diff --git a/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js b/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js index f470f599..dbf8fcbd 100644 --- a/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js +++ b/static/libs/iclient-mapboxgl/iclient-mapboxgl.min.js @@ -5,6 +5,6 @@ * license: Apache-2.0 * version: v11.3.0-dev * -*/!function(){var e={304:function(e,t,r){"use strict";var n=r(2651),o=r(5045),i=r(3174);e.exports={XMLParser:o,XMLValidator:n,XMLBuilder:i}},6392:function(e,t){"use strict";var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n="["+r+"][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",o=new RegExp("^"+n+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,r){if(t)for(var n=Object.keys(t),o=n.length,i=0;i5&&"xml"===n)return y("InvalidXml","XML declaration allowed only at the start of the document.",m(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){var r=1;for(t+=8;t"===e[t]&&0===--r)break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},o,t);var r,u=[],l=!1,f=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(var d=0;d"!==e[d]&&" "!==e[d]&&"\t"!==e[d]&&"\n"!==e[d]&&"\r"!==e[d];d++)g+=e[d];if("/"===(g=g.trim())[g.length-1]&&(g=g.substring(0,g.length-1),d--),r=g,!n.isName(r)){return y("InvalidTag",0===g.trim().length?"Invalid space after '<'.":"Tag '"+g+"' is an invalid name.",m(e,d))}var w=c(e,d);if(!1===w)return y("InvalidAttr","Attributes for '"+g+"' have open quote.",m(e,d));var S=w.value;if(d=w.index,"/"===S[S.length-1]){var O=d-S.length,_=p(S=S.substring(0,S.length-1),t);if(!0!==_)return y(_.err.code,_.err.msg,m(e,O+_.err.line));l=!0}else if(b){if(!w.tagClosed)return y("InvalidTag","Closing tag '"+g+"' doesn't have proper closing.",m(e,d));if(S.trim().length>0)return y("InvalidTag","Closing tag '"+g+"' can't have attributes or invalid starting.",m(e,v));if(0===u.length)return y("InvalidTag","Closing tag '"+g+"' has not been opened.",m(e,v));var x=u.pop();if(g!==x.tagName){var P=m(e,x.tagStartPos);return y("InvalidTag","Expected closing tag '"+x.tagName+"' (opened in line "+P.line+", col "+P.col+") instead of closing tag '"+g+"'.",m(e,v))}0==u.length&&(f=!0)}else{var k=p(S,t);if(!0!==k)return y(k.err.code,k.err.msg,m(e,d-S.length+k.err.line));if(!0===f)return y("InvalidXml","Multiple possible root nodes found.",m(e,d));-1!==t.unpairedTags.indexOf(g)||u.push({tagName:g,tagStartPos:v}),l=!0}for(d++;d0)||y("InvalidXml","Invalid '"+JSON.stringify(u.map(function(e){return e.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):y("InvalidXml","Start tag expected.",1)};var u='"',l="'";function c(e,t){for(var r="",n="",o=!1;t"===e[t]&&""===n){o=!0;break}r+=e[t]}return""===n&&{value:r,index:t,tagClosed:o}}var f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(e,t){for(var r=n.getAllMatches(e,f),o={},i=0;i","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(e){this.options=Object.assign({},a,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=u,this.options.format?(this.indentate=l,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function u(e,t,r){var n=this.j2x(e,r+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}function l(e){return this.options.indentBy.repeat(e)}function c(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}s.prototype.build=function(e){return this.options.preserveOrder?i(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e=o({},this.options.arrayNodeName,e)),this.j2x(e,0).val)},s.prototype.j2x=function(e,t){var r="",o="";for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i))if(void 0===e[i])this.isAttribute(i)&&(o+="");else if(null===e[i])this.isAttribute(i)?o+="":"?"===i[0]?o+=this.indentate(t)+"<"+i+"?"+this.tagEndChar:o+=this.indentate(t)+"<"+i+"/"+this.tagEndChar;else if(e[i]instanceof Date)o+=this.buildTextValNode(e[i],i,"",t);else if("object"!==n(e[i])){var a=this.isAttribute(i);if(a)r+=this.buildAttrPairStr(a,""+e[i]);else if(i===this.options.textNodeName){var s=this.options.tagValueProcessor(i,""+e[i]);o+=this.replaceEntitiesValue(s)}else o+=this.buildTextValNode(e[i],i,"",t)}else if(Array.isArray(e[i])){for(var u=e[i].length,l="",c=0;c"+e+o},s.prototype.closeTag=function(e){var t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":">")+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(e,"--\x3e")+this.newLine;if("?"===t[0])return this.indentate(n)+"<"+t+r+"?"+this.tagEndChar;var o=this.options.tagValueProcessor(t,e);return""===(o=this.replaceEntitiesValue(o))?this.indentate(n)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+r+">"+o+"0&&this.options.processEntities)for(var t=0;t0&&t.processEntities)for(var r=0;r0&&(s=t),function e(t,a,s,u){for(var l="",c=!1,f=0;f":l+=v+"/>":b&&0!==b.length||!a.suppressEmptyNode?b&&b.endsWith(">")?l+=v+">".concat(b).concat(u,""):(l+=v+">",b&&""!==u&&(b.includes("/>")||b.includes("")):l+=v+"/>",c=!0}else{var g=n(p[":@"],a),w="?xml"===h?"":u,S=p[h][0][a.textNodeName];S=0!==S.length?" "+S:"",l+=w+"<".concat(h).concat(S).concat(g,"?>"),c=!0}else l+=u+"\x3c!--".concat(p[h][0][a.textNodeName],"--\x3e"),c=!0;else c&&(l+=u),l+=""),c=!1;else{var O=p[h];o(y,a)||(O=i(O=a.tagValueProcessor(h,O),a)),c&&(l+=u),l+=O,c=!1}}}return l}(e,a,"",s)}},3214:function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r"===e[t]){if(h?"-"===e[t-1]&&"-"===e[t-2]&&(h=!1,o--):o--,0===o)break}else"["===e[t]?i=!0:e[t];else{if(i&&u(e,t)){var y=n(a(e,(t+=7)+1),3);entityName=y[0],val=y[1],t=y[2],-1===val.indexOf("&")&&(r[p(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(i&&l(e,t))t+=8;else if(i&&c(e,t))t+=8;else if(i&&f(e,t))t+=9;else{if(!s)throw new Error("Invalid DOCTYPE");h=!0}o++}if(0!==o)throw new Error("Unclosed DOCTYPE");return{entities:r,i:t}}},3070:function(e,t){var r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e}};t.buildOptions=function(e){return Object.assign({},r,e)},t.defaultOptions=r},2246:function(e,t,r){"use strict";function n(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var r=0;r"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(e,t){return String.fromCharCode(Number.parseInt(t,10))}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(e,t){return String.fromCharCode(Number.parseInt(t,16))}}},this.addExternalEntities=p,this.parseXml=v,this.parseTextData=h,this.resolveNameSpace=y,this.buildAttributesMap=m,this.isItStopNode=S,this.replaceEntitiesValue=g,this.readStopNodeData=x,this.saveTextToParentTag=w,this.addChild=b});function p(e){for(var t=Object.keys(e),r=0;r0)){s||(e=this.replaceEntitiesValue(e));var u=this.options.tagValueProcessor(t,e,r,i,a);return null===u||void 0===u?e:o(u)!==o(e)||u!==e?u:this.options.trimValues?P(e,this.options.parseTagValue,this.options.numberParseOptions):e.trim()===e?P(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function y(e){if(this.options.removeNSPrefix){var t=e.split(":"),r="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=r+t[1])}return e}var d=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function m(e,t,r){if(!this.options.ignoreAttributes&&"string"==typeof e){for(var n=s.getAllMatches(e,d),i=n.length,a={},u=0;u",a,"Closing Tag is not closed."),c=e.substring(a+2,s).trim();if(this.options.removeNSPrefix){var f=c.indexOf(":");-1!==f&&(c=c.substr(f+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&(o=this.saveTextToParentTag(o,r,i));var p=i.substring(i.lastIndexOf(".")+1);if(c&&-1!==this.options.unpairedTags.indexOf(c))throw new Error("Unpaired tag can not be used as closing tag: "));var h=0;p&&-1!==this.options.unpairedTags.indexOf(p)?(h=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=i.lastIndexOf("."),i=i.substring(0,h),r=this.tagsNodeStack.pop(),o="",a=s}else if("?"===e[a+1]){var y=_(e,a,!1,"?>");if(!y)throw new Error("Pi Tag is not closed.");if(o=this.saveTextToParentTag(o,r,i),this.options.ignoreDeclaration&&"?xml"===y.tagName||this.options.ignorePiTags);else{var d=new u(y.tagName);d.add(this.options.textNodeName,""),y.tagName!==y.tagExp&&y.attrExpPresent&&(d[":@"]=this.buildAttributesMap(y.tagExp,i,y.tagName)),this.addChild(r,d,i)}a=y.closeIndex+1}else if("!--"===e.substr(a+1,3)){var m=O(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var v=e.substring(a+4,m-2);o=this.saveTextToParentTag(o,r,i),r.add(this.options.commentPropName,[n({},this.options.textNodeName,v)])}a=m}else if("!D"===e.substr(a+1,2)){var b=l(e,a);this.docTypeEntities=b.entities,a=b.i}else if("!["===e.substr(a+1,2)){var g=O(e,"]]>",a,"CDATA is not closed.")-2,w=e.substring(a+9,g);o=this.saveTextToParentTag(o,r,i);var S=this.parseTextData(w,r.tagname,i,!0,!1,!0,!0);void 0==S&&(S=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[n({},this.options.textNodeName,w)]):r.add(this.options.textNodeName,S),a=g+2}else{var x=_(e,a,this.options.removeNSPrefix),P=x.tagName,k=x.rawTagName,E=x.tagExp,j=x.attrExpPresent,T=x.closeIndex;this.options.transformTagName&&(P=this.options.transformTagName(P)),r&&o&&"!xml"!==r.tagname&&(o=this.saveTextToParentTag(o,r,i,!1));var C=r;if(C&&-1!==this.options.unpairedTags.indexOf(C.tagname)&&(r=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),P!==t.tagname&&(i+=i?"."+P:P),this.isItStopNode(this.options.stopNodes,i,P)){var A="";if(E.length>0&&E.lastIndexOf("/")===E.length-1)"/"===P[P.length-1]?(P=P.substr(0,P.length-1),i=i.substr(0,i.length-1),E=P):E=E.substr(0,E.length-1),a=x.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(P))a=x.closeIndex;else{var I=this.readStopNodeData(e,k,T+1);if(!I)throw new Error("Unexpected end of ".concat(k));a=I.i,A=I.tagContent}var L=new u(P);P!==E&&j&&(L[":@"]=this.buildAttributesMap(E,i,P)),A&&(A=this.parseTextData(A,P,i,!0,j,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),L.add(this.options.textNodeName,A),this.addChild(r,L,i)}else{if(E.length>0&&E.lastIndexOf("/")===E.length-1){"/"===P[P.length-1]?(P=P.substr(0,P.length-1),i=i.substr(0,i.length-1),E=P):E=E.substr(0,E.length-1),this.options.transformTagName&&(P=this.options.transformTagName(P));var N=new u(P);P!==E&&j&&(N[":@"]=this.buildAttributesMap(E,i,P)),this.addChild(r,N,i),i=i.substr(0,i.lastIndexOf("."))}else{var M=new u(P);this.tagsNodeStack.push(r),P!==E&&j&&(M[":@"]=this.buildAttributesMap(E,i,P)),this.addChild(r,M,i),r=M}o="",a=T}}else o+=e[a]}return t.child};function b(e,t,r){var n=this.options.updateTag(t.tagname,r,t[":@"]);!1===n||("string"==typeof n?(t.tagname=n,e.addChild(t)):e.addChild(t))}var g=function(e){if(this.options.processEntities){for(var t in this.docTypeEntities){var r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(var n in this.lastEntities){var o=this.lastEntities[n];e=e.replace(o.regex,o.val)}if(this.options.htmlEntities)for(var i in this.htmlEntities){var a=this.htmlEntities[i];e=e.replace(a.regex,a.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function w(e,t,r,n){return e&&(void 0===n&&(n=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,r,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,n))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function S(e,t,r){var n="*."+r;for(var o in e){var i=e[o];if(n===i||t===i)return!0}return!1}function O(e,t,r,n){var o=e.indexOf(t,r);if(-1===o)throw new Error(n);return o+t.length-1}function _(e,t,r){var n=function(e,t){for(var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",o="",i=t;i3&&void 0!==arguments[3]?arguments[3]:">");if(n){var o=n.data,i=n.index,a=o.search(/\s/),s=o,u=!0;-1!==a&&(s=o.substring(0,a),o=o.substring(a+1).trimStart());var l=s;if(r){var c=s.indexOf(":");-1!==c&&(u=(s=s.substr(c+1))!==n.data.substr(c+1))}return{tagName:s,tagExp:o,closeIndex:i,attrExpPresent:u,rawTagName:l}}}function x(e,t,r){for(var n=r,o=1;r",r,"".concat(t," is not closed"));if(e.substring(r+2,i).trim()===t&&0===--o)return{tagContent:e.substring(n,r),i:i};r=i}else if("?"===e[r+1]){r=O(e,"?>",r+1,"StopNode is not closed.")}else if("!--"===e.substr(r+1,3)){r=O(e,"--\x3e",r+3,"StopNode is not closed.")}else if("!["===e.substr(r+1,2)){r=O(e,"]]>",r,"StopNode is not closed.")-2}else{var a=_(e,r,">");if(a)(a&&a.tagName)===t&&"/"!==a.tagExp[a.tagExp.length-1]&&o++,r=a.closeIndex}}function P(e,t,r){if(t&&"string"==typeof e){var n=e.trim();return"true"===n||"false"!==n&&c(e,r)}return s.isExist(e)?e:""}e.exports=f},5045:function(e,t,r){function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var r=0;r0&&(u[i.textNodeName]=s):void 0!==s&&(u[i.textNodeName]=s),u}(e,t)}},4670:function(e){"use strict";function t(e){"@babel/helpers - typeof";return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t,r){return(t=o(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){for(var r=0;r0?this.child.push(r(r({},e.tagname,e.child),":@",e[":@"])):this.child.push(r({},e.tagname,e.child))}}])&&n(e.prototype,t),o&&n(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,o}();e.exports=i},1358:function(e){!function(t){"use strict";if(t.__disableNativeFetch||!t.fetch){s.prototype.append=function(e,t){e=i(e),t=a(t);var r=this.map[e];r||(r=[],this.map[e]=r),r.push(t)},s.prototype.delete=function(e){delete this.map[i(e)]},s.prototype.get=function(e){var t=this.map[i(e)];return t?t[0]:null},s.prototype.getAll=function(e){return this.map[i(e)]||[]},s.prototype.has=function(e){return this.map.hasOwnProperty(i(e))},s.prototype.set=function(e,t){this.map[i(e)]=[a(t)]},s.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(n){e.call(t,n,r,this)},this)},this)};var r={blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t},n=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this)},f.call(p.prototype),f.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var o=[301,302,303,307,308];y.redirect=function(e,t){if(-1===o.indexOf(t))throw new RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},t.Headers=s,t.Request=p,t.Response=y,t.fetch=function(e,t){return new Promise(function(n,o){var i;i=p.prototype.isPrototypeOf(e)&&!t?e:new p(e,t);var a=new XMLHttpRequest;var u=!1;function l(){if(4===a.readyState){var e=1223===a.status?204:a.status;if(e<100||e>599){if(u)return;return u=!0,void o(new TypeError("Network request failed"))}var t={status:e,statusText:a.statusText,headers:function(e){var t=new s;return e.getAllResponseHeaders().trim().split("\n").forEach(function(e){var r=e.trim().split(":"),n=r.shift().trim(),o=r.join(":").trim();t.append(n,o)}),t}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},r="response"in a?a.response:a.responseText;u||(u=!0,n(new y(r,t)))}}a.onreadystatechange=l,a.onload=l,a.onerror=function(){u||(u=!0,o(new TypeError("Network request failed")))},a.open(i.method,i.url,!0);try{"include"===i.credentials&&("withCredentials"in a?a.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(e){console&&console.warn&&console.warn("set withCredentials error:"+e)}"responseType"in a&&r.blob&&(a.responseType="blob"),i.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send(void 0===i._bodyInit?null:i._bodyInit)})},t.fetch.polyfill=!0,e.exports&&(e.exports=t.fetch)}function i(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function s(e){this.map={},e instanceof s?e.forEach(function(e,t){this.append(t,e)},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function l(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function c(e){var t=new FileReader;return t.readAsArrayBuffer(e),l(t)}function f(){return this.bodyUsed=!1,this._initBody=function(e,t){if(this._bodyInit=e,"string"==typeof e)this._bodyText=e;else if(r.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e,this._options=t;else if(r.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(e){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(c)},this.text=function(){var e,t,r,n,o,i,a,s=u(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,t=this._options,r=new FileReader,n=t.headers.map["content-type"]?t.headers.map["content-type"].toString():"",o=/charset\=[0-9a-zA-Z\-\_]*;?/,i=e.type.match(o)||n.match(o),a=[e],i&&a.push(i[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,a),l(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var e=u(this);return e||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function p(e,t){var r,o,i=(t=t||{}).body;if(p.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new s(e.headers)),this.method=e.method,this.mode=e.mode,i||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new s(t.headers)),this.method=(r=t.method||this.method||"GET",o=r.toUpperCase(),n.indexOf(o)>-1?o:r),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i,t)}function h(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}}),t}function y(e,t){t||(t={}),this._initBody(e,t),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof s?t.headers:new s(t.headers),this.url=t.url||""}}("undefined"!=typeof self?self:this)},3678:function(e,t){var r,n,o;n=[t,e],void 0===(o="function"==typeof(r=function(e,t){"use strict";var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function n(e){try{delete window[e]}catch(t){window[e]=void 0}}function o(e){var t=document.getElementById(e);t&&document.getElementsByTagName("head")[0].removeChild(t)}t.exports=function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=e,a=t.timeout||r.timeout,s=t.jsonpCallback||r.jsonpCallback,u=void 0;return new Promise(function(r,l){var c=t.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),f=s+"_"+c;window[c]=function(e){r({ok:!0,json:function(){return Promise.resolve(e)}}),u&&clearTimeout(u),o(f),n(c)},i+=-1===i.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+i+s+"="+c),t.charset&&p.setAttribute("charset",t.charset),p.id=f,document.getElementsByTagName("head")[0].appendChild(p),u=setTimeout(function(){l(new Error("JSONP request to "+e+" timed out")),n(c),o(f),window[c]=function(){n(c)}},a),p.onerror=function(){l(new Error("JSONP request to "+e+" failed")),n(c),o(f),u&&clearTimeout(u)}})}})?r.apply(t,n):r)||(e.exports=o)},3448:function(e){var t=[],r=[],n="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function o(e,o){if(o=o||{},void 0===e)throw new Error(n);var i,a=!0===o.prepend?"prepend":"append",s=void 0!==o.container?o.container:document.querySelector("head"),u=t.indexOf(s);return-1===u&&(u=t.push(s)-1,r[u]={}),void 0!==r[u]&&void 0!==r[u][a]?i=r[u][a]:(i=r[u][a]=function(){var e=document.createElement("style");return e.setAttribute("type","text/css"),e}(),"prepend"===a?s.insertBefore(i,s.childNodes[0]):s.appendChild(i)),65279===e.charCodeAt(0)&&(e=e.substr(1,e.length)),i.styleSheet?i.styleSheet.cssText+=e:i.textContent+=e,i}e.exports=o,e.exports.insertCss=o},5611:function(e,t,r){function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e=r.nmd(e);var o=200,i="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Boolean]",l="[object Date]",c="[object Function]",f="[object GeneratorFunction]",p="[object Map]",h="[object Number]",y="[object Object]",d="[object RegExp]",m="[object Set]",v="[object String]",b="[object Symbol]",g="[object ArrayBuffer]",w="[object DataView]",S="[object Float32Array]",O="[object Float64Array]",_="[object Int8Array]",x="[object Int16Array]",P="[object Int32Array]",k="[object Uint8Array]",E="[object Uint8ClampedArray]",j="[object Uint16Array]",T="[object Uint32Array]",C=/\w*$/,A=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,L={};L[s]=L["[object Array]"]=L[g]=L[w]=L[u]=L[l]=L[S]=L[O]=L[_]=L[x]=L[P]=L[p]=L[h]=L[y]=L[d]=L[m]=L[v]=L[b]=L[k]=L[E]=L[j]=L[T]=!0,L["[object Error]"]=L[c]=L["[object WeakMap]"]=!1;var N="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,M="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,R=N||M||Function("return this")(),D="object"==n(t)&&t&&!t.nodeType&&t,B=D&&"object"==n(e)&&e&&!e.nodeType&&e,F=B&&B.exports===D;function U(e,t){return e.set(t[0],t[1]),e}function G(e,t){return e.add(t),e}function z(e,t,r,n){var o=-1,i=e?e.length:0;for(n&&i&&(r=e[++o]);++o-1},Ee.prototype.set=function(e,t){var r=this.__data__,n=Ie(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},je.prototype.clear=function(){this.__data__={hash:new ke,map:new(ye||Ee),string:new ke}},je.prototype.delete=function(e){return De(this,e).delete(e)},je.prototype.get=function(e){return De(this,e).get(e)},je.prototype.has=function(e){return De(this,e).has(e)},je.prototype.set=function(e,t){return De(this,e).set(e,t),this},Te.prototype.clear=function(){this.__data__=new Ee},Te.prototype.delete=function(e){return this.__data__.delete(e)},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ee){var n=r.__data__;if(!ye||n.length-1&&e%1==0&&e-1&&e%1==0&&e<=a}(e.length)&&!Ke(e)}var Je=fe||function(){return!1};function Ke(e){var t=Ye(e)?te.call(e):"";return t==c||t==f}function Ye(e){var t=n(e);return!!e&&("object"==t||"function"==t)}function Qe(e){return We(e)?Ce(e):function(e){if(!ze(e))return pe(e);var t=[];for(var r in Object(e))ee.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return Le(e,!0,!0)}},1855:function(e,t,r){function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o="Expected a function",i=NaN,a="[object Symbol]",s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,p="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,y=p||h||Function("return this")(),d=Object.prototype.toString,m=Math.max,v=Math.min,b=function(){return y.Date.now()};function g(e){var t=n(e);return!!e&&("object"==t||"function"==t)}function w(e){return"symbol"==n(e)||function(e){return!!e&&"object"==n(e)}(e)&&d.call(e)==a}function S(e){if("number"==typeof e)return e;if(w(e))return i;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var r=l.test(e);return r||c.test(e)?f(e.slice(2),r?2:8):u.test(e)?i:+e}e.exports=function(e,t,r){var n,i,a,s,u,l,c=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new TypeError(o);function y(t){var r=n,o=i;return n=i=void 0,c=t,s=e.apply(o,r)}function d(e){var r=e-l;return void 0===l||r>=t||r<0||p&&e-c>=a}function w(){var e=b();if(d(e))return O(e);u=setTimeout(w,function(e){var r=t-(e-l);return p?v(r,a-(e-c)):r}(e))}function O(e){return u=void 0,h&&n?y(e):(n=i=void 0,s)}function _(){var e=b(),r=d(e);if(n=arguments,i=this,l=e,r){if(void 0===u)return function(e){return c=e,u=setTimeout(w,t),f?y(e):s}(l);if(p)return u=setTimeout(w,t),y(l)}return void 0===u&&(u=setTimeout(w,t)),s}return t=S(t)||0,g(r)&&(f=!!r.leading,a=(p="maxWait"in r)?m(S(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h),_.cancel=function(){void 0!==u&&clearTimeout(u),c=0,n=l=i=u=void 0},_.flush=function(){return void 0===u?s:O(b())},_}},311:function(e,t,r){function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=200,i="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Function]",l="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,f="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,h=f||p||Function("return this")();function y(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,n){var o=e.length,i=r+(n?1:-1);for(;n?i--:++i-1}function d(e,t,r){for(var n=-1,o=e?e.length:0;++n=o&&(s=b,u=!1,t=new F(t));e:for(;++a-1},D.prototype.set=function(e,t){var r=this.__data__,n=U(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},B.prototype.clear=function(){this.__data__={hash:new R,map:new(N||D),string:new R}},B.prototype.delete=function(e){return V(this,e).delete(e)},B.prototype.get=function(e){return V(this,e).get(e)},B.prototype.has=function(e){return V(this,e).has(e)},B.prototype.set=function(e,t){return V(this,e).set(e,t),this},F.prototype.add=F.prototype.push=function(e){return this.__data__.set(e,i),this},F.prototype.has=function(e){return this.__data__.has(e)};var W,J,K=(W=function(e,t){return X(e)?G(e,function e(t,r,n,o,i){var a=-1,s=t.length;for(n||(n=H),i||(i=[]);++a0&&n(u)?r>1?e(u,r-1,n,o,i):m(i,u):o||(i[i.length]=u)}return i}(t,1,X,!0)):[]},J=L(void 0===J?W.length-1:J,0),function(){for(var e=arguments,t=-1,r=L(e.length-J,0),n=Array(r);++t-1&&e%1==0&&e<=a}(e.length)&&!Z(e)}function X(e){return function(e){return!!e&&"object"==n(e)}(e)&&Q(e)}function Z(e){var t=$(e)?E.call(e):"";return t==u||t==l}function $(e){var t=n(e);return!!e&&("object"==t||"function"==t)}e.exports=K},8676:function(e,t,r){function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o="Expected a function",i=NaN,a="[object Symbol]",s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,p="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,y=p||h||Function("return this")(),d=Object.prototype.toString,m=Math.max,v=Math.min,b=function(){return y.Date.now()};function g(e,t,r){var n,i,a,s,u,l,c=0,f=!1,p=!1,h=!0;if("function"!=typeof e)throw new TypeError(o);function y(t){var r=n,o=i;return n=i=void 0,c=t,s=e.apply(o,r)}function d(e){var r=e-l;return void 0===l||r>=t||r<0||p&&e-c>=a}function g(){var e=b();if(d(e))return S(e);u=setTimeout(g,function(e){var r=t-(e-l);return p?v(r,a-(e-c)):r}(e))}function S(e){return u=void 0,h&&n?y(e):(n=i=void 0,s)}function _(){var e=b(),r=d(e);if(n=arguments,i=this,l=e,r){if(void 0===u)return function(e){return c=e,u=setTimeout(g,t),f?y(e):s}(l);if(p)return u=setTimeout(g,t),y(l)}return void 0===u&&(u=setTimeout(g,t)),s}return t=O(t)||0,w(r)&&(f=!!r.leading,a=(p="maxWait"in r)?m(O(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h),_.cancel=function(){void 0!==u&&clearTimeout(u),c=0,n=l=i=u=void 0},_.flush=function(){return void 0===u?s:S(b())},_}function w(e){var t=n(e);return!!e&&("object"==t||"function"==t)}function S(e){return"symbol"==n(e)||function(e){return!!e&&"object"==n(e)}(e)&&d.call(e)==a}function O(e){if("number"==typeof e)return e;if(S(e))return i;if(w(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=w(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var r=l.test(e);return r||c.test(e)?f(e.slice(2),r?2:8):u.test(e)?i:+e}e.exports=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError(o);return w(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),g(e,t,{leading:n,maxWait:t,trailing:i})}},8518:function(e,t,r){function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=9007199254740991,i="[object Arguments]",a="[object Function]",s="[object GeneratorFunction]",u="[object Map]",l="[object Set]",c=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,p="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,y=p||h||Function("return this")();function d(e,t){return function(e,t){for(var r=-1,n=e?e.length:0,o=Array(n);++r-1&&e%1==0&&e-1&&e%1==0&&e<=o}(e.length)&&!K(e)}function K(e){var t=Y(e)?P.call(e):"";return t==a||t==s}function Y(e){var t=n(e);return!!e&&("object"==t||"function"==t)}var Q,X=(Q=function(e){return J(e)?F(e):G(e)},function(e){var t,r,n,o=V(e);return o==u?(t=e,r=-1,n=Array(t.size),t.forEach(function(e,t){n[++r]=[t,e]}),n):o==l?function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=[e,e]}),r}(e):d(e,Q(e))});e.exports=X},44:function(e,t,r){function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e=r.nmd(e);var o=200,i="Expected a function",a="__lodash_hash_undefined__",s=1,u=2,l=1/0,c=9007199254740991,f="[object Arguments]",p="[object Array]",h="[object Boolean]",y="[object Date]",d="[object Error]",m="[object Function]",v="[object GeneratorFunction]",b="[object Map]",g="[object Number]",w="[object Object]",S="[object RegExp]",O="[object Set]",_="[object String]",x="[object Symbol]",P="[object ArrayBuffer]",k="[object DataView]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/,T=/^\./,C=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,A=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,N={};N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N[f]=N[p]=N[P]=N[h]=N[k]=N[y]=N[d]=N[m]=N[b]=N[g]=N[w]=N[S]=N[O]=N[_]=N["[object WeakMap]"]=!1;var M="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,R="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,D=M||R||Function("return this")(),B="object"==n(t)&&t&&!t.nodeType&&t,F=B&&"object"==n(e)&&e&&!e.nodeType&&e,U=F&&F.exports===B&&M.process,G=function(){try{return U&&U.binding("util")}catch(e){}}(),z=G&&G.isTypedArray;function V(e,t){return!!(e?e.length:0)&&function(e,t,r){if(t!=t)return function(e,t,r,n){var o=e.length,i=r+(n?1:-1);for(;n?i--:++i-1}function q(e,t,r){for(var n=-1,o=e?e.length:0;++n-1},Te.prototype.set=function(e,t){var r=this.__data__,n=Ne(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Ce.prototype.clear=function(){this.__data__={hash:new je,map:new(de||Te),string:new je}},Ce.prototype.delete=function(e){return qe(this,e).delete(e)},Ce.prototype.get=function(e){return qe(this,e).get(e)},Ce.prototype.has=function(e){return qe(this,e).has(e)},Ce.prototype.set=function(e,t){return qe(this,e).set(e,t),this},Ae.prototype.add=Ae.prototype.push=function(e){return this.__data__.set(e,a),this},Ae.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.clear=function(){this.__data__=new Te},Ie.prototype.delete=function(e){return this.__data__.delete(e)},Ie.prototype.get=function(e){return this.__data__.get(e)},Ie.prototype.has=function(e){return this.__data__.has(e)},Ie.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Te){var n=r.__data__;if(!de||n.lengthl))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var p=-1,h=!0,y=o&s?new Ae:void 0;for(i.set(e,t),i.set(t,e);++p-1&&e%1==0&&e-1&&e%1==0&&e<=c}function st(e){var t=n(e);return!!e&&("object"==t||"function"==t)}function ut(e){return!!e&&"object"==n(e)}function lt(e){return"symbol"==n(e)||ut(e)&&se.call(e)==x}var ct=z?function(e){return function(t){return e(t)}}(z):function(e){return ut(e)&&at(e.length)&&!!N[se.call(e)]};function ft(e){return ot(e)?Le(e):Ue(e)}function pt(e){return e}e.exports=function(e,t){return e&&e.length?function(e,t,r){var n=-1,i=V,a=e.length,s=!0,u=[],l=u;if(r)s=!1,i=q;else if(a>=o){var c=t?null:ze(e);if(c)return Q(c);s=!1,i=J,l=new Ae}else l=t?[]:u;e:for(;++n15?(r=Date.now(),a(e)):(t.push(e),1===t.length&&o.setAttribute("a",n=!n))}}i.nextTick=i.setImmediate}(),i.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,i.globalScope=i.isNodejs?t:"undefined"==typeof self?window:self,i.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},i.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},i.isArrayBufferView=function(e){return e&&i.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},i.ByteBuffer=u,i.ByteStringBuffer=u,i.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},i.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},i.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},i.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},i.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},i.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},i.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(i.encodeUtf8(e))},i.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},i.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},i.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},i.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},i.ByteStringBuffer.prototype.putInt=function(e,t){a(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},i.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},i.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},i.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},i.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},i.ByteStringBuffer.prototype.copy=function(){var e=i.createBuffer(this.data);return e.read=this.read,e},i.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},i.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},i.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},i.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},i.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},i.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},i.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},i.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},i.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},i.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},i.DataBuffer.prototype.putInt=function(e,t){a(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},i.DataBuffer.prototype.putSignedInt=function(e,t){return a(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},i.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},i.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},i.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},i.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},i.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},i.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},i.DataBuffer.prototype.copy=function(){return new i.DataBuffer(this)},i.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},i.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},i.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},i.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},i.xorBytes=function(e,t,r){for(var n="",o="",i="",a=0,s=0;r>0;--r,++a)o=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(n+=i,i="",s=0),i+=String.fromCharCode(o),++s;return n+i},i.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";i.encode64=function(e,t){for(var r,n,o,i="",a="",s=0;s>2),i+=l.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=l.charAt((15&n)<<2|o>>6),i+=isNaN(o)?"=":l.charAt(63&o)),t&&i.length>t&&(a+=i.substr(0,t)+"\r\n",i=i.substr(t));return a+i},i.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,o,i="",a=0;a>4),64!==n&&(i+=String.fromCharCode((15&r)<<4|n>>2),64!==o&&(i+=String.fromCharCode((3&n)<<6|o)));return i},i.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},i.decodeUtf8=function(e){return decodeURIComponent(escape(e))},i.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:o.encode,decode:o.decode}},i.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},i.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var o=r=r||0,i=0;i>2),i+=l.charAt((3&r)<<4|n>>4),isNaN(n)?i+="==":(i+=l.charAt((15&n)<<2|o>>6),i+=isNaN(o)?"=":l.charAt(63&o)),t&&i.length>t&&(a+=i.substr(0,t)+"\r\n",i=i.substr(t));return a+i},i.binary.base64.decode=function(e,t,r){var n,o,i,a,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==i&&(s[l++]=(15&o)<<4|i>>2,64!==a&&(s[l++]=(3&i)<<6|a));return t?l-r:s.subarray(0,l)},i.binary.base58.encode=function(e,t){return i.binary.baseN.encode(e,f,t)},i.binary.base58.decode=function(e,t){return i.binary.baseN.decode(e,f,t)},i.text={utf8:{},utf16:{}},i.text.utf8.encode=function(e,t,r){e=i.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var o=r=r||0,a=0;a0&&i.push(r),a=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":o");break;case"%":i.push("%");break;default:i.push("<%"+s+"?>")}}return i.push(e.substring(a)),i.join("")},i.formatNumber=function(e,t,r,n){var o=e,i=isNaN(t=Math.abs(t))?2:t,a=void 0===r?",":r,s=void 0===n?".":n,u=o<0?"-":"",l=parseInt(o=Math.abs(+o||0).toFixed(i),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(i?a+Math.abs(o-l).toFixed(i).slice(2):"")},i.formatSize=function(e){return e>=1073741824?i.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?i.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?i.formatNumber(e/1024,0)+" KiB":i.formatNumber(e,0)+" bytes"},i.bytesFromIP=function(e){return-1!==e.indexOf(".")?i.bytesFromIPv4(e):-1!==e.indexOf(":")?i.bytesFromIPv6(e):null},i.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=i.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(a)}if(r.length>0){var l=r[n];l.end-l.start>0&&(t.splice(l.start,l.end-l.start+1,""),0===l.start&&t.unshift(""),7===l.end&&t.push(""))}return t.join(":")},i.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in i&&!e.update)return t(null,i.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return i.cores=navigator.hardwareConcurrency,t(null,i.cores);if("undefined"==typeof Worker)return i.cores=1,t(null,i.cores);if("undefined"==typeof Blob)return i.cores=2,t(null,i.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&o.sto.st&&s.stt){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}o.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},o.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},o.create=function(e,t,r,i,a){if(n.util.isArray(i)){for(var s=[],u=0;ur){if(a.strict){var y=new Error("Too few bytes to read ASN.1 value.");throw y.available=t.length(),y.remaining=r,y.requested=h,y}h=r}var d=32==(32&u);if(d)if(f=[],void 0===h)for(;;){if(i(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}s=t.length(),f.push(e(t,r,n+1,a)),r-=s-t.length()}else for(;h>0;)s=t.length(),f.push(e(t,h,n+1,a)),r-=s-t.length(),h-=s-t.length();if(void 0===f&&l===o.Class.UNIVERSAL&&c===o.Type.BITSTRING&&(p=t.bytes(h)),void 0===f&&a.decodeBitStrings&&l===o.Class.UNIVERSAL&&c===o.Type.BITSTRING&&h>1){var m=t.read,v=r,b=0;if(c===o.Type.BITSTRING&&(i(t,r,1),b=t.getByte(),r--),0===b)try{s=t.length();var g=e(t,r,n+1,{strict:!0,decodeBitStrings:!0}),w=s-t.length();r-=w,c==o.Type.BITSTRING&&w++;var S=g.tagClass;w!==h||S!==o.Class.UNIVERSAL&&S!==o.Class.CONTEXT_SPECIFIC||(f=[g])}catch(e){}void 0===f&&(t.read=m,r=v)}if(void 0===f){if(void 0===h){if(a.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=r}if(c===o.Type.BMPSTRING)for(f="";h>0;h-=2)i(t,r,2),f+=String.fromCharCode(t.getInt16()),r-=2;else f=t.getBytes(h),r-=h}var O=void 0===p?null:{bitStringContents:p};return o.create(l,c,d,f,O)}(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=r,s.remaining=e.length(),s}return a},o.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,i=n.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=o.equals(e,e.original))),a)i.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:i.putByte(0);for(var s=0;s1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?i.putBytes(e.value.substr(1)):i.putBytes(e.value);if(t.putByte(r),i.length()<=127)t.putByte(127&i.length());else{var u=i.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(t.putByte(128|l.length),s=l.length-1;s>=0;--s)t.putByte(l.charCodeAt(s))}return t.putBuffer(i),t},o.oidToDer=function(e){var t,r,o,i,a=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u>>=7,t||(i|=128),r.push(i),t=!1}while(o>0);for(var l=r.length-1;l>=0;--l)s.putByte(r[l])}return s},o.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var o=0;e.length()>0;)o<<=7,128&(r=e.getByte())?o+=127&r:(t+="."+(o+r),o=0);return t},o.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,o=parseInt(e.substr(4,2),10),i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(r,n,o),t.setUTCHours(i,a,s,0),l&&("+"===(u=e.charAt(l))||"-"===u)){var c=60*parseInt(e.substr(l+1,2),10)+parseInt(e.substr(l+4,2),10);c*=6e4,"+"===u?t.setTime(+t-c):t.setTime(+t+c)}return t},o.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,o=parseInt(e.substr(6,2),10),i=parseInt(e.substr(8,2),10),a=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,l=0,c=!1;"Z"===e.charAt(e.length-1)&&(c=!0);var f=e.length-5,p=e.charAt(f);return"+"!==p&&"-"!==p||(l=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),l*=6e4,"+"===p&&(l*=-1),c=!0),"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),c?(t.setUTCFullYear(r,n,o),t.setUTCHours(i,a,s,u),t.setTime(+t+l)):(t.setFullYear(r,n,o),t.setHours(i,a,s,u)),t},o.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},o.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},o.validate=function(e,t,r,i){var a=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)i&&(e.tagClass!==t.tagClass&&i.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&i.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(a=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;a&&u0&&(i+="\n");for(var s="",u=0;u1?i+="0x"+n.util.bytesToHex(e.value.slice(1)):i+="(none)",e.value.length>0){var p=e.value.charCodeAt(0);1==p?i+=" (1 unused bit shown)":p>1&&(i+=" ("+p+" unused bits shown)")}}else if(e.type===o.Type.OCTETSTRING)a.test(e.value)||(i+="("+e.value+") "),i+="0x"+n.util.bytesToHex(e.value);else if(e.type===o.Type.UTF8)try{i+=n.util.decodeUtf8(e.value)}catch(t){if("URI malformed"!==t.message)throw t;i+="0x"+n.util.bytesToHex(e.value)+" (malformed UTF8)"}else e.type===o.Type.PRINTABLESTRING||e.type===o.Type.IA5String?i+=e.value:a.test(e.value)?i+="0x"+n.util.bytesToHex(e.value):0===e.value.length?i+="[null]":i+=e.value}return i}},function(e,t,r){var n=r(0);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(e,t,r){var n=r(0);function o(e,t){n.cipher.registerAlgorithm(e,function(){return new n.aes.Algorithm(e,t)})}r(13),r(19),r(1),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var o=y({key:e,output:r,decrypt:!1,mode:n});return o.start(t),o},n.aes.createEncryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var o=y({key:e,output:r,decrypt:!0,mode:n});return o.start(t),o},n.aes.createDecryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){c||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return h(r._w,e,t,!1)},decrypt:function(e,t){return h(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var o=0;o>>=2,o=0;o>8^255&f^99,i[d]=f,a[f]=d,h=(p=e[f])<<24^f<<16^f<<8^f^p,y=((r=e[d])^(n=e[r])^(o=e[n]))<<24^(d^o)<<16^(d^n^o)<<8^d^r^o;for(var v=0;v<4;++v)u[v][d]=h,l[v][f]=y,h=h<<24|h>>>8,y=y<<24|y>>>8;0===d?d=m=1:(d=r^e[e[e[r^o]]],m^=e[e[m]])}}function p(e,t){for(var r,n=e.slice(0),o=1,a=n.length,u=4*(a+6+1),c=a;c>>16&255]<<24^i[r>>>8&255]<<16^i[255&r]<<8^i[r>>>24]^s[o]<<24,o++):a>6&&c%a==4&&(r=i[r>>>24]<<24^i[r>>>16&255]<<16^i[r>>>8&255]<<8^i[255&r]),n[c]=n[c-a]^r;if(t){for(var f,p=l[0],h=l[1],y=l[2],d=l[3],m=n.slice(0),v=(c=0,(u=n.length)-4);c>>24]]^h[i[f>>>16&255]]^y[i[f>>>8&255]]^d[i[255&f]];n=m}return n}function h(e,t,r,n){var o,s,c,f,p,h,y,d,m,v,b,g,w=e.length/4-1;n?(o=l[0],s=l[1],c=l[2],f=l[3],p=a):(o=u[0],s=u[1],c=u[2],f=u[3],p=i),h=t[0]^e[0],y=t[n?3:1]^e[1],d=t[2]^e[2],m=t[n?1:3]^e[3];for(var S=3,O=1;O>>24]^s[y>>>16&255]^c[d>>>8&255]^f[255&m]^e[++S],b=o[y>>>24]^s[d>>>16&255]^c[m>>>8&255]^f[255&h]^e[++S],g=o[d>>>24]^s[m>>>16&255]^c[h>>>8&255]^f[255&y]^e[++S],m=o[m>>>24]^s[h>>>16&255]^c[y>>>8&255]^f[255&d]^e[++S],h=v,y=b,d=g;r[0]=p[h>>>24]<<24^p[y>>>16&255]<<16^p[d>>>8&255]<<8^p[255&m]^e[++S],r[n?3:1]=p[y>>>24]<<24^p[d>>>16&255]<<16^p[m>>>8&255]<<8^p[255&h]^e[++S],r[2]=p[d>>>24]<<24^p[m>>>16&255]<<16^p[h>>>8&255]<<8^p[255&y]^e[++S],r[n?1:3]=p[m>>>24]<<24^p[h>>>16&255]<<16^p[y>>>8&255]<<8^p[255&d]^e[++S]}function y(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),o=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,o.call(t,r)},t}},function(e,t,r){var n=r(0);n.pki=n.pki||{};var o=e.exports=n.pki.oids=n.oids=n.oids||{};function i(e,t){o[e]=t,o[t]=e}function a(e,t){o[e]=t}i("1.2.840.113549.1.1.1","rsaEncryption"),i("1.2.840.113549.1.1.4","md5WithRSAEncryption"),i("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),i("1.2.840.113549.1.1.7","RSAES-OAEP"),i("1.2.840.113549.1.1.8","mgf1"),i("1.2.840.113549.1.1.9","pSpecified"),i("1.2.840.113549.1.1.10","RSASSA-PSS"),i("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),i("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),i("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),i("1.3.101.112","EdDSA25519"),i("1.2.840.10040.4.3","dsa-with-sha1"),i("1.3.14.3.2.7","desCBC"),i("1.3.14.3.2.26","sha1"),i("1.3.14.3.2.29","sha1WithRSASignature"),i("2.16.840.1.101.3.4.2.1","sha256"),i("2.16.840.1.101.3.4.2.2","sha384"),i("2.16.840.1.101.3.4.2.3","sha512"),i("2.16.840.1.101.3.4.2.4","sha224"),i("2.16.840.1.101.3.4.2.5","sha512-224"),i("2.16.840.1.101.3.4.2.6","sha512-256"),i("1.2.840.113549.2.2","md2"),i("1.2.840.113549.2.5","md5"),i("1.2.840.113549.1.7.1","data"),i("1.2.840.113549.1.7.2","signedData"),i("1.2.840.113549.1.7.3","envelopedData"),i("1.2.840.113549.1.7.4","signedAndEnvelopedData"),i("1.2.840.113549.1.7.5","digestedData"),i("1.2.840.113549.1.7.6","encryptedData"),i("1.2.840.113549.1.9.1","emailAddress"),i("1.2.840.113549.1.9.2","unstructuredName"),i("1.2.840.113549.1.9.3","contentType"),i("1.2.840.113549.1.9.4","messageDigest"),i("1.2.840.113549.1.9.5","signingTime"),i("1.2.840.113549.1.9.6","counterSignature"),i("1.2.840.113549.1.9.7","challengePassword"),i("1.2.840.113549.1.9.8","unstructuredAddress"),i("1.2.840.113549.1.9.14","extensionRequest"),i("1.2.840.113549.1.9.20","friendlyName"),i("1.2.840.113549.1.9.21","localKeyId"),i("1.2.840.113549.1.9.22.1","x509Certificate"),i("1.2.840.113549.1.12.10.1.1","keyBag"),i("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),i("1.2.840.113549.1.12.10.1.3","certBag"),i("1.2.840.113549.1.12.10.1.4","crlBag"),i("1.2.840.113549.1.12.10.1.5","secretBag"),i("1.2.840.113549.1.12.10.1.6","safeContentsBag"),i("1.2.840.113549.1.5.13","pkcs5PBES2"),i("1.2.840.113549.1.5.12","pkcs5PBKDF2"),i("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),i("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),i("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),i("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),i("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),i("1.2.840.113549.2.7","hmacWithSHA1"),i("1.2.840.113549.2.8","hmacWithSHA224"),i("1.2.840.113549.2.9","hmacWithSHA256"),i("1.2.840.113549.2.10","hmacWithSHA384"),i("1.2.840.113549.2.11","hmacWithSHA512"),i("1.2.840.113549.3.7","des-EDE3-CBC"),i("2.16.840.1.101.3.4.1.2","aes128-CBC"),i("2.16.840.1.101.3.4.1.22","aes192-CBC"),i("2.16.840.1.101.3.4.1.42","aes256-CBC"),i("2.5.4.3","commonName"),i("2.5.4.4","surname"),i("2.5.4.5","serialNumber"),i("2.5.4.6","countryName"),i("2.5.4.7","localityName"),i("2.5.4.8","stateOrProvinceName"),i("2.5.4.9","streetAddress"),i("2.5.4.10","organizationName"),i("2.5.4.11","organizationalUnitName"),i("2.5.4.12","title"),i("2.5.4.13","description"),i("2.5.4.15","businessCategory"),i("2.5.4.17","postalCode"),i("2.5.4.42","givenName"),i("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),i("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),i("2.16.840.1.113730.1.1","nsCertType"),i("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),i("2.5.29.14","subjectKeyIdentifier"),i("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),i("2.5.29.17","subjectAltName"),i("2.5.29.18","issuerAltName"),i("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),i("2.5.29.31","cRLDistributionPoints"),i("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),i("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),i("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),i("1.3.6.1.4.1.11129.2.4.2","timestampList"),i("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),i("1.3.6.1.5.5.7.3.1","serverAuth"),i("1.3.6.1.5.5.7.3.2","clientAuth"),i("1.3.6.1.5.5.7.3.3","codeSigning"),i("1.3.6.1.5.5.7.3.4","emailProtection"),i("1.3.6.1.5.5.7.3.8","timeStamping")},function(e,t,r){var n=r(0);r(1);var o=e.exports=n.pem=n.pem||{};function i(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},o=0;o65&&-1!==a){var s=t[a];","===s?(++a,t=t.substr(0,a)+"\r\n "+t.substr(a)):t=t.substr(0,a)+"\r\n"+s+t.substr(a+1),i=o-a-1,a=-1,++o}else" "!==t[o]&&"\t"!==t[o]&&","!==t[o]||(a=o);return t}function a(e){return e.replace(/^\s+/,"")}o.encode=function(e,t){t=t||{};var r,o="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(o+=i(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(o+=i(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),o+=i(r)),e.headers)for(var a=0;at.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=n.util.createBuffer(),o=n.util.createBuffer(),l=a.length(),u=0;u>>0,u>>>0];for(var l=o.fullMessageLength.length-1;l>=0;--l)o.fullMessageLength[l]+=u[1],u[1]=u[0]+(o.fullMessageLength[l]/4294967296>>>0),o.fullMessageLength[l]=o.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(i),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),o},o.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var u,l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;a.putBytes(i.substr(0,o.blockLength-l));for(var c=8*o.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=u>>>0;a.putInt32(c);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(p,r,a);var h=n.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h},o};var i=null,a=!1;function s(e,t,r){for(var n,o,i,a,s,u,l,c=r.length();c>=64;){for(o=e.h0,i=e.h1,a=e.h2,s=e.h3,u=e.h4,l=0;l<16;++l)n=r.getInt32(),t[l]=n,n=(o<<5|o>>>27)+(s^i&(a^s))+u+1518500249+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<20;++l)n=(n=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|n>>>31,t[l]=n,n=(o<<5|o>>>27)+(s^i&(a^s))+u+1518500249+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<32;++l)n=(n=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|n>>>31,t[l]=n,n=(o<<5|o>>>27)+(i^a^s)+u+1859775393+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<40;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(o<<5|o>>>27)+(i^a^s)+u+1859775393+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<60;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(o<<5|o>>>27)+(i&a|s&(i^a))+u+2400959708+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;for(;l<80;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(o<<5|o>>>27)+(i^a^s)+u+3395469782+n,u=s,s=a,a=(i<<30|i>>>2)>>>0,i=o,o=n;e.h0=e.h0+o|0,e.h1=e.h1+i|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,c-=64}}},function(e,t,r){var n=r(0);function o(e,t){n.cipher.registerAlgorithm(e,function(){return new n.des.Algorithm(e,t)})}r(13),r(19),r(1),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var o=y({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return o.start(t),o},n.des.createEncryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var o=y({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return o.start(t),o},n.des.createDecryptionCipher=function(e,t){return y({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return h(r._keys,e,t,!1)},decrypt:function(e,t){return h(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],o=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],i=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],p=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],h=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],d=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],m=e.length()>8?3:1,v=[],b=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],g=0,w=0;w>>4^O))<<4,S^=t=65535&((O^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(O^=t<<-16)))<<2,S^=t=65535&((O^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(O^=t<<-16)))<<1,S^=t=16711935&((O^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(O^=t<<8)))<<1)<<8|(O^=t)>>>20&240,S=O<<24|O<<8&16711680|O>>>8&65280|O>>>24&240,O=t;for(var _=0;_>>26,O=O<<2|O>>>26):(S=S<<1|S>>>27,O=O<<1|O>>>27);var x=r[(S&=-15)>>>28]|n[S>>>24&15]|o[S>>>20&15]|i[S>>>16&15]|a[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],P=l[(O&=-15)>>>28]|c[O>>>24&15]|f[O>>>20&15]|p[O>>>16&15]|h[O>>>12&15]|y[O>>>8&15]|d[O>>>4&15];t=65535&(P>>>16^x),v[g++]=x^t,v[g++]=P^t<<16}}return v}(t),this._init=!0}},o("DES-ECB",n.cipher.modes.ecb),o("DES-CBC",n.cipher.modes.cbc),o("DES-CFB",n.cipher.modes.cfb),o("DES-OFB",n.cipher.modes.ofb),o("DES-CTR",n.cipher.modes.ctr),o("3DES-ECB",n.cipher.modes.ecb),o("3DES-CBC",n.cipher.modes.cbc),o("3DES-CFB",n.cipher.modes.cfb),o("3DES-OFB",n.cipher.modes.ofb),o("3DES-CTR",n.cipher.modes.ctr);var i=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],l=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],c=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],p=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function h(e,t,r,n){var o,h,y=32===e.length?3:9;o=3===y?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var d=t[0],m=t[1];d^=(h=252645135&(d>>>4^m))<<4,d^=(h=65535&(d>>>16^(m^=h)))<<16,d^=h=858993459&((m^=h)>>>2^d),d^=h=16711935&((m^=h<<2)>>>8^d),d=(d^=(h=1431655765&(d>>>1^(m^=h<<8)))<<1)<<1|d>>>31,m=(m^=h)<<1|m>>>31;for(var v=0;v>>4|m<<28)^e[w+1];h=d,d=m,m=h^(a[S>>>24&63]|u[S>>>16&63]|c[S>>>8&63]|p[63&S]|i[O>>>24&63]|s[O>>>16&63]|l[O>>>8&63]|f[63&O])}h=d,d=m,m=h}m=m>>>1|m<<31,m^=h=1431655765&((d=d>>>1|d<<31)>>>1^m),m^=(h=16711935&(m>>>8^(d^=h<<1)))<<8,m^=(h=858993459&(m>>>2^(d^=h)))<<2,m^=h=65535&((d^=h)>>>16^m),m^=h=252645135&((d^=h<<16)>>>4^m),d^=h<<4,r[0]=d,r[1]=m}function y(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),o=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var i=null;r instanceof n.util.ByteBuffer&&(i=r,r={}),(r=r||{}).output=i,r.iv=e,o.call(t,r)},t}},function(e,t,r){var n=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===o)var o=n.jsbn.BigInteger;var i=n.util.isNodejs?r(16):null,a=n.asn1,u=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var l=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},p={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},y=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d={name:"DigestInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},m=function(e){var t;if(!(e.algorithm in l.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=l.oids[e.algorithm];var n=a.oidToDer(t).getBytes(),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);i.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),i.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e.digest().getBytes());return o.value.push(i),o.value.push(s),a.toDer(o).getBytes()},v=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var i;t.dP||(t.dP=t.d.mod(t.p.subtract(o.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(o.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{i=new o(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(i.compareTo(t.n)>=0||!i.gcd(t.n).equals(o.ONE));for(var a=(e=e.multiply(i.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(s)<0;)a=a.add(t.p);var u=a.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u.multiply(i.modInverse(t.n)).mod(t.n)};function b(e,t,r){var o=n.util.createBuffer(),i=Math.ceil(t.n.bitLength()/8);if(e.length>i-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=i-11,a}o.putByte(0),o.putByte(r);var s,u=i-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var l=0;l0;){var c=0,f=n.random.getBytes(u);for(l=0;l1;){if(255!==a.getByte()){--a.read;break}++l}else if(2===u)for(l=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++l}if(0!==a.getByte()||l!==i-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function w(e,t,r){"function"==typeof t&&(r=t,t={});var i={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function a(){s(e.pBits,function(t,n){return t?r(t):(e.p=n,null!==e.q?u(t,e.q):void s(e.qBits,u))})}function s(e,t){n.prime.generateProbablePrime(e,i,t)}function u(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var i=e.p;e.p=e.q,e.q=i}if(0!==e.p.subtract(o.ONE).gcd(e.e).compareTo(o.ONE))return e.p=null,void a();if(0!==e.q.subtract(o.ONE).gcd(e.e).compareTo(o.ONE))return e.q=null,void s(e.qBits,u);if(e.p1=e.p.subtract(o.ONE),e.q1=e.q.subtract(o.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(o.ONE))return e.p=e.q=null,void a();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,u);var c=e.e.modInverse(e.phi);e.keys={privateKey:l.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:l.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(i.prng=t.prng),a()}function S(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function O(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function _(e){return n.util.isNodejs&&"function"==typeof i[e]}function x(e){return void 0!==u.globalScope&&"object"==s(u.globalScope.crypto)&&"object"==s(u.globalScope.crypto.subtle)&&"function"==typeof u.globalScope.crypto.subtle[e]}function P(e){return void 0!==u.globalScope&&"object"==s(u.globalScope.msCrypto)&&"object"==s(u.globalScope.msCrypto.subtle)&&"function"==typeof u.globalScope.msCrypto.subtle[e]}function k(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),o=0;o0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),c.getBytes()},l.rsa.decrypt=function(e,t,r,i){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=a,s}var u=new o(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=v(u,t,r).toString(16),c=n.util.createBuffer(),f=a-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),!1!==i?g(c.getBytes(),t,r):c.getBytes()},l.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var i,a=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(i.eInt),i},l.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new o(null);r.fromInt(30);for(var n,i=0,a=function(e,t){return e|t},s=+new Date,u=0;null===e.keys&&(t<=0||uf?e.pqState=0:e.num.isProbablePrime(O(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[i++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(o.ONE).gcd(e.e).compareTo(o.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(o.ONE),e.q1=e.q.subtract(o.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(o.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var h=e.e.modInverse(e.phi);e.keys={privateKey:l.rsa.setPrivateKey(e.n,e.e,h,e.p,e.q,h.mod(e.p1),h.mod(e.q1),e.q.modInverse(e.p)),publicKey:l.rsa.setPublicKey(e.n,e.e)}}u+=(n=+new Date)-s,s=n}return null!==e.keys},l.rsa.generateKeyPair=function(e,t,r,o){if(1===arguments.length?"object"==s(e)?(r=e,e=void 0):"function"==typeof e&&(o=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(o=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,o=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(o=r,r=void 0):(o=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(o){if(_("generateKeyPair"))return i.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(e,t,r){if(e)return o(e);o(null,{privateKey:l.privateKeyFromPem(r),publicKey:l.publicKeyFromPem(t)})});if(x("generateKey")&&x("exportKey"))return u.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:k(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(e){return u.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)}).then(void 0,function(e){o(e)}).then(function(e){if(e){var t=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));o(null,{privateKey:t,publicKey:l.setRsaPublicKey(t.n,t.e)})}});if(P("generateKey")&&P("exportKey")){var c=u.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:k(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=u.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));o(null,{privateKey:r,publicKey:l.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){o(e)}},void(c.onerror=function(e){o(e)})}}else if(_("generateKeyPairSync")){var f=i.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:l.privateKeyFromPem(f.privateKey),publicKey:l.publicKeyFromPem(f.publicKey)}}var p=l.rsa.createKeyPairGenerationState(e,t,r);if(!o)return l.rsa.stepKeyPairGenerationState(p,0),p.keys;w(p,r,o)},l.setRsaPublicKey=l.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,o){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return b(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,o)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var i=t.encode(e,r,!0);return l.rsa.encrypt(i,r,!0)},verify:function(e,t,o,i){"string"==typeof o?o=o.toUpperCase():void 0===o&&(o="RSASSA-PKCS1-V1_5"),void 0===i&&(i={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in i||(i._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===o?o={verify:function(e,t){t=g(t,r,!0);var o=a.fromDer(t,{parseAllBytes:i._parseAllDigestBytes}),s={},u=[];if(!a.validate(o,d,s,u))throw(l=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,l;var l,c=a.derToOid(s.algorithmIdentifier);if(c!==n.oids.md2&&c!==n.oids.md5&&c!==n.oids.sha1&&c!==n.oids.sha224&&c!==n.oids.sha256&&c!==n.oids.sha384&&c!==n.oids.sha512&&c!==n.oids["sha512-224"]&&c!==n.oids["sha512-256"])throw(l=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=c,l;if(!(c!==n.oids.md2&&c!==n.oids.md5||"parameters"in s))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return e===s.digest}}:"NONE"!==o&&"NULL"!==o&&null!==o||(o={verify:function(e,t){return e===g(t,r,!0)}});var s=l.rsa.decrypt(t,r,!0,!1);return o.verify(e,s,r.n.bitLength())}};return r},l.setRsaPrivateKey=l.rsa.setPrivateKey=function(e,t,r,o,i,a,s,u){var c={n:e,e:t,d:r,p:o,q:i,dP:a,dQ:s,qInv:u,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var o=l.rsa.decrypt(e,c,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:g};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(o,c,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:m},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,c.n.bitLength());return l.rsa.encrypt(n,c,r)}};return c},l.wrapRsaPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(e).getBytes())])},l.privateKeyFromAsn1=function(e){var t,r,i,s,u,c,h,y,d={},m=[];if(a.validate(e,f,d,m)&&(e=a.fromDer(n.util.createBuffer(d.privateKey))),d={},m=[],!a.validate(e,p,d,m)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=m,v}return t=n.util.createBuffer(d.privateKeyModulus).toHex(),r=n.util.createBuffer(d.privateKeyPublicExponent).toHex(),i=n.util.createBuffer(d.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(d.privateKeyPrime1).toHex(),u=n.util.createBuffer(d.privateKeyPrime2).toHex(),c=n.util.createBuffer(d.privateKeyExponent1).toHex(),h=n.util.createBuffer(d.privateKeyExponent2).toHex(),y=n.util.createBuffer(d.privateKeyCoefficient).toHex(),l.setRsaPrivateKey(new o(t,16),new o(r,16),new o(i,16),new o(s,16),new o(u,16),new o(c,16),new o(h,16),new o(y,16))},l.privateKeyToAsn1=l.privateKeyToRSAPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.qInv))])},l.publicKeyFromAsn1=function(e){var t={},r=[];if(a.validate(e,y,t,r)){var i,s=a.derToOid(t.publicKeyOid);if(s!==l.oids.rsaEncryption)throw(i=new Error("Cannot read public key. Unknown OID.")).oid=s,i;e=t.rsaPublicKey}if(r=[],!a.validate(e,h,t,r))throw(i=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,i;var u=n.util.createBuffer(t.publicKeyModulus).toHex(),c=n.util.createBuffer(t.publicKeyExponent).toHex();return l.setRsaPublicKey(new o(u,16),new o(c,16))},l.publicKeyToAsn1=l.publicKeyToSubjectPublicKeyInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[l.publicKeyToRSAPublicKey(e)])])},l.publicKeyToRSAPublicKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,S(e.e))])}},function(e,t,r){var n,o=r(0);function i(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function a(){return new i(null)}function s(e,t,r,n,o,i){for(var a=16383&t,s=t>>14;--i>=0;){var u=16383&this.data[e],l=this.data[e++]>>14,c=s*u+l*a;o=((u=a*u+((16383&c)<<14)+r.data[n]+o)>>28)+(c>>14)+s*l,r.data[n++]=268435455&u}return o}e.exports=o.jsbn=o.jsbn||{},o.jsbn.BigInteger=i,"undefined"==typeof navigator?(i.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(i.prototype.am=function(e,t,r,n,o,i){for(var a=32767&t,s=t>>15;--i>=0;){var u=32767&this.data[e],l=this.data[e++]>>15,c=s*u+l*a;o=((u=a*u+((32767&c)<<15)+r.data[n]+(1073741823&o))>>>30)+(c>>>15)+s*l+(o>>>30),r.data[n++]=1073741823&u}return o},n=30):"Netscape"!=navigator.appName?(i.prototype.am=function(e,t,r,n,o,i){for(;--i>=0;){var a=t*this.data[e++]+r.data[n]+o;o=Math.floor(a/67108864),r.data[n++]=67108863&a}return o},n=26):(i.prototype.am=s,n=28),i.prototype.DB=n,i.prototype.DM=(1<>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function d(e){this.m=e}function m(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function O(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function _(){}function x(e){return e}function P(e){this.r2=a(),this.q3=a(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}d.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},d.prototype.revert=function(e){return e},d.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},d.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},d.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},m.prototype.convert=function(e){var t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},m.prototype.revert=function(e){var t=a();return e.copyTo(t),this.reduce(t),t},m.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},m.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},m.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},i.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,o=!1,a=0;--n>=0;){var s=8==r?255&e[n]:p(e,n);s<0?"-"==e.charAt(n)&&(o=!0):(o=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-a):this.data[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+a+1]=this.data[r]>>o|s,s=(this.data[r]&i)<=0;--r)t.data[r]=0;t.data[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,i=(1<>n;for(var a=r+1;a>n;n>0&&(t.data[this.t-r-1]|=(this.s&i)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),o=r.t;for(t.t=o+n.t;--o>=0;)t.data[o]=0;for(o=0;o=0;)e.data[r]=0;for(r=0;r=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t0?(n.lShiftTo(c,s),o.lShiftTo(c,r)):(n.copyTo(s),o.copyTo(r));var f=s.t,p=s.data[f-1];if(0!=p){var h=p*(1<1?s.data[f-2]>>this.F2:0),d=this.FV/h,m=(1<=0&&(r.data[r.t++]=1,r.subTo(w,r)),i.ONE.dlShiftTo(f,w),w.subTo(s,s);s.t=0;){var S=r.data[--b]==p?this.DM:Math.floor(r.data[b]*d+(r.data[b-1]+v)*m);if((r.data[b]+=s.am(0,S,r,g,0,f))0&&r.rShiftTo(c,r),u<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=a(),n=a(),o=t.convert(this),s=y(e)-1;for(o.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,o,r);else{var u=r;r=n,n=u}return t.revert(r)},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<0)for(s>s)>0&&(o=!0,i=f(r));a>=0;)s>(s+=this.DB-t)):(r=this.data[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(o=!0),o&&(i+=f(r));return o?i:"0"},i.prototype.negate=function(){var e=a();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+y(this.data[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=a();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new d(t):new m(t),this.exp(e,r)},i.ZERO=h(0),i.ONE=h(1),_.prototype.convert=x,_.prototype.revert=x,_.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},_.prototype.sqrTo=function(e,t){e.squareTo(t)},P.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=a();return e.copyTo(t),this.reduce(t),t},P.prototype.revert=function(e){return e},P.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},P.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},P.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var k=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],E=(1<<26)/k[k.length-1];i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=h(r),o=a(),i=a(),s="";for(this.divRemTo(n,o,i);o.signum()>0;)s=(r+i.intValue()).toString(e).substr(1)+s,o.divRemTo(n,o,i);return i.intValue().toString(e)+s},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,a=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),o&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var n=new Array,o=7&e;n.length=1+(e>>3),t.nextBytes(n),o>0?n[0]&=(1<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var n,o=Math.min(this.t+e.t,t);for(r.s=0,r.t=o;o>0;)r.data[--o]=0;for(n=r.t-this.t;o=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,o=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t=0);var u=n.modPow(o,this);if(0!=u.compareTo(i.ONE)&&0!=u.compareTo(t)){for(var l=1;l++>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,o=0;if(e-- >0)for(n>n)!=(this.s&this.DM)>>n&&(t[o++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(t[o++]=r);return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=a();return this.bitwiseTo(e,v,t),t},i.prototype.or=function(e){var t=a();return this.bitwiseTo(e,b,t),t},i.prototype.xor=function(e){var t=a();return this.bitwiseTo(e,g,t),t},i.prototype.andNot=function(e){var t=a();return this.bitwiseTo(e,w,t),t},i.prototype.not=function(){for(var e=a(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var f=a();for(n.sqrTo(s[1],f);u<=c;)s[u]=a(),n.mulTo(f,s[u-2],s[u]),u+=2}var p,v,b=e.t-1,g=!0,w=a();for(o=y(e.data[b])-1;b>=0;){for(o>=l?p=e.data[b]>>o-l&c:(p=(e.data[b]&(1<0&&(p|=e.data[b-1]>>this.DB+o-l)),u=r;0==(1&p);)p>>=1,--u;if((o-=u)<0&&(o+=this.DB,--b),g)s[p].copyTo(i),g=!1;else{for(;u>1;)n.sqrTo(i,w),n.sqrTo(w,i),u-=2;u>0?n.sqrTo(i,w):(v=i,i=w,w=v),n.mulTo(w,s[p],i)}for(;b>=0&&0==(e.data[b]&1<=0?(r.subTo(n,r),t&&o.subTo(s,o),a.subTo(u,a)):(n.subTo(r,n),t&&s.subTo(o,s),u.subTo(a,u))}return 0!=n.compareTo(i.ONE)?i.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},i.prototype.pow=function(e){return this.exp(e,new _)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),i=r.getLowestSetBit();if(i<0)return t;for(o0&&(t.rShiftTo(i,t),r.rShiftTo(i,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return i>0&&r.lShiftTo(i,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=k[k.length-1]){for(t=0;t>>0,s>>>0];for(var u=o.fullMessageLength.length-1;u>=0;--u)o.fullMessageLength[u]+=s[1],s[1]=s[0]+(o.fullMessageLength[u]/4294967296>>>0),o.fullMessageLength[u]=o.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(i),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),o},o.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;a.putBytes(i.substr(0,o.blockLength-s));for(var u,l=0,f=o.fullMessageLength.length-1;f>=0;--f)l=(u=8*o.fullMessageLength[f]+l)/4294967296>>>0,a.putInt32Le(u>>>0);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};c(p,r,a);var h=n.util.createBuffer();return h.putInt32Le(p.h0),h.putInt32Le(p.h1),h.putInt32Le(p.h2),h.putInt32Le(p.h3),h},o};var i=null,a=null,s=null,u=null,l=!1;function c(e,t,r){for(var n,o,i,l,c,f,p,h=r.length();h>=64;){for(o=e.h0,i=e.h1,l=e.h2,c=e.h3,p=0;p<16;++p)t[p]=r.getInt32Le(),n=o+(c^i&(l^c))+u[p]+t[p],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;for(;p<32;++p)n=o+(l^c&(i^l))+u[p]+t[a[p]],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;for(;p<48;++p)n=o+(i^l^c)+u[p]+t[a[p]],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;for(;p<64;++p)n=o+(l^(i|~c))+u[p]+t[a[p]],o=c,c=l,l=i,i+=n<<(f=s[p])|n>>>32-f;e.h0=e.h0+o|0,e.h1=e.h1+i|0,e.h2=e.h2+l|0,e.h3=e.h3+c|0,h-=64}}},function(e,t,r){var n=r(0);r(8),r(4),r(1);var o,i=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(o=r(16)),e.exports=n.pbkdf2=i.pbkdf2=function(e,t,r,i,a,u){if("function"==typeof a&&(u=a,a=null),n.util.isNodejs&&!n.options.usePureJavaScript&&o.pbkdf2&&(null===a||"object"!=s(a))&&(o.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),u?4===o.pbkdf2Sync.length?o.pbkdf2(e,t,r,i,function(e,t){if(e)return u(e);u(null,t.toString("binary"))}):o.pbkdf2(e,t,r,i,a,function(e,t){if(e)return u(e);u(null,t.toString("binary"))}):4===o.pbkdf2Sync.length?o.pbkdf2Sync(e,t,r,i).toString("binary"):o.pbkdf2Sync(e,t,r,i,a).toString("binary");if(null==a&&(a="sha1"),"string"==typeof a){if(!(a in n.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=n.md[a].create()}var l=a.digestLength;if(i>4294967295*l){var c=new Error("Derived key is too long.");if(u)return u(c);throw c}var f=Math.ceil(i/l),p=i-(f-1)*l,h=n.hmac.create();h.start(a,e);var y,d,m,v="";if(!u){for(var b=1;b<=f;++b){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(b)),y=m=h.digest().getBytes();for(var g=2;g<=r;++g)h.start(null,null),h.update(m),d=h.digest().getBytes(),y=n.util.xorBytes(y,d,l),m=d;v+=bf)return u(null,v);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(b)),y=m=h.digest().getBytes(),g=2,S()}function S(){if(g<=r)return h.start(null,null),h.update(m),d=h.digest().getBytes(),y=n.util.xorBytes(y,d,l),m=d,++g,n.util.setImmediate(S);v+=b128)throw new Error('Invalid "nsComment" content.');e.value=o.create(o.Class.UNIVERSAL,o.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var h=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=h.toHex(),e.value=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,h.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){if(e.value=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),c=e.value.value,e.keyIdentifier){var y=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;c.push(o.create(o.Class.CONTEXT_SPECIFIC,0,!1,y))}if(e.authorityCertIssuer){var d=[o.create(o.Class.CONTEXT_SPECIFIC,4,!0,[b(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];c.push(o.create(o.Class.CONTEXT_SPECIFIC,1,!0,d))}if(e.serialNumber){var m=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);c.push(o.create(o.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),c=e.value.value;var v,g=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),w=o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[]);for(p=0;p2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){u.md=m({signatureOid:u.signatureOid,type:"certificate"});var p=o.toDer(u.tbsCertificate);u.md.update(p.getBytes())}var h=n.md.sha1.create(),v=o.toDer(r.certIssuer);h.update(v.getBytes()),u.issuer.getField=function(e){return y(u.issuer,e)},u.issuer.addField=function(e){g([e]),u.issuer.attributes.push(e)},u.issuer.attributes=i.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=h.digest().toHex();var b=n.md.sha1.create(),w=o.toDer(r.certSubject);return b.update(w.getBytes()),u.subject.getField=function(e){return y(u.subject,e)},u.subject.addField=function(e){g([e]),u.subject.attributes.push(e)},u.subject.attributes=i.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=b.digest().toHex(),r.certExtensions?u.extensions=i.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=i.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},i.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=u.value.charCodeAt(1),i=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&i)}else if("basicConstraints"===t.name){(u=o.fromDer(t.value)).value.length>0&&u.value[0].type===o.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===o.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=o.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=o.fromDer(t.value),l=0;l1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r);else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[],u=o.fromDer(t.value);for(var p=0;p=O&&e<_?o.create(o.Class.UNIVERSAL,o.Type.UTCTIME,!1,o.dateToUtcTime(e)):o.create(o.Class.UNIVERSAL,o.Type.GENERALIZEDTIME,!1,o.dateToGeneralizedTime(e))}i.getTBSCertificate=function(e){var t=x(e.validity.notBefore),r=x(e.validity.notAfter),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(e.version).getBytes())]),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(e.siginfo.algorithmOid).getBytes()),S(e.siginfo.algorithmOid,e.siginfo.parameters)]),b(e.issuer),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[t,r]),b(e.subject),i.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&a.value.push(o.create(o.Class.CONTEXT_SPECIFIC,1,!0,[o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&a.value.push(o.create(o.Class.CONTEXT_SPECIFIC,2,!0,[o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&a.value.push(i.certificateExtensionsToAsn1(e.extensions)),a},i.getCertificationRequestInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(e.version).getBytes()),b(e.subject),i.publicKeyToAsn1(e.publicKey),function(e){var t=o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,i=0;if.validity.notAfter)&&(l={message:"Certificate is not valid yet or has expired.",error:i.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===l){if(null===(p=t[0]||e.getIssuer(f))&&f.isIssuer(f)&&(h=!0,p=f),p){var y=p;n.util.isArray(y)||(y=[y]);for(var d=!1;!d&&y.length>0;){p=y.shift();try{d=p.verify(f)}catch(e){}}d||(l={message:"Certificate signature is invalid.",error:i.certificateError.bad_certificate})}null!==l||p&&!h||e.hasCertificate(f)||(l={message:"Certificate is not trusted.",error:i.certificateError.unknown_ca})}if(null===l&&p&&!f.isIssuer(p)&&(l={message:"Certificate issuer is invalid.",error:i.certificateError.bad_certificate}),null===l)for(var m={keyUsage:!0,basicConstraints:!0},v=0;null===l&&vg.pathLenConstraint&&(l={message:"Certificate basicConstraints pathLenConstraint violated.",error:i.certificateError.bad_certificate})}var S=null===l||l.error,O=r.verify?r.verify(S,c,o):S;if(!0!==O)throw!0===S&&(l={message:"The application rejected the certificate.",error:i.certificateError.bad_certificate}),(O||0===O)&&("object"!=s(O)||n.util.isArray(O)?"string"==typeof O&&(l.error=O):(O.message&&(l.message=O.message),O.error&&(l.error=O.error))),l;l=null,u=!1,++c}while(t.length>0);return!0}},function(e,t,r){var n=r(0);r(2),r(1),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,o=e.mgf,i=r.digestLength,a=e.salt||null;if("string"==typeof a&&(a=n.util.createBuffer(a)),"saltLength"in e)t=e.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");t=a.length()}if(null!==a&&a.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random;return{encode:function(e,u){var l,c,f=u-1,p=Math.ceil(f/8),h=e.digest().getBytes();if(p>8*p-f&255;return(w=String.fromCharCode(w.charCodeAt(0)&~S)+w.substr(1))+d+String.fromCharCode(188)},verify:function(e,a,s){var u,l=s-1,c=Math.ceil(l/8);if(a=a.substr(-c),c>8*c-l&255;if(0!=(p.charCodeAt(0)&y))throw new Error("Bits beyond keysize not zero as expected.");var d=o.generate(h,f),m="";for(u=0;u4){var r=e;e=n.util.createBuffer();for(var o=0;o0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},o.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},o.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},o.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2||(e.truncate(n),0))},o.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},o.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0)e.read-=this.blockSize;else for(o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0)e.read-=this.blockSize;else for(o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},o.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0)e.read-=this.blockSize;else for(o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},o.ofb.prototype.decrypt=o.ofb.prototype.encrypt,o.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},o.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=i(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},o.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},o.ctr.prototype.decrypt=o.ctr.prototype.encrypt,o.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},o.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var o=r.length();if(12===o)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*o)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var i=t.length()%this.blockSize;for(i&&t.fillWithByte(0,this.blockSize-i),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},o.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var o=0;o0&&(i=this.blockSize-i),this._partialOutput.clear(),o=0;o0&&this._partialOutput.getBytes(this._partialBytes),i>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(i-this._partialBytes)),this._partialBytes=i,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},o.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var o=0;o0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},o.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,o=this._m[r][n];t[0]^=o[0],t[1]^=o[1],t[2]^=o[2],t[3]^=o[3]}return t},o.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},o.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,o=16*r,i=new Array(o),a=0;a>>1,o=new Array(r);o[n]=e.slice(0);for(var i=n>>>1;i>0;)this.pow(o[2*i],o[i]=[]),i>>=1;for(i=2;i>1,s=a+(1&e.length),u=e.substr(0,s),l=e.substr(a,s),c=n.util.createBuffer(),f=n.hmac.create();r=t+r;var p=Math.ceil(o/16),h=Math.ceil(o/20);f.start("MD5",u);var y=n.util.createBuffer();c.putBytes(r);for(var d=0;d0&&(c.queue(e,c.createAlert(e,{level:c.Alert.Level.warning,description:c.Alert.Description.no_renegotiation})),c.flush(e)),e.process()},c.parseHelloMessage=function(e,t,r){var o=null,i=e.entity===c.ConnectionEnd.client;if(r<38)e.error(e,{message:i?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});else{var a=t.fragment,s=a.length();if(o={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:u(a,1),extensions:[]},i?(o.cipher_suite=a.getBytes(2),o.compression_method=a.getByte()):(o.cipher_suites=u(a,2),o.compression_methods=u(a,1)),(s=r-(s-a.length()))>0){for(var l=u(a,2);l.length()>0;)o.extensions.push({type:[l.getByte(),l.getByte()],data:u(l,2)});if(!i)for(var f=0;f0&&0===h.getByte();)e.session.extensions.server_name.serverNameList.push(u(h,2).getBytes())}}if(e.session.version&&(o.version.major!==e.session.version.major||o.version.minor!==e.session.version.minor))return e.error(e,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});if(i)e.session.cipherSuite=c.getCipherSuite(o.cipher_suite);else for(var y=n.util.createBuffer(o.cipher_suites.bytes());y.length()>0&&(e.session.cipherSuite=c.getCipherSuite(y.getBytes(2)),null===e.session.cipherSuite););if(null===e.session.cipherSuite)return e.error(e,{message:"No cipher suites in common.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(o.cipher_suite)});e.session.compressionMethod=i?o.compression_method:c.CompressionMethod.none}return o},c.createSecurityParameters=function(e,t){var r=e.entity===c.ConnectionEnd.client,n=t.random.bytes(),o=r?e.session.sp.client_random:n,i=r?n:c.createRandom().getBytes();e.session.sp={entity:e.entity,prf_algorithm:c.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:e.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:o,server_random:i}},c.handleServerHello=function(e,t,r){var n=c.parseHelloMessage(e,t,r);if(!e.fail){if(!(n.version.minor<=e.version.minor))return e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});e.version.minor=n.version.minor,e.session.version=e.version;var o=n.session_id.bytes();o.length>0&&o===e.session.id?(e.expect=d,e.session.resuming=!0,e.session.sp.server_random=n.random.bytes()):(e.expect=f,e.session.resuming=!1,c.createSecurityParameters(e,n)),e.session.id=o,e.process()}},c.handleClientHello=function(e,t,r){var o=c.parseHelloMessage(e,t,r);if(!e.fail){var i=o.session_id.bytes(),a=null;if(e.sessionCache&&(null===(a=e.sessionCache.getSession(i))?i="":(a.version.major!==o.version.major||a.version.minor>o.version.minor)&&(a=null,i="")),0===i.length&&(i=n.random.getBytes(32)),e.session.id=i,e.session.clientHelloVersion=o.version,e.session.sp={},a)e.version=e.session.version=a.version,e.session.sp=a.sp;else{for(var s,u=1;u0;)o=u(s.certificate_list,3),i=n.asn1.fromDer(o),o=n.pki.certificateFromAsn1(i,!0),l.push(o)}catch(t){return e.error(e,{message:"Could not parse certificate list.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var f=e.entity===c.ConnectionEnd.client;!f&&!0!==e.verifyClient||0!==l.length?0===l.length?e.expect=f?p:w:(f?e.session.serverCertificate=l[0]:e.session.clientCertificate=l[0],c.verifyCertificateChain(e,l)&&(e.expect=f?p:w)):e.error(e,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}}),e.process()},c.handleServerKeyExchange=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});e.expect=h,e.process()},c.handleClientKeyExchange=function(e,t,r){if(r<48)return e.error(e,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});var o=t.fragment,i={enc_pre_master_secret:u(o,2).getBytes()},a=null;if(e.getPrivateKey)try{a=e.getPrivateKey(e,e.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(t){e.error(e,{message:"Could not get private key.",cause:t,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}if(null===a)return e.error(e,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}});try{var s=e.session.sp;s.pre_master_secret=a.decrypt(i.enc_pre_master_secret);var l=e.session.clientHelloVersion;if(l.major!==s.pre_master_secret.charCodeAt(0)||l.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(e){s.pre_master_secret=n.random.getBytes(48)}e.expect=O,null!==e.session.clientCertificate&&(e.expect=S),e.process()},c.handleCertificateRequest=function(e,t,r){if(r<3)return e.error(e,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var n=t.fragment,o={certificate_types:u(n,1),certificate_authorities:u(n,2)};e.session.certificateRequest=o,e.expect=y,e.process()},c.handleCertificateVerify=function(e,t,r){if(r<2)return e.error(e,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var o=t.fragment;o.read-=4;var i=o.bytes();o.read+=4;var a={signature:u(o,2).getBytes()},s=n.util.createBuffer();s.putBuffer(e.session.md5.digest()),s.putBuffer(e.session.sha1.digest()),s=s.getBytes();try{if(!e.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");e.session.md5.update(i),e.session.sha1.update(i)}catch(t){return e.error(e,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure}})}e.expect=O,e.process()},c.handleServerHelloDone=function(e,t,r){if(r>0)return e.error(e,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.record_overflow}});if(null===e.serverCertificate){var o={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.insufficient_security}},i=e.verify(e,o.alert.description,0,[]);if(!0!==i)return(i||0===i)&&("object"!=s(i)||n.util.isArray(i)?"number"==typeof i&&(o.alert.description=i):(i.message&&(o.message=i.message),i.alert&&(o.alert.description=i.alert))),e.error(e,o)}null!==e.session.certificateRequest&&(t=c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificate(e)}),c.queue(e,t)),t=c.createRecord(e,{type:c.ContentType.handshake,data:c.createClientKeyExchange(e)}),c.queue(e,t),e.expect=b;var a=function(e,t){null!==e.session.certificateRequest&&null!==e.session.clientCertificate&&c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createCertificateVerify(e,t)})),c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.pending=c.createConnectionState(e),e.state.current.write=e.state.pending.write,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)})),e.expect=d,c.flush(e),e.process()};if(null===e.session.certificateRequest||null===e.session.clientCertificate)return a(e,null);c.getClientSignature(e,a)},c.handleChangeCipherSpec=function(e,t){if(1!==t.fragment.getByte())return e.error(e,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var r=e.entity===c.ConnectionEnd.client;(e.session.resuming&&r||!e.session.resuming&&!r)&&(e.state.pending=c.createConnectionState(e)),e.state.current.read=e.state.pending.read,(!e.session.resuming&&r||e.session.resuming&&!r)&&(e.state.pending=null),e.expect=r?m:_,e.process()},c.handleFinished=function(e,t,r){var i=t.fragment;i.read-=4;var a=i.bytes();i.read+=4;var s=t.fragment.getBytes();(i=n.util.createBuffer()).putBuffer(e.session.md5.digest()),i.putBuffer(e.session.sha1.digest());var u=e.entity===c.ConnectionEnd.client,l=u?"server finished":"client finished",f=e.session.sp;if((i=o(f.master_secret,l,i.getBytes(),12)).getBytes()!==s)return e.error(e,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decrypt_error}});e.session.md5.update(a),e.session.sha1.update(a),(e.session.resuming&&u||!e.session.resuming&&!u)&&(c.queue(e,c.createRecord(e,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),e.state.current.write=e.state.pending.write,e.state.pending=null,c.queue(e,c.createRecord(e,{type:c.ContentType.handshake,data:c.createFinished(e)}))),e.expect=u?v:x,e.handshaking=!1,++e.handshakes,e.peerCertificate=u?e.session.serverCertificate:e.session.clientCertificate,c.flush(e),e.isConnected=!0,e.connected(e),e.process()},c.handleAlert=function(e,t){var r,n=t.fragment,o={level:n.getByte(),description:n.getByte()};switch(o.description){case c.Alert.Description.close_notify:r="Connection closed.";break;case c.Alert.Description.unexpected_message:r="Unexpected message.";break;case c.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case c.Alert.Description.decryption_failed:r="Decryption failed.";break;case c.Alert.Description.record_overflow:r="Record overflow.";break;case c.Alert.Description.decompression_failure:r="Decompression failed.";break;case c.Alert.Description.handshake_failure:r="Handshake failure.";break;case c.Alert.Description.bad_certificate:r="Bad certificate.";break;case c.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case c.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case c.Alert.Description.certificate_expired:r="Certificate expired.";break;case c.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case c.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case c.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case c.Alert.Description.access_denied:r="Access denied.";break;case c.Alert.Description.decode_error:r="Decode error.";break;case c.Alert.Description.decrypt_error:r="Decrypt error.";break;case c.Alert.Description.export_restriction:r="Export restriction.";break;case c.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case c.Alert.Description.insufficient_security:r="Insufficient security.";break;case c.Alert.Description.internal_error:r="Internal error.";break;case c.Alert.Description.user_canceled:r="User canceled.";break;case c.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(o.description===c.Alert.Description.close_notify)return e.close();e.error(e,{message:r,send:!1,origin:e.entity===c.ConnectionEnd.client?"server":"client",alert:o}),e.process()},c.handleHandshake=function(e,t){var r=t.fragment,o=r.getByte(),i=r.getInt24();if(i>r.length())return e.fragmented=t,t.fragment=n.util.createBuffer(),r.read-=4,e.process();e.fragmented=null,r.read-=4;var a=r.bytes(i+4);r.read+=4,o in F[e.entity][e.expect]?(e.entity!==c.ConnectionEnd.server||e.open||e.fail||(e.handshaking=!0,e.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),o!==c.HandshakeType.hello_request&&o!==c.HandshakeType.certificate_verify&&o!==c.HandshakeType.finished&&(e.session.md5.update(a),e.session.sha1.update(a)),F[e.entity][e.expect][o](e,t,i)):c.handleUnexpected(e,t)},c.handleApplicationData=function(e,t){e.data.putBuffer(t.fragment),e.dataReady(e),e.process()},c.handleHeartbeat=function(e,t){var r=t.fragment,o=r.getByte(),i=r.getInt16(),a=r.getBytes(i);if(o===c.HeartbeatMessageType.heartbeat_request){if(e.handshaking||i>a.length)return e.process();c.queue(e,c.createRecord(e,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_response,a)})),c.flush(e)}else if(o===c.HeartbeatMessageType.heartbeat_response){if(a!==e.expectedHeartbeatPayload)return e.process();e.heartbeatReceived&&e.heartbeatReceived(e,n.util.createBuffer(a))}e.process()};var f=1,p=2,h=3,y=4,d=5,m=6,v=7,b=8,g=1,w=2,S=3,O=4,_=5,x=6,P=c.handleUnexpected,k=c.handleChangeCipherSpec,E=c.handleAlert,j=c.handleHandshake,T=c.handleApplicationData,C=c.handleHeartbeat,A=[];A[c.ConnectionEnd.client]=[[P,E,j,P,C],[P,E,j,P,C],[P,E,j,P,C],[P,E,j,P,C],[P,E,j,P,C],[k,E,P,P,C],[P,E,j,P,C],[P,E,j,T,C],[P,E,j,P,C]],A[c.ConnectionEnd.server]=[[P,E,j,P,C],[P,E,j,P,C],[P,E,j,P,C],[P,E,j,P,C],[k,E,P,P,C],[P,E,j,P,C],[P,E,j,T,C],[P,E,j,P,C]];var I=c.handleHelloRequest,L=c.handleServerHello,N=c.handleCertificate,M=c.handleServerKeyExchange,R=c.handleCertificateRequest,D=c.handleServerHelloDone,B=c.handleFinished,F=[];F[c.ConnectionEnd.client]=[[P,P,L,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[I,P,P,P,P,P,P,P,P,P,P,N,M,R,D,P,P,P,P,P,P],[I,P,P,P,P,P,P,P,P,P,P,P,M,R,D,P,P,P,P,P,P],[I,P,P,P,P,P,P,P,P,P,P,P,P,R,D,P,P,P,P,P,P],[I,P,P,P,P,P,P,P,P,P,P,P,P,P,D,P,P,P,P,P,P],[I,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[I,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,B],[I,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[I,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P]];var U=c.handleClientHello,G=c.handleClientKeyExchange,z=c.handleCertificateVerify;F[c.ConnectionEnd.server]=[[P,U,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,N,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,G,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,z,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,B],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P],[P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P,P]],c.generateKeys=function(e,t){var r=o,n=t.client_random+t.server_random;e.session.resuming||(t.master_secret=r(t.pre_master_secret,"master secret",n,48).bytes(),t.pre_master_secret=null),n=t.server_random+t.client_random;var i=2*t.mac_key_length+2*t.enc_key_length,a=e.version.major===c.Versions.TLS_1_0.major&&e.version.minor===c.Versions.TLS_1_0.minor;a&&(i+=2*t.fixed_iv_length);var s=r(t.master_secret,"key expansion",n,i),u={client_write_MAC_key:s.getBytes(t.mac_key_length),server_write_MAC_key:s.getBytes(t.mac_key_length),client_write_key:s.getBytes(t.enc_key_length),server_write_key:s.getBytes(t.enc_key_length)};return a&&(u.client_write_IV=s.getBytes(t.fixed_iv_length),u.server_write_IV=s.getBytes(t.fixed_iv_length)),u},c.createConnectionState=function(e){var t=e.entity===c.ConnectionEnd.client,r=function(){var e={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(e){return!0},compressionState:null,compressFunction:function(e){return!0},updateSequenceNumber:function(){4294967295===e.sequenceNumber[1]?(e.sequenceNumber[1]=0,++e.sequenceNumber[0]):++e.sequenceNumber[1]}};return e},n={read:r(),write:r()};if(n.read.update=function(e,t){return n.read.cipherFunction(t,n.read)?n.read.compressFunction(e,t,n.read)||e.error(e,{message:"Could not decompress record.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decompression_failure}}):e.error(e,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_record_mac}}),!e.fail},n.write.update=function(e,t){return n.write.compressFunction(e,t,n.write)?n.write.cipherFunction(t,n.write)||e.error(e,{message:"Could not encrypt record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):e.error(e,{message:"Could not compress record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}),!e.fail},e.session){var o=e.session.sp;switch(e.session.cipherSuite.initSecurityParameters(o),o.keys=c.generateKeys(e,o),n.read.macKey=t?o.keys.server_write_MAC_key:o.keys.client_write_MAC_key,n.write.macKey=t?o.keys.client_write_MAC_key:o.keys.server_write_MAC_key,e.session.cipherSuite.initConnectionState(n,e,o),o.compression_algorithm){case c.CompressionMethod.none:break;case c.CompressionMethod.deflate:n.read.compressFunction=a,n.write.compressFunction=i;break;default:throw new Error("Unsupported compression algorithm.")}}return n},c.createRandom=function(){var e=new Date,t=+e+6e4*e.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(t),r.putBytes(n.random.getBytes(28)),r},c.createRecord=function(e,t){return t.data?{type:t.type,version:{major:e.version.major,minor:e.version.minor},length:t.data.length(),fragment:t.data}:null},c.createAlert=function(e,t){var r=n.util.createBuffer();return r.putByte(t.level),r.putByte(t.description),c.createRecord(e,{type:c.ContentType.alert,data:r})},c.createClientHello=function(e){e.session.clientHelloVersion={major:e.version.major,minor:e.version.minor};for(var t=n.util.createBuffer(),r=0;r0&&(y+=2);var d=e.session.id,m=d.length+1+2+4+28+2+i+1+s+y,v=n.util.createBuffer();return v.putByte(c.HandshakeType.client_hello),v.putInt24(m),v.putByte(e.version.major),v.putByte(e.version.minor),v.putBytes(e.session.sp.client_random),l(v,1,n.util.createBuffer(d)),l(v,2,t),l(v,1,a),y>0&&l(v,2,u),v},c.createServerHello=function(e){var t=e.session.id,r=t.length+1+2+4+28+2+1,o=n.util.createBuffer();return o.putByte(c.HandshakeType.server_hello),o.putInt24(r),o.putByte(e.version.major),o.putByte(e.version.minor),o.putBytes(e.session.sp.server_random),l(o,1,n.util.createBuffer(t)),o.putByte(e.session.cipherSuite.id[0]),o.putByte(e.session.cipherSuite.id[1]),o.putByte(e.session.compressionMethod),o},c.createCertificate=function(e){var t,r=e.entity===c.ConnectionEnd.client,o=null;e.getCertificate&&(t=r?e.session.certificateRequest:e.session.extensions.server_name.serverNameList,o=e.getCertificate(e,t));var i=n.util.createBuffer();if(null!==o)try{n.util.isArray(o)||(o=[o]);for(var a=null,s=0;sc.MaxFragment;)o.push(c.createRecord(e,{type:t.type,data:n.util.createBuffer(i.slice(0,c.MaxFragment))})),i=i.slice(c.MaxFragment);i.length>0&&o.push(c.createRecord(e,{type:t.type,data:n.util.createBuffer(i)}))}for(var a=0;a0&&(o=r.order[0]),null!==o&&o in r.cache)for(var i in t=r.cache[o],delete r.cache[o],r.order)if(r.order[i]===o){r.order.splice(i,1);break}return t},r.setSession=function(e,t){if(r.order.length===r.capacity){var o=r.order.shift();delete r.cache[o]}o=n.util.bytesToHex(e),r.order.push(o),r.cache[o]=t}}return r},c.createConnection=function(e){var t;t=e.caStore?n.util.isArray(e.caStore)?n.pki.createCaStore(e.caStore):e.caStore:n.pki.createCaStore();var r=e.cipherSuites||null;if(null===r)for(var o in r=[],c.CipherSuites)r.push(c.CipherSuites[o]);var i=e.server?c.ConnectionEnd.server:c.ConnectionEnd.client,a=e.sessionCache?c.createSessionCache(e.sessionCache):null,s={version:{major:c.Version.major,minor:c.Version.minor},entity:i,sessionId:e.sessionId,caStore:t,sessionCache:a,cipherSuites:r,connected:e.connected,virtualHost:e.virtualHost||null,verifyClient:e.verifyClient||!1,verify:e.verify||function(e,t,r,n){return t},verifyOptions:e.verifyOptions||{},getCertificate:e.getCertificate||null,getPrivateKey:e.getPrivateKey||null,getSignature:e.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:e.tlsDataReady,dataReady:e.dataReady,heartbeatReceived:e.heartbeatReceived,closed:e.closed,error:function(t,r){r.origin=r.origin||(t.entity===c.ConnectionEnd.client?"client":"server"),r.send&&(c.queue(t,c.createAlert(t,r.alert)),c.flush(t));var n=!1!==r.fatal;n&&(t.fail=!0),e.error(t,r),n&&t.close(!1)},deflate:e.deflate||null,inflate:e.inflate||null,reset:function(e){s.version={major:c.Version.major,minor:c.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,c.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(e||void 0===e),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=c.createConnectionState(s)}};return s.reset(),s.handshake=function(e){if(s.entity!==c.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var t=null;(e=e||"").length>0&&(s.sessionCache&&(t=s.sessionCache.getSession(e)),null===t&&(e="")),0===e.length&&s.sessionCache&&null!==(t=s.sessionCache.getSession())&&(e=t.id),s.session={id:e,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},t&&(s.version=t.version,s.session.sp=t.sp),s.session.sp.client_random=c.createRandom().getBytes(),s.open=!0,c.queue(s,c.createRecord(s,{type:c.ContentType.handshake,data:c.createClientHello(s)})),c.flush(s)}},s.process=function(e){var t=0;return e&&s.input.putBytes(e),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(t=function(e){var t=0,r=e.input,o=r.length();if(o<5)t=5-o;else{e.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var i=e.record.version.major===e.version.major;i&&e.session&&e.session.version&&(i=e.record.version.minor===e.version.minor),i||e.error(e,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}})}return t}(s)),s.fail||null===s.record||s.record.ready||(t=function(e){var t=0,r=e.input,n=r.length();return n=0;u--)T>>=8,T+=P.at(u)+j.at(u),j.setAt(u,255&T);E.putBuffer(j)}w=E,f.putBuffer(_)}return f.truncate(f.length()-i),f},a.pbe.getCipher=function(e,t,r){switch(e){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(e,t,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(e,t,r){var o,s={},u=[];if(!i.validate(t,l,s,u))throw(o=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,o;if((e=i.derToOid(s.kdfOid))!==a.oids.pkcs5PBKDF2)throw(o=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,o.supportedOids=["pkcs5PBKDF2"],o;if((e=i.derToOid(s.encOid))!==a.oids["aes128-CBC"]&&e!==a.oids["aes192-CBC"]&&e!==a.oids["aes256-CBC"]&&e!==a.oids["des-EDE3-CBC"]&&e!==a.oids.desCBC)throw(o=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,o.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],o;var c,f,h=s.kdfSalt,y=n.util.createBuffer(s.kdfIterationCount);switch(y=y.getInt(y.length()<<3),a.oids[e]){case"aes128-CBC":c=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=n.des.createDecryptionCipher;break;case"desCBC":c=8,f=n.des.createDecryptionCipher}var d=p(s.prfOid),m=n.pkcs5.pbkdf2(r,h,y,c,d),v=s.encIv,b=f(m);return b.start(v),b},a.pbe.getCipherForPKCS12PBE=function(e,t,r){var o={},s=[];if(!i.validate(t,c,o,s))throw(d=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,d;var u,l,f,h=n.util.createBuffer(o.salt),y=n.util.createBuffer(o.iterations);switch(y=y.getInt(y.length()<<3),e){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var d;throw(d=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,d}var m=p(o.prfOid),v=a.pbe.generatePkcs12Key(r,h,1,y,u,m);return m.start(),f(v,a.pbe.generatePkcs12Key(r,h,2,y,l,m))},a.pbe.opensslDeriveBytes=function(e,t,r,o){if(null==o){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');o=n.md.md5.create()}null===t&&(t="");for(var i=[f(o,e+t)],a=16,s=1;a>>0,s>>>0];for(var l=o.fullMessageLength.length-1;l>=0;--l)o.fullMessageLength[l]+=s[1],s[1]=s[0]+(o.fullMessageLength[l]/4294967296>>>0),o.fullMessageLength[l]=o.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(i),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),o},o.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,l=o.fullMessageLength[o.fullMessageLength.length-1]+o.messageLengthSize&o.blockLength-1;a.putBytes(i.substr(0,o.blockLength-l));for(var c=8*o.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=s>>>0;a.putInt32(c);var p={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(p,r,a);var h=n.util.createBuffer();return h.putInt32(p.h0),h.putInt32(p.h1),h.putInt32(p.h2),h.putInt32(p.h3),h.putInt32(p.h4),h.putInt32(p.h5),h.putInt32(p.h6),h.putInt32(p.h7),h},o};var i=null,a=!1,s=null;function u(e,t,r){for(var n,o,i,a,u,l,c,f,p,h,y,d,m,v=r.length();v>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,o=((o=t[u-15])>>>7|o<<25)^(o>>>18|o<<14)^o>>>3,t[u]=n+t[u-7]+o+t[u-16]|0;for(l=e.h0,c=e.h1,f=e.h2,p=e.h3,h=e.h4,y=e.h5,d=e.h6,m=e.h7,u=0;u<64;++u)i=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),a=l&c|f&(l^c),n=m+((h>>>6|h<<26)^(h>>>11|h<<21)^(h>>>25|h<<7))+(d^h&(y^d))+s[u]+t[u],m=d,d=y,y=h,h=p+n>>>0,p=f,f=c,c=l,l=n+(o=i+a)>>>0;e.h0=e.h0+l|0,e.h1=e.h1+c|0,e.h2=e.h2+f|0,e.h3=e.h3+p|0,e.h4=e.h4+h|0,e.h5=e.h5+y|0,e.h6=e.h6+d|0,e.h7=e.h7+m|0,v-=64}}},function(e,t,r){var n=r(0);r(1);var o=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(o=r(16)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,i=new Array(32),a=0;a<32;++a)i[a]=r.create();function s(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var o=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(o),t.generated=0}function l(e){var t=null,r=n.util.globalScope,o=r.crypto||r.msCrypto;o&&o.getRandomValues&&(t=function(e){return o.getRandomValues(e)});var i=n.util.createBuffer();if(t)for(;i.length()>16)))<<16,p=4294967295&(c=(2147483647&(c+=l>>15))+(c>>31)),u=0;u<3;++u)f=p>>>(u<<3),f^=Math.floor(256*Math.random()),i.putByte(255&f);return i.getBytes(e)}return t.pools=i,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var o=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,s=t.plugin.formatSeed,l=n.util.createBuffer();t.key=null,function c(f){if(f)return r(f);if(l.length()>=e)return r(null,l.getBytes(e));if(t.generated>1048575&&(t.key=null),null===t.key)return n.util.nextTick(function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,function(r,n){if(r)return e(r);t.collect(n),u(),e()})}(c)});var p=o(t.key,t.seed);t.generated+=p.length,l.putBytes(p),t.key=a(o(t.key,i(t.seed))),t.seed=s(o(t.key,t.seed)),n.util.setImmediate(c)}()},t.generateSync=function(e){var r=t.plugin.cipher,o=t.plugin.increment,i=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(t.key=null),null===t.key&&s();var l=r(t.key,t.seed);t.generated+=l.length,u.putBytes(l),t.key=i(r(t.key,o(t.seed))),t.seed=a(r(t.key,t.seed))}return u.getBytes(e)},o?(t.seedFile=function(e,t){o.randomBytes(e,function(e,r){if(e)return t(e);t(null,r.toString())})},t.seedFileSync=function(e){return o.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,l(e))}catch(e){t(e)}},t.seedFileSync=l),t.collect=function(e){for(var r=e.length,n=0;n>o&255);t.collect(n)},t.registerWorker=function(e){e===self?t.seedFile=function(e,t){self.addEventListener("message",function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:e}}})}:e.addEventListener("message",function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})})})},t}},function(e,t,r){var n=r(0);r(1);var o=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],i=[1,2,3,5],a=function(e,t){return e<>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,i=e,a=e.length(),s=t,u=Math.ceil(s/8),l=255>>(7&s);for(r=a;r<128;r++)i.putByte(o[i.at(r-1)+i.at(r-a)&255]);for(i.setAt(128-u,o[i.at(128-u)&l]),r=127-u;r>=0;r--)i.setAt(r,o[i.at(r+1)^i.at(r+u)]);return i};var u=function(e,t,r){var o,u,l,c,f=!1,p=null,h=null,y=null,d=[];for(e=n.rc2.expandKey(e,t),l=0;l<64;l++)d.push(e.getInt16Le());r?(o=function(e){for(l=0;l<4;l++)e[l]+=d[c]+(e[(l+3)%4]&e[(l+2)%4])+(~e[(l+3)%4]&e[(l+1)%4]),e[l]=a(e[l],i[l]),c++},u=function(e){for(l=0;l<4;l++)e[l]+=d[63&e[(l+3)%4]]}):(o=function(e){for(l=3;l>=0;l--)e[l]=s(e[l],i[l]),e[l]-=d[c]+(e[(l+3)%4]&e[(l+2)%4])+(~e[(l+3)%4]&e[(l+1)%4]),c--},u=function(e){for(l=3;l>=0;l--)e[l]-=d[63&e[(l+3)%4]]});var m=function(e){var t=[];for(l=0;l<4;l++){var n=p.getInt16Le();null!==y&&(r?n^=y.getInt16Le():y.putInt16Le(n)),t.push(65535&n)}c=r?0:63;for(var o=0;o=8;)m([[5,o],[1,u],[6,o],[1,u],[5,o]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,p,!r);else{var n=8===p.length()?8:8-p.length();p.fillWithByte(n,n)}if(t&&(f=!0,v.update()),!r&&(t=0===p.length()))if(e)t=e(8,h,!r);else{var o=h.length(),i=h.at(o-1);i>o?t=!1:h.truncate(i)}return t}}};n.rc2.startEncrypting=function(e,t,r){var o=n.rc2.createEncryptionCipher(e,128);return o.start(t,r),o},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var o=n.rc2.createDecryptionCipher(e,128);return o.start(t,r),o},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},function(e,t,r){var n=r(0);r(1),r(2),r(9);var o=e.exports=n.pkcs1=n.pkcs1||{};function i(e,t,r){r||(r=n.md.sha1.create());for(var o="",i=Math.ceil(t/r.digestLength),a=0;a>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+s),o+=r.digest().getBytes()}return o.substring(0,t)}o.encode_rsa_oaep=function(e,t,r){var o,a,s,u;"string"==typeof r?(o=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(o=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var l=Math.ceil(e.n.bitLength()/8),c=l-2*s.digestLength-2;if(t.length>c)throw(d=new Error("RSAES-OAEP input message length is too long.")).length=t.length,d.maxLength=c,d;o||(o=""),s.update(o,"raw");for(var f=s.digest(),p="",h=c-t.length,y=0;ye&&(a=u(e,t));var h=a.toString(16);o.target.postMessage({hex:h,workLoad:c}),a.dAddOffset(f,0)}}}h()}(e,t,o,i):s(e,t,o,i)}(e,l,i.options,o);throw new Error("Invalid prime generation algorithm: "+i.name)}}function s(e,t,r,i){var a=u(e,t),s=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function e(t,r,i,a,s,l,c){var f=+new Date;do{if(t.bitLength()>r&&(t=u(r,i)),t.isProbablePrime(s))return c(null,t);t.dAddOffset(o[a++%8],0)}while(l<0||+new Date-f=0&&o.push(s):o.push(s))}return o}function h(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(u=o.create(o.Class.UNIVERSAL,o.Type.SET,!0,f));var p=[],h=[];null!==t&&(h=n.util.isArray(t)?t:[t]);for(var y=[],d=0;d0){var g=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,y),w=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.data).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(g).getBytes())])]);p.push(w)}var S=null;if(null!==e){var O=i.wrapRsaPrivateKey(i.privateKeyToAsn1(e));S=null===r?o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.keyBag).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[O]),u]):o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.pkcs8ShroudedKeyBag).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[i.encryptPrivateKeyInfo(O,r,s)]),u]);var _=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[S]),x=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.data).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(_).getBytes())])]);p.push(x)}var P,k=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,p);if(s.useMac){var E=n.md.sha1.create(),j=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),T=s.count,C=(e=a.generateKey(r,j,3,T,20),n.hmac.create());C.start(E,e),C.update(o.toDer(k).getBytes());var A=C.getMac();P=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.sha1).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,A.getBytes())]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,j.getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(T).getBytes())])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(3).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(i.oids.data).getBytes()),o.create(o.Class.CONTEXT_SPECIFIC,0,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(k).getBytes())])]),P])},a.generateKey=n.pbe.generatePkcs12Key},function(e,t,r){var n=r(0);r(3),r(1);var o=n.asn1,i=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=i;var a={name:"ContentInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};i.contentInfoValidator=a;var s={name:"EncryptedContentInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:o.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};i.envelopedDataValidator={name:"EnvelopedData",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:o.Class.UNIVERSAL,type:o.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},i.encryptedDataValidator={name:"EncryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:o.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:o.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};i.signedDataValidator={name:"SignedData",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:o.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:o.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:o.Class.UNIVERSAL,type:o.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},i.recipientInfoValidator={name:"RecipientInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:o.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(0);r(1),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var o=new n.util.ByteBuffer,i=Math.ceil(r/e.digestLength),a=0;a>>0,a>>>0];for(var s=h.fullMessageLength.length-1;s>=0;--s)h.fullMessageLength[s]+=a[1],a[1]=a[0]+(h.fullMessageLength[s]/4294967296>>>0),h.fullMessageLength[s]=h.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return o.putBytes(e),c(r,i,o),(o.read>2048||0===o.length())&&o.compact(),h},h.digest=function(){var t=n.util.createBuffer();t.putBytes(o.bytes());var s,u=h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1;t.putBytes(a.substr(0,h.blockLength-u));for(var l=8*h.fullMessageLength[0],f=0;f>>0,t.putInt32(l>>>0),l=s>>>0;t.putInt32(l);var p=new Array(r.length);for(f=0;f=128;){for(C=0;C<16;++C)t[C][0]=r.getInt32()>>>0,t[C][1]=r.getInt32()>>>0;for(;C<80;++C)n=(((A=(L=t[C-2])[0])>>>19|(I=L[1])<<13)^(I>>>29|A<<3)^A>>>6)>>>0,o=((A<<13|I>>>19)^(I<<3|A>>>29)^(A<<26|I>>>6))>>>0,i=(((A=(M=t[C-15])[0])>>>1|(I=M[1])<<31)^(A>>>8|I<<24)^A>>>7)>>>0,a=((A<<31|I>>>1)^(A<<24|I>>>8)^(A<<25|I>>>7))>>>0,N=t[C-7],R=t[C-16],I=o+N[1]+a+R[1],t[C][0]=n+N[0]+i+R[0]+(I/4294967296>>>0)>>>0,t[C][1]=I>>>0;for(y=e[0][0],d=e[0][1],m=e[1][0],v=e[1][1],b=e[2][0],g=e[2][1],w=e[3][0],S=e[3][1],O=e[4][0],_=e[4][1],x=e[5][0],P=e[5][1],k=e[6][0],E=e[6][1],j=e[7][0],T=e[7][1],C=0;C<80;++C)c=((O>>>14|_<<18)^(O>>>18|_<<14)^(_>>>9|O<<23))>>>0,f=(k^O&(x^k))>>>0,s=((y>>>28|d<<4)^(d>>>2|y<<30)^(d>>>7|y<<25))>>>0,l=((y<<4|d>>>28)^(d<<30|y>>>2)^(d<<25|y>>>7))>>>0,p=(y&m|b&(y^m))>>>0,h=(d&v|g&(d^v))>>>0,I=T+(((O<<18|_>>>14)^(O<<14|_>>>18)^(_<<23|O>>>9))>>>0)+((E^_&(P^E))>>>0)+u[C][1]+t[C][1],n=j+c+f+u[C][0]+t[C][0]+(I/4294967296>>>0)>>>0,o=I>>>0,i=s+p+((I=l+h)/4294967296>>>0)>>>0,a=I>>>0,j=k,T=E,k=x,E=P,x=O,P=_,O=w+n+((I=S+o)/4294967296>>>0)>>>0,_=I>>>0,w=b,S=g,b=m,g=v,m=y,v=d,y=n+i+((I=o+a)/4294967296>>>0)>>>0,d=I>>>0;I=e[0][1]+d,e[0][0]=e[0][0]+y+(I/4294967296>>>0)>>>0,e[0][1]=I>>>0,I=e[1][1]+v,e[1][0]=e[1][0]+m+(I/4294967296>>>0)>>>0,e[1][1]=I>>>0,I=e[2][1]+g,e[2][0]=e[2][0]+b+(I/4294967296>>>0)>>>0,e[2][1]=I>>>0,I=e[3][1]+S,e[3][0]=e[3][0]+w+(I/4294967296>>>0)>>>0,e[3][1]=I>>>0,I=e[4][1]+_,e[4][0]=e[4][0]+O+(I/4294967296>>>0)>>>0,e[4][1]=I>>>0,I=e[5][1]+P,e[5][0]=e[5][0]+x+(I/4294967296>>>0)>>>0,e[5][1]=I>>>0,I=e[6][1]+E,e[6][0]=e[6][0]+k+(I/4294967296>>>0)>>>0,e[6][1]=I>>>0,I=e[7][1]+T,e[7][0]=e[7][0]+j+(I/4294967296>>>0)>>>0,e[7][1]=I>>>0,D-=128}}},function(e,t,r){e.exports=r(33)},function(e,t,r){e.exports=r(0),r(5),r(36),r(3),r(13),r(10),r(38),r(8),r(40),r(41),r(42),r(30),r(15),r(7),r(26),r(28),r(43),r(21),r(27),r(24),r(18),r(2),r(25),r(44),r(20),r(1)},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==("undefined"==typeof window?"undefined":s(window))&&(r=window)}e.exports=r},function(e,t){var r={};e.exports=r;var n={};r.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var o=0,i=t.length,a=t.charAt(0),s=[0];for(o=0;o0;)s.push(l%i),l=l/i|0}for(o=0;0===e[o]&&o=0;--o)n+=t[s[o]]}else n=function(e,t){var r=0,n=t.length,o=t.charAt(0),i=[0];for(r=0;r0;)i.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[i[r]];return u}(e,t);if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join("\r\n")}return n},r.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var r=n[t];if(!r){r=n[t]=[];for(var o=0;o>=8;for(;c>0;)s.push(255&c),c>>=8}for(var f=0;e[f]===a&&f=o.Versions.TLS_1_1.minor&&u.output.putBytes(r),u.update(e.fragment),u.finish(s)&&(e.fragment=u.output,e.length=e.fragment.length(),i=!0),i}function s(e,t,r){if(!r){var n=e-t.length()%e;t.fillWithByte(n-1,n)}return!0}function u(e,t,r){var n=!0;if(r){for(var o=t.length(),i=t.last(),a=o-1-i;a=s?(e.fragment=a.output.getBytes(c-s),l=a.output.getBytes(s)):e.fragment=a.output.getBytes(),e.fragment=n.util.createBuffer(e.fragment),e.length=e.fragment.length();var f=t.macFunction(t.macKey,t.sequenceNumber,e);return t.updateSequenceNumber(),function(e,t,r){var o=n.hmac.create();return o.start("SHA1",e),o.update(t),t=o.digest().getBytes(),o.start(null,null),o.update(r),t===(r=o.digest().getBytes())}(t.macKey,l,f)&&i}o.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=o.BulkCipherAlgorithm.aes,e.cipher_type=o.CipherType.block,e.enc_key_length=16,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=o.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i},o.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(e){e.bulk_cipher_algorithm=o.BulkCipherAlgorithm.aes,e.cipher_type=o.CipherType.block,e.enc_key_length=32,e.block_length=16,e.fixed_iv_length=16,e.record_iv_length=16,e.mac_algorithm=o.MACAlgorithm.hmac_sha1,e.mac_length=20,e.mac_key_length=20},initConnectionState:i}},function(e,t,r){var n=r(0);r(30),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){var n=r(0);r(12),r(2),r(31),r(1);var o=r(39),i=o.publicKeyValidator,a=o.privateKeyValidator;if(void 0===s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,l="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},e.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var c=n.ed25519;function f(e){var t=e.message;if(t instanceof Uint8Array||t instanceof l)return t;var r=e.encoding;if(void 0===t){if(!e.md)throw new TypeError('"options.message" or "options.md" not specified.');t=e.md.digest().getBytes(),r="binary"}if("string"==typeof t&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof t){if("undefined"!=typeof Buffer)return Buffer.from(t,r);t=new u(t,r)}else if(!(t instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new l(t.length()),o=0;o=0;--r)B(n,n),1!==r&&F(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(r,r),F(r,r,o),F(r,r,i),F(r,r,i),F(e[0],r,i),B(n,e[0]),F(n,n,i),E(n,o)&&F(e[0],e[0],g),B(n,e[0]),F(n,n,i),E(n,o)?-1:(T(e[0])===t[31]>>7&&D(e[0],p,e[0]),F(e[3],e[0],e[1]),0)}(s,n))return-1;for(o=0;o=0};var p=M(),h=M([1]),y=M([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=M([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),m=M([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),v=M([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),b=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),g=M([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(e,t){var r=n.md.sha512.create(),o=new u(e);r.update(o.getBytes(t),"binary");var i=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(i,"binary");for(var a=new l(c.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)a[s]=i.charCodeAt(s);return a}function S(e,t){var r,n,o,i;for(n=63;n>=32;--n){for(r=0,o=n-32,i=n-12;o>8,t[o]-=256*r;t[o]+=r,t[n]=0}for(r=0,o=0;o<32;++o)t[o]+=r-(t[31]>>4)*b[o],r=t[o]>>8,t[o]&=255;for(o=0;o<32;++o)t[o]-=r*b[o];for(n=0;n<32;++n)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function O(e){for(var t=new Float64Array(64),r=0;r<64;++r)t[r]=e[r],e[r]=0;S(e,t)}function _(e,t){var r=M(),n=M(),o=M(),i=M(),a=M(),s=M(),u=M(),l=M(),c=M();D(r,e[1],e[0]),D(c,t[1],t[0]),F(r,r,c),R(n,e[0],e[1]),R(c,t[0],t[1]),F(n,n,c),F(o,e[3],t[3]),F(o,o,d),F(i,e[2],t[2]),R(i,i,i),D(a,n,r),D(s,i,o),R(u,i,o),R(l,n,r),F(e[0],a,s),F(e[1],l,u),F(e[2],u,s),F(e[3],a,l)}function x(e,t,r){for(var n=0;n<4;++n)N(e[n],t[n],r)}function P(e,t){var r=M(),n=M(),o=M();!function(e,t){var r,n=M();for(r=0;r<16;++r)n[r]=t[r];for(r=253;r>=0;--r)B(n,n),2!==r&&4!==r&&F(n,n,t);for(r=0;r<16;++r)e[r]=n[r]}(o,t[2]),F(r,t[0],o),F(n,t[1],o),k(e,n),e[31]^=T(r)<<7}function k(e,t){var r,n,o,i=M(),a=M();for(r=0;r<16;++r)a[r]=t[r];for(L(a),L(a),L(a),n=0;n<2;++n){for(i[0]=a[0]-65517,r=1;r<15;++r)i[r]=a[r]-65535-(i[r-1]>>16&1),i[r-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,N(a,i,1-o)}for(r=0;r<16;r++)e[2*r]=255&a[r],e[2*r+1]=a[r]>>8}function E(e,t){var r=new l(32),n=new l(32);return k(r,e),k(n,t),j(r,0,n,0)}function j(e,t,r,n){return function(e,t,r,n,o){var i,a=0;for(i=0;i<32;++i)a|=e[t+i]^r[n+i];return(1&a-1>>>8)-1}(e,t,r,n)}function T(e){var t=new l(32);return k(t,e),1&t[0]}function C(e,t,r){var n,o;for(I(e[0],p),I(e[1],h),I(e[2],h),I(e[3],p),o=255;o>=0;--o)x(e,t,n=r[o/8|0]>>(7&o)&1),_(t,e),_(e,e),x(e,t,n)}function A(e,t){var r=[M(),M(),M(),M()];I(r[0],m),I(r[1],v),I(r[2],h),F(r[3],m,v),C(e,r,t)}function I(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function L(e){var t,r,n=1;for(t=0;t<16;++t)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function N(e,t,r){for(var n,o=~(r-1),i=0;i<16;++i)n=o&(e[i]^t[i]),e[i]^=n,t[i]^=n}function M(e){var t,r=new Float64Array(16);if(e)for(t=0;t0&&(a=n.util.fillString(String.fromCharCode(0),u)+a),{encapsulation:t.encrypt(a,"NONE"),key:e.generate(a,i)}},decrypt:function(t,r,n){var o=t.decrypt(r,"NONE");return e.generate(o,n)}}},n.kem.kdf1=function(e,t){i(this,e,0,t||e.digestLength)},n.kem.kdf2=function(e,t){i(this,e,1,t||e.digestLength)}},function(e,t,r){var n=r(0);r(1),e.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var o={},i=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s0){for(var r=o.create(o.Class.CONTEXT_SPECIFIC,1,!0,[]),i=0;i=r&&a0&&a.value[0].value.push(o.create(o.Class.CONTEXT_SPECIFIC,0,!0,t)),i.length>0&&a.value[0].value.push(o.create(o.Class.CONTEXT_SPECIFIC,1,!0,i)),a.value[0].value.push(o.create(o.Class.UNIVERSAL,o.Type.SET,!0,e.signerInfos)),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(e.type).getBytes()),a])},addSigner:function(t){var r=t.issuer,o=t.serialNumber;if(t.certificate){var i=t.certificate;"string"==typeof i&&(i=n.pki.certificateFromPem(i)),r=i.issuer.attributes,o=i.serialNumber}var a=t.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var l=!1,c=!1,f=0;f="8"&&(r="00"+r);var o=n.util.hexToBytes(r);e.putInt32(o.length),e.putBytes(o)}function a(e,t){e.putInt32(t.length),e.putString(t)}function s(){for(var e=n.md.sha1.create(),t=arguments.length,r=0;r=e.minX&&t.maxY>=e.minY}function d(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,t,r,o,i){for(var a,s=[t,r];s.length;)(r=s.pop())-(t=s.pop())<=o||(a=t+Math.ceil((r-t)/o/2)*o,n(e,a,t,r,i),s.push(t,a,a,r))}o.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,r=[],n=this.toBBox;if(!y(e,t))return r;for(var o,i,a,s,u=[];t;){for(o=0,i=t.children.length;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(o,i,t)},_split:function(e,t){var r=e[t],n=r.children.length,o=this._minEntries;this._chooseSplitAxis(r,o,n);var i=this._chooseSplitIndex(r,o,n),s=d(r.children.splice(i,r.children.length-i));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(e,t){this.data=d([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,r){var n,o,i,a,u,l,c,p,h,y,d,m,v,b;for(l=c=1/0,n=t;n<=r-t;n++)o=s(e,0,n,this.toBBox),i=s(e,n,r,this.toBBox),h=o,y=i,void 0,void 0,void 0,void 0,d=Math.max(h.minX,y.minX),m=Math.max(h.minY,y.minY),v=Math.min(h.maxX,y.maxX),b=Math.min(h.maxY,y.maxY),a=Math.max(0,v-d)*Math.max(0,b-m),u=f(o)+f(i),a=t;o--)i=e.children[o],u(c,e.leaf?a(i):i),f+=p(c);return f},_adjustParentBBoxes:function(e,t,r){for(var n=r;n>=0;n--)u(t[n],e)},_condense:function(e){for(var t,r=e.length-1;r>=0;r--)0===e[r].children.length?r>0?(t=e[r-1].children).splice(t.indexOf(e[r]),1):this.clear():a(e[r],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]+"};")}}},2299:function(e,t,r){var n,o,i;function a(e){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}i=function(){"use strict";function e(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function t(e,t){return et?1:0}return function(r,n,o,i,a){!function t(r,n,o,i,a){for(;i>o;){if(i-o>600){var s=i-o+1,u=n-o+1,l=Math.log(s),c=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1),p=Math.max(o,Math.floor(n-u*c/s+f)),h=Math.min(i,Math.floor(n+(s-u)*c/s+f));t(r,n,p,h,a)}var y=r[n],d=o,m=i;for(e(r,o,n),a(r[i],y)>0&&e(r,o,i);d0;)m--}0===a(r[o],y)?e(r,o,m):e(r,++m,i),m<=n&&(o=m+1),n<=m&&(i=m-1)}}(r,n,o||0,i||r.length-1,a||t)}},"object"===a(t)?e.exports=i():void 0===(o="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=o)},1097:function(e){var t=/^[-+]?0x[a-fA-F0-9]+$/,r=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};e.exports=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o=Object.assign({},n,o),!e||"string"!=typeof e)return e;var i=e.trim();if(void 0!==o.skipLike&&o.skipLike.test(i))return e;if(o.hex&&t.test(i))return Number.parseInt(i,16);var a=r.exec(i);if(a){var s=a[1],u=a[2],l=function(e){return e&&-1!==e.indexOf(".")?("."===(e=e.replace(/0+$/,""))?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e):e}(a[3]),c=a[4]||a[6];if(!o.leadingZeros&&u.length>0&&s&&"."!==i[2])return e;if(!o.leadingZeros&&u.length>0&&!s&&"."!==i[1])return e;var f=Number(i),p=""+f;return-1!==p.search(/[eE]/)?o.eNotation?f:e:c?o.eNotation?f:e:-1!==i.indexOf(".")?"0"===p&&""===l?f:p===l?f:s&&p==="-"+l?f:e:u?l===p?f:s+l===p?f:e:i===p?f:i===s+p?f:e}return e}},5400:function(e,t,r){var n,o;function i(e){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e=r.nmd(e),function(a,s){"use strict";"object"===i(e)&&e.exports?e.exports=s():void 0===(o="function"==typeof(n=s)?n.call(t,r,t,e):n)||(e.exports=o)}(0,function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),o=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[o-1]&&""===n[o-2]&&n.pop(),-1!==n[(o=n.length)-1].indexOf(".")&&(i=7),t=0;t1;s++)r.splice(0,1);n[a]=r.join("")}var u=-1,l=0,c=0,f=-1,p=!1;for(a=0;al&&(u=f,l=c)):"0"===n[a]&&(p=!0,f=a,c=1);c>l&&(u=f,l=c),l>1&&n.splice(u,l,""),o=n.length;var h="";for(""===n[0]&&(h=":"),a=0;a=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var o=r.list[e.slice(t+1)];return!!o&&o.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var o=r.list[e.slice(t+1)];return o?o.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r})},7411:function(e,t,r){var n,o,i;function a(e){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e=r.nmd(e),function(s,u){"use strict";"object"===a(e)&&e.exports?e.exports=u(r(9018),r(5400),r(2714)):(o=[r(9018),r(5400),r(2714)],void 0===(i="function"==typeof(n=u)?n.apply(t,o):n)||(e.exports=i))}(0,function(e,t,r,n){"use strict";var o=n&&n.URI;function i(e,t){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof i))return r?n?new i(e,t):new i(e):new i;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.11";var s=i.prototype,u=Object.prototype.hasOwnProperty;function l(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function f(e){return"Array"===c(e)}function p(e,t){var r,n,o={};if("RegExp"===c(t))o=null;else if(f(t))for(r=0,n=t.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,i.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=v,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=v,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var r=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var b,g={encode:"encode",decode:"decode"},w=function(e,t){return function(r){try{return i[t](r+"").replace(i.characters[e][t].expression,function(r){return i.characters[e][t].map[r]})}catch(e){return r}}};for(b in g)i[b+"PathSegment"]=w("pathname",g[b]),i[b+"UrnPathSegment"]=w("urnpath",g[b]);var S=function(e,t,r){return function(n){var o;o=r?function(e){return i[t](i[r](e))}:i[t];for(var a=(n+"").split(e),s=0,u=a.length;s-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=(e=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=i.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var r,n,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,o)||null,"/"===t.port&&(t.port=null);else{var a=e.indexOf(":"),s=e.indexOf("/"),u=e.indexOf(":",a+1);-1!==u&&(-1===s||u-1?o:e.length-1);return a>-1&&(-1===o||a-1?h.slice(0,y)+h.slice(y).replace(a,""):h.replace(a,"")).length<=l[0].length||r.ignore&&r.ignore.test(h))){var v=t(h,c,p=c+h.length,e);void 0!==v?(v=String(v),e=e.slice(0,c)+v+e.slice(p),n.lastIndex=c+v.length):n.lastIndex=p}}return n.lastIndex=0,e},i.ensureValidHostname=function(t,r){var n=!!t,o=!1;if(!!r&&(o=h(i.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=o),this},s.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new i(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=O("protocol"),s.username=O("username"),s.password=O("password"),s.hostname=O("hostname"),s.port=O("port"),s.query=_("query","?"),s.fragment=_("fragment","#"),s.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},s.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},s.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},s.path=s.pathname,s.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var n=e instanceof i,o="object"===a(e)&&(e.hostname||e.path||e.pathname);e.nodeName&&(e=e[i.getDomAttribute(e)]||"",o=!1);if(!n&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var s=n?e._parts:e;for(r in s)"query"!==r&&u.call(this._parts,r)&&(this._parts[r]=s[r]);s.query&&this.query(s.query,!1)}return this.build(!t),this},s.is=function(e){var t=!1,n=!1,o=!1,a=!1,s=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,n=i.ip4_expression.test(this._parts.hostname),o=i.ip6_expression.test(this._parts.hostname),s=(a=!(t=n||o))&&r&&r.has(this._parts.hostname),u=a&&i.idn_expression.test(this._parts.hostname),l=a&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return a;case"sld":return s;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var x=s.protocol,P=s.port,k=s.hostname;s.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},s.scheme=s.protocol,s.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),P.call(this,e,t))},s.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return k.call(this,e,t)},s.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},s.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},s.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},s.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=i.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},s.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,o=this._parts.hostname.substring(0,n),a=new RegExp("^"+l(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,e),this.build(!t),this},s.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},s.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),o=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},s.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?i.decodePath(n):n}var o=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,o),s=new RegExp("^"+l(a));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),this.build(!t),this},s.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?i.decodePathSegment(n):n}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var a=new RegExp(l(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(a,e),o?this.normalizePath(t):this.build(!t),this},s.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,o=this.filename(),a=o.lastIndexOf(".");return-1===a?"":(r=o.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?i.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var s,u=this.suffix();if(u)s=e?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return s&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},s.segment=function(e,t,r){var n=this._parts.urn?":":"/",o=this.path(),i="/"===o.substring(0,1),a=o.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&a.shift(),e<0&&(e=Math.max(a.length+e,0)),void 0===t)return void 0===e?a:a[e];if(null===e||void 0===a[e])if(f(t)){a=[];for(var s=0,u=t.length;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=p-h,P=Math.floor,k=String.fromCharCode;function E(e){throw new RangeError(_[e])}function j(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function T(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+j((e=e.replace(O,".")).split("."),t).join(".")}function C(e){for(var t,r,n=[],o=0,i=e.length;o=55296&&t<=56319&&o65535&&(t+=k((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=k(e)}).join("")}function I(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function L(e,t,r){var n=0;for(e=r?P(e/m):e>>1,e+=P(e/t);e>x*y>>1;n+=p)e=P(e/x);return P(n+(x+1)*e/(e+d))}function N(e){var t,r,n,o,i,a,s,u,l,c,d,m=[],w=e.length,S=0,O=b,_=v;for((r=e.lastIndexOf(g))<0&&(r=0),n=0;n=128&&E("not-basic"),m.push(e.charCodeAt(n));for(o=r>0?r+1:0;o=w&&E("invalid-input"),((u=(d=e.charCodeAt(o++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:p)>=p||u>P((f-S)/a))&&E("overflow"),S+=u*a,!(u<(l=s<=_?h:s>=_+y?y:s-_));s+=p)a>P(f/(c=p-l))&&E("overflow"),a*=c;_=L(S-i,t=m.length+1,0==i),P(S/t)>f-O&&E("overflow"),O+=P(S/t),S%=t,m.splice(S++,0,O)}return A(m)}function M(e){var t,r,n,o,i,a,s,u,l,c,d,m,w,S,O,_=[];for(m=(e=C(e)).length,t=b,r=0,i=v,a=0;a=t&&dP((f-r)/(w=n+1))&&E("overflow"),r+=(s-t)*w,t=s,a=0;af&&E("overflow"),d==t){for(u=r,l=p;!(u<(c=l<=i?h:l>=i+y?y:l-i));l+=p)O=u-c,S=p-c,_.push(k(I(c+O%S,0))),u=P(O/S);_.push(k(I(u,0))),i=L(r,w,n==o),r=0,++n}++r,++t}return _.join("")}if(l={version:"1.3.2",ucs2:{decode:C,encode:A},decode:N,encode:M,toASCII:function(e){return T(e,function(e){return S.test(e)?"xn--"+M(e):e})},toUnicode:function(e){return T(e,function(e){return w.test(e)?N(e.slice(4).toLowerCase()):e})}},"object"==o(r.amdO)&&r.amdO)void 0===(n=function(){return l}.call(t,r,t,e))||(e.exports=n);else if(a&&s)if(e.exports==a)s.exports=l;else for(c in l)l.hasOwnProperty(c)&&(a[c]=l[c]);else i.punycode=l}(this)},4539:function(){"use strict"},8857:function(e,t,r){"use strict";var n=mapboxgl,o=r.n(n),i={values:[],set:function(e){return this.values=e,this.values},add:function(e){return this.values.push(e),this.values}},a=(r(5246),r(1358),r(3678)),s=r.n(a);function u(e){"@babel/helpers - typeof";return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var r=0;r0&&(r=parseFloat(e.toPrecision(t))),r},format:function(e,t,r,n){t=void 0!==t?t:0,r=void 0!==r?r:h.thousandsSeparator,n=void 0!==n?n:h.decimalSeparator,null!=t&&(e=parseFloat(e.toFixed(t)));var o=e.toString().split(".");1===o.length&&null==t&&(t=0);var i,a=o[0];if(r)for(var s=/(-?[0-9]+)([0-9]{3})/;s.test(a);)a=a.replace(s,"$1"+r+"$2");if(0==t)i=a;else{var u=o.length>1?o[1]:"0";null!=t&&(u+=new Array(t-u.length+1).join("0")),i=a+n+u}return i}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(e){return h.limitSigDigs(this,e)});var y={bind:function(e,t){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return e.apply(t,n)}},bindAsEventListener:function(e,t){return function(r){return e.call(t,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},d={filter:function(e,t,r){var n=[];if(Array.prototype.filter)n=e.filter(t,r);else{var o=e.length;if("function"!=typeof t)throw new TypeError;for(var i=0;i-1||E.indexOf("trident")>-1&&E.indexOf("rv")>-1?(x="msie",_=E.match(/msie ([\d.]+)/)||E.match(/rv:([\d.]+)/)):E.indexOf("chrome")>-1?(x="chrome",_=E.match(/chrome\/([\d.]+)/)):E.indexOf("firefox")>-1?(x="firefox",_=E.match(/firefox\/([\d.]+)/)):E.indexOf("opera")>-1?(x="opera",_=E.match(/version\/([\d.]+)/)):E.indexOf("safari")>-1&&(x="safari",_=E.match(/version\/([\d.]+)/)),P=_?_[1]:"",E.indexOf("ipad")>-1||E.indexOf("ipod")>-1||E.indexOf("iphone")>-1?k="apple":E.indexOf("android")>-1&&(P=(_=E.match(/version\/([\d.]+)/))?_[1]:"",k="android"),{name:x,version:P,device:k}),A=(j=!0,T=C,document.createElement("canvas").getContext?("firefox"===T.name&&parseFloat(T.version)<5&&(j=!1),"safari"===T.name&&parseFloat(T.version)<4&&(j=!1),"opera"===T.name&&parseFloat(T.version)<10&&(j=!1),"msie"===T.name&&parseFloat(T.version)<9&&(j=!1)):j=!1,j),I=function(){var e=navigator.userAgent.toLowerCase();return-1===e.indexOf("webkit")&&-1!==e.indexOf("gecko")}(),L={assign:function(e){for(var t=0;t=0;r--)e[r]===t&&e.splice(r,1);return e},indexOf:function(e,t){if(null==e)return-1;if("function"==typeof e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r=0&&parseFloat(s)<1?(e.style.filter="alpha(opacity="+100*s+")",e.style.opacity=s):1===parseFloat(s)&&(e.style.filter="",e.style.opacity="")},applyDefaults:function(e,t){e=e||{};var r="function"==typeof window.Event&&t instanceof window.Event;for(var n in t)(void 0===e[n]||!r&&t.hasOwnProperty&&t.hasOwnProperty(n)&&!e.hasOwnProperty(n))&&(e[n]=t[n]);return!r&&t&&t.hasOwnProperty&&t.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")&&(e.toString=t.toString),e},getParameterString:function(e){var t=[];for(var r in e){var n,o=e[r];if(null!=o&&"function"!=typeof o)n=Array.isArray(o)||"[object Object]"===o.toString()?encodeURIComponent(JSON.stringify(o)):encodeURIComponent(o),t.push(encodeURIComponent(r)+"="+n)}return t.join("&")},urlAppend:function(e,t){var r=e;if(t){0===t.indexOf("?")&&(t=t.substring(1));var n=(e+" ").split(/[?&]/);r+=" "===n.pop()?t:n.length?"&"+t:"?"+t}return r},urlPathAppend:function(e,t){var r=e;if(!t)return r;0===t.indexOf("/")&&(t=t.substring(1));var n=e.split("?");return n[0].indexOf("/",n[0].length-1)<0&&(n[0]+="/"),r="".concat(n[0]).concat(t).concat(n.length>1?"?".concat(n[1]):"")},DEFAULT_PRECISION:14,toFloat:function(e,t){return null==t&&(t=L.DEFAULT_PRECISION),"number"!=typeof e&&(e=parseFloat(e)),0===t?e:parseFloat(e.toPrecision(t))},rad:function(e){return e*Math.PI/180},getParameters:function(e){e=null===e||void 0===e?window.location.href:e;var t="";if(p.contains(e,"?")){var r=e.indexOf("?")+1,n=p.contains(e,"#")?e.indexOf("#"):e.length;t=e.substring(r,n)}for(var o={},i=t.split(/[&;]/),a=0,s=i.length;a1?1/e:e},getResolutionFromScale:function(e,t){var r;e&&(null==t&&(t="degrees"),r=1/(L.normalizeScale(e)*N[t]*96));return r},getScaleFromResolution:function(e,t){return null==t&&(t="degrees"),e*N[t]*96},getBrowser:function(){return C},isSupportCanvas:A,supportCanvas:function(){return L.isSupportCanvas},isInTheSameDomain:function(e){return!e||(-1===e.indexOf("//")||L.isSameDomain(e,document.location.toString()))},isSameDomain:function(e,t){return new(S())(e).normalize().origin()===new(S())(t).normalize().origin()},calculateDpi:function(e,t,r,n,o){if(e&&t&&r){var i,a=e.getWidth(),s=e.getHeight(),u=t.w,l=t.h;if(o=o||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){var c=a/u,f=s/l;i=254/(c>f?c:f)/r/(2*Math.PI*o/360)/1e4}else{i=254/(a/u)/r/1e4}return i}},toJSON:function(e){var t=e;if(null==t)return null;switch(t.constructor){case String:return t=(t=(t=(t=(t=(t=(t='"'+t.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",n=0,o=t.length;n0?"{"+u.join(",")+"}":"{}"}return t.toString()}},getResolutionFromScaleDpi:function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?(e=L.normalizeScale(e),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4):-1},getScaleFromResolutionDpi:function(e,t,r,n){return n=n||6378137,r=r||"",e>0&&t>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/t/e/(2*Math.PI*n/360)/1e4:254/t/e/1e4:-1},transformResult:function(e){return e.responseText&&"string"==typeof e.responseText&&(e=JSON.parse(e.responseText)),e},copyAttributes:function(e,t){if(e=e||{},t)for(var r in t){var n=t[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(e[r]=n)}return e},copyAttributesWithClip:function(e,t,r){if(e=e||{},t)for(var n in t){var o=!1;if(r&&r.length)for(var i=0,a=r.length;i=0&&i<=1&&o<=1&&i>=0?new g.Point(e.x+o*(t.x-e.x),e.y+o*(t.y-e.y)):"No Intersection";else if(0==s&&0==u){var c=Math.max(e.y,t.y),f=Math.min(e.y,t.y),p=Math.max(e.x,t.x),h=Math.min(e.x,t.x);a=(r.y>=f&&r.y<=c||n.y>=f&&n.y<=c)&&r.x>=h&&r.x<=p||n.x>=h&&n.x<=p?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(e,t,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",e.fontSize&&(r.style.fontSize=e.fontSize),e.fontFamily&&(r.style.fontFamily=e.fontFamily),e.fontWeight&&(r.style.fontWeight=e.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=t;var n=r.clientWidth,o=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:o}},convertPath:function(e,t){return t?e.replace(/\{([\w-\.]+)\}/g,function(e,r){var n;return n=t.hasOwnProperty(r)?function(e){if(void 0==e||null==e)return"";if(e instanceof Date)return e.toJSON();if(function(e){if("string"!=typeof e&&"object"!==O(e))return!1;try{var t=e.toString();return"[object Object]"===t||"[object Array]"===t}catch(e){return!1}}(e))return JSON.stringify(e);return e.toString()}(t[r]):e,encodeURIComponent(n)}):e}},N={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};N.in=N.inches,N.degrees=N.dd,N.nmi=1852*N.m;var M=.0254000508001016;L.extend(N,{Inch:N.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),L.extend(N,{mm:N.Meter/1e3,cm:N.Meter/100,dm:100*N.Meter,km:1e3*N.Meter,kmi:N.nmi,fath:N.Fathom,ch:N.IntnlChain,link:N.IntnlLink,"us-in":N.inches,"us-ft":N.Foot,"us-yd":N.Yard,"us-ch":N.GunterChain,"us-mi":N.Mile,"ind-yd":N.IndianYd37,"ind-ft":N.IndianFt37,"ind-ch":791.9942845122}),N.degree=N.dd,N.meter=N.m,N.foot=N.ft,N.inch=N.inches,N.mile=N.mi,N.kilometer=N.km,N.yard=N.yd;var R,D,B=window.fetch,F={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(e){for(var t in e){this.queryKeys.push(t),"string"!=typeof e[t]&&(e[t]=L.toJSON(e[t]));var r=encodeURIComponent(e[t]);this.queryValues.push(r)}},issue:function(e){for(var t=this,r=t.getUid(),n=e.url,o=[],i=n,a=0,s=t.queryKeys?t.queryKeys.length:0,u=0;u=t.limitLength){if(0==a)return!1;o.push(i),i=n,a=0,u--}else if(i.length+t.queryKeys[u].length+2+t.queryValues[u].length>t.limitLength)for(var l=t.queryValues[u];l.length>0;){var c=t.limitLength-i.length-t.queryKeys[u].length-2;i.indexOf("?")>-1?i+="&":i+="?";var f=l.substring(0,c);"%"===f.substring(c-1,c)?(c-=1,f=l.substring(0,c)):"%"===f.substring(c-2,c-1)&&(c-=2,f=l.substring(0,c)),i+=t.queryKeys[u]+"="+f,l=l.substring(c),f.length>0&&(o.push(i),i=n,a=0)}else a++,i.indexOf("?")>-1?i+="&":i+="?",i+=t.queryKeys[u]+"="+t.queryValues[u];return o.push(i),t.send(o,"SuperMapJSONPCallbacks_"+r,e&&e.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(e,t,r){var n=e.length;if(n>0)return new Promise(function(o){for(var i=(new Date).getTime(),a=0;a-1?u+="&":u+="?",u+="sectionCount="+n,u+="§ionIndex="+a,u+="&jsonpUserID="+i,r&&(u=decodeURIComponent(u),u=r+encodeURIComponent(u)),s()(u,{jsonpCallbackFunction:t,timeout:3e4}).then(function(e){o(e.json())})}})},GET:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(e.params),this.issue(e)},POST:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},PUT:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)},DELETE:function(e){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:e.data}),this.issue(e)}},U=function(){return void 0!=R?R:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},G=function(){return D||45e3},z={commit:function(e,t,r,n){switch(e=e?e.toUpperCase():e){case"GET":return this.get(t,r,n);case"POST":return this.post(t,r,n);case"PUT":return this.put(t,r,n);case"DELETE":return this.delete(t,r,n);default:return this.get(t,r,n)}},supportDirectRequest:function(e,t){return!!L.isInTheSameDomain(e)||(void 0!=t.crossOrigin?t.crossOrigin:U()||t.proxy)},get:function(e,t,r){r=r||{};if(e=L.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){var n={url:e=e.replace(".json",".jsonp"),data:t};return F.GET(n)}return this.urlIsLong(e)?this._postSimulatie("GET",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"GET")},delete:function(e,t,r){r=r||{};if(e=L.urlAppend(e,this._getParameterString(t||{})),e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var n={url:e+="&_method=DELETE",data:t};return F.DELETE(n)}return this.urlIsLong(e)?this._postSimulatie("DELETE",e.substring(0,e.indexOf("?")),t,r):this._fetch(e,t,r,"DELETE")},post:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var n={url:L.urlAppend(e,"_method=POST"),data:t};return F.POST(n)}return this._fetch(e,t,r,"POST")},put:function(e,t,r){if(r=r||{},e=this._processUrl(e,r),!this.supportDirectRequest(e,r)){e=e.replace(".json",".jsonp");var n={url:e+="&_method=PUT",data:t};return F.PUT(n)}return this._fetch(e,t,r,"PUT")},urlIsLong:function(e){for(var t=0,r=null,n=0,o=e.length;n-1?"&":"?")+"_method="+e,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(t,r,n)},_processUrl:function(e,t){if(this._isMVTRequest(e))return e;if(-1===e.indexOf(".json")&&!t.withoutFormatSuffix)if(e.indexOf("?")<0)e+=".json";else{var r=e.split("?");2===r.length&&(e=r[0]+".json?"+r[1])}return t&&t.proxy&&("function"==typeof t.proxy?e=t.proxy(e):(e=decodeURIComponent(e),e=t.proxy+encodeURIComponent(e))),e},_fetch:function(e,t,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(t)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,B(e,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?t:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:G()}).then(function(e){return e})):B(e,{method:n,body:"PUT"===n||"POST"===n?t:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:G()}).then(function(e){return e})},_getWithCredentials:function(e){return!0===e.withCredentials?"include":!1===e.withCredentials?"omit":"same-origin"},_fetchJsonp:function(e,t){return t=t||{},s()(e,{method:"GET",timeout:t.timeout}).then(function(e){return e})},_timeout:function(e,t){return new Promise(function(r,n){setTimeout(function(){n(new Error("timeout"))},e),t.then(r,n)})},_getParameterString:function(e){var t=[];for(var r in e){var n,o=e[r];if(null!=o&&"function"!=typeof o)n=Array.isArray(o)||"[object Object]"===o.toString()?encodeURIComponent(JSON.stringify(o)):encodeURIComponent(o),t.push(encodeURIComponent(r)+"="+n)}return t.join("&")},_isMVTRequest:function(e){return e.indexOf(".mvt")>-1||e.indexOf(".pbf")>-1}},V=r(7915);function q(e,t){e&&-1===e.indexOf("BEGIN PUBLIC KEY")&&(e="-----BEGIN PUBLIC KEY-----\n".concat(e,"\n-----END PUBLIC KEY-----"));var r=V.pki.publicKeyFromPem(e),n={md:V.md.sha256.create(),mgf1:{md:V.md.sha1.create()}},o=r.encrypt(t,"RSA-OAEP",n);return!!o&&window.btoa(o)}function H(e,t,r){r=V.util.encodeUtf8(r);var n=V.cipher.createCipher("AES-GCM",e);if(n.start({iv:t,additionalData:"",tagLength:128}),n.update(V.util.createBuffer(r)),n.finish()){var o=n.output,i=n.mode.tag;return window.btoa(o.data+i.data)}return!1}function W(e){for(var t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=e;n>0;--n)r+=t[Math.floor(Math.random()*t.length)];return r}function J(e){"@babel/helpers - typeof";return(J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function K(){K=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==J(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Q(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+s+"+"+i+";}}"],{type:"text/javascript"}))}},{key:"getPaintProperty",value:function(e,r){var n=this.overlayLayersManager[e];return n?n.getPaintProperty?n.getPaintProperty(r):void 0:t.getPaintProperty.call(this,e,r)}},{key:"getLayoutProperty",value:function(e,r){var n=this.overlayLayersManager[e];return n?n.getLayoutProperty?n.getLayoutProperty(r):void 0:t.getLayoutProperty.call(this,e,r)}},{key:"getFilter",value:function(e,r,n){var o=this.overlayLayersManager[e];return o?o.getFilter?o.getFilter(r,n):void 0:t.getFilter.call(this,e,r,n)}},{key:"setFilter",value:function(e,r,n){var o=this.overlayLayersManager[e];return o?(o.setFilter&&o.setFilter(r,n),this):t.setFilter.call(this,e,r,n)}},{key:"on",value:function(e,t,r){return this._eventsModeHandler({type:e,layerId:t,listener:r,mode:"on"})}},{key:"once",value:function(e,t,r){return this._eventsModeHandler({type:e,layerId:t,listener:r,mode:"once"})}},{key:"off",value:function(e,t,r){return this._eventsModeHandler({type:e,layerId:t,listener:r,mode:"off"})}},{key:"queryRenderedFeatures",value:function(e,r){var n,o=this,i=Object.keys(this.overlayLayersManager);r&&r.layers&&(i=r.layers.filter(function(e){return o.overlayLayersManager[e]}),n=r.layers.filter(function(e){return!o.overlayLayersManager[e]}));var a=e||[[0,0],[this.transform.width,this.transform.height]],s=r||{};delete s.layers;var u=i.reduce(function(e,t){var r=o.overlayLayersManager[t];return r.query&&r.queryRenderedFeatures&&r.queryRenderedFeatures(a,s,function(t){e=e.concat(t)}),e},[]);return t.queryRenderedFeatures.call(this,e,ce(ce({},r),{},{layers:n})).concat(u)}},{key:"querySourceFeatures",value:function(e,r){var n=Object.values(this.overlayLayersManager).find(function(t){return t.sourceId===e&&t instanceof se});return n?n.query?n.querySourceFeatures(r):void 0:t.querySourceFeatures.call(this,e,r)}},{key:"getSource",value:function(e){var r=Object.values(this.overlayLayersManager).find(function(t){return t.sourceId===e&&t instanceof se});return r?r.getSource():t.getSource.call(this,e)}},{key:"removeSource",value:function(e){var r=Object.values(this.overlayLayersManager).find(function(t){return t.sourceId===e&&t instanceof se});return r?r.removeSource():t.removeSource.call(this,e)}},{key:"isSourceLoaded",value:function(e){var r=Object.values(this.overlayLayersManager).find(function(t){return t.sourceId===e&&t instanceof se});return r?r.isSourceLoaded():t.isSourceLoaded.call(this,e)}},{key:"_eventsModeHandler",value:function(e){var r=this,n=e.type,o=e.layerId,i=e.listener,a=e.mode,s=[];i&&(s=s.concat(o)),s.forEach(function(e){var t=r.overlayLayersManager[e]||{};t.interaction&&t[a]&&t.events.includes(n)&&t[a](n,i||o)});var u=i&&s.filter(function(e){return!r.overlayLayersManager[e]});if(u&&!u.length)return this;var l=u&&"string"!=typeof o?u:o;return t[a].call(this,n,l,i)}},{key:"_moveToHandler",value:function(t,r){var n,o=document.getElementById(t);r&&((n=document.getElementById(r))||e.Evented.prototype.fire("error",{error:new Error('Layer with id "'.concat(r,'" does not exist on this document.'))})),o&&(n?n.parentNode.insertBefore(o,n):o.parentNode.appendChild(o))}}])&&ye(o.prototype,i),a&&ye(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,a}()}function we(e){"@babel/helpers - typeof";return(we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Se(e,t){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Ee(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}var je,Te;o().VectorTileSource&&void 0===o().VectorTileSource.prototype.beforeLoadBak&&(o().VectorTileSource.prototype.beforeLoadBak=o().VectorTileSource.prototype.beforeLoad,o().VectorTileSource.prototype.beforeLoad=(je=ke().mark(function e(t,r){var n,o;return ke().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=r&&r.tiles&&r.tiles[0],!i.values.includes(t)||!n){e.next=6;break}return e.next=4,re(n);case 4:(o=e.sent)&&(this.decryptOptions={key:o.serviceKey,algorithm:o.algorithm});case 6:this.beforeLoadBak(t,r);case 7:case"end":return e.stop()}},e,this)}),Te=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=je.apply(e,t);function i(e){Ee(o,r,n,i,a,"next",e)}function a(e){Ee(o,r,n,i,a,"throw",e)}i(void 0)})},function(e,t){return Te.apply(this,arguments)})),o().Map.prototype._inherit||(o().Map=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),_e(this,t,[e])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pe(e,t)}(t,ge(o())),r=t,n&&Se(r.prototype,n),i&&Se(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(), -// 防止引入多个 iclient-mapboxgl 导致死循环 -o().Map.prototype._inherit=!0);function Ce(e){"@babel/helpers - typeof";return(Ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ae(e,t){for(var r=0;r";return this._container.innerHTML=a?""+s+"":s,this._createStyleSheet(),this._container}},{key:"_createStyleSheet",value:function(){var e=document.createElement("style");e.type="text/css",e.innerHTML=".iclient-logo{margin:0 !important;}.iclient-logo a{border: none;display: block;height:31px;}.iclient-logo img{border: none;white-space: nowrap}",document.getElementsByTagName("head")[0].appendChild(e)}},{key:"_extend",value:function(e){for(var t=0;te.right;)t.lon-=e.getWidth()}return t}},{key:"destroy",value:function(){this.lon=null,this.lat=null}}])&&Ve(t.prototype,r),n&&Ve(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function We(e){"@babel/helpers - typeof";return(We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Je(e,t){for(var r=0;rthis.right)&&(this.right=r.right),(null==this.top||r.top>this.top)&&(this.top=r.top))}}},{key:"containsLonLat",value:function(e,t){"boolean"==typeof t&&(t={inclusive:t}),t=t||{};var r=this.contains(e.lon,e.lat,t.inclusive),n=t.worldBounds;if(n&&!r){var o=n.getWidth(),i=(n.left+n.right)/2,a=Math.round((e.lon-i)/o);r=this.containsLonLat({lon:e.lon-a*o,lat:e.lat},{inclusive:t.inclusive})}return r}},{key:"containsPixel",value:function(e,t){return this.contains(e.x,e.y,t)}},{key:"contains",value:function(e,t,r){if(null==r&&(r=!0),null==e||null==t)return!1;var n=!1;return n=r?e>=this.left&&e<=this.right&&t>=this.bottom&&t<=this.top:e>this.left&&ethis.bottom&&t=r.bottom&&e.bottom<=r.top||r.bottom>=e.bottom&&r.bottom<=e.top,a=e.top>=r.bottom&&e.top<=r.top||r.top>e.bottom&&r.top=r.left&&e.left<=r.right||r.left>=e.left&&r.left<=e.right,u=e.right>=r.left&&e.right<=r.right||r.right>=e.left&&r.right<=e.right;n=(i||a)&&(s||u)}if(t.worldBounds&&!n){var l=t.worldBounds,c=l.getWidth(),f=!l.containsBounds(r),p=!l.containsBounds(e);f&&!p?(e=e.add(-c,0),n=r.intersectsBounds(e,{inclusive:t.inclusive})):p&&!f&&(r=r.add(-c,0),n=e.intersectsBounds(r,{inclusive:t.inclusive}))}return n}},{key:"containsBounds",value:function(e,t,r){null==t&&(t=!1),null==r&&(r=!0);var n=this.contains(e.left,e.bottom,r),o=this.contains(e.right,e.bottom,r),i=this.contains(e.left,e.top,r),a=this.contains(e.right,e.top,r);return t?n||o||i||a:n&&o&&i&&a}},{key:"determineQuadrant",value:function(e){var t="",r=this.getCenterLonLat();return t+=e.lat=e.right&&o.right>e.right;)o=o.add(-i,0);var a=o.left+r;ae.left&&o.right-n>e.right&&(o=o.add(-i,0))}return o}},{key:"toServerJSONObject",value:function(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}},{key:"destroy",value:function(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}}])&&Je(t.prototype,r),n&&Je(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function Qe(e){"@babel/helpers - typeof";return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xe(e,t){for(var r=0;r-1)){if(null!=t&&t=0;--r)t=this.removeComponent(e[r])||t;return t}},{key:"removeComponent",value:function(e){return L.removeItem(this.components,e),this.clearBounds(),!0}},{key:"getArea",value:function(){for(var e=0,t=0,r=this.components.length;t=1?1:v)<=-1?-1:v,c=180*Math.acos(v)/Math.PI,a=(c=o.x==r.x?t.x>r.x&&n.x>r.x||t.xp*t.x+h&&n.y>p*n.x+h||t.yr.y?n.xr.x&&(s=!1):o.xp*n.x+h&&(s=!1):o.x>r.x?n.y>r.y&&(s=!1):n.y=0?180*Math.atan(b)/Math.PI:Math.abs(180*Math.atan(b)/Math.PI)+90,w=Math.abs(t.y);r.y==w&&w==o.y&&r.x=0?b>=0?l+=u:l=180-(l-90)+u:l=b>0?l-180+u:90-l+u:S>=0?b>=0?l-=u:l=180-(l-90)-u:l=b>=0?l-180-u:90-l-u,l=l*Math.PI/180;var _=t.x+i*Math.cos(l),x=t.y+i*Math.sin(l);f.push(new nt(_,x))}f.push(o)}return f}},{key:"createLineEPS",value:function(e){var r=[],n=e.length;if(n<2)return e;for(var o=0;o2;return r&&Ct(At(t.prototype),"removeComponent",this).apply(this,arguments),r}},{key:"getSortedSegments",value:function(){for(var e,t,r=this.components.length-1,n=new Array(r),o=0;o3;if(r){this.components.pop(),Bt(Ft(t.prototype),"removeComponent",this).apply(this,arguments);var n=this.components[0];Bt(Ft(t.prototype),"addComponent",this).apply(this,[n])}return r}},{key:"getArea",value:function(){var e=0;if(this.components&&this.components.length>2){for(var t=0,r=0,n=this.components.length;r0){e+=Math.abs(this.components[0].getArea());for(var t=1,r=this.components.length;t0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),t));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(e){var t={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)?'"'+e.replace(/([\x00-\x1f\\"])/g,function(e,r){var n=t[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+e+'"'},number:function(e){return isFinite(e)?String(e):"null"},boolean:function(e){return String(e)},date:function(e){function t(e){return e<10?"0"+e:e}return'"'+e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+'"'}},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wr(e,t)}(t,yr),r=t,(n=[{key:"read",value:function(e,t){var r;if(this.nativeJSON)try{r=JSON.parse(e,t)}catch(t){return{data:e}}return this.keepData&&(this.data=r),r}},{key:"write",value:function(e,t){this.pretty=!!t;var r=null,n=dr(e);if(this.serialize[n])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(e):this.serialize[n].apply(this,[e])}catch(e){}return r}},{key:"writeIndent",value:function(){var e=[];if(this.pretty)for(var t=0;t0))return null;for(var a=0,s=0,u=[];a0){e+='"points":[';for(var r=0,n=this.components.length;re[i]){var a=e[i];e[i]=e[o],e[o]=a;var s=t[i];if(t[i]=t[o],t[o]=s,r&&r.length>0){var u=r[i];r[i]=r[o],r[o]=u}if(n&&n.length>0){var l=n[i];n[i]=n[o],n[o]=l}}}}],(r=[{key:"destroy",value:function(){var e=this;e.id=null,e.style=null,e.parts=null,e.partTopo=null,e.points=null,e.type=null,e.prjCoordSys=null}},{key:"toGeometry",value:function(){var e=this;switch(e.type.toUpperCase()){case sn.POINT:return e.toGeoPoint();case sn.LINE:return e.toGeoLine();case sn.LINEM:return e.toGeoLinem();case sn.REGION:return e.toGeoRegion();case sn.POINTEPS:return e.toGeoPoint();case sn.LINEEPS:return e.toGeoLineEPS();case sn.REGIONEPS:return e.toGeoRegionEPS();case sn.GEOCOMPOUND:return e.transformGeoCompound()}}},{key:"toGeoPoint",value:function(){var e=this.parts||[],t=this.points||[],r=e.length;if(r>0){if(1===r)return new nt(t[0].x,t[0].y);for(var n=[],o=0;o0){if(1===r){for(var n=[],o=0;o0){if(1===s){for(e=0,r=[];e=0;g--)if(v[b]=-1,f[g].containsBounds(f[b])){p[b]=-1*p[g],p[b]<0&&(v[b]=g);break}for(var w=0;w0?i.push(c[w]):(i[v[w]].components=i[v[w]].components.concat(c[w].components),i.push(""))}else{i=new Array;for(var S=0;S0&&i.length>0&&(i[i.length-1].components=i[i.length-1].components.concat(u),u=[]),i.push(c[S])),S==o-1){var O=i.length;if(O)i[O-1].components=i[O-1].components.concat(u);else for(var _=0,x=u.length;_=0;w--)if(b[g]=-1,p[w].containsBounds(p[g])){h[g]=-1*h[w],h[g]<0&&(b[g]=w);break}for(var S=0;S0?a.push(f[S]):(a[b[S]].components=a[b[S]].components.concat(f[S].components),a.push(""))}else{a=new Array;for(var O=0;O0&&a.length>0&&(a[a.length-1].components=a[a.length-1].components.concat(l),l=[]),a.push(f[O])),O==o-1){var _=a.length;if(_)a[_-1].components=a[_-1].components.concat(l);else for(var x=0,P=l.length;x-1||(t[n]=e[n]);return t}}])&&$n(r.prototype,n),o&&$n(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function ao(e){return"string"==typeof e&&e.constructor===String}function so(e){return"[object Array]"===Object.prototype.toString.call(e)}function uo(e){return"[object Object]"===Object.prototype.toString.call(e)}function lo(e){return so(e)&&2===e.length&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90}var co=JSON.parse('[{"name":"克拉玛依市","coord":[85.01486759299489,45.406422237230046]},{"name":"昌吉回族自治州","coord":[88.7154624754753,44.26991024636568]},{"name":"石河子市","coord":[86.0208600035924,44.239045558096805]},{"name":"霍林郭勒市","coord":[114.73479243733115,44.16058374713977]},{"name":"本溪市","coord":[124.64357865201586,41.177197783134275]},{"name":"嘉峪关市","coord":[98.16891560537093,39.76279786284264]},{"name":"莱芜市","coord":[117.65723565456207,36.27916499211527]},{"name":"神农架林区","coord":[110.48296222218153,31.581260143666697]},{"name":"天门市","coord":[113.00615321481195,30.64105781887143]},{"name":"鄂州市","coord":[114.94764081970385,30.325634953844585]},{"name":"潜江市","coord":[112.70703817700621,30.349210666019893]},{"name":"仙桃市","coord":[113.34688900729822,30.315951161935402]},{"name":"萍乡市","coord":[113.88072263074415,27.47193090553213]},{"name":"台湾省","coord":[120.14338943402045,23.596002465926095]},{"name":"东莞市","coord":[113.89443658529342,22.897826158636448]},{"name":"中山市","coord":[113.37118387764659,22.501478858616522]},{"name":"珠海市","coord":[113.21799258934986,22.23782602992192]},{"name":"北海市","coord":[109.18248083043899,21.695773689750148]},{"name":"香港","coord":[114.20689279508653,22.36016760139811]},{"name":"舟山市","coord":[122.22514712841459,30.338633120695956]},{"name":"克孜勒苏柯尔克孜","coord":[74.62910472637343,39.59886016069875]},{"name":"喀什地区","coord":[77.19899922143753,37.85462871211595]},{"name":"阿克苏地区","coord":[81.43930290016381,41.067304799230456]},{"name":"和田地区","coord":[80.69780509160952,36.95287032287055]},{"name":"阿里地区","coord":[82.536487505389,32.69566569631762]},{"name":"日喀则地区","coord":[86.5996831353606,29.54861754814263]},{"name":"那曲地区","coord":[88.32523292667608,33.20600450932715]},{"name":"玉树藏族自治州","coord":[95.2107128446203,33.90320387919257]},{"name":"迪庆藏族自治州","coord":[99.42465312188943,28.052797714348895]},{"name":"怒江傈傈族自治州","coord":[98.85737910439825,26.98345757528851]},{"name":"大理白族自治州","coord":[99.93934374816013,25.684737357453045]},{"name":"德宏傣族景颇族自","coord":[98.13830877778075,24.593421919561205]},{"name":"保山市","coord":[99.19031013453166,24.979380341662]},{"name":"临沧市","coord":[99.62483778975081,24.058807858948214]},{"name":"普洱市","coord":[100.94440267992684,23.44121660743221]},{"name":"西双版纳傣族自治","coord":[100.86105801845994,21.882475641324206]},{"name":"拉萨市","coord":[91.3684790613129,30.14176592960237]},{"name":"山南地区","coord":[92.11665242621062,28.33000201578789]},{"name":"林芝地区","coord":[94.9307847458166,29.125110156601963]},{"name":"昌都地区","coord":[97.33912235873476,30.48520825551814]},{"name":"丽江市","coord":[100.65713436205135,26.96190318191959]},{"name":"攀枝花市","coord":[101.73355913301131,26.714486678752795]},{"name":"凉山彝族自治州","coord":[102.08678551422615,27.683020519860396]},{"name":"楚雄彝族自治州","coord":[101.68264761198458,25.369603845264024]},{"name":"红河哈尼族彝族自","coord":[102.95101719613119,23.624860095239875]},{"name":"文山壮族苗族自治","coord":[104.8708359910614,23.579587266862504]},{"name":"百色市","coord":[106.69546907589859,23.98220841166522]},{"name":"崇左市","coord":[107.3277087317123,22.49769755349952]},{"name":"防城港市","coord":[107.88939931155171,21.94550204069006]},{"name":"南宁市","coord":[108.67078983716917,23.12207641861882]},{"name":"钦州市","coord":[108.8532307305186,22.157690108421384]},{"name":"玉林市","coord":[110.26918466489103,22.391823643610415]},{"name":"湛江市","coord":[109.93033457863683,21.086751055633457]},{"name":"茂名市","coord":[110.80336192333934,22.069184739040775]},{"name":"阳江市","coord":[111.70471342186183,22.108751366417575]},{"name":"江门市","coord":[112.53715618649149,22.297368082806777]},{"name":"广州市","coord":[113.4949302208309,23.28359314707863]},{"name":"清远市","coord":[113.10957368131268,24.334444053233856]},{"name":"肇庆市","coord":[112.11117530204233,23.60241158796112]},{"name":"梧州市","coord":[111.01709510772797,23.518132876753846]},{"name":"贺州市","coord":[111.50423061842756,24.4095096817199]},{"name":"桂林市","coord":[110.44046163393094,25.353966673735407]},{"name":"柳州市","coord":[109.34854449214147,24.972408051485047]},{"name":"河池市","coord":[107.81191841865586,24.649291651298164]},{"name":"黔东南苗族侗族自","coord":[108.39952601614591,26.429286420465576]},{"name":"贵阳市","coord":[106.59784062851153,26.797907456479816]},{"name":"安顺市","coord":[105.76161265300635,25.988644902171018]},{"name":"黔西南布依族苗族","coord":[105.5954078788574,25.404850939549405]},{"name":"曲靖市","coord":[103.9164335632742,25.697243690315265]},{"name":"六盘水市","coord":[104.77723228072432,26.15402255629164]},{"name":"毕节地区","coord":[105.03867422931839,27.077913968069666]},{"name":"昭通市","coord":[104.29730513046874,27.62418247971078]},{"name":"宜宾市","coord":[104.76748901448207,28.553501804266475]},{"name":"乐山市","coord":[103.56027669102787,29.160754519210577]},{"name":"自贡市","coord":[104.63272827056402,29.273152614922402]},{"name":"内江市","coord":[104.82644562304716,29.61272653799929]},{"name":"遵义市","coord":[106.82413636302059,28.191847588570702]},{"name":"达州市","coord":[107.59704170009518,31.32138258839703]},{"name":"遂宁市","coord":[105.48979445433736,30.677687821242678]},{"name":"广安市","coord":[106.56708164098042,30.43500706741521]},{"name":"泸州市","coord":[105.42591761727707,28.50277238478137]},{"name":"资阳市","coord":[104.97995126874034,30.154251886139654]},{"name":"雅安市","coord":[102.69931299964517,29.892630706195035]},{"name":"眉山市","coord":[104.07052881858888,29.894202166560405]},{"name":"甘孜藏族自治州","coord":[100.50721042614238,30.975216556269658]},{"name":"果洛藏族自治州","coord":[99.30775565051923,34.03539865224808]},{"name":"海南藏族自治州","coord":[100.39969108016373,35.90048272566899]},{"name":"黄南藏族自治州","coord":[101.5360706381689,35.10286360841902]},{"name":"赣南藏族自治州","coord":[102.97083885806067,34.326752803339026]},{"name":"陇南市","coord":[105.24780098912132,33.57031117443431]},{"name":"天水市","coord":[105.53503634660417,34.62320421368087]},{"name":"定西市","coord":[104.58787768541339,35.08900966621695]},{"name":"临夏回族自治州","coord":[103.2612870434902,35.591577124455235]},{"name":"西宁市","coord":[101.57680657999033,36.84800271717157]},{"name":"海东地区","coord":[102.30909850729282,36.287400615025646]},{"name":"海北藏族自治州","coord":[100.27122484450717,37.892557516083826]},{"name":"金昌市","coord":[102.02244049169511,38.497330414886164]},{"name":"酒泉市","coord":[95.94486678270127,40.56891536586272]},{"name":"海西蒙古族藏族自","coord":[94.67143298050689,36.022725148503724]},{"name":"巴音郭楞蒙古自治","coord":[88.18116214759745,39.556478810319916]},{"name":"哈密地区","coord":[93.84302392518026,42.95015211178875]},{"name":"叶鲁番地区","coord":[89.82035217277885,42.399368632283505]},{"name":"乌鲁木齐市","coord":[88.00048109561487,43.549986370786]},{"name":"阿勒泰地区","coord":[88.11213933257655,47.05593413019629]},{"name":"博尔塔拉蒙古自治","coord":[82.26402238163408,44.671135542630864]},{"name":"伊犁哈萨克自治州","coord":[82.80778717477179,43.53783381365267]},{"name":"阿拉善盟","coord":[103.29923966842289,40.10955801781495]},{"name":"武威市","coord":[102.73362058791429,37.94211141321436]},{"name":"兰州市","coord":[103.73793563506032,36.27379827886003]},{"name":"中卫市","coord":[105.6943786030716,37.20654236148948]},{"name":"银川市","coord":[106.20022174140034,38.52103167597483]},{"name":"石嘴山市","coord":[106.41544011793628,38.84054137571417]},{"name":"乌海市","coord":[106.8984175998405,39.54616572239788]},{"name":"鄂尔多斯市","coord":[108.43285571424619,39.24036799350715]},{"name":"巴彦淖尔市","coord":[107.45840392808307,41.30159860424196]},{"name":"包头市","coord":[110.46472193224272,41.48017783644221]},{"name":"呼和浩特市","coord":[111.48365173603975,40.498363056149884]},{"name":"乌兰察布市","coord":[112.61568977597707,41.75789561273154]},{"name":"大同市","coord":[113.7107192749083,39.898956799744184]},{"name":"朔州市","coord":[112.65428748167508,39.681772914701924]},{"name":"忻州市","coord":[112.36127575589583,38.88990233614568]},{"name":"榆林市","coord":[109.68473112169593,38.19921027134876]},{"name":"延安市","coord":[109.52425222161318,36.406522726136814]},{"name":"庆阳市","coord":[107.73052193155061,36.183821532624464]},{"name":"固原市","coord":[106.20191575442442,36.11634909496382]},{"name":"白银市","coord":[104.68634478137065,36.51582865625868]},{"name":"宝鸡市","coord":[107.33534779230747,34.3387216485855]},{"name":"汉中市","coord":[107.03534754266246,33.00142998064871]},{"name":"广元市","coord":[105.92928137563939,32.21872447205537]},{"name":"巴中市","coord":[107.03422410306194,31.99874720836291]},{"name":"南充市","coord":[106.32964805032347,31.156657700184095]},{"name":"绵阳市","coord":[104.58949560201106,31.88628780630976]},{"name":"德阳市","coord":[104.41542984932845,31.110558133718676]},{"name":"成都市","coord":[103.8852290010473,30.777258040348634]},{"name":"阿坝藏族羌族自治","coord":[102.26209319552814,32.45725845387284]},{"name":"安康市","coord":[109.14236501848015,32.77467694678074]},{"name":"十堰市","coord":[110.39934083416314,32.376209039347906]},{"name":"襄阳市","coord":[111.97539147094662,31.93399822417465]},{"name":"宜昌市","coord":[111.22204852395754,30.772457669035354]},{"name":"恩施市","coord":[109.42158366502872,30.260366574390105]},{"name":"张家界市","coord":[110.59760006538717,29.330107409240718]},{"name":"吉首市","coord":[109.72176899848378,28.681903937242495]},{"name":"铜仁地区","coord":[108.54247523485463,28.11736237519646]},{"name":"重庆市","coord":[107.86007108564992,30.186253395053196]},{"name":"怀化市","coord":[109.94325166787243,27.43919084801186]},{"name":"益阳市","coord":[112.43060358108062,28.75127294553697]},{"name":"娄底市","coord":[111.41891416951897,27.696312460064604]},{"name":"常德市","coord":[111.72571610131646,29.27189463838195]},{"name":"荆州市","coord":[112.65896596965268,30.05161542755362]},{"name":"荆门市","coord":[112.6586855902184,31.01267124474617]},{"name":"岳阳市","coord":[113.2595036144316,29.106247116930163]},{"name":"长沙市","coord":[113.15415586456598,28.222934680488425]},{"name":"湘潭市","coord":[112.51092596317824,27.69881544105668]},{"name":"株州市","coord":[113.49665538546823,27.03993794610501]},{"name":"衡阳市","coord":[112.48849636578527,26.783613569970782]},{"name":"邵阳市","coord":[110.6723832117475,26.81652287086792]},{"name":"永州市","coord":[111.8565364154186,25.768488267811968]},{"name":"韶关市","coord":[113.53420325850979,24.69848878771937]},{"name":"惠州市","coord":[114.32029589634925,23.25504544231892]},{"name":"佛山市","coord":[112.95925897403649,23.10116677189257]},{"name":"云浮市","coord":[111.78042514904234,22.840400494105687]},{"name":"深圳市","coord":[114.13138648919008,22.649563063468342]},{"name":"汕尾市","coord":[115.57412892884373,23.06989642104901]},{"name":"河源市","coord":[114.89746229844398,23.97971937124767]},{"name":"揭阳市","coord":[116.04290004239446,23.304802704715357]},{"name":"汕头市","coord":[116.7008461897183,23.35898625947344]},{"name":"潮州市","coord":[116.75405548481658,23.854381508863064]},{"name":"梅州市","coord":[116.13719397345734,24.15633544812716]},{"name":"漳州市","coord":[117.38279760543345,24.41111215459575]},{"name":"厦门市","coord":[118.04275971554665,24.675908246507944]},{"name":"龙岩市","coord":[116.69341144552507,25.20284542644492]},{"name":"泉州市","coord":[118.12035864630246,25.22984144365049]},{"name":"莆田市","coord":[118.82439690138142,25.439653480972687]},{"name":"福州市","coord":[119.1608285845262,25.99117532466728]},{"name":"三明市","coord":[117.51188176216434,26.318292906961602]},{"name":"南平市","coord":[118.16153136678187,27.306303151805437]},{"name":"抚州市","coord":[116.3455359885574,27.487043655935366]},{"name":"鹰潭市","coord":[117.01082360702333,28.241253742969946]},{"name":"吉安市","coord":[114.91377151807418,26.957486660664525]},{"name":"赣州市","coord":[115.046455717572,25.81565075681663]},{"name":"郴州市","coord":[113.1544526703492,25.871927095452524]},{"name":"新余市","coord":[114.94161795877827,27.79044654578371]},{"name":"宜春市","coord":[115.04574494880995,28.306428044943356]},{"name":"南昌市","coord":[115.9963824234495,28.664803351584705]},{"name":"九江市","coord":[115.53225905704193,29.362905920276297]},{"name":"上饶市","coord":[117.8595355766598,28.765755150094634]},{"name":"景德镇市","coord":[117.25387030721845,29.33426823662448]},{"name":"黄山市","coord":[117.85476357809696,29.969632034273722]},{"name":"池州市","coord":[117.34517113140791,30.208089337922335]},{"name":"铜陵市","coord":[117.93160431300694,30.926442655001676]},{"name":"安庆市","coord":[116.54307680610799,30.524265461641296]},{"name":"黄石市","coord":[115.02354597728443,29.924060229331015]},{"name":"咸宁市","coord":[114.26967602231792,29.652174021136048]},{"name":"黄冈市","coord":[115.2859016705373,30.65856897065683]},{"name":"武汉市","coord":[114.34552076948799,30.68836237966767]},{"name":"随州市","coord":[113.3850627838818,31.87891659924412]},{"name":"信阳市","coord":[114.81374730587638,32.0309685135914]},{"name":"驻马店市","coord":[114.07756451509235,32.896720987266114]},{"name":"商洛市","coord":[109.82044421310393,33.77403373563189]},{"name":"西安市","coord":[109.11839808451401,34.225257215515896]},{"name":"渭南市","coord":[109.75732444226935,35.025913644359306]},{"name":"铜川市","coord":[108.98695328111377,35.19235092947735]},{"name":"咸阳市","coord":[108.36398776446165,34.84311348287181]},{"name":"三门峡市","coord":[110.80049688104964,34.31818709571671]},{"name":"运城市","coord":[111.1736679525165,35.19010372283576]},{"name":"洛阳市","coord":[111.87577573098216,34.33379926109848]},{"name":"平顶山市","coord":[112.80931281928427,33.759895800153096]},{"name":"漯河市","coord":[113.83505724178012,33.70034266174508]},{"name":"许昌市","coord":[113.78762484088509,34.051835688452435]},{"name":"郑州市","coord":[113.49619951867594,34.61181797865449]},{"name":"焦作市","coord":[113.13404280173008,35.134167097471625]},{"name":"晋城市","coord":[112.7495732073233,35.63186423091449]},{"name":"长治市","coord":[112.85900842873183,36.45872910742828]},{"name":"临汾市","coord":[111.49379787924448,36.22810800777857]},{"name":"太原市","coord":[112.15628804033796,37.91704444063036]},{"name":"吕梁市","coord":[111.31901105774872,37.712740463356496]},{"name":"晋中市","coord":[113.08199599739676,37.36532613794343]},{"name":"邯郸市","coord":[114.41824047234618,36.530119932543315]},{"name":"安阳市","coord":[113.88883283163116,35.7797611183252]},{"name":"鹤壁市","coord":[114.3654094911545,35.75770487428472]},{"name":"新乡市","coord":[113.9184107718167,35.348471214026716]},{"name":"开封市","coord":[114.52801677500626,34.61371216679872]},{"name":"周口市","coord":[114.88509782391864,33.69999759722657]},{"name":"阜阳市","coord":[115.44595951398213,32.98060371610532]},{"name":"淮南市","coord":[116.68941991880993,32.79972275772595]},{"name":"蚌埠市","coord":[117.38594715783302,33.106729536033896]},{"name":"淮北市","coord":[116.69651711889378,33.69527529383458]},{"name":"宿州市","coord":[117.30175405886838,33.943330421260015]},{"name":"亳州市","coord":[116.12410804185097,33.46769392946132]},{"name":"商丘市","coord":[115.59575176872548,34.28339840831147]},{"name":"菏泽市","coord":[115.53631974831816,35.197319393220624]},{"name":"濮阳市","coord":[115.3070485514902,35.775883510964334]},{"name":"聊城市","coord":[115.8870069012884,36.40529594548765]},{"name":"邢台市","coord":[114.74259008644859,37.251396750084155]},{"name":"石家庄市","coord":[114.56923838363613,38.13141710980106]},{"name":"阳泉市","coord":[113.39216149668508,38.09075470547468]},{"name":"保定市","coord":[115.261524468934,39.09118520781398]},{"name":"衡水市","coord":[115.8182936677897,37.715661598187154]},{"name":"德州市","coord":[116.4582273790399,37.19372347888644]},{"name":"沧州市","coord":[116.76192710911863,38.20240042039232]},{"name":"廊坊市","coord":[116.50410772133856,39.27896741763884]},{"name":"天津市","coord":[117.31988934444873,39.37154482470619]},{"name":"北京市","coord":[116.59734730757869,40.237112944270976]},{"name":"张家口市","coord":[115.1823606483226,40.83732566607167]},{"name":"唐山市","coord":[117.8693184261954,39.71862889477249]},{"name":"秦皇岛市","coord":[119.30467355367742,39.990574652162564]},{"name":"承德市","coord":[117.16275671911026,41.36623845548547]},{"name":"葫芦岛市","coord":[119.9342336210531,40.5628822626519]},{"name":"朝阳市","coord":[120.11853493535794,41.471852354885755]},{"name":"赤峰市","coord":[118.50943546234379,43.25452976059767]},{"name":"锦州市","coord":[121.5167549323861,41.45933087433065]},{"name":"营口市","coord":[122.58571915054674,40.42093503997384]},{"name":"丹东市","coord":[124.33549382902183,40.46369290272115]},{"name":"辽阳市","coord":[123.34064798039414,41.152331397771356]},{"name":"盘锦市","coord":[122.06718005354679,41.05573599862555]},{"name":"阜新市","coord":[121.93889757908204,42.27641773244204]},{"name":"鞍山市","coord":[122.78904432242356,40.77781183142038]},{"name":"沈阳市","coord":[122.99508899709724,42.1162195010079]},{"name":"铁岭市","coord":[124.23100515588399,42.72666083611828]},{"name":"扶顺市","coord":[124.46027188217573,41.82955407638859]},{"name":"通辽市","coord":[122.0729370657937,43.90889130864869]},{"name":"兴安盟","coord":[120.79456431092532,45.92003249442161]},{"name":"白城市","coord":[123.10619907715235,45.25475749267784]},{"name":"齐齐哈尔市","coord":[124.5462214659102,47.55395009317394]},{"name":"大兴安岭地区","coord":[124.50992855161529,52.18438447846694]},{"name":"黑河市","coord":[127.14721400335922,49.25080134026901]},{"name":"大庆市","coord":[124.40329830095243,46.401048760966745]},{"name":"绥化市","coord":[126.5214484055605,46.76992452194825]},{"name":"松原市","coord":[124.21244334807682,44.75779381338502]},{"name":"四平市","coord":[124.27839350328821,43.52139065090318]},{"name":"通化市","coord":[125.67392830706305,41.91771808663852]},{"name":"辽源市","coord":[125.33529527643432,42.758340204944986]},{"name":"吉林市","coord":[126.83350281902375,43.60730120049175]},{"name":"长春市","coord":[125.53597875970374,44.24624314701737]},{"name":"白山市","coord":[127.16780160322108,42.093893880305075]},{"name":"哈尔滨市","coord":[127.39125008786029,45.36200668820575]},{"name":"鹤岗市","coord":[130.4703811258197,47.66520688940109]},{"name":"伊春市","coord":[128.91240831703635,47.93833794565277]},{"name":"七台河市","coord":[131.2677920224311,45.945099776108584]},{"name":"鸡西市","coord":[132.38059153660274,45.722934218318535]},{"name":"双鸭山市","coord":[132.3184817002743,46.65813679030265]},{"name":"佳木斯市","coord":[132.26174446608726,47.17569713691394]},{"name":"呼伦贝尔市","coord":[122.3210739998419,50.18176996070858]},{"name":"孝感市","coord":[113.83749892135485,31.11757234692128]},{"name":"贵港市","coord":[110.07354588052804,23.380735604767374]},{"name":"黔南布依族苗族自","coord":[107.30931767543106,26.2976919432269]},{"name":"宁德市","coord":[119.52482556634342,27.013151692716413]},{"name":"温州市","coord":[120.30037042732202,27.8699145504001]},{"name":"台州市","coord":[120.88886782713843,28.670799172772313]},{"name":"丽水市","coord":[119.56796851966463,28.170268394477755]},{"name":"衢州市","coord":[118.79479802644406,28.865874397158763]},{"name":"金华市","coord":[119.99381920686633,29.093455548185744]},{"name":"绍兴市","coord":[120.46546691682343,29.69382513836818]},{"name":"宁波市","coord":[121.42142987830871,29.70001162878972]},{"name":"杭州市","coord":[119.4405685790891,29.87218307296989]},{"name":"宣城市","coord":[118.68748382914703,30.628143499626418]},{"name":"湖州市","coord":[119.98261306633574,30.7945175862809]},{"name":"嘉兴市","coord":[120.83889215988998,30.67538495499343]},{"name":"上海市","coord":[121.37534147322967,31.25628247908459]},{"name":"苏州市","coord":[120.6906182622391,31.381280695137775]},{"name":"无锡市","coord":[120.32182300914366,31.54113306724517]},{"name":"常州市","coord":[119.61953292830165,31.611878565375576]},{"name":"南京市","coord":[118.71890548838064,31.910863187910323]},{"name":"镇江市","coord":[119.42349332902813,31.97942313430778]},{"name":"合肥市","coord":[117.30651975617157,31.79407863049138]},{"name":"六安市","coord":[116.24668220575353,31.820846193819513]},{"name":"滁州市","coord":[117.88422385307969,32.51792621904418]},{"name":"泰州市","coord":[120.03124303305091,32.56503102346783]},{"name":"南通市","coord":[120.85599446760912,32.18496706099728]},{"name":"盐城市","coord":[120.01812490612667,33.54219948734023]},{"name":"淮安市","coord":[119.0749424205415,33.39203631772854]},{"name":"宿迁市","coord":[118.45404943216346,33.666258719120265]},{"name":"徐州市","coord":[117.77482249295966,34.30847766157078]},{"name":"济宁市","coord":[116.74147276546373,35.27488504351119]},{"name":"枣庄市","coord":[117.43359942491492,34.884162021736]},{"name":"连云港市","coord":[119.01553213785074,34.54316517587849]},{"name":"临沂市","coord":[118.31478835349617,35.28173079028279]},{"name":"日照市","coord":[119.14265350444272,35.54479073199592]},{"name":"青岛市","coord":[120.27779044405756,36.3464117375903]},{"name":"威海市","coord":[122.12963327195605,37.13879077904251]},{"name":"烟台市","coord":[120.7689567423966,37.19772002195597]},{"name":"潍坊市","coord":[119.02178548592039,36.49292234053931]},{"name":"淄博市","coord":[117.92936024367185,36.60871347163638]},{"name":"泰安市","coord":[116.93810893944303,36.0423330118612]},{"name":"济南市","coord":[117.34560282551296,36.769574973846304]},{"name":"东营市","coord":[118.4915054457184,37.52194690335787]},{"name":"滨州市","coord":[117.67610299757533,37.4439597758601]},{"name":"昆明市","coord":[102.93100245594789,25.481300763922075]},{"name":"玉溪市","coord":[102.23080854291823,24.156168324611663]},{"name":"塔城地区","coord":[83.60908162840168,45.3721852373893]},{"name":"张掖市","coord":[100.47710030600572,38.704239320458385]},{"name":"南阳市","coord":[112.1400670951149,33.03033276715801]},{"name":"扬州市","coord":[119.48949608990988,32.80956776339646]},{"name":"延边朝鲜族自治州","coord":[129.3577692895626,43.24968794080283]},{"name":"牡丹江市","coord":[129.87240796405672,44.7073040108322]},{"name":"澳门","coord":[113.56289691515346,22.14602596262204]},{"name":"吴忠市","coord":[106.76894508116403,37.72566765880316]},{"name":"来宾市","coord":[109.25592217010114,23.86346274681084]},{"name":"平凉市","coord":[107.0708132782897,35.30329631658711]},{"name":"马鞍山市","coord":[118.27245878467022,31.657727937739004]},{"name":"芜湖市","coord":[118.32992684415504,31.081688223101658]},{"name":"澄迈县","coord":[110.04198076060266,19.694955078668105]},{"name":"保亭黎族苗族自治","coord":[109.6055304964257,18.6101488675304]},{"name":"乐东黎族自治县","coord":[109.04051999525574,18.643137437909203]},{"name":"儋州市","coord":[109.3431358337404,19.550974957403195]},{"name":"定安县","coord":[110.38744429685676,19.47557074114284]},{"name":"屯昌县","coord":[110.00574767630334,19.367175093044388]},{"name":"白沙黎族自治县","coord":[109.36860737761768,19.214416393082217]},{"name":"琼中黎族苗族自治","coord":[109.86691465937548,19.073671135862682]},{"name":"东方市","coord":[108.86903802405428,19.017352815445214]},{"name":"昌江黎族自治县","coord":[108.9686431884767,19.182594167127824]},{"name":"海口市","coord":[110.420654296875,19.806565564640795]},{"name":"济源市","coord":[112.38051465474433,35.07958362422394]},{"name":"五指山市","coord":[109.53595187364496,18.832908264613966]},{"name":"大连市","coord":[121.96662235866603,39.444150542439914]},{"name":"文昌市三沙市","coord":[110.81828537536748,19.756501444162936]},{"name":"三亚市","coord":[109.38424600793707,18.39186315877128]},{"name":"万宁市","coord":[110.28485046979574,18.860240588635115]},{"name":"陵水黎族自治县","coord":[109.95577603229562,18.594712684620465]},{"name":"临高县","coord":[109.71915395436967,19.79420403032508]},{"name":"琼海市","coord":[110.41650700703043,19.22315873149372]}]'),fo=JSON.parse('[{"name":"黑龙江省","coord":[127.64559817675396,48.48668098449708]},{"name":"内蒙古自治区","coord":[118.34519572208615,45.370218276977525]},{"name":"新疆维吾尔自治区","coord":[87.13479065593184,41.75497055053711]},{"name":"吉林省","coord":[126.12985278813787,43.57983207702637]},{"name":"辽宁省","coord":[124.02494773936439,41.105743408203125]},{"name":"甘肃省","coord":[102.87785725633012,37.69582366943361]},{"name":"河北省","coord":[115.66327227481898,39.33383178710938]},{"name":"北京市","coord":[116.62199343603638,40.25053787231445]},{"name":"山西省","coord":[112.45180235808988,37.666561126708984]},{"name":"天津市","coord":[117.35711842642581,39.406789779663086]},{"name":"陕西省","coord":[109.56294003056632,35.64754199981689]},{"name":"宁夏回族自治区","coord":[105.96110877640074,37.3081169128418]},{"name":"青海省","coord":[96.07301048277901,35.44417190551758]},{"name":"山东省","coord":[118.03833752951093,36.29800605773925]},{"name":"西藏自治区","coord":[87.47361520439412,31.6703872680664]},{"name":"河南省","coord":[113.07832397097275,33.87751102447509]},{"name":"江苏省","coord":[119.93926538201052,32.945452690124505]},{"name":"安徽省","coord":[117.15146765881019,32.024482727050774]},{"name":"四川省","coord":[102.28998890142759,30.182161331176758]},{"name":"湖北省","coord":[112.87798261431585,31.157071113586426]},{"name":"重庆市","coord":[107.870126637831,30.188085556030266]},{"name":"上海市","coord":[121.42561166015514,31.276043891906745]},{"name":"浙江省","coord":[119.75337092707514,29.175934791564945]},{"name":"湖南省","coord":[111.52770282777405,27.38110256195069]},{"name":"江西省","coord":[115.51091280655628,27.283511161804206]},{"name":"云南省","coord":[101.27053825991308,25.19783210754396]},{"name":"贵州省","coord":[106.49672346773299,26.92267990112305]},{"name":"福建省","coord":[117.9976766946587,25.939599990844727]},{"name":"广西壮族自治区","coord":[108.98706831086302,23.891559600830078]},{"name":"台湾省","coord":[120.82468432537434,23.602651596069336]},{"name":"香港特别行政区","coord":[114.21036850371561,22.374858856201172]},{"name":"海南省","coord":[109.62792940960824,19.163116455078125]},{"name":"广东省","coord":[113.32127888266032,22.873867034912106]},{"name":"澳门特别行政区","coord":[113.56819996291901,22.160347992976]}]');function po(e){"@babel/helpers - typeof";return(po="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ho(e){return function(e){if(Array.isArray(e))return yo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return yo(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yo(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"type",r=[],n=0;n0){var i=_o(o,t);r.push.apply(r,ho(i))}}else r.push(e[n])}return r}function xo(e,t){var r=e.type,n=e.tiles;return"raster"===r&&(r===t.type&&n&&t.tiles&&(n[0].includes(t.tiles[0])||t.tiles[0].includes(n[0])))}function Po(e){return e.layerInfo&&e.layerInfo.id?e.layerInfo.id:e.metadata&&e.metadata.SM_Layer_Id?e.metadata.SM_Layer_Id:e.sourceLayer||e.source||e.id}var ko={toSuperMapGeometry:function(e){if(e&&e.type)return(new io).read(e,"FeatureCollection")[0].geometry},toSuperMapBounds:function(e){return so(e)?new Ye(e[0],e[1],e[2],e[3]):e instanceof o().LngLatBounds?new Ye(e.getWest(),e.getSouth(),e.getEast(),e.getNorth()):e},toSuperMapPoint:function(e){return so(e)?new nt(e[0],e[1]):e.lng&&e.lat?new nt(e.lng,e.lat):new nt(e.geometry.coordinates[0],e.geometry.coordinates[1])},toSuperMapPolygon:function(e){var t=e.getWest(),r=e.getEast(),n=e.getSouth(),o=e.getNorth();return new Kt([new Gt([new nt(t,n),new nt(r,n),new nt(r,o),new nt(t,o)])])},isArray:so,toGeoJSON:function(e){if(e)return(new io).toGeoJSON(e)},toProcessingParam:function(e){var t={};if(e.length<1)t="";else{for(var r=[],n=0;n1e-7;s++)t=1,a+=u=Math.PI/2-2*Math.atan(i*t)-a;return new(o().LngLat)(e[0]*r/n,a*r)},transformUrl:function(e){var t=e.url,r=e.server,n=e.excludePortalProxyUrl,o=e.credentialValue,i=e.credentialKey,a=-1===t.indexOf(".json")?"".concat(t,".json"):t,s="getUrlResource.json?url=";if(n&&r.indexOf(s)>-1){var u=r.split(s);u.length>1&&(a=u[0]+s+a)}return o&&i&&(a+="?"+i+"="+o),a}};function Eo(e){"@babel/helpers - typeof";return(Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jo(e,t){for(var r=0;r1&&(r=parseFloat(r)*l),n.labelAlign&&"cm"!==n.labelAlign)switch(n.labelAlign){case"lt":u.x+=t/2,u.y+=r/2;break;case"lm":u.x+=t/2;break;case"lb":u.x+=t/2,u.y-=r/2;break;case"ct":u.y+=r/2;break;case"cb":u.y-=r/2;break;case"rt":u.x-=t/2,u.y+=r/2;break;case"rm":u.x-=t/2;break;case"rb":u.x-=t/2,u.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=t,o=u.x-parseFloat(t)/2,i=u.y+parseFloat(r)/2,s=u.x+parseFloat(t)/2,a=u.y-parseFloat(r)/2,new Ye(o,i,s,a)}},{key:"getLabelPxBoundsByText",value:function(e,t){var r,n,o,i,a=this.getLabelPxSize(t),s=L.cloneObject(e);if(t.labelAlign&&"cm"!==t.labelAlign)switch(t.labelAlign){case"lt":s.x+=a.w/2,s.y+=a.h/2;break;case"lm":s.x+=a.w/2;break;case"lb":s.x+=a.w/2,s.y-=a.h/2;break;case"ct":s.y+=a.h/2;break;case"cb":s.y-=a.h/2;break;case"rt":s.x-=a.w/2,s.y+=a.h/2;break;case"rm":s.x-=a.w/2;break;case"rb":s.x-=a.w/2,s.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,r=s.x-a.w/2,n=s.y+a.h/2,i=t.fontStyle&&"italic"===t.fontStyle?s.x+a.w/2+parseInt(parseFloat(t.fontSize)/2):s.x+a.w/2,o=s.y-a.h/2,new Ye(r,n,i,o)}},{key:"getLabelPxSize",value:function(e){var t,r,n,o,i=parseFloat(e.strokeWidth);t=e.label||this.text,r=e.fontSize?parseFloat(e.fontSize):parseFloat("12px");var a=t.split("\n"),s=a.length;o=s>1?r*s+s+i+.2*r:r+i+.2*r+1,n=0,this.labelWTmp&&n255?r++:n++;return t.cnC=r,t.enC=n,t.textC=e.length,t}}])&&jo(r.prototype,n),o&&jo(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Mo(e){"@babel/helpers - typeof";return(Mo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ro(e,t){for(var r=0;r1&&(e=new nt(t[0],t[1])),new cr(e,this.attributes)}}])&&Uo(e.prototype,t),r&&Uo(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function Vo(e){"@babel/helpers - typeof";return(Vo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qo(e,t){for(var r=0;ri&&(i=e+s+100,n.width=i,r=!0),t+u>a&&(a=t+u+100,n.height=a,r=!0),e<-s&&(i+=s=100*Math.ceil(-e/100),n.width=i,r=!0),t<-u&&(a+=u=100*Math.ceil(-t/100),n.height=a,r=!0),r&&o.translate(s,u)}},{key:"getPixelOffset",value:function(){return{x:this._offsetX,y:this._offsetY}}},{key:"indexOf",value:function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r3&&(t=Array.prototype.slice.call(t,1));for(var n=this._handlers[e],o=n.length,i=0;i4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var n=t[t.length-1],o=this._handlers[e],i=o.length,a=0;a-this.EPSILON&&ethis.EPSILON||e<-this.EPSILON}},{key:"cubicAt",value:function(e,t,r,n,o){var i=1-o;return i*i*(i*e+3*o*t)+o*o*(o*n+3*i*r)}},{key:"cubicDerivativeAt",value:function(e,t,r,n,o){var i=1-o;return 3*(((t-e)*i+2*(r-t)*o)*i+(n-r)*o*o)}},{key:"cubicRootAt",value:function(e,t,r,n,o,i){var a=n+3*(t-r)-e,s=3*(r-2*t+e),u=3*(t-e),l=e-o,c=s*s-3*a*u,f=s*u-9*a*l,p=u*u-3*s*l,h=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(s))i[0]=0;else{var y=-u/s;y>=0&&y<=1&&(i[h++]=y)}else{var d=f*f-4*c*p;if(this.isAroundZero(d)){var m=f/c,v=-s/a+m,b=-m/2;v>=0&&v<=1&&(i[h++]=v),b>=0&&b<=1&&(i[h++]=b)}else if(d>0){var g=Math.sqrt(d),w=c*s+1.5*a*(-f+g),S=c*s+1.5*a*(-f-g),O=(-s-((w=w<0?-Math.pow(-w,this.ONE_THIRD):Math.pow(w,this.ONE_THIRD))+(S=S<0?-Math.pow(-S,this.ONE_THIRD):Math.pow(S,this.ONE_THIRD))))/(3*a);O>=0&&O<=1&&(i[h++]=O)}else{var _=(2*c*s-3*a*f)/(2*Math.sqrt(c*c*c)),x=Math.acos(_)/3,P=Math.sqrt(c),k=Math.cos(x),E=(-s-2*P*k)/(3*a),j=(-s+P*(k+this.THREE_SQRT*Math.sin(x)))/(3*a),T=(-s+P*(k-this.THREE_SQRT*Math.sin(x)))/(3*a);E>=0&&E<=1&&(i[h++]=E),j>=0&&j<=1&&(i[h++]=j),T>=0&&T<=1&&(i[h++]=T)}}return h}},{key:"cubicExtrema",value:function(e,t,r,n,o){var i=6*r-12*t+6*e,a=9*t+3*n-3*e-9*r,s=3*t-3*e,u=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(i)){var l=-s/i;l>=0&&l<=1&&(o[u++]=l)}}else{var c=i*i-4*a*s;if(this.isAroundZero(c))o[0]=-i/(2*a);else if(c>0){var f=Math.sqrt(c),p=(-i+f)/(2*a),h=(-i-f)/(2*a);p>=0&&p<=1&&(o[u++]=p),h>=0&&h<=1&&(o[u++]=h)}}return u}},{key:"cubicSubdivide",value:function(e,t,r,n,o,i){var a=(t-e)*o+e,s=(r-t)*o+t,u=(n-r)*o+r,l=(s-a)*o+a,c=(u-s)*o+s,f=(c-l)*o+l;i[0]=e,i[1]=a,i[2]=l,i[3]=f,i[4]=f,i[5]=c,i[6]=u,i[7]=n}},{key:"cubicProjectPoint",value:function(e,t,r,n,o,i,a,s,u,l,c){var f,p=this.vector.create(),h=this.vector.create(),y=this.vector.create(),d=.005,m=1/0;p[0]=u,p[1]=l;for(var v=0;v<1;v+=.05){h[0]=this.cubicAt(e,r,o,a,v),h[1]=this.cubicAt(t,n,i,s,v);var b=this.vector.distSquare(p,h);b=0&&O=0&&l<=1&&(o[u++]=l)}}else{var c=a*a-4*i*s;if(this.isAroundZero(c)){var f=-a/(2*i);f>=0&&f<=1&&(o[u++]=f)}else if(c>0){var p=Math.sqrt(c),h=(-a+p)/(2*i),y=(-a-p)/(2*i);h>=0&&h<=1&&(o[u++]=h),y>=0&&y<=1&&(o[u++]=y)}}return u}},{key:"quadraticExtremum",value:function(e,t,r){var n=e+r-2*t;return 0===n?.5:(e-t)/n}},{key:"quadraticProjectPoint",value:function(e,t,r,n,o,i,a,s,u){var l,c=this.vector.create(),f=this.vector.create(),p=this.vector.create(),h=.005,y=1/0;c[0]=a,c[1]=s;for(var d=0;d<1;d+=.05){f[0]=this.quadraticAt(e,r,o,d),f[1]=this.quadraticAt(t,n,i,d);var m=this.vector.distSquare(c,f);m=0&&w0){for(var b=this.isInsidePolygon(t.pointList,m,v),g=e.holePolygonPointLists,w=!1,S=0,O=g.length;St+s&&a>n+s||ae+s&&i>r+s||it+f&&c>n+f&&c>i+f&&c>s+f||ce+f&&l>r+f&&l>o+f&&l>a+f||lt+l&&u>n+l&&u>i+l||ue+l&&s>r+l&&s>o+l||sr||f+c=l)return!0;if(i){var p=n;n=this.normalizeRadian(o),o=this.normalizeRadian(p)}else n=this.normalizeRadian(n),o=this.normalizeRadian(o);n>o&&(o+=l);var h=Math.atan2(u,s);return h<0&&(h+=l),h>=n&&h<=o||h+l>=n&&h+l<=o}},{key:"isInsideBrokenLine",value:function(e,t,r,n){for(var o=Math.max(t,10),i=0,a=e.length-1;ir*r}},{key:"isInsideRect",value:function(e,t,r,n,o,i){return o>=e&&o<=e+r&&i>=t&&i<=t+n}},{key:"isInsideCircle",value:function(e,t,r,n,o){return(n-e)*(n-e)+(o-t)*(o-t)t&&i>n||io?nt&&l>n&&l>i&&l>s||l1&&this.swapExtrema(),y=c.cubicAt(t,n,i,s,p[0]),v>1&&(d=c.cubicAt(t,n,i,s,p[1]))),2==v?gt&&s>n&&s>i||s=0&&f<=1){for(var p=0,h=u.quadraticAt(t,n,i,f),y=0;ya||(l[y]a?0:ir||s<-r)return 0;var c=Math.sqrt(r*r-s*s);if(u[0]=-c,u[1]=c,Math.abs(n-o)>=l){n=0,o=l;var f=i?1:-1;return a>=u[0]+e&&a<=u[1]+e?f:0}if(i){var p=n;n=this.normalizeRadian(o),o=this.normalizeRadian(p)}else n=this.normalizeRadian(n),o=this.normalizeRadian(o);n>o&&(o+=l);for(var h=0,y=0;y<2;y++){var d=u[y];if(d+e>a){var m=Math.atan2(s,d),v=i?1:-1;m<0&&(m=l+m),(m>=n&&m<=o||m+l>=n&&m+l<=o)&&(m>Math.PI/2&&m<1.5*Math.PI&&(v=-v),h+=v)}}return h}},{key:"isInsidePath",value:function(e,t,r,n,o){for(var i=0,a=0,s=0,u=0,l=0,c=!0,f=!0,p="stroke"===(r=r||"fill")||"both"===r,h="fill"===r||"both"===r,y=0;y0&&(h&&(i+=this.windingLine(a,s,u,l,n,o)),0!==i))return!0;u=m[m.length-2],l=m[m.length-1],c=!1,f&&"A"!==d.command&&(f=!1,a=u,s=l)}switch(d.command){case"M":a=m[0],s=m[1];break;case"L":if(p&&this.isInsideLine(a,s,m[0],m[1],t,n,o))return!0;h&&(i+=this.windingLine(a,s,m[0],m[1],n,o)),a=m[0],s=m[1];break;case"C":if(p&&this.isInsideCubicStroke(a,s,m[0],m[1],m[2],m[3],m[4],m[5],t,n,o))return!0;h&&(i+=this.windingCubic(a,s,m[0],m[1],m[2],m[3],m[4],m[5],n,o)),a=m[4],s=m[5];break;case"Q":if(p&&this.isInsideQuadraticStroke(a,s,m[0],m[1],m[2],m[3],t,n,o))return!0;h&&(i+=this.windingQuadratic(a,s,m[0],m[1],m[2],m[3],n,o)),a=m[2],s=m[3];break;case"A":var v=m[0],b=m[1],g=m[2],w=m[3],S=m[4],O=m[5],_=Math.cos(S)*g+v,x=Math.sin(S)*w+b;f?(f=!1,u=_,l=x):i+=this.windingLine(a,s,_,x);var P=(n-v)*w/g+v;if(p&&this.isInsideArcStroke(v,b,w,S,S+O,1-m[7],t,P,o))return!0;h&&(i+=this.windingArc(v,b,w,S,S+O,1-m[7],P,o)),a=Math.cos(S+O)*g+v,s=Math.sin(S+O)*w+b;break;case"z":if(p&&this.isInsideLine(a,s,u,l,t,n,o))return!0;c=!0}}return h&&(i+=this.windingLine(a,s,u,l,n,o)),0!==i}},{key:"getTextWidth",value:function(e,t){var r=e+":"+t;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t);for(var n=0,o=0,i=(e=(e+"").split("\n")).length;othis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}},{key:"getTextHeight",value:function(e,t){var r=e+":"+t;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),t&&(this._ctx.font=t),e=(e+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*e.length;return this._ctx.restore(),this._textHeightCache[r]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}}])&&ai(e.prototype,t),r&&ai(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function li(e){"@babel/helpers - typeof";return(li="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ci(e,t){for(var r=0;r1)for(var o=0,i=n-1;o1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),function(e){return e+"%"});e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}},{key:"toArray",value:function(e){(e=this.trim(e)).indexOf("rgba")<0&&(e=this.toRGBA(e));var t=[],r=0;return e.replace(/[\d.]+/g,function(e){r<3?e|=0:e=+e,t[r++]=e}),t}},{key:"convert",value:function(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),n=r[3];return void 0===n&&(n=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):t.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,t)}},{key:"toRGBA",value:function(e){return this.convert(e,"rgba")}},{key:"toRGB",value:function(e){return this.convert(e,"rgb")}},{key:"toHex",value:function(e){return this.convert(e,"hex")}},{key:"toHSVA",value:function(e){return this.convert(e,"hsva")}},{key:"toHSV",value:function(e){return this.convert(e,"hsv")}},{key:"toHSBA",value:function(e){return this.convert(e,"hsba")}},{key:"toHSB",value:function(e){return this.convert(e,"hsb")}},{key:"toHSLA",value:function(e){return this.convert(e,"hsla")}},{key:"toHSL",value:function(e){return this.convert(e,"hsl")}},{key:"toName",value:function(e){for(var t in this._nameColors)if(this.toHex(this._nameColors[t])===this.toHex(e))return t;return null}},{key:"trim",value:function(e){return String(e).replace(/\s+/g,"")}},{key:"normalize",value:function(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=(e=this.trim(e)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){var t=(3840&(e=parseInt(e.slice(1),16)))<<8,r=(240&e)<<4,n=15&e;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return e}},{key:"lift",value:function(e,t){if(!this.isCalculableColor(e))return e;var r=t>0?1:-1;void 0===t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=this.toRGB(e);for(var n=this.getData(e),o=0;o<3;o++)n[o]=1===r?n[o]*(1-t)|0:(255-n[o])*t+n[o]|0;return"rgb("+n.join(",")+")"}},{key:"reverse",value:function(e){if(!this.isCalculableColor(e))return e;var t=this.getData(this.toRGBA(e));return t=this.map(t,function(e){return 255-e}),this.toColor(t,"rgb")}},{key:"mix",value:function(e,t,r){if(!this.isCalculableColor(e)||!this.isCalculableColor(t))return e;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,o=this.getData(this.toRGBA(e)),i=this.getData(this.toRGBA(t)),a=o[3]-i[3],s=((n*a==-1?n:(n+a)/(1+n*a))+1)/2,u=1-s,l=[],c=0;c<3;c++)l[c]=o[c]*s+i[c]*u;var f=o[3]*r+i[3]*(1-r);return f=Math.max(0,Math.min(1,f)),1===o[3]&&1===i[3]?this.toColor(l,"rgb"):(l[3]=f,this.toColor(l,"rgba"))}},{key:"random",value:function(){return"#"+Math.random().toString(16).slice(2,8)}},{key:"getData",value:function(t){var r,n,o=(t=this.normalize(t)).match(this.colorRegExp);if(null===o)throw new Error("The color format error");var i,a=[];if(o[2])i=[(r=o[2].replace("#","").split(""))[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(i,function(t){return e.prototype.adjust.call(this,parseInt(t,16),[0,255])});else if(o[4]){var s=o[4].split(",");n=s[3],i=s.slice(0,3),a=this.map(i,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),e.prototype.adjust.call(this,t,[0,255])}),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}else if(o[5]||o[6]){var u=(o[5]||o[6]).split(","),l=parseInt(u[0],0)/360,c=u[1],f=u[2];n=u[3],(a=this.map([c,f],function(t){return e.prototype.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(l),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}return a}},{key:"alpha",value:function(e,t){if(!this.isCalculableColor(e))return e;null===t&&(t=1);var r=this.getData(this.toRGBA(e));return r[3]=this.adjust(Number(t).toFixed(4),[0,1]),this.toColor(r,"rgba")}},{key:"map",value:function(e,t){if("function"!=typeof t)throw new TypeError;for(var r=e?e.length:0,n=0;n=t[1]&&(e=t[1]),e}},{key:"isCalculableColor",value:function(e){return e instanceof Array||"string"==typeof e}},{key:"_HSV_2_RGB",value:function(e){var t,r,n,o=e[0],i=e[1],a=e[2];if(0===i)t=255*a,r=255*a,n=255*a;else{var s=6*o;6===s&&(s=0);var u=0|s,l=a*(1-i),c=a*(1-i*(s-u)),f=a*(1-i*(1-(s-u))),p=0,h=0,y=0;0===u?(p=a,h=f,y=l):1===u?(p=c,h=a,y=l):2===u?(p=l,h=a,y=f):3===u?(p=l,h=c,y=a):4===u?(p=f,h=l,y=a):(p=a,h=l,y=c),t=255*p,r=255*h,n=255*y}return[t,r,n]}},{key:"_HSL_2_RGB",value:function(e){var t,r,n,o=e[0],i=e[1],a=e[2];if(0===i)t=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+i):a+i-i*a);t=255*this._HUE_2_RGB(u,s,o+1/3),r=255*this._HUE_2_RGB(u,s,o),n=255*this._HUE_2_RGB(u,s,o-1/3)}return[t,r,n]}},{key:"_HUE_2_RGB",value:function(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}},{key:"_RGB_2_HSB",value:function(e){var t,r,n=e[0]/255,o=e[1]/255,i=e[2]/255,a=Math.min(n,o,i),s=Math.max(n,o,i),u=s-a,l=s;if(0===u)t=0,r=0;else{r=u/s;var c=((s-n)/6+u/2)/u,f=((s-o)/6+u/2)/u,p=((s-i)/6+u/2)/u;n===s?t=p-f:o===s?t=1/3+c-p:i===s&&(t=2/3+f-c),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,l*=100]}},{key:"_RGB_2_HSL",value:function(e){var t,r,n=e[0]/255,o=e[1]/255,i=e[2]/255,a=Math.min(n,o,i),s=Math.max(n,o,i),u=s-a,l=(s+a)/2;if(0===u)t=0,r=0;else{r=l<.5?u/(s+a):u/(2-s-a);var c=((s-n)/6+u/2)/u,f=((s-o)/6+u/2)/u,p=((s-i)/6+u/2)/u;n===s?t=p-f:o===s?t=1/3+c-p:i===s&&(t=2/3+f-c),t<0&&(t+=1),t>1&&(t-=1)}return[t*=360,r*=100,l*=100]}}])&&ci(t.prototype,r),n&&ci(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function hi(e){"@babel/helpers - typeof";return(hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yi(e,t){for(var r=0;ro&&(o=u[0]),u[1]a&&(a=u[1])}t[0]=n,t[1]=i,r[0]=o,r[1]=a}}},{key:"cubeBezier",value:function(e,t,r,n,o,i){var a=new oi,s=[];a.cubicExtrema(e[0],t[0],r[0],n[0],s);for(var u=0;uo&&!i?o+=2*Math.PI:nn&&(f[0]=Math.cos(h)*r+e,f[1]=Math.sin(h)*r+t,u.min(a,f,a),u.max(s,f,s))}}])&&yi(e.prototype,t),r&&yi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function vi(e){"@babel/helpers - typeof";return(vi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function bi(e,t){for(var r=0;r=200&&o.status<300||304===o.status?t&&t(o.responseText):r&&r(),o.onreadystatechange=new Function,o=null)},o.send(null)}}])&&ki(e.prototype,t),r&&ki(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function Ti(e){"@babel/helpers - typeof";return(Ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ci(e,t){for(var r=0;r1)for(var t in arguments)console.log(arguments[t])}},(t=[{key:"destory",value:function(){return!0}}])&&Ni(e.prototype,t),r&&Ni(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function Di(e){"@babel/helpers - typeof";return(Di="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bi(e,t){for(var r=0;ra-2?a-1:h+1][0]+i[0],t[h>a-2?a-1:h+1][1]+i[1]],b=[t[h>a-3?a-1:h+2][0]+i[0],t[h>a-3?a-1:h+2][1]+i[1]]);var g=y*y,w=y*g;s.push([S(d[0],m[0],v[0],b[0],y,g,w),S(d[1],m[1],v[1],b[1],y,g,w)])}return s;function S(e,t,r,n,o,i,a){var s=.5*(r-e),u=.5*(n-t);return(2*(t-r)+s+u)*a+(-3*(t-r)-2*s-u)*i+s*o+t}}},{key:"SUtil_dashedLineTo",value:function(e,t,r,n,o,i,a){var s=[5,5];if(i="number"!=typeof i?5:i,e.setLineDash)return s[0]=i,s[1]=i,a&&a instanceof Array?e.setLineDash(a):e.setLineDash(s),e.moveTo(t,r),void e.lineTo(n,o);var u=n-t,l=o-r,c=Math.floor(Math.sqrt(u*u+l*l)/i);u/=c,l/=c;for(var f=!0,p=0;p-5e-5&&e<5e-5}Ki.Util_vector.sub(t,e,this.position),n(t[0])&&n(t[1])||(Ki.Util_vector.normalize(t,t),r[2]=t[0]*this.scale[1],r[3]=t[1]*this.scale[1],r[0]=t[1]*this.scale[0],r[1]=-t[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})},(t=[{key:"destroy",value:function(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}},{key:"updateNeedTransform",value:function(){function e(e){return e>5e-5||e<-5e-5}this.needLocalTransform=e(this.rotation[0])||e(this.position[0])||e(this.position[1])||e(this.scale[0]-1)||e(this.scale[1]-1)}},{key:"updateTransform",value:function(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var e=[0,0],t=this.transform||Ki.Util_matrix.create();if(Ki.Util_matrix.identity(t),this.needLocalTransform){if(o(this.scale[0])||o(this.scale[1])){e[0]=-this.scale[2]||0,e[1]=-this.scale[3]||0;var r=o(e[0])||o(e[1]);r&&Ki.Util_matrix.translate(t,t,e),Ki.Util_matrix.scale(t,t,this.scale),r&&(e[0]=-e[0],e[1]=-e[1],Ki.Util_matrix.translate(t,t,e))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){e[0]=-this.rotation[1]||0,e[1]=-this.rotation[2]||0;var n=o(e[0])||o(e[1]);n&&Ki.Util_matrix.translate(t,t,e),Ki.Util_matrix.rotate(t,t,this.rotation[0]),n&&(e[0]=-e[0],e[1]=-e[1],Ki.Util_matrix.translate(t,t,e))}}else 0!=+this.rotation&&Ki.Util_matrix.rotate(t,t,this.rotation);(o(this.position[0])||o(this.position[1]))&&Ki.Util_matrix.translate(t,t,this.position)}this.transform=t,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Ki.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Ki.Util_matrix.copy(this.transform,this.parent.transform))}function o(e){return e>5e-5||e<-5e-5}}},{key:"setTransform",value:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}},{key:"decomposeTransform",value:function(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],r=this.position,n=this.scale,o=this.rotation;a(t-1)&&(t=Math.sqrt(t));var i=e[2]*e[2]+e[3]*e[3];a(i-1)&&(i=Math.sqrt(i)),r[0]=e[4],r[1]=e[5],n[0]=t,n[1]=i,n[2]=n[3]=0,o[0]=Math.atan2(-e[1]/i,e[0]/t),o[1]=o[2]=0}function a(e){return e>5e-5||e<-5e-5}}}])&&Qi(e.prototype,t),r&&Qi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function $i(e){"@babel/helpers - typeof";return($i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ea(e,t){for(var r=0;r0}},{key:"addRoot",value:function(e){e instanceof aa&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)}},{key:"delRoot",value:function(e){if(void 0===e){for(var t=0;t=0&&(this.delFromMap(i.id),this._roots.splice(a,1),i instanceof aa&&i.delChildrenFromStorage(this))}}},{key:"addToMap",value:function(e){return e instanceof aa&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this}},{key:"get",value:function(e){return this._elements[e]}},{key:"delFromMap",value:function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof aa&&(t._storage=null)),this}},{key:"dispose",value:function(){this._elements=null,this._roots=null,this._hoverElements=null}}])&&ua(t.prototype,r),n&&ua(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function fa(e){"@babel/helpers - typeof";return(fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pa(e,t){for(var r=0;r1},isLeftClick:function(e){return e.which&&1===e.which||e.button&&1===e.button},isRightClick:function(e){return e.which&&3===e.which||e.button&&2===e.button},stop:function(e,t){t||(e.preventDefault?e.preventDefault():e.returnValue=!1),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},findElement:function(e,t){for(var r=_a.element(e);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=t.toUpperCase());)r=r.parentNode;return r},observe:function(e,t,r,n){var o=L.getElement(e);if(n=n||!1,"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||o.attachEvent)&&(t="keydown"),this.observers||(this.observers={}),!o._eventCacheID){var i="eventCacheID_";o.id&&(i=o.id+"_"+i),o._eventCacheID=L.createUniqueID(i)}var a=o._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:o,name:t,observer:r,useCapture:n}),o.addEventListener?"mousewheel"===t?o.addEventListener(t,r,{useCapture:n,passive:!1}):o.addEventListener(t,r,n):o.attachEvent&&o.attachEvent("on"+t,r)},stopObservingElement:function(e){var t=L.getElement(e)._eventCacheID;this._removeElementObservers(_a.observers[t])},_removeElementObservers:function(e){if(e)for(var t=e.length-1;t>=0;t--){var r=e[t],n=new Array(r.element,r.name,r.observer,r.useCapture);_a.stopObserving.apply(this,n)}},stopObserving:function(e,t,r,n){n=n||!1;var o=L.getElement(e),i=o._eventCacheID;"keypress"===t&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||o.detachEvent)&&(t="keydown");var a=!1,s=_a.observers[i];if(s)for(var u=0;!a&&u0&&(this.setCtxGlobalAlpha(e,"stroke",r),e.stroke()),this.setCtxGlobalAlpha(e,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(e,"stroke",r),r.lineWidth>0&&e.stroke(),this.setCtxGlobalAlpha(e,"reset",r);break;default:this.setCtxGlobalAlpha(e,"fill",r),e.fill(),this.setCtxGlobalAlpha(e,"reset",r)}this.drawText(e,r,this.style),this.afterBrush(e)}},{key:"beforeBrush",value:function(e,t){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),t&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),e.save(),this.doClip(e),this.setContext(e,r),this.setTransform(e),r}},{key:"afterBrush",value:function(e){e.restore()}},{key:"setContext",value:function(e,t){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,o=r.length;n=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height&&Ki.Util_area.isInside(this,this.style,e,t)}},{key:"drawText",value:function(e,r,n){if(void 0!==r.text&&!1!==r.text){var o=r.textColor||r.color||r.strokeColor;e.fillStyle=o;var i,a,s,u,l=10,c=r.textPosition||this.textPosition||"top",f=[];switch(f=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],c){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var p=(n||r).__rect||this.getRect(n||r);switch(c){case"inside":s=p.x+p.width/2,u=p.y+p.height/2,i="center",a="middle","stroke"!=r.brushType&&o==r.color&&(e.fillStyle="#fff");break;case"left":s=p.x-l,u=p.y+p.height/2,i="end",a="middle";break;case"right":s=p.x+p.width+l,u=p.y+p.height/2,i="start",a="middle";break;case"top":s=p.x+p.width/2,u=p.y-l,i="center",a="bottom";break;case"bottom":s=p.x+p.width/2,u=p.y+p.height+l,i="center",a="top"}}break;case"start":case"end":var h=0,y=0,d=0,m=0;if(void 0!==r.pointList){var v=r.pointList;if(v.length<2)return;var b=v.length;switch(c){case"start":h=v[0][0]+f[0],y=v[1][0]+f[0],d=v[0][1]+f[1],m=v[1][1]+f[1];break;case"end":h=v[b-2][0]+f[0],y=v[b-1][0]+f[0],d=v[b-2][1]+f[1],m=v[b-1][1]+f[1]}}else h=r.xStart+f[0]||0,y=r.xEnd+f[0]||0,d=r.yStart+f[1]||0,m=r.yEnd+f[1]||0;switch(c){case"start":i=h0&&e>this._zlevelList[0]){for(o=0;oe);o++);n=this._layers[this._zlevelList[o]]}this._zlevelList.splice(o+1,0,e),t=new as(L.createUniqueID("_levelLayer_"+e),this);var i=n?n.dom:this._bgDom;i.nextSibling?i.parentNode.insertBefore(t.dom,i.nextSibling):i.parentNode.appendChild(t.dom),t.initContext(),this._layers[e]=t,this._layerConfig[e]&&(new Wo).merge(t,this._layerConfig[e],!0),t.updateTransform()}return t}},{key:"getLayers",value:function(){return this._layers}},{key:"_updateLayerStatus",value:function(e){var t=this._layers,r={};for(var n in t)"hover"!==n&&(r[n]=t[n].elCount,t[n].elCount=0);for(var o=0;o0?1.1:1/1.1,r=this.painter.getLayers(),n=!1;for(var o in r)if("hover"!==o){var i=r[o],a=i.position;if(i.zoomable){i.__zoom=i.__zoom||1;var s=i.__zoom;s*=t,t=(s=Math.max(Math.min(i.maxZoom,s),i.minZoom))/i.__zoom,i.__zoom=s,a[0]-=(this._mouseX-a[0])*(t-1),a[1]-=(this._mouseY-a[1])*(t-1),i.scale[0]*=t,i.scale[1]*=t,i.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,Ii.EVENT.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){this._clickThreshold++,e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=Ki.Util_event.getX(e),this._mouseY=Ki.Util_event.getY(e);var t=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(e),this._processDragLeave(e)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var o=this.painter.getLayers(),i=!1;for(var a in o)if("hover"!==a){var s=o[a];s.panable&&(n="move",s.position[0]+=t,s.position[1]+=r,i=!0,s.dirty=!0)}i&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,Ii.EVENT.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(e){var t=(e=this._zrenderEventFixed(e)).toElement||e.relatedTarget;if(t!=this.root)for(;t&&9!=t.nodeType;){if(t==this.root)return void this._mousemoveHandler(e);t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.refreshHover(),this.dispatch(Ii.EVENT.GLOBALOUT,e)},mousedown:function(e){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=e.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,Ii.EVENT.MOUSEDOWN,e),this._lastDownButton=e.button},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,Ii.EVENT.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&Ki.Util_event.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment=0;o--){var i=r[o];if(void 0!==i.zlevel&&(e=this.painter.getLayer(i.zlevel,e),n[0]=this._mouseX,n[1]=this._mouseY,e.needTransform&&(Ki.Util_matrix.invert(t,e.transform),Ki.Util_vector.applyTransform(n,n,t))),this._findHover(i,n[0],n[1]))break}}},{key:"_mobildFindFixed",value:function(e){var t=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r=0&&this._clips.splice(t,1)}},{key:"_update",value:function(){for(var e=(new Date).getTime(),t=e-this._time,r=this._clips,n=r.length,o=[],i=[],a=0;a=0&&!(d[w]<=a);w--);w=Math.min(w,l-2)}else{for(w=k;wa);w++);w=Math.min(w-1,l-2)}k=w,E=a;var s=d[w+1]-d[w];if(0!==s){var c,y;for(S=(a-d[w])/s,i?(_=m[w],O=m[0===w?w:w-1],x=m[w>l-2?l-1:w+1],P=m[w>l-3?l-1:w+2],f?Cs._catmullRomInterpolateArray(O,_,x,P,S,S*S,S*S*S,n(e,u),h):(c=p?Cs.rgba2String(j):Cs._catmullRomInterpolate(O,_,x,P,S,S*S,S*S*S),r(e,u,c))):f?Cs._interpolateArray(m[w],m[w+1],S,n(e,u),h):(p?(Cs._interpolateArray(m[w],m[w+1],S,j,1),y=Cs.rgba2String(j)):y=Cs._interpolateNumber(m[w],m[w+1],S),r(e,u,y)),w=0;w=0;t--)e[t].destroy()}}},{key:"setVisibility",value:function(e){e!==this.visibility&&(this.visibility=e,this.display(e),this.redrawThematicFeatures(this.map.getBounds()))}},{key:"display",value:function(e){this.div.style.display=e?"block":"none"}},{key:"setOpacity",value:function(e){if(e!==this.opacity){this.opacity=e;var t=this.div;L.modifyDOMElement(t,null,null,null,null,null,null,e),null!==this.map&&o().Evented.prototype.fire("changelayer",{layer:this,property:"opacity"})}}},{key:"addFeatures",value:function(e){}},{key:"removeFeatures",value:function(e){var t=this;if(e){if(e===t.features)return t.removeAllFeatures();L.isArray(e)||"function"==typeof e||(e=[e]);for(var r=[],n=0;n=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){n=!0;break}}return n}},{key:"clearCache",value:function(){this.cache={},this.charts=[]}},{key:"removeFeatures",value:function(e){this.clearCache(),Zs($s(t.prototype),"removeFeatures",this).call(this,e)}},{key:"removeAllFeatures",value:function(){this.clearCache(),Zs($s(t.prototype),"removeAllFeatures",this).call(this)}},{key:"redraw",value:function(){return this.clearCache(),!!this.renderer&&(this.redrawThematicFeatures(this.map.getBounds()),!0)}},{key:"clear",value:function(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}}])&&Ys(r.prototype,n),i&&Ys(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function ru(e){"@babel/helpers - typeof";return(ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function nu(e,t){for(var r=0;rn&&(n=u[0]),u[1]o&&(o=u[1]))}return e.__rect={x:t,y:r,width:n-t,height:o-r},e.__rect}},{key:"getRectNoRotation",value:function(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition,n=Ki.Util_area.getTextHeight("ZH",e.textFont),o=Ki.Util_area.getTextWidth(e.text,e.textFont),i=Ki.Util_area.getTextHeight(e.text,e.textFont),a=e.x+r[0];"end"==e.textAlign||"right"==e.textAlign?a-=o:"center"==e.textAlign&&(a-=o/2),t="top"==e.textBaseline?e.y+r[1]:"bottom"==e.textBaseline?e.y+r[1]-i:e.y+r[1]-i/2;var s,u=!1;if(e.maxWidth){var l=parseInt(e.maxWidth);l-1&&(o+=!0===u?n/3*(o/s):n/3));return{x:a,y:t,width:o,height:i}}},{key:"getTextBackground",value:function(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!t&&e.__textBackground)return e.__textBackground;var n=this.getRectNoRotation(e),o=e.x+r[0],i=e.y+r[1],a=[];if(e.textRotation&&0!==e.textRotation){var s=e.textRotation,u=this.getRotatedLocation(n.x,n.y,o,i,s),l=this.getRotatedLocation(n.x+n.width,n.y,o,i,s),c=this.getRotatedLocation(n.x+n.width,n.y+n.height,o,i,s),f=this.getRotatedLocation(n.x,n.y+n.height,o,i,s);a.push(u),a.push(l),a.push(c),a.push(f)}else{var p=[n.x,n.y],h=[n.x+n.width,n.y],y=[n.x+n.width,n.y+n.height],d=[n.x,n.y+n.height];a.push(p),a.push(h),a.push(y),a.push(d)}return e.__textBackground=a,e.__textBackground}},{key:"getRotatedLocation",value:function(e,t,r,n,o){var i,a,s=new Array;return t=-t,n=-n,o=-o,i=(e-r)*Math.cos(o/180*Math.PI)-(t-n)*Math.sin(o/180*Math.PI)+r,a=(e-r)*Math.sin(o/180*Math.PI)+(t-n)*Math.cos(o/180*Math.PI)+n,s[0]=i,s[1]=-a,s}}])&&Pl(r.prototype,n),o&&Pl(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Il(e){"@babel/helpers - typeof";return(Il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ll(e,t){for(var r=0;r0&&("stroke"==r.brushType||"both"==r.brushType)&&(n||(e.beginPath(),this.buildPath(e,r)),this.setCtxGlobalAlpha(e,"stroke",r),e.stroke(),this.setCtxGlobalAlpha(e,"reset",r)),this.drawText(e,r,this.style);var o=L.cloneObject(r);if(o.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var i=this.holePolygonPointLists,a=i.length,s=0;s0&&("stroke"==o.brushType||"both"==o.brushType)?(n||(e.beginPath(),this.buildPath(e,o)),e.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(e,"stroke",o),e.stroke(),this.setCtxGlobalAlpha(e,"reset",o)):e.globalCompositeOperation="source-over"}e.restore()}},{key:"buildPath",value:function(e,t){t.showShadow&&(e.shadowBlur=t.shadowBlur,e.shadowColor=t.shadowColor,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,n=t.pointList;if(!(n.length<2))if(t.smooth&&"spline"!==t.smooth){var o,i,a,s=Ki.SUtil_smoothBezier(n,t.smooth,!0,t.smoothConstraint,r);e.moveTo(n[0][0]+r[0],n[0][1]+r[1]);for(var u=n.length,l=0;li&&(i=u[l][0]+r[0]),u[l][1]+r[1]s&&(s=u[l][1]+r[1]);return n="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(o-n/2),y:Math.round(a-n/2),width:i-o+n,height:s-a+n},e.__rect}}])&&Gl(r.prototype,n),o&&Gl(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Kl(e){"@babel/helpers - typeof";return(Kl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Yl(e,t){for(var r=0;rc&&(r*=c/(a=r+n),n*=c/a),o+i>c&&(o*=c/(a=o+i),i*=c/a),n+o>f&&(n*=f/(a=n+o),o*=f/a),r+i>f&&(r*=f/(a=r+i),i*=f/a),e.moveTo(u+r,l),e.lineTo(u+c-n,l),0!==n&&e.quadraticCurveTo(u+c,l,u+c,l+n),e.lineTo(u+c,l+f-o),0!==o&&e.quadraticCurveTo(u+c,l+f,u+c-o,l+f),e.lineTo(u+i,l+f),0!==i&&e.quadraticCurveTo(u,l+f,u,l+f-i),e.lineTo(u,l+r),0!==r&&e.quadraticCurveTo(u,l,u+r,l)}},{key:"buildPath",value:function(e,t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x+r[0],t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]),e.lineTo(t.x+r[0]+t.width,t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1]+t.height),e.lineTo(t.x+r[0],t.y+r[1])),e.closePath()}},{key:"getRect",value:function(e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var t,r=this.refOriginalPosition;return e.__rect?e.__rect:(t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x+r[0]-t/2),y:Math.round(e.y+r[1]-t/2),width:e.width+t,height:e.height+t},e.__rect)}}])&&nc(r.prototype,n),o&&nc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function cc(e){"@babel/helpers - typeof";return(cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function fc(e,t){for(var r=0;r1?Ki.Util_computeBoundingBox.arc(a,s,u,c,f,!p,r,o):(r[0]=o[0]=a,r[1]=o[1]=s),Ki.Util_computeBoundingBox.arc(a,s,l,c,f,!p,n,i),Ki.Util_vector.min(r,r,n),Ki.Util_vector.max(o,o,i),e.__rect={x:r[0],y:r[1],width:o[0]-r[0],height:o[1]-r[1]},e.__rect}}])&&fc(r.prototype,n),o&&fc(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function bc(e){"@babel/helpers - typeof";return(bc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gc(e,t){for(var r=0;r=15){var p=parseInt(i.axis3DParameter),h=[o[0]-p,o[1]+p];i.axisUseArrow?(c.push([h[0]+1.5,h[1]-7.5]),c.push([h[0]-1,h[1]+1]),c.push([h[0]+7.5,h[1]-1.5]),f.push([h[0],h[1]])):f.push([h[0],h[1]]),f.push([o[0],o[1]])}f.push([o[2]+5,o[1]])}else{var y=Math.abs(o[1]-o[3])/l,d=o[3];f.push([o[0],d-5]);for(var m=0;m=15){var b=parseInt(i.axis3DParameter),g=[o[0]-b,o[1]+b];i.axisUseArrow?(c.push([g[0]+1.5,g[1]-7.5]),c.push([g[0]-1,g[1]+1]),c.push([g[0]+7.5,g[1]-1.5]),f.push([g[0],g[1]])):f.push([g[0],g[1]]),f.push([o[0],o[1]])}f.push([o[2]+5,o[1]])}if(i.axisUseArrow){var w=[[o[2]+5,o[1]+4],[o[2]+13,o[1]],[o[2]+5,o[1]-4]],S=[[o[0]-4,o[3]-5],[o[0],o[3]-13],[o[0]+4,o[3]-5]],O=new Tu(w);O.style={fillColor:"#008acd"},L.copyAttributesWithClip(O.style,i.axisStyle),s.push(e.createShape(O));var _=new Tu(S);if(_.style={fillColor:"#008acd"},L.copyAttributesWithClip(_.style,i.axisStyle),s.push(e.createShape(_)),i.axis3DParameter&&!isNaN(i.axis3DParameter)&&i.axis3DParameter>=15){var x=new Tu(c);x.style={fillColor:"#008acd"},L.copyAttributesWithClip(x.style,i.axisStyle),s.push(e.createShape(x))}}var P=new Su(f);P.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},i.axisStyle&&L.copyAttributesWithClip(P.style,i.axisStyle),P.clickable=!1,P.hoverable=!1;var k=[e.createShape(P)],E=[];if(i.axisYLabels&&i.axisYLabels.length&&i.axisYLabels.length>0){var j=i.axisYLabels,T=j.length,C=[0,0];if(i.axisYLabelsOffset&&i.axisYLabelsOffset.length&&(C=i.axisYLabelsOffset),1==T){var A=new $u(o[0]-5+C[0],o[3]+C[1],j[0]);A.style={labelAlign:"right"},i.axisYLabelsStyle&&L.copyAttributesWithClip(A.style,i.axisYLabelsStyle),A.clickable=!1,A.hoverable=!1,E.push(e.createShape(A))}else for(var I=o[3],N=Math.abs(o[1]-o[3])/(T-1),M=0;M0){var B=i.axisXLabels,F=B.length,U=[0,0];if(i.axisXLabelsOffset&&i.axisXLabelsOffset.length&&(U=i.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length==F)for(var G=n.xPositions,z=0;z=0&&r[o]&&L.copyAttributesWithClip(a,r[o]),n&&n.length&&void 0!==i)for(var s=n,u=s.length,l=parseFloat(i),c=0;c0){var l=i[i.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}i.push(n)}if(i.length<2)return null;var c=new Object;(c=L.copyAttributesWithClip(c,this.style,["pointList"])).pointList=i;var f=new tc({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&L.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}},{key:"multiPointToTF",value:function(e){for(var t=e.components,r=[],n=[],o=this.location,i=[],a=this.nodesClipPixel,s=0;s0){var l=i[i.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}i.push(n);var c=new Object;c.r=6,(c=L.copyAttributesWithClip(c,this.style)).x=n[0],c.y=n[1];var f=new _l({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=o,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&L.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}},{key:"multiLineStringToTF",value:function(e){for(var t=e.components,r=0;r0){var p=i[i.length-1];if(Math.abs(p[0]-n[0])<=u&&Math.abs(p[1]-n[1])<=u)continue}i.push(n)}}else{a=[];for(var h=0;h0){var y=a[a.length-1];if(Math.abs(y[0]-n[0])<=u&&Math.abs(y[1]-n[1])<=u)continue}a.push(n)}}a.length<2||s.push(a)}if(!(i.length<2)){var d={};(d=L.copyAttributesWithClip(d,this.style,["pointList"])).pointList=i;var m=new Jl({style:d,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(m.highlightStyle=this.highlightStyle),m.refOriginalPosition=this.location,m.refDataID=this.data.id,m.isHoverByRefDataID=this.isMultiHover,s.length>0&&(m.holePolygonPointLists=s),this.shapeOptions&&L.copyAttributesWithClip(m,this.shapeOptions),this.shapes.push(m)}}},{key:"rectangleToTF",value:function(e){var t=this.location,r=new He(e.x,e.y),n=this.layer.map.getResolution(),o=this.getLocalXY(r),i=new Object;i.r=6,(i=L.copyAttributesWithClip(i,this.style)).x=o[0]-t[0],i.y=o[1]-t[1]-2*e.width/n,i.width=e.width/n,i.height=e.height/n;var a=new lc({style:i,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=t,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&L.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}},{key:"geoTextToTF",value:function(e){var t=this.location,r=this.getLocalXY(e),n=new Object;n.r=6,(n=L.copyAttributesWithClip(n,this.style,["x","y","text"])).x=r[0]-t[0],n.y=r[1]-t[1],n.text=e.text;var o=new Al({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(o.highlightStyle=this.highlightStyle),o.refOriginalPosition=t,o.refDataID=this.data.id,o.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&L.copyAttributesWithClip(o,this.shapeOptions),this.shapes.push(o)}},{key:"updateAndAddShapes",value:function(){var e=this.getLocalXY(this.lonlat);this.location=e;for(var t=this.layer.renderer,r=0,n=this.shapes.length;rs){var p=i[0];i.splice(0,1),delete o[p]}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var h=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(h)}}},{key:"createThematicFeature",value:function(e){var t=L.copyAttributesWithClip(this.style);e.style&&!0===this.isAllowFeatureStyle&&(t=L.copyAttributesWithClip(e.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Sc.transformStyle(this.highlightStyle);for(var n=new Cc(e,this,Sc.transformStyle(t),r),o=0;o0&&0==this.labelFeatures.length)for(var r=this.setLabelsStyle(this.features),n=0,o=r.length;n=0&&y.x<=f.x&&y.y>=0&&y.y<=f.y){if(r.style.minZoomLevel>-1&&l<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&l>r.style.maxZoomLevel)continue;var d=null;r.isStyleChange?(r.isStyleChange=null,d=this.calculateLabelBounds(r,y)):d=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,y):this.calculateLabelBounds(r,y);var m=new Ye(0,f.y,f.x,0),v=d.length;if(this.isAvoid){var b=this.getAvoidInfo(m,d);if(b){if("left"===b.aspectW){r.style.labelXOffset+=b.offsetX;for(var g=0;g=o[u].start&&a=o[u].start&&as&&(s=r,u="top")}if(t.y>e.bottom){var n=Math.abs(t.y-e.bottom);n>s&&(s=n,u="bottom")}if(t.xa&&(a=o,l="left")}if(t.x>e.right){var i=Math.abs(t.x-e.right);i>a&&(a=i,l="right")}}}}},{key:"isQuadrilateralOverLap",value:function(e,t){var r=e.length,n=t.length;if(5!==r||5!==n)return null;for(var o=!1,i=0;ie-n&&r.time-1?t=1:["degrees","deg","degree","dd"].indexOf(e.toLocaleLowerCase())>-1?t=2*Math.PI*6378137/360:e===fn.KILOMETER?t=1e3:e===fn.INCH?t=.025399999918:e===fn.FOOT&&(t=.3048),t},of={SquareFoot:10.763910417,SquareKiloMeter:1e-6,SquareMeter:1,SquareMile:3.86e-7,SquareYard:1.195990046};function af(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[-180,180],o=n[1],i=n[0],a=o-i;return e===o&&t?e:e===i&&r?e:0===((e-i)%a+a)%a&&t?o:((e-i)%a+a)%a+i}function sf(e){var t=parseInt(e),r=parseInt(60*(e-t)),n=parseInt(60*(60*(e-t)-r));return r=0===parseInt(r/10)?"0".concat(r):r,n=0===parseInt(n/10)?"0".concat(n):n,"".concat(t,"°").concat(r,"'").concat(n)}function uf(e,t,r){return 1/(e*t*(1/.0254)*nf(r))}function lf(e){"@babel/helpers - typeof";return(lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cf(e,t){for(var r=0;rthis.mapVOptions.maxZoom)}},{key:"_getResolution",value:function(){var e=this.map.getBounds(),t=(e.getEast()-e.getWest())/this.map.getCanvas().getBoundingClientRect().width;return nf("DEGREE")*t}},{key:"_getCenterPixel",value:function(){return this.map.project(new(o().LngLat)(0,0))}},{key:"addData",value:function(e,t){this.renderer.addData(e,t)}},{key:"update",value:function(e){this.renderer.update(e)}},{key:"getData",value:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet}},{key:"removeData",value:function(e){this.renderer&&this.renderer.removeData(e)}},{key:"clearData",value:function(){this.renderer.clearData()}},{key:"show",value:function(){return this.renderer&&this.renderer.show(),this}},{key:"hide",value:function(){return this.renderer&&this.renderer.hide(),this}},{key:"getTopLeft",value:function(){var e,t=this.map;t&&(e=t.getBounds().getNorthWest());return e}},{key:"bindEvent",value:function(){var e=this.map;this.mapVOptions.methods&&(this.mapVOptions.methods.click&&e.on("click",this.renderer.clickEvent),this.mapVOptions.methods.mousemove&&e.on("mousemove",this.renderer.mousemoveEvent))}},{key:"unbindEvent",value:function(){var e=this.map;this.mapvOptions.methods&&(this.mapvOptions.methods.click&&e.off("click",this.clickEvent),this.mapvOptions.methods.mousemove&&e.off("mousemove",this.mousemoveEvent))}},{key:"setVisibility",value:function(e){e!==this.visibility&&(this.visibility=e,e?this.show():this.hide())}},{key:"setZIndex",value:function(e){this.renderer.setZIndex(e)}}])&&cf(e.prototype,t),r&&cf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function hf(e){"@babel/helpers - typeof";return(hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yf(e,t){for(var r=0;r",a="
"+(t._createLegendElement.call(t)||"")+"
";this._container.innerHTML=i+a}return t._appendLegendCSSStyle(),this._container},r.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},new r}},{key:"_createLegendElement",value:function(){}},{key:"_addLayer",value:function(){var e=this.getLayerStyleOptions(),t=this.id?this.id:"theme3DLayer",r=this.sourceId=t+"Source";this.map.getSource(r)?(this.map.removeSource(r),this.map.addSource(r,{type:"geojson",data:this.data})):this.map.addSource(r,{type:"geojson",data:this.data}),this.map.addLayer({id:t,type:"fill-extrusion",source:r,paint:e}),this.map.moveLayer(t)}},{key:"_addHighLightLayer",value:function(){if(this.map){var e=this.map;e.addLayer({id:this._highlightLayerId,type:"fill-extrusion",source:this.sourceId,paint:this.getHighlightStyleOptions(),filter:["in","$id",""]}),this._selectFeatureId=null,e.on("mousemove",this.id,this._onMouseMove.bind(this)),e.on("mouseout",this.id,this._onMouseMove.bind(this))}}},{key:"_onMouseMove",value:function(e){var t=this,r=this.map,n=r.queryRenderedFeatures(e.point,{layers:[t.id]});if(t.highlight&&t.highlight.callback&&t.highlight.callback(n,e),!n||n.length<1)return t._clearHighlight.call(t),void(t._selectFeatureId=null);var o=n[0].id;t._selectFeatureId!==o&&(t._selectFeatureId=o,r.setFilter(t._highlightLayerId,["==","$id",t._selectFeatureId]))}},{key:"_clearHighlight",value:function(){this.map&&this.map.setFilter(this._highlightLayerId,["in","$id",""])}},{key:"_appendLegendCSSStyle",value:function(){var e=document.createElement("style");e.type="text/css";e.innerHTML="\n .legend {\n display: inline-block;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n font-size: 12px;\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n }\n .legend-light {\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 0px 6px #bbbbbb;\n -moz-box-shadow: 0px 6px 10px #bbbbbb;\n -webkit-box-shadow: 0px 0px 6px #bbbbbb;\n }\n .legend-dark {\n color: rgba(255, 255, 255, 0.8);\n background-color: rgb(64, 64, 64);\n }\n .legend .legend-title {\n min-height: 14px;\n max-width: 500px;\n padding:6px 10px;\n }\n .legend-light .legend-title {\n color: rgba(0, 0, 0, 0.8);\n }\n .legend-dark .legend-title {\n color: rgba(255, 255, 255, 0.8);\n }\n .legend-content{\n padding:6px 10px;\n }\n "+this._legendCSSStyle(),document.getElementsByTagName("head")[0].appendChild(e)}},{key:"_legendCSSStyle",value:function(){return"\n .legend ul {\n padding: 0;\n margin: 0 16px;\n height: 100%;\n display: block;\n list-style: none;\n }\n\n .legend li {\n vertical-align: middle;\n }\n\n .legend li span:first-child {\n vertical-align: middle;\n }\n\n .legend li span:last-child {\n line-height: 28px;\n max-width: 200px;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n -ms-text-overflow: ellipsis;\n }\n\n .legend-vertical li {\n height: 28px;\n }\n\n .legend-vertical li span:first-child {\n display: inline-block;\n width: 60px;\n height: 100%;\n }\n\n .legend-vertical li span:last-child {\n display: inline-block;\n margin-left: 16px;\n height: 100%;\n }\n\n .legend-horizontal li {\n height: 56px;\n float: left;\n }\n\n .legend-horizontal li span:first-child {\n display: block;\n width: 100%;\n height: 50%;\n }\n\n .legend-horizontal li span:last-child {\n display: block;\n vertical-align: middle;\n width: 60px;\n height: 50%;\n text-align: center;\n }\n "}},{key:"_extend",value:function(e){for(var t=0;t";for(e=0;e "+o;else o=o+"-"+this._getWrapperText(this.colorStops[e+1][0]);r+="
  • "+o+"
  • "}return r+=""}},{key:"_getWrapperText",value:function(e){var t=e*(null==this.legendRatio?1:parseFloat(this.legendRatio)),r=parseFloat(t);return r%1e6<=1e6?r.toString():parseInt(r/1e3)+"k"}}])&&bf(r.prototype,n),o&&bf(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function xf(e){"@babel/helpers - typeof";return(xf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pf(e,t){for(var r=0;r0&&r.attributes){var n=this.themeField,o=r.attributes,i=this.styleGroups,a=!1,s=null;for(var u in o)if(n===u){a=!0,s=o[u];break}if(a)for(var l=0,c=i.length;l=i[l].start&&s"+n+""}return e+=""}}])&&Ff(r.prototype,n),o&&Ff(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Hf(e){"@babel/helpers - typeof";return(Hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wf(e,t){for(var r=0;r0&&r.attributes){var n=this.themeField,o=r.attributes,i=this.styleGroups,a=!1,s=null;for(var u in o)if(n===u){a=!0,s=o[u];break}if(a)for(var l=0,c=i.length;l0&&void 0!==arguments[0]?arguments[0]:null;if(!e||0===e.length||e===this.graphics)return this.graphics.length=0,this.layer.props.data&&(this.layer.props.data.length=0),void this.update();L.isArray(e)||(e=[e]);for(var t=e.length-1;t>=0;t--){var r=e[t],n=L.indexOf(this.graphics,r);-1!==n&&this.graphics.splice(n,1)}this.update()}},{key:"update",value:function(){if("Awaiting state"!==this.layer.lifecycle){this.layer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0});var e=this.getState(),t=parseInt(this.canvas.style.width),r=parseInt(this.canvas.style.height);e.width=t,e.height=r,this.layer.setState(e)}}},{key:"clear",value:function(){this.removeGraphics(),this.deckGL.finalize()}},{key:"remove",value:function(){this.mapOptions.targetElement.removeChild(this.canvas)}},{key:"destroy",value:function(){this.remove(),this.clear()}},{key:"moveTo",value:function(e,t){var r=document.getElementById(this.id);if(t=void 0===t||t){var n=document.getElementById(e);r&&n&&n.parentNode.insertBefore(r,n)}else{var o=document.getElementById(e);if(r){if(o.nextSibling)return void o.parentNode.insertBefore(r,o.nextSibling);o.parentNode.appendChild(r)}}}},{key:"setVisibility",value:function(e){this.canvas&&e!==this.visibility&&(this.visibility=e,this.canvas.style.display=e?"block":"none")}},{key:"draw",value:function(){var e=this.getState(),t={};for(var r in e)t[r]=e[r];var n=parseInt(this.canvas.style.width),o=parseInt(this.canvas.style.height);t.width=n,t.height=o,t.layers=[this.layer],t.canvas=this.canvas,this.deckGL.setProps(t)}},{key:"_initContainer",value:function(){this.canvas=this._createCanvas(this.mapOptions.mapElement),this.mapOptions.targetElement.appendChild(this.canvas)}},{key:"_createCanvas",value:function(e){var t=document.createElement("canvas");return this.id&&(t.id=this.id),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.cursor="",t.width=parseInt(e.style.width),t.height=parseInt(e.style.height),t.style.width=e.style.width,t.style.height=e.style.height,t}},{key:"getState",value:function(){var e=this.functions.getMapState();return function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:null;this.renderer&&this.renderer.removeGraphics(e)}},{key:"clear",value:function(){this.renderer&&this.renderer.clear()}},{key:"remove",value:function(){this.renderer&&this.renderer.remove()}},{key:"moveTo",value:function(e,t){this.renderer.moveTo(e,t)}},{key:"setVisibility",value:function(e){this.renderer.setVisibility(e)}},{key:"getState",value:function(){return this.renderer.getState()}},{key:"getMapState",value:function(){var e={},t=this.map.getCenter(),r={longitude:t.lng,latitude:t.lat,zoom:this.map.getZoom(),maxZoom:this.map.getMaxZoom(),pitch:this.map.getPitch(),bearing:this.map.getBearing()};for(var n in r)e[n]=r[n];return this.map.getCRS&&this.map.getCRS()!==o().CRS.EPSG3857&&(e.coordinateSystem=this.coordinateSystem,e.isGeographicCoordinateSystem=this.isGeographicCoordinateSystem),e}}])&&ap(e.prototype,t),r&&ap(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),lp=function(){try{return THREE}catch(e){return{}}}();function cp(e,t,r){if(e===r||e===t)return e;var n=r-t;return((e-t)%n+n)%n+t}function fp(e){return e*Math.PI/180}var pp={matrix:[1,-1,0,0],projection:{R:6378137,minZoom:0,maxZoom:22,nativeMaxZoom:19,RAD:Math.PI/180,METERS_PER_DEGREE:6378137*Math.PI/180,MAX_LATITUDE:85.0511287798,project:function(e){var t=this.RAD,r=this.METERS_PER_DEGREE,n=this.MAX_LATITUDE,o=e instanceof Array?{lng:e[0],lat:e[1]}:{lng:e.lng,lat:e.lat},i=o.lng,a=Math.max(Math.min(n,o.lat),-n);return{x:i*r,y:(0===a?0:Math.log(Math.tan((90+a)*t/2))/t)*r}},unproject:function(e){var t,r=e.x,n=e.y,o=this.RAD,i=this.METERS_PER_DEGREE;return 0===n?t=0:(t=n/i,t=(2*Math.atan(Math.exp(t*o))-Math.PI/2)/o),{lng:cp(r/i,-180,180),lat:cp(t,-this.MAX_LATITUDE,this.MAX_LATITUDE)}},locate:function(e,t,r){if(!e)return null;if(t=t||0,r=r||0,!t&&!r)return e;var n=e.lng;if(0!==t){var o=Math.abs(t),i=fp(e.lng);n=cp(180*(i+=2*Math.sqrt(Math.pow(Math.sin(o/(2*this.R)),2)/Math.pow(Math.cos(i),2))*(o>0?1:-1))/Math.PI,-180,180)}var a=e.lat;if(0!==r){var s=Math.abs(r),u=fp(e.lat);a=cp(180*(u+=2*Math.sin(s/(2*this.R))*(s>0?1:-1))/Math.PI,-90,90)}return{lng:n,lat:a}},getResolution:function(e){if(!this.resolutions){for(var t=[],r=12756274*Math.PI,n=0;n<=this.maxZoom;n++)t[n]=r/(256*Math.pow(2,n));this.resolutions=t}var o=0|e,i=this.resolutions.length;o=o<0?0:o>i-1?i-1:o;var a=this.resolutions[o];return(0|e)!==e&&o!==i-1?a+(this.resolutions[o+1]-a)*(e-o):a}},project:function(e){return this.projection.project(e)},unproject:function(e){return this.projection.unproject(e)},lngLatToPoint:function(e,t){var r=this.project(e);return this.transform(r,this.projection.getResolution(t))},locate:function(e,t,r){return this.projection.locate(e,t,r)},transform:function(e,t){return{x:this.matrix[0]*(e.x-this.matrix[2])/t,y:this.matrix[1]*(e.y-this.matrix[3])/t}}};function hp(e){"@babel/helpers - typeof";return(hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yp(e,t){for(var r=0;r=0;t--)e.children[t]instanceof lp.Mesh&&e.remove(e.children[t]);return this}},{key:"clearAll",value:function(e){var t=this.scene;if(!t)return this;for(var r=t.children.length-1;r>=0;r--)!e&&t.children[r]instanceof lp.Camera||t.remove(t.children[r]);return this}},{key:"setPosition",value:function(e,t){if(!e||!t)return this;var r=this.lngLatToPosition(t);return e.position.set(r.x,r.y,r.z),this}},{key:"lngLatToPosition",value:function(e){var t=pp.projection.nativeMaxZoom,r=pp.lngLatToPoint(e,t);return new Sp(r.x,r.y,-0)}},{key:"distanceToThreeVector3",value:function(e,t,r){var n=this.map,o=r||n.getCenter(),i=pp.projection.nativeMaxZoom,a=pp.locate(o,e,t),s=pp.lngLatToPoint(o,i),u=pp.lngLatToPoint(a,i),l=Math.abs(u.x-s.x)*Math.sign(e),c=Math.abs(u.y-s.y)*Math.sign(t);return new Sp(l,c,0)}},{key:"removeDuplicatedCoordinates",value:function(e){function t(e,t){return e[0]===t[0]&&e[1]===t[1]}for(var r=[].concat(e),n=r.length-1;n>=1;n--)t(r[n],r[n-1])&&r.splice(n,1);return t(r[0],r[r.length-1])&&r.splice(r.length-1,1),r}},{key:"getCoordinatesCenter",value:function(e){for(var t=0,r=0,n=0,o=0,i=e.length;o0?this.convertFastToPixelPoints(e):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}},{key:"convertFastToPixelPoints",value:function(e){var t,r,n,o,i,a,s,u=[],l=e.getEast()-e.getWest(),c=e.getNorth()-e.getSouth(),f=this.mapElement;o=l/f.width>c/f.height?l/f.width:c/f.height,this.useRadius=this.useGeoUnit?parseInt(this.radius/o):this.radius;for(var p=0;p0&&this.maxWidth>0))return!1;var r=this.canvasContext;r.setTransform(1,0,0,1,0,0),this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var n=0;ne.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:this.options;(e=e||{}).strokeStyle=Object.assign({},dh,e.strokeStyle||{}),e.lngLabelStyle=Object.assign({},yh,e.lngLabelStyle||{}),e.latLabelStyle=Object.assign({},yh,e.latLabelStyle||{}),this.options=Object.assign({},mh,e,{extent:this.getDefaultExtent(e.extent),wrapX:e.wrapX}),this.oldExtent=this.options.extent,this._calcInterval(),this.isRotate=!1,this.visible=this.options.visible,this.features=this._getGraticuleFeatures()}},{key:"_createCanvas",value:function(){if(!this.canvas){var e=this.mapElement;this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px";var t=("undefined"==typeof window?{}:window).devicePixelRatio||1;this.canvas.width=parseInt(e.style.width)*t,this.canvas.height=parseInt(e.style.height)*t,this.canvas.style.width=e.style.width,this.canvas.style.height=e.style.height,this.canvas.globalAlpha=this.options.opacity,this.targetElement.appendChild(this.canvas)}}},{key:"_drawCanvas",value:function(){this.canvas||this._createCanvas(),this.setVisibility(),this._reset()}},{key:"_resizeCallback",value:function(){this.targetElement&&this.targetElement.removeChild(this.canvas),this.canvas=null,this._drawCanvas()}},{key:"_reset",value:function(){this._updateRotate(),this._updateExtent(),this._calcInterval(),this._drawLabel()}},{key:"_updateRotate",value:function(){var e=this.getMapStateByKey("getBearing");this.isRotate=e>-180&&e<=-90||e>=90&&e<180}},{key:"_updateExtent",value:function(){if(this.options.wrapX&&!this.oldExtent){var e=this.getMapStateByKey("getBounds"),t=e._ne,r=e._sw;this.options.extent=[r.lng,r.lat,t.lng,t.lat]}}},{key:"_calcInterval",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.interval;"function"==typeof e?(e=e(this.map),this._currLngInterval=e,this._currLatInterval=e):(this._currLngInterval=e,this._currLatInterval=e)}},{key:"_formatLat",value:function(e){return this.options.latFormatTickLabel?this.options.latLabelFormatter(e):e<0?sf(-1*e)+"S":e>0?sf(e)+"N":""+sf(e)}},{key:"_formatLng",value:function(e){return this.options.lngLabelFormatter?this.options.lngLabelFormatter(e):(e=af(e))>0&&e<=180?sf(e)+"E":e<0&&e>=-180?sf(-1*e)+"W":""+sf(e)}},{key:"_parsePxToInt",value:function(e){e.length>2&&"p"===e.charAt(e.length-2)&&(e=e.substr(0,e.length-2));try{return parseInt(e,10)}catch(e){console.log(e)}return 0}},{key:"_drawLabel",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.visible,r=this.canvas,n=r.getContext("2d");if(t&&this.options.showLabel){if(this.mapElement){this._currLngInterval&&this._currLatInterval||this._calcInterval(),n.clearRect(0,0,r.width,r.height);var o=this.options,i=o.lngLabelStyle,a=o.latLabelStyle,s=this._getGridiculePoints(),u=s.lngPoints,l=s.latPonits;u.forEach(function(t){e._drawLng(n,t[0],t[1],t[2],i)}),l.forEach(function(t){e._drawLat(n,t[0],t[1],t[2],a)})}}else n.clearRect(0,0,r.width,r.height)}},{key:"_drawLat",value:function(e,t,r,n,o){e=this._setLabelStyle(e,o);var i=this.canvas.width,a=12;try{var s=e.font.split(" ")[0];a=this._parsePxToInt(s)}catch(e){console.log(e)}if(!n){var u=t;t=r,r=this.getMapStateByKey("project",[u,t])}var l=this._formatLat(t),c=e.measureText(l).width;e.strokeText(l,(n?i:r.x)-c,(n?r:r.y)+a/2),e.fillText(l,(n?i:r.x)-c,(n?r:r.y)+a/2)}},{key:"_drawLng",value:function(e,t,r,n,o){e=this._setLabelStyle(e,o);var i=this.canvas.height;if(!n){var a=r;r=this.getMapStateByKey("project",[t,a])}var s=this._formatLng(t),u=e.measureText(s).width;e.strokeText(s,(n?r:r.x)-u/2,n?i:r.y),e.fillText(s,(n?r:r.x)-u/2,n?i:r.y)}},{key:"_getLatPoints",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-180,180],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(o){if(this.options.wrapX&&-180===t[0]&&180===t[1])return[];var i=[];return o.forEach(function(o){var a=o.geometry.coordinates[0][1];if(o.geometry.coordinates[1][1]===a){var s="number"==typeof n?n:t[1];e.isRotate&&(s="number"==typeof r?r:t[0]),e.options.wrapX&&(i=i.concat(e._getWrapPoints(s,a,[s,s]))),i.push([s,a])}}),i}}},{key:"_getLngPoints",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-90,90],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(o){var i="number"==typeof r?r:t[0];this.isRotate&&(i="number"==typeof n?n:t[1]);var a=[];return o.forEach(function(t){var r=t.geometry.coordinates[0][0];t.geometry.coordinates[1][0]===r&&(a.push([r,i]),e.options.wrapX&&(a=a.concat(e._getWrapPoints(r,i))))}),a}}},{key:"_getWrapPoints",value:function(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.oldExtent,n=[],o=this.getMapStateByKey("getBounds"),i=o._ne,a=o._sw,s=r.length>2?r[2]:r[1];e>=a.lng;){var u=af(e,180===s,-180===r[0]);(!r||u>=r[0]&&u<=s)&&n.push([e,t]),e-=360}for(;e<=i.lng;){var l=af(e,180===s,-180===r[0]);(!r||l>=r[0]&&l<=s)&&n.push([e,t]),e+=360}return n}},{key:"_getGridiculePoints",value:function(){var e=this._getEdgeLat(),t=this._getEdgeLng(),r=this._getRange(),n=r.latRange,o=r.lngRange,i=r.firstLat,a=r.firstLng,s=r.lastLat,u=r.lastLng;return{latPonits:this._getUniquePoint(this._getLatPoints(o,a,u),e,1),lngPoints:this._getUniquePoint(this._getLngPoints(n,i,s),t,0)}}},{key:"_getEdgeLat",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLatInterval,r=[],n=[],o=this.canvas.width,i=this.canvas.height,a=this._getRange().extent,s=this.getMapStateByKey("getBounds")._ne;if(this.options.wrapX&&af(s.lng)>a[2])return[];for(var u=this._countDecimals(t),l=0;l<=i;l++){var c=this.getMapStateByKey("unproject",[o,l]),f=af(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lat,l]),n.push(c.lat),void 0===e&&c.lat.toFixed(u)%t==0&&(e=Number(c.lat.toFixed(u))))}var p=this._getIntersectRange(e,n,r,t),h=p.first,y=p.last,d=p.coordinates,m=p.points;e=Math.min(Math.max(h,-90),90);var v=Math.max(Math.min(Math.round(y),90),-90);return-90!==e||-90!==v?this._getClosestCoordinate(e,v,d,m,t):[]}},{key:"_getEdgeLng",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLngInterval,r=[],n=[],o=this.canvas.width,i=this.canvas.height,a=this.options.extent,s=this._countDecimals(t),u=this.getMapStateByKey("getBounds")._sw;if(this.options.wrapX&&af(u.lat)>a[3])return[];for(var l=0;l<=o;l++){var c=this.getMapStateByKey("unproject",[l,i]),f=af(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lng,l]),n.push(c.lng),void 0===e&&c.lng.toFixed(s)%t==0&&(e=Number(c.lng.toFixed(s))))}var p=this._getIntersectRange(e,n,r,t),h=p.first,y=p.last,d=p.coordinates,m=p.points;return e=h,this._getClosestCoordinate(e,y,d,m,t)}},{key:"_getIntersectRange",value:function(e,t,r,n){var o=t[t.length-1];if(e>o){o=e,t.reverse(),r.reverse();for(var i=this._countDecimals(n),a=0;a<=t.length;a++){var s=t[a];if(s.toFixed(i)%n==0){e=Number(s.toFixed(i));break}}}return{first:e,last:o,coordinates:t,points:r}}},{key:"_getClosestCoordinate",value:function(e,t,r,n,o){for(var i=[],a=e;a<=t;){var s=this._getClosestNumberIndex(a,r),u=n[s];i.push([Math.round(u[0]),u[1],!0]),a+=o,r=r.slice(s),n=n.slice(s)}return i}},{key:"_getClosestNumberIndex",value:function(e,t){for(var r=0,n=Number.MAX_VALUE,o=0;o2&&void 0!==arguments[2]?arguments[2]:0;if(this.options.wrapX)return e.concat(t);if(!t||0===t.length)return e;var n=t,o=this.canvas.width,i=this.canvas.height;for(var a in e){var s=this.getMapStateByKey("project",e[a]),u=n.findIndex(function(t){return t[0]===e[a][r]});u<=-1?n.push(e[a]):s&&s.x>=0&&s.x<=o&&s.y>=0&&s.y<=i&&(n[u]=e[a])}return n}},{key:"_countDecimals",value:function(e){return Math.floor(e)!==e&&e.toString().split(".")[1].length||0}},{key:"_getGraticuleFeatures",value:function(){var e=this._currLngInterval||10,t=this._currLatInterval||10,r=[],n=this._getRange(),o=n.latRange,i=n.lngRange,a=n.firstLat,s=n.firstLng,u=n.lastLat,l=n.lastLng;this.options.wrapX&&!this.oldExtent&&(o=[-90,90],i=[-180,180],a=s=u=l=null),"number"==typeof s&&r.unshift(this._makeLineFeature(this._makeLineCoords(s,o,a,u))),"number"==typeof l&&r.unshift(this._makeLineFeature(this._makeLineCoords(l,o,a,u)));for(var c=i[0];c<=i[1];c+=e)r.unshift(this._makeLineFeature(this._makeLineCoords(c,o,a,u)));"number"==typeof a&&r.unshift(this._makeLineFeature(this._makeLineCoords(a,i,s,l,"lat"))),"number"==typeof u&&r.unshift(this._makeLineFeature(this._makeLineCoords(u,i,s,l,"lat")));for(var f=o[0];f<=o[1];f+=t)r.unshift(this._makeLineFeature(this._makeLineCoords(f,i,s,l,"lat")));return r}},{key:"_getRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.extent&&ch(this.options.extent);e&&0!==e.length||(e=this.getDefaultExtent());var t={};if((e=e.map(function(e){return Number(e.toFixed(6))}))[1]%this._currLatInterval!=0){t.firstLat=e[1];var r=Math.ceil(e[1]/this._currLatInterval);e[1]=r*this._currLatInterval}if(e[3]%this._currLatInterval!=0){t.lastLat=e[3];var n=Math.floor(e[3]/this._currLatInterval);e[3]=n*this._currLatInterval}if(e[0]%this._currLngInterval!=0){t.firstLng=e[0];var o=Math.ceil(e[0]/this._currLngInterval);e[0]=o*this._currLngInterval}if(e[2]%this._currLngInterval!=0){t.lastLng=e[2];var i=Math.floor(e[2]/this._currLngInterval);e[2]=i*this._currLngInterval}return Object.assign({latRange:[e[1],e[3]],lngRange:[e[0],e[2]],extent:e},t)}},{key:"_makeLineCoords",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[-90,90],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"lng";e="lng"===o?this._lngFix(e):e,r="number"==typeof r?r:t[0],n="number"==typeof n?n:t[1];for(var i=Math.abs(r-n),a=[],s=r;s<=n;s+=i)"lng"===o?a.push([e,s]):a.push([s,e]);return a}},{key:"_makeLineFeature",value:function(e){return{type:"Feature",geometry:{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"LineString",coordinates:e}}}},{key:"_lngFix",value:function(e){return e>=180?180:e<=-180?-180:e}},{key:"_transformStrokeStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.strokeStyle;if(!e||"string"==typeof e)return{paint:{"line-color":e||"rgba(0,0,0,0.2)"}};var t={visibility:this.visible?"visible":"none","line-join":e.lineJoin||"round","line-cap":e.lineCap||"round"},r={"line-color":e.lineColor||"rgba(0,0,0,0.2)","line-width":e.lineWidth||1,"line-offset":e.lineDashOffset||0,"line-translate-anchor":"viewport","line-opacity":e.lineOpacity||1};return e.lineWidth&&("function"==typeof e.lineWidth?r["line-width"]=e.lineWidth(this.map):r["line-width"]=e.lineWidth),e.lindDasharray&&("function"==typeof e.lindDasharray?r["line-dasharray"]=e.lindDasharray(this.map):r["line-dasharray"]=e.lindDasharray),{layout:t,paint:r}}},{key:"_setLabelStyle",value:function(e,t){return t.textColor&&(e.fillStyle=t.textColor),t.textSize&&(e.font=t.textSize+" "+(t.textFont||["Calibri","sans-serif"]).join(",")),t.textHaloColor&&(e.strokeStyle=t.textHaloColor,e.lineWidth=t.textHaloWidth||1),t.textAnchor&&(e.textBaseline=this._getTxetBaseline(t.textAnchor),e.textAligin=this._getTxetAlign(t.textAligin)),e}},{key:"_getTxetBaseline",value:function(e){if(!e)return"bottom";var t=e.split("-");return t.includes("bottom")?"bottom":t.includes("top")?"top":t.includes("center")?"middle":void 0}},{key:"_getTxetAlign",value:function(e){if(!e)return"center";var t=e.split("-");return t.includes("left")?"left":t.includes("right")?"right":t.includes("center")?"center":void 0}}])&&ph(e.prototype,t),r&&ph(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function bh(e){"@babel/helpers - typeof";return(bh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gh(e,t){for(var r=0;r=this.options.minZoom&&t<=this.options.maxZoom,this.renderer&&(this.renderer.visible=this.visible),this.map.getLayer(this.sourceId)&&this.map.setLayoutProperty(this.sourceId,"visibility",this.visible?"visible":"none"),this.renderer&&this.renderer._drawLabel()}},{key:"setMinZoom",value:function(e){this.options.minZoom=e,this.setVisibility()}},{key:"setMaxZoom",value:function(e){this.options.maxZoom=e,this.setVisibility()}},{key:"setShowLabel",value:function(e){this.options.showLabel=e,this.renderer._drawLabel()}},{key:"setExtent",value:function(e){this.options.extent=this.getDefaultExtent(e,this.map),this.renderer.setExtent(e)}},{key:"setStrokeStyle",value:function(e){if(this.map&&this.map.getLayer(this.sourceId)){this.options.strokeStyle=e;var t=this.renderer._transformStrokeStyle(e),r=t.layout,n=t.paint;for(var o in r)this.map.setLayoutProperty(this.sourceId,o,r[o]);for(var i in n)this.map.setPaintProperty(this.sourceId,i,n[i])}}},{key:"setLngLabelStyle",value:function(e){this.options.lngLabelStyle=e,this.renderer._drawLabel()}},{key:"setLatLabelStyle",value:function(e){this.options.latLabelStyle=e,this.renderer._drawLabel()}},{key:"setIntervals",value:function(e){this.renderer&&this.renderer.setIntervals(e)}},{key:"getDefaultExtent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.map,r=(t.getCRS&&t.getCRS()||{}).lngLatExtent;if(r||(r=[-180,-85.05119,180,85.05119]),!e||0===e.length)return r;var n=o().LngLatBounds.convert(e),i=n._sw,a=n._ne;return e=[i.lng,i.lat,a.lng,a.lat],e=[Math.max(r[0],e[0]),Math.max(r[1],e[1]),Math.min(r[2],e[2]),Math.min(r[3],e[3])]}},{key:"addGraticuleLayer",value:function(){if(!this.map.getSource(this.sourceId)){var e={type:"geojson",data:{type:"FeatureCollection",features:this.renderer.features}};this.map.addSource(this.sourceId,e)}if(!this.map.getLayer(this.sourceId)){var t=Object.assign({id:this.sourceId,type:"line",source:this.sourceId},this.renderer._transformStrokeStyle());this.map.addLayer(t)}}},{key:"_getLatPoints",value:function(e,t,r,n){return this.renderer._getLatPoints(e,t,r,n)}},{key:"_bindEvent",value:function(){this.map.on("styledata",this.styleDataEevent),this.map.on("resize",this.resizeEvent),this.map.on("zoomend",this.zoomendEvent)}},{key:"_unbindEvent",value:function(){this.map.off("styledata",this.styleDataEevent),this.map.off("resize",this.resizeEvent),this.map.off("zoomend",this.zoomendEvent)}},{key:"_setLayerTop",value:function(){var e=this,t=this.map;if(t){var r=t.getStyle&&t.getStyle().layers;r&&r.length&&r.findIndex(function(t){return t.id===e.sourceId})!==r.length-1&&t.getLayer(this.sourceId)&&(t.removeLayer(this.sourceId),this.addGraticuleLayer())}}},{key:"updateGraticuleLayer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.renderer.features;if(this.map.getSource(this.sourceId)){var t={type:"FeatureCollection",features:e};this.map.getSource(this.sourceId).setData(t)}this.addGraticuleLayer()}}])&&gh(e.prototype,t),r&&gh(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();!function(e){e[e.Unknown=0]="Unknown",e[e.Point=1]="Point",e[e.LineString=2]="LineString",e[e.Polygon=3]="Polygon",e[e.MultiPoint=4]="MultiPoint",e[e.MultiLineString=5]="MultiLineString",e[e.MultiPolygon=6]="MultiPolygon",e[e.GeometryCollection=7]="GeometryCollection",e[e.CircularString=8]="CircularString",e[e.CompoundCurve=9]="CompoundCurve",e[e.CurvePolygon=10]="CurvePolygon",e[e.MultiCurve=11]="MultiCurve",e[e.MultiSurface=12]="MultiSurface",e[e.Curve=13]="Curve",e[e.Surface=14]="Surface",e[e.PolyhedralSurface=15]="PolyhedralSurface",e[e.TIN=16]="TIN",e[e.Triangle=17]="Triangle"}(Sh||(Sh={}));var kh,Eh=new Int32Array(2),jh=new Float32Array(Eh.buffer),Th=new Float64Array(Eh.buffer),Ch=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];function Ah(e){"@babel/helpers - typeof";return(Ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ih(e,t){for(var r=0;r>24}},{key:"readUint8",value:function(e){return this.bytes_[e]}},{key:"readInt16",value:function(e){return this.readUint16(e)<<16>>16}},{key:"readUint16",value:function(e){return this.bytes_[e]|this.bytes_[e+1]<<8}},{key:"readInt32",value:function(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}},{key:"readUint32",value:function(e){return this.readInt32(e)>>>0}},{key:"readInt64",value:function(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<>8}},{key:"writeUint16",value:function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}},{key:"writeInt32",value:function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}},{key:"writeUint32",value:function(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}},{key:"writeInt64",value:function(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}},{key:"writeUint64",value:function(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}},{key:"writeFloat32",value:function(e,t){jh[0]=t,this.writeInt32(e,Eh[0])}},{key:"writeFloat64",value:function(e,t){Th[0]=t,this.writeInt32(e,Eh[Ch?0:1]),this.writeInt32(e+4,Eh[Ch?1:0])}},{key:"getBufferIdentifier",value:function(){if(this.bytes_.length=0;r--)e.addInt32(t[r]);return e.endVector()}},{key:"startEndsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"addXy",value:function(e,t){e.addFieldOffset(1,t,0)}},{key:"createXyVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startXyVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addZ",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"createZVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startZVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addM",value:function(e,t){e.addFieldOffset(3,t,0)}},{key:"createMVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startMVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addT",value:function(e,t){e.addFieldOffset(4,t,0)}},{key:"createTVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startTVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addTm",value:function(e,t){e.addFieldOffset(5,t,0)}},{key:"createTmVector",value:function(e,t){e.startVector(8,t.length,8);for(var r=t.length-1;r>=0;r--)e.addInt64(t[r]);return e.endVector()}},{key:"startTmVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addType",value:function(e,t){e.addFieldInt8(6,t,Sh.Unknown)}},{key:"addParts",value:function(e,t){e.addFieldOffset(7,t,0)}},{key:"createPartsVector",value:function(e,t){e.startVector(4,t.length,4);for(var r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}},{key:"startPartsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"endGeometry",value:function(e){return e.endObject()}},{key:"createGeometry",value:function(t,r,n,o,i,a,s,u,l){return e.startGeometry(t),e.addEnds(t,r),e.addXy(t,n),e.addZ(t,o),e.addM(t,i),e.addT(t,a),e.addTm(t,s),e.addType(t,u),e.addParts(t,l),e.endGeometry(t)}}],(r=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"ends",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb.__vector(this.bb_pos+t)+4*e):0}},{key:"endsLength",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"endsArray",value:function(){var e=this.bb.__offset(this.bb_pos,4);return e?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"xy",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"xyLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"xyArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"z",value:function(e){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"zLength",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"zArray",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"m",value:function(e){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"mLength",value:function(){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"mArray",value:function(){var e=this.bb.__offset(this.bb_pos,10);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"t",value:function(e){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"tLength",value:function(){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"tArray",value:function(){var e=this.bb.__offset(this.bb_pos,12);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"tm",value:function(e){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readUint64(this.bb.__vector(this.bb_pos+t)+8*e):BigInt(0)}},{key:"tmLength",value:function(){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"type",value:function(){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readUint8(this.bb_pos+e):Sh.Unknown}},{key:"parts",value:function(t,r){var n=this.bb.__offset(this.bb_pos,18);return n?(r||new e).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*t),this.bb):null}},{key:"partsLength",value:function(){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}}])&&Rh(t.prototype,r),n&&Rh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function Uh(e,t){for(var r=[],n=0;n>1]),r.push(o)}return r}function Gh(e,t,r){if(!r||0===r.length)return[Uh(e,t)];var n,o=0,i=Array.from(r).map(function(t){return e.slice(o,o=t<<1)});return t&&(o=0,n=Array.from(r).map(function(e){return t.slice(o,o=e)})),i.map(function(e,t){return Uh(e,n?n[t]:void 0)})}function zh(e,t){var r=t;if(r===Sh.Unknown&&(r=e.type()),r===Sh.GeometryCollection){for(var n=[],o=0;o=0;r--)e.addInt8(t[r]);return e.endVector()}},{key:"startPropertiesVector",value:function(e,t){e.startVector(1,t,1)}},{key:"addColumns",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"createColumnsVector",value:function(e,t){e.startVector(4,t.length,4);for(var r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}},{key:"startColumnsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"endFeature",value:function(e){return e.endObject()}},{key:"finishFeatureBuffer",value:function(e,t){e.finish(t)}},{key:"finishSizePrefixedFeatureBuffer",value:function(e,t){e.finish(t,void 0,!0)}},{key:"createFeature",value:function(t,r,n,o){return e.startFeature(t),e.addGeometry(t,r),e.addProperties(t,n),e.addColumns(t,o),e.endFeature(t)}}],(r=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"geometry",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?(e||new Fh).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}},{key:"properties",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readUint8(this.bb.__vector(this.bb_pos+t)+e):0}},{key:"propertiesLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"propertiesArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"columns",value:function(e,t){var r=this.bb.__offset(this.bb_pos,8);return r?(t||new Wh).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"columnsLength",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}}])&&Kh(t.prototype,r),n&&Kh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}(),Xh=(new TextEncoder,new TextDecoder);function Zh(e,t){var r={};if(!t||0===t.length)return r;var n=e.propertiesArray();if(!n)return r;for(var o=new DataView(n.buffer,n.byteOffset),i=e.propertiesLength(),a=0;a0?{done:!1,value:t}:{done:!0,value:void 0}:{done:!1,value:function(e,t){if(!e.length)return t;if(!t.length)return e;var r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),r}(t,r.value)}})},ty.prototype.slice=function(e){if((e|=0)<0)throw new Error("invalid length");var t=this,r=this._array.length-this._index;if(this._index+e<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=e));var n=new Uint8Array(e);return n.set(this._array.subarray(this._index)),function o(){return t._source.read().then(function(i){return i.done?(t._array=ey,t._index=0,r>0?n.subarray(0,r):null):r+i.value.length>=e?(t._array=i.value,t._index=e-r,n.set(i.value.subarray(0,e-r),r),n):(n.set(i.value,r),r+=i.value.length,o())})}()},ty.prototype.cancel=function(){return this._source.cancel()};var iy=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bb=null,this.bb_pos=0}return t=e,n=[{key:"getRootAsCrs",value:function(t,r){return(r||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"getSizePrefixedRootAsCrs",value:function(t,r){return t.setPosition(t.position()+4),(r||new e).__init(t.readInt32(t.position())+t.position(),t)}},{key:"startCrs",value:function(e){e.startObject(6)}},{key:"addOrg",value:function(e,t){e.addFieldOffset(0,t,0)}},{key:"addCode",value:function(e,t){e.addFieldInt32(1,t,0)}},{key:"addName",value:function(e,t){e.addFieldOffset(2,t,0)}},{key:"addDescription",value:function(e,t){e.addFieldOffset(3,t,0)}},{key:"addWkt",value:function(e,t){e.addFieldOffset(4,t,0)}},{key:"addCodeString",value:function(e,t){e.addFieldOffset(5,t,0)}},{key:"endCrs",value:function(e){return e.endObject()}},{key:"createCrs",value:function(t,r,n,o,i,a,s){return e.startCrs(t),e.addOrg(t,r),e.addCode(t,n),e.addName(t,o),e.addDescription(t,i),e.addWkt(t,a),e.addCodeString(t,s),e.endCrs(t)}}],(r=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"org",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"code",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}},{key:"name",value:function(e){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"description",value:function(e){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"wkt",value:function(e){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"codeString",value:function(e){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__string(this.bb_pos+t,e):null}}])&&ny(t.prototype,r),n&&ny(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function ay(e){"@babel/helpers - typeof";return(ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sy(e,t){for(var r=0;r=0;r--)e.addFloat64(t[r]);return e.endVector()}},{key:"startEnvelopeVector",value:function(e,t){e.startVector(8,t,8)}},{key:"addGeometryType",value:function(e,t){e.addFieldInt8(2,t,Sh.Unknown)}},{key:"addHasZ",value:function(e,t){e.addFieldInt8(3,+t,0)}},{key:"addHasM",value:function(e,t){e.addFieldInt8(4,+t,0)}},{key:"addHasT",value:function(e,t){e.addFieldInt8(5,+t,0)}},{key:"addHasTm",value:function(e,t){e.addFieldInt8(6,+t,0)}},{key:"addColumns",value:function(e,t){e.addFieldOffset(7,t,0)}},{key:"createColumnsVector",value:function(e,t){e.startVector(4,t.length,4);for(var r=t.length-1;r>=0;r--)e.addOffset(t[r]);return e.endVector()}},{key:"startColumnsVector",value:function(e,t){e.startVector(4,t,4)}},{key:"addFeaturesCount",value:function(e,t){e.addFieldInt64(8,t,BigInt("0"))}},{key:"addIndexNodeSize",value:function(e,t){e.addFieldInt16(9,t,16)}},{key:"addCrs",value:function(e,t){e.addFieldOffset(10,t,0)}},{key:"addTitle",value:function(e,t){e.addFieldOffset(11,t,0)}},{key:"addDescription",value:function(e,t){e.addFieldOffset(12,t,0)}},{key:"addMetadata",value:function(e,t){e.addFieldOffset(13,t,0)}},{key:"endHeader",value:function(e){return e.endObject()}},{key:"finishHeaderBuffer",value:function(e,t){e.finish(t)}},{key:"finishSizePrefixedHeaderBuffer",value:function(e,t){e.finish(t,void 0,!0)}}],(r=[{key:"__init",value:function(e,t){return this.bb_pos=e,this.bb=t,this}},{key:"name",value:function(e){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"envelope",value:function(e){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readFloat64(this.bb.__vector(this.bb_pos+t)+8*e):0}},{key:"envelopeLength",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"envelopeArray",value:function(){var e=this.bb.__offset(this.bb_pos,6);return e?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}},{key:"geometryType",value:function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):Sh.Unknown}},{key:"hasZ",value:function(){var e=this.bb.__offset(this.bb_pos,10);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasM",value:function(){var e=this.bb.__offset(this.bb_pos,12);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasT",value:function(){var e=this.bb.__offset(this.bb_pos,14);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"hasTm",value:function(){var e=this.bb.__offset(this.bb_pos,16);return!!e&&!!this.bb.readInt8(this.bb_pos+e)}},{key:"columns",value:function(e,t){var r=this.bb.__offset(this.bb_pos,18);return r?(t||new Wh).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null}},{key:"columnsLength",value:function(){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__vector_len(this.bb_pos+e):0}},{key:"featuresCount",value:function(){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readUint64(this.bb_pos+e):BigInt("0")}},{key:"indexNodeSize",value:function(){var e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readUint16(this.bb_pos+e):16}},{key:"crs",value:function(e){var t=this.bb.__offset(this.bb_pos,24);return t?(e||new iy).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}},{key:"title",value:function(e){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"description",value:function(e){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__string(this.bb_pos+t,e):null}},{key:"metadata",value:function(e){var t=this.bb.__offset(this.bb_pos,30);return t?this.bb.__string(this.bb_pos+t,e):null}}])&&sy(t.prototype,r),n&&sy(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function cy(e){for(var t=ly.getRootAsHeader(e),r=t.featuresCount(),n=t.indexNodeSize(),o=[],i=0;i0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function dy(e){return this instanceof dy?(this.v=e,this):new dy(e)}function my(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise(function(r,n){i.push([e,t,r,n])>1||s(e,t)})})}function s(e,t){try{(r=o[e](t)).value instanceof dy?Promise.resolve(r.value.v).then(u,l):c(i[0][2],r)}catch(e){c(i[0][3],e)}var r}function u(e){s("next",e)}function l(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}var vy=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(e,t){function r(){this.constructor=e}fy(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t}(Error);(function(){function e(e){if(e<0)throw new RangeError("Capacity may not be less than 0");this._c=e,this._q=[]}Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),e.prototype.add=function(e){if(this.full)throw new Error("Buffer full");this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}})(),function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){for(;this._q.length>=this._c;)this._q.shift();this._q.push(e)},e.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}}(),function(){function e(e){if(e<1)throw new RangeError("Capacity may not be less than 1");this._c=e,this._q=[]}Object.defineProperty(e.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.add=function(e){this._q.length=Oy;return Promise.resolve(t).then(function(t){return!r&&e.state>=_y?ky(e).then(function(e){return{value:e,done:!0}}):{value:t,done:r}})}function jy(e,t){var r,n;if(!(e.state>=Sy))if(e.state=Sy,e.onnext(),e.onstop(),null==e.err&&(e.err=t),0!==e.pushes.length||void 0!==e.buffer&&!e.buffer.empty)try{for(var o=yy(e.pushes),i=o.next();!i.done;i=o.next()){i.value.resolve()}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}else Ty(e)}function Ty(e){var t,r;if(!(e.state>=Oy)){e.state=_y||(e.state=wy)){e.state=wy;var t=function(e,t){if(by(t),e.pushes.length>=xy)throw new vy("No more than "+xy+" pending calls to push are allowed on a single repeater.");if(e.state>=Sy)return Promise.resolve(void 0);var r,n=void 0===e.pending?Promise.resolve(t):e.pending.then(function(){return t});n=n.catch(function(t){e.state=xy)throw new vy("No more than "+xy+" pending calls to next are allowed on a single repeater.");if(t.state<=gy&&Ay(t),t.onnext(e),void 0!==t.buffer&&!t.buffer.empty){var r=Ey(t,t.buffer.remove());if(t.pushes.length){var n=t.pushes.shift();t.buffer.add(n.value),t.onnext=n.resolve}return r}if(t.pushes.length){var o=t.pushes.shift();return t.onnext=o.resolve,Ey(t,o.value)}return t.state>=Sy?(Ty(t),Ey(t,ky(t))):new Promise(function(r){return t.nexts.push({resolve:r,value:e})})},e.prototype.return=function(e){by(e);var t=Iy.get(this);if(void 0===t)throw new Error("WeakMap error");return Ty(t),t.execution=Promise.resolve(t.execution).then(function(){return e}),Ey(t,ky(t))},e.prototype.throw=function(e){var t=Iy.get(this);if(void 0===t)throw new Error("WeakMap error");return t.state<=gy||t.state>=Sy||void 0!==t.buffer&&!t.buffer.empty?(Ty(t),null==t.err&&(t.err=e),Ey(t,ky(t))):this.next(Promise.reject(e))},e.prototype[Symbol.asyncIterator]=function(){return this},e.race=My,e.merge=Ry,e.zip=Dy,e.latest=By,e}();function Ny(e,t){var r,n,o=[],i=function(e){null!=e&&"function"==typeof e[Symbol.asyncIterator]?o.push(e[Symbol.asyncIterator]()):null!=e&&"function"==typeof e[Symbol.iterator]?o.push(e[Symbol.iterator]()):o.push(function(){return my(this,arguments,function(){return hy(this,function(r){switch(r.label){case 0:return t.yieldValues?[4,dy(e)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return t.returnValues?[4,dy(e)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var a=yy(e),s=a.next();!s.done;s=a.next()){i(s.value)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function My(e){var t=this,r=Ny(e,{returnValues:!0});return new Ly(function(e,n){return py(t,void 0,void 0,function(){var t,o,i,a,s,u;return hy(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2];o=!1,n.then(function(){t(),o=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),a=void 0,s=0,u=function(){var o,u,l,c,f,p;return hy(this,function(h){switch(h.label){case 0:o=s;try{for(f=void 0,u=yy(r),l=u.next();!l.done;l=u.next())c=l.value,Promise.resolve(c.next()).then(function(e){e.done?(n(),void 0===i&&(i=e)):s===o&&(s++,t(e))},function(e){return n(e)})}catch(e){f={error:e}}finally{try{l&&!l.done&&(p=u.return)&&p.call(u)}finally{if(f)throw f.error}}return[4,new Promise(function(e){return t=e})];case 1:return void 0===(a=h.sent())?[3,3]:[4,e(a.value)];case 2:h.sent(),h.label=3;case 3:return[2]}})},l.label=2;case 2:return o?[3,4]:[5,u()];case 3:return l.sent(),[3,2];case 4:return[2,i&&i.value];case 5:return n(),[4,Promise.race(r.map(function(e){return e.return&&e.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function Ry(e){var t=this,r=Ny(e,{yieldValues:!0});return new Ly(function(e,n){return py(t,void 0,void 0,function(){var t,o,i,a=this;return hy(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2];t=[],o=!1,n.then(function(){var e,r;o=!0;try{for(var n=yy(t),i=n.next();!i.done;i=n.next()){(0,i.value)()}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}}),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,s){return py(a,void 0,void 0,function(){var a;return hy(this,function(u){switch(u.label){case 0:u.trys.push([0,,6,9]),u.label=1;case 1:return o?[3,5]:(Promise.resolve(r.next()).then(function(e){return t[s](e)},function(e){return n(e)}),[4,new Promise(function(e){t[s]=e})]);case 2:return void 0===(a=u.sent())?[3,4]:a.done?(i=a,[2]):[4,e(a.value)];case 3:u.sent(),u.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:u.sent(),u.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return s.sent(),[2,i&&i.value];case 3:return n(),[7];case 4:return[2]}})})})}function Dy(e){var t=this,r=Ny(e,{returnValues:!0});return new Ly(function(e,n){return py(t,void 0,void 0,function(){var t,o,i,a;return hy(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2,[]];o=!1,n.then(function(){t(),o=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return o?[3,5]:(Promise.all(r.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return n(e)}),[4,new Promise(function(e){return t=e})]);case 3:return void 0===(i=s.sent())?[2]:(a=i.map(function(e){return e.value}),i.some(function(e){return e.done})?[2,a]:[4,e(a)]);case 4:return s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(r.map(function(e){return e.return&&e.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function By(e){var t=this,r=Ny(e,{yieldValues:!0,returnValues:!0});return new Ly(function(e,n){return py(t,void 0,void 0,function(){var t,o,i,a,s,u=this;return hy(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2,[]];o=[],i=!1,n.then(function(){var e,r;t();try{for(var n=yy(o),a=n.next();!a.done;a=n.next()){(0,a.value)()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}i=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(e){return e.next()})).then(function(e){return t(e)},function(e){return n(e)}),[4,new Promise(function(e){return t=e})];case 2:return void 0===(a=l.sent())?[2]:(s=a.map(function(e){return e.value}),a.every(function(e){return e.done})?[2,s]:[4,e(s.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(t,r){return py(u,void 0,void 0,function(){var u;return hy(this,function(l){switch(l.label){case 0:if(a[r].done)return[2,a[r].value];l.label=1;case 1:return i?[3,4]:(Promise.resolve(t.next()).then(function(e){return o[r](e)},function(e){return n(e)}),[4,new Promise(function(e){return o[r]=e})]);case 2:return void 0===(u=l.sent())?[2,a[r].value]:u.done?[2,u.value]:(s[r]=u.value,[4,e(s.slice())]);case 3:return l.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return n(),[4,Promise.all(r.map(function(e){return e.return&&e.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function Fy(e){"@babel/helpers - typeof";return(Fy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Uy(e,t){for(var r=0;re)){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Zy(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $y(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rthis.nodes[1]),this.nodes[1]=e}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&td(e.prototype,t),r&&td(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),a=n.minX,s=n.minY,u=n.maxX,l=n.maxY,Yy.info("tree items: ".concat(t,", nodeSize: ").concat(r)),c=sd(t,r),f=c[0][0],void 0,d=c.length-1,p=new i([0,1],d),h=[p],Yy.debug("starting stream search with queue: ".concat(h,", numItems: ").concat(t,", nodeSize: ").concat(r,", levelBounds: ").concat(c)),y=Xy().mark(function e(){var n,p,y,d,m,v,b,g,w;return Xy().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=h.shift(),Yy.debug("popped node: ".concat(n,", queueLength: ").concat(h.length)),p=n.startNodeIdx(),y=p>=f,d=function(){var e=Zy(c[n.level()],2)[1],t=Math.min(n.endNodeIdx()+r,e);return y&&tb.getFloat64(c+16,!0))){e.next=8;break}return e.abrupt("return",0);case 8:if(!(s>b.getFloat64(c+24,!0))){e.next=10;break}return e.abrupt("return",0);case 10:if(d=b.getBigUint64(c+32,!0),!y){e.next=18;break}return m=d,v=function(){if(r ").concat(w)),O.extendEndNodeIdx(Number(w)),e.abrupt("return",0);case 25:void 0,void 0,x=n.level()-1,P=[Number(w),Number(w)+1],_=new i(P,x),void 0!==O&&O.level()==_.level()?Yy.info("Same level, but too far away. Pushing new request for nodeIdx: ".concat(w," rather than merging with distant ").concat(O)):Yy.info("Pushing new level for ".concat(_," onto queue with nearestNodeRange: ").concat(O," since there's not already a range for this level.")),h.push(_);case 28:case"end":return e.stop()}var x,P},e)}),w=p;case 12:if(!(w=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function yd(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||dd(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dd(e,t){if(e){if("string"==typeof e)return md(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?md(e,t):void 0}}function md(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function bd(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function gd(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){bd(i,n,o,a,s,"next",e)}function s(e){bd(i,n,o,a,s,"throw",e)}a(void 0)})}}function wd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sd(e,t){for(var r=0;rqy.global.extraRequestThreshold()&&(Yy.info("Pushing new feature batch, since gap ".concat(g," was too large")),a.push(s),s=[]),s.push([d,v]);case 23:u=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),l=!0,c=r.t0;case 32:if(r.prev=32,r.prev=33,!u||null==f.return){r.next=37;break}return r.next=37,kd(f.return());case 37:if(r.prev=37,!l){r.next=40;break}throw c;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return t.headerClient.logUsage("header+index"),s.length>0&&a.push(s),w=a.flatMap(function(e){return t.readFeatureBatch(e,t.nocache)}),r.delegateYield(Ed(Td(Ly.merge(w))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return cd.length+fd+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(e){return new Id(this.headerClient.httpClient,e)}},{key:"readFeatureBatch",value:function(e,t){var r=this;return xd(vd().mark(function n(){var o,i,a,s,u,l,c,f,p,h,y,d;return vd().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:o=yd(e[0],1),i=o[0],a=yd(e[e.length-1],2),s=a[0],u=a[1],l=s+u-i,c=r.buildFeatureClient(t),f=l,p=hd(e),n.prev=8,p.s();case 10:if((h=p.n()).done){n.next=19;break}return y=yd(h.value,1),d=y[0],n.next=14,kd(r.readFeature(c,d,f));case 14:return n.next=16,n.sent;case 16:f=0;case 17:n.next=10;break;case 19:n.next=24;break;case 21:n.prev=21,n.t0=n.catch(8),p.e(n.t0);case 24:return n.prev=24,p.f(),n.finish(24);case 27:c.logUsage("feature");case 28:case"end":return n.stop()}},n,null,[[8,21,24,27]])}))()}},{key:"readFeature",value:function(){var e=gd(vd().mark(function e(t,r,n){var o,i,a,s,u,l,c;return vd().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=r+this.lengthBeforeFeatures(),e.next=3,t.getRange(o,4,n,"feature length");case 3:return a=e.sent,i=new DataView(a).getUint32(0,!0),e.next=7,t.getRange(o+4,i,n,"feature data");case 7:return s=e.sent,u=new Uint8Array(s),(l=new Uint8Array(i+fd)).set(u,fd),(c=new Nh(l)).setPosition(fd),e.abrupt("return",Qh.getRootAsFeature(c));case 14:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()}],[{key:"open",value:function(){var t=gd(vd().mark(function t(r,n){var o,i,a,s,u,l,c,f,p,h,y;return vd().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=2024,i=new Id(r,n),a=function(){var e,t=0;for(e=0;e<3;e++){t+=Math.pow(16,e)*id}return t}(),s=o+a,Yy.debug("fetching header. minReqLength: ".concat(s," (assumedHeaderLength: ").concat(o,", assumedIndexLength: ").concat(a,")")),t.t0=Uint8Array,t.next=8,i.getRange(0,8,s,"header");case 8:if(t.t1=t.sent,(u=new t.t0(t.t1)).subarray(0,3).every(function(e,t){return cd[t]===e})){t.next=13;break}throw Yy.error("bytes: ".concat(u," != ").concat(cd)),new Error("Not a FlatGeobuf file");case 13:return Yy.debug("magic bytes look good"),t.next=16,i.getRange(8,4,s,"header");case 16:if(c=t.sent,!((l=new DataView(c).getUint32(0,!0))>10485760||l<8)){t.next=21;break}throw new Error("Invalid header size");case 21:return Yy.debug("headerLength: ".concat(l)),t.next=24,i.getRange(12,l,s,"header");case 24:return f=t.sent,p=new Nh(new Uint8Array(f)),h=cy(p),y=ad(h.featuresCount,h.indexNodeSize),Yy.debug("completed: opening http reader"),t.abrupt("return",new e(i,h,l,y,n));case 30:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}()}])}(),Id=function(){return Od(function e(t,r){if(wd(this,e),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,"string"==typeof t)this.httpClient=new Ld(t,r);else{if(!(t instanceof Ld))throw new Error("Unknown source ");this.httpClient=t}},[{key:"getRange",value:function(){var e=gd(vd().mark(function e(t,r,n,o){var i,a,s;return vd().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.bytesEverUsed+=r,i=t-this.head,a=i+r,!(i>=0&&a<=this.buffer.byteLength)){e.next=5;break}return e.abrupt("return",this.buffer.slice(i,a));case 5:return s=Math.max(r,n),this.bytesEverFetched+=s,Yy.debug("requesting for new Range: ".concat(t,"-").concat(t+s-1)),e.next=10,this.httpClient.getRange(t,s,o);case 10:return this.buffer=e.sent,this.head=t,e.abrupt("return",this.buffer.slice(0,r));case 13:case"end":return e.stop()}},e,this)}));return function(t,r,n,o){return e.apply(this,arguments)}}()},{key:"logUsage",value:function(e){var t=e.split(" ")[0],r=this.bytesEverUsed,n=this.bytesEverFetched,o=(100*r/n).toFixed(2);Yy.info("".concat(t," bytes used/requested: ").concat(r," / ").concat(n," = ").concat(o,"%"))}}])}(),Ld=function(){return Od(function e(t,r){wd(this,e),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=t,this.nocache=r},[{key:"getRange",value:function(){var e=gd(vd().mark(function e(t,r,n){var o,i,a;return vd().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,o="bytes=".concat(t,"-").concat(t+r-1),Yy.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(n,"), bytes: (this_request: ").concat(r,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(o)),i={Range:o},this.nocache&&(i["Cache-Control"]="no-cache, no-store"),e.next=8,fetch(this.url,{headers:i});case 8:return a=e.sent,e.abrupt("return",a.arrayBuffer());case 10:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()}])}();function Nd(e){"@babel/helpers - typeof";return(Nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Md(){Md=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Nd(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Rd(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Dd(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Rd(i,n,o,a,s,"next",e)}function s(e){Rd(i,n,o,a,s,"throw",e)}a(void 0)})}}function Bd(e){var t,r,n,o=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);o--;){if(r&&null!=(t=e[r]))return t.call(e);if(n&&null!=(t=e[n]))return new Fd(t.call(e));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function Fd(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(Fd=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new Fd(e)}function Ud(e){return new Vd(e,0)}function Gd(e){return function(){return new zd(e.apply(this,arguments))}}function zd(e){var t,r;function n(t,r){try{var i=e[t](r),a=i.value,s=a instanceof Vd;Promise.resolve(s?a.v:a).then(function(r){if(s){var u="return"===t?"return":"next";if(!a.k||r.done)return n(u,r);r=e[u](r).value}o(i.done?"return":"normal",r)},function(e){n("throw",e)})}catch(e){o("throw",e)}}function o(e,o){switch(e){case"return":t.resolve({value:o,done:!0});break;case"throw":t.reject(o);break;default:t.resolve({value:o,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,o){return new Promise(function(i,a){var s={key:e,arg:o,resolve:i,reject:a,next:null};r?r=r.next=s:(t=r=s,n(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function Vd(e,t){this.v=e,this.k=t}function qd(){return(qd=Gd(Md().mark(function e(t,r,n){var o,i,a,s,u,l,c,f,p,h;return Md().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o="function"==typeof(y=t).slice?y:new ty("function"==typeof y.read?y:y.getReader()),i=function(){var e=Dd(Md().mark(function e(t){return Md().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.slice(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),e.t0=Uint8Array,e.next=5,Ud(i(8,"magic bytes"));case 5:if(e.t1=e.sent,(a=new e.t0(e.t1)).subarray(0,3).every(function(e,t){return cd[t]===e})){e.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return e.t2=Uint8Array,e.next=12,Ud(i(4,"header length"));case 12:return e.t3=e.sent,a=new e.t2(e.t3),s=new Nh(a),u=s.readUint32(0),e.t4=Uint8Array,e.next=19,Ud(i(u,"header data"));case 19:if(e.t5=e.sent,a=new e.t4(e.t5),s=new Nh(a),l=cy(s),n&&n(l),c=l.indexNodeSize,f=l.featuresCount,!(c>0)){e.next=29;break}return p=ad(f,c),e.next=29,Ud(i(p,"entire index, w/o rect"));case 29:return e.next=31,Ud(Wd(i,l,r));case 31:if(!(h=e.sent)){e.next=36;break}return e.next=34,h;case 34:e.next=29;break;case 36:case"end":return e.stop()}var y},e)}))).apply(this,arguments)}function Hd(){return(Hd=Gd(function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return Md().mark(function i(){var a,s,u,l,c,f,p;return Md().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,Ud(Ad.open(e,o));case 2:a=i.sent,Yy.debug("opened reader"),n&&n(a.header),s=!1,u=!1,i.prev=7,c=Bd(a.selectBbox(t));case 9:return i.next=11,Ud(c.next());case 11:if(!(s=!(f=i.sent).done)){i.next=18;break}return p=f.value,i.next=15,r(p,a.header);case 15:s=!1,i.next=9;break;case 18:i.next=24;break;case 20:i.prev=20,i.t0=i.catch(7),u=!0,l=i.t0;case 24:if(i.prev=24,i.prev=25,!s||null==c.return){i.next=29;break}return i.next=29,Ud(c.return());case 29:if(i.prev=29,!u){i.next=32;break}throw l;case 32:return i.finish(29);case 33:return i.finish(24);case 34:case"end":return i.stop()}},i,null,[[7,20,24,34],[25,,29,33]])})()})).apply(this,arguments)}function Wd(e,t,r){return Jd.apply(this,arguments)}function Jd(){return(Jd=Dd(Md().mark(function e(t,r,n){var o,i,a,s,u;return Md().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,t(4,"feature length");case 3:if(e.t1=e.sent,0!==(o=new e.t0(e.t1)).byteLength){e.next=7;break}return e.abrupt("return");case 7:return i=new Nh(o),a=i.readUint32(0),e.t2=Uint8Array,e.next=12,t(a,"feature data");case 12:return e.t3=e.sent,o=new e.t2(e.t3),(s=new Uint8Array(a+4)).set(o,4),(i=new Nh(s)).setPosition(fd),u=Qh.getRootAsFeature(i),e.abrupt("return",n(u,r));case 20:case"end":return e.stop()}},e)}))).apply(this,arguments)}function Kd(e,t){return{type:"FeatureCollection",features:function(e,t,r){if(!e.subarray(0,3).every(function(e,t){return cd[t]===e}))throw new Error("Not a FlatGeobuf file");var n=new Nh(e),o=n.readUint32(cd.length);n.setPosition(cd.length+fd);var i=cy(n);r&&r(i);var a=cd.length+fd+o,s=i.indexNodeSize,u=i.featuresCount;s>0&&(a+=ad(u,s));for(var l=[];a3&&void 0!==arguments[3]&&arguments[3])}function Xd(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e instanceof Uint8Array?Kd(e,r):e instanceof ReadableStream?Yd(e,r):Qd(e,t,r,n)}zd.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},zd.prototype.next=function(e){return this._invoke("next",e)},zd.prototype.throw=function(e){return this._invoke("throw",e)},zd.prototype.return=function(e){return this._invoke("return",e)};var Zd=r(833),$d=r.n(Zd);function em(e){"@babel/helpers - typeof";return(em="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tm(){tm=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==em(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function rm(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function nm(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){rm(i,n,o,a,s,"next",e)}function s(e){rm(i,n,o,a,s,"throw",e)}a(void 0)})}}function om(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=t.layerID?t.layerID:L.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=t,this.strategy=t.strategy||"bbox",this.url=t.url,this.layerType="",this.extent=t.extent,this.init()},(t=[{key:"init",value:function(){"bbox"===this.strategy&&(this.loadedExtentsRtree_=new($d()))}},{key:"iterateFeatures",value:function(){var e=nm(tm().mark(function e(t){var r,n,o,i,a,s,u;return tm().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r={type:"FeatureCollection",features:[]},n=!1,o=!1,e.prev=3,a=am(t);case 5:return e.next=7,a.next();case 7:if(!(n=!(s=e.sent).done)){e.next=15;break}u=s.value,this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(u=this.options.featureLoader(u)),this.layerType||(this.layerType=um[u.geometry.type]),r.features.push(u);case 12:n=!1,e.next=5;break;case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(3),o=!0,i=e.t0;case 21:if(e.prev=21,e.prev=22,!n||null==a.return){e.next=26;break}return e.next=26,a.return();case 26:if(e.prev=26,!o){e.next=29;break}throw i;case 29:return e.finish(26);case 30:return e.finish(21);case 31:return e.abrupt("return",r);case 32:case"end":return e.stop()}},e,this,[[3,17,21,31],[22,,26,30]])}));return function(t){return e.apply(this,arguments)}}()},{key:"_loadData",value:function(){var e=nm(tm().mark(function e(t){var r,n,o=this;return tm().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]},t.length){e.next=7;break}return e.next=4,this._getStream(this.url);case 4:r=e.sent,e.next=9;break;case 7:n.value={extent:t.slice()},this.loadedExtentsRtree_.insert(n);case 9:return e.next=11,Xd(r&&r.body||this.url,n,function(e){o.layerType=um[e.geometryType]});case 11:return e.abrupt("return",e.sent);case 12:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_getStream",value:function(){var e=nm(tm().mark(function e(t){return tm().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,z.get(t,{},{withoutFormatSuffix:!0}).then(function(e){return e});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}()},{key:"_containsExtent",value:function(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}},{key:"_getInExtent",value:function(e){var t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.loadedExtentsRtree_.search(t).map(function(e){return e.value})}},{key:"_forEachInExtent",value:function(e,t){return this._forEach(this._getInExtent(e),t)}},{key:"_forEach",value:function(e,t){for(var r,n=0,o=e.length;n=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function pm(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function hm(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){pm(i,n,o,a,s,"next",e)}function s(e){pm(i,n,o,a,s,"throw",e)}a(void 0)})}}function ym(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=t.layerID?t.layerID:L.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this._sourceId=this.layerId,this.options=t,this.strategy=t.strategy||"bbox",this.url=t.url,this.layerType="",this.extent=t.extent,this.overlay=!0,this.type="custom",this.renderingMode="3d",this._updateFeaturesFn=this._updateFeatures.bind(this)},(t=[{key:"onAdd",value:function(e){this.map=e;var t,r,n,o=[];if("bbox"===this.strategy){var i=this.map.getBounds().toArray();o=[i[0][0],i[0][1],i[1][0],i[1][1]],this.map.on("moveend",this._updateFeaturesFn)}if(this.extent){var a=(t=this.extent,n=[],function(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}(t,r=o)&&(t[0]>r[0]?n[0]=t[0]:n[0]=r[0],t[1]>r[1]?n[1]=t[1]:n[1]=r[1],t[2]0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.url=t.url,this.layerId=t.id,this.autoplay=void 0===t.autoplay||t.autoplay,this.loop=void 0===t.loop||t.loop},(t=[{key:"_createVideoElement",value:function(){var e=document.createElement("video");e.id=this.layerId,e.className="video-js",e.style.position="fixed",e.style.left="-300%",e.setAttribute("crossorigin","anonymous"),document.body.appendChild(e)}},{key:"createVideo",value:function(){this._createVideoElement();var e=this._getVideoOptions();return this.video=gm()(this.layerId,e,function(){}),this.video}},{key:"_getVideoOptions",value:function(){if(this.url){var e={autoplay:this.autoplay,muted:!0,loop:this.loop};return this.url.includes("mp4")?e.sources=[{src:this.url,type:"video/mp4"}]:this.url.includes("flv")?e={loop:this.loop,autoplay:this.autoplay,muted:!0,techOrder:["html5","flvjs"],flvjs:{mediaDataSource:{isLive:!0,cors:!0,withCredentials:!1}},sources:[{src:this.url,type:"video/x-flv"}]}:this.url.includes("m3u8")&&(e.sources=[{src:this.url}]),e}}},{key:"getVideoDomId",value:function(){if(this.url){var e;if(this.url.includes("flv")){var t=document.querySelector("#".concat(this.layerId));e="".concat(this.layerId,"_flvjs_api"),t.style.position="fixed",t.style.left="-200%"}else e=this.video.el_.firstChild.id;return e}}}])&&Sm(e.prototype,t),r&&Sm(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),xm=function(){try{return turf}catch(e){return{}}}();function Pm(e){"@babel/helpers - typeof";return(Pm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function km(e,t){for(var r=0;r=this.text.length)return;e=this.text[this.place++]}switch(this.state){case nv:return this.neutral(e);case 2:return this.keyword(e);case 4:return this.quoted(e);case 5:return this.afterquote(e);case 3:return this.number(e);case-1:return}},lv.prototype.afterquote=function(e){if('"'===e)return this.word+='"',void(this.state=4);if(sv.test(e))return this.word=this.word.trim(),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in afterquote yet, index '+this.place)},lv.prototype.afterItem=function(e){return","===e?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=nv)):"]"===e?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=nv,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},lv.prototype.number=function(e){if(!uv.test(e)){if(sv.test(e))return this.word=parseFloat(this.word),void this.afterItem(e);throw new Error("havn't handled \""+e+'" in number yet, index '+this.place)}this.word+=e},lv.prototype.quoted=function(e){'"'!==e?this.word+=e:this.state=5},lv.prototype.keyword=function(e){if(av.test(e))this.word+=e;else{if("["===e){var t=[];return t.push(this.word),this.level++,null===this.root?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,void(this.state=nv)}if(!sv.test(e))throw new Error("havn't handled \""+e+'" in keyword yet, index '+this.place);this.afterItem(e)}},lv.prototype.neutral=function(e){if(iv.test(e))return this.word=e,void(this.state=2);if('"'===e)return this.word="",void(this.state=4);if(uv.test(e))return this.word=e,void(this.state=3);if(!sv.test(e))throw new Error("havn't handled \""+e+'" in neutral yet, index '+this.place);this.afterItem(e)},lv.prototype.output=function(){for(;this.place0?90:-90)):(e.lat0=yv(e.lat1>0?90:-90),e.lat_ts=e.lat1)}(o),o}function mv(e){var t=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?mv[e]=tv(arguments[1]):mv[e]=dv(arguments[1]):mv[e]=r}else if(1===arguments.length){if(Array.isArray(e))return e.map(function(e){Array.isArray(e)?mv.apply(t,e):mv(e)});if("string"==typeof e){if(e in mv)return mv[e]}else"EPSG"in e?mv["EPSG:"+e.EPSG]=e:"ESRI"in e?mv["ESRI:"+e.ESRI]=e:"IAU2000"in e?mv["IAU2000:"+e.IAU2000]=e:console.log(e);return}}!function(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}(mv);var vv=mv;var bv=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var gv=["3857","900913","3785","102113"];var wv=function(e){if(!function(e){return"string"==typeof e}(e))return e;if(function(e){return e in vv}(e))return vv[e];if(function(e){return bv.some(function(t){return e.indexOf(t)>-1})}(e)){var t=dv(e);if(function(e){var t=ev(e,"authority");if(t){var r=ev(t,"epsg");return r&&gv.indexOf(r)>-1}}(t))return vv["EPSG:3857"];var r=function(e){var t=ev(e,"extension");if(t)return ev(t,"proj4")}(t);return r?tv(r):t}return function(e){return"+"===e[0]}(e)?tv(e):void 0};function Sv(e,t){var r,n;if(e=e||{},!t)return e;for(n in t)void 0!==(r=t[n])&&(e[n]=r);return e}function Ov(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}function _v(e){return e<0?-1:1}function xv(e){return Math.abs(e)<=Qm?e:e-_v(e)*Ym}function Pv(e,t,r){var n=e*r,o=.5*e;return n=Math.pow((1-n)/(1+n),o),Math.tan(.5*(Gm-t))/n}function kv(e,t){for(var r,n,o=.5*e,i=Gm-2*Math.atan(t),a=0;a<=15;a++)if(r=e*Math.sin(i),i+=n=Gm-2*Math.atan(t*Math.pow((1-r)/(1+r),o))-i,Math.abs(n)<=1e-10)return i;return-9999}function Ev(e){return e}var jv=[{init:function(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Ov(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(e){var t,r,n=e.x,o=e.y;if(o*Jm>90&&o*Jm<-90&&n*Jm>180&&n*Jm<-180)return null;if(Math.abs(Math.abs(o)-Gm)<=Hm)return null;if(this.sphere)t=this.x0+this.a*this.k0*xv(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(Km+.5*o));else{var i=Math.sin(o),a=Pv(this.e,o,i);t=this.x0+this.a*this.k0*xv(n-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return e.x=t,e.y=r,e},inverse:function(e){var t,r,n=e.x-this.x0,o=e.y-this.y0;if(this.sphere)r=Gm-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var i=Math.exp(-o/(this.a*this.k0));if(-9999===(r=kv(this.e,i)))return null}return t=xv(this.long0+n/(this.a*this.k0)),e.x=t,e.y=r,e},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Ev,inverse:Ev,names:["longlat","identity"]}],Tv={},Cv=[];function Av(e,t){var r=Cv.length;return e.names?(Cv[r]=e,e.names.forEach(function(e){Tv[e.toLowerCase()]=r}),this):(console.log(t),!0)}var Iv={start:function(){jv.forEach(Av)},add:Av,get:function(e){if(!e)return!1;var t=e.toLowerCase();return void 0!==Tv[t]&&Cv[Tv[t]]?Cv[Tv[t]]:void 0}},Lv={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},Nv=Lv.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Lv.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Mv={};Mv.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Mv.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Mv.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Mv.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Mv.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Mv.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Mv.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Mv.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Mv.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},Mv.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Mv.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Mv.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Mv.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Mv.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Mv.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Mv.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Mv.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Mv.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var Rv=function(e,t,r,n,o,i,a){var s={};return s.datum_type=void 0===e||"none"===e?Rm:Mm,t&&(s.datum_params=t.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=Im),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=Lm,s.datum_params[3]*=Um,s.datum_params[4]*=Um,s.datum_params[5]*=Um,s.datum_params[6]=s.datum_params[6]/1e6+1))),a&&(s.datum_type=Nm,s.grids=a),s.a=r,s.b=n,s.es=o,s.ep2=i,s},Dv={};function Bv(e){if(0===e.length)return null;var t="@"===e[0];return t&&(e=e.slice(1)),"null"===e?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:Dv[e]||null,isNull:!1}}function Fv(e){return e/3600*Math.PI/180}function Uv(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function Gv(e){return e.map(function(e){return[Fv(e.longitudeShift),Fv(e.latitudeShift)]})}function zv(e,t,r){return{name:Uv(e,t+8,t+16).trim(),parent:Uv(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function Vv(e,t,r,n){for(var o=t+176,i=[],a=0;a-1.001*Gm)u=-Gm;else if(u>Gm&&u<1.001*Gm)u=Gm;else{if(u<-Gm)return{x:-1/0,y:-1/0,z:e.z};if(u>Gm)return{x:1/0,y:1/0,z:e.z}}return s>Math.PI&&(s-=2*Math.PI),o=Math.sin(u),a=Math.cos(u),i=o*o,{x:((n=r/Math.sqrt(1-t*i))+l)*a*Math.cos(s),y:(n+l)*a*Math.sin(s),z:(n*(1-t)+l)*o}}function Jv(e,t,r,n){var o,i,a,s,u,l,c,f,p,h,y,d,m,v,b,g=e.x,w=e.y,S=e.z?e.z:0;if(o=Math.sqrt(g*g+w*w),i=Math.sqrt(g*g+w*w+S*S),o/r<1e-12){if(v=0,i/r<1e-12)return Gm,b=-n,{x:e.x,y:e.y,z:e.z}}else v=Math.atan2(w,g);a=S/i,f=(s=o/i)*(1-t)*(u=1/Math.sqrt(1-t*(2-t)*s*s)),p=a*u,m=0;do{m++,l=t*(c=r/Math.sqrt(1-t*p*p))/(c+(b=o*f+S*p-c*(1-t*p*p))),d=(y=a*(u=1/Math.sqrt(1-l*(2-l)*s*s)))*f-(h=s*(1-l)*u)*p,f=h,p=y}while(d*d>1e-24&&m<30);return{x:v,y:Math.atan(y/Math.abs(h)),z:b}}function Kv(e){return e===Im||e===Lm}function Yv(e,t,r){if(function(e,t){return e.datum_type===t.datum_type&&!(e.a!==t.a||Math.abs(e.es-t.es)>5e-11)&&(e.datum_type===Im?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type!==Lm||e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6])}(e,t))return r;if(e.datum_type===Rm||t.datum_type===Rm)return r;var n=e.a,o=e.es;if(e.datum_type===Nm){if(0!==Qv(e,!1,r))return;n=Dm,o=Fm}var i=t.a,a=t.b,s=t.es;if(t.datum_type===Nm&&(i=Dm,a=Bm,s=Fm),o===s&&n===i&&!Kv(e.datum_type)&&!Kv(t.datum_type))return r;if((r=Wv(r,o,n),Kv(e.datum_type)&&(r=function(e,t,r){if(t===Im)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===Lm){var n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],u=r[5],l=r[6];return{x:l*(e.x-u*e.y+s*e.z)+n,y:l*(u*e.x+e.y-a*e.z)+o,z:l*(-s*e.x+a*e.y+e.z)+i}}}(r,e.datum_type,e.datum_params)),Kv(t.datum_type)&&(r=function(e,t,r){if(t===Im)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===Lm){var n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],u=r[5],l=r[6],c=(e.x-n)/l,f=(e.y-o)/l,p=(e.z-i)/l;return{x:c+u*f-s*p,y:-u*c+f+a*p,z:s*c-a*f+p}}}(r,t.datum_type,t.datum_params)),r=Jv(r,s,i,a),t.datum_type===Nm)&&0!==Qv(t,!0,r))return;return r}function Qv(e,t,r){if(null===e.grids||0===e.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},o={x:Number.NaN,y:Number.NaN},i=[];e:for(var a=0;an.y||h>n.x||m1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=xv(i.x+r.ll[0]),n.y=i.y+r.ll[1]}else isNaN(i.x)||(n.x=e.x+i.x,n.y=e.y+i.y);return n}function Zv(e,t){var r,n={x:e.x/t.del[0],y:e.y/t.del[1]},o=Math.floor(n.x),i=Math.floor(n.y),a=n.x-1*o,s=n.y-1*i,u={x:Number.NaN,y:Number.NaN};if(o<0||o>=t.lim[0])return u;if(i<0||i>=t.lim[1])return u;r=i*t.lim[0]+o;var l=t.cvs[r][0],c=t.cvs[r][1];r++;var f=t.cvs[r][0],p=t.cvs[r][1];r+=t.lim[0];var h=t.cvs[r][0],y=t.cvs[r][1];r--;var d=t.cvs[r][0],m=t.cvs[r][1],v=a*s,b=a*(1-s),g=(1-a)*(1-s),w=(1-a)*s;return u.x=g*l+b*f+w*d+v*h,u.y=g*c+b*p+w*m+v*y,u}function $v(e,t,r){var n,o,i,a=r.x,s=r.y,u=r.z||0,l={};for(i=0;i<3;i++)if(!t||2!==i||void 0!==r.z)switch(0===i?(n=a,o=-1!=="ew".indexOf(e.axis[i])?"x":"y"):1===i?(n=s,o=-1!=="ns".indexOf(e.axis[i])?"y":"x"):(n=u,o="z"),e.axis[i]){case"e":l[o]=n;break;case"w":l[o]=-n;break;case"n":l[o]=n;break;case"s":l[o]=-n;break;case"u":void 0!==r[o]&&(l.z=n);break;case"d":void 0!==r[o]&&(l.z=-n);break;default:return null}return l}function eb(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function tb(e){if("function"==typeof Number.isFinite){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof e||e!=e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function rb(e,t,r,n){var o,i=void 0!==(r=Array.isArray(r)?eb(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(e){tb(e.x),tb(e.y)}(r),e.datum&&t.datum&&function(e,t){return(e.datum.datum_type===Im||e.datum.datum_type===Lm||e.datum.datum_type===Nm)&&"WGS84"!==t.datumCode||(t.datum.datum_type===Im||t.datum.datum_type===Lm||t.datum.datum_type===Nm)&&"WGS84"!==e.datumCode}(e,t)&&(r=rb(e,o=new Hv("WGS84"),r,n),e=o),n&&"enu"!==e.axis&&(r=$v(e,!1,r)),"longlat"===e.projName)r={x:r.x*Wm,y:r.y*Wm,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),!(r=e.inverse(r)))return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=Yv(e.datum,t.datum,r))return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),"longlat"===t.projName?r={x:r.x*Jm,y:r.y*Jm,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),n&&"enu"!==t.axis?$v(t,!0,r):(r&&!i&&delete r.z,r)}var nb=Hv("WGS84");function ob(e,t,r,n){var o,i,a;return Array.isArray(r)?(o=rb(e,t,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name?"number"==typeof o.z?[o.x,o.y,o.z].concat(r.splice(3)):[o.x,o.y,r[2]].concat(r.splice(3)):[o.x,o.y].concat(r.splice(2)):[o.x,o.y]):(i=rb(e,t,r,n),2===(a=Object.keys(r)).length?i:(a.forEach(function(n){if(void 0!==e.name&&"geocent"===e.name||void 0!==t.name&&"geocent"===t.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;i[n]=r[n]}),i))}function ib(e){return e instanceof Hv?e:e.oProj?e.oProj:Hv(e)}var ab=function(e,t,r){e=ib(e);var n,o=!1;return void 0===t?(t=e,e=nb,o=!0):(void 0!==t.x||Array.isArray(t))&&(r=t,t=e,e=nb,o=!0),t=ib(t),r?ob(e,t,r):(n={forward:function(r,n){return ob(e,t,r,n)},inverse:function(r,n){return ob(t,e,r,n)}},o&&(n.oProj=t),n)},sb=6,ub="AJSAJS",lb="AFAFAF",cb=65,fb=73,pb=79,hb=86,yb=90,db={forward:mb,inverse:function(e){var t=wb(Ob(e.toUpperCase()));if(t.lat&&t.lon)return[t.lon,t.lat,t.lon,t.lat];return[t.left,t.bottom,t.right,t.top]},toPoint:vb};function mb(e,t){return t=t||5,function(e,t){var r="00000"+e.easting,n="00000"+e.northing;return e.zoneNumber+e.zoneLetter+(h=e.easting,y=e.northing,d=e.zoneNumber,m=Sb(d),v=Math.floor(h/1e5),b=Math.floor(y/1e5)%20,o=v,i=b,a=m,s=a-1,u=ub.charCodeAt(s),l=lb.charCodeAt(s),c=u+o-1,f=l+i,p=!1,c>yb&&(c=c-yb+cb-1,p=!0),(c===fb||ufb||(c>fb||upb||(c>pb||uyb&&(c=c-yb+cb-1),f>hb?(f=f-hb+cb-1,p=!0):p=!1,(f===fb||lfb||(f>fb||lpb||(f>pb||lhb&&(f=f-hb+cb-1),String.fromCharCode(c)+String.fromCharCode(f))+r.substr(r.length-5,t)+n.substr(n.length-5,t);var o,i,a,s,u,l,c,f,p;var h,y,d,m,v,b}(function(e){var t,r,n,o,i,a,s,u=e.lat,l=e.lon,c=6378137,f=bb(u),p=bb(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60);u>=56&&u<64&&l>=3&&l<12&&(s=32);u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37));a=bb(6*(s-1)-180+3),.006739496752268451,t=c/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),r=Math.tan(f)*Math.tan(f),n=.006739496752268451*Math.cos(f)*Math.cos(f),o=Math.cos(f)*(p-a),i=c*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-3.418046101696858e-9*Math.sin(6*f));var h=.9996*t*(o+(1-r+n)*o*o*o/6+(5-18*r+r*r+72*n-.39089081163157013)*o*o*o*o*o/120)+5e5,y=.9996*(i+t*Math.tan(f)*(o*o/2+(5-r+9*n+4*n*n)*o*o*o*o/24+(61-58*r+r*r+600*n-2.2240339282485886)*o*o*o*o*o*o/720));u<0&&(y+=1e7);return{northing:Math.round(y),easting:Math.round(h),zoneNumber:s,zoneLetter:function(e){var t="Z";84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C");return t}(u)}}({lat:e[1],lon:e[0]}),t)}function vb(e){var t=wb(Ob(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function bb(e){return e*(Math.PI/180)}function gb(e){return e/Math.PI*180}function wb(e){var t=e.northing,r=e.easting,n=e.zoneLetter,o=e.zoneNumber;if(o<0||o>60)return null;var i,a,s,u,l,c,f,p,h=6378137,y=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),d=r-5e5,m=t;n<"N"&&(m-=1e7),c=6*(o-1)-180+3,p=(f=m/.9996/6367449.145945056)+(3*y/2-27*y*y*y/32)*Math.sin(2*f)+(21*y*y/16-55*y*y*y*y/32)*Math.sin(4*f)+151*y*y*y/96*Math.sin(6*f),i=h/Math.sqrt(1-.00669438*Math.sin(p)*Math.sin(p)),a=Math.tan(p)*Math.tan(p),s=.006739496752268451*Math.cos(p)*Math.cos(p),u=.99330562*h/Math.pow(1-.00669438*Math.sin(p)*Math.sin(p),1.5),l=d/(.9996*i);var v=p-i*Math.tan(p)/u*(l*l/2-(5+3*a+10*s-4*s*s-.06065547077041606)*l*l*l*l/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*l*l*l*l*l*l/720);v=gb(v);var b,g=(l-(1+2*a+s)*l*l*l/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(p);if(g=c+gb(g),e.accuracy){var w=wb({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});b={top:w.lat,right:w.lon,bottom:v,left:g}}else b={lat:v,lon:g};return b}function Sb(e){var t=e%sb;return 0===t&&(t=sb),t}function Ob(e){if(e&&0===e.length)throw"MGRSPoint coverting from nothing";for(var t,r=e.length,n=null,o="",i=0;!/[A-Z]/.test(t=e.charAt(i));){if(i>=2)throw"MGRSPoint bad conversion from: "+e;o+=t,i++}var a=parseInt(o,10);if(0===i||i+3>r)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(i++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+e;n=e.substring(i,i+=2);for(var u=Sb(a),l=function(e,t){var r=ub.charCodeAt(t-1),n=1e5,o=!1;for(;r!==e.charCodeAt(0);){if(++r===fb&&r++,r===pb&&r++,r>yb){if(o)throw"Bad character: "+e;r=cb,o=!0}n+=1e5}return n}(n.charAt(0),u),c=function(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;var r=lb.charCodeAt(t-1),n=0,o=!1;for(;r!==e.charCodeAt(0);){if(++r===fb&&r++,r===pb&&r++,r>hb){if(o)throw"Bad character: "+e;r=cb,o=!0}n+=1e5}return n}(n.charAt(1),u);c<_b(s);)c+=2e6;var f=r-i;if(f%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+e;var p,h,y,d=f/2,m=0,v=0;return d>0&&(p=1e5/Math.pow(10,d),h=e.substring(i,i+d),m=parseFloat(h)*p,y=e.substring(i+d),v=parseFloat(y)*p),{easting:m+l,northing:v+c,zoneLetter:s,zoneNumber:a,accuracy:p}}function _b(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function xb(e,t,r){if(!(this instanceof xb))return new xb(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if("object"==typeof e)this.x=e.x,this.y=e.y,this.z=e.z||0;else if("string"==typeof e&&void 0===t){var n=e.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}xb.fromMGRS=function(e){return new xb(vb(e))},xb.prototype.toMGRS=function(e){return mb([this.x,this.y],e)};var Pb=xb,kb=1,Eb=.25,jb=.046875,Tb=.01953125,Cb=.01068115234375,Ab=.75,Ib=.46875,Lb=.013020833333333334,Nb=.007120768229166667,Mb=.3645833333333333,Rb=.005696614583333333,Db=.3076171875;function Bb(e){var t=[];t[0]=kb-e*(Eb+e*(jb+e*(Tb+e*Cb))),t[1]=e*(Ab-e*(jb+e*(Tb+e*Cb)));var r=e*e;return t[2]=r*(Ib-e*(Lb+e*Nb)),r*=e,t[3]=r*(Mb-e*Rb),t[4]=r*e*Db,t}function Fb(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var Ub=20;function Gb(e,t,r){for(var n=1/(1-t),o=e,i=Ub;i;--i){var a=Math.sin(o),s=1-t*a*a;if(o-=s=(Fb(o,a,Math.cos(o),r)-e)*(s*Math.sqrt(s))*n,Math.abs(s)Hm?Math.tan(i):0,y=Math.pow(h,2),d=Math.pow(y,2);t=1-this.es*Math.pow(s,2),l/=Math.sqrt(t);var m=Fb(i,s,u,this.en);r=this.a*(this.k0*l*(1+c/6*(1-y+f+c/20*(5-18*y+d+14*f-58*y*f+c/42*(61+179*d-d*y-479*y)))))+this.x0,n=this.a*(this.k0*(m-this.ml0+s*a*l/2*(1+c/12*(5-y+9*f+4*p+c/30*(61+d-58*y+270*f-330*y*f+c/56*(1385+543*d-d*y-3111*y))))))+this.y0}else{var v=u*Math.sin(a);if(Math.abs(Math.abs(v)-1)=1){if(v-1>Hm)return 93;n=0}else n=Math.acos(n);i<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return e.x=r,e.y=n,e},inverse:function(e){var t,r,n,o,i=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(r=Gb(t=this.ml0+a/this.k0,this.es,this.en),Math.abs(r)Hm?Math.tan(r):0,c=this.ep2*Math.pow(u,2),f=Math.pow(c,2),p=Math.pow(l,2),h=Math.pow(p,2);t=1-this.es*Math.pow(s,2);var y=i*Math.sqrt(t)/this.k0,d=Math.pow(y,2);n=r-(t*=l)*d/(1-this.es)*.5*(1-d/12*(5+3*p-9*c*p+c-4*f-d/30*(61+90*p-252*c*p+45*h+46*c-d/56*(1385+3633*p+4095*h+1574*h*p)))),o=xv(this.long0+y*(1-d/6*(1+2*p+c-d/20*(5+28*p+24*h+8*c*p+6*c-d/42*(61+662*p+1320*h+720*h*p))))/u)}else n=Gm*_v(a),o=0;else{var m=Math.exp(i/this.k0),v=.5*(m-1/m),b=this.lat0+a/this.k0,g=Math.cos(b);t=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(v,2))),n=Math.asin(t),a<0&&(n=-n),o=0===v&&0===g?0:xv(Math.atan2(v,g)+this.long0)}return e.x=o,e.y=n,e},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function Vb(e){var t=Math.exp(e);return t=(t-1/t)/2}function qb(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function Hb(e){var t=Math.abs(e);return t=function(e){var t=1+e,r=t-1;return 0===r?e:e*Math.log(t)/r}(t*(1+t/(qb(1,t)+1))),e<0?-t:t}function Wb(e,t){for(var r,n=2*Math.cos(2*t),o=e.length-1,i=e[o],a=0;--o>=0;)r=n*i-a+e[o],a=i,i=r;return t+r*Math.sin(2*t)}function Jb(e,t,r){for(var n,o,i=Math.sin(t),a=Math.cos(t),s=Vb(r),u=function(e){var t=Math.exp(e);return t=(t+1/t)/2}(r),l=2*a*u,c=-2*i*s,f=e.length-1,p=e[f],h=0,y=0,d=0;--f>=0;)n=y,o=h,p=l*(y=p)-n-c*(h=d)+e[f],d=c*y-o+l*h;return[(l=i*u)*p-(c=a*s)*d,l*d+c*p]}var Kb={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(zb.init.apply(this),this.forward=zb.forward,this.inverse=zb.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(t*(116/45+t*(26/45+t*(-2854/675)))-2))),this.cbg[0]=t*(t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))-2),r*=t,this.cgb[1]=r*(7/3+t*(t*(-227/45+t*(2704/315+t*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r*=t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(1.6+t*(-12686/2835)))),r*=t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(t*(-24832/14175)-2.4)),r*=t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r*=t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=t*(t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))-.5),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(t*(557/1440+t*(281/630+t*(-1983433/1935360)))-.6)),r*=t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r*=t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r*=t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r*=t,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var n=Wb(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(e,t){for(var r,n=2*Math.cos(t),o=e.length-1,i=e[o],a=0;--o>=0;)r=n*i-a+e[o],a=i,i=r;return Math.sin(t)*r}(this.gtu,2*n))},forward:function(e){var t=xv(e.x-this.long0),r=e.y;r=Wb(this.cbg,r);var n=Math.sin(r),o=Math.cos(r),i=Math.sin(t),a=Math.cos(t);r=Math.atan2(n,a*o),t=Math.atan2(i*o,qb(n,o*a)),t=Hb(Math.tan(t));var s,u,l=Jb(this.gtu,2*r,2*t);return r+=l[0],t+=l[1],Math.abs(t)<=2.623395162778?(s=this.a*(this.Qn*t)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(s=1/0,u=1/0),e.x=s,e.y=u,e},inverse:function(e){var t,r,n=(e.x-this.x0)*(1/this.a),o=(e.y-this.y0)*(1/this.a);if(o=(o-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var i=Jb(this.utg,2*o,2*n);o+=i[0],n+=i[1],n=Math.atan(Vb(n));var a=Math.sin(o),s=Math.cos(o),u=Math.sin(n),l=Math.cos(n);o=Math.atan2(a*l,qb(u,l*s)),t=xv((n=Math.atan2(u,l*s))+this.long0),r=Wb(this.cgb,o)}else t=1/0,r=1/0;return e.x=t,e.y=r,e},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var Yb={init:function(){var e=function(e,t){if(void 0===e){if((e=Math.floor(30*(xv(t)+Math.PI)/Math.PI)+1)<0)return 0;if(e>60)return 60}return e}(this.zone,this.long0);if(void 0===e)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*Wm,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Kb.init.apply(this),this.forward=Kb.forward,this.inverse=Kb.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function Qb(e,t){return Math.pow((1-e)/(1+e),t)}var Xb=20;var Zb={init:function(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Km)/(Math.pow(Math.tan(.5*this.lat0+Km),this.C)*Qb(this.e*e,this.ratexp))},forward:function(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+Km),this.C)*Qb(this.e*Math.sin(r),this.ratexp))-Gm,e.x=this.C*t,e},inverse:function(e){for(var t=e.x/this.C,r=e.y,n=Math.pow(Math.tan(.5*r+Km)/this.K,1/this.C),o=Xb;o>0&&(r=2*Math.atan(n*Qb(this.e*Math.sin(e.y),-.5*this.e))-Gm,!(Math.abs(r-e.y)<1e-14));--o)e.y=r;return o?(e.x=t,e.y=r,e):null},names:["gauss"]};var $b={init:function(){Zb.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(e){var t,r,n,o;return e.x=xv(e.x-this.long0),Zb.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),o=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*n),e.x=o*r*Math.sin(e.x),e.y=o*(this.cosc0*t-this.sinc0*r*n),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){var t,r,n,o,i;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,i=qb(e.x,e.y)){var a=2*Math.atan2(i,this.R2);t=Math.sin(a),r=Math.cos(a),o=Math.asin(r*this.sinc0+e.y*t*this.cosc0/i),n=Math.atan2(e.x*t,i*this.cosc0*r-e.y*this.sinc0*t)}else o=this.phic0,n=0;return e.x=n,e.y=o,Zb.inverse.apply(this,[e]),e.x=xv(e.x+this.long0),e},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var eg={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Hm&&(this.k0=.5*(1+_v(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Hm&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Hm&&Math.abs(Math.cos(this.lat_ts))>Hm&&(this.k0=.5*this.cons*Ov(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Pv(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ov(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Gm,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(e){var t,r,n,o,i,a,s=e.x,u=e.y,l=Math.sin(u),c=Math.cos(u),f=xv(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=Hm&&Math.abs(u+this.lat0)<=Hm?(e.x=NaN,e.y=NaN,e):this.sphere?(t=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(f)),e.x=this.a*t*c*Math.sin(f)+this.x0,e.y=this.a*t*(this.coslat0*l-this.sinlat0*c*Math.cos(f))+this.y0,e):(r=2*Math.atan(this.ssfn_(u,l,this.e))-Gm,o=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=Hm?(i=Pv(this.e,u*this.con,this.con*l),a=2*this.a*this.k0*i/this.cons,e.x=this.x0+a*Math.sin(s-this.long0),e.y=this.y0-this.con*a*Math.cos(s-this.long0),e):(Math.abs(this.sinlat0)0?xv(this.long0+Math.atan2(e.x,-1*e.y)):xv(this.long0+Math.atan2(e.x,e.y)):xv(this.long0+Math.atan2(e.x*Math.sin(s),a*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=r,e)}if(Math.abs(this.coslat0)<=Hm){if(a<=Hm)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*kv(this.e,n),t=this.con*xv(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else o=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=Hm?i=this.X0:(i=Math.asin(Math.cos(o)*this.sinX0+e.y*Math.sin(o)*this.cosX0/a),t=xv(this.long0+Math.atan2(e.x*Math.sin(o),a*this.cosX0*Math.cos(o)-e.y*this.sinX0*Math.sin(o)))),r=-1*kv(this.e,Math.tan(.5*(Gm+i)));return e.x=t,e.y=r,e},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(e,t,r){return t*=r,Math.tan(.5*(Gm+e))*Math.pow((1-t)/(1+t),.5*r)}};var tg={init:function(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,n=1/this.rf,o=2*n-Math.pow(n,2),i=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+e/2)),u=Math.log((1+i*t)/(1-i*t));this.K=a-this.alpha*s+this.alpha*i/2*u},forward:function(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),n=-this.alpha*(t+r)+this.K,o=2*(Math.atan(Math.exp(n))-Math.PI/4),i=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(i)/(Math.sin(this.b0)*Math.tan(o)+Math.cos(this.b0)*Math.cos(i))),s=Math.asin(Math.cos(this.b0)*Math.sin(o)-Math.sin(this.b0)*Math.cos(o)*Math.cos(i));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*a+this.x0,e},inverse:function(e){for(var t=e.x-this.x0,r=e.y-this.y0,n=t/this.R,o=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),i=Math.asin(Math.cos(this.b0)*Math.sin(o)+Math.sin(this.b0)*Math.cos(o)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(o))),s=this.lambda0+a/this.alpha,u=0,l=i,c=-1e3,f=0;Math.abs(l-c)>1e-7;){if(++f>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+i/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return e.x=s,e.y=l,e},names:["somerc"]},rg=1e-7;var ng={init:function(){var e,t,r,n,o,i,a,s,u,l,c,f,p,h=0,y=0,d=0,m=0,v=0,b=0,g=0;this.no_off=(p="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(p)),this.no_rot="no_rot"in this;var w=!1;"alpha"in this&&(w=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),w&&(g=this.alpha),S&&(h=this.rectified_grid_angle*Wm),w||S)y=this.longc;else if(d=this.long1,v=this.lat1,m=this.long2,b=this.lat2,Math.abs(v-b)<=rg||(e=Math.abs(v))<=rg||Math.abs(e-Gm)<=rg||Math.abs(Math.abs(this.lat0)-Gm)<=rg||Math.abs(Math.abs(b)-Gm)<=rg)throw new Error;var O=1-this.es;t=Math.sqrt(O),Math.abs(this.lat0)>Hm?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/O),this.A=this.B*this.k0*t/e,(o=(n=this.B*t/(r*Math.sqrt(e)))*n-1)<=0?o=0:(o=Math.sqrt(o),this.lat0<0&&(o=-o)),this.E=o+=n,this.E*=Math.pow(Pv(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=o=1),w||S?(w?(c=Math.asin(Math.sin(g)/n),S||(h=g)):(c=h,g=Math.asin(n*Math.sin(c))),this.lam0=y-Math.asin(.5*(o-1/o)*Math.tan(c))/this.B):(i=Math.pow(Pv(this.e,v,Math.sin(v)),this.B),a=Math.pow(Pv(this.e,b,Math.sin(b)),this.B),o=this.E/i,u=(a-i)/(a+i),l=((l=this.E*this.E)-a*i)/(l+a*i),(e=d-m)<-Math.pi?m-=Ym:e>Math.pi&&(m+=Ym),this.lam0=xv(.5*(d+m)-Math.atan(l*Math.tan(.5*this.B*(d-m))/u)/this.B),c=Math.atan(2*Math.sin(this.B*xv(d-this.lam0))/(o-1/o)),h=g=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(h),this.cosrot=Math.cos(h),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(g))),this.lat0<0&&(this.u_0=-this.u_0)),o=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(Km-o)),this.v_pole_s=this.ArB*Math.log(Math.tan(Km+o))},forward:function(e){var t,r,n,o,i,a,s,u,l={};if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-Gm)>Hm){if(t=.5*((i=this.E/Math.pow(Pv(this.e,e.y,Math.sin(e.y)),this.B))-(a=1/i)),r=.5*(i+a),o=Math.sin(this.B*e.x),n=(t*this.singam-o*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,s=this.ArB*e.y;return this.no_rot?(l.x=s,l.y=u):(s-=this.u_0,l.x=u*this.cosrot+s*this.sinrot,l.y=s*this.cosrot-u*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(e){var t,r,n,o,i,a,s,u={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),o=.5*((n=Math.exp(-this.BrA*r))-1/n),i=.5*(n+1/n),s=((a=Math.sin(this.BrA*t))*this.cosgam+o*this.singam)/i,Math.abs(Math.abs(s)-1)Hm?this.ns=Math.log(n/s)/Math.log(o/u):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(o,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=Hm&&(r=_v(r)*(Gm-2*Hm));var n,o,i=Math.abs(Math.abs(r)-Gm);if(i>Hm)n=Pv(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(n,this.ns);else{if((i=r*this.ns)<=0)return null;o=0}var a=this.ns*xv(t-this.long0);return e.x=this.k0*(o*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(a))+this.y0,e},inverse:function(e){var t,r,n,o,i,a=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+s*s),r=1):(t=-Math.sqrt(a*a+s*s),r=-1);var u=0;if(0!==t&&(u=Math.atan2(r*a,r*s)),0!==t||this.ns>0){if(r=1/this.ns,n=Math.pow(t/(this.a*this.f0),r),-9999===(o=kv(this.e,n)))return null}else o=-Gm;return i=xv(u/this.ns+this.long0),e.x=i,e.y=o,e},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var ig={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(e){var t,r,n,o,i,a,s,u=e.x,l=e.y,c=xv(u-this.long0);return t=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/t)-this.s45),n=-c*this.alfa,o=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),i=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(o)),a=this.n*i,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(o/2+this.s45),this.n),e.y=s*Math.cos(a)/1,e.x=s*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e},inverse:function(e){var t,r,n,o,i,a,s,u=e.x;e.x=e.y,e.y=u,this.czech||(e.y*=-1,e.x*=-1),i=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/i,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(o)),r=Math.asin(Math.cos(n)*Math.sin(o)/Math.cos(t)),e.x=this.long0-r/this.alfa,a=t,s=0;var l=0;do{e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(s=1),a=e.y,l+=1}while(0===s&&l<15);return l>=15?null:e},names:["Krovak","krovak"]};function ag(e,t,r,n,o){return e*o-t*Math.sin(2*o)+r*Math.sin(4*o)-n*Math.sin(6*o)}function sg(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function ug(e){return.375*e*(1+.25*e*(1+.46875*e))}function lg(e){return.05859375*e*e*(1+.75*e)}function cg(e){return e*e*e*(35/3072)}function fg(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}function pg(e){return Math.abs(e)1e-7?(1-e*e)*(t/(1-(r=e*t)*r)-.5/e*Math.log((1-r)/(1+r))):2*t}var mg=.3333333333333333,vg=.17222222222222222,bg=.10257936507936508,gg=.06388888888888888,wg=.0664021164021164,Sg=.016415012942191543;var Og={init:function(){var e,t=Math.abs(this.lat0);if(Math.abs(t-Gm)0)switch(this.qp=dg(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(e){var t,r=[];return r[0]=e*mg,t=e*e,r[0]+=t*vg,r[1]=t*gg,t*=e,r[0]+=t*bg,r[1]+=t*wg,r[2]=t*Sg,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=dg(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(e){var t,r,n,o,i,a,s,u,l,c,f=e.x,p=e.y;if(f=xv(f-this.long0),this.sphere){if(i=Math.sin(p),c=Math.cos(p),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+c*n:1+this.sinph0*i+this.cosph0*c*n)<=Hm)return null;t=(r=Math.sqrt(2/r))*c*Math.sin(f),r*=this.mode===this.EQUIT?i:this.cosph0*i-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(p+this.lat0)=0?(t=(l=Math.sqrt(a))*o,r=n*(this.mode===this.S_POLE?l:-l)):t=r=0}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e},inverse:function(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,o,i,a,s,u,l,c,f=e.x/this.a,p=e.y/this.a;if(this.sphere){var h,y=0,d=0;if((r=.5*(h=Math.sqrt(f*f+p*p)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(d=Math.sin(r),y=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(h)<=Hm?0:Math.asin(p*d/h),f*=d,p=y*h;break;case this.OBLIQ:r=Math.abs(h)<=Hm?this.lat0:Math.asin(y*this.sinph0+p*d*this.cosph0/h),f*=d*this.cosph0,p=(y-Math.sin(r)*this.sinph0)*h;break;case this.N_POLE:p=-p,r=Gm-r;break;case this.S_POLE:r-=Gm}t=0!==p||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,p):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,p*=this.dd,(a=Math.sqrt(f*f+p*p))1&&(e=e>1?1:-1),Math.asin(e)}var xg={init:function(){Math.abs(this.lat1+this.lat2)Hm?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=dg(this.e3,this.sin_phi),o=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,i=this.ns0*xv(t-this.long0),a=o*Math.sin(i)+this.x0,s=this.rh-o*Math.cos(i)+this.y0;return e.x=a,e.y=s,e},inverse:function(e){var t,r,n,o,i,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),o=0,0!==t&&(o=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),i=xv(o/this.ns0+this.long0),e.x=i,e.y=a,e},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(e,t){var r,n,o,i,a,s=_g(.5*t);if(e0||Math.abs(i)<=Hm?(a=this.x0+1*this.a*r*Math.sin(n)/i,s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*o)/i):(a=this.x0+this.infinity_dist*r*Math.sin(n),s=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*o)),e.x=a,e.y=s,e},inverse:function(e){var t,r,n,o,i,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(o=Math.atan2(t,this.rc),r=Math.sin(o),a=_g((n=Math.cos(o))*this.sin_p14+e.y*r*this.cos_p14/t),i=Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r),i=xv(this.long0+i)):(a=this.phic0,i=0),e.x=i,e.y=a,e},names:["gnom"]};var kg={init:function(){this.sphere||(this.k0=Ov(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(e){var t,r,n=e.x,o=e.y,i=xv(n-this.long0);if(this.sphere)t=this.x0+this.a*i*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(o)/Math.cos(this.lat_ts);else{var a=dg(this.e,Math.sin(o));t=this.x0+this.a*this.k0*i,r=this.y0+this.a*a*.5/this.k0}return e.x=t,e.y=r,e},inverse:function(e){var t,r;return e.x-=this.x0,e.y-=this.y0,this.sphere?(t=xv(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=function(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*Gm:Gm;for(var n,o,i,a,s=Math.asin(.5*t),u=0;u<30;u++)if(o=Math.sin(s),i=Math.cos(s),a=e*o,s+=n=Math.pow(1-a*a,2)/(2*i)*(t/(1-e*e)-o/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return s;return NaN}(this.e,2*e.y*this.k0/this.a),t=xv(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e},names:["cea"]};var Eg={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(e){var t=e.x,r=e.y,n=xv(t-this.long0),o=pg(r-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*o,e},inverse:function(e){var t=e.x,r=e.y;return e.x=xv(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=pg(this.lat0+(r-this.y0)/this.a),e},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},jg=20;var Tg={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=sg(this.es),this.e1=ug(this.es),this.e2=lg(this.es),this.e3=cg(this.es),this.ml0=this.a*ag(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(e){var t,r,n,o=e.x,i=e.y,a=xv(o-this.long0);if(n=a*Math.sin(i),this.sphere)Math.abs(i)<=Hm?(t=this.a*a,r=-1*this.a*this.lat0):(t=this.a*Math.sin(n)/Math.tan(i),r=this.a*(pg(i-this.lat0)+(1-Math.cos(n))/Math.tan(i)));else if(Math.abs(i)<=Hm)t=this.a*a,r=-1*this.ml0;else{var s=fg(this.a,this.e,Math.sin(i))/Math.tan(i);t=s*Math.sin(n),r=this.a*ag(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+s*(1-Math.cos(n))}return e.x=t+this.x0,e.y=r+this.y0,e},inverse:function(e){var t,r,n,o,i,a,s,u,l;if(n=e.x-this.x0,o=e.y-this.y0,this.sphere)if(Math.abs(o+this.a*this.lat0)<=Hm)t=xv(n/this.a+this.long0),r=0;else{var c;for(a=this.lat0+o/this.a,s=n*n/this.a/this.a+a*a,u=a,i=jg;i;--i)if(u+=l=-1*(a*(u*(c=Math.tan(u))+1)-u-.5*(u*u+s)*c)/((u-a)/c-1),Math.abs(l)<=Hm){r=u;break}t=xv(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(r))}else if(Math.abs(o+this.ml0)<=Hm)r=0,t=xv(this.long0+n/this.a);else{var f,p,h,y,d;for(a=(this.ml0+o)/this.a,s=n*n/this.a/this.a+a*a,u=a,i=jg;i;--i)if(d=this.e*Math.sin(u),f=Math.sqrt(1-d*d)*Math.tan(u),p=this.a*ag(this.e0,this.e1,this.e2,this.e3,u),h=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=l=(a*(f*(y=p/this.a)+1)-y-.5*f*(y*y+s))/(this.es*Math.sin(2*u)*(y*y+s-2*a*y)/(4*f)+(a-y)*(f*h-2/Math.sin(2*u))-h),Math.abs(l)<=Hm){r=u;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=xv(this.long0+Math.asin(n*f/this.a)/Math.sin(r))}return e.x=t,e.y=r,e},names:["Polyconic","poly"]};var Cg={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(e){var t,r=e.x,n=e.y-this.lat0,o=r-this.long0,i=n/Um*1e-5,a=o,s=1,u=0;for(t=1;t<=10;t++)s*=i,u+=this.A[t]*s;var l,c=u,f=a,p=1,h=0,y=0,d=0;for(t=1;t<=6;t++)l=h*c+p*f,p=p*c-h*f,h=l,y=y+this.B_re[t]*p-this.B_im[t]*h,d=d+this.B_im[t]*p+this.B_re[t]*h;return e.x=d*this.a+this.x0,e.y=y*this.a+this.y0,e},inverse:function(e){var t,r,n=e.x,o=e.y,i=n-this.x0,a=(o-this.y0)/this.a,s=i/this.a,u=1,l=0,c=0,f=0;for(t=1;t<=6;t++)r=l*a+u*s,u=u*a-l*s,l=r,c=c+this.C_re[t]*u-this.C_im[t]*l,f=f+this.C_im[t]*u+this.C_re[t]*l;for(var p=0;p.999999999999&&(r=.999999999999),t=Math.asin(r);var n=xv(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var o=Math.asin(r);return e.x=n,e.y=o,e},names:["Mollweide","moll"]};var Mg={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var i=0;return 0!==r&&(i=Math.atan2(t*e.x,t*e.y)),this.sphere?(o=xv(this.long0+i/this.ns),n=pg(this.g-r/this.a),e.x=o,e.y=n,e):(n=hg(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),o=xv(this.long0+i/this.ns),e.x=o,e.y=n,e)},names:["Equidistant_Conic","eqdc"]};var Rg={init:function(){this.R=this.a},forward:function(e){var t,r,n=e.x,o=e.y,i=xv(n-this.long0);Math.abs(o)<=Hm&&(t=this.x0+this.R*i,r=this.y0);var a=_g(2*Math.abs(o/Math.PI));(Math.abs(i)<=Hm||Math.abs(Math.abs(o)-Gm)<=Hm)&&(t=this.x0,r=o>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/i-i/Math.PI),u=s*s,l=Math.sin(a),c=Math.cos(a),f=c/(l+c-1),p=f*f,h=f*(2/l-1),y=h*h,d=Math.PI*this.R*(s*(f-y)+Math.sqrt(u*(f-y)*(f-y)-(y+u)*(p-y)))/(y+u);i<0&&(d=-d),t=this.x0+d;var m=u+f;return d=Math.PI*this.R*(h*m-s*Math.sqrt((y+u)*(u+1)-m*m))/(y+u),r=o>=0?this.y0+d:this.y0-d,e.x=t,e.y=r,e},inverse:function(e){var t,r,n,o,i,a,s,u,l,c,f,p;return e.x-=this.x0,e.y-=this.y0,f=Math.PI*this.R,i=(n=e.x/f)*n+(o=e.y/f)*o,f=3*(o*o/(u=-2*(a=-Math.abs(o)*(1+i))+1+2*o*o+i*i)+(2*(s=a-2*o*o+n*n)*s*s/u/u/u-9*a*s/u/u)/27)/(l=(a-s*s/3/u)/u)/(c=2*Math.sqrt(-l/3)),Math.abs(f)>1&&(f=f>=0?1:-1),p=Math.acos(f)/3,r=e.y>=0?(-c*Math.cos(p+Math.PI/3)-s/3/u)*Math.PI:-(-c*Math.cos(p+Math.PI/3)-s/3/u)*Math.PI,t=Math.abs(n)2*Gm*this.a)return;return r=t/this.a,n=Math.sin(r),o=Math.cos(r),i=this.long0,Math.abs(t)<=Hm?a=this.lat0:(a=_g(o*this.sin_p12+e.y*n*this.cos_p12/t),s=Math.abs(this.lat0)-Gm,i=Math.abs(s)<=Hm?this.lat0>=0?xv(this.long0+Math.atan2(e.x,-e.y)):xv(this.long0-Math.atan2(-e.x,e.y)):xv(this.long0+Math.atan2(e.x*n,t*this.cos_p12*o-e.y*this.sin_p12*n))),e.x=i,e.y=a,e}return u=sg(this.es),l=ug(this.es),c=lg(this.es),f=cg(this.es),Math.abs(this.sin_p12-1)<=Hm?(a=hg(((p=this.a*ag(u,l,c,f,Gm))-(t=Math.sqrt(e.x*e.x+e.y*e.y)))/this.a,u,l,c,f),i=xv(this.long0+Math.atan2(e.x,-1*e.y)),e.x=i,e.y=a,e):Math.abs(this.sin_p12+1)<=Hm?(p=this.a*ag(u,l,c,f,Gm),a=hg(((t=Math.sqrt(e.x*e.x+e.y*e.y))-p)/this.a,u,l,c,f),i=xv(this.long0+Math.atan2(e.x,e.y)),e.x=i,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),d=Math.atan2(e.x,e.y),h=fg(this.a,this.e,this.sin_p12),m=Math.cos(d),b=-(v=this.e*this.cos_p12*m)*v/(1-this.es),g=3*this.es*(1-b)*this.sin_p12*this.cos_p12*m/(1-this.es),O=1-b*(S=(w=t/h)-b*(1+b)*Math.pow(w,3)/6-g*(1+3*b)*Math.pow(w,4)/24)*S/2-w*S*S*S/6,y=Math.asin(this.sin_p12*Math.cos(S)+this.cos_p12*Math.sin(S)*m),i=xv(this.long0+Math.asin(Math.sin(d)*Math.sin(S)/Math.cos(y))),_=Math.sin(y),a=Math.atan2((_-this.es*O*this.sin_p12)*Math.tan(y),_*(1-this.es)),e.x=i,e.y=a,e)},names:["Azimuthal_Equidistant","aeqd"]};var Bg={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(e){var t,r,n,o,i,a,s,u=e.x,l=e.y;return n=xv(u-this.long0),t=Math.sin(l),r=Math.cos(l),o=Math.cos(n),((i=this.sin_p14*t+this.cos_p14*r*o)>0||Math.abs(i)<=Hm)&&(a=1*this.a*r*Math.sin(n),s=this.y0+1*this.a*(this.cos_p14*t-this.sin_p14*r*o)),e.x=a,e.y=s,e},inverse:function(e){var t,r,n,o,i,a,s;return e.x-=this.x0,e.y-=this.y0,r=_g((t=Math.sqrt(e.x*e.x+e.y*e.y))/this.a),n=Math.sin(r),o=Math.cos(r),a=this.long0,Math.abs(t)<=Hm?(s=this.lat0,e.x=a,e.y=s,e):(s=_g(o*this.sin_p14+e.y*n*this.cos_p14/t),i=Math.abs(this.lat0)-Gm,Math.abs(i)<=Hm?(a=this.lat0>=0?xv(this.long0+Math.atan2(e.x,-e.y)):xv(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=s,e):(a=xv(this.long0+Math.atan2(e.x*n,t*this.cos_p14*o-e.y*this.sin_p14*n)),e.x=a,e.y=s,e))},names:["ortho"]},Fg={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Ug={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Gg(e,t,r,n){var o;return eKm&&o<=Gm+Km?(n.value=Ug.AREA_1,o-=Gm):o>Gm+Km||o<=-(Gm+Km)?(n.value=Ug.AREA_2,o=o>=0?o-Qm:o+Qm):(n.value=Ug.AREA_3,o+=Gm)),o}function zg(e,t){var r=e+t;return r<-Qm?r+=Ym:r>+Qm&&(r-=Ym),r}var Vg={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Gm-Km/2?this.face=Fg.TOP:this.lat0<=-(Gm-Km/2)?this.face=Fg.BOTTOM:Math.abs(this.long0)<=Km?this.face=Fg.FRONT:Math.abs(this.long0)<=Gm+Km?this.face=this.long0>0?Fg.RIGHT:Fg.LEFT:this.face=Fg.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(e){var t,r,n,o,i,a,s={x:0,y:0},u={value:0};if(e.x-=this.long0,t=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(e.y)):e.y,r=e.x,this.face===Fg.TOP)o=Gm-t,r>=Km&&r<=Gm+Km?(u.value=Ug.AREA_0,n=r-Gm):r>Gm+Km||r<=-(Gm+Km)?(u.value=Ug.AREA_1,n=r>0?r-Qm:r+Qm):r>-(Gm+Km)&&r<=-Km?(u.value=Ug.AREA_2,n=r+Gm):(u.value=Ug.AREA_3,n=r);else if(this.face===Fg.BOTTOM)o=Gm+t,r>=Km&&r<=Gm+Km?(u.value=Ug.AREA_0,n=-r+Gm):r=-Km?(u.value=Ug.AREA_1,n=-r):r<-Km&&r>=-(Gm+Km)?(u.value=Ug.AREA_2,n=-r-Gm):(u.value=Ug.AREA_3,n=r>0?-r+Qm:-r-Qm);else{var l,c,f,p,h,y;this.face===Fg.RIGHT?r=zg(r,+Gm):this.face===Fg.BACK?r=zg(r,+Qm):this.face===Fg.LEFT&&(r=zg(r,-Gm)),p=Math.sin(t),h=Math.cos(t),y=Math.sin(r),l=h*Math.cos(r),c=h*y,f=p,this.face===Fg.FRONT?n=Gg(o=Math.acos(l),f,c,u):this.face===Fg.RIGHT?n=Gg(o=Math.acos(c),f,-l,u):this.face===Fg.BACK?n=Gg(o=Math.acos(-l),f,-c,u):this.face===Fg.LEFT?n=Gg(o=Math.acos(-c),f,l,u):(o=n=0,u.value=Ug.AREA_0)}return a=Math.atan(12/Qm*(n+Math.acos(Math.sin(n)*Math.cos(Km))-Gm)),i=Math.sqrt((1-Math.cos(o))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),u.value===Ug.AREA_1?a+=Gm:u.value===Ug.AREA_2?a+=Qm:u.value===Ug.AREA_3&&(a+=1.5*Qm),s.x=i*Math.cos(a),s.y=i*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,e.x=s.x,e.y=s.y,e},inverse:function(e){var t,r,n,o,i,a,s,u,l,c,f,p,h={lam:0,phi:0},y={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),t=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?y.value=Ug.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(y.value=Ug.AREA_1,t-=Gm):e.x<0&&-e.x>=Math.abs(e.y)?(y.value=Ug.AREA_2,t=t<0?t+Qm:t-Qm):(y.value=Ug.AREA_3,t+=Gm),l=Qm/12*Math.tan(t),i=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),a=Math.atan(i),(s=1-(n=Math.cos(t))*n*(o=Math.tan(r))*o*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===Fg.TOP)u=Math.acos(s),h.phi=Gm-u,y.value===Ug.AREA_0?h.lam=a+Gm:y.value===Ug.AREA_1?h.lam=a<0?a+Qm:a-Qm:y.value===Ug.AREA_2?h.lam=a-Gm:h.lam=a;else if(this.face===Fg.BOTTOM)u=Math.acos(s),h.phi=u-Gm,y.value===Ug.AREA_0?h.lam=-a+Gm:y.value===Ug.AREA_1?h.lam=-a:y.value===Ug.AREA_2?h.lam=-a-Gm:h.lam=a<0?-a-Qm:-a+Qm;else{var d,m,v;l=(d=s)*d,m=(l+=(v=l>=1?0:Math.sqrt(1-l)*Math.sin(a))*v)>=1?0:Math.sqrt(1-l),y.value===Ug.AREA_1?(l=m,m=-v,v=l):y.value===Ug.AREA_2?(m=-m,v=-v):y.value===Ug.AREA_3&&(l=m,m=v,v=-l),this.face===Fg.RIGHT?(l=d,d=-m,m=l):this.face===Fg.BACK?(d=-d,m=-m):this.face===Fg.LEFT&&(l=d,d=m,m=-l),h.phi=Math.acos(-v)-Gm,h.lam=Math.atan2(m,d),this.face===Fg.RIGHT?h.lam=zg(h.lam,-Gm):this.face===Fg.BACK?h.lam=zg(h.lam,-Qm):this.face===Fg.LEFT&&(h.lam=zg(h.lam,+Gm))}return 0!==this.es&&(c=h.phi<0?1:0,f=Math.tan(h.phi),p=this.b/Math.sqrt(f*f+this.one_minus_f_squared),h.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),c&&(h.phi=-h.phi)),h.lam+=this.long0,e.x=h.lam,e.y=h.phi,e},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},qg=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Hg=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Wg=.8487,Jg=1.3523,Kg=Jm/5,Yg=1/Kg,Qg=18,Xg=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},Zg=function(e,t){return e[1]+t*(2*e[2]+3*t*e[3])};var $g={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(e){var t=xv(e.x-this.long0),r=Math.abs(e.y),n=Math.floor(r*Kg);n<0?n=0:n>=Qg&&(n=Qg-1),r=Jm*(r-Yg*n);var o={x:Xg(qg[n],r)*t,y:Xg(Hg[n],r)};return e.y<0&&(o.y=-o.y),o.x=o.x*this.a*Wg+this.x0,o.y=o.y*this.a*Jg+this.y0,o},inverse:function(e){var t={x:(e.x-this.x0)/(this.a*Wg),y:Math.abs(e.y-this.y0)/(this.a*Jg)};if(t.y>=1)t.x/=qg[Qg][0],t.y=e.y<0?-Gm:Gm;else{var r=Math.floor(t.y*Qg);for(r<0?r=0:r>=Qg&&(r=Qg-1);;)if(Hg[r][0]>t.y)--r;else{if(!(Hg[r+1][0]<=t.y))break;++r}var n=Hg[r],o=5*(t.y-n[0])/(Hg[r+1][0]-n[0]);o=function(e,t,r,n){for(var o=t;n;--n){var i=e(o);if(o-=i,Math.abs(i)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(e){var t,r,n,o,i=e.x,a=e.y;if(i-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/qb(this.radius_p*Math.cos(a),Math.sin(a));if(r=s*Math.cos(i)*Math.cos(a),n=s*Math.sin(i)*Math.cos(a),o=s*Math.sin(a),(this.radius_g-r)*r-n*n-o*o*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/qb(o,t)),e.y=this.radius_g_1*Math.atan(o/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(o/qb(n,t)))}else"sphere"===this.shape&&(t=Math.cos(a),r=Math.cos(i)*t,n=Math.sin(i)*t,o=Math.sin(a),t=this.radius_g-r,this.flip_axis?(e.x=this.radius_g_1*Math.atan(n/qb(o,t)),e.y=this.radius_g_1*Math.atan(o/t)):(e.x=this.radius_g_1*Math.atan(n/t),e.y=this.radius_g_1*Math.atan(o/qb(n,t))));return e.x=e.x*this.a,e.y=e.y*this.a,e},inverse:function(e){var t,r,n,o,i=-1,a=0,s=0;if(e.x=e.x/this.a,e.y=e.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*qb(1,s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*qb(1,a));var u=s/this.radius_p;if(t=a*a+u*u+i*i,(n=(r=2*this.radius_g*i)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-r-Math.sqrt(n))/(2*t),i=this.radius_g+o*i,a*=o,s*=o,e.x=Math.atan2(a,i),e.y=Math.atan(s*Math.cos(e.x)/i),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(e.y/this.radius_g_1),a=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(e.x/this.radius_g_1),s=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+a*a)),t=a*a+s*s+i*i,(n=(r=2*this.radius_g*i)*r-4*t*this.C)<0)return e.x=Number.NaN,e.y=Number.NaN,e;o=(-r-Math.sqrt(n))/(2*t),i=this.radius_g+o*i,a*=o,s*=o,e.x=Math.atan2(a,i),e.y=Math.atan(s*Math.cos(e.x)/i)}return e.x=e.x+this.long0,e},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},iw=1.340264,aw=-.081106,sw=893e-6,uw=.003796,lw=Math.sqrt(3)/2;var cw={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(e){var t=xv(e.x-this.long0),r=e.y,n=Math.asin(lw*Math.sin(r)),o=n*n,i=o*o*o;return e.x=t*Math.cos(n)/(lw*(iw+3*aw*o+i*(7*sw+9*uw*o))),e.y=n*(iw+aw*o+i*(sw+uw*o)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e},inverse:function(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t,r,n,o,i=e.y;for(o=0;o<12&&(i-=n=(i*(iw+aw*(t=i*i)+(r=t*t*t)*(sw+uw*t))-e.y)/(iw+3*aw*t+r*(7*sw+9*uw*t)),!(Math.abs(n)<1e-9));++o);return r=(t=i*i)*t*t,e.x=lw*e.x*(iw+3*aw*t+r*(7*sw+9*uw*t))/Math.cos(i),e.y=Math.asin(Math.sin(i)/lw),e.x=xv(e.x+this.long0),e},names:["eqearth","Equal Earth","Equal_Earth"]};ab.defaultDatum="WGS84",ab.Proj=Hv,ab.WGS84=new ab.Proj("WGS84"),ab.Point=Pb,ab.toPoint=eb,ab.defs=vv,ab.nadgrid=function(e,t){var r=new DataView(t),n=function(e){var t=e.getInt32(8,!1);return 11!==t&&(11!==(t=e.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),o=function(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:Uv(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}(r,n),i={header:o,subgrids:function(e,t,r){for(var n=176,o=[],i=0;ie.length)&&(t=e.length);for(var r=0,n=Array(t);r=t[0]&&e[0]<=t[2]&&e[1]>=t[1]&&e[1]<=t[3]}},{key:"moveLayer",value:function(e){this.map.moveLayer(this.layerId,e)}},{key:"setVisibility",value:function(e){var t=e?"visible":"none";this.map.setLayoutProperty(this.layerId,"visibility",t)}}])&&dw(r.prototype,n),i&&dw(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Sw(e){"@babel/helpers - typeof";return(Sw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ow(e,t){for(var r=0;r0?(r.totalTimes--,r.ajaxPolling(e)):r._commit(e)}},{key:"ajaxPolling",value:function(e){var t=this,r=e.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return t.index=parseInt(Math.random()*t.length),t.url=t.urls[t.index],r=r.replace(n,n.exec(t.url)[0]),e.url=r,e.isInTheSameDomain=L.isInTheSameDomain(r),t._commit(e)}},{key:"calculatePollingTimes",value:function(){var e=this;e.times?e.totalTimes>e.POLLING_TIMES?e.times>e.POLLING_TIMES?e.totalTimes=e.POLLING_TIMES:e.totalTimes=e.times:e.timese.POLLING_TIMES&&(e.totalTimes=e.POLLING_TIMES),e.totalTimes--}},{key:"isServiceSupportPolling",value:function(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}},{key:"transformResult",value:function(e,t){return{result:e=L.transformResult(e),options:t}}},{key:"transformErrorResult",value:function(e,t){return{error:(e=L.transformResult(e)).error||e,options:t}}},{key:"serviceProcessCompleted",value:function(e,t){e=this.transformResult(e).result,this.events.triggerEvent("processCompleted",{result:e,options:t})}},{key:"serviceProcessFailed",value:function(e,t){var r=(e=this.transformErrorResult(e).error).error||e;this.events.triggerEvent("processFailed",{error:r,options:t})}},{key:"_returnContent",value:function(e){return e.scope.format!==on.FGB&&!!e.scope.returnContent}},{key:"supportDataFormat",value:function(e){return this.dataFormat().includes(e)}},{key:"dataFormat",value:function(){return[on.GEOJSON,on.ISERVER]}},{key:"_commit",value:function(e){var t=this;if("POST"===e.method||"PUT"===e.method||"PATCH"===e.method)if(e.params&&(e.url=L.urlAppend(e.url,L.getParameterString(e.params||{}))),"object"!==Mw(e.data)||e.data instanceof FormData)e.params=e.data;else try{e.params=L.toJSON(e.data)}catch(e){console.log("不是json对象")}return z.commit(e.method,e.url,e.params,{headers:e.headers,withoutFormatSuffix:e.withoutFormatSuffix,withCredentials:e.withCredentials,crossOrigin:e.crossOrigin,timeout:e.async?0:null,proxy:e.proxy}).then(function(e){return e.text?e.text():e.json?e.json():e}).then(function(t){var r=t;return"string"==typeof t&&(r=(new Sr).read(t)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&e.scope.format===on.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(e){return{error:e}}).then(function(r){var n={object:t};if(r.error){var o="processFailed";if(t.events&&t.events.listeners[o]&&t.events.listeners[o].length){var i=e.failure&&(e.scope?y.bind(e.failure,e.scope):e.failure);i?i(r,e):t.serviceProcessFailed(r,e)}else(n=Lw(Lw({},n),t.transformErrorResult(r,e))).type=o,e.failure&&e.failure(n)}else{var a="processCompleted";if(t.events&&t.events.listeners[a]&&t.events.listeners[a].length){var s=e.success&&(e.scope?y.bind(e.success,e.scope):e.success);s?s(r,e):t.serviceProcessCompleted(r,e)}else r.succeed=void 0==r.succeed||r.succeed,(n=Lw(Lw({},n),t.transformResult(r,e))).type=a,e.success&&e.success(n)}return n})}}])&&Rw(e.prototype,t),r&&Rw(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function Fw(e){"@babel/helpers - typeof";return(Fw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Uw(){Uw=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Fw(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Gw(e){return function(e){if(Array.isArray(e))return zw(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return zw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zw(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function $w(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function eS(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"id";return sS()(e,t)}function mS(e){return e.hasOwnProperty("start")&&e.hasOwnProperty("end")}function vS(e,t,r){var n=e.id,o=e.properties,i=e.lables,a=t?function(e,t){if(!t)return{};for(var r=e.id,n=e.labels,o=t.filter(function(e){return"entity"===e.type}),i=0;ie.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:this.hoverColor;return{stroke:e,shadowColor:e,shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:e}}}},{key:"_getDefaultNodeHighlightStyle",value:function(){return{lineWidth:3,stroke:arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hoverColor}}},{key:"_getContextMenu",value:function(){var e=this;return new(OS().Menu)({shouldBegin:function(e){return!!(e.target&&e.target.isCanvas&&e.target.isCanvas())||!!e.item},getContent:function(t){var r=t.item;if(!(t.target&&t.target.isCanvas&&t.target.isCanvas())&&r){var n=r.getType(),o=r.getModel();return n&&o&&"node"===n?e.isCollpased(o.id)?"
      \n
    • 展开
    • \n
    ":"
      \n
    • 折叠
    • \n
    ":void 0}},handleMenuClick:function(t,r){switch(t.id.split("-")[0]){case"hide":e.hideItem(r);break;case"expand":e.expandNode(r);break;case"collapse":e.collapseNode(r);break;case"show":e.showItem(r)}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}},{key:"_getGraphConfig",value:function(e){var t=this,r={speed:150,maxIteration:30,tick:kS()(this.refreshPositions.bind(this),150)},n={type:"fruchterman",gravity:5},o={},i={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},a={default:["drag-canvas","zoom-canvas","drag-node"]},s=this._getContextMenu(),u=[new(OS().ToolBar),s];if(!e)return this._setToolBarStyle(),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"knowledgeGraph",s=document.querySelector("#".concat(e));return{container:e,width:s.scrollWidth,height:s.scrollHeight,plugins:u,modes:a,layout:AS(AS({},n),r),defaultNode:o,defaultEdge:i,nodeStateStyles:{hover:t._getDefaultNodeHighlightStyle(),actived:t._getDefaultNodeHighlightStyle()},edgeStateStyles:{hover:t._getDefaultEdgeHighlightStyle(),actived:t._getDefaultEdgeHighlightStyle()}}}();e.container=e.container||"knowledgeGraph";var l="string"==typeof e.container?document.querySelector("#".concat(e.container)):e.container;e.width=e.width||l.scrollWidth,e.height=e.height||l.scrollHeight,e.layout=AS(AS(AS({},n),e.layout||{}),!1!==e.animate?r:{}),e.defaultNode=AS(AS({},o),e.defaultNode||{}),e.defaultEdge=AS(AS({},i),e.defaultEdge||{}),e.modes={default:[]},!1!==e.dragCanvas&&e.modes.default.push("drag-canvas"),!1!==e.zoomCanvas&&e.modes.default.push("zoom-canvas"),!1!==e.dragNode&&e.modes.default.push("drag-node");var c=AS(AS({},this._getDefaultNodeHighlightStyle()),e.nodeHighlightStyle||{}),f=AS(AS({},this._getDefaultEdgeHighlightStyle()),e.edgeHighlightStyle||{});return e.nodeStateStyles={hover:c,actived:c},e.edgeStateStyles={hover:f,actived:f},!1!==e.showToolBar&&(e.plugins=[new(OS().ToolBar)],this._setToolBarStyle()),!1!==e.showContextMenu&&(e.plugins=[].concat(jS(e.plugins||[]),[s]),this._setToolBarStyle()),e}},{key:"changeSize",value:function(e,t){return this.graph.changeSize(e,t)}},{key:"autoResize",value:function(){var e=this,t=this.getContainer();window.addEventListener("resize",function(){var r=t.scrollWidth,n=t.scrollHeight;e.graph.changeSize(r,n),e.graph.refresh()})}},{key:"zoom",value:function(e,t,r,n){this.graph.zoom(e,t,r,n)}},{key:"zoomTo",value:function(e,t,r,n){this.graph.zoomTo(e,t,r,n)}},{key:"fitView",value:function(e,t,r,n){this.graph.fitView(e,t,r,n)}},{key:"fitCenter",value:function(e,t){this.graph.fitCenter(e,t)}},{key:"getGraphCenterPoint",value:function(){return this.graph.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graph.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graph.getZoom()}},{key:"getMinZoom",value:function(){return this.graph.getMinZoom()}},{key:"setMinZoom",value:function(e){this.graph.setMinZoom(e)}},{key:"getMaxZoom",value:function(){return this.graph.getMaxZoom()}},{key:"setMaxZoom",value:function(e){this.graph.setMaxZoom(e)}},{key:"getWidth",value:function(){return this.graph.getWidth()}},{key:"getHeight",value:function(){return this.graph.getHeight()}},{key:"setCenter",value:function(e){var t=this.graph.getWidth()/2,r=this.graph.getHeight()/2,n=this.graph.getCanvasByPoint(e.x,e.y);this.graph.translate(t-n.x,r-n.y)}},{key:"_setToolBarStyle",value:function(){xS()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ")}},{key:"highlightNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,t=null;e.on("node:mouseenter",function(r){var n=r.item;e.setAutoPaint(!1),t&&e.clearItemStates(t,"hover"),e.setItemState(n,"hover",!0),t=n,e.paint(),e.setAutoPaint(!0)}),e.on("node:mouseleave",function(){e.setAutoPaint(!1),t&&(e.clearItemStates(t,"hover"),t=null),e.paint(),e.setAutoPaint(!0)})}},{key:"highlightEdge",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,t=null;e.on("edge:mouseenter",function(r){var n=r.item;e.setAutoPaint(!1),t&&e.clearItemStates(t,"hover"),e.setItemState(n,"hover",!0),t=n,e.paint(),e.setAutoPaint(!0)}),e.on("edge:mouseleave",function(){e.setAutoPaint(!1),t&&(e.clearItemStates(t,"hover"),t=null),e.paint(),e.setAutoPaint(!0)})}},{key:"setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data?t.changeData(e):t.data(e),this.data=e}},{key:"render",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).render()}},{key:"updateGraph",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data=e,t.changeData(e)}},{key:"refresh",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refresh()}},{key:"getContainer",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getContainer()}},{key:"getCanvas",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).get("canvas")}},{key:"getNodes",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getNodes()}},{key:"getEdges",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getEdges()}},{key:"getNeighbors",value:function(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).getNeighbors(e,t)}},{key:"findById",value:function(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).findById(e)}},{key:"find",value:function(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).find(e,t)}},{key:"findAll",value:function(e,t){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).findAll(e,t)}},{key:"getEdgesByNode",value:function(e){return e.getEdges()}},{key:"getInEdges",value:function(e){return e.getInEdges()}},{key:"getOutEdges",value:function(e){return e.getOutEdges()}},{key:"getSourceByEdge",value:function(e){return e.getSource()}},{key:"getTargetByEdge",value:function(e){return e.getTarget()}},{key:"expandNode",value:function(e){var t=e.getModel().id;this._expandCollapseNode(this.collpasedData[t],"show"),delete this.collpasedData[t]}},{key:"collapseNode",value:function(e){var t=e.getModel().id,r=[];this._collapseFunc(e,r),this.collpasedData[t]=r,this._expandCollapseNode(r)}},{key:"isCollpased",value:function(e){return!!this.collpasedData[e]}},{key:"_collapseFunc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this.getNeighbors(e,"target"),n=this.getNeighbors(e,"source"),o=0;o1&&void 0!==arguments[1]?arguments[1]:"hide";e&&e.forEach(function(e){"hide"===r?t.hideItem(e.id):(t.showItem(e.id),t.isCollpased(e.id)&&delete t.collpasedData[e.id]),e.children&&t._expandCollapseNode(e.children,r)})}},{key:"showItem",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).showItem(e,t)}},{key:"hideItem",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).hideItem(e,t)}},{key:"show",value:function(e){e.show()}},{key:"hide",value:function(e){e.hide()}},{key:"changeVisibility",value:function(e,t){e.changeVisibility(t)}},{key:"isVisible",value:function(e){return e.isVisible()}},{key:"getModel",value:function(e){return e.getModel()}},{key:"addItem",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).addItem(e,t)}},{key:"removeItem",value:function(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).removeItem(e)}},{key:"updateItem",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).updateItem(e,t)}},{key:"refreshItem",value:function(e){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).refreshItem(e)}},{key:"refreshPositions",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refreshPositions()}},{key:"on",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).on(e,t)}},{key:"off",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).off(e,t)}},{key:"toDataURL",value:function(e,t){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).toDataURL(e,t)}},{key:"bindNodeDefaultDragEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;e.on("node:dragstart",function(e){RS(e)}),e.on("node:drag",function(e){RS(e)}),e.on("node:dragend",function(e){e.item.get("model").fx=null,e.item.get("model").fy=null})}},{key:"stopDefaultEventPropagation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;e.on("click",function(e){e.stopPropagation()}),e.on("mousedown",function(e){e.stopPropagation()}),e.on("mouseover",function(e){e.stopPropagation()}),e.on("mouseout",function(e){e.stopPropagation()})}},{key:"clear",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).clear()}},{key:"destroy",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).destroy()}}])&&LS(e.prototype,t),r&&LS(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function RS(e){var t=e.item.get("model");return t.fx=e.x,t.fy=e.y,t.x=e.x,t.y=e.y,t}var DS=r(5611),BS=r.n(DS);function FS(e){"@babel/helpers - typeof";return(FS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function US(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"G6";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.graph=null,this.config=BS()(t),this.graphRender=null,this.type=r,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"},r=[{key:"dataFromGraphMap",value:function(e,t){return yS(e,t)}},{key:"dataFromKnowledgeGraphQuery",value:function(e){return yS(e)}}],(t=[{key:"_handleNodes",value:function(e,t){var r=this;e.filter(function(e){return""!==e}).forEach(function(e){var n=r.findById(e);t(n,"node")})}},{key:"_handleEdges",value:function(e,t){var r=this;e.filter(function(e){return""!==e}).forEach(function(e){var n=r.find("edge",function(t){return t.get("model").edgeId==e});t(n,"edge")})}},{key:"highlight",value:function(e){var t=e.nodeIDs,r=void 0===t?[]:t,n=e.edgeIDs,o=void 0===n?[]:n,i=this.graph,a=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"node";if(t){var n=e[r+"StateStyles"];n&&i.updateItem(t,{style:t.style,stateStyles:{actived:n}}),i.setItemState(t,"actived",!0),i.paint(),i.setAutoPaint(!0)}};this._handleNodes(r,a),this._handleEdges(o,a)}},{key:"clearHighlight",value:function(e){var t=this.graph,r=function(e){e&&(t.clearItemStates(e,"actived"),t.paint(),t.setAutoPaint(!0))};if(t.setAutoPaint(!1),!e)return t.getNodes().forEach(function(e){r(e)}),void t.getEdges().forEach(function(e){r(e)});var n=e.nodeIDs,o=void 0===n?[]:n,i=e.edgeIDs,a=void 0===i?[]:i;this._handleNodes(o,r),this._handleEdges(a,r)}},{key:"handleNodeStatus",value:function(e){var t=e.expand,r=e.collapse,n=e.hidden;this.expandNodes(t),this.collapseNodes(r),this.hideNodes(n)}},{key:"expandNodes",value:function(e){var t=this;e&&e.forEach(function(e){t.expandNode(e+"")})}},{key:"collapseNodes",value:function(e){var t=this;e&&e.forEach(function(e){t.collapseNode(e+"")})}},{key:"hideNodes",value:function(e){var t=this;e&&e.forEach(function(e){t.hideItem(e+"")})}},{key:"createGraphRender",value:function(e){"G6"===e&&(this.graphRender=new MS)}},{key:"createGraph",value:function(e){var t=this.initGraph(e);return this.graph=t,this.autoResize(),t}},{key:"getGraph",value:function(){return this.graph}},{key:"autoResize",value:function(){this.config&&!1!==this.config.autoResize&&this.graphRender.autoResize()}},{key:"zoom",value:function(e,t,r,n){this.graphRender.zoom(e,t,r,n)}},{key:"zoomTo",value:function(e,t,r,n){this.graphRender.zoomTo(e,t,r,n)}},{key:"fitView",value:function(e,t,r,n){this.graphRender.fitView(e,t,r,n)}},{key:"fitCenter",value:function(e,t){this.graphRender.fitCenter(e,t)}},{key:"getGraphCenterPoint",value:function(){return this.graphRender.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graphRender.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graphRender.getZoom()}},{key:"getMinZoom",value:function(){return this.graphRender.getMinZoom()}},{key:"setMinZoom",value:function(e){this.graphRender.setMinZoom(e)}},{key:"getMaxZoom",value:function(){return this.graphRender.getMaxZoom()}},{key:"setMaxZoom",value:function(e){this.graphRender.setMaxZoom(e)}},{key:"getWidth",value:function(){return this.graphRender.getWidth()}},{key:"getHeight",value:function(){return this.graphRender.getHeight()}},{key:"initGraph",value:function(e){var t=this,r=this.graphRender.initGraph(e);this.graph=r;return this.graph.on("afterlayout",function(){void 0!==t.config.zoom&&t.zoom(t.config.zoom),void 0!==t.config.center&&t.graphRender.setCenter({x:t.config.center[0],y:t.config.center[1]})}),r}},{key:"setData",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;e=e||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(e.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,e.nodes)),this.graphRender.setData(e,t),this.render(t),this.data=e}},{key:"render",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;e&&this.graphRender.render(e)}},{key:"updateGraph",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;t&&this.graphRender.updateGraph(e,t)}},{key:"refresh",value:function(){return this.graphRender.refresh()}},{key:"changeSize",value:function(e,t){return this.graphRender.changeSize(e,t)}},{key:"resize",value:function(e,t){this.graphRender.changeSize(e,t),this.graphRender.refresh()}},{key:"getContainer",value:function(){return this.graphRender.getContainer()}},{key:"getCanvas",value:function(){return this.graphRender.getCanvas()}},{key:"getNodes",value:function(){return this.graphRender.getNodes()}},{key:"getEdges",value:function(){return this.graphRender.getEdges()}},{key:"getNeighbors",value:function(e,t){return this.graphRender.getNeighbors(e,t)}},{key:"findById",value:function(e){return this.graphRender.findById(e)}},{key:"find",value:function(e,t){return this.graphRender.find(e,t)}},{key:"findAll",value:function(e,t){return this.graphRender.findAll(e,t)}},{key:"getEdgesByNode",value:function(e){return this.graphRender.getEdgesByNode(e)}},{key:"getInEdges",value:function(e){return this.graphRender.getInEdges(e)}},{key:"getOutEdges",value:function(e){return this.graphRender.getOutEdges(e)}},{key:"getSourceByEdge",value:function(e){return this.graphRender.getSourceByEdge(e)}},{key:"getTargetByEdge",value:function(e){return this.graphRender.getTargetByEdge(e)}},{key:"expandNode",value:function(e){var t=this.findById(e);t&&this.graphRender.expandNode(t)}},{key:"collapseNode",value:function(e){var t=this.findById(e);t&&this.graphRender.collapseNode(t)}},{key:"showItem",value:function(e,t){this.graphRender.showItem(e,t)}},{key:"hideItem",value:function(e,t){this.graphRender.hideItem(e,t)}},{key:"show",value:function(e){this.graphRender.show(e)}},{key:"hide",value:function(e){this.graphRender.hide(e)}},{key:"changeVisibility",value:function(e,t){this.graphRender.changeVisibility(e,t)}},{key:"isVisible",value:function(e){return this.graphRender.isVisible(e)}},{key:"getModel",value:function(e){return this.graphRender.getModel(e)}},{key:"addItem",value:function(e,t){return this.graphRender.addItem(e,t)}},{key:"removeItem",value:function(e){return this.graphRender.removeItem(e)}},{key:"updateItem",value:function(e,t){return this.graphRender.updateItem(e,t)}},{key:"refreshItem",value:function(e){return this.graphRender.refreshItem(e)}},{key:"refreshPositions",value:function(){return this.graphRender.refreshPositions()}},{key:"on",value:function(e,t){this.graphRender.on(e,t)}},{key:"off",value:function(e,t){this.graphRender.off(e,t)}},{key:"toDataURL",value:function(e,t){this.graphRender.toDataURL(e,t)}},{key:"nodeLabelOpenEllipsis",value:function(e,t){var r=this;return t?e?t.map(function(t){var n=t.labelCfg&&t.labelCfg.fontSize||r.defaultNode&&r.defaultNode.labelCfg&&r.defaultNode.labelCfg.fontSize||14;return t.label=function(e,t,r){var n=1*r;t*=1.6;if(function(e){for(var t=0,r=0;r0&&e.charCodeAt(r)<128?t++:t+=2;return t}(e)*n>t){var o=Math.floor((t-20)/n),i=e.substring(0,o);return(e.substring(o).length+"…".length)*n>t?i+"\n"+e.substring(o,o+o-2)+"…":0==e.substring(o).length?i:i+"\n"+e.substring(o)}return e}(t.label,e,n),t}):t:[]}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;e&&e.clear()}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;e&&e.destroy()}}])&&US(e.prototype,t),r&&US(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function VS(e){"@babel/helpers - typeof";return(VS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function HS(e,t,r){return(t=YS(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WS(){WS=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==VS(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function JS(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function KS(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);rp.length?o:p}if(!o.length){var h=[[0,0],[this.map.transform.width-1,this.map.transform.height-1]];this.queryRenderedFeatures(h,{layerCapture:!1},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];o=e})}return o}},{key:"setSelectedDatas",value:function(e){this.selectedDatas=e instanceof Array?e:[e]}},{key:"_formatListenType",value:function(e){switch(e){case"mouseover":return"mouseenter";case"mouseleave":return"mouseout";default:return e}}},{key:"_transformFilterValues",value:function(e){for(var t=e.fields,r=e.values,n=e.selectedDatas,o=arguments.length,i=new Array(o>1?o-1:0),a=1;ae[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var r=this.map(e.slice(1,3),function(e){return e+"%"});e[1]=r[0],e[2]=r[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=this.adjust(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}},convert:function(e,t){if(!this.isCalculableColor(e))return e;var r=this.getData(e),n=r[3];return void 0===n&&(n=1),e.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):e.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),r[3]=n,this.toColor(r,t)},toRGBA:function(e){return this.convert(e,"rgba")},trim:function(e){return String(e).replace(/\s+/g,"")},normalize:function(e){if(this._nameColors[e]&&(e=this._nameColors[e]),e=(e=this.trim(e)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){var t=(3840&(e=parseInt(e.slice(1),16)))<<8,r=(240&e)<<4,n=15&e;e="#"+((1<<24)+(t<<4)+t+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return e},getData:function(e){var t,r,n=(e=this.normalize(e)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var o,i=[];if(n[2])o=[(t=n[2].replace("#","").split(""))[0]+t[1],t[2]+t[3],t[4]+t[5]],i=this.map(o,function(e){return _O.adjust.call(this,parseInt(e,16),[0,255])});else if(n[4]){var a=n[4].split(",");r=a[3],o=a.slice(0,3),i=this.map(o,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),_O.adjust.call(this,e,[0,255])}),void 0!==r&&i.push(this.adjust(parseFloat(r),[0,1]))}else if(n[5]||n[6]){var s=(n[5]||n[6]).split(","),u=parseInt(s[0],0)/360,l=s[1],c=s[2];r=s[3],(i=this.map([l,c],function(e){return _O.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(u),void 0!==r&&i.push(this.adjust(parseFloat(r),[0,1]))}return i},map:function(e,t){if("function"!=typeof t)throw new TypeError;for(var r=e?e.length:0,n=0;n=t[1]&&(e=t[1]),e},isCalculableColor:function(e){return e instanceof Array||"string"==typeof e},_HSV_2_RGB:function(e){var t,r,n,o=e[0],i=e[1],a=e[2];if(0===i)t=255*a,r=255*a,n=255*a;else{var s=6*o;6===s&&(s=0);var u=0|s,l=a*(1-i),c=a*(1-i*(s-u)),f=a*(1-i*(1-(s-u))),p=0,h=0,y=0;0===u?(p=a,h=f,y=l):1===u?(p=c,h=a,y=l):2===u?(p=l,h=a,y=f):3===u?(p=l,h=c,y=a):4===u?(p=f,h=l,y=a):(p=a,h=l,y=c),t=255*p,r=255*h,n=255*y}return[t,r,n]},_HSL_2_RGB:function(e){var t,r,n,o=e[0],i=e[1],a=e[2];if(0===i)t=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+i):a+i-i*a);t=255*this._HUE_2_RGB(u,s,o+1/3),r=255*this._HUE_2_RGB(u,s,o),n=255*this._HUE_2_RGB(u,s,o-1/3)}return[t,r,n]},_HUE_2_RGB:function(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}};_O.initialize();var xO=_O,PO=r(1855),kO=r.n(PO);function EO(e){"@babel/helpers - typeof";return(EO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function jO(e,t){for(var r=0;r=t)if("RANGE"===r)for(o=0;o=0&&this.getSqrtInterval(e,r):"logarithm"===t?this.getMin(e)>0&&this.getGeometricProgression(e,r):void 0}},{key:"getSum",value:function(e){return this.getInstance(e).sum()}},{key:"getMax",value:function(e){return this.getInstance(e).max()}},{key:"getMin",value:function(e){return this.getInstance(e).min()}},{key:"getMean",value:function(e){return this.getInstance(e).mean()}},{key:"getMedian",value:function(e){return this.getInstance(e).median()}},{key:"getTimes",value:function(e){return e.length}},{key:"getEqInterval",value:function(e,t){return this.getInstance(e).getClassEqInterval(t)}},{key:"getJenks",value:function(e,t){return this.getInstance(e).getClassJenks(t)}},{key:"getSqrtInterval",value:function(e,t){return e=e.map(function(e){return Math.sqrt(e)}),this.getInstance(e).getClassEqInterval(t).map(function(e){return e*e})}},{key:"getGeometricProgression",value:function(e,t){return this.getInstance(e).getClassGeometricProgression(t)}}],(t=null)&&LO(e.prototype,t),r&&LO(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function RO(e){if(!e)throw new Error("No GeoJSON coords provided");if(!e||0===e.length)return null;var t=e.length,r=new Float64Array(e.flat()),n=window.Module._malloc(2*t*8);window.Module.HEAPF64.set(r,n/8);var o=window.Module._UGCWasm_Geometry_CreatePoint2DsFromBuffer(n,t);return window.Module._free(n),o}function DO(e){if(!e)throw new Error("No GeoJSON coords provided");if(!e||0===e.length)return null;var t=e.length,r=new Float64Array(e),n=window.Module._malloc(8*t);window.Module.HEAPF64.set(r,n/8);var o=window.Module._UGCWasm_Helper_CreateDoubleArray(n,t);return window.Module._free(n),o}function BO(e){var t=window.Module._UGCWasm_Helper_GetDoubleArrayLength(e),r=window.Module._malloc(8*t);window.Module._UGCWasm_Helper_GetBufferFromDoubleArray(e,r);for(var n=new Float64Array(window.Module.HEAPF64.buffer,r,t),o=[],i=0;i1)for(var i=1;i1)for(var l=1;l2&&void 0!==arguments[2]?arguments[2]:1e-6,n=UO(e),o=UO(t);return 1===this.module._UGCWasm_Geometrist_IsIdentical(n,o,r)}},{key:"hasIntersection",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=UO(e),o=UO(t);return 1===this.module._UGCWasm_Geometrist_HasIntersection(n,o,r)}},{key:"hasTouch",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=UO(e),o=UO(t);return 1===this.module._UGCWasm_Geometrist_HasTouch(n,o,r)}},{key:"resample",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6,r=UO(e);return{type:"Feature",geometry:FO(this.module._UGCWasm_Geometrist_Resample(r,t))}}},{key:"isParallel",value:function(e,t,r,n,o,i,a,s){return 1===this.module._UGCWasm_Geometrist_IsParallel(e,t,r,n,o,i,a,s)}},{key:"computePerpendicularPosition",value:function(e,t,r,n,o,i){var a=this.module._UGCWasm_Helper_CreateDoubleArray(0,2);return this.module._UGCWasm_Geometrist_ComputePerpendicularPosition(e,t,r,n,o,i,a),a=BO(a)}},{key:"isPointOnLine",value:function(e,t,r,n,o,i){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return 1===this.module._UGCWasm_Geometrist_IsPointOnLine(e,t,r,n,o,i,a)}},{key:"isProjectOnLineSegment",value:function(e,t,r,n,o,i){return 1===this.module._UGCWasm_Geometrist_IsProjectOnLineSegment(e,t,r,n,o,i)}},{key:"distanceToLineSegment",value:function(e,t,r,n,o,i){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:fn.DEGREE,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:fn.DEGREE,u=this.module._UGCWasm_Geometrist_DistanceToLineSegment(e,t,r,n,o,i);return s!==fn.DEGREE?u*nf(a)/nf(s):u}},{key:"nearestPointToVertex",value:function(e,t,r){if("LineString"!==QO(r))throw new Error("only feature type is LineString supported");var n=this.module._UGCWasm_Helper_CreateDoubleArray(0,2),o=UO(r);return this.module._UGCWasm_Geometrist_NearestPointToVertex(e,t,o,n),n=BO(n)}},{key:"computeConcaveHullPoints",value:function(e,t,r){if(!Array.isArray(t)){var n=GO(e);r=t,e=n.xList,t=n.yList}var o=DO(e),i=DO(t);return{type:"Feature",geometry:FO(this.module._UGCWasm_Geometrist_ComputeConcaveHullPoints(o,i,e.length,r))}}},{key:"isSegmentIntersect",value:function(e,t,r,n,o,i,a,s){return 1===this.module._UGCWasm_Geometrist_IsSegmentIntersect(e,t,r,n,o,i,a,s)}},{key:"isIntersectRegionWithRect",value:function(e,t,r,n,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e-6,a=UO(e);return 0!==this.module._UGCWasm_Geometrist_isIntersectRegionWithRect(a,t,r,n,o,i)}},{key:"isOnSameSide",value:function(e,t,r,n,o,i,a,s){return 1===this.module._UGCWasm_Geometrist_IsOnSameSide(e,t,r,n,o,i,a,s)}},{key:"isRight",value:function(e,t,r,n,o,i){return 1===this.module._UGCWasm_Geometrist_IsRight(e,t,r,n,o,i)}},{key:"isLeft",value:function(e,t,r,n,o,i){return 1===this.module._UGCWasm_Geometrist_IsLeft(e,t,r,n,o,i)}},{key:"computeGeodesicArea",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rn.SQUAREMETER;if(!function(e){if(e&&e.geometry&&e.geometry.type){var t=e.geometry.type;if("Point"===t)return lo(e.geometry.coordinates);if("LineString"===t)return lo(e.geometry.coordinates[0]);if("Polygon"===t||"MultiLineString"===t)return lo(e.geometry.coordinates[0][0])}}(e))throw new Error("coordinates is invalid latlng");if("Polygon"!==QO(e))throw new Error("only feature type is Polygon supported");var r=UO(e),n=this.module._UGCWasm_Geometry_NewUGPrjCoordSys(4326),o=this.module._UGCWasm_Geometrist_ComputeGeodesicArea(r,n);return t!==Rn.SQUAREMETER?o*of[t]:o}},{key:"smooth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if("LineString"!==QO(e))throw new Error("only feature type is LineString supported");var r=UO(e);return{type:"Feature",geometry:FO(this.module._UGCWasm_Geometrist_Smooth(r,t))}}},{key:"computeGeodesicDistance",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:fn.METER;if(!Array.isArray(t)){var i=GO(e),a=i.xList,s=i.yList;o=n||fn.METER,n=r,r=t,e=a,t=s}if(!lo([e[0],t[0]]))throw new Error("coordinates is invalid latlng");var u=DO(e),l=DO(t),c=this.module._UGCWasm_Geometrist_ComputeGeodesicDistance(u,l,r,n);return o!==fn.METER?c/nf(o):c}},{key:"computeParallel",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fn.DEGREE,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:fn.DEGREE;if("LineString"!==QO(e))throw new Error("only feature type is LineString supported");n!==fn.DEGREE&&(t=t*nf(n)/nf(r));var o=UO(e);return{type:"Feature",geometry:FO(this.module._UGCWasm_Geometrist_ComputeParallel(o,t))}}},{key:"computeConvexHullPoints",value:function(e,t){if(!Array.isArray(t)){var r=GO(e);e=r.xList,t=r.yList}var n=DO(e),o=DO(t);return{type:"Feature",geometry:FO(this.module._UGCWasm_Geometrist_ComputeConvexHullPoints(n,o,e.length))}}}])&&qO(r.prototype,n),o&&qO(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function QO(e){return"Feature"===e.type&&null!==e.geometry?e.geometry.type:e.type}function XO(e,t,r){r.defs(e)||(t?r.defs(e,t):console.error("".concat(e," not define")))}function ZO(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:fw;if("[object Object]"!==Object.prototype.toString.call(arguments[0]))XO(e,t,r);else{var n=arguments[0];for(var o in n)XO(o,n[o],r)}}function $O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fw;if(!t.defs(e)){var r={"EPSG:3857":'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]',"EPSG:4326":'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],AXIS["Easting", "EAST"],AXIS["Northing", "NORTH"],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000", DATUM["China 2000", SPHEROID["CGCS2000", 6378137.0, 298.257222101, AUTHORITY["EPSG","1024"]], AUTHORITY["EPSG","1043"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic latitude", NORTH], AXIS["Geodetic longitude", EAST], AUTHORITY["EPSG","4490"]]'};r[e]&&ZO(e,r[e])}return t.defs(e)}function e_(e){if("string"!=typeof e)return"";if(0===e.indexOf("EPSG"))return e;var t=e.lastIndexOf("AUTHORITY")+10,r=e.indexOf("]",t)-1;return t>0&&r>0?"EPSG:".concat(e.substring(t,r).split(",")[1].substr(1)):""}function t_(e){var t=e.coordinates,r=e.sourceProjection,n=e.destProjection,o=void 0===n?"EPSG:4326":n,i=e.proj4,a=void 0===i?fw:i;try{return a(r,o,t)}catch(e){throw"".concat(e," is not defined")}}function r_(e,t){var r=e.replace(/^EPSG:/,""),n=wo(t);return z.get("".concat(n,"epsgcodes/").concat(r,".json"),null).then(function(e){return e.json()}).then(function(e){return e.wkt}).catch(function(e){console.error(e)})}function n_(e){"@babel/helpers - typeof";return(n_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o_(){o_=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==n_(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function i_(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=y_(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function a_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s_(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r0}function A_(e,t){if(e){var r,n=v_(r=e)||m_(r)||y_(r)||h_(),o=n[0],i=n.slice(1).filter(function(e){var t=p_(e,2)[1];return!["$type","$id"].includes(t)}),a=Array.from(new Set(function e(t){var r=[];var n,o=i_(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(i instanceof Array&&i[1]&&"string"==typeof i[1])r.push(i[1]);else if(i instanceof Array){var a=e(i);a&&a.length>0&&r.push.apply(r,f_(a))}}}catch(e){o.e(e)}finally{o.f()}return r}(i))),s=t([o].concat(f_(i))),u=s.filter.bind(s);return{field:a,values:function(){for(var e=arguments.length,t=new Array(e),r=0;r=0}function b(e,t){return v(e,t)?s_(s_({},t),{},{withCredentials:!0}):s_(s_({},t),{},{withCredentials:void 0})}function g(e,t){return w.apply(this,arguments)}function w(){return(w=c_(o_().mark(function e(t,r){var n,o,i,a,u,l,c,f,p,y,d,v,g;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.url,o=t.dataSourceName,i=t.datasetName,a=t.credential,u={datasetNames:[o+":"+i],getFeatureMode:"SQL",targetEpsgCode:"4326",queryParameter:{name:i+"@"+o}},l="".concat(n.split("featureResults")[0],"datasources/").concat(o,"/datasets/").concat(i),c=b(l,r),e.next=6,h(l,a,c);case 6:return f=e.sent,p=f.fieldNames,y=f.fieldTypes,d=s(n,a),e.next=12,z.post(d,JSON.stringify(u),c);case 12:return v=e.sent,e.next=15,v.json();case 15:return g=e.sent,e.abrupt("return",{type:"FeatureCollection",features:m((g||{}).features||[],p,y)});case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function S(e,t){return z.get(e,null,t).then(function(e){return e.json()}).then(function(e){if(!1===e.succeed)throw e.error.errorMsg;return e})}function O(e,t){return _.apply(this,arguments)}function _(){return(_=c_(o_().mark(function e(t,r){var n,o,i,a,s;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,S(t,r);case 2:if(n=e.sent,i=(o=n||{}).features,a=o.links,!(s=(void 0===a?[]:a).find(function(e){return"next"===e.rel}))){e.next=13;break}return e.t0=i,e.next=9,O(s.href,r);case 9:return e.t1=e.sent,e.abrupt("return",e.t0.concat.call(e.t0,e.t1));case 13:return e.abrupt("return",i);case 14:case"end":return e.stop()}},e)}))).apply(this,arguments)}function x(e,t){return P.apply(this,arguments)}function P(){return(P=c_(o_().mark(function e(t,r){var n,o;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(r.server,"web/datas/").concat(t,"/structureddata/ogc-features/collections/all/items.json?limit=10000&offset=0"),e.next=3,O(n,r);case 3:return o=e.sent,e.abrupt("return",{type:"FeatureCollection",features:o});case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function k(e,t,r){if(e===t)return r;if("EPSG:4214"===e&&"EPSG:4326"===t&&180===r[0]){var n=t_({coordinates:r,sourceProjection:e,destProjection:t,proj4:a});return n[0]=180,n}return t_({coordinates:r,sourceProjection:e,destProjection:t,proj4:a})}function E(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"EPSG:4326";if(e&&e.length&&t)return t===r?e:e.map(function(e){var n=function(e,t,r){if("MultiPolygon"===r.type){var n=r.coordinates;return{type:r.type,coordinates:n.map(function(r){return r.map(function(r){return r.map(function(r){return k(e,t,r)})})})}}if("Polygon"===r.type||"MultiLineString"===r.type){var o=r.coordinates;return{type:r.type,coordinates:o.map(function(r){return r.map(function(r){return k(e,t,r)})})}}if("MultiPoint"===r.type||"LineString"===r.type){var i=r.coordinates;return{type:r.type,coordinates:i.map(function(r){return k(e,t,r)})}}if("Point"===r.type)return{type:r.type,coordinates:k(e,t,r.coordinates)}}(t,r,e.geometry),o=s_({},e);return n&&Object.assign(o,{geometry:n}),o})}function j(e,t){return T.apply(this,arguments)}function T(){return(T=c_(o_().mark(function e(t,r){var n,o,i,s,u,l;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,x(t.dataId,r);case 2:return n=e.sent,e.next=5,z.get("".concat(r.server,"web/datas/").concat(t.dataId,"/structureddata.json"),null,r);case 5:return o=e.sent,e.next=8,o.json();case 8:if(i=e.sent,"EPSG:4326"===(s="EPSG:".concat(i.epsgCode))){e.next=18;break}if($O(s,a)){e.next=16;break}return e.next=14,r_(s,r.server);case 14:u=e.sent,ZO(s,u,a);case 16:(l=E(n.features,s))&&(n.features=l);case 18:return e.abrupt("return",n);case 19:case"end":return e.stop()}},e)}))).apply(this,arguments)}function C(e){return{type:"json",x:e.originX,y:e.originY,x1:e.destinationX,y1:e.destinationY}}function A(e){var t=e.clusterField,r=e.clusterMethod,n=e.clusterRadius;return[{type:e.clusterType,field:t,method:r&&{avg:"mean"}[r]||r,size:n}]}function I(e,t,r){return L.apply(this,arguments)}function L(){return(L=c_(o_().mark(function e(t,r,n){var o,i,a,s,u,l;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.data,i=t.od,a=t.cluster,!o||"FeatureCollection"!==o.type){e.next=3;break}return e.abrupt("return",{data:o});case 3:if(s={"supermap-rest-data":g,"supermap-structured-data":j},u=i&&C(t),l=a&&A(t),e.t0=s[o.type],!e.t0){e.next=11;break}return e.next=10,s[o.type](t.data,n);case 10:e.t0=e.sent;case 11:return e.t1=e.t0,e.t2=u,e.t3=l,e.abrupt("return",{data:e.t1,parser:e.t2,transforms:e.t3});case 15:case"end":return e.stop()}},e)}))).apply(this,arguments)}function N(e,t,r){var n={data:((e||{}).tiles||[])[0],parser:{type:"mvt",extent:e.bounds,sourceLayer:t}};return v(n.data,r)&&Object.assign(n.parser,{requestParameters:{credentials:"include"}}),n}function M(e,t,r){var n=e.type,o={vector:N,geojson:I};return o[n]&&o[n](e,t,r)}function R(e){var r=e.type,n=e.id,o=e.minzoom,i=e.maxzoom,a=e.layout,s=e.paint,u=e.filter,l=e.source;return{id:n,options:{type:r,name:e.id,sourceLayer:e["source-layer"],source:l,layout:a,paint:s,filter:u,minZoom:o,maxZoom:i,visible:"none"!==a.visibility},filter:A_(u,t)}}function D(e){var t=e.value,o=e.property,i=e.multiple,a=e.map;if(!r.isExpression(t))return{values:i?t*i:t};var s={interpolate:function(e){return e.value._styleExpression.expression.input.args[0].args[0].evaluate(e.value._styleExpression._evaluator)},match:function(e){return e.value._styleExpression.expression.input.args[0].evaluate(e.value._styleExpression._evaluator)},case:function(e){var t=e.value._styleExpression.expression.branches[0][0];return t&&t.args?t.args[0].lhs.args[0].args[0].evaluate(e.value._styleExpression._evaluator):t.lhs.args[0].evaluate()}},u=n[{size:"paint_circle",color:"paint_circle",shape:"layout_symbol"}[o]][{size:"circle-radius",color:"circle-color",shape:"icon-image"}[o]],l=r.createPropertyExpression(t,u),c=s[t[0]]&&s[t[0]](l),f=l.value.evaluate.bind(l.value);return{field:c,values:function(e){var t={properties:u_({},c,e),type:"point"},r=f({zoom:a.getZoom()},t);return"shape"===o?r.toString():i?r*i:r}}}function B(e,t){return u_(u_(u_(u_(u_(u_(u_(u_({},"".concat(e,"-dasharray"),"dashArray"),"".concat(e,"-opacity"),"opacity"),"".concat(e,"-pattern-color"),"textureColor"),"".concat(e,"-pattern-opacity"),"opacity"),"".concat(e,"-pattern-interval"),"iconStep"),"".concat(e,"-pattern-blend"),"textureBlend"),"".concat(e,"-segment"),"segmentNumber"),"".concat(e,"-pattern-rotate"),"textureRotate")[t]}function F(e,t){return u_(u_(u_({},"".concat(e,"-animate-duration"),"duration"),"".concat(e,"-animate-interval"),"interval"),"".concat(e,"-animate-trailLength"),"trailLength")[t]}function U(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1&&!function(e){return 2===e.length&&1===e[0]&&0===e[1]}(e)?"dash":"solid"}function W(e,t,r){var n=e.paint,o=e.layout,i=n["circle-color"]||"#EE4D5A",a=n["circle-radius"]||30,s=n["circle-opacity"],u=o["circle-animate-speed"],l=o["circle-animate-rings"];return s_(s_({},R(e)),{},{type:g_.point,source:t,color:D({value:i,property:"color",map:r}),size:D({value:a,property:"size",multiple:2,map:r}),shape:{values:"circle"},style:{opacity:s},animate:{enable:!0,speed:u,rings:l}})}function J(e,t,r){var n=e.paint,o=e.layout,i=n["radar-color"]||"#EE4D5A",a=n["radar-radius"]||30,s=n["radar-opacity"],u=o["radar-animate-speed"];return s_(s_({},R(e)),{},{type:g_.point,source:t,color:D({value:i,property:"color",map:r}),size:D({value:a,property:"size",map:r}),shape:{values:"radar"},style:{opacity:s,speed:u},animate:{enable:!0}})}function K(e,t,r){var n=e.paint,o=e.layout,i=o["line-curve-shape"]||o["line-curve-extrusion-shape"],a="arc3d"===i?"line-curve-extrusion":"line-curve",s=n["".concat(a,"-color")]||"#ff6b34",u=n["".concat(a,"-width")]||1,l=n["".concat(a,"-dasharray")],c=n["".concat(a,"-pattern")],f=s_(s_({},R(e)),{},{type:g_.line,source:{data:t.data.features.map(function(e){return e.properties}),parser:t.parser},color:D({value:s,property:"color",map:r}),size:D({value:u,property:"size",map:r}),shape:{values:i},style:{lineType:H(l)}});for(var p in n){var h=B(a,p);h&&Object.assign(f.style||{},u_({},h,n[p]))}for(var y in o){var d=B(a,y);d&&Object.assign(f.style||{},u_({},d,o[y]));var m=F(a,y);m&&(f.animate||(f.animate={}),Object.assign(f.animate,u_({},m,o[y])))}return c&&(f.texture={values:c},Object.assign(f.style||{},{lineTexture:!0})),f}function Y(e,t,r){var n=e.paint,o=e.layout,i=n["point-extrusion-color"]||"#EE4D5A",a=n["point-extrusion-width"]||12,s=n["point-extrusion-length"]||12,u=n["point-extrusion-height"]||12,l=n["point-extrusion-opacity"],c=n["point-extrusion-source-color"],f=n["point-extrusion-target-color"],p=n["point-extrusion-opacity-linear-direction"],h=o["point-extrusion-shape"]||"cylinder";return s_(s_({},R(e)),{},{type:g_.point,source:t,color:D({value:i,property:"color",map:r}),size:U(r,{value:a,multiple:.5},{value:s,multiple:.5},{value:u}),shape:D({value:h,property:"shape",map:r}),style:{opacity:l,sourceColor:c,targetColor:f,opacityLinear:{enable:!!p,dir:p}}})}function Q(e,t,r){var n=e.paint,o=e.layout,i=n["line-extrusion-color"]||"#ff6b34",a=n["line-extrusion-width"]||12,s=n["line-extrusion-base"]||0,u=n["line-extrusion-dasharray"],l=n["line-extrusion-pattern"],c=s_(s_({},R(e)),{},{type:g_.line,source:t,color:D({value:i,property:"color",map:r}),size:U(r,{value:a,multiple:T_},{value:s}),shape:{values:"line"},style:{lineType:H(u)}});for(var f in n){var p=w_[f];p&&Object.assign(c.style||{},u_({},p,n[f]))}for(var h in o){var y=w_[h];y&&Object.assign(c.style||{},u_({},y,o[h]));var d=S_[h];d&&(c.animate||(c.animate={}),Object.assign(c.animate,u_({},d,o[h])))}return l&&(c.texture={values:l},Object.assign(c.style||{},{lineTexture:!0})),c}function X(e,t){var r=e.paint,n=e.layout,o=r["chart-background-color"],i=r["chart-width"],a=r["chart-height"],s={grid:r["chart-xAxis-grid"],label:r["chart-xAxis-label"],line:r["chart-xAxis-line"]},u={grid:r["chart-yAxis-grid"],label:r["chart-yAxis-label"],line:r["chart-yAxis-line"]},l=n["chart-type"],c=n["chart-attribute-color"],f="line"===l&&c.length>0&&{values:c[0][1]};return s_(s_({},R(e)),{},{type:g_.point,id:e.id,source:t,layerType:O_.MarkerLayer,chartType:l,fields:{values:"bar"===l?G(c):function(e){return e.map(function(e){return p_(e,1)[0]})}(c)},width:{values:i},height:{values:a},background:{values:o},xAxis:{values:s},yAxis:{values:u},color:f})}function Z(e,t){var r=e.paint,n=e.layout,o=r["chart-radius"],i=r["chart-inner-radius"],a=n["chart-type"],s=n["chart-attribute-color"];return s_(s_({},R(e)),{},{type:g_.point,id:e.id,source:t,layerType:O_.MarkerLayer,chartType:a,fields:{values:G(s)},radius:{values:o},innerRadius:{values:i}})}function $(e,t,r){var n=e.paint,o=e.layout,i=n["heatmap-color"]||"#EE4D5A",a=n["heatmap-opacity"],s=o["heatmap-shape"],u=o["heatmap-rotate"],l=o["heatmap-coverage"];return s_(s_({},R(e)),{},{type:g_.heatmap,id:e.id,source:t,shape:{values:s},color:D({value:i,property:"color",map:r}),style:{opacity:a,coverage:l,angle:u}})}function ee(e,t,r){var n=e.paint,o=e.layout,i=n["heatmap-extrusion-color"]||"#EE4D5A",a=n["heatmap-extrusion-opacity"],s=n["heatmap-extrusion-height"],u=o["heatmap-extrusion-shape"],l=o["heatmap-extrusion-rotate"],c=o["heatmap-extrusion-coverage"];return s_(s_({},R(e)),{},{type:g_.heatmap,id:e.id,source:t,shape:{values:u},size:D({value:s,property:"size",map:r}),color:D({value:i,property:"color",map:r}),style:{opacity:a,coverage:c,angle:l}})}function te(e,t){var o=e.paint,i=o["heatmap-extrusion-color"],a=o["heatmap-extrusion-opacity"],s=o["heatmap-extrusion-intensity"],u=o["heatmap-extrusion-radius"],l=o["heatmap-extrusion-weight"];return s_(s_({},R(e)),{},{type:g_.heatmap,id:e.id,source:t,size:{field:l,values:[0,1]},shape:{values:"heatmap3D"},style:{rampColors:function(e){var t=n.paint_heatmap["heatmap-color"],o=r.createPropertyExpression(e,t);return{positions:o.value._styleExpression.expression.labels,colors:o.value._styleExpression.expression.outputs.map(function(e){return e.value})}}(i),opacity:a,intensity:s,radius:u}})}function re(e,t,r,n){var o=e.paint,i=e.layout,a=i["text-field"].split("{")[1].split("}")[0],s={};return Object.keys(function(e,t){var r={};for(var n in e)t.includes(n)||(r[n]=e[n]);return e}(__,["text-color","text-size","text-field"])).forEach(function(t){var r,n=(e[(r=t,x_.includes(r)?"layout":"paint")]||{})[t];void 0!==n&&(s[__[t]]=n)}),s_(s_({},R(e)),{},{type:g_.point,id:e.id,source:t,color:D({value:o["text-color"],property:"color",map:n}),size:D({value:i["text-size"],property:"size",map:n}),shape:{field:a,values:"text"},style:s})}function ne(e){return oe.apply(this,arguments)}function oe(){return(oe=c_(o_().mark(function e(t){var r,n,o,i,a,s,u,l,c,f,p,h;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=t.layers,n=t.sources,o=t.map,i=t.options,a=[],s=i_(r),e.prev=3,s.s();case 5:if((u=s.n()).done){e.next=23;break}return l=u.value,e.prev=7,c=n[l.source],f=u_(u_(u_(u_(u_(u_(u_(u_(u_(u_({},b_.animatePoint,W),b_.radarPoint,J),b_.od,K),b_.column,Y),b_.line,Q),b_.bar,X),b_.pie,Z),b_.heatGrid,$),b_.heat3DGrid,ee),b_.heat3D,te),e.next=12,M(c,l["source-layer"],i);case 12:p=e.sent,h=V(l),a.push(f[h]&&f[h](l,p,o)||re(l,p,(l||{}).visible,o)),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(7),console.error(e.t0),i.emitterEvent("layercreatefailed",{error:e.t0,map:o,layer:l});case 21:e.next=5;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(3),s.e(e.t1);case 28:return e.prev=28,s.f(),e.finish(28);case 31:return e.abrupt("return",a);case 32:case"end":return e.stop()}},e,null,[[3,25,28,31],[7,17]])}))).apply(this,arguments)}function ie(e){return ae.apply(this,arguments)}function ae(){return(ae=c_(o_().mark(function e(t){return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){t.getL7Scene().then(function(t){e(t)})}));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function se(e,t){if(t){var r=document.createElement("canvas");r.width=t.width,r.height=t.height;var n=r.getContext("2d");if(n)return n.drawImage(t,0,0),n.getImageData(e.x,e.y,e.width,e.height)}}function ue(e){var t=p_(xO.getData(xO.toRGBA(e)),4);return{r:t[0],g:t[1],b:t[2],a:t[3]}}function le(e,t){return ce.apply(this,arguments)}function ce(){return(ce=c_(o_().mark(function e(t,r){var n,o,i,a,s,u,l,c,f,p,h,y,d;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fe(t);case 2:if(n=e.sent,o=r.color,i=r.rotate,a=document.createElement("canvas"),s=a.getContext("2d"),a.width=n.width,a.height=n.height,s.translate(a.width/2,a.height/2),0!==i&&s.rotate(i*Math.PI/180),s.drawImage(n,-n.width/2,-n.height/2),o){for(u=s.getImageData(0,0,a.width,a.height),l=u.data,c=ue(o),f=c.r,p=c.g,h=c.b,y=c.a,d=0;d1&&!e.includes("/sprite@2x")?function(e){var t=e.split("/"),r=t.slice(-1)[0];if(!r)return e;var n=r.replace("sprite","sprite@2x");return t.splice(t.length-1,1,n),t.join("/")}(e):e}(r)+".png";return n&&(o+="?token=".concat(n)),o}function me(e,t){return new Promise(function(r){var n=de(e),o=new XMLHttpRequest,i=new Image;i.crossOrigin="",o.responseType="blob",o.open("get",n,!0),o.withCredentials=t.withCredentials,o.setRequestHeader("accept","image/webp,*/*"),o.onreadystatechange=function(){4===o.readyState&&200===o.status&&(i.src=URL.createObjectURL(o.response),i.onload=function(){r(i)},i.onerror=function(){r(null)})},o.send(null)})}function ve(e,t,r){return be.apply(this,arguments)}function be(){return(be=c_(o_().mark(function e(t,r,n){var o;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,me(t,n);case 2:if(o=e.sent){e.next=5;break}return e.abrupt("return");case 5:return e.abrupt("return",se(r,o));case 6:case"end":return e.stop()}},e)}))).apply(this,arguments)}function ge(e){return we.apply(this,arguments)}function we(){return(we=c_(o_().mark(function e(t){var r,n,o,i,a,s,u,l,c,f,p,h,y,d,m,v;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=t.layers,n=t.sprite,o=t.spriteJson,i=t.scene,a=t.options,s=+new Date,u=0;case 3:if(!(u2&&void 0!==arguments[2]&&arguments[2],n=[],o=t.properties,i=0;return r&&e.forEach(function(e){var t=o?o[e]:0;i+=t}),e.forEach(function(e){var t=o?o[e]:0,a={x:e,y:t};r&&(a.percent=t/i),n.push(a)}),n}function Pe(e,t,r,n){if(!OO){throw console.error("G2 is not define"),new Error("G2 is not define")}var o=new OO.Chart({container:e,width:t,height:r,autoFit:!0});return o.legend(!1),o.data(n),o}function ke(e,t){return new i.Marker({element:e}).setLnglat(t)}function Ee(e,t){var r=Se.getMarkerLayer(e);r&&(t.removeMarkerLayer(r),Se.removeMarkerLayer(e))}function je(e,t){var r=e.source,n=e.id,o=e.chartType,a=r.data;e.filter&&(a=function(e,t){var r=e.features,n=t.field,o=t.values;return{type:"FeatureCollection",features:r.filter(function(e){var t=n.map(function(t){return(e.properties||{})[t]});return o.apply(void 0,f_(t))})}}(r.data,e.filter)),Ee(n,t);var s=[];if(o===j_.bar){var u=e.fields,l=e.width,c=e.height,f=e.background,p=e.xAxis,h=e.yAxis,y={width:l.values,height:c.values,background:f.values,xAxis:p.values,yAxis:h.values};s=function(e,t,r){var n=t.width,o=t.height,i=t.background,a=t.xAxis,s=t.yAxis,u=r.features,l=Object.keys(e),c=Object.values(e),f=Oe(a),p=Oe(s),h=document.createElement("div");return h.style.backgroundColor=i,u.map(function(e){var t=h.cloneNode(),r=_e(e),i=xe(l,e),a=Pe(t,n,o,i);return a.axis("x",f),a.axis("y",p),a.interval().position("x*y").color("x",c),a.render(),ke(t,r)})}(u.values,y,a)}if(o===j_.line){var d=e.color,m=e.fields,v=e.width,b=e.height,g=e.background,w=e.xAxis,S=e.yAxis,O={width:v.values,height:b.values,background:g.values,xAxis:w.values,yAxis:S.values,color:d.values};s=function(e,t,r){var n=t.color,o=t.width,i=t.height,a=t.background,s=t.xAxis,u=t.yAxis,l=r.features,c=Oe(s),f=Oe(u),p=document.createElement("div");return p.style.background=a,l.map(function(t){var r=p.cloneNode(),a=_e(t),s=xe(e,t),u=Pe(r,o,i,s);return u.axis("x",c),u.axis("y",f),u.line().position("x*y").color(n),u.render(),ke(r,a)})}(m.values,O,a)}if(o===j_.pie){var _=e.fields,x=e.radius,P=e.innerRadius,k={radius:x.values,innerRadius:P.values};s=function(e,t,r){var n=r.features,o=Object.keys(e),i=Object.values(e),a=t.radius,s=t.innerRadius,u=document.createElement("div");return n.map(function(e){var t=u.cloneNode(),r=_e(e),n=xe(o,e,!0),l=Pe(t,a,a,n);return l.coord("theta",{innerRadius:s}),l.interval().adjust("stack").position("percent").color("x",i).shape("sliceShape"),l.render(),ke(t,r)})}(_.values,k,a)}var E=function(e){var t=new i.MarkerLayer;return e.forEach(function(e){t.addMarker(e)}),t}(s);return t.addMarkerLayer(E),Se.setMarkerLayer(n,E),E}function Te(e,t){var r=u_(u_(u_(u_({},g_.line,"LineLayer"),g_.point,"PointLayer"),g_.polygon,"PolygonLayer"),g_.heatmap,"HeatmapLayer"),n=e.source||{},i=t.promoteId;i||(i=t.tiles&&t.tiles[0].includes("/structureddata/")?"smpid":void 0);var a=new o({type:r[e.type],options:s_(s_({},e.options),{},{layerID:(e.options||{}).name,featureId:i})}),s=a.getL7Layer(),u={},l=e.shape||{};if(n.parser&&(u.parser=e.source.parser),n.transforms&&(u.transforms=e.source.transforms),s.source(n.data,u),l.field?s.shape(l.field,l.values):s.shape(l.values),e.texture&&s.texture(e.texture.values),e.size&&(e.size.field?s.size(e.size.field,e.size.values):s.size(e.size.values)),e.color&&(e.color.field?s.color(e.color.field,e.color.values):s.color(e.color.values)),e.style&&s.style(e.style),e.animate&&s.animate(e.animate),e.filter){var c=kO()(function(){a.reRender()},500);s.filter(e.filter.field,function(){var t,r=(t=e.filter).values.apply(t,arguments);return r&&c(),r})}return a}return{addL7Layers:function(e){return c_(o_().mark(function t(){var r,n,o,i,a,s,u,l,c,f,p,h,y;return o_().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.map,n=e.webMapInfo,o=e.l7Layers,i=e.spriteDatas,a=e.options,s=n.layers,u=n.sources,l=n.sprite,t.next=4,ne({layers:o,sources:u,map:r,options:Object.assign({withoutFormatSuffix:!0},a)});case 4:return c=t.sent,t.next=7,ie(r);case 7:if(f=t.sent,!(Object.keys(i).length>0)){t.next=18;break}return t.prev=9,t.next=12,ge({layers:c.filter(function(e){return!!e.texture}),spriteJson:i,sprite:l,scene:f,options:a});case 12:t.next=18;break;case 14:t.prev=14,t.t0=t.catch(9),console.error(t.t0),a.emitterEvent("layercreatefailed",{error:t.t0,map:r});case 18:p=i_(c),t.prev=19,y=o_().mark(function e(){var t,n,o,i,a;return o_().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=h.value,n=s.findIndex(function(e){return e.id===t.id}),o=s.slice(n+1).find(function(e){return!C_(e)}),t.layerType===O_.MarkerLayer?(i=t,!1!==(t.options||{}).visible&&je(i,f),Se.setSceneChartLayer(t.id,i)):(a=Te(t,u[s[n].source]),r.getLayer(a.id)||r.addLayer(a,o&&o.id));case 4:case"end":return e.stop()}},e)}),p.s();case 22:if((h=p.n()).done){t.next=26;break}return t.delegateYield(y(),"t1",24);case 24:t.next=22;break;case 26:t.next=31;break;case 28:t.prev=28,t.t2=t.catch(19),p.e(t.t2);case 31:return t.prev=31,p.f(),t.finish(31);case 34:case"end":return t.stop()}},t,null,[[9,14],[19,28,31,34]])}))()},isL7Layer:C_,getL7MarkerLayers:function(){return Se.markerLayers},removeL7MarkerLayer:Ee}}function L_(e){return function(e){if(Array.isArray(e))return Q_(e)}(e)||N_(e)||Y_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N_(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function M_(e,t){return D_(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Y_(e,t)||R_()}function R_(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D_(e){if(Array.isArray(e))return e}function B_(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Y_(e,t){if(e){if("string"==typeof e)return Q_(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q_(e,t):void 0}}function Q_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r`.",required:!0},import:{id:{type:"string",doc:"Unique import name.",required:!0},url:{type:"string",doc:"The URL of the style.",required:!0},config:{type:"config",doc:"Configuration values for the imported style's options."},data:{type:"$root",doc:"The inlined style that must correspond to the contents of the specified URL."}},config:{"*":{type:"*",doc:"Value of the imported style's configuration option."}},schema:{"*":{type:"option",doc:"Specification of a configuration option."}},option:{default:{type:"*",doc:"Default configuration value for this option.","property-type":"data-constant",expression:{interpolated:!1},required:!0},type:{type:"enum",doc:"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.",values:{string:{doc:"The result will be coerced to a string."},number:{doc:"The result will be coerced to a number."},boolean:{doc:"The result will be coerced to a boolean."},color:{doc:"The result will be coerced to a color."}}},array:{type:"boolean",doc:"If true, this option is returned as an array"},minValue:{type:"number",doc:"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},maxValue:{type:"number",doc:"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},stepValue:{type:"number",doc:"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},values:{type:"array",value:"*",doc:"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."}},models:{"*":{type:"model",doc:"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{id:{type:"string",doc:"Unique light name.",required:!0},properties:{type:"properties",doc:"Properties of the light."},type:{type:"enum",doc:"Type of the light to be added",values:{ambient:{doc:"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},directional:{doc:"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},flat:{doc:"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}}},properties:["properties_light_directional","properties_light_ambient","properties_light_flat"],properties_light_directional:{direction:{type:"array",default:[210,30],minimum:[0,0],maximum:[360,90],length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).",example:[90,40],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"cast-shadows":{type:"boolean",default:!1,doc:"Enable/Disable shadow casting for this light",transition:!1,expression:{interpolated:!1},"property-type":"data-constant","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"shadow-intensity":{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},doc:"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_ambient:{color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_flat:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_array:{experimental:!0,type:{required:!0,type:"enum",values:{"raster-array":{doc:"A raster array source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},rasterLayers:{type:"*",doc:"Contains the description of the raster data layers and the bands contained within the tiles."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},minzoom:{type:"number",default:0,doc:"Minimum zoom level at which to create vector tiles"},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the GeoJSON features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."},dynamic:{type:"boolean",default:!1,doc:"Whether to optimize this source for frequent data updates (e.g. animating features).","sdk-support":{"basic functionality":{js:"3.4.0"}}}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!1,type:"string",doc:"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_model:{type:{required:!0,type:"enum",values:{model:{doc:"A collection of 3D models"},"batched-model":{doc:"A collection of 3D models with anchor data"}},doc:"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which batched-model tiles are available"},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},"raster-particle":{experimental:!0,doc:"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}}},model:{doc:"A 3D model",experimental:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},slot:{doc:"Marks the position of a slot.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},clip:{doc:"Layer that removes 3D content from map.",experimental:!0,"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.6.0",ios:"11.6.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},slot:{type:"string",doc:"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_model:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"model-id":{type:"string",default:"",doc:"Model to render. It can be either a string referencing an element to the models root property or an internal or external URL","property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!1,requires:[{source:["geojson","vector"]}]}},layout_clip:{"clip-layer-types":{type:"array",value:"enum",values:{model:{doc:"If present the clip layer would remove all 3d model layers below it. Currently only instanced models (e.g. trees) are removed."},symbol:{doc:"If present the clip layer would remove all symbol layers below it."}},default:[],doc:"Layer types that will also be removed if fallen below this clip layer.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.6.0",ios:"11.6.0"}},expression:{interpolated:!1},"property-type":"data-constant",experimental:!0}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",experimental:!0,private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."},none:{doc:"Line segments are not joined together, each one creates a separate line. Useful in combination with line-pattern. Line-cap property is not respected. Can't be used with data-driven styling."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"},"`none` value":{js:"3.4.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{type:"number",experimental:!0,doc:"Vertical offset from ground, in meters. Defaults to 0. Not supported for globe projection at the moment.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"},"data-driven styling":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature","line-progress"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{type:"boolean",default:!1,doc:"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},requires:[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_raster-particle":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"},"expressions support":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},config:{doc:"Retrieves the configuration value for the given option.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},hsl:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},hsla:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"measure-light":{doc:"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"9.2.0",ios:"5.9.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"raster-value":{doc:"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.",group:"Raster Colorization","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-particle-speed":{doc:"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.",group:"Raster Particle Animation","sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}}},random:{doc:"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"vertical-range":{type:"array",default:[0,0],minimum:0,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},camera:{"camera-projection":{doc:"Camera projection describes how 3D world geometry get projected into 2D screen",type:"enum",values:{perspective:{doc:"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},orthographic:{doc:"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"perspective","property-type":"data-constant"}},colorTheme:{data:{type:"string",doc:"Expects a base64 encoded PNG image which represents a cube strip LUT. The height of the image cannot exceed 32 pixels and the width must be equal to the height squared.",transition:!1,"property-type":"data-constant",expression:{interpolated:!1}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0",ios:"10.5.0",android:"10.5.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant",type:"number",experimental:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant",type:"number",experimental:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant",type:"number",experimental:!0,default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant",type:"color",experimental:!0,default:"#ffffff",doc:"The color of the flood light effect on the walls of the extruded buildings.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant",type:"number",experimental:!0,default:0,minimum:0,maximum:1,doc:"The intensity of the flood light color.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven",type:"number",experimental:!0,units:"meters",default:0,minimum:0,doc:"The extent of the flood light effect on the walls of the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven",type:"number",experimental:!0,units:"meters",default:0,doc:"The extent of the flood light effect on the ground beneath the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant",type:"number",experimental:!0,default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant",type:"number",experimental:!0,default:1,minimum:0,doc:"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant",type:"boolean",default:!0,experimental:!0,doc:"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.",requires:["fill-extrusion-edge-radius"],transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.10.0",ios:"10.10.0"}},expression:{interpolated:!1,parameters:["zoom"]}},"fill-extrusion-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',example:["interpolate",["linear"],["line-progress"],0,"blue",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be painted using `line-trim-color,` which is transparent by default to produce a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0"}},"property-type":"constant"},"line-trim-fade-range":{type:"array",value:"number",doc:"The fade range for the trim-start and trim-end points is defined by the `line-trim-offset` property. The first element of the array represents the fade range from the trim-start point toward the end of the line, while the second element defines the fade range from the trim-end point toward the beginning of the line. The fade result is achieved by interpolating between `line-trim-color` and the color specified by the `line-color` or the `line-gradient` property.",experimental:!0,length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:["line-trim-offset",{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.6.0",android:"11.6.0",ios:"11.6.0"}},"property-type":"data-constant"},"line-trim-color":{type:"color",doc:"The color to be used for rendering the trimmed line section that is defined by the `line-trim-offset` property.",experimental:!0,default:"transparent",transition:!0,requires:["line-trim-offset",{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"3.6.0",android:"11.6.0",ios:"11.6.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{type:"number",private:!0,doc:"The width of the line border. A value of zero means no border.",default:0,minimum:0,transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{type:"color",private:!0,doc:"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.",default:"rgba(0, 0, 0, 0)",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{type:"number",default:0,minimum:0,maximum:1,experimental:!0,doc:"Opacity multiplier (multiplies line-opacity value) of the line part that is occluded by 3D objects. Value 0 hides occluded part, value 1 means the same opacity as non-occluded part. The property is not supported when `line-opacity` has data-driven styling.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},transition:!0,"property-type":"data-constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{doc:"The opacity at which the icon will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.",type:"number",minimum:0,maximum:1,default:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"},"data-driven styling":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},requires:["icon-image"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},doc:"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.",transition:!0},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{type:"number",doc:"The opacity at which the text will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.",minimum:0,maximum:1,default:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"},"data-driven styling":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!1,doc:"Increase or reduce the saturation of the symbol icon.","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}},expression:{interpolated:!1},"property-type":"data-constant"},"icon-color-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!1,doc:"Increase or reduce the contrast of the symbol icon.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1},"property-type":"data-constant"},"icon-color-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the symbols. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1},"property-type":"data-constant"},"icon-color-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the symbols. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-color":{type:"color",doc:'Defines a color map by which to colorize a raster layer, parameterized by the `["raster-value"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.',transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{type:"array",default:[.2126,.7152,.0722,0],length:4,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.",example:[.2126,.7152,.0722,0],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-color-range":{type:"array",length:2,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source's stated data range is used.",example:[.5,10],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{type:"string",required:!1,experimental:!0,"property-type":"data-constant",transition:!1,requires:[{source:"raster-array"}],doc:"Displayed band of raster array source layer. Defaults to the first band if not set.",example:"band-name","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}}},"raster-elevation":{type:"number",doc:"Specifies an uniform elevation from the ground, in meters.",default:0,minimum:0,transition:!0,experimental:!0,"sdk-support":{"basic functionality":{js:"3.1.0",android:"11.2.0",ios:"11.2.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{type:"string",required:!1,"property-type":"data-constant",transition:!1,doc:"Displayed band of raster array source layer",example:'"1713348000"',"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}}},"raster-particle-count":{type:"number",doc:"Defines the amount of particles per tile.",default:512,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},"property-type":"data-constant"},"raster-particle-color":{type:"color",doc:'Defines a color map by which to colorize a raster particle layer, parameterized by the `["raster-particle-speed"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.',transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{type:"number",doc:"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.",default:1,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},"property-type":"data-constant"},"raster-particle-speed-factor":{type:"number",doc:"Defines a coefficient for the speed of particles’ motion.",default:.2,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{type:"number",doc:"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.",default:.98,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{type:"number",doc:"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).",default:.8,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_model:{"model-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the model layer.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-rotation":{type:"array",value:"number",length:3,default:[0,0,0],period:360,units:"degrees","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{type:"array",value:"number",length:3,default:[1,1,1],doc:"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-translation":{type:"array",value:"number",length:3,default:[0,0,0],"property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{type:"color",default:"#ffffff",doc:"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-color-mix-intensity":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,doc:"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model's colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-type":{type:"enum",values:{"common-3d":{doc:"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{doc:"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"common-3d",doc:"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow casting for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow receiving for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{type:"number",default:1,minimum:0,maximum:1,doc:"Intensity of the ambient occlusion if present in the 3D model.",expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant",transition:!0},"model-emissive-strength":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:5,units:"intensity",doc:"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-roughness":{type:"number",default:1,minimum:0,maximum:1,doc:"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-height-based-emissive-strength-multiplier":{type:"array",default:[1,1,1,1,0],length:5,value:"number",doc:"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-front-cutoff":{type:"array",private:!0,value:"number","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]},length:3,default:[0,0,1],minimum:[0,0,0],maximum:[1,1,1],doc:"An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}}}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};function $_(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:[];G_(this,e),this.parent=t,this.bindings={};var n,o=K_(r);try{for(o.s();!(n=o.n()).done;){var i=M_(n.value,2),a=i[0],s=i[1];this.bindings[a]=s}}catch(e){o.e(e)}finally{o.f()}}return F_(e,[{key:"concat",value:function(t){return new e(this,t)}},{key:"get",value:function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}},{key:"has",value:function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}])}(),rx={kind:"null"},nx={kind:"number"},ox={kind:"string"},ix={kind:"boolean"},ax={kind:"color"},sx={kind:"object"},ux={kind:"value"},lx={kind:"collator"},cx={kind:"formatted"},fx={kind:"resolvedImage"};function px(e,t){return{kind:"array",itemType:e,N:t}}function hx(e){if("array"===e.kind){var t=hx(e.itemType);return"number"==typeof e.N?"array<".concat(t,", ").concat(e.N,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")}return e.kind}var yx=[rx,nx,ox,ix,ax,cx,sx,px(ux),fx];function dx(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!dx(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=yx;r255?255:e}function Ox(e){return e<0?0:e>1?1:e}function _x(e){return"%"===e[e.length-1]?Sx(parseFloat(e)/100*255):Sx(parseInt(e))}function xx(e){return"%"===e[e.length-1]?Ox(parseFloat(e)/100):Ox(parseFloat(e))}function Px(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{gx={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in wx)return wx[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var n=r.indexOf("("),o=r.indexOf(")");if(-1!==n&&o+1===r.length){var i=r.substr(0,n),a=r.substr(n+1,o-(n+1)).split(","),s=1;switch(i){case"rgba":if(4!==a.length)return null;s=xx(a.pop());case"rgb":return 3!==a.length?null:[_x(a[0]),_x(a[1]),_x(a[2]),s];case"hsla":if(4!==a.length)return null;s=xx(a.pop());case"hsl":if(3!==a.length)return null;var u=(parseFloat(a[0])%360+360)%360/360,l=xx(a[1]),c=xx(a[2]),f=c<=.5?c*(l+1):c+l-c*l,p=2*c-f;return[Sx(255*Px(p,f,u+1/3)),Sx(255*Px(p,f,u)),Sx(255*Px(p,f,u-1/3)),s];default:return null}}return null}}catch(e){}function kx(e,t,r){return e*(1-r)+t*r}var Ex=Object.freeze({__proto__:null,array:function(e,t,r){return e.map(function(e,n){return kx(e,t[n],r)})},color:function(e,t,r){return new jx(kx(e.r,t.r,r),kx(e.g,t.g,r),kx(e.b,t.b,r),kx(e.a,t.a,r))},number:kx}),jx=function(){function e(t,r,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;G_(this,e),this.r=t,this.g=r,this.b=n,this.a=o}return F_(e,[{key:"toString",value:function(){var e=M_(0===this.a?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a],4),t=e[0],r=e[1],n=e[2],o=e[3];return"rgba(".concat(Math.round(t),",").concat(Math.round(r),",").concat(Math.round(n),",").concat(o,")")}},{key:"toRenderColor",value:function(e){var t=this.r,r=this.g,n=this.b,o=this.a;return new Tx(e,t,r,n,o)}}],[{key:"parse",value:function(t){if(t){if(t instanceof e)return t;if("string"==typeof t){var r=gx(t);if(r)return new e(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3])}}}}])}(),Tx=function(){return F_(function e(t,r,n,o,i){if(G_(this,e),t){var a=t.image.height,s=a*a;r=0===i?0:r/i*(a-1),n=0===i?0:n/i*(a-1),o=0===i?0:o/i*(a-1);var u=Math.floor(r),l=Math.floor(n),c=Math.floor(o),f=Math.ceil(r),p=Math.ceil(n),h=Math.ceil(o),y=r-u,d=n-l,m=o-c,v=t.image.data,b=4*(u+l*s+c*a),g=4*(u+l*s+h*a),w=4*(u+p*s+c*a),S=4*(u+p*s+h*a),O=4*(f+l*s+c*a),_=4*(f+l*s+h*a),x=4*(f+p*s+c*a),P=4*(f+p*s+h*a);if(b<0||P>=v.length)throw new Error("out of range");this.r=kx(kx(kx(v[b],v[g],m),kx(v[w],v[S],m),d),kx(kx(v[O],v[_],m),kx(v[x],v[P],m),d),y)/255*i,this.g=kx(kx(kx(v[b+1],v[g+1],m),kx(v[w+1],v[S+1],m),d),kx(kx(v[O+1],v[_+1],m),kx(v[x+1],v[P+1],m),d),y)/255*i,this.b=kx(kx(kx(v[b+2],v[g+2],m),kx(v[w+2],v[S+2],m),d),kx(kx(v[O+2],v[_+2],m),kx(v[x+2],v[P+2],m),d),y)/255*i,this.a=i}else this.r=r,this.g=n,this.b=o,this.a=i},[{key:"toArray",value:function(){var e=this.r,t=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*e/n,255*t/n,255*r/n,n]}},{key:"toArray01",value:function(){var e=this.r,t=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[e/n,t/n,r/n,n]}},{key:"toArray01Scaled",value:function(e){var t=this.r,r=this.g,n=this.b,o=this.a;return 0===o?[0,0,0]:[t/o*e,r/o*e,n/o*e]}},{key:"toArray01PremultipliedAlpha",value:function(){return[this.r,this.g,this.b,this.a]}},{key:"toArray01Linear",value:function(){var e=this.r,t=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[Math.pow(e/n,2.2),Math.pow(t/n,2.2),Math.pow(r/n,2.2),n]}}])}();jx.black=new jx(0,0,0,1),jx.white=new jx(1,1,1,1),jx.transparent=new jx(0,0,0,0),jx.red=new jx(1,0,0,1),jx.blue=new jx(0,0,1,1);var Cx=function(){return F_(function e(t,r,n){G_(this,e),this.sensitivity=t?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})},[{key:"compare",value:function(e,t){return this.collator.compare(e,t)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}])}(),Ax=F_(function e(t,r,n,o,i){G_(this,e),this.text=t.normalize?t.normalize():t,this.image=r,this.scale=n,this.fontStack=o,this.textColor=i}),Ix=function(){function e(t){G_(this,e),this.sections=t}return F_(e,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some(function(e){return 0!==e.text.length||e.image&&0!==e.image.namePrimary.length})}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map(function(e){return e.text}).join("")}},{key:"serialize",value:function(){var e,t=["format"],r=K_(this.sections);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.image)t.push(["image",n.image.namePrimary]);else{t.push(n.text);var o={};n.fontStack&&(o["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(o["font-scale"]=n.scale),n.textColor&&(o["text-color"]=["rgba"].concat(n.textColor.toRenderColor(null).toArray())),t.push(o)}}}catch(e){r.e(e)}finally{r.f()}return t}}],[{key:"fromString",value:function(t){return new e([new Ax(t,null,null,null,null)])}},{key:"factory",value:function(t){return t instanceof e?t:e.fromString(t)}}])}(),Lx=function(){function e(t){G_(this,e),this.namePrimary=t.namePrimary,t.nameSecondary&&(this.nameSecondary=t.nameSecondary),this.available=t.available}return F_(e,[{key:"toString",value:function(){return this.nameSecondary?"[".concat(this.namePrimary,",").concat(this.nameSecondary,"]"):this.namePrimary}},{key:"serialize",value:function(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}],[{key:"fromString",value:function(t,r){return t?new e({namePrimary:t,nameSecondary:r,available:!1}):null}}])}();function Nx(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value [".concat([e,t,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function Mx(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof jx)return!0;if(e instanceof Cx)return!0;if(e instanceof Ix)return!0;if(e instanceof Lx)return!0;if(Array.isArray(e)){var t,r=K_(e);try{for(r.s();!(t=r.n()).done;){if(!Mx(t.value))return!1}}catch(e){r.e(e)}finally{r.f()}return!0}if("object"===X_(e)){for(var n in e)if(!Mx(e[n]))return!1;return!0}return!1}function Rx(e){if(null===e)return rx;if("string"==typeof e)return ox;if("boolean"==typeof e)return ix;if("number"==typeof e)return nx;if(e instanceof jx)return ax;if(e instanceof Cx)return lx;if(e instanceof Ix)return cx;if(e instanceof Lx)return fx;if(Array.isArray(e)){var t,r,n=e.length,o=K_(e);try{for(o.s();!(r=o.n()).done;){var i=Rx(r.value);if(t){if(t===i)continue;t=ux;break}t=i}}catch(e){o.e(e)}finally{o.f()}return px(t||ux,n)}return sx}function Dx(e){var t=X_(e);return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof jx||e instanceof Ix||e instanceof Lx?e.toString():JSON.stringify(e)}var Bx=function(){function e(t,r){G_(this,e),this.type=t,this.value=r}return F_(e,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof jx?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof Ix?this.value.serialize():this.value}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("'literal' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!Mx(t[1]))return r.error("invalid value");var n=t[1],o=Rx(n),i=r.expectedType;return"array"!==o.kind||0!==o.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(o=i),new e(o,n)}}])}(),Fx=function(){return F_(function e(t){G_(this,e),this.name="ExpressionEvaluationError",this.message=t},[{key:"toJSON",value:function(){return this.message}}])}(),Ux={string:ox,number:nx,boolean:ix,object:sx},Gx=function(){function e(t,r){G_(this,e),this.type=t,this.args=r}return F_(e,[{key:"evaluate",value:function(e){for(var t=0;t1)&&t.push(n)}}return t.concat(this.args.map(function(e){return e.serialize()}))}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expected at least one argument.");var n,o=1,i=t[0];if("array"===i){var a,s;if(t.length>2){var u=t[1];if("string"!=typeof u||!(u in Ux)||"object"===u)return r.error('The item type argument of "array" must be one of string, number, boolean',1);a=Ux[u],o++}else a=ux;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);s=t[2],o++}n=px(a,s)}else n=Ux[i];for(var l=[];o-1,t.nameSecondary&&t.available&&e.availableImages&&(t.available=e.availableImages.indexOf(t.nameSecondary)>-1)),t}},{key:"eachChild",value:function(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expected two or more arguments.");var n=r.parse(t[1],1,ox);if(!n)return r.error("No image name provided.");if(2===t.length)return new e(n);var o=r.parse(t[2],1,ox);return o?new e(n,o):r.error("Secondary image variant is not a string.")}}])}();function qx(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":X_(e)}var Hx={"to-boolean":ix,"to-color":ax,"to-number":nx,"to-string":ox},Wx=function(){function e(t,r){G_(this,e),this.type=t,this.args=r}return F_(e,[{key:"evaluate",value:function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){var t,r,n,o=K_(this.args);try{for(o.s();!(n=o.n()).done;){if(r=null,(t=n.value.evaluate(e))instanceof jx)return t;if("string"==typeof t){var i=e.parseColor(t);if(i)return i}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):Nx(t[0],t[1],t[2],t[3])))return new jx(t[0]/255,t[1]/255,t[2]/255,t[3])}}catch(e){o.e(e)}finally{o.f()}throw new Fx(r||"Could not parse color from value '".concat("string"==typeof t?t:String(JSON.stringify(t)),"'"))}if("number"===this.type.kind){var a,s=null,u=K_(this.args);try{for(u.s();!(a=u.n()).done;){if(null===(s=a.value.evaluate(e)))return 0;var l=Number(s);if(!isNaN(l))return l}}catch(e){u.e(e)}finally{u.f()}throw new Fx("Could not convert ".concat(JSON.stringify(s)," to number."))}return"formatted"===this.type.kind?Ix.fromString(Dx(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Lx.fromString(Dx(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map(function(t){return t.evaluate(e)}):Dx(this.args[0].evaluate(e))}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return this.args.every(function(e){return e.outputDefined()})}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new zx([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Vx(this.args[0]).serialize();var e="array"===this.type.kind?[]:["to-".concat(this.type.kind)];return this.eachChild(function(t){e.push(t.serialize())}),e}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expected at least one argument.");var n=t[0],o=[],i=rx;if("to-array"===n){if(!Array.isArray(t[1]))return null;var a=t[1].length;if(r.expectedType){if("array"!==r.expectedType.kind)return r.error("Expected ".concat(r.expectedType.kind," but found array."));i=px(r.expectedType.itemType,a)}else{if(!(a>0&&Mx(t[1][0])))return null;i=px(Rx(t[1][0]),a)}for(var s=0;s=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function tP(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function rP(e,t){for(var r,n,o,i,a,s,u,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=!1,f=0,p=t.length;f0&&f<0||c<0&&f>0}function oP(e,t,r,n){var o,i,a=[t[0]-e[0],t[1]-e[1]],s=[n[0]-r[0],n[1]-r[1]];return 0!=(o=s)[0]*(i=a)[1]-o[1]*i[0]&&!(!nP(e,t,r,n)||!nP(r,n,e,t))}var iP=8192;function aP(e,t){var r,n=(180+e[0])/360,o=(r=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),i=Math.pow(2,t.z);return[Math.round(n*i*iP),Math.round(o*i*iP)]}function sP(e,t){for(var r=0;rr[2]){var o=.5*n,i=e[0]-r[0]>o?-n:r[0]-e[0]>o?n:0;0===i&&(i=e[0]-r[2]>o?-n:r[2]-e[0]>o?n:0),e[0]+=i}$x(t,e)}function yP(e,t,r,n){var o=Math.pow(2,n.z)*iP,i=[n.x*iP,n.y*iP],a=[];if(!e)return a;var s,u=K_(e);try{for(u.s();!(s=u.n()).done;){var l,c=K_(s.value);try{for(c.s();!(l=c.n()).done;){var f=l.value,p=[f.x+i[0],f.y+i[1]];hP(p,t,r,o),a.push(p)}}catch(e){c.e(e)}finally{c.f()}}}catch(e){u.e(e)}finally{u.f()}return a}function dP(e,t,r,n){var o=Math.pow(2,n.z)*iP,i=[n.x*iP,n.y*iP],a=[];if(!e)return a;var s,u,l=K_(e);try{for(l.s();!(s=l.n()).done;){var c,f=[],p=K_(s.value);try{for(p.s();!(c=p.n()).done;){var h=c.value,y=[h.x+i[0],h.y+i[1]];$x(t,y),f.push(y)}}catch(e){p.e(e)}finally{p.f()}a.push(f)}}catch(e){l.e(e)}finally{l.f()}if(t[2]-t[0]<=o/2){(u=t)[0]=u[1]=1/0,u[2]=u[3]=-1/0;var d,m=K_(a);try{for(m.s();!(d=m.n()).done;){var v,b=K_(d.value);try{for(b.s();!(v=b.n()).done;){hP(v.value,t,r,o)}}catch(e){b.e(e)}finally{b.f()}}}catch(e){m.e(e)}finally{m.f()}}return a}var mP=function(){function e(t,r){G_(this,e),this.type=ix,this.geojson=t,this.geometries=r}return F_(e,[{key:"evaluate",value:function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if(!o)return!1;if("Polygon"===t.type){var i=fP(t.coordinates,n,o),a=yP(e.geometry(),r,n,o);if(!eP(r,n))return!1;var s,u=K_(a);try{for(u.s();!(s=u.n()).done;)if(!rP(s.value,i))return!1}catch(e){u.e(e)}finally{u.f()}}if("MultiPolygon"===t.type){var l=pP(t.coordinates,n,o),c=yP(e.geometry(),r,n,o);if(!eP(r,n))return!1;var f,p=K_(c);try{for(p.s();!(f=p.n()).done;)if(!sP(f.value,l))return!1}catch(e){p.e(e)}finally{p.f()}}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if(!o)return!1;if("Polygon"===t.type){var i=fP(t.coordinates,n,o),a=dP(e.geometry(),r,n,o);if(!eP(r,n))return!1;var s,u=K_(a);try{for(u.s();!(s=u.n()).done;)if(!lP(s.value,i))return!1}catch(e){u.e(e)}finally{u.f()}}if("MultiPolygon"===t.type){var l=pP(t.coordinates,n,o),c=dP(e.geometry(),r,n,o);if(!eP(r,n))return!1;var f,p=K_(c);try{for(p.s();!(f=p.n()).done;)if(!cP(f.value,l))return!1}catch(e){p.e(e)}finally{p.f()}}return!0}(e,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("'within' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(Mx(t[1])){var n=t[1];if("FeatureCollection"===n.type)for(var o=0;ot)return xP(o,i,(t-(r-a))/a)}return e[e.length-1]}},{key:"pointToSegmentDistance",value:function(e,t,r){var n=M_(t,2),o=n[0],i=n[1],a=PP(r[0]-o)*this.kx,s=(r[1]-i)*this.ky;if(0!==a||0!==s){var u=(PP(e[0]-o)*this.kx*a+(e[1]-i)*this.ky*s)/(a*a+s*s);u>1?(o=r[0],i=r[1]):u>0&&(o+=a/this.kx*u,i+=s/this.ky*u)}return a=PP(e[0]-o)*this.kx,s=(e[1]-i)*this.ky,Math.sqrt(a*a+s*s)}},{key:"pointOnLine",value:function(e,t){for(var r=1/0,n=e[0][0],o=e[0][1],i=0,a=0,s=0;s1?(u=e[s+1][0],l=e[s+1][1]):p>0&&(u+=c/this.kx*p,l+=f/this.ky*p));var h=(c=PP(t[0]-u)*this.kx)*c+(f=(t[1]-l)*this.ky)*f;ho.index||n.index===o.index&&n.t>o.t){var i=n;n=o,o=i}var a=[n.point],s=n.index+1,u=o.index;!_P(r[s],a[0])&&s<=u&&a.push(r[s]);for(var l=s+1;l<=u;l++)a.push(r[l]);return _P(r[u],o.point)||a.push(o.point),a}},{key:"lineSliceAlong",value:function(e,t,r){for(var n=0,o=[],i=0;ie&&0===o.length&&o.push(xP(a,s,(e-(n-u))/u)),n>=t)return o.push(xP(a,s,(t-(n-u))/u)),o;n>e&&o.push(s)}return o}},{key:"bufferPoint",value:function(e,t){var r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[0]+n,e[1]+r]}},{key:"bufferBBox",value:function(e,t){var r=t/this.ky,n=t/this.kx;return[e[0]-n,e[1]-r,e[2]+n,e[3]+r]}},{key:"insideBBox",value:function(e,t){return PP(e[0]-t[0])>=0&&PP(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]}}],[{key:"fromTile",value:function(t,r,n){var o=Math.PI*(1-2*(t+.5)/Math.pow(2,r));return new e(Math.atan(.5*(Math.exp(o)-Math.exp(-o)))/SP,n)}},{key:"units",get:function(){return vP}}])}();function _P(e,t){return e[0]===t[0]&&e[1]===t[1]}function xP(e,t,r){var n=PP(t[0]-e[0]),o=t[1]-e[1];return[e[0]+n*r,e[1]+o*r]}function PP(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}function kP(e,t){this.x=e,this.y=t}kP.prototype={clone:function(){return new kP(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,o=r*this.x+t*this.y;return this.x=n,this.y=o,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),o=t.x+r*(this.x-t.x)-n*(this.y-t.y),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=o,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},kP.convert=function(e){return e instanceof kP?e:Array.isArray(e)?new kP(e[0],e[1]):e};var EP=function(){return F_(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return et?1:0};if(G_(this,e),this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)},[{key:"push",value:function(e){this.data.push(e),this._up(this.length++)}},{key:"pop",value:function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var o=e-1>>1,i=t[o];if(r(n,i)>=0)break;t[e]=i,e=o}t[e]=n}},{key:"_down",value:function(e){for(var t=this.data,r=this.compare,n=this.length>>1,o=t[e];e=0)break;t[e]=t[i],e=i}t[e]=o}}])}(),jP=8192;function TP(e,t){return t.dist-e.dist}var CP=100,AP=50;function IP(e){var t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(var r=0;r=e[0]&&e[1]e[1])return[null,null];var r=LP(e);if(t){if(2===r)return[e,null];var n=Math.floor(r/2);return[[e[0],e[0]+n],[e[0]+n,e[1]]]}if(1===r)return[e,null];var o=Math.floor(r/2)-1;return[[e[0],e[0]+o],[e[0]+o+1,e[1]]]}function RP(e,t){var r=[1/0,1/0,-1/0,-1/0];if(!NP(t,e.length))return r;for(var n=t[0];n<=t[1];++n)$x(r,e[n]);return r}function DP(e){for(var t=[1/0,1/0,-1/0,-1/0],r=0;rt[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]3&&void 0!==arguments[3]?arguments[3]:1/0,o=DP(e),i=DP(t);if(n!==1/0&&BP(o,i,r)>=n)return n;if(eP(o,i)){if(KP(e,t))return 0}else if(KP(t,e))return 0;var a,s=n,u=K_(e);try{for(u.s();!(a=u.n()).done;)for(var l=a.value,c=0,f=l.length,p=f-1;c4&&void 0!==arguments[4]?arguments[4]:1/0,i=Math.min(n.distance(e[0],r[0][0]),o);if(0===i)return i;for(var a={dist:0,range1:[0,e.length-1],range2:[0,0]},s=new EP([a],TP),u=t?AP:CP,l=DP(r);s.length;){var c=s.pop();if(!(c.dist>=i)){var f=c.range1;if(LP(f)<=u){if(!NP(f,e.length))return NaN;if(t){var p=JP(e,f,r,n);if(0===(i=Math.min(i,p)))return i}else for(var h=f[0];h<=f[1];++h){var y=WP(e[h],r,n);if(0===(i=Math.min(i,y)))return i}}else{var d=MP(f,t);if(null!==d[0]){var m=BP(RP(e,d[0]),l,n);m5&&void 0!==arguments[5]?arguments[5]:1/0,a=Math.min(i,o.distance(e[0],r[0]));if(0===a)return a;for(var s={dist:0,range1:[0,e.length-1],range2:[0,r.length-1]},u=new EP([s],TP),l=t?AP:CP,c=n?AP:CP;u.length;){var f=u.pop();if(!(f.dist>=a)){var p=f.range1,h=f.range2;if(LP(p)<=l&&LP(h)<=c){if(!NP(p,e.length)||!NP(h,r.length))return NaN;if(t&&n?a=Math.min(a,qP(e,p,r,h,o)):t||n?t&&!n?a=Math.min(a,zP(r,h,e,p,o)):!t&&n&&(a=Math.min(a,zP(e,p,r,h,o))):a=Math.min(a,HP(e,p,r,h,o)),0===a)return a}else{var y=MP(p,t),d=MP(h,n);QP(u,a,o,e,r,y[0],d[0]),QP(u,a,o,e,r,y[0],d[1]),QP(u,a,o,e,r,y[1],d[0]),QP(u,a,o,e,r,y[1],d[1])}}}return a}function $P(e,t,r,n){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=RP(e,[0,e.length-1]),s=K_(r);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(!(i!==1/0&&BP(a,RP(u,[0,u.length-1]),n)>=i)&&0===(i=Math.min(i,ZP(e,t,u,!0,n,i))))return i}}catch(e){s.e(e)}finally{s.f()}return i}function ek(e,t,r,n){var o,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=RP(e,[0,e.length-1]),s=K_(r);try{for(s.s();!(o=s.n()).done;){var u=o.value;if(!(i!==1/0&&BP(a,DP(u),n)>=i)){var l=XP(e,t,u,n,i);if(isNaN(l))return l;if(0===(i=Math.min(i,l)))return i}}}catch(e){s.e(e)}finally{s.f()}return i}function tk(e,t,r){var n,o=[],i=K_(function(e,t){var r=e.length;if(r<=1)return[e];for(var n,o,i=[],a=0;ar&&(e=r),e}var ak=function(){function e(t,r,n){G_(this,e),this.type=t,this.key=r,this.scope=n}return F_(e,[{key:"evaluate",value:function(e){var t=[this.key,this.scope,e.scope].filter(Boolean).join(""),r=e.getConfig(t);if(!r)return null;var n=r.type,o=r.value,i=r.values,a=r.minValue,s=r.maxValue,u=r.stepValue,l=r.default.evaluate(e),c=l;if(o){var f=e.scope;e.scope=(f||"").split("").slice(1).join(""),c=o.evaluate(e),e.scope=f}return n&&(c=ok(n,c)),void 0===c||void 0===a&&void 0===s&&void 0===u||("number"==typeof c?c=ik(c,a,s,u):Array.isArray(c)&&(c=c.map(function(e){return"number"==typeof e?ik(e,a,s,u):e}))),void 0!==o&&void 0!==c&&i&&!i.includes(c)&&(c=l,n&&(c=ok(n,c))),(n&&n!==this.type||void 0!==c&&Rx(c)!==this.type)&&(c=ok(this.type.kind,c)),c}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var e=["config",this.key];return this.scope&&e.concat(this.key),e}}],[{key:"parse",value:function(t,r){var n=r.expectedType;if(null!==n&&void 0!==n||(n=ux),t.length<2||t.length>3)return r.error("Invalid number of arguments for 'config' expression.");var o=r.parse(t[1],1);if(!(o instanceof Bx))return r.error("Key name of 'config' expression must be a string literal.");if(t.length>=3){var i=r.parse(t[2],2);return i instanceof Bx?new e(n,Dx(o.value),Dx(i.value)):r.error("Scope of 'config' expression must be a string literal.")}return new e(n,Dx(o.value))}}])}();function sk(e){if(e instanceof Yx){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof mP)return!1;if(e instanceof nk)return!1;var t=!0;return e.eachChild(function(e){t&&!sk(e)&&(t=!1)}),t}function uk(e){if(e instanceof Yx&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild(function(e){t&&!uk(e)&&(t=!1)}),t}function lk(e){if(e instanceof ak)return!1;var t=!0;return e.eachChild(function(e){t&&!lk(e)&&(t=!1)}),t}function ck(e,t){if(e instanceof Yx&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild(function(e){r&&!ck(e,t)&&(r=!1)}),r}var fk=function(){function e(t,r){G_(this,e),this.type=r.type,this.name=t,this.boundExpression=r}return F_(e,[{key:"evaluate",value:function(e){return this.boundExpression.evaluate(e)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");var n=t[1];return r.scope.has(n)?new e(n,r.scope.get(n)):r.error('Unknown variable "'.concat(n,'". Make sure "').concat(n,'" has been bound in an enclosing "let" expression before using it.'),1)}}])}(),pk=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new tx,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;G_(this,e),this.registry=t,this.path=r,this.key=r.map(function(e){return"[".concat(e,"]")}).join(""),this.scope=o,this.errors=i,this.expectedType=n,this._scope=a,this.options=s}return F_(e,[{key:"parse",value:function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t||r?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}},{key:"_parse",value:function(e,t){function r(e,t,r){return"assert"===r?new Gx(t,[e]):"coerce"===r?new Wx(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n="string"==typeof e[0]?this.registry[e[0]]:void 0;if(n){var o=n.parse(e,this);if(!o)return null;if(this.expectedType){var i=this.expectedType,a=o.type;if("string"!==i.kind&&"number"!==i.kind&&"boolean"!==i.kind&&"object"!==i.kind&&"array"!==i.kind||"value"!==a.kind)if("color"!==i.kind&&"formatted"!==i.kind&&"resolvedImage"!==i.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(i,a))return null}else o=r(o,i,t.typeAnnotation||"coerce");else o=r(o,i,t.typeAnnotation||"assert")}if(!(o instanceof Bx)&&"resolvedImage"!==o.type.kind&&function e(t){if(t instanceof fk)return e(t.boundExpression);if(t instanceof Yx&&"error"===t.name)return!1;if(t instanceof Xx)return!1;if(t instanceof mP)return!1;if(t instanceof nk)return!1;if(t instanceof ak)return!1;var r=t instanceof Wx||t instanceof Gx;var n=!0;t.eachChild(function(t){n=r?n&&e(t):n&&t instanceof Bx});if(!n)return!1;return sk(t)&&ck(t,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}(o)){var s=new Kx(this._scope,this.options);try{o=new Bx(o.type,o.evaluate(s))}catch(e){return this.error(e.message),null}}return o}return Wx.parse(["to-array",e],this)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"===X_(e)?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(X_(e)," instead."))}},{key:"concat",value:function(t,r,n){var o="number"==typeof t?this.path.concat(t):this.path,i=n?this.scope.concat(n):this.scope;return new e(this.registry,o,r||null,i,this.errors,this._scope,this.options)}},{key:"error",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;nt))throw new Fx("Input is not a number.");a=s-1}return 0}var yk=function(){function e(t,r,n){G_(this,e),this.type=t,this.input=r,this.labels=[],this.outputs=[];var o,i=K_(n);try{for(i.s();!(o=i.n()).done;){var a=M_(o.value,2),s=a[0],u=a[1];this.labels.push(s),this.outputs.push(u)}}catch(e){i.e(e)}finally{i.f()}}return F_(e,[{key:"evaluate",value:function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var o=t.length;return n>=t[o-1]?r[o-1].evaluate(e):r[hk(t,n)].evaluate(e)}},{key:"eachChild",value:function(e){e(this.input);var t,r=K_(this.outputs);try{for(r.s();!(t=r.n()).done;){e(t.value)}}catch(e){r.e(e)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(e){return e.outputDefined()})}},{key:"serialize",value:function(){for(var e=["step",this.input.serialize()],t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}],[{key:"parse",value:function(t,r){if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");var n=r.parse(t[1],1,nx);if(!n)return null;var o=[],i=null;r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);for(var a=1;a=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var f=r.parse(u,c,i);if(!f)return null;i=i||f.type,o.push([s,f])}return new e(i,n,o)}}])}(),dk=mk;function mk(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}mk.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)o?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var vk=bx(dk),bk=.95047,gk=1,wk=1.08883,Sk=4/29,Ok=6/29,_k=3*Ok*Ok,xk=Ok*Ok*Ok,Pk=Math.PI/180,kk=180/Math.PI;function Ek(e){return e>xk?Math.pow(e,1/3):e/_k+Sk}function jk(e){return e>Ok?e*e*e:_k*(e-Sk)}function Tk(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ck(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ak(e){var t=Ck(e.r),r=Ck(e.g),n=Ck(e.b),o=Ek((.4124564*t+.3575761*r+.1804375*n)/bk),i=Ek((.2126729*t+.7151522*r+.072175*n)/gk);return{l:116*i-16,a:500*(o-i),b:200*(i-Ek((.0193339*t+.119192*r+.9503041*n)/wk)),alpha:e.a}}function Ik(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=gk*jk(t),r=bk*jk(r),n=wk*jk(n),new jx(Tk(3.2404542*r-1.5371385*t-.4985314*n),Tk(-.969266*r+1.8760108*t+.041556*n),Tk(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}var Lk={forward:Ak,reverse:Ik,interpolate:function(e,t,r){return{l:kx(e.l,t.l,r),a:kx(e.a,t.a,r),b:kx(e.b,t.b,r),alpha:kx(e.alpha,t.alpha,r)}}},Nk={forward:function(e){var t=Ak(e),r=t.l,n=t.a,o=t.b,i=Math.atan2(o,n)*kk;return{h:i<0?i+360:i,c:Math.sqrt(n*n+o*o),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Pk,r=e.c;return Ik({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:function(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(e.h,t.h,r),c:kx(e.c,t.c,r),l:kx(e.l,t.l,r),alpha:kx(e.alpha,t.alpha,r)}}},Mk=Object.freeze({__proto__:null,hcl:Nk,lab:Lk}),Rk=function(){function e(t,r,n,o,i){G_(this,e),this.type=t,this.operator=r,this.interpolation=n,this.input=o,this.labels=[],this.outputs=[];var a,s=K_(i);try{for(s.s();!(a=s.n()).done;){var u=M_(a.value,2),l=u[0],c=u[1];this.labels.push(l),this.outputs.push(c)}}catch(e){s.e(e)}finally{s.f()}}return F_(e,[{key:"evaluate",value:function(t){var r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(t);var o=this.input.evaluate(t);if(o<=r[0])return n[0].evaluate(t);var i=r.length;if(o>=r[i-1])return n[i-1].evaluate(t);var a=hk(r,o),s=r[a],u=r[a+1],l=e.interpolationFactor(this.interpolation,o,s,u),c=n[a].evaluate(t),f=n[a+1].evaluate(t);return"interpolate"===this.operator?Ex[this.type.kind.toLowerCase()](c,f,l):"interpolate-hcl"===this.operator?Nk.reverse(Nk.interpolate(Nk.forward(c),Nk.forward(f),l)):Lk.reverse(Lk.interpolate(Lk.forward(c),Lk.forward(f),l))}},{key:"eachChild",value:function(e){e(this.input);var t,r=K_(this.outputs);try{for(r.s();!(t=r.n()).done;){e(t.value)}}catch(e){r.e(e)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(e){return e.outputDefined()})}},{key:"serialize",value:function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r1}))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:c}}if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(s=r.parse(s,2,nx)))return null;var f=[],p=null;"interpolate-hcl"===i||"interpolate-lab"===i?p=ax:r.expectedType&&"value"!==r.expectedType.kind&&(p=r.expectedType);for(var h=0;h=y)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',m);var b=r.parse(d,v,p);if(!b)return null;p=p||b.type,f.push([y,b])}return"number"===p.kind||"color"===p.kind||"array"===p.kind&&"number"===p.itemType.kind&&"number"==typeof p.N?new e(p,i,a,s,f):r.error("Type ".concat(hx(p)," is not interpolatable."))}}])}();function Dk(e,t,r,n){var o=n-r,i=e-r;return 0===o?0:1===t?i/o:(Math.pow(t,i)-1)/(Math.pow(t,o)-1)}var Bk=function(){function e(t,r){G_(this,e),this.type=t,this.args=r}return F_(e,[{key:"evaluate",value:function(e){var t,r,n=null,o=0,i=K_(this.args);try{for(i.s();!(r=i.n()).done;){if(o++,(n=r.value.evaluate(e))&&n instanceof Lx&&!n.available&&(t||(t=n),n=null,o===this.args.length))return t;if(null!==n)break}}catch(e){i.e(e)}finally{i.f()}return n}},{key:"eachChild",value:function(e){this.args.forEach(e)}},{key:"outputDefined",value:function(){return this.args.every(function(e){return e.outputDefined()})}},{key:"serialize",value:function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e}}],[{key:"parse",value:function(t,r){if(t.length<2)return r.error("Expectected at least one argument.");var n=null,o=r.expectedType;o&&"value"!==o.kind&&(n=o);var i,a=[],s=K_(t.slice(1));try{for(s.s();!(i=s.n()).done;){var u=i.value,l=r.parse(u,1+a.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,a.push(l)}}catch(e){s.e(e)}finally{s.f()}return new e(o&&a.some(function(e){return dx(o,e.type)})?ux:n,a)}}])}(),Fk=function(){function e(t,r){G_(this,e),this.type=r.type,this.bindings=[].concat(t),this.result=r}return F_(e,[{key:"evaluate",value:function(e){return this.result.evaluate(e)}},{key:"eachChild",value:function(e){var t,r=K_(this.bindings);try{for(r.s();!(t=r.n()).done;){e(t.value[1])}}catch(e){r.e(e)}finally{r.f()}e(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var e,t=["let"],r=K_(this.bindings);try{for(r.s();!(e=r.n()).done;){var n=M_(e.value,2),o=n[0],i=n[1];t.push(o,i.serialize())}}catch(e){r.e(e)}finally{r.f()}return t.push(this.result.serialize()),t}}],[{key:"parse",value:function(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));for(var n=[],o=1;o=r.length)throw new Fx("Array index out of bounds: ".concat(t," > ").concat(r.length-1,"."));if(t!==Math.floor(t))throw new Fx("Array index must be an integer, but found ".concat(t," instead."));return r[t]}},{key:"eachChild",value:function(e){e(this.index),e(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));var n=r.parse(t[1],1,nx),o=r.parse(t[2],2,px(r.expectedType||ux));return n&&o?new e(o.type.itemType,n,o):null}}])}(),Gk=function(){function e(t,r){G_(this,e),this.type=ix,this.needle=t,this.haystack=r}return F_(e,[{key:"evaluate",value:function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(null==r)return!1;if(!vx(t,["boolean","string","number","null"]))throw new Fx("Expected first argument to be of type boolean, string, number or null, but found ".concat(hx(Rx(t))," instead."));if(!vx(r,["string","array"]))throw new Fx("Expected second argument to be of type array or string, but found ".concat(hx(Rx(r))," instead."));return r.indexOf(t)>=0}},{key:"eachChild",value:function(e){e(this.needle),e(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));var n=r.parse(t[1],1,ux),o=r.parse(t[2],2,ux);return n&&o?mx(n.type,[ix,ox,nx,rx,ux])?new e(n,o):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(hx(n.type)," instead")):null}}])}(),zk=function(){function e(t,r,n){G_(this,e),this.type=nx,this.needle=t,this.haystack=r,this.fromIndex=n}return F_(e,[{key:"evaluate",value:function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!vx(t,["boolean","string","number","null"]))throw new Fx("Expected first argument to be of type boolean, string, number or null, but found ".concat(hx(Rx(t))," instead."));if(!vx(r,["string","array"]))throw new Fx("Expected second argument to be of type array or string, but found ".concat(hx(Rx(r))," instead."));if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)}},{key:"eachChild",value:function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));var n=r.parse(t[1],1,ux),o=r.parse(t[2],2,ux);if(!n||!o)return null;if(!mx(n.type,[ix,ox,nx,rx,ux]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(hx(n.type)," instead"));if(4===t.length){var i=r.parse(t[3],3,nx);return i?new e(n,o,i):null}return new e(n,o)}}])}(),Vk=function(){function e(t,r,n,o,i,a){G_(this,e),this.inputType=t,this.type=r,this.input=n,this.cases=o,this.outputs=i,this.otherwise=a}return F_(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);return(Rx(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}},{key:"eachChild",value:function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var e,t=this,r=["match",this.input.serialize()],n=[],o={},i=K_(Object.keys(this.cases).sort());try{for(i.s();!(e=i.n()).done;){var a=e.value,s=o[this.cases[a]];void 0===s?(o[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[s][1].push(a)}}catch(e){i.e(e)}finally{i.f()}for(var u=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=n;lNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof h&&Math.floor(h)!==h)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,Rx(h)))return null}else n=Rx(h);if(void 0!==i[String(h)])return c.error("Branch labels must be unique.");i[String(h)]=a.length}}catch(e){p.e(e)}finally{p.f()}var y=r.parse(l,s,o);if(!y)return null;o=o||y.type,a.push(y)}var d=r.parse(t[1],1,ux);if(!d)return null;var m=r.parse(t[t.length-1],t.length-1,o);return m?"value"!==d.type.kind&&r.concat(1).checkSubtype(n,d.type)?null:new e(n,o,d,i,a,m):null}}])}(),qk=function(){function e(t,r,n){G_(this,e),this.type=t,this.branches=r,this.otherwise=n}return F_(e,[{key:"evaluate",value:function(e){var t,r=K_(this.branches);try{for(r.s();!(t=r.n()).done;){var n=M_(t.value,2),o=n[0],i=n[1];if(o.evaluate(e))return i.evaluate(e)}}catch(e){r.e(e)}finally{r.f()}return this.otherwise.evaluate(e)}},{key:"eachChild",value:function(e){var t,r=K_(this.branches);try{for(r.s();!(t=r.n()).done;){var n=M_(t.value,2),o=n[0],i=n[1];e(o),e(i)}}catch(e){r.e(e)}finally{r.f()}e(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every(function(e){var t=M_(e,2);t[0];return t[1].outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e}}],[{key:"parse",value:function(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return r.error("Expected an odd number of arguments.");var n;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);for(var o=[],i=1;i=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));var n=r.parse(t[1],1,ux),o=r.parse(t[2],2,nx);if(!n||!o)return null;if(!mx(n.type,[px(ux),ox,ux]))return r.error("Expected first argument to be of type array or string, but found ".concat(hx(n.type)," instead"));if(4===t.length){var i=r.parse(t[3],3,nx);return i?new e(n.type,n,o,i):null}return new e(n.type,n,o)}}])}();function Wk(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Jk(e,t,r,n){return 0===n.compare(t,r)}function Kk(e,t,r){var n="=="!==e&&"!="!==e;return function(){function o(e,t,r){G_(this,o),this.type=ix,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return F_(o,[{key:"evaluate",value:function(o){var i=this.lhs.evaluate(o),a=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){var s=Rx(i),u=Rx(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new Fx('Expected arguments for "'.concat(e,'" to be (string, string) or (number, number), but found (').concat(s.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){var l=Rx(i),c=Rx(a);if("string"!==l.kind||"string"!==c.kind)return t(o,i,a)}return this.collator?r(o,i,a,this.collator.evaluate(o)):t(o,i,a)}},{key:"eachChild",value:function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var t=[e];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],i=t.parse(e[1],1,ux);if(!i)return null;if(!Wk(r,i.type))return t.concat(1).error('"'.concat(r,"\" comparisons are not supported for type '").concat(hx(i.type),"'."));var a=t.parse(e[2],2,ux);if(!a)return null;if(!Wk(r,a.type))return t.concat(2).error('"'.concat(r,"\" comparisons are not supported for type '").concat(hx(a.type),"'."));if(i.type.kind!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return t.error("Cannot compare types '".concat(hx(i.type),"' and '").concat(hx(a.type),"'."));n&&("value"===i.type.kind&&"value"!==a.type.kind?i=new Gx(a.type,[i]):"value"!==i.type.kind&&"value"===a.type.kind&&(a=new Gx(i.type,[a])));var s=null;if(4===e.length){if("string"!==i.type.kind&&"string"!==a.type.kind&&"value"!==i.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,lx)))return null}return new o(i,a,s)}}])}()}var Yk=Kk("==",function(e,t,r){return t===r},Jk),Qk=Kk("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!Jk(0,t,r,n)}),Xk=Kk("<",function(e,t,r){return t",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),$k=Kk("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),eE=Kk(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0}),tE=function(){function e(t,r,n,o,i,a){G_(this,e),this.type=ox,this.number=t,this.locale=r,this.currency=n,this.unit=o,this.minFractionDigits=i,this.maxFractionDigits=a}return F_(e,[{key:"evaluate",value:function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}},{key:"eachChild",value:function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}],[{key:"parse",value:function(t,r){if(3!==t.length)return r.error("Expected two arguments.");var n=r.parse(t[1],1,nx);if(!n)return null;var o=t[2];if("object"!==X_(o)||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");var i=null;if(o.locale&&!(i=r.parse(o.locale,1,ox)))return null;var a=null;if(o.currency&&!(a=r.parse(o.currency,1,ox)))return null;var s=null;if(o.unit&&!(s=r.parse(o.unit,1,ox)))return null;var u=null;if(o["min-fraction-digits"]&&!(u=r.parse(o["min-fraction-digits"],1,nx)))return null;var l=null;return o["max-fraction-digits"]&&!(l=r.parse(o["max-fraction-digits"],1,nx))?null:new e(n,i,a,s,u,l)}}])}();var rE={"==":Yk,"!=":Qk,">":Zk,"<":Xk,">=":eE,"<=":$k,array:Gx,at:Uk,boolean:Gx,case:qk,coalesce:Bk,collator:Xx,format:zx,image:Vx,in:Gk,"index-of":zk,interpolate:Rk,"interpolate-hcl":Rk,"interpolate-lab":Rk,length:function(){function e(t){G_(this,e),this.type=nx,this.input=t}return F_(e,[{key:"evaluate",value:function(e){var t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Fx("Expected value to be of type string or array, but found ".concat(hx(Rx(t))," instead."))}},{key:"eachChild",value:function(e){e(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e}}],[{key:"parse",value:function(t,r){if(2!==t.length)return r.error("Expected 1 argument, but found ".concat(t.length-1," instead."));var n=r.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?r.error("Expected argument of type string or array, but found ".concat(hx(n.type)," instead.")):new e(n):null}}])}(),let:Fk,literal:Bx,match:Vk,number:Gx,"number-format":tE,object:Gx,slice:Hk,step:yk,string:Gx,"to-boolean":Wx,"to-color":Wx,"to-number":Wx,"to-string":Wx,var:fk,within:mP,distance:nk,config:ak};function nE(e,t){var r=M_(t,4),n=r[0],o=r[1],i=r[2],a=r[3];n=n.evaluate(e),o=o.evaluate(e),i=i.evaluate(e);var s=a?a.evaluate(e):1,u=Nx(n,o,i,s);if(u)throw new Fx(u);return new jx(n/255*s,o/255*s,i/255*s,s)}function oE(e,t){var r=M_(t,4),n=r[0],o=r[1],i=r[2],a=r[3];n=n.evaluate(e),o=o.evaluate(e),i=i.evaluate(e);var s=a?a.evaluate(e):1,u=function(e,t,r,n){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid hsla value [".concat([e,t,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid hsla value [".concat(("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", "),"]: 's', and 'l' must be between 0 and 100."):"Invalid hsla value [".concat(("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", "),"]: 'h' must be between 0 and 360.")}(n,o,i,s);if(u)throw new Fx(u);var l="hsla(".concat(n,", ").concat(o,"%, ").concat(i,"%, ").concat(s,")"),c=jx.parse(l);if(!c)throw new Fx("Failed to parse HSLA color: ".concat(l));return c}function iE(e,t){return e in t}function aE(e,t){var r=t[e];return void 0===r?null:r}function sE(e){return{type:e}}function uE(e){return{result:"success",value:e}}function lE(e){return{result:"error",value:e}}function cE(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function fE(e){return"data-driven"===e["property-type"]}function pE(e){return cE(e.expression,"measure-light")}function hE(e){return cE(e.expression,"zoom")}function yE(e){return!!e.expression&&e.expression.interpolated}function dE(e){return"object"===X_(e)&&null!==e&&!Array.isArray(e)}function mE(e){return e}function vE(e,t){var r,n,o,i="color"===t.type,a=e.stops&&"object"===X_(e.stops[0][0]),s=a||void 0!==e.property,u=a||!s,l=e.type||(yE(t)?"exponential":"interval");if(i&&((e=$_({},e)).stops&&(e.stops=e.stops.map(function(e){return[e[0],jx.parse(e[1])]})),e.default?e.default=jx.parse(e.default):e.default=jx.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Mk[e.colorSpace])throw new Error("Unknown color space: ".concat(e.colorSpace));if("exponential"===l)r=SE;else if("interval"===l)r=wE;else if("categorical"===l){r=gE,n=Object.create(null);var c,f=K_(e.stops);try{for(f.s();!(c=f.n()).done;){var p=c.value;n[p[0]]=p[1]}}catch(e){f.e(e)}finally{f.f()}o=X_(e.stops[0][0])}else{if("identity"!==l)throw new Error('Unknown function type "'.concat(l,'"'));r=OE}if(a){for(var h={},y=[],d=0;d=e.stops[n-1][0])return e.stops[n-1][1];var o=hk(e.stops.map(function(e){return e[0]}),r);return e.stops[o][1]}function SE(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==qx(r))return bE(e.default,t.default);var o=e.stops.length;if(1===o)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[o-1][0])return e.stops[o-1][1];var i=hk(e.stops.map(function(e){return e[0]}),r),a=function(e,t,r,n){var o=n-r,i=e-r;return 0===o?0:1===t?i/o:(Math.pow(t,i)-1)/(Math.pow(t,o)-1)}(r,n,e.stops[i][0],e.stops[i+1][0]),s=e.stops[i][1],u=e.stops[i+1][1],l=Ex[t.type]||mE;if(e.colorSpace&&"rgb"!==e.colorSpace){var c=Mk[e.colorSpace];l=function(e,t){return c.reverse(c.interpolate(c.forward(e),c.forward(t),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var e=arguments.length,t=new Array(e),r=0;r":[ix,[ox,ux],function(e,t){var r=M_(t,2),n=r[0],o=r[1],i=e.properties()[n.value],a=o.value;return X_(i)===X_(a)&&i>a}],"filter-id->":[ix,[ux],function(e,t){var r=M_(t,1)[0],n=e.id(),o=r.value;return X_(n)===X_(o)&&n>o}],"filter-<=":[ix,[ox,ux],function(e,t){var r=M_(t,2),n=r[0],o=r[1],i=e.properties()[n.value],a=o.value;return X_(i)===X_(a)&&i<=a}],"filter-id-<=":[ix,[ux],function(e,t){var r=M_(t,1)[0],n=e.id(),o=r.value;return X_(n)===X_(o)&&n<=o}],"filter->=":[ix,[ox,ux],function(e,t){var r=M_(t,2),n=r[0],o=r[1],i=e.properties()[n.value],a=o.value;return X_(i)===X_(a)&&i>=a}],"filter-id->=":[ix,[ux],function(e,t){var r=M_(t,1)[0],n=e.id(),o=r.value;return X_(n)===X_(o)&&n>=o}],"filter-has":[ix,[ux],function(e,t){return M_(t,1)[0].value in e.properties()}],"filter-has-id":[ix,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[ix,[px(ox)],function(e,t){return M_(t,1)[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[ix,[px(ux)],function(e,t){return M_(t,1)[0].value.indexOf(e.id())>=0}],"filter-in-small":[ix,[ox,px(ux)],function(e,t){var r=M_(t,2),n=r[0];return r[1].value.indexOf(e.properties()[n.value])>=0}],"filter-in-large":[ix,[ox,px(ux)],function(e,t){var r=M_(t,2),n=r[0],o=r[1];return function(e,t,r,n){for(;r<=n;){var o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[n.value],o.value,0,o.value.length-1)}],all:{type:ix,overloads:[[[ix,ix],function(e,t){var r=M_(t,2),n=r[0],o=r[1];return n.evaluate(e)&&o.evaluate(e)}],[sE(ix),function(e,t){var r,n=K_(t);try{for(n.s();!(r=n.n()).done;){if(!r.value.evaluate(e))return!1}}catch(e){n.e(e)}finally{n.f()}return!0}]]},any:{type:ix,overloads:[[[ix,ix],function(e,t){var r=M_(t,2),n=r[0],o=r[1];return n.evaluate(e)||o.evaluate(e)}],[sE(ix),function(e,t){var r,n=K_(t);try{for(n.s();!(r=n.n()).done;){if(r.value.evaluate(e))return!0}}catch(e){n.e(e)}finally{n.f()}return!1}]]},"!":[ix,[ix],function(e,t){return!M_(t,1)[0].evaluate(e)}],"is-supported-script":[ix,[ox],function(e,t){var r=M_(t,1)[0],n=e.globals&&e.globals.isSupportedScript;return!n||n(r.evaluate(e))}],upcase:[ox,[ox],function(e,t){return M_(t,1)[0].evaluate(e).toUpperCase()}],downcase:[ox,[ox],function(e,t){return M_(t,1)[0].evaluate(e).toLowerCase()}],concat:[ox,sE(ux),function(e,t){return t.map(function(t){return Dx(t.evaluate(e))}).join("")}],"resolved-locale":[ox,[lx],function(e,t){return M_(t,1)[0].evaluate(e).resolvedLocale()}],random:[nx,[nx,nx,ux],function(e,t){var r,n,o=M_(t.map(function(t){return t.evaluate(e)}),3),i=o[0],a=o[1],s=o[2];if(i>a)return i;if(i===a)return i;if("string"==typeof s)r=function(e){var t=0;if(0===e.length)return t;for(var r=0;r>>15,1|n);return(((e=e+Math.imul(e^e>>>7,61|e)^e)^e>>>14)>>>0)/4294967296})()*(a-i)}]});var _E=function(){return F_(function e(t,r,n,o){var i;G_(this,e),this.expression=t,this._warningHistory={},this._evaluator=new Kx(n,o),this._defaultValue=r?"color"===(i=r).type&&(dE(i.default)||Array.isArray(i.default))?new jx(0,0,0,0):"color"===i.type?jx.parse(i.default)||null:void 0===i.default?null:i.default:null,this._enumValues=r&&"enum"===r.type?r.values:null},[{key:"evaluateWithoutErrorHandling",value:function(e,t,r,n,o,i,a,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=i,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}},{key:"evaluate",value:function(e,t,r,n,o,i,a,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=i||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var u=this.expression.evaluate(this._evaluator);if(null===u||void 0===u||"number"==typeof u&&u!=u)return this._defaultValue;if(this._enumValues&&!(u in this._enumValues))throw new Fx("Expected value to be one of ".concat(Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", "),", but found ").concat(JSON.stringify(u)," instead."));return u}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}])}();function xE(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in rE}function PE(e,t,r,n){var o=new pk(rE,[],t?function(e){var t={color:ax,string:ox,number:nx,enum:ox,boolean:ix,formatted:cx,resolvedImage:fx};if("array"===e.type)return px(t[e.value]||ux,e.length);return t[e.type]}(t):void 0,void 0,void 0,r,n),i=o.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return i?uE(new _E(i,t,r,n)):lE(o.errors)}var kE=function(){return F_(function e(t,r,n){G_(this,e),this.kind=t,this._styleExpression=r,this.isLightConstant=n,this.isStateDependent="constant"!==t&&!uk(r.expression),this.isConfigDependent=!lk(r.expression)},[{key:"evaluateWithoutErrorHandling",value:function(e,t,r,n,o,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,i)}},{key:"evaluate",value:function(e,t,r,n,o,i){return this._styleExpression.evaluate(e,t,r,n,o,i)}}])}(),EE=function(){return F_(function e(t,r,n,o,i){G_(this,e),this.kind=t,this.zoomStops=n,this._styleExpression=r,this.isStateDependent="camera"!==t&&!uk(r.expression),this.isLightConstant=i,this.isConfigDependent=!lk(r.expression),this.interpolationType=o},[{key:"evaluateWithoutErrorHandling",value:function(e,t,r,n,o,i){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,i)}},{key:"evaluate",value:function(e,t,r,n,o,i){return this._styleExpression.evaluate(e,t,r,n,o,i)}},{key:"interpolationFactor",value:function(e,t,r){return this.interpolationType?Rk.interpolationFactor(this.interpolationType,e,t,r):0}}])}();function jE(e,t,r,n){if("error"===(e=PE(e,t,r,n)).result)return e;var o=e.value.expression,i=sk(o);if(!i&&!fE(t))return lE([new ex("","data expressions not supported")]);var a=ck(o,["zoom","pitch","distance-from-center"]);if(!a&&!hE(t))return lE([new ex("","zoom expressions not supported")]);var s=ck(o,["measure-light"]);if(!s&&!pE(t))return lE([new ex("","measure-light expression not supported")]);var u=t.expression&&t.expression.relaxZoomRestriction,l=function e(t){var r=null;if(t instanceof Fk)r=e(t.result);else if(t instanceof Bk){var n,o=K_(t.args);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(r=e(i))break}}catch(e){o.e(e)}finally{o.f()}}else(t instanceof yk||t instanceof Rk)&&t.input instanceof Yx&&"zoom"===t.input.name&&(r=t);if(r instanceof ex)return r;t.eachChild(function(t){var n=e(t);n instanceof ex?r=n:r&&n&&r!==n&&(r=new ex("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))});return r}(o);if(!(l||a||u))return lE([new ex("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')]);if(l instanceof ex)return lE([l]);if(l instanceof Rk&&!yE(t))return lE([new ex("",'"interpolate" expressions cannot be used with this property')]);if(!l)return uE(new kE(i?"constant":"source",e.value,s));var c=l instanceof Rk?l.interpolation:void 0;return uE(new EE(i?"camera":"composite",e.value,l.labels,c,s))}var TE=function(){function e(t,r){G_(this,e),this._parameters=t,this._specification=r,$_(this,vE(this._parameters,this._specification))}return F_(e,null,[{key:"deserialize",value:function(t){return new e(t._parameters,t._specification)}},{key:"serialize",value:function(e){return{_parameters:e._parameters,_specification:e._specification}}}])}();function CE(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function AE(e){if(Array.isArray(e))return e.map(AE);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=AE(e[r]);return t}return CE(e)}function IE(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":var t,r=K_(e.slice(1));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(!IE(n)&&"boolean"!=typeof n)return!1}}catch(e){r.e(e)}finally{r.f()}return!0;default:return!0}}function LE(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill";if(null===e||void 0===e)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};IE(e)||(e=DE(e));var r=e,n=!0;try{n=function(e){if(!NE(e))return e;var t=AE(e);return function e(t){var r=!1,n=[];if("case"===t[0]){for(var o=1;o",">=","<","<=","to-boolean"]);function RE(e,t){return et?1:0}function DE(e){if(!e)return!0;var t,r=e[0];return e.length<=1?"any"!==r:"=="===r?BE(e[1],e[2],"=="):"!="===r?GE(BE(e[1],e[2],"==")):"<"===r||">"===r||"<="===r||">="===r?BE(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(DE))):"all"===r?["all"].concat(e.slice(1).map(DE)):"none"===r?["all"].concat(e.slice(1).map(DE).map(GE)):"in"===r?FE(e[1],e.slice(2)):"!in"===r?GE(FE(e[1],e.slice(2))):"has"===r?UE(e[1]):"!has"!==r||GE(UE(e[1]))}function BE(e,t,r){switch(e){case"$type":return["filter-type-".concat(r),t];case"$id":return["filter-id-".concat(r),t];default:return["filter-".concat(r),e,t]}}function FE(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(e){return X_(e)!==X_(t[0])})?["filter-in-large",e,["literal",t.sort(RE)]]:["filter-in-small",e,["literal",t]]}}function UE(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function GE(e){return["!",e]}var zE={};!function(e){var t=function(){var e=function(e,t,r,n){for(r=r||{},n=e.length;n--;r[e[n]]=t);return r},t=[1,12],r=[1,13],n=[1,9],o=[1,10],i=[1,11],a=[1,14],s=[1,15],u=[14,18,22,24],l=[18,22],c=[22,24],f={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,r,n,o,i,a){var s=i.length-1;switch(o){case 1:this.$=new String(e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(e),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=i[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=i[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[i[s-2],i[s]];break;case 16:this.$={},this.$[i[s][0]]=i[s][1];break;case 17:this.$=i[s-2],i[s-2][i[s][0]]=i[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[i[s]];break;case 21:this.$=i[s-2],i[s-2].push(i[s])}},table:[{3:5,4:t,5:6,6:r,7:3,8:n,9:4,10:o,11:i,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},e(u,[2,7]),e(u,[2,8]),e(u,[2,9]),e(u,[2,10]),e(u,[2,11]),e(u,[2,12]),e(u,[2,3]),e(u,[2,4]),e(u,[2,5]),e([14,18,21,22,24],[2,1]),e(u,[2,2]),{3:20,4:t,18:[1,17],19:18,20:19},{3:5,4:t,5:6,6:r,7:3,8:n,9:4,10:o,11:i,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},e(u,[2,13]),{18:[1,24],22:[1,25]},e(l,[2,16]),{21:[1,26]},e(u,[2,18]),{22:[1,28],24:[1,27]},e(c,[2,20]),e(u,[2,14]),{3:20,4:t,20:29},{3:5,4:t,5:6,6:r,7:3,8:n,9:4,10:o,11:i,13:30,15:7,16:8,17:a,23:s},e(u,[2,19]),{3:5,4:t,5:6,6:r,7:3,8:n,9:4,10:o,11:i,13:31,15:7,16:8,17:a,23:s},e(l,[2,17]),e(l,[2,15]),e(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,r=[0],n=[null],o=[],i=this.table,a="",s=0,u=0,l=1,c=o.slice.call(arguments,1),f=Object.create(this.lexer),p={yy:{}};for(var h in this.yy)Object.prototype.hasOwnProperty.call(this.yy,h)&&(p.yy[h]=this.yy[h]);f.setInput(e,p.yy),p.yy.lexer=f,p.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var y=f.yylloc;o.push(y);var d=f.options&&f.options.ranges;"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var m,v,b,g,w,S,O,_,x,P={};;){if(v=r[r.length-1],this.defaultActions[v]?b=this.defaultActions[v]:(null!==m&&void 0!==m||(x=void 0,"number"!=typeof(x=f.lex()||l)&&(x=t.symbols_[x]||x),m=x),b=i[v]&&i[v][m]),void 0===b||!b.length||!b[0]){var k="";for(w in _=[],i[v])this.terminals_[w]&&w>2&&_.push("'"+this.terminals_[w]+"'");k=f.showPosition?"Parse error on line "+(s+1)+":\n"+f.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[m]||m)+"'":"Parse error on line "+(s+1)+": Unexpected "+(m==l?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(k,{text:f.match,token:this.terminals_[m]||m,line:f.yylineno,loc:y,expected:_})}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+m);switch(b[0]){case 1:r.push(m),n.push(f.yytext),o.push(f.yylloc),r.push(b[1]),m=null,u=f.yyleng,a=f.yytext,s=f.yylineno,y=f.yylloc;break;case 2:if(S=this.productions_[b[1]][1],P.$=n[n.length-S],P._$={first_line:o[o.length-(S||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(S||1)].first_column,last_column:o[o.length-1].last_column},d&&(P._$.range=[o[o.length-(S||1)].range[0],o[o.length-1].range[1]]),void 0!==(g=this.performAction.apply(P,[a,u,s,p.yy,b[1],n,o].concat(c))))return g;S&&(r=r.slice(0,-1*S*2),n=n.slice(0,-1*S),o=o.slice(0,-1*S)),r.push(this.productions_[b[1]][0]),n.push(P.$),o.push(P._$),O=i[r[r.length-2]][r[r.length-1]],r.push(O);break;case 3:return!0}}return!0}},p={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,n,o;if(this.options.backtrack_lexer&&(o={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(o.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in o)this[i]=o[i];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),i=0;it[0].length)){if(t=r,n=i,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,o[i])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,o[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,n){switch(r){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function h(){this.yy={}}return f.lexer=p,h.prototype=f,f.Parser=h,new h}();e.parser=t,e.Parser=t.Parser,e.parse=function(){return t.parse.apply(t,arguments)}}(zE);var VE={StyleExpression:_E,isExpression:xE,isExpressionFilter:IE,createExpression:PE,createPropertyExpression:jE,normalizePropertyExpression:function(e,t,r,n){if(dE(e))return new TE(e,t);if(xE(e)||Array.isArray(e)&&e.length>0){var o=jE(e,t,r,n);if("error"===o.result)throw new Error(o.value.map(function(e){return"".concat(e.key,": ").concat(e.message)}).join(", "));return o.value}var i=e;return"string"==typeof e&&"color"===t.type&&(i=jx.parse(e)),{kind:"constant",isConfigDependent:!1,evaluate:function(){return i}}},ZoomConstantExpression:kE,ZoomDependentExpression:EE,StylePropertyFunction:TE};function qE(e){"@babel/helpers - typeof";return(qE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HE(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return WE(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?WE(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function WE(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r0}function Nj(e){var t=function(e){var t,r,n=e.paint,o=void 0===n?{}:n,i=e.layout,a=void 0===i?{}:i,s=Object.keys(o).concat(Object.keys(a)),u=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=jj(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(Ij);try{var l=function(){var e=r.value,n=s.some(function(t){return t.startsWith(e.prefix)});if(n)return t=e.type,1};for(u.s();!(r=u.n()).done&&!l(););}catch(e){u.e(e)}finally{u.f()}return t||Aj.symbol}(e);return Cj(Cj(Cj({},Aj.symbol,{type:"layout",name:"icon-image"}),Aj.line,{type:"paint",name:"line-pattern"}),Aj.fill,{type:"paint",name:"fill-pattern"})[t]}var Mj=["array","boolean","collator","format","literal","number","object","string","to-boolean","to-color","to-number","to-string","typeof","feature-state","geometry-type","id","line-progress","properties","at","get","has","length","!","!=","<","<=","==",">",">=","all","any","case","match","coalesce","interpolate","interpolate-hcl","interpolate-lab","step","let","var","concat","downcase","is-supported-script","resolved-locale","upcase","rgb","rgba","-","*","/","%","^","+","abs","acos","asin","atan","ceil","cos","e","floor","ln","ln2","log10","log2","max","min","pi","round","sin","sqrt","tan","zoom","heatmap-density"];function Rj(e){if(e&&e.length>0){var t=Ej(e,1)[0];return"string"==typeof t&&Mj.includes(t)}return!1}function Dj(e){return Object.keys(e).every(function(t){return!Rj(e[t])})}function Bj(e){return(Lj(e)?e:[e]).every(function(e){return Dj(e.paint||{})&&Dj(e.layout||{})})}var Fj=function(e){return["background-color","background-color-transition","background-pattern","background-pattern-transition","background-opacity","background-opacity-transition","fill-antialias","fill-opacity","fill-opacity-transition","fill-color","fill-color-transition","fill-outline-color","fill-outline-color-transition","fill-translate","fill-translate-transition","fill-translate-anchor","fill-pattern","fill-pattern-transition","fill-extrusion-opacity","fill-extrusion-opacity-transition","fill-extrusion-color","fill-extrusion-color-transition","fill-extrusion-translate","fill-extrusion-translate-transition","fill-extrusion-translate-anchor","fill-extrusion-pattern","fill-extrusion-pattern-transition","fill-extrusion-height","fill-extrusion-height-transition","fill-extrusion-base","fill-extrusion-base-transition","fill-extrusion-vertical-gradient","line-opacity","line-opacity-transition","line-color","line-color-transition","line-translate","line-translate-transition","line-translate-anchor","line-width","line-width-transition","line-gap-width","line-gap-width-transition","line-offset","line-offset-transition","line-blur","line-blur-transition","line-dasharray","line-dasharray-transition","line-pattern","line-pattern-transition","line-gradient","icon-opacity","icon-opacity-transition","icon-color","icon-color-transition","icon-halo-color","icon-halo-color-transition","icon-halo-width","icon-halo-width-transition","icon-halo-blur","icon-halo-blur-transition","icon-translate","icon-translate-transition","icon-translate-anchor","text-opacity","text-opacity-transition","text-color","text-color-transition","text-halo-color","text-halo-color-transition","text-halo-width","text-halo-width-transition","text-halo-blur","text-halo-blur-transition","text-translate","text-translate-transition","text-translate-anchor","raster-opacity","raster-opacity-transition","raster-hue-rotate","raster-hue-rotate-transition","raster-brightness-min","raster-brightness-min-transition","raster-brightness-max","raster-brightness-max-transition","raster-saturation","raster-saturation-transition","raster-contrast","raster-contrast-transition","raster-fade-duration","raster-resampling","circle-sort-key","circle-radius","circle-radius-transition","circle-color","circle-color-transition","circle-blur","circle-blur-transition","circle-opacity","circle-opacity-transition","circle-translate","circle-translate-transition","circle-translate-anchor","circle-pitch-scale","circle-pitch-alignment","circle-stroke-width","circle-stroke-width-transition","circle-stroke-color","circle-stroke-color-transition","circle-stroke-opacity","circle-stroke-opacity-transition","heatmap-radius","heatmap-radius-transition","heatmap-weight","heatmap-intensity","heatmap-intensity-transition","heatmap-color","heatmap-opacity","heatmap-opacity-transition","hillshade-illumination-direction","hillshade-illumination-anchor","hillshade-exaggeration","hillshade-exaggeration-transition","hillshade-shadow-color","hillshade-shadow-color-transition","hillshade-highlight-color","hillshade-highlight-color-transition","hillshade-accent-color","hillshade-accent-color-transition"].includes(e)};function Uj(e){"@babel/helpers - typeof";return(Uj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function zj(e){for(var t=1;t0}},{key:"removeSymbol",value:function(e){this.symbolManager.removeSymbol(e)}},{key:"getSymbol",value:function(e){return this.symbolManager.getSymbol(e)}},{key:"getLayerIds",value:function(e){return this.compositeSymbolRender.getLayerIds(e)||[]}},{key:"getLayerId",value:function(e){return this.compositeSymbolRender.getLayerId(e)}},{key:"removeLayerId",value:function(e){return this.compositeSymbolRender.removeLayerId(e)}},{key:"getLayer",value:function(e){var t=this.map.getLayerBySymbolBak(e),r=this.getLayerSymbol(e);if(t)return r?zj(zj({},t),{},{symbol:r}):t;var n=this.getLayerIds(e);if(n[0]){var o=this.map.getLayerBySymbolBak(n[0]);return o&&zj(zj({},o),{},{symbol:r,id:e})}}},{key:"removeLayer",value:function(e){var t=this,r=this.getLayerIds(e);r.length>0?(r.forEach(function(e){return t.map.style.removeLayer(e)}),this.removeLayerId(e)):this.map.style.removeLayer(e)}},{key:"getStyle",value:function(){var e=this,t=this.map.style.serialize();return this.hasSymbol()&&(t.layers=t.layers.reduce(function(t,r){var n=e.getLayerId(r.id);return n?!t.find(function(e){return e.id===n})&&t.push(zj(zj({},r),{},{symbol:e.getLayerSymbol(n),id:n})):e.getLayerSymbol(r.id)?t.push(zj(zj({},r),{},{symbol:e.getLayerSymbol(r.id)})):t.push(r),t},[])),t}},{key:"getFirstLayerId",value:function(e){return this.getLayerIds(e)[0]}},{key:"moveLayer",value:function(e,t){var r=this,n=this.getLayerIds(e),o=t&&this.map.style.getLayer(t),i=o&&o.id||t&&this.getFirstLayerId(t);n.length>0?n.forEach(function(e){return r.map.style.moveLayer(e,i)}):this.map.style.moveLayer(e,i)}},{key:"setFilter",value:function(e,t,r){var n=this;if(Rj(this.getLayerSymbol(e))){var o=this.getFirstLayerId(e);this.map.style.setFilter(o,t,r);var i=this.getLayerSymbol(e);this.setSymbol(e,i)}else{var a=this.getLayerIds(e);a.length>0?a.forEach(function(e){return n.map.style.setFilter(e,t,r)}):this.map.style.setFilter(e,t,r)}}},{key:"getFilter",value:function(e){var t=this.getFirstLayerId(e);if(this.map.style.getLayer(t))return this.map.style.getFilter(t)}},{key:"setLayerZoomRange",value:function(e,t,r){var n=this,o=this.getLayerIds(e);o.length>0?o.forEach(function(e){return n.map.style.setLayerZoomRange(e,t,r)}):this.map.style.setLayerZoomRange(e,t,r)}},{key:"setPaintProperty",value:function(e,t,r,n){var o=this,i=this.getLayerIds(e);i.length>0?i.forEach(function(e){return o.map.style.setPaintProperty(e,t,r,n)}):this.map.style.setPaintProperty(e,t,r,n)}},{key:"getPaintProperty",value:function(e,t){var r=this.getFirstLayerId(e);return this.map.style.getPaintProperty(r,t)}},{key:"setLayoutProperty",value:function(e,t,r,n){var o=this,i=this.getLayerIds(e);i.length>0?i.forEach(function(e){return o.map.style.setLayoutProperty(e,t,r,n)}):this.map.style.setLayoutProperty(e,t,r,n)}},{key:"getLayoutProperty",value:function(e,t){var r=this.getFirstLayerId(e);return this.map.style.getLayoutProperty(r,t)}},{key:"updateLayerSymbol",value:function(e){var t=this;Object.keys(this._layerSymbols).forEach(function(r){var n=t._layerSymbols[r];n.includes(e)&&t.setSymbol(r,n)})}},{key:"updateSymbol",value:function(e,t){return this.getSymbol(e)?Bj(t)?(this.symbolManager.addSymbol(e,t),void this.updateLayerSymbol(e)):this.map.fire("error",{error:new Error("Symbol is not supported expressions.")}):this.map.fire("error",{error:new Error('Symbol "'.concat(e,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}},{key:"setSymbolProperty",value:function(e,t,r,n){var o=this.getSymbol(e);if(!o)return this.map.fire("error",{error:new Error('Symbol "'.concat(e,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))});if(Rj(n))return this.map.fire("error",{error:new Error("Symbol value is not supported expressions.")});var i=Fj(r)?"paint":"layout";if(o.length>0){var a=o[t];if(!a)return this.map.fire("error",{error:new Error("symbol[".concat(t,"] does not exist."))});a[i]||(a[i]={}),Object.assign(a[i],Vj({},r,n))}else o[i]||(o[i]={}),Object.assign(o[i],Vj({},r,n));this.symbolManager.addSymbol(e,o),this.updateLayerSymbol(e)}},{key:"getSymbolProperty",value:function(e,t,r){var n=this.getSymbol(e);if(n){var o=Fj(r)?"paint":"layout";return n.length>0?n[t]&&n[t][o]&&n[t][o][r]:n[o]&&n[o][r]}this.map.fire("error",{error:new Error('Symbol "'.concat(e,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}}])&&qj(e.prototype,t),r&&qj(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function Jj(e){"@babel/helpers - typeof";return(Jj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kj(){Kj=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Jj(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Yj(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Qj(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Yj(i,n,o,a,s,"next",e)}function s(e){Yj(i,n,o,a,s,"throw",e)}a(void 0)})}}var Xj=function(){var e=function(e){return o().Map.prototype.symbolHandler||(o().Map.prototype.symbolHandler=new Wj(e)),o().Map.prototype.symbolHandler._update(e)};function t(){return(t=Qj(Kj().mark(function e(t,r){var n,o,i,a,s,u;return Kj().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n="".concat(r.basePath,"/").concat(t,"/").concat(t),e.next=4,z.get("".concat(n,".json")).then(function(e){return e.ok?e.json():null}).catch(function(){return null});case 4:if(o=e.sent){e.next=7;break}return e.abrupt("return",null);case 7:if(i=o.paint||{},a=o.layout||{},s=i["fill-pattern"]||i["line-pattern"]||a["icon-image"],e.t0=s,!e.t0){e.next=15;break}return e.next=14,new Promise(function(e){var t=new Image;t.src="".concat(n,".png"),t.onload=function(r){e(r?t:null)},t.onerror=function(){e(null)}});case 14:e.t0=e.sent;case 15:return u=e.t0,e.abrupt("return",{value:o,image:u});case 17:case"end":return e.stop()}},e)}))).apply(this,arguments)}function r(r,n){return function(e,r){return t.apply(this,arguments)}(r,n).then(function(t){if(!t)return null;var r=t.value,o=t.image;return o&&e(n).addSymbolImageToMap(r,o),r})}void 0===o().Map.prototype.addLayerBySymbolBak&&(o().Map.prototype.addLayerBySymbolBak=o().Map.prototype.addLayer,o().Map.prototype.addLayer=function(t,r){var n=e(this);if(!(n.getLayerIds(t.id).length>0))return t.symbol?(n.addLayer(t,r),this):(this.addLayerBySymbolBak(t,r),this);this.fire("error",{error:new Error("A layer with this id already exists.")})}),void 0===o().Map.prototype.getLayerBySymbolBak&&(o().Map.prototype.getLayerBySymbolBak=o().Map.prototype.getLayer,o().Map.prototype.getLayer=function(t){return e(this).getLayer(t)}),void 0===o().Map.prototype.moveLayerBySymbolBak&&(o().Map.prototype.moveLayerBySymbolBak=o().Map.prototype.moveLayer,o().Map.prototype.moveLayer=function(t,r){return!this.style.getLayer(t)||r&&!this.style.getLayer(r)?(e(this).moveLayer(t,r),this._update(!0)):this.moveLayerBySymbolBak(t,r)}),void 0===o().Map.prototype.removeLayerBySymbolBak&&(o().Map.prototype.removeLayerBySymbolBak=o().Map.prototype.removeLayer,o().Map.prototype.removeLayer=function(t){return this.style.getLayer(t)?this.removeLayerBySymbolBak(t):e(this).removeLayer(t)}),void 0===o().Map.prototype.setLayoutPropertyBySymbolBak&&(o().Map.prototype.setLayoutPropertyBySymbolBak=o().Map.prototype.setLayoutProperty,o().Map.prototype.setLayoutProperty=function(t,r,n,o){return this.overlayLayersManager[t]||this.style.getLayer(t)?this.setLayoutPropertyBySymbolBak(t,r,n,o):(e(this).setLayoutProperty(t,r,n,o),this._update(!0))}),o().Map.prototype.setSymbol=function(t,r){e(this).setSymbol(t,r)},o().Map.prototype.setStyleBak||(o().Map.prototype.setStyleBak=o().Map.prototype.setStyle,o().Map.prototype.setStyle=function(e,t){var r=this;return this.setStyleBak(e,t),this.style&&this.style.once("style.load",function(){e.layers.filter(function(e){return e.symbol}).forEach(function(e){r.setSymbol(e.id,e.symbol)})}),this}),o().Map.prototype.loadSymbol=(n=Qj(Kj().mark(function e(t,n){var o,i,a,s,u,l,c=this;return Kj().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=9;break}return e.next=3,r(t,this);case 3:o=e.sent,i=null,o||(i="Symbol ".concat(t," is not exists")),n(i,o),e.next=21;break;case 9:if(!L.isArray(t)){e.next=20;break}return a=t.map(function(e){return r(e,c)}),e.next=13,Promise.all(a);case 13:s=e.sent,u=null,(l=t.filter(function(e,t){return!s[t]})).length>0&&(u="Symbol ".concat(l.join(",")," is not exists")),n(u,s),e.next=21;break;case 20:n({message:"Symbol id must be a string or string[]."});case 21:case"end":return e.stop()}},e,this)})),function(e,t){return n.apply(this,arguments)}),o().Map.prototype.addSymbol=function(t,r){e(this).addSymbol(t,r)},o().Map.prototype.getSymbol=function(t){return e(this).getSymbol(t)},o().Map.prototype.hasSymbol=function(e){return e?!!this.getSymbol(e):(this.fire("error",{error:new Error("Missing required symbol id")}),!1)},o().Map.prototype.removeSymbol=function(t){e(this).removeSymbol(t)},o().Map.prototype.updateSymbol=function(t,r){e(this).updateSymbol(t,r)},o().Map.prototype.setSymbolProperty=function(t,r,n,o){e(this).setSymbolProperty(t,r,n,o)},o().Map.prototype.getSymbolProperty=function(t,r,n){return e(this).getSymbolProperty(t,r,n)},o().Map.prototype.getStyle=function(){if(this.style)return e(this).getStyle()},o().Map.prototype.setFilter=function(t,r,n){return this.style.getLayer(t)?(this.style.setFilter(t,r,n),this._update(!0)):(e(this).setFilter(t,r,n),this._update(!0))},o().Map.prototype.getFilter=function(t){return this.style.getLayer(t)?this.style.getFilter(t):e(this).getFilter(t)},o().Map.prototype.setLayerZoomRange=function(t,r,n){return this.style.getLayer(t)?(this.style.setLayerZoomRange(t,r,n),this._update(!0)):(e(this).setLayerZoomRange(t,r,n),this._update(!0))},o().Map.prototype.setPaintProperty=function(t,r,n,o){return this.style.getLayer(t)?(this.style.setPaintProperty(t,r,n,o),this._update(!0)):(e(this).setPaintProperty(t,r,n,o),this._update(!0))},o().Map.prototype.getPaintProperty=function(t,r){return this.style.getLayer(t)?this.style.getPaintProperty(t,r):e(this).getPaintProperty(t,r)},o().Map.prototype.getLayoutProperty=function(t,r){return this.style.getLayer(t)?this.style.getLayoutProperty(t,r):e(this).getLayoutProperty(t,r)},void 0===o().Map.prototype.onBak&&(o().Map.prototype.onBak=o().Map.prototype.on,o().Map.prototype.on=function(t,r,n){var o=this;return void 0===n||this.style.getLayer(r)?this.onBak(t,r,n):(e(this).getLayerIds(r).forEach(function(e){return o.onBak(t,e,n)}),this)}),void 0===o().Map.prototype.onceBak&&(o().Map.prototype.onceBak=o().Map.prototype.once,o().Map.prototype.once=function(t,r,n){var o=this;return void 0===n||this.style.getLayer(r)?this.onceBak(t,r,n):(e(this).getLayerIds(r).forEach(function(e){return o.onceBak(t,e,n)}),this)}),void 0===o().Map.prototype.offBak&&(o().Map.prototype.offBak=o().Map.prototype.off,o().Map.prototype.off=function(t,r,n){var o=this;return void 0===n||this.style.getLayer(r)?this.offBak(t,r,n):(e(this).getLayerIds(r).forEach(function(e){return o.offBak(t,e,n)}),this)});var n};function Zj(e){"@babel/helpers - typeof";return(Zj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $j(e,t){for(var r=0;r=0){var t=JSON.parse(e.data);return e.filterParam=t,e.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",e)}var r=JSON.parse(e.data);e.featureResult=r,e.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",e)}},{key:"_connect",value:function(e){return e=Aw.appendCredential(e),"WebSocket"in window?new WebSocket(e):"MozWebSocket"in window?new(0,window.MozWebSocket)(e):(console.log("no WebSocket"),null)}}])&&wC(r.prototype,n),o&&wC(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function kC(e){"@babel/helpers - typeof";return(kC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function EC(e,t){for(var r=0;r=0&&n.toIndex>=0&&!o&&(n.url=L.urlAppend(n.url,"fromIndex=".concat(n.fromIndex,"&toIndex=").concat(n.toIndex))),n.returnContent&&(e.returnCountOnly||e.returnDatasetInfoOnly||e.returnFeaturesOnly||console.warn("recommend set returnFeaturesOnly config to true to imporve performance. if need get Total amount and Dataset information. FeatureService provide getFeaturesCount and getFeaturesDatasetInfo method"),e.returnCountOnly&&(n.url=L.urlAppend(n.url,"returnCountOnly="+e.returnCountOnly)),e.returnDatasetInfoOnly&&(n.url=L.urlAppend(n.url,"returnDatasetInfoOnly="+e.returnDatasetInfoOnly)),e.returnFeaturesOnly&&(n.url=L.urlAppend(n.url,"returnFeaturesOnly="+e.returnFeaturesOnly))),r=n.getJsonParameters(e),n.request({method:"POST",data:r,scope:n,success:t,failure:t})}}},{key:"transformResult",value:function(e,t){e=L.transformResult(e);var r=new io;(this.format===on.GEOJSON&&e.features&&(e.features=r.toGeoJSON(e.features)),this.returnFeaturesOnly&&Array.isArray(e))&&(e={succeed:e.succeed,features:r.toGeoJSON(e)});return{result:e,options:t}}},{key:"dataFormat",value:function(){return[on.GEOJSON,on.ISERVER,on.FGB]}}])&&MA(r.prototype,n),o&&MA(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function zA(e){"@babel/helpers - typeof";return(zA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function VA(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}}}])&&XA(r.prototype,n),o&&XA(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function oI(e){"@babel/helpers - typeof";return(oI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function iI(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null}}])&&TI(r.prototype,n),o&&TI(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function RI(e){"@babel/helpers - typeof";return(RI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DI(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}e.geometry&&(e.geometry.destroy(),e.geometry=null)}}])&&HI(r.prototype,n),o&&HI(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function ZI(e){"@babel/helpers - typeof";return(ZI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $I(e,t){for(var r=0;r0;)e.fields.pop();e.fields=null}e.attributeFilter=null,e.spatialQueryMode=null,e.getFeatureMode=null,e.orderBy=null}}])&&sL(r.prototype,n),o&&sL(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function yL(e){"@babel/helpers - typeof";return(yL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function dL(e,t){for(var r=0;r0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.defaultStyle&&(e.defaultStyle.destroy(),e.defaultStyle=null)}},{key:"toServerJSONObject",value:function(){var e={};if((e=L.copyAttributes(e,this)).defaultStyle&&e.defaultStyle.toServerJSONObject&&(e.defaultStyle=e.defaultStyle.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,n=0;n0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.rangeExpression=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}}])&&fD(r.prototype,n),o&&fD(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function bD(e){"@babel/helpers - typeof";return(bD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gD(e,t){for(var r=0;r0?e[0].subLayers.layers:null)?r.length:0,this.handleLayers(n,r),{result:e[0],options:t}}},{key:"handleLayers",value:function(e,t){var r;if(e)for(var n=0;n0)this.handleLayers(t[n].subLayers.layers.length,t[n].subLayers.layers);else switch(t[n].ugcLayerType){case"THEME":(r=new $D).fromJson(t[n]),t[n]=r;break;case"GRID":(r=new fB).fromJson(t[n]),t[n]=r;break;case"IMAGE":(r=new gB).fromJson(t[n]),t[n]=r;break;case"VECTOR":(r=new EB).fromJson(t[n]),t[n]=r}}}}])&&TB(r.prototype,n),o&&TB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function RB(e){"@babel/helpers - typeof";return(RB="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function DB(e,t){for(var r=0;r0&&(n+='"subLayers":'+e.toJSON()),n+=',"visible":true,',n+='"name":"'+this.getMapName(this.mapUrl)+'"',n+="}]",r.request({method:"PUT",data:n,scope:r,success:t,failure:t})}}},{key:"createTempLayerComplete",value:function(e,t){return t=t.result?t.result:t,(t=L.transformResult(t)).succeed&&(this.lastparams.resourceID=t.newResourceID),this.processAsync(this.lastparams,e)}},{key:"getMapName",value:function(e){var t=e;"/"===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1));var r=t.lastIndexOf("/");return t.substring(r+1,t.length)}},{key:"transformResult",value:function(e,t){return null!=(e=L.transformResult(e))&&null!=this.lastparams&&null!=this.lastparams.resourceID&&(e.newResourceID=this.lastparams.resourceID),{result:e,options:t}}}])&&fF(r.prototype,n),o&&fF(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function bF(e){"@babel/helpers - typeof";return(bF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gF(e,t){for(var r=0;r=200&&e.code<300||0==e.code||304===e.code,n=e.code&&r;return!e.code||n?{result:e,options:t}:{error:e,options:t}}}])&&CF(r.prototype,n),o&&CF(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function DF(e){"@babel/helpers - typeof";return(DF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function BF(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[o].x+',"y":'+t[o].y+"}";else if(!0===e)for(var i=0;i0&&(r+=","),r+=t[i];return r+="]"}}])&&QU(r.prototype,n),o&&QU(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function nG(e){"@babel/helpers - typeof";return(nG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oG(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[o].x+',"y":'+t[o].y+"}";else if(!0===e)for(var i=0;i0&&(r+=","),r+=t[i];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.facilityPathList)return e;var t=new io;return e.facilityPathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}])&&qG(r.prototype,n),o&&qG(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function XG(e){"@babel/helpers - typeof";return(XG="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ZG(e,t){for(var r=0;r0&&(t+=","),t+=L.toJSON(e[n]);return t+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e)return null;var t=new io;return e.demandResults&&(e.demandResults=t.toGeoJSON(e.demandResults)),e.supplyResults&&(e.supplyResults=t.toGeoJSON(e.supplyResults)),e}}])&&rz(r.prototype,n),o&&rz(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function lz(e){"@babel/helpers - typeof";return(lz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cz(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[o].x+',"y":'+t[o].y+"}";else if(!0===e)for(var i=0;i0&&(r+=","),r+=t[i];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.pathList)return null;var t=new io;return e.pathList.map(function(e){return e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e}),e}}])&&yz(r.prototype,n),o&&yz(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Sz(e){"@babel/helpers - typeof";return(Sz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oz(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[o].x+',"y":'+t[o].y+"}";else if(!0===e)for(var i=0;i0&&(r+=","),r+=t[i];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.pathList||e.pathList.length<1)return null;var t=new io;return e.pathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}])&&kz(r.prototype,n),o&&kz(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Lz(e){"@babel/helpers - typeof";return(Lz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nz(e,t){for(var r=0;r0&&(r+=","),r+='{"x":'+t[o].x+',"y":'+t[o].y+"}";else if(!0===e)for(var i=0;i0&&(r+=","),r+=t[i];return r+="]"}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.serviceAreaList)return e;var t=new io;return e.serviceAreaList.map(function(e){return e.serviceRegion&&(e.serviceRegion=t.toGeoJSON(e.serviceRegion)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures)),e.routes&&(e.routes=t.toGeoJSON(e.routes)),e}),e}}])&&Bz(r.prototype,n),o&&Bz(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Hz(e){"@babel/helpers - typeof";return(Hz="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wz(e,t){for(var r=0;r0&&(t+=","),t+='{"x":'+o[r].x+',"y":'+o[r].y+"}";i+=t+="]"}else if(!0===e.isAnalyzeById){for(var a="[",s=e.nodes,u=s.length,l=0;l0&&(a+=","),a+=s[l];i+=a+="]"}return i}},{key:"toGeoJSONResult",value:function(e){if(!e||!e.tspPathList)return null;var t=new io;return e.tspPathList.forEach(function(e){e.route&&(e.route=t.toGeoJSON(e.route)),e.pathGuideItems&&(e.pathGuideItems=t.toGeoJSON(e.pathGuideItems)),e.edgeFeatures&&(e.edgeFeatures=t.toGeoJSON(e.edgeFeatures)),e.nodeFeatures&&(e.nodeFeatures=t.toGeoJSON(e.nodeFeatures))}),e}}])&&Qz(r.prototype,n),o&&Qz(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function nV(e){"@babel/helpers - typeof";return(nV="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oV(e,t){for(var r=0;r0)for(var t in e.items)e.items[t].destroy(),e.items[t]=null;e.items=null}e.numericPrecision=null,e.rangeMode=null,e.rangeCount=null,e.colorGradientType=null}}])&&GH(e.prototype,t),r&&GH(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function qH(e){"@babel/helpers - typeof";return(qH="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function HH(e,t){for(var r=0;r=0;e--)this.points[e].destroy();this.points=null}}}])&&o1(r.prototype,n),o&&o1(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function f1(e){"@babel/helpers - typeof";return(f1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p1(e,t){for(var r=0;r0&&(1===o.length?r+="'displayFilter':\""+o[0]+'",':r+="'displayFilter':\""+o[a]+'",'),(i=e.displayOrderBy)&&i.length>0&&(1===i.length?r+="'displayOrderBy':'"+i[0]+"',":r+="'displayOrderBy':'"+i[a]+"',"),(t=e.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+L.toJSON(t)+","),e.joinItems&&e.joinItems.length>0&&e.joinItems[a]&&(r+="'joinItems':["+L.toJSON(e.joinItems[a])+"],"),e.datasetNames&&e.dataSourceNames){var u=e.datasetNames[a]?a:e.datasetNames.length-1,l=e.dataSourceNames[a]?a:e.dataSourceNames.length-1;r+="'datasetInfo': {'name': '"+e.datasetNames[u]+"','dataSourceName': '"+e.dataSourceNames[l]+"'}},"}else r+="},"}e.themes&&e.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var c=this.url.split("/");return r+="'name': '"+c[c.length-2]+"'}]"}}])&&P2(r.prototype,n),o&&P2(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function I2(e){"@babel/helpers - typeof";return(I2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function L2(e,t){for(var r=0;r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function M3(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function R3(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){M3(i,n,o,a,s,"next",e)}function s(e){M3(i,n,o,a,s,"throw",e)}a(void 0)})}}function D3(e,t){for(var r=0;r0&&o.push(","),r=t[i].geometry,o.push(this.extractGeometry(r));return n&&o.push(")"),o.join("")}},{key:"extractGeometry",value:function(e){var t=e.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[t]?("collection"===t?"GEOMETRYCOLLECTION":t.toUpperCase())+"("+this.extract[t].apply(this,[e])+")":null}}])&&I5(r.prototype,n),o&&I5(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function B5(e){"@babel/helpers - typeof";return(B5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function F5(e,t){for(var r=0;r=0?t.speed:1,this.frequency=t.speed&&t.frequency>=0?t.frequency:1e3,this.startTime=t.startTime&&null!=t.startTime?t.startTime:0,this.endTime=t.endTime&&null!=t.endTime&&t.endTime>=r.startTime?t.endTime:+new Date,this.repeat=void 0===t.repeat||t.repeat,this.reverse=void 0!==t.reverse&&t.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],r.events=new Ea(this,null,this.EVENT_TYPES),r.speed=Number(r.speed),r.frequency=Number(r.frequency),r.startTime=Number(r.startTime),r.endTime=Number(r.endTime),r.startTime=Date.parse(new Date(r.startTime)),r.endTime=Date.parse(new Date(r.endTime)),r.currentTime=r.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"},(t=[{key:"updateOptions",value:function(e){var t=this;(e=e||{}).speed&&e.speed>=0&&(t.speed=e.speed,t.speed=Number(t.speed)),e.speed&&e.frequency>=0&&(t.frequency=e.frequency,t.frequency=Number(t.frequency)),e.startTime&&null!=e.startTime&&(t.startTime=e.startTime,t.startTime=Date.parse(new Date(t.startTime))),e.endTime&&null!=e.endTime&&e.endTime>=t.startTime&&(t.endTime=e.endTime,t.endTime=Date.parse(new Date(t.endTime))),null!=e.repeat&&(t.repeat=e.repeat),null!=e.reverse&&(t.reverse=e.reverse)}},{key:"start",value:function(){var e=this;e.running||(e.running=!0,e.tick(),e.events.triggerEvent("start",e.currentTime))}},{key:"pause",value:function(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}},{key:"stop",value:function(){var e=this;e.currentTime=e.startTime,e.running&&(e.running=!1),e.events.triggerEvent("stop",e.currentTime)}},{key:"toggle",value:function(){this.running?this.pause():this.start()}},{key:"setSpeed",value:function(e){return e>=0&&(this.speed=e,!0)}},{key:"getSpeed",value:function(){return this.speed}},{key:"setFrequency",value:function(e){return e>=0&&(this.frequency=e,!0)}},{key:"getFrequency",value:function(){return this.frequency}},{key:"setStartTime",value:function(e){var t=this;return!((e=Date.parse(new Date(e)))>t.endTime)&&(t.startTime=e,t.currentTime=t.endTime&&(t.currentTime=t.startTime,t.tick()),!0)}},{key:"getEndTime",value:function(){return this.endTime}},{key:"setCurrentTime",value:function(e){var t=this;return t.currentTime=Date.parse(new Date(t.currentTime)),e>=t.startTime&&e<=t.endTime&&(t.currentTime=e,t.startTime=t.currentTime,t.tick(),!0)}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"setRepeat",value:function(e){this.repeat=e}},{key:"getRepeat",value:function(){return this.repeat}},{key:"setReverse",value:function(e){this.reverse=e}},{key:"getReverse",value:function(){return this.reverse}},{key:"getRunning",value:function(){return this.running}},{key:"destroy",value:function(){var e=this;e.speed=null,e.frequency=null,e.startTime=null,e.endTime=null,e.currentTime=null,e.repeat=null,e.running=!1,e.reverse=null}},{key:"tick",value:function(){}}])&&F5(e.prototype,t),r&&F5(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function z5(e){"@babel/helpers - typeof";return(z5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function V5(e,t){for(var r=0;r=e.endTime&&(e.currentTime=e.endTime)}}}])&&V5(r.prototype,n),o&&V5(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Q5(e){"@babel/helpers - typeof";return(Q5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function X5(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials};return t=Aw.appendCredential(t),z.commit(e,t,r,n).then(function(e){return e.json()})}}])&&p4(e.prototype,t),r&&p4(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function d4(e){"@babel/helpers - typeof";return(d4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m4(e,t){for(var r=0;r0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.reverseColor=null,e.rangeMode=null,e.rangeParameter=null,e.colorGradientType=null}}])&&w9(r.prototype,n),o&&w9(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function E9(e){"@babel/helpers - typeof";return(E9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j9(e,t){for(var r=0;r0)for(var r in e.items)e.items[r].destroy(),e.items[r]=null;e.items=null}e.defaultcolor&&(e.defaultcolor.destroy(),e.defaultcolor=null)}},{key:"toServerJSONObject",value:function(){var e={};if((e=L.copyAttributes(e,this)).defaultcolor&&e.defaultcolor.toServerJSONObject&&(e.defaultcolor=e.defaultcolor.toServerJSONObject()),e.items){for(var t=[],r=e.items.length,n=0;n0&&(e=e.substring(0,e.length-1)),"{"+e+"}"}return null}}])&&q9(e.prototype,t),r&&q9(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function J9(e){"@babel/helpers - typeof";return(J9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function K9(e,t){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{};return t=Aw.appendCredential(t),n.crossOrigin=this.options.crossOrigin,n.headers=this.options.headers,z.commit(e,t,r,n).then(function(e){return e.json()})}}])&&Yee(e.prototype,t),r&&Yee(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function Zee(e){"@babel/helpers - typeof";return(Zee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $ee(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);rt.geoFence.radius&&(t.outOfGeoFence&&t.outOfGeoFence(e),t.events.triggerEvent("outOfGeoFence",{data:e})),r})}},{key:"_distance",value:function(e,t,r,n){return Math.sqrt((e-r)*(e-r)+(t-n)*(t-n))}},{key:"_getMeterPerMapUnit",value:function(e){var t;return"meter"===e?t=1:"degree"===e&&(t=2*Math.PI*6378137/360),t}}])&&jte(e.prototype,t),r&&jte(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),Ate=r(8518),Ite=r.n(Ate);function Lte(e){"@babel/helpers - typeof";return(Lte="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mte(e,t){for(var r=0;rl&&(u[o]=u[o].slice(n-l),l=n)}function d(e){var t,i,a,s;if(e instanceof Function)return e.call(c.parsers);if("string"==typeof e)t=r.charAt(n)===e?e:null,i=1,y();else{if(y(),!(t=e.exec(u[o])))return null;i=t[0].length}if(t){var f=n+=i;for(s=n+u[o].length-i;n=0&&"\n"!==n.charAt(a);a--)e.column++;return new Error([e.filename,e.line,e.column,e.message].join(";"))}return this.env=t=t||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},c={parse:function(i){var a,c=null;if(n=o=l=s=0,u=[],r=i.replace(/\r\n/g,"\n"),t.filename&&(f.env.inputs[t.filename]=r),u=function(e){for(var t,n,o,i,a=0,s=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,u=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,l=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,f=0,p=e[0],h=0;h0?"missing closing `}`":"missing opening `{`"}),e.map(function(e){return e.join("")})}([[]]),c)throw m(c);var p=function(e,t){var r=e.specificity,n=t.specificity;return r[0]!=n[0]?n[0]-r[0]:r[1]!=n[1]?n[1]-r[1]:r[2]!=n[2]?n[2]-r[2]:n[3]-r[3]};return(a=new e.Tree.Ruleset([],d(this.parsers.primary))).root=!0,a.toList=function(e){e.error=function(t){e.errors||(e.errors=new Error("")),e.errors.message?e.errors.message+="\n"+m(t).message:e.errors.message=m(t).message},e.frames=e.frames||[];var t=this.flatten([],[],e);return t.sort(p),t},a},parsers:{primary:function(){for(var e,t=[];(e=d(this.rule)||d(this.ruleset)||d(this.comment))||d(/^[\s\n]+/)||(e=d(this.invalid));)e&&t.push(e);return t},invalid:function(){var t=d(/^[^;\n]*[;\n]/);if(t)return new e.Tree.Invalid(t,a)},comment:function(){var t;if("/"===r.charAt(n))return"/"===r.charAt(n+1)?new e.Tree.Comment(d(/^\/\/.*/),!0):(t=d(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new e.Tree.Comment(t):void 0},entities:{quoted:function(){if('"'===r.charAt(n)||"'"===r.charAt(n)){var t=d(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return t?new e.Tree.Quoted(t[1]||t[2]):void 0}},field:function(){if(d("[")){var t=d(/(^[^\]]+)/);if(d("]"))return t?new e.Tree.Field(t[1]):void 0}},comparison:function(){var e=d(/^=~|=|!=|<=|>=|<|>/);if(e)return e},keyword:function(){var t=d(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(t)return new e.Tree.Keyword(t)},call:function(){var t,r;if(t=/^([\w\-]+|%)\(/.exec(u[o])){if("url"===(t=t[1]))return null;n+=t.length;if(d("("),r=d(this.entities.arguments),d(")"))return t?new e.Tree.Call(t,r,n):void 0}},arguments:function(){for(var e,t=[];e=d(this.expression);){t.push(e);if(!d(","))break}return t},literal:function(){return d(this.entities.dimension)||d(this.entities.keywordcolor)||d(this.entities.hexcolor)||d(this.entities.quoted)},url:function(){var t;if("u"===r.charAt(n)&&d(/^url\(/)){t=d(this.entities.quoted)||d(this.entities.variable)||d(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return d(")")?new e.Tree.URL(void 0!==t.value||t instanceof e.Tree.Variable?t:new e.Tree.Quoted(t)):new e.Tree.Invalid(t,a,"Missing closing ) in URL.")}},variable:function(){var o,i=n;if("@"===r.charAt(n)&&(o=d(/^@[\w-]+/)))return new e.Tree.Variable(o,i,t.filename)},hexcolor:function(){var t;if("#"===r.charAt(n)&&(t=d(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Tree.Color(t[1])},keywordcolor:function(){var t=u[o].match(/^[a-z]+/);if(t&&t[0]in e.Tree.Reference.data.colors)return new e.Tree.Color(e.Tree.Reference.data.colors[d(/^[a-z]+/)])},dimension:function(){var t=r.charCodeAt(n);if(!(t>57||t<45||47===t)){var o=d(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return o?new e.Tree.Dimension(o[1],o[2],a):void 0}}},variable:function(){var e;if("@"===r.charAt(n)&&(e=d(/^(@[\w-]+)\s*:/)))return e[1]},entity:function(){var e=d(this.entities.call)||d(this.entities.literal),t=d(this.entities.field)||d(this.entities.variable),r=d(this.entities.url)||d(this.entities.keyword);return e||t||r},end:function(){var e;return d(";")||("string"==typeof(e="}")?r.charAt(n)===e:!!e.test(u[o]))},element:function(){var t=d(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(t)return new e.Tree.Element(t)},attachment:function(){var e=d(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(e)return e[1]},selector:function(){for(var t,o,i,s,u,l=[],c=new e.Tree.Filterset,f=[],p=0,h=0;(i=d(this.element))||(u=d(this.zoom))||(s=d(this.filter))||(t=d(this.attachment));){if(p++,i)l.push(i);else if(u)f.push(u),h++;else if(s){var y=c.add(s);if(y)throw m({message:y,index:n-1});h++}else{if(o)throw m({message:"Encountered second attachment name.",index:n-1});o=t}var v=r.charAt(n);if("{"===v||"}"===v||";"===v||","===v)break}if(p)return new e.Tree.Selector(c,f,l,o,h,a)},filter:function(){p();var r,n,o;if(d("[")&&(r=d(/^[a-zA-Z0-9\-_]+/)||d(this.entities.quoted)||d(this.entities.variable)||d(this.entities.keyword)||d(this.entities.field))&&(r instanceof e.Tree.Quoted&&(r=new e.Tree.Field(r.toString())),(n=d(this.entities.comparison))&&(o=d(this.entities.quoted)||d(this.entities.variable)||d(this.entities.dimension)||d(this.entities.keyword)||d(this.entities.field)))){if(!d("]"))throw m({message:"Missing closing ] of filter.",index:a-1});return r.is||(r=new e.Tree.Field(r)),new e.Tree.Filter(r,n,o,a,t.filename)}},zoom:function(){p();var t,r;if(d(/^\[\s*zoom/g)&&(t=d(this.entities.comparison))&&(r=d(this.entities.variable)||d(this.entities.dimension))&&d("]"))return new e.Tree.Zoom(t,r,a);h()},block:function(){var e;if(d("{")&&(e=d(this.primary))&&d("}"))return e},ruleset:function(){var t,r,n=[];for(p();t=d(this.selector);){for(n.push(t);d(this.comment););if(!d(","))break;for(;d(this.comment););}if(t)for(;d(this.comment););if(n.length>0&&(r=d(this.block))){if(1===n.length&&n[0].elements.length&&"Map"===n[0].elements[0].value){var o=new e.Tree.Ruleset(n,r);return o.isMap=!0,o}return new e.Tree.Ruleset(n,r)}h()},rule:function(){var o,i,u=r.charAt(n);if(p(),"."!==u&&"#"!==u&&(o=d(this.variable)||d(this.property))){if((i=d(this.value))&&d(this.end))return new e.Tree.Rule(o,i,a,t.filename);s=n,h()}},font:function(){for(var t,r=[],n=[];t=d(this.entity);)n.push(t);if(r.push(new e.Tree.Expression(n)),d(","))for(;(t=d(this.expression))&&(r.push(t),d(",")););return new e.Tree.Value(r)},value:function(){for(var t,r=[];(t=d(this.expression))&&(r.push(t),d(",")););return r.length>1?new e.Tree.Value(r.map(function(e){return e.value[0]})):1===r.length?new e.Tree.Value(r):void 0},sub:function(){var e;if(d("(")&&(e=d(this.expression))&&d(")"))return e},multiplication:function(){var t,r,n,o;if(t=d(this.operand)){for(;(n=d("/")||d("*")||d("%"))&&(r=d(this.operand));)o=new e.Tree.Operation(n,[o||t,r],a);return o||t}},addition:function(){var t,o,i,s;if(t=d(this.multiplication)){for(;(i=d(/^[-+]\s+/)||" "!=r.charAt(n-1)&&(d("+")||d("-")))&&(o=d(this.multiplication));)s=new e.Tree.Operation(i,[s||t,o],a);return s||t}},operand:function(){return d(this.sub)||d(this.entity)},expression:function(){for(var t,r=[];t=d(this.addition)||d(this.entity);)r.push(t);if(r.length>0)return new e.Tree.Expression(r)},property:function(){var e=d(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(e)return e[1]}}}}},{key:"parse",value:function(e){var t=this.parser;return this.ruleSet=t.parse(e)}},{key:"toShaders",value:function(){if(this.ruleSet){var e=this.ruleSet;if(e){var t=e.toList(this.env);t.reverse();var r={},n=[];this._toShaders(r,n,t);for(var o=[],i={},a=0,s=t.length;a=0){if(!t.featureFilter){var i=o+n.length,a=r.indexOf(")",i+1),s="featureId&&(featureId"+r.substring(i,a)+")";Object.defineProperty(t,"featureFilter",{configurable:!0,enumerable:!1,value:function(e){return!!s}})}return{property:h,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+r+";} return _value; ")}}return{property:h,getValue:Function("attributes","zoom","var _value = null;"+r+"; return _value; ")}}(c[h],f);Object.defineProperty(f,"attachment",{configurable:!0,enumerable:!1,value:l}),Object.defineProperty(f,"elements",{configurable:!0,enumerable:!1,value:u.elements}),o.push(f),i[n[a]]=!0}Object.defineProperty(f,"zoom",{configurable:!0,enumerable:!1,value:u.zoom})}return o}}return null}},{key:"_toShaders",value:function(t,r,n){for(var o=0,i=n.length;o= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};function Ute(e){"@babel/helpers - typeof";return(Ute="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gte(e,t){for(var r=0;r1&&(t=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:e,color:t,mode:r,toString:function(n){return'\n\t"}}},hsl:function(e,t,r){return this.hsla(e,t,r,1)},hsla:function(e,t,r,n){if([e=this.number(e)%360/360,t=this.number(t),r=this.number(r),n=this.number(n)].some(isNaN))return null;var o=r<=.5?r*(t+1):r+t-r*t,i=2*r-o;return this.rgba(255*a(e+1/3),255*a(e),255*a(e-1/3),n);function a(e){return 6*(e=e<0?e+1:e>1?e-1:e)<1?i+(o-i)*e*6:2*e<1?o:3*e<2?i+(o-i)*(2/3-e)*6:i}},hue:function(e){return"toHSL"in e?new Bte.Tree.Dimension(Math.round(e.toHSL().h)):null},saturation:function(e){return"toHSL"in e?new Bte.Tree.Dimension(Math.round(100*e.toHSL().s),"%"):null},lightness:function(e){return"toHSL"in e?new Bte.Tree.Dimension(Math.round(100*e.toHSL().l),"%"):null},alpha:function(e){return"toHSL"in e?new Bte.Tree.Dimension(e.toHSL().a):null},saturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s+=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.s-=t.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l+=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.l-=t.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a+=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL();return r.a-=t.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(e,t){if(!("toHSL"in e))return null;var r=e.toHSL(),n=(r.h+t.value)%360;return r.h=n<0?360+n:n,this.hsla_simple(r)},replace:function(e,t,r){return"field"===e.is?e.toString+".replace("+t.toString()+", "+r.toString()+")":e.replace(t,r)},mix:function(e,t,r){var n=r.value/100,o=2*n-1,i=e.toHSL().a-t.toHSL().a,a=((o*i==-1?o:(o+i)/(1+o*i))+1)/2,s=1-a,u=[e.rgb[0]*a+t.rgb[0]*s,e.rgb[1]*a+t.rgb[1]*s,e.rgb[2]*a+t.rgb[2]*s],l=e.alpha*n+t.alpha*(1-n);return new Bte.Tree.Color(u,l)},greyscale:function(e){return this.desaturate(e,new Bte.Tree.Dimension(100))},"%":function(e){for(var t=Array.prototype.slice.call(arguments,1),r=e.value,n=0;n.5?l/(2-a-s):l/(a+s),a){case r:e=(n-o)/l+(n=0){if(!e.ppi)return e.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*e.ppi,this.unit="px"}return this}},{key:"toColor",value:function(){return new Bte.Tree.Color([this.value,this.value,this.value])}},{key:"round",value:function(){return this.value=Math.round(this.value),this}},{key:"toString",value:function(){return this.value.toString()}},{key:"operate",value:function(e,t,r){return"%"===this.unit&&"%"!==r.unit?(e.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.unit?"*"===t||"/"===t||"%"===t?(e.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new Bte.Tree.Dimension(Bte.Tree.operate(t,this.value,this.value*r.value*.01),this.unit):new Bte.Tree.Dimension(Bte.Tree.operate(t,this.value,r.value),this.unit||r.unit)}}])}(),Bte.Tree.Element=function(){return Rte(function e(t){Nte(this,e),this.value=t.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")},[{key:"specificity",value:function(){return["id"===this.type?1:0,"class"===this.type?1:0]}},{key:"toString",value:function(){return this.value}}])}(),Bte.Tree.Expression=function(){return Rte(function e(t){Nte(this,e),this.is="expression",this.value=t},[{key:"ev",value:function(e){return this.value.length>1?new Bte.Tree.Expression(this.value.map(function(t){return t.ev(e)})):this.value[0].ev(e)}},{key:"toString",value:function(e){return this.value.map(function(t){return t.toString(e)}).join(" ")}}])}(),Bte.Tree.Field=function(){return Rte(function e(t){Nte(this,e),this.is="field",this.value=t||""},[{key:"toString",value:function(){return'["'+this.value.toUpperCase()+'"]'}},{key:"ev",value:function(){return this}}])}(),Bte.Tree.Filter=function(){return Rte(function e(t,r,n,o,i){Nte(this,e),this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=t,this.op=r,this.val=n,this.index=o,this.filename=i,this.id=this.key+this.op+this.val},[{key:"ev",value:function(e){return this.key=this.key.ev(e),this.val=this.val.ev(e),this}},{key:"toString",value:function(){return"["+this.id+"]"}}])}(),Bte.Tree.Filterset=function(){return Rte(function e(){Nte(this,e),this.filters={}},[{key:"toJS",value:function(e){function t(e){var t=e.op;"="===t&&(t="==");var r=e.val;void 0!==e._val&&(r=e._val.toString(!0)),e.key&&"scale"===e.key.value?r=+r:"string"!=typeof r&&"object"!==Lte(r)||(r="'"+r+"'");var n="attributes";return n+"&&"+n+e.key+"&&"+n+e.key+" "+t+r}var r=[];for(var n in this.filters)r.push(t(this.filters[n]));return r.join(" && ")}},{key:"toString",value:function(){var e=[];for(var t in this.filters)e.push(this.filters[t].id);return e.sort().join("\t")}},{key:"ev",value:function(e){for(var t in this.filters)this.filters[t].ev(e);return this}},{key:"clone",value:function(){var e=new Bte.Tree.Filterset;for(var t in this.filters)e.filters[t]=this.filters[t];return e}},{key:"cloneWith",value:function(e){var t=[];for(var r in e.filters){var n=this.addable(e.filters[r]);if(!1===n)return!1;!0===n&&t.push(e.filters[r])}if(!t.length)return null;var o=new Bte.Tree.Filterset;for(r in this.filters)o.filters[r]=this.filters[r];for(;r=t.shift();)o.add(r);return o}},{key:"addable",value:function(e){var t=e.key.toString(),r=e.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),e.op){case"=":return void 0!==this.filters[t+"="]?this.filters[t+"="].val.toString()==r&&null:void 0===this.filters[t+"!="+r]&&(!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val"]&&this.filters[t+">"].val>=r?null:void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val":return t+"="in this.filters?!(this.filters[t+"="].val<=r)&&null:!(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r)&&(!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)&&(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)||null));case">=":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val"]&&this.filters[t+">"].val>=r?null:!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)||null));case"<":return void 0!==this.filters[t+"="]?!(this.filters[t+"="].val>=r)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>=r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].valr)&&null:!(void 0!==this.filters[t+">"]&&this.filters[t+">"].val>=r)&&(!(void 0!==this.filters[t+">="]&&this.filters[t+">="].val>r)&&(void 0!==this.filters[t+"<"]&&this.filters[t+"<"].val<=r?null:!(void 0!==this.filters[t+"<="]&&this.filters[t+"<="].val<=r)||null))}}},{key:"conflict",value:function(e){var t=e.key.toString(),r=e.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===e.op&&void 0!==this.filters[t+"="]&&r!=this.filters[t+"="].val.toString()||"!="===e.op&&void 0!==this.filters[t+"="]&&r==this.filters[t+"="].val.toString()||"="===e.op&&void 0!==this.filters[t+"!="]&&r===this.filters[t+"!="].val.toString())&&e.toString()+" added to "+this.toString()+" produces an invalid filter"}},{key:"add",value:function(e,t){var r,n=e.key.toString(),o=e.op,i=this.conflict(e);if(i)return i;if("="===o){for(var a in this.filters)this.filters[a].key===n&&delete this.filters[a];this.filters[n+"="]=e}else if("!="===o)this.filters[n+"!="+e.val]=e;else if("=~"===o)this.filters[n+"=~"+e.val]=e;else if(">"===o){for(var s in this.filters)this.filters[s].key===n&&this.filters[s].val<=e.val&&delete this.filters[s];this.filters[n+">"]=e}else if(">="===o){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===n&&r",this.filters[n+">"]=e):this.filters[n+">="]=e}else if("<"===o){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===n&&r>=e.val&&delete this.filters[l];this.filters[n+"<"]=e}else if("<="===o){for(var c in this.filters)r=+this.filters[c].val.toString(),this.filters[c].key===n&&r>e.val&&delete this.filters[c];void 0!==this.filters[n+"!="+e.val]?(delete this.filters[n+"!="+e.val],e.op="<",this.filters[n+"<"]=e):this.filters[n+"<="]=e}}}])}(),Bte.Tree.Fontset=Rte(function e(t,r){Nte(this,e),this.fonts=r,this.name="fontset-"+t.effects.length}),Bte.Tree.Invalid=function(){return Rte(function e(t,r,n){Nte(this,e),this.is="invalid",this.chunk=t,this.index=r,this.type="syntax",this.message=n||"Invalid code: "+this.chunk},[{key:"ev",value:function(e){return e.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}}])}(),Bte.Tree.Keyword=function(){return Rte(function e(t){Nte(this,e),this.value=t;var r={transparent:"color",true:"boolean",false:"boolean"};this.is=r[t]?r[t]:"keyword"},[{key:"ev",value:function(){return this}},{key:"toString",value:function(){return this.value}}])}(),Bte.Tree.Literal=function(){return Rte(function e(t){Nte(this,e),this.value=t||"",this.is="field"},[{key:"toString",value:function(){return this.value}},{key:"ev",value:function(){return this}}])}(),Bte.Tree.Operation=function(){return Rte(function e(t,r,n){Nte(this,e),this.is="operation",this.op=t.trim(),this.operands=r,this.index=n},[{key:"ev",value:function(e){var t,r=this.operands[0].ev(e),n=this.operands[1].ev(e);return"undefined"===r.is||"undefined"===n.is?{is:"undefined",value:"undefined"}:(r instanceof Bte.Tree.Dimension&&n instanceof Bte.Tree.Color&&("*"===this.op||"+"===this.op?(t=n,n=r,r=t):e.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof Bte.Tree.Quoted&&n instanceof Bte.Tree.Quoted&&"+"!==this.op?(e.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r instanceof Bte.Tree.Field||n instanceof Bte.Tree.Field||r instanceof Bte.Tree.Literal||n instanceof Bte.Tree.Literal?"color"===r.is||"color"===n.is?(e.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new Bte.Tree.Literal(r.ev(e).toString(!0)+this.op+n.ev(e).toString(!0)):void 0===r.operate?(e.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(e,this.op,n))}}])}(),Bte.Tree.Quoted=function(){return Rte(function e(t){Nte(this,e),this.is="string",this.value=t||""},[{key:"toString",value:function(e){var t=this.value.replace(/&/g,"&"),r=t.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===e?"'"+r+"'":t}},{key:"ev",value:function(){return this}},{key:"operate",value:function(e,t,r){return new Bte.Tree.Quoted(Bte.Tree.operate(t,this.toString(),r.toString(this.contains_field)))}}])}(),Bte.Tree.Reference={_validateValue:{font:function(e,t){return!e.validation_data||!e.validation_data.fonts||-1!=e.validation_data.fonts.indexOf(t)}},setData:function(e){this.data=e,this.selector_cache=function(e){var t={};for(var r in e.symbolizers)for(var n in e.symbolizers[r])e.symbolizers[r][n].hasOwnProperty("css")&&(t[e.symbolizers[r][n].css]=[e.symbolizers[r][n],r,n]);return t}(e),this.mapnikFunctions=function(e){var t={};for(var r in e.symbolizers)for(var n in e.symbolizers[r])if("functions"===e.symbolizers[r][n].type)for(var o=0;o1?Array.prototype.push.apply(r,n.find(new Bte.Tree.Selector(null,null,e.elements.slice(1)),t)):r.push(n);break}}),this._lookups[n]=r)}},{key:"evZooms",value:function(e){for(var t=0;tBte.Tree.Zoom.maxZoom||t<0)&&e.error({message:"Only zoom levels between 0 and "+Bte.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+t,this;case">":this.zoom="zoom && zoom > "+t;break;case">=":this.zoom="zoom && zoom >= "+t;break;case"<":this.zoom="zoom && zoom < "+t;break;case"<=":this.zoom="zoom && zoom <= "+t}return this}},{key:"toString",value:function(){for(var e="",t=0;t<=Bte.Tree.Zoom.maxZoom;t++)e+=this.zoom&1<=l[2]||l[1]<=l[3])&&(this.DVBOrigonPoint=[l[0],l[3]],this.DVBWidth=Math.abs(l[2]-l[0]),this.DVBHeight=Math.abs(l[1]-l[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}},{key:"resetLocation",value:function(e){e&&(this.lonlat=e);var t=this.getLocalXY(this.lonlat);t[0]+=this.XOffset,t[1]+=this.YOffset,this.location=t;var r=this.width,n=this.height,o=this.location;return this.chartBounds=new Ye(o[0]-r/2,o[1]+n/2,o[0]+r/2,o[1]-n/2),this.resetLinearGradient(),o}},{key:"resetLinearGradient",value:function(){}},{key:"shapesConvertToRelativeCoordinate",value:function(){for(var e=this.shapes,t=this.location,r=0,n=e.length;r=0?n.push(parseFloat(o[a].toString()).toFixed(r)):n.push(parseFloat(o[a].toString()))}catch(e){throw new Error("not a number")}return n.length===t.length&&n};var ire=function(e){function t(e,r,n,o,i){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(a=tre(this,t,[e,r,n,o,i])).CLASS_NAME="SuperMap.Feature.Theme.Bar",a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ore(e,t)}(t,Xte),r=t,(n=[{key:"destroy",value:function(){rre(nre(t.prototype),"destroy",this).call(this)}},{key:"assembleShapes",value:function(){var e={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},t=this.setting;if(t.barLinearGradient||(t.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var n=this.dataViewBox,o=this.dataValues;if(!(o.length<1)){for(var i=0,a=o.length;ir[1])return;var s=this.calculateXShapeInfo();if(s){var u=s.xPositions,l=s.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Sc.Background(this.shapeFactory,this.chartBox,t)),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(Sc.GraphAxis(this.shapeFactory,n,t,s)));for(var c=0;c=t.length&&(r%=t.length);var u=t[r][0],l=t[r][1],c=(new pi).getLinearGradient(a,0,s,0,[[0,u],[1,l]]);o.style.color=c}}}}])&&$te(r.prototype,n),o&&$te(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function are(e){"@babel/helpers - typeof";return(are="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sre(e,t){for(var r=0;rt[1])return;var a=this.calculateXShapeInfo();if(a){var s=a.xPositions,u=a.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(Sc.Background(this.shapeFactory,this.chartBox,e)),(!e.axis3DParameter||isNaN(e.axis3DParameter)||e.axis3DParameter<15)&&(e.axis3DParameter=20),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(Sc.GraphAxis(this.shapeFactory,r,e,a)));for(var l=e.bar3DParameter&&!isNaN(e.bar3DParameter)?e.bar3DParameter:10,c=0;c=s[2]||s[1]<=s[3])&&(this.DVBOrigonPoint=[s[0],s[3]],this.DVBWidth=Math.abs(s[2]-s[0]),this.DVBHeight=Math.abs(s[1]-s[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-o[0],this.DVBOrigonPoint[1]-o[1]],!0)}}])&&dre(r.prototype,n),o&&dre(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Ore(e){"@babel/helpers - typeof";return(Ore="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _re(e,t){for(var r=0;r0?this.DVBUnitValue=e.maxR/(o[1]-o[0]):this.DVBUnitValue=e.maxR;var i=this.DVBUnitValue,a=n[0]*i+e.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!o||!(n[0]o[1]))){var s=this.DVBCenterPoint,u=new dl(s[0],s[1],a);u.style=Sc.ShapeStyleTool(null,e.circleStyle,null,null,0),void 0!==e.fillColor?u.style.fillColor=e.fillColor:u.style.fillColor="#ff9277",u.highlightStyle=Sc.ShapeStyleTool(null,e.circleHoverStyle),void 0!==e.circleHoverAble&&(u.hoverable=e.circleHoverAble),void 0!==e.circleClickAble&&(u.clickable=e.circleClickAble),u.refDataID=this.data.id,u.dataInfo={field:this.fields[0],r:a,value:n[0]},this.shapes.push(this.shapeFactory.createShape(u)),this.shapesConvertToRelativeCoordinate()}}}])&&_re(r.prototype,n),o&&_re(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Cre(e){"@babel/helpers - typeof";return(Cre="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Are(e,t){for(var r=0;rr[1])return null;a=u[f],s=t[1]-(o[f]-r[0])/n;var h=new hu(a,s);h.style=Sc.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,f,o[f]),h.highlightStyle=Sc.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(h.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(h.clickable=e.pointClickAble),h.refDataID=this.data.id,h.dataInfo={field:this.fields[f],value:o[f]},c.push(this.shapeFactory.createShape(h));var y=[a,s];l.push(y)}var d=new Su(l);d.style=Sc.ShapeStyleTool({strokeColor:"#ee9900"},e.lineStyle),d.clickable=!1,d.hoverable=!1;var m=this.shapeFactory.createShape(d);this.shapes.push(m),this.shapes=this.shapes.concat(c),this.shapesConvertToRelativeCoordinate()}}}}},{key:"calculateXShapeInfo",value:function(){var e,t=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var o=[],i=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=i-((e=r.xShapeBlank)[0]+e[1]);if(s<=n)return null;a=s/(n-1)}else e=[a=i/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var i=0,a=0;a=360&&(c=359.9999999);var d=new Hu(u[0],u[1],p,l,c);if(void 0===e.sectorStyleByFields){var m=h%t.length;d.style=Sc.ShapeStyleTool(null,e.sectorStyle,t,null,m)}else d.style=Sc.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,h,r[h]);d.highlightStyle=Sc.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(d.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(d.clickable=e.sectorClickAble),d.refDataID=this.data.id,d.dataInfo={field:this.fields[h],value:r[h]},this.shapes.push(this.shapeFactory.createShape(d)),l=c}this.shapesConvertToRelativeCoordinate()}}}}])&&Fre(r.prototype,n),o&&Fre(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Wre(e){"@babel/helpers - typeof";return(Wre="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jre(e,t){for(var r=0;rr[1])return null;a=u[l],s=t[1]-(o[l]-r[0])/n;var f=new hu(a,s);f.style=Sc.ShapeStyleTool({fillColor:"#ee9900"},e.pointStyle,e.pointStyleByFields,e.pointStyleByCodomain,l,o[l]),f.highlightStyle=Sc.ShapeStyleTool(null,e.pointHoverStyle),void 0!==e.pointHoverAble&&(f.hoverable=e.pointHoverAble),void 0!==e.pointClickAble&&(f.clickable=e.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[l],value:o[l]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}},{key:"calculateXShapeInfo",value:function(){var e,t=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var o=[],i=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=i-((e=r.xShapeBlank)[0]+e[1]);if(s<=n)return null;a=s/(n-1)}else e=[a=i/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var i=0,a=0;a=0&&t.innerRingRadius1&&void 0!==arguments[1]?arguments[1]:"warring";"success"===t?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===t?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===t&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=e,this.messageBoxContainer.hidden=!1}}])&&hne(e.prototype,t),r&&hne(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}(),mne=function(){try{return echarts}catch(e){return{}}}(),vne={"en-US":{title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure!",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},"zh-CN":{title_dataFlowService:"数据流服务",title_distributedAnalysis:"分布式分析",title_clientComputing:"客户端计算",title_dataServiceQuery:"数据服务查询",title_searchCity:"搜索城市",title_searchLayer:"搜索图层",text_input_value_inputDataFlowUrl:"请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"显示要素信息",text_subscribe:"订阅",text_cancelSubscribe:"取消订阅",text_densityAnalysis:"密度分析",text_CalculateTheValuePerUnitArea:"计算点指定邻域形状内的每单位面积量值",text_option_selectDataset:"请选择数据集",text_label_dataset:"数据集",text_option_simplePointDensityAnalysis:"简单点密度分析",text_option_nuclearDensityAnalysis:"核密度分析",text_label_analyticalMethod:"分析方法",text_option_quadrilateral:"四边形",text_option_hexagon:"六边形",text_label_meshType:"网格面类型",text_option_notSet:"未设置",text_label_weightField:"权重字段",text_label_gridSizeInMeters:"网格大小",text_label_searchRadius:"搜索半径",text_label_queryRange:"分析范围",text_label_areaUnit:"面积单位",text_option_equidistantSegmentation:"等距离分段",text_option_logarithm:"对数",text_option_equalCountingSegment:"等计数分段",text_option_squareRootSegmentation:"平方根分段",text_label_thematicMapSegmentationMode:"专题图分段模式",text_label_thematicMapSegmentationParameters:"专题图分段参数",text_option_greenOrangePurpleGradient:"绿橙紫渐变",text_option_greenOrangeRedGradient:"绿橙红渐变",text_option_rainbowGradient:"彩虹渐变",text_option_spectralGradient:"光谱渐变",text_option_terrainGradient:"地形渐变",text_label_thematicMapColorGradientMode:"专题图颜色渐变模式",text_label_resultLayerName:"结果图层名称",text_chooseFile:"选择文件",text_isoline:"等值线",text_extractDiscreteValue:"提取离散值生成曲线",text_buffer:"缓冲区",text_specifyTheDistance:"指定距离创建周边区域",text_label_analysisLayer:"分析图层",text_label_extractField:"提取字段",text_label_extractedValue:"提取值",text_label_distanceAttenuation:"距离衰减",text_label_gridSize:"栅格大小",text_label_bufferRadius:"缓冲半径",text_label_defaultkilometers:"默认10千米",text_option_kilometer:"千米",text_label_unit:"单位",text_retainOriginal:"保留原对象字段属性",text_mergeBuffer:"合并缓冲区",text_label_color:"颜色",text_label_buffer:"[缓冲区]",text_label_isolines:"[等值线]",text_label_queryRangeTips:"默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"要素 ID 数组",text_label_maxFeatures:"最多可返回的要素数量",text_label_bufferDistance:"缓冲区距离",text_label_queryRange1:"查询范围",text_label_spatialQueryMode:"空间查询模式",text_label_featureFilter:"要素过滤器",text_label_geometricObject:"几何对象",text_label_queryMode:"查询模式",text_label_searchTips:"搜索城市地点或图层要素",text_label_chooseSearchLayers:"选择查询图层",text_loadSearchCriteria:"加载搜索条件",text_saveSearchCriteria:"保存搜索条件",btn_analyze:"分析",btn_analyzing:"分析中",btn_emptyTheAnalysisLayer:"清空分析图层",btn_cancelAnalysis:"取消",btn_query:"查询",btn_querying:"查询中",btn_emptyTheRresultLayer:"清除所有结果图层",msg_dataFlowServiceHasBeenSubscribed:"已订阅该数据流服务。",msg_inputDataFlowUrlFirst:"请先输入数据流服务地址。",msg_datasetOrMethodUnsupport:"该数据集不支持本分析类型,请重新选择数据集",msg_selectDataset:"请选择数据集!",msg_setTheWeightField:"请设置权重字段!",msg_theFieldNotSupportAnalysis:"您当前选择的字段不支持分析!",msg_resultIsEmpty:"分析的结果为空!",msg_dataReturnedIsEmpty:"请求成功,查询返回的数据为空。",msg_openFileFail:"打开文件失败!",msg_fileTypeUnsupported:"不支持该文件格式!",msg_fileSizeExceeded:"文件大小超限!文件大小不得超过 10M!",msg_dataInWrongGeoJSONFormat:"数据格式错误!非标准的 GEOJSON 格式数据!",msg_dataInWrongFormat:"数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!",msg_searchKeywords:"搜索关键字不能为空,请输入搜索条件。",msg_searchGeocodeField:"未匹配到地址匹配服务数据!",msg_cityGeocodeField:"未配置当前城市的地址匹配服务。",msg_getFeatureField:"未查找到相关矢量要素!",msg_dataflowservicesubscribed:"已订阅该数据流服务。",msg_subscribesucceeded:"数据流服务订阅成功。",msg_crsunsupport:"不支持当前地图的坐标系",msg_tilematrixsetunsupport:"不支持传入的TileMatrixSet",msg_jsonResolveFiled:"json格式解析失败!",msg_requestContentFiled:"通过iportal请求数据失败!",msg_getdatafailed:"获取数据失败!"},code:null,defaultCode:"en-US",getCode:function(){return vne.code||vne.setCode(),vne.code},setCode:function(){var e=this.getLanguageFromCookie();e||(e=vne.defaultCode,e="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===e.indexOf("zh")&&(e="zh-CN"),0===e.indexOf("en")&&(e="en-US"),vne.code=e},getLanguageFromCookie:function(){for(var e=document.cookie.split(";"),t=0;t0){var a=i.SheetNames[0],s=bne.utils.sheet_to_csv(i.Sheets[a]);t&&t.call(n,s)}}catch(e){r&&r.call(n,e)}},o.onerror=function(e){r&&r.call(n,e)},this.rABF&&o.readAsArrayBuffer(e.file)},processDataToGeoJson:function(e,t,r,n,o){var i=null;if("EXCEL"===e||"CSV"===e)i=this.processExcelDataToGeoJson(t),r&&r.call(o,i);else if("JSON"===e||"GEOJSON"===e){var a=t;"string"==typeof a&&(a=JSON.parse(a)),"ISERVER"===a.type?i=a.data.recordsets[0].features:"FeatureCollection"===a.type?i=a:n&&n.call(o,vne.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(o,i)}else n&&n.call(o,vne.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson:function(e){for(var t=this.string2Csv(e),r=t.colTitles,n=-1,o=-1,i=0,a=r.length;i0?(n.dataItemServices.forEach(function(n){if("RESTDATA"===n.serviceType&&"PUBLISHED"===n.serviceStatus)o=n;else{if("RESTMAP"!==n.serviceType||"PUBLISHED"!==n.serviceStatus)return void r.getDatafromContent(e,t);o=n}}),o&&r.getDatafromRest(o.serviceType,o.address,t)):r.getDatafromContent(e,t):r._fireFailedEvent(n)}).catch(function(e){console.log(e),r._fireFailedEvent(e)})}},{key:"getDatafromContent",value:function(e,t){var r=this,n={result:{}},o=this;e+="/content.json?pageSize=9999999¤tPage=1",z.get(e,null,{withCredentials:this.datasets.withCredentials}).then(function(e){return e.json()}).then(function(e){if(!1!==e.succeed){if(e.type){if("JSON"===e.type||"GEOJSON"===e.type){if(e.content=JSON.parse(e.content.trim()),!e.content.features)return void console.log(vne.i18n("msg_jsonResolveFiled"));var i=r._formatGeoJSON(e.content);n.result.features={type:e.content.type,features:i}}else if("EXCEL"===e.type||"CSV"===e.type){var a=r._excelData2Feature(e.content);n.result.features={type:"FeatureCollection",features:a}}t(n,"content")}}else o._fireFailedEvent(e)},this).catch(function(e){console.log(e),o._fireFailedEvent(e)})}},{key:"getDatafromRest",value:function(e,t,r){var n=this,o=this.datasets.withCredentials;if("RESTDATA"===e){var i,a,s="".concat(t,"/data/datasources");z.get(s,null,{withCredentials:o}).then(function(e){return e.json()}).then(function(e){i=e.datasourceNames[0],s="".concat(t,"/data/datasources/").concat(i,"/datasets"),z.get(s,null,{withCredentials:o}).then(function(e){return e.json()}).then(function(e){return a=e.datasetNames[0],n.getDatafromRestData("".concat(t,"/data"),[i+":"+a],r),[i+":"+a]}).catch(function(e){n._fireFailedEvent(e)})}).catch(function(e){n._fireFailedEvent(e)})}else{var u,l,c,f="".concat(t,"/maps");z.get(f,null,{withCredentials:o}).then(function(e){return e.json()}).then(function(e){u=e[0].name,c=e[0].path,f=f="".concat(t,"/maps/").concat(u,"/layers"),z.get(f,null,{withCredentials:o}).then(function(e){return e.json()}).then(function(e){return l=e[0].subLayers.layers[0].caption,n.getDatafromRestMap(l,c,r),l}).catch(function(e){n._fireFailedEvent(e)})}).catch(function(e){n._fireFailedEvent(e)})}}},{key:"getDatafromRestData",value:function(e,t,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(e,t,this.datasets.queryInfo,function(e){r(e,"RESTDATA")},function(e){console.log(e),n._fireFailedEvent(e)})}},{key:"getDatafromRestMap",value:function(e,t,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(t,e,this.datasets.queryInfo,null,null,function(e){r(e,"RESTMAP")},function(e){console.log(e),n._fireFailedEvent(e)})}},{key:"_getFeatureBySQL",value:function(e,t,r,n,o){var i,a,s={name:t.join().replace(":","@")};Object.assign(s,r),i=new HA(s),a=new gI({queryParameter:i,datasetNames:t,fromIndex:0,toIndex:1e5,returnContent:!0}),new EI(e).processAsync(a,function(e){"processCompleted"===e.type?n&&n(e):o&&o(e)})}},{key:"_queryFeatureBySQL",value:function(e,t,r,n,o,i,a,s,u,l){var c,f,p={name:t};Object.assign(p,r),c=new HA(p),n&&(c.fields=n);var h={queryParams:[c]};l&&(h.queryOption=un.ATTRIBUTE),s&&(h.startRecord=s),u&&(h.expectCount=u),o&&(h.prjCoordSys={epsgCode:o}),f=new YK(h),this._queryBySQL(e,f,function(e){"processCompleted"===e.type?i(e):a(e)})}},{key:"_queryBySQL",value:function(e,t,r,n){new nY(e,{format:this._processFormat(n)}).processAsync(t,r)}},{key:"_processFormat",value:function(e){return e||on.GEOJSON}},{key:"_formatGeoJSON",value:function(e){var t=e.features;return t.forEach(function(e,t){e.properties.index=t}),t}},{key:"_excelData2Feature",value:function(e){for(var t=e.colTitles,r=-1,n=-1,o=0,i=t.length;o=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function kne(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&e.forEach(function(e){e.xAxis&&t.xField.push({field:e.xAxis.field,name:e.xAxis.name}),e.yAxis&&t.yField.push({field:e.yAxis.field,name:e.yAxis.name})})}},{key:"getDatasetInfo",value:function(e){var t=this;this.createChart=e,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new _ne(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:function(e){t.events.triggerEvent("getdatafailed",e)}}))}},{key:"_getDatasetInfoSuccess",value:function(e){var t=this.datasets.url,r=t.indexOf("rest");if(r>0){var n=t.indexOf("/",r+5),o=t.substring(r+5,n),i=t.substring(0,r+4)+"/data";if("maps"===o){var a=t.indexOf("/",n+1),s=t.substring(n+1,a);i=t.substring(0,r+4)+"/maps/"+s,e.result.dataUrl=i,this._getLayerFeatures(e)}else"data"===o&&(e.result.dataUrl=i,this._getDataFeatures(e))}}},{key:"_getDataInfoSuccess",value:function(e,t){"RESTMAP"===t?this._getChartDatasFromLayer(e):this._getChartDatas(e)}},{key:"_getDataFeatures",value:function(e){this.chartModel.getDataFeatures(e,this._getChartDatas.bind(this))}},{key:"_getLayerFeatures",value:function(e){this.chartModel.getLayerFeatures(e,this._getChartDatasFromLayer.bind(this))}},{key:"_getChartDatas",value:function(e){if(e){this.features=e.result.features;var t=this.features.features,r={};if(t.length){var n=t[0],o=[],i=[];for(var a in n.properties)o.push(a),i.push(this._getDataType(n.properties[a]));for(var s in r={features:t,fieldCaptions:o,fieldTypes:i,fieldValues:[]},i){var u=[];for(var l in t){var c=t[l],f=r.fieldCaptions[s],p=c.properties[f];u.push(p)}r.fieldValues.push(u)}this.createChart(r)}}}},{key:"_getChartDatasFromLayer",value:function(e){if(e.result.recordsets){var t=e.result.recordsets[0],r=t.features.features;this.features=t.features;var n={};if(r.length){for(var o in(n={features:t.features,fieldCaptions:t.fieldCaptions,fieldTypes:t.fieldTypes,fieldValues:[]}).fieldCaptions){var i=[];for(var a in r){var s=r[a],u=n.fieldCaptions[o],l=s.properties[u];i.push(l)}n.fieldValues.push(i)}this.createChart(n)}}}},{key:"_createChartOptions",value:function(e){return this.calculatedData=this._createChartDatas(e),this.updateChartOptions(this.chartType)}},{key:"changeType",value:function(e){if(e!==this.chartType)return this.chartType=e,this.updateChartOptions(this.chartType)}},{key:"updateData",value:function(e,t,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(t),e.type=e.type||"iServer",e.withCredentials=e.withCredentials||!1,this.datasets=e,this.getDatasetInfo(this._updateDataSuccess.bind(this))}},{key:"_updateDataSuccess",value:function(e){var t=this._createChartOptions(e);this.updateChart(t)}},{key:"updateChartOptions",value:function(e,t){if(this.calculatedData){var r=this.grid,n=this._createChartSeries(this.calculatedData,e),o=[];for(var i in this.calculatedData.XData)o.push({value:this.calculatedData.XData[i].fieldsData});var a={type:"category",name:this.xField[0].name||"X",data:o,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},u={formatter:"{b0}: {c0}"},l="#404a59";return t&&(t.grid&&(r=t.grid),t.tooltip&&(u=t.tooltip),t.backgroundColor&&(l=t.backgroundColor)),{backgroundColor:l,grid:r,series:n,xAxis:a,yAxis:s,tooltip:u}}}},{key:"_createChartDatas",value:function(e){var t=0,r=[],n=e.fieldCaptions,o=this;n.forEach(function(e,r){o.xField[0]&&e===o.xField[0].field&&(t=r)}),this.yFieldName="",this.yField.forEach(function(e,t){0!==t&&(o.yFieldName=o.yFieldName+","),o.yFieldName=o.yFieldName+e.name,n.forEach(function(t,n){t===e.field&&r.push(n)})});var i=this._getAttrData(e,t),a=[];if(r.length>0)r.forEach(function(t){var r=[];for(var n in e.fieldValues[t])r.push({value:e.fieldValues[t][n]});a.push(r)});else{for(var s=[],u=[],l=i.length,c=0;c0;e--)this.header.removeChild(this.header.children[e]),this.content.removeChild(this.content.children[e])}},{key:"_changeTabsPage",value:function(e){for(var t=e.target.index,r=0;r0;t--)this.content.removeChild(this.content.children[t-1]);var r=this.config[e];for(var n in r)this._createCityItem(n,r[n])}},{key:"_createCityItem",value:function(e,t){var r=document.createElement("div"),n=document.createElement("div");n.setAttribute("class","component-citytabpag__py-key"),n.innerHTML=e,r.appendChild(n);var o=document.createElement("div");o.setAttribute("class","component-citytabpag__content");for(var i=0;i0&&this.appendTabs(e),this.rootContainer=t}},{key:"setTabs",value:function(e){this.removeAllTabs(),this.appendTabs(e)}},{key:"appendTabs",value:function(e){for(var t=0;t0;e--)this.navTabsTitle.removeChild(this.navTabsTitle.children[e]),this.navTabsContent.removeChild(this.navTabsContent.children[e])}},{key:"_changeTabsPage",value:function(e){for(var t=e.target.index,r=0;r=0;e--)this.content.removeChild(this.content.children[e])}},{key:"setPageLink",value:function(e){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(e),this._appendPageLink()}},{key:"_createPageLi",value:function(e){for(var t=0;t1;e--)this.link.removeChild(this.link.children[e])}},{key:"_createLink",value:function(e){for(var t=0;t<4;t++){var r=document.createElement("li");r.setAttribute("class","disable");var n=document.createElement("span");r.appendChild(n),0===t?(n.id="first",n.setAttribute("class","supermapol-icons-first")):1===t?(n.id="prev",n.setAttribute("class","supermapol-icons-prev")):2===t?(n.id="next",n.setAttribute("class","supermapol-icons-next")):3===t&&(n.id="last",n.setAttribute("class","supermapol-icons-last")),e.appendChild(r)}}},{key:"_changePageEvent",value:function(e){var t=e.target;if("disable"!==t.parentElement.classList[0]){var r;if(t.id)r=t.id;else{if(!Number(t.innerHTML))return;r=Number(t.innerHTML)}this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}}},{key:"_changeDisableState",value:function(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}},{key:"_prePageNum",value:function(e){var t=[];if(this.currentPage="first"===e?1:"last"===e?this.pageNumberLis.length:"prev"===e?this.currentPage-1:"next"===e?this.currentPage+1:e,this.pageNumberLis.length<=5)for(var r=0;r=this.pageNumberLis.length-3)for(var o=this.pageNumberLis.length-5;o0&&(this.currentPageNumberLis=t)}}])&&Goe(r.prototype,n),o&&Goe(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(),Joe=function(){try{return canvg}catch(e){return{}}}(),Koe=r.n(Joe),Yoe=r(311),Qoe=r.n(Yoe),Xoe=r(304);function Zoe(e){return function(e){if(Array.isArray(e))return $oe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return $oe(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$oe(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function tie(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function rie(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){tie(i,n,o,a,s,"next",e)}function s(e){tie(i,n,o,a,s,"throw",e)}a(void 0)})}}function nie(e){"@babel/helpers - typeof";return(nie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function oie(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"==typeof t||"number"==typeof t?this.mapId=t:null!==t&&"object"===nie(t)&&(this.mapInfo=t),this.serverUrl=r.serverUrl||"https://www.supermapol.com",this.credentialKey=r.credentialKey,this.credentialValue=r.credentialValue,this.tiandituKey=r.tiandituKey||"",this.withCredentials=r.withCredentials||!1,this.excludePortalProxyUrl=r.excludePortalProxyUrl,this.iportalServiceProxyUrl=r.iportalServiceProxyUrlPrefix,this.proxy=r.proxy,this.proxyOptions={data:"apps/viewer/getUrlResource.json?url=",image:"apps/viewer/getUrlResource.png?url="}},(t=[{key:"setMapId",value:function(e){"string"==typeof e||"number"==typeof e?(this.mapId=e,this.mapInfo=null):null!==e&&"object"===nie(e)&&(this.mapInfo=e,this.mapId="")}},{key:"setServerUrl",value:function(e){this.serverUrl=e}},{key:"setWithCredentials",value:function(e){this.withCredentials=e}},{key:"setProxy",value:function(e){this.proxy=e}},{key:"handleServerUrl",value:function(e){var t=wo(e);return this.serverUrl=t,t}},{key:"getMapInfo",value:function(){var e=rie(eie().mark(function e(){var t,r=this;return eie().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.mapId||!this.mapInfo){e.next=2;break}return e.abrupt("return",new Promise(function(e){e(r.mapInfo)}));case 2:return t=this._handleMapUrl(),e.prev=3,e.next=6,this.getiPortalServiceProxy();case 6:return e.abrupt("return",new Promise(function(e,n){z.get(t,null,{withCredentials:r.withCredentials}).then(function(e){return e.json()}).then(function(t){if(t&&!1===t.succeed){var r={message:t&&t.error&&t.error.errorMsg};n(r)}else t.mapParams={title:t.title,description:t.description},e(t)}).catch(function(e){n(e)})}));case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("return",Promise.reject(e.t0));case 12:case"end":return e.stop()}},e,this,[[3,9]])}));return function(){return e.apply(this,arguments)}}()},{key:"getiPortalServiceProxy",value:function(){var e=this;return new Promise(function(t,r){z.get("".concat(e.serverUrl,"web/config/portal.json"),{scope:["serviceProxy"]}).then(function(e){return e.json()}).then(function(n){if(n&&n.serviceProxy){var o=n.serviceProxy;o.enable&&(o.proxyServerRootUrl?e.iportalServiceProxyUrl=o.proxyServerRootUrl:o.port&&o.rootUrlPostfix&&(e.iportalServiceProxyUrl="".concat(o.port,"/").concat(o.rootUrlPostfix)),e.serverUrl.indexOf(e.iportalServiceProxyUrl)>-1&&(e.iportalServiceProxyUrl="")),t(o)}else r("serviceProxyFailed")}).catch(function(e){r(e)})})}},{key:"getLayerFeatures",value:function(e,t,r){var n;switch(e){case"hosted":n=this._getFeaturesFromHosted(t,r);break;case"rest_data":n=this._getFeaturesFromRestData(t,r);break;case"rest_map":n=this._getFeaturesFromRestMap(t);break;case"dataflow":n=this._getFeaturesFromDataflow(t);break;case"user_data":n=this._getFeaturesFromUserData(t)}return n}},{key:"getWmsInfo",value:function(e){var t=this;return new Promise(function(r){var n=t.handleProxy(),o=L.urlAppend(e.url,"REQUEST=GetCapabilities&SERVICE=WMS");z.get(o,null,{withCredentials:t.handleWithCredentials(n,e.url,!1),withoutFormatSuffix:!0,proxy:n}).then(function(e){return e.text()}).then(function(e){var t=new Xoe.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"@_"}).parse(e),n=t.WMT_MS_Capabilities||t.WMS_Capabilities;r({version:n["@_version"]})})})}},{key:"getMapBoxStyle",value:function(e){return new Promise(function(t,r){z.get(e).then(function(e){return e.json()}).then(function(e){t(e)}).catch(function(e){r(e)})})}},{key:"getWmtsInfo",value:function(e,t){var r=this;return new Promise(function(n,o){var i,a=!1,s=22,u=0,l="",c="",f="",p=r.handleProxy(),h=L.urlAppend(e.url,"REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0");h=r.handleParentRes(h),z.get(h,null,{withCredentials:r.handleWithCredentials(p,e.url,!1),withoutFormatSuffix:!0,proxy:p}).then(function(e){return e.text()}).then(function(o){var p=["Layer","TileMatrixSet","ows:Operation","ows:Get","ResourceURL","Style"],h=new Xoe.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"@_",isArray:function(e){if(-1!==p.indexOf(e))return!0}}).parse(o).Capabilities,y=h.Contents,d=h["ows:OperationsMetadata"];if(d){var m=d["ows:Operation"];Array.isArray(m)||(m=[m]);var v=m.find(function(e){return"GetTile"===e["@_name"]});if(v){var b=v["ows:DCP"]["ows:HTTP"]["ows:Get"];Array.isArray(b)||(b=[b]);var g=b.find(function(e){return"KVP"===e["ows:Constraint"]["ows:AllowedValues"]["ows:Value"]});g&&(f=g["@_xlink:href"])}}for(var w=y.TileMatrixSet,S=0;S0)break}var A=Object.keys(O).map(function(e){return+e});if(s=A.length>0?Math.max.apply(Math,Zoe(A)):void 0,u=A.length>0?Math.min.apply(Math,Zoe(A)):void 0,0===A.length)throw Error("TileMatrixSetNotSuppport");a=!0}break}var I=y.Layer&&y.Layer.find(function(t){return t["ows:Identifier"]===e.layer});if(I){var L=I.Style;if(l=Array.isArray(I.Style)?L[0]["ows:Identifier"]?L[0]["ows:Identifier"]:"":L["ows:Identifier"]?L["ows:Identifier"]:"",I["ows:WGS84BoundingBox"]){var N=I["ows:WGS84BoundingBox"]["ows:LowerCorner"].split(" "),M=I["ows:WGS84BoundingBox"]["ows:UpperCorner"].split(" ");i=[parseFloat(N[0]),parseFloat(N[1]),parseFloat(M[0]),parseFloat(M[1])]}var R=I.ResourceURL;Array.isArray(R)||(R=[R]);var D=R.find(function(e){return"tile"===e["@_resourceType"]});D&&(c=D["@_template"])}n({isMatched:a,matchMaxZoom:s,matchMinZoom:u,style:l,bounds:i,restResourceURL:c,kvpResourceUrl:f})}).catch(function(e){o(e)})})}},{key:"_getFeaturesFromHosted",value:function(e,t){var r=e.dataSource,n=e.layerType,o=r?r.serverId:e.serverId;return o?"MARKER"===n||r&&(!r.accessType||"DIRECT"===r.accessType)?this._getDataFromIportal(o,e):this._getDataFromHosted({layer:e,serverId:o,baseProjection:t}):new Promise(function(e){e({type:"noServerId"})})}},{key:"_getFeaturesFromRestData",value:function(e,t){var r,n=this,o=e.dataSource;return new Promise(function(i,a){n._getFeatureBySQL(o.url,[decodeURIComponent(o.dataSourceName)||e.name],function(e){e.result.features?(r=n.parseGeoJsonData2Feature({allDatas:{features:e.result.features.features}}),i({type:"feature",features:r})):a("features must be valid")},function(e){a(e)},t)})}},{key:"_getFeaturesFromRestMap",value:function(e){var t=this;return new Promise(function(r,n){t._queryFeatureBySQL(e.dataSource.url,e.dataSource.layerName,function(o){var i=o&&o.result.recordsets,a=i&&i[0],s=a.fields;if(a&&s){var u=[];for(var l in s){var c=s[l];0===c.indexOf("Sm")&&"SmID"!==c||u.push(c)}t._getFeatures(u,e,function(e){r({type:"feature",features:e})},function(e){n(e)})}},function(e){n(e)},"smid=1")})}},{key:"_getFeaturesFromUserData",value:function(e){var t=this,r=e.dataSource;return new Promise(function(e,n){var o=t.handleProxy(),i=t.handleParentRes(r.url);z.get(i,null,{withCredentials:t.handleWithCredentials(o,i,t.withCredentials),proxy:o,withoutFormatSuffix:!0}).then(function(e){return e.json()}).then(function(r){var n;n=r&&r instanceof Object&&"FeatureCollection"===r.type?r.features:r,n=t.parseGeoJsonData2Feature({allDatas:{features:n}}),e({type:"feature",features:n})}).catch(function(e){n(e)})})}},{key:"_queryFeatureBySQL",value:function(e,t,r,n,o,i,a,s,u,l){var c=this._getQueryFeaturesParam(t,o,i,a,s,u,l),f=this.handleProxy(),p=this.handleParentRes(e);new nY(p,{proxy:f,withCredentials:this.handleWithCredentials(f,e,!1),eventListeners:{processCompleted:function(e){r&&r(e)},processFailed:function(e){n&&n(e)}}}).processAsync(c)}},{key:"_getFeatures",value:function(e,t,r,n){var o=this,i=t.dataSource;this._queryFeatureBySQL(i.url,i.layerName,function(e){var t=e.result.recordsets[0].features.features,n=o.parseGeoJsonData2Feature({allDatas:{features:t}});r(n)},function(e){n(e)},null,e)}},{key:"_getQueryFeaturesParam",value:function(e,t,r,n,o,i,a){var s=new HA({name:e,attributeFilter:t});r&&(s.fields=r);var u={queryParams:[s]};return a&&(u.queryOption=un.ATTRIBUTE),o&&(u.startRecord=o),i&&(u.expectCount=i),n&&(u.prjCoordSys={epsgCode:n}),new YK(u)}},{key:"_getFeaturesFromDataflow",value:function(e){var t=this;return new Promise(function(r,n){t._getDataflowInfo(e,function(){r({type:"dataflow"})},function(e){n(e)})})}},{key:"_getDataflowInfo",value:function(e,t,r){var n,o=e.url,i="".concat(o,".json");e.credential&&e.credential.token&&(n=e.credential.token,i+="?token=".concat(n));var a=this.handleProxy();i=this.handleParentRes(i),z.get(i,null,{proxy:a,withCredentials:this.handleWithCredentials(a,i,!1)}).then(function(e){return e.json()}).then(function(n){n?(n.featureMetaData&&(e.featureType=n.featureMetaData.featureType.toUpperCase(),e.dataSource={dataTypes:{}},n.featureMetaData.fieldInfos&&n.featureMetaData.fieldInfos.length>0&&n.featureMetaData.fieldInfos.forEach(function(t){var r=t.name.trim();"TEXT"===t.type?e.dataSource.dataTypes[r]="STRING":["DOUBLE","INT","FLOAT","LONG","SHORT"].includes(t.type)?e.dataSource.dataTypes[r]="NUMBER":e.dataSource.dataTypes[r]="UNKNOWN"})),e.wsUrl=n.urls[0].url,e.name=n.urls[0].url.split("iserver/services/")[1].split("/dataflow")[0],t()):r()}).catch(function(){r()})}},{key:"getDatasourceType",value:function(e){var t,r=e.dataSource,n=e.layerType;return r&&"SAMPLE_DATA"===r.type?r.type:(r&&r.serverId||"MARKER"===n||"HOSTED_TILE"===n?t="hosted":"SUPERMAP_REST"===n||"TILE"===n||"WMS"===n||"WMTS"===n||"MAPBOXSTYLE"===n?t="tile":r&&"REST_DATA"===r.type?t="rest_data":r&&"REST_MAP"===r.type&&r.url?t="rest_map":"DATAFLOW_POINT_TRACK"===n||"DATAFLOW_HEAT"===n?t="dataflow":r&&"USER_DATA"===r.type&&(t="user_data"),t)}},{key:"getFeatureProperties",value:function(e){var t=[];return e&&e.length&&e.forEach(function(e){var r=e.properties;r&&t.push(r)}),t}},{key:"parseGeoJsonData2Feature",value:function(e){for(var t=e.allDatas.features,r=[],n=0,o=t.length;n0){var u=s[0].name,l=s[0].type.toUpperCase();t._getDataService(n,u).then(function(n){var s=n.dataItemServices;0===s.length&&a("noDataServices");var c={layer:r,dataItemServices:s,datasetName:u,featureType:l,resolve:e,reject:a,baseProjection:o};if(i){var f=s.filter(function(e){return e&&"RESTDATA"===e.serviceType})[0];t._isMvt(f.address,u,o).then(function(e){t._getServiceInfoFromLayer(c,e)}).catch(function(){t._getServiceInfoFromLayer(c)})}else t._getServiceInfoFromLayer(c)})}else a("resultIsEmpty")}).catch(function(e){a(e)})})}},{key:"_isMvt",value:function(e,t,r){return this._getDatasetsInfo(e,t).then(function(e){return e.epsgCode==r.split("EPSG:")[1]?z.get("".concat(e.url,"/tilefeature.mvt")).then(function(e){return e.json()}).then(function(t){return e.isMvt=t.error&&400===t.error.code,e}).catch(function(){return e}):e})}},{key:"_getServiceInfoFromLayer",value:function(e,t){var r=this,n=e.layer,o=e.dataItemServices,i=e.datasetName,a=e.featureType,s=e.resolve,u=e.reject,l=e.baseProjection,c=t?!t.isMvt:"HOSTED_TILE"===n.layerType,f=!1;o.forEach(function(e){f||(e&&c&&"RESTMAP"===e.serviceType?(f=!0,r._getTileLayerInfo(e.address,l).then(function(e){s({type:"restMap",restMaps:e})})):e&&!c&&"RESTDATA"===e.serviceType&&(t&&t.isMvt?s({type:"mvt",info:t,featureType:a}):(f=!0,r._getDatasources(e.address).then(function(t){n.dataSource.dataSourceName=t+":"+i,n.dataSource.url="".concat(e.address,"/data"),r._getFeatureBySQL(n.dataSource.url,[n.dataSource.dataSourceName||n.name],function(e){var t=r.parseGeoJsonData2Feature({allDatas:{features:e.result.features.features}});s({type:"feature",features:t})},function(e){u(e)})},function(e){u(e)}))))},this),f||u("noService")}},{key:"_getDatasetsInfo",value:function(e,t){var r=this;return this._getDatasources(e).then(function(n){var o="".concat(e,"/data/datasources/").concat(n,"/datasets/").concat(t),i=r.handleProxy();return o=r.handleParentRes(o),z.get(o,null,{withCredentials:r.handleWithCredentials(i,o,!1),proxy:i}).then(function(e){return e.json()}).then(function(e){return{epsgCode:e.datasetInfo.prjCoordSys.epsgCode,bounds:e.datasetInfo.bounds,datasourceName:n,datasetName:t,url:o}})})}},{key:"_getDatasources",value:function(e){var t=this.handleProxy(),r="".concat(e,"/data/datasources.json");return r=this.handleParentRes(r),z.get(r,null,{withCredentials:this.handleWithCredentials(t,r,!1),proxy:t}).then(function(e){return e.json()}).then(function(e){if(401===e.code)throw Error(e.errorMsg);return e.datasourceNames[0]})}},{key:"_getDataService",value:function(e,t){var r=this.handleProxy(),n="".concat(this.serverUrl,"web/datas/").concat(e,".json");return n=this.handleParentRes(n),z.get(n,null,{withCredentials:this.handleWithCredentials(r,n,this.withCredentials),proxy:r}).then(function(e){return e.json()}).then(function(r){return r.fileId=e,r.datasetName=t,r})}},{key:"_checkUploadToRelationship",value:function(e){var t=this.handleProxy(),r="".concat(this.serverUrl,"web/datas/").concat(e,"/datasets.json");return r=this.handleParentRes(r),z.get(r,null,{withCredentials:this.handleWithCredentials(t,r,this.withCredentials),proxy:t}).then(function(e){return e.json()}).then(function(e){return e})}},{key:"_handleMapUrl",value:function(){var e=this.serverUrl+"web/maps/"+this.mapId+"/map";this.credentialValue&&this.credentialKey&&(e+="?"+this.credentialKey+"="+this.credentialValue);var t="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.serverUrl.indexOf(t)>-1){var r=this.serverUrl.split(t);r.length>1&&(e=r[0]+t+this.serverUrl+"web/maps/"+this.mapId+"/map.json")}return e=-1===e.indexOf(".json")?"".concat(e,".json"):e}},{key:"handleProxy",value:function(e){if(!this.proxy)return null;var t=this.proxyOptions[e||"data"],r=this.serverUrl+t;return"string"==typeof this.proxy&&(r=this.proxy),r}},{key:"handleWithCredentials",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.withCredentials;return t&&t.includes("https://www.supermapol.com")?"":!(!e||!e.startsWith(this.serverUrl)||t&&!t.startsWith(e))||(!!(t&&this.iportalServiceProxyUrl&&t.indexOf(this.iportalServiceProxyUrl)>=0)||r)}},{key:"isIportalResourceUrl",value:function(e){return e.startsWith(this.serverUrl)||this.iportalServiceProxyUrl&&e.indexOf(this.iportalServiceProxyUrl)>=0}},{key:"handleParentRes",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mapId,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MAP";return this.isIportalResourceUrl(e)?L.urlAppend(e,"parentResType=".concat(r,"&parentResId=").concat(t)):e}},{key:"_formatGeoJSON",value:function(e){var t=e.features;return t.forEach(function(e,t){e.properties.index=t}),t}},{key:"_excelData2Feature",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.colTitles,n=r.indexOf(t.xField),o=r.indexOf(t.yField);if(o<0||n<0)for(var i=0,a=r.length;i2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(+e-+t)<=r}}])&&oie(e.prototype,t),r&&oie(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function cie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fie(e,t,r){return(t=mie(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pie(){pie=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==yie(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function hie(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function yie(e){"@babel/helpers - typeof";return(yie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function die(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:Ea,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"triggerEvent";return function(r){function n(e,t,r){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(o=vie(this,n)).serverUrl=t.serverUrl||"https://www.supermapol.com",o.credentialValue=t.credentialValue,o.credentialKey=t.credentialKey,o.tiandituKey=t.tiandituKey||"",o.googleMapsAPIKey=t.googleMapsAPIKey||"",o.bingMapsKey=t.bingMapsKey||"",o.googleMapsLanguage=t.googleMapsLanguage||"zh-CN",o.withCredentials=t.withCredentials||!1,o.proxy=t.proxy,o.target=t.target||"map",o.excluortalProxyUrl=t.excludePortalProxyUrl,o.isSuperMapOnline=t.isSuperMapOnline,o.ignoreBaseProjection=t.ignoreBaseProjection,o.specifiedProj4=t.proj4,o.echartslayer=[],o.canvgsV=[],o.webMapService=new lie(e,t),o.mapOptions=r,o.eventTypes=["mapcreatefailed","layercreatefailed"],o.mapId=e,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gie(e,t)}(n,e),o=n,(i=[{key:"_initWebMap",value:function(){throw new Error("_initWebMap is not implemented")}},{key:"_getMapInfo",value:function(){throw new Error("_getMapInfo is not implemented")}},{key:"_createMap",value:function(){throw new Error("_createMap is not implemented")}},{key:"_initBaseLayer",value:function(){throw new Error("_initBaseLayer is not implemented")}},{key:"_initOverlayLayer",value:function(){throw new Error("_initOverlayLayer is not implemented")}},{key:"_addLayerSucceeded",value:function(){throw new Error("_addLayerSucceeded is not implemented")}},{key:"_unproject",value:function(){throw new Error("_unproject is not implemented")}},{key:"clean",value:function(){throw new Error("clean is not implemented")}},{key:"echartsLayerResize",value:function(){this.echartslayer.forEach(function(e){e.chart.resize()})}},{key:"setMapId",value:function(e){var t=this;"string"==typeof e||"number"==typeof e?(this.mapId=e,this.webMapInfo=null):null!==e&&"object"===yie(e)&&(this.webMapInfo=e,this.mapId=""),this.webMapService.setMapId(e),e&&setTimeout(function(){t._initWebMap()},0)}},{key:"setServerUrl",value:function(e){this.serverUrl=e,this.webMapService.setServerUrl(e)}},{key:"setWithCredentials",value:function(e){this.withCredentials=e,this.webMapService.setWithCredentials(e)}},{key:"setProxy",value:function(e){this.proxy=e,this.webMapService.setProxy(e)}},{key:"setZoom",value:function(e){this.map&&(this.mapOptions.zoom=e,e!==+this.map.getZoom().toFixed(2)&&(e||0===e)&&this.map.setZoom(e,{from:"setZoom"}))}},{key:"setMaxBounds",value:function(e){this.map&&(this.mapOptions.maxBounds=e,e&&this.map.setMaxBounds(e))}},{key:"setMinZoom",value:function(e){this.map&&(this.mapOptions.minZoom=e,(e||0===e)&&this.map.setMinZoom(e))}},{key:"setMaxZoom",value:function(e){this.map&&(this.mapOptions.maxZoom=e,(e||0===e)&&this.map.setMaxZoom(e))}},{key:"initWebMap",value:function(){if(this.clean(),this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapInfo){var e=this.webMapInfo;return e.mapParams={title:this.webMapInfo.title,description:this.webMapInfo.description},this.mapParams=e.mapParams,void this._getMapInfo(e)}this.mapId&&this.serverUrl?(this._taskID=new Date,this.getMapInfo(this._taskID)):this._createMap()}},{key:"getMapInfo",value:function(e){var t=this;this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapService.getMapInfo().then(function(r){t._taskID===e&&(t.mapParams=r.mapParams,t._getMapInfo(r,e))},function(e){throw e}).catch(function(e){t._fire("mapcreatefailed",{error:e}),console.log(e)})}},{key:"getBaseLayerType",value:function(e){var t=e.layerType;switch((t.indexOf("TIANDITU_VEC")>-1||t.indexOf("TIANDITU_IMG")>-1||t.indexOf("TIANDITU_TER")>-1)&&(t="TIANDITU"),t){case"TILE":case"SUPERMAP_REST":return"TILE";case"CLOUD":case"CLOUD_BLACK":return"CLOUD";case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":return"XYZ";default:return t}}},{key:"getMapurls",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{CLOUD:e.CLOUD||"http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",CLOUD_BLACK:e.CLOUD_BLACK||"http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",OSM:e.OSM||"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",GOOGLE:"https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s{googleMapsLanguage}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key={googleMapsAPIKey}",GOOGLE_CN:"https://mt{0-3}.google.com/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}",JAPAN_STD:"https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",JAPAN_PALE:"https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",JAPAN_RELIEF:"https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",JAPAN_ORT:"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"}}},{key:"getLayerFeatures",value:function(e,t,r){var n=this,o=this.webMapService.getLayerFeatures(r,e,this.baseProjection);o&&o.then(function(){var r,o=(r=pie().mark(function r(o){var i;return pie().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!n.mapId||n._taskID===t){r.next=2;break}return r.abrupt("return");case 2:if(!o||!e.projection){r.next=8;break}if($O(e.projection,n.specifiedProj4)){r.next=8;break}return r.next=6,r_(e.projection.split(":")[1],n.serverUrl);case 6:(i=r.sent)&&ZO(e.projection,i,n.specifiedProj4);case 8:n._getLayerFeaturesSucceeded(o,e);case 9:case"end":return r.stop()}},r)}),function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){hie(i,n,o,a,s,"next",e)}function s(e){hie(i,n,o,a,s,"throw",e)}a(void 0)})});return function(e){return o.apply(this,arguments)}}(),function(e){throw new Error(e)}).catch(function(t){n._addLayerSucceeded(),n._fire("layercreatefailed",{error:t,layer:e,map:n.map}),console.log(t)})}},{key:"setFeatureInfo",value:function(e){var t,r=e.dv_v5_markerInfo;if(!r||!r.dataViz_title)return r;t=r;var n=e.properties;for(var o in t)n[o]&&(t[o]=n[o],delete n[o]);return t}},{key:"getRankStyleGroup",value:function(e,t,r){var n=[],o=[],i=r.style,a=r.themeSetting,s=a.segmentMethod,u=a.segmentCount,l=a.customSettings,c=r.themeSetting.minRadius,f=r.themeSetting.maxRadius,p=a.colors,h=i.fillColor;t.forEach(function(t){var r=t.properties[e];null==r||""===r||isNaN(+r)||n.push(Number(r))});try{o=MO.getArraySegments(n,s,u)}catch(e){console.log(e)}for(var y=0;y0&&(_=l[P]&&l[P].color?l[P].color:x[P]||h,i.fillColor=_),v.push({radius:O,color:_,start:b,end:g,style:i});return v}return!1}},{key:"createRankStyleSource",value:function(e,t){var r=e.themeSetting.themeField,n=this.getRankStyleGroup(r,t,e);return!!n&&{parameters:e,styleGroups:n}}},{key:"getRestMapLayerInfo",value:function(e,t){var r=e.bounds,n=e.coordUnit,o=e.visibleScales,i=e.url;return t.layerType="TILE",t.orginEpsgCode=this.baseProjection,t.units=n&&n.toLowerCase(),t.extent=[r.left,r.bottom,r.right,r.top],t.visibleScales=o,t.url=i,t.sourceType="TILE",t}},{key:"handleLayerFeatures",value:function(e,t){var r=t.layerType,n=t.style,o=t.themeSetting,i=t.filterCondition;return(n||o)&&i&&"RANGE"!==r&&"UNIQUE"!==r&&"RANK_SYMBOL"!==r&&(e=this.getFilterFeatures(i,e)),e}},{key:"getFilterFeatures",value:function(e,t){if(!e)return t;for(var r=this.replaceFilterCharacter(e),n=[],o=0;o0&&n.push(i)}return n}},{key:"replaceFilterCharacter",value:function(e){return e=e.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=")}},{key:"getParseSpecialCharacter",value:function(){var e={};return["(",")","(",")",",",","].forEach(function(t,r){e[t]="$".concat(r)}),e}},{key:"parseSpecialCharacter",value:function(e){var t=this.getParseSpecialCharacter();for(var r in t)for(var n=t[r],o=new RegExp("\\".concat(r),"g");o.test(e);)e=e.replace(o,n);return e}},{key:"parseCondition",value:function(e,t){var r=this,n=e;return e.replace(/&|\||>|<|=|!/g," ").split(" ").filter(function(e){return e}).forEach(function(e){var o=t.find(function(t){return t===e});if(r.startsWithNumber(e)&&o&&(n=n.replace(o,"$"+o)),o){var i=r.parseSpecialCharacter(o);n=n.replace(o,i)}}),n}},{key:"parseConditionFeature",value:function(e){var t={};for(var r in e){var n=r;this.startsWithNumber(r)&&(n="$"+r),t[n=this.parseSpecialCharacter(n)]=e[r]}return t}},{key:"startsWithNumber",value:function(e){return/^\d/.test(e)}},{key:"getEchartsLayerOptions",value:function(e,t,r){var n=this.webMapService.getFeatureProperties(t),o=function(e,t){var r=[];if(t&&t.length){var n,o,i=e.from,a=e.to;if("XY_FIELD"===i.type&&i.xField&&i.yField&&a.xField&&a.yField)t.forEach(function(e){var t=e[i.xField],s=e[i.yField],u=e[a.xField],l=e[a.yField];t&&s&&u&&l&&(n=[e[i.xField],e[i.yField]],o=[e[a.xField],e[a.yField]],r.push({coords:[n,o]}))});else if("PLACE_FIELD"===i.type&&i.field&&a.field){var s=fo.concat(co);t.forEach(function(e){var t=e[i.field],u=e[a.field];n=s.find(function(e){return go(e.name,t)}),o=s.find(function(e){return go(e.name,u)}),n&&o&&r.push({coords:[n.coord,o.coord]})})}}return r}(e,n),i=this._createPointsData(o,e,n);return this._createOptions(e,o,i,r)}},{key:"getDashStyle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"array";if(!e)return"array"===r?[]:"";var n,o=t;switch(e){case"solid":n=[];break;case"dot":n=[1,4*o];break;case"dash":n=[4*o,4*o];break;case"dashrailway":n=[8*o,12*o];break;case"dashdot":n=[4*o,4*o,1*o,4*o];break;case"longdash":n=[8*o,4*o];break;case"longdashdot":n=[8*o,4*o,1,4*o];break;default:n=L.isArray(e)?e:(e=p.trim(e).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(",")}return n="array"===r?n:n.join(",")}},{key:"getCanvasFromSVG",value:function(e,t,r){var n=this,o=document.createElement("canvas");if(o.id="dataviz-canvas-".concat((new Date).getTime()),o.style.display="none",t.appendChild(o),e){var i=(window.canvg||{}).default?window.canvg.default:Koe(),a=o.getContext("2d");i.from(a,e,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:function(){return!1}}).then(function(e){e.start(),n.canvgsV.push(e),o.width>300||o.height>300||r(o)})}else r(o)}},{key:"stopCanvg",value:function(){this.canvgsV.forEach(function(e){return e.stop()}),this.canvgsV=[]}},{key:"getRangeStyleGroup",value:function(e,t){var r,n=e.featureType,o=e.style,i=e.themeSetting,a=i.customSettings,s=i.themeField,u=i.segmentCount,l=i.segmentMethod,c=i.colors,f=[];t.forEach(function(e){if(r=e.properties){var t=r[s];(t||0===t)&&!isNaN(+t)&&f.push(parseFloat(t))}},this);var p=f&&f.length&&MO.getArraySegments(f,l,u);if(p){var h=u;r&&p[0]===p[r.length-1]&&(h=1,p.length=2);for(var y=0;yl&&o>0||"\n"===e[o]?(t=e[o],f++,n=!0):(t=i,c=a)}n?p.push(l):p.push(c)},this);for(var h=0;h=l){c=l;break}y>c&&(c=y)}return c+=a,t=f*i+a-6,s.width=c,s.height=t,r.fillStyle=u,r.fillRect(0,0,c,t),r.lineWidth=n.borderWidth,r.strokeStyle=n.borderColor,r.strokeRect(0,0,c,t),{width:c,height:t}}},{key:"_drawTextWithCanvas",value:function(e){var t=e.context,r=e.canvas,n=e.style,o=Number(n.font.replace(/[^0-9]/gi,""))+3,i=n.text.split("\r\n");t.font=n.font;var a=this._drawTextRectAndGetSize({context:t,style:n,textArray:i,lineHeight:o,doublePadding:16,canvas:r}),s=8;i.forEach(function(e,r){0!==r&&(s+=o),t.font=n.font;var i,u=n.textAlign,l=a.width-16;switch(u){case"center":i=l/2;break;case"right":i=l;break;default:i=8}for(var c=e.split(""),f="",p=n.fillColor,h=n.maxWidth-16,y=0;yh&&y>0||"\n"===c[y]?(t.fillStyle=p,t.textAlign=u,t.textBaseline="top",t.fillText(f,i,s),f=c[y],s+=o):f=d}t.fillStyle=p,t.textAlign=u,t.textBaseline="top",t.fillText(f,i,s)},this)}},{key:"handleSvgColor",value:function(e,t){var r=e.fillColor,n=e.fillOpacity,o=e.strokeColor,i=e.strokeOpacity,a=e.strokeWidth,s=t.getContext("2d");e.text?this._drawTextWithCanvas({context:s,canvas:t,style:e}):(r&&(s.fillStyle=AO.getColorWithOpacity(r,n),s.fill()),(o||a)&&(s.strokeStyle=AO.getColorWithOpacity(o,i),s.lineWidth=a,s.stroke()))}},{key:"_createPointsData",value:function(e,t,r){var n=[],o=t.labelSetting;if(!o.show||!e.length)return n;var i=[],a=[];return e.forEach(function(e,t){var n=e.coords,s=n[0],u=n[1],l=r[t][o.from],c=r[t][o.to];!i.find(function(e){return e.value[0]===s[0]&&e.value[1]===s[1]})&&i.push({name:l,value:s}),!a.find(function(e){return e.value[0]===u[0]&&e.value[1]===u[1]})&&a.push({name:c,value:u})}),n=i.concat(a)}},{key:"_createOptions",value:function(e,t,r,n){var o,i=this._createLineSeries(e,t,n);if(r&&r.length){var a=this._createPointSeries(e,r,n);o=i.concat(a)}else o=i.slice();return{series:o,animation:!1}}},{key:"_createPointSeries",value:function(e,t,r){var n=e.lineSetting,o=e.animationSetting,i=e.labelSetting,a=[{name:"point-series",coordinateSystem:r,zlevel:2,label:{normal:{show:i.show,position:"right",formatter:"{b}",color:i.color,fontFamily:i.fontFamily}},itemStyle:{normal:{color:n.color||i.color}},data:t}];return o.show?(a[0].type="effectScatter",a[0].rippleEffect={brushType:"stroke"}):a[0].type="scatter",a}},{key:"_createLineSeries",value:function(e,t,r){var n=e.lineSetting,o=e.animationSetting,i=[{name:"line-series",coordinateSystem:r,type:"lines",zlevel:1,effect:{show:o.show,constantSpeed:o.constantSpeed,trailLength:0,symbol:o.symbol,symbolSize:o.symbolSize},lineStyle:{normal:{color:n.color,type:n.type,width:n.width,opacity:n.opacity,curveness:n.curveness}},data:t}];return t.length>=wie&&(i[0].large=!0,i[0].largeThreshold=100,i[0].blendMode="lighter"),i}},{key:"_getLayerFeaturesSucceeded",value:function(e,t){switch(e.type){case"feature":this._initOverlayLayer(t,e.features);break;case"restMap":t.layerType="restMap",this._initOverlayLayer(t,e.restMaps);break;case"mvt":t.layerType="mvt",this._initOverlayLayer(t,e);break;case"dataflow":case"noServerId":this._initOverlayLayer(t)}}},{key:"_fire",value:function(e,r){this[t]&&this[t](e,r)}}])&&die(o.prototype,i),a&&die(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,a}()}function Oie(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _ie(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{layerFilter:function(){return!0}},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{style:{version:8,sources:{},layers:[]}};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t=jie(this,n),"string"==typeof e||"number"==typeof e?t.mapId=e:null!==e&&"object"===Pie(e)&&(t.webMapInfo=e),t.mapId||o.center||o.zoom||(o.center=[0,0],o.zoom=0),r.map&&(t.map=r.map),t.options=Object.assign({},r),delete t.options.map,t._setServer(r.server||"https://www.supermapol.com"),t.options.target=r.target||"map",t.options.withCredentials=r.withCredentials||!1,t.mapOptions=o,t.webMapService=new lie(e,t.options),t.eventTypes=["mapinitialized","mapcreatesucceeded","addlayerssucceeded","mapcreatefailed","getmapfailed","layercreatefailed","getlayersfailed","baidumapnotsupport","dataflowfeatureupdated","projectionnotmatch","layeraddchanged","layerupdatechanged","mapbeforeremove"],t._cacheCleanLayers=[],t._mapInitializedHandler=t._mapInitializedHandler.bind(t),t._mapCreateSucceededHandler=t._mapCreateSucceededHandler.bind(t),t._addLayerChangedHandler=t._addLayerChangedHandler.bind(t),t._initWebMap(!t.map),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cie(e,t)}(n,e),o=n,(i=[{key:"resize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.map&&this.map.resize(),this._handler&&this._handler.echartsLayerResize();var t=window.getComputedStyle(document.getElementById(this.options.target)),r=this.mapOptions.bounds;if(e&&this.map&&r&&t){var n=this._getResizedZoom(r,t);n!==this.map.getZoom()&&this.map&&this.map.setZoom(n)}}},{key:"setCRS",value:function(e){if(this.map&&(this.mapOptions.crs=e,this.mapOptions.crs)){if(this.map.getCRS("string"==typeof e?e:e.epsgCode))return;e.epsgCode?(this.mapOptions.crs=new r.CRS(this.mapOptions.crs.epsgCode,this.mapOptions.crs.WKT,this.mapOptions.crs.extent,this.mapOptions.crs.unit),this.map.setCRS(this.mapOptions.crs)):this.map.setCRS(r.CRS.get(e))}}},{key:"setCenter",value:function(e){if(this.map&&this._centerValid(e)){this.mapOptions.center=e;var t=this.map.getCenter(),r=t.lng,n=t.lat;e[0]===+r.toFixed(4)&&e[1]===+n.toFixed(4)||this.map.setCenter(e,{from:"setCenter"})}}},{key:"setRenderWorldCopies",value:function(e){this.map&&(this.mapOptions.renderWorldCopies=e,this.map.setRenderWorldCopies(e))}},{key:"setBearing",value:function(e){this.map&&(this.mapOptions.bearing=e,e!==+this.map.getBearing().toFixed(2)&&(e||0===e)&&this.map.setBearing(e))}},{key:"setPitch",value:function(e){this.map&&(this.mapOptions.pitch=e,e!==+this.map.getPitch().toFixed(2)&&(e||0===e)&&this.map.setPitch(e))}},{key:"setStyle",value:function(e){this.map&&(this.mapOptions.style=e,this._initWebMap())}},{key:"setRasterTileSize",value:function(e){var t=this;if(this.map&&!(e<=0)){var r=this.map.getStyle().sources;Object.keys(r).forEach(function(n){"raster"===r[n].type&&"iserver"===r[n].rasterSource&&t._updateRasterSource(n,{tileSize:e})})}}},{key:"setMaxBounds",value:function(e){this.map&&(this.mapOptions.maxBounds=e,e&&this.map.setMaxBounds(e))}},{key:"setMinZoom",value:function(e){this.map&&(this.mapOptions.minZoom=e,(e||0===e)&&this.map.setMinZoom(e))}},{key:"setMaxZoom",value:function(e){this.map&&(this.mapOptions.maxZoom=e,(e||0===e)&&this.map.setMaxZoom(e))}},{key:"setWebMapOptions",value:function(e){this.setServerUrl(e.server),this._createWebMap()}},{key:"setMapOptions",value:function(e){var t=e.center,r=e.zoom,n=e.maxBounds,o=e.minZoom,i=e.maxZoom,a=e.isWorldCopy,s=e.bearing,u=e.pitch;t&&t.length&&this.setCenter(t),r&&this.setZoom(r),n&&this.setMaxBounds(n),o&&this.setMinZoom(o),i&&this.setMaxZoom(i),a&&this.setRenderWorldCopies(a),s&&this.setBearing(s),u&&this.setPitch(u)}},{key:"getLayers",value:function(){return this._handler&&this._handler.getLayers()||[]}},{key:"getLegends",value:function(){return this._handler&&this._handler.getLegends()||[]}},{key:"getLayerCatalog",value:function(){return this._handler&&this._handler.getLayerCatalog()||[]}},{key:"setLayersVisible",value:function(){var e;this._handler&&(e=this._handler).setLayersVisible.apply(e,arguments)}},{key:"toggleLayerVisible",value:function(){var e;this._handler&&(e=this._handler).toggleLayerVisible.apply(e,arguments)}},{key:"getWebMapType",value:function(){return this.type}},{key:"rectifyLayersOrder",value:function(){var e;this._handler&&(e=this._handler).rectifyLayersOrder.apply(e,arguments)}},{key:"updateOverlayLayer",value:function(){var e;this._handler&&(e=this._handler).updateOverlayLayer.apply(e,arguments)}},{key:"copyLayer",value:function(){var e;return this._handler&&(e=this._handler).copyLayer.apply(e,arguments)}},{key:"clean",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(e&&this._fire("mapbeforeremove",{map:this.map}),this._handler&&(this._handler.clean(e),this._handler=null),this.map=null,this.mapOptions&&(this.mapId||this.webMapInfo)&&(this.mapOptions.center=null,this.mapOptions.zoom=null))}},{key:"cleanLayers",value:function(){if(this.map){var e=this._cacheCleanLayers.filter(function(e){return!e.reused});this._handler&&this._handler.cleanLayers(e),this._cacheCleanLayers=[],this.clean(!1)}}},{key:"_initWebMap",value:function(){var e=this;if((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.clean(),this.webMapInfo){var t=this.webMapInfo;return t.mapParams={title:this.webMapInfo.title,description:this.webMapInfo.description},this.mapParams=t.mapParams,void Promise.resolve().then(function(){e._getMapInfo(t)}).catch(function(t){e._fire("mapcreatefailed",{error:t})})}this.mapId&&this.options.serverUrl?(this._taskID=new Date,this.getMapInfo(this._taskID)):Promise.resolve().then(function(){e._createMap("MapStyle")}).catch(function(t){e._fire("mapcreatefailed",{error:t})})}},{key:"setZoom",value:function(e){this.map&&(this.mapOptions.zoom=e,e!==+this.map.getZoom().toFixed(2)&&(e||0===e)&&this.map.setZoom(e,{from:"setZoom"}))}},{key:"setServerUrl",value:function(e){this._setServer(e),this.webMapService.setServerUrl(this.options.serverUrl)}},{key:"setWithCredentials",value:function(e){this.options.withCredentials=e,this.webMapService.setWithCredentials(e)}},{key:"setProxy",value:function(e){this.options.proxy=e,this.webMapService.setProxy(e)}},{key:"setMapId",value:function(e){var t=this;"string"==typeof e||"number"==typeof e?(this.mapId=e,this.webMapInfo=null):null!==e&&"object"===Pie(e)&&(this.webMapInfo=e,this.mapId=""),this.webMapService.setMapId(e),e&&setTimeout(function(){t._initWebMap()},0)}},{key:"getMapInfo",value:function(e){var t=this;this.webMapService.getMapInfo().then(function(r){t._taskID===e&&(t.mapParams=r.mapParams,t._getMapInfo(r))},function(e){throw e}).catch(function(e){t._fire("mapcreatefailed",{error:e}),console.log(e)})}},{key:"_createWebMapFactory",value:function(){throw new Error("_createWebMapFactory is not implemented")}},{key:"_mapInitializedHandler",value:function(e){var t=e.map;this.map=t,this._fire("mapinitialized",{map:this.map})}},{key:"_mapCreateSucceededHandler",value:function(e){this.mapParams=e.mapparams,this._cacheCleanLayers=e.layers,this._fire("mapcreatesucceeded",e)}},{key:"_addLayerChangedHandler",value:function(e){this._cacheCleanLayers=e.layers,this.fire("layeraddchanged",e)}},{key:"_getMapInfo",value:function(e){var t=+e.version.split(".")[0]>=3?"WebMap3":"WebMap2";this._createMap(t,e)}},{key:"_createMap",value:function(e,t){var r=this,n=_ie(_ie({},this.options),{},{iportalServiceProxyUrlPrefix:this.webMapService.iportalServiceProxyUrl}),o=_ie(_ie({},this.eventTypes.reduce(function(e,t){return e[t]=function(e){r._fire(t,e)},e},{})),{},{mapinitialized:this._mapInitializedHandler,mapcreatesucceeded:this._mapCreateSucceededHandler,layeraddchanged:this._addLayerChangedHandler}),i=BS()(this.mapOptions),a=this._createWebMapFactory(e),s=this.mapId||this.webMapInfo;for(var u in this._handler=new a(s,n,i),o)this._handler.on(u,o[u]);var l={},c=this.options.layerFilter;t&&(l=_ie(_ie({},t),{},{layers:"function"==typeof c?t.layers.filter(c):t.layers})),this.type=e,this._handler.initializeMap(l,this.map)}},{key:"_updateRasterSource",value:function(e,t){if(e){var r=this.map.getSource(e);Object.assign(r,t),this.map.style.sourceCaches[e].clearTiles(),this.map.style.sourceCaches[e].update(this.map.transform),this.map.triggerRepaint()}}},{key:"_getResizedZoom",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Aie,o=t.width,i=t.height,a=Math.abs(e.getEast()-e.getWest()),s=Math.abs(this._getBoundsRadian(e.getSouth())-this._getBoundsRadian(e.getNorth())),u=+Math.log2(n/(a/parseInt(o)*r)).toFixed(2),l=+Math.log2(n/(s/parseInt(i)*r)).toFixed(2);return u<=l?u:l}},{key:"_getBoundsRadian",value:function(e){return 180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360))}},{key:"_centerValid",value:function(e){return!(!e||!(e.length>0||Pie(e)===r.LngLat||e.lng))}},{key:"_getWebMapInstance",value:function(){return this._handler}},{key:"_setServer",value:function(e){this.options.server=wo(e),this.options.serverUrl=this.options.server}},{key:"_fire",value:function(e,t){var r=this;([["mapcreatesucceeded","addlayerssucceeded"],["mapcreatefailed","getmapfailed"],["layercreatefailed","getlayersfailed"]].find(function(t){return t.includes(e)})||[e]).forEach(function(e){r.fire(e,t)})}}])&&kie(o.prototype,i),a&&kie(o,a),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,i,a}()}function Lie(e){"@babel/helpers - typeof";return(Lie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nie(e){return function(e){if(Array.isArray(e))return Mie(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Mie(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mie(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mie(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Uie(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=Jie(this,t)).map=r.map,e.layers=r.layers||[],e.appendLayers=r.appendLayers||!1,e.unexpectedSourceNames=["tdt-search-","tdt-route-","smmeasure","mapbox-gl-draw","maplibre-gl-draw",/tracklayer-\d+-line/],e.uniqueId=+new Date,e.layersVisibleMap=new Map,e.eventTypes=["layerupdatechanged"],e._styleDataUpdatedHandler=e._styleDataUpdatedHandler.bind(e),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yie(e,t)}(t,Ea),r=t,(n=[{key:"setLayers",value:function(e){this.layers=e}},{key:"createLayerCatalogs",value:function(){throw new Error("createLayerCatalogs is not implemented")}},{key:"getSelfLayerIds",value:function(){throw new Error("getSelfLayerIds is not implemented")}},{key:"initLayers",value:function(){throw new Error("initLayers is not implemented")}},{key:"createAppreciableLayers",value:function(){var e=this.initLayers();return this._initAppreciableLayers(e)}},{key:"getLayerCatalog",value:function(){var e=this.createLayerCatalogs();return this._updateLayerCatalogsVisible(e),this._updateImmutableOrderLayers(e)}},{key:"getLayers",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.createAppreciableLayers();return e&&this.removeLayerExtralFields(t),this._updateImmutableOrderLayers(t,!0)}},{key:"getSelfLayers",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayers(),t=this.getSelfLayerIds();return e.filter(function(e){return e.renderLayers.some(function(e){return t.some(function(t){return t===e})})})}},{key:"toggleLayerVisible",value:function(e,t){var r=t?"visible":"none";if("group"===e.type){var n=this._getLayerVisibleId(e);this.layersVisibleMap.set(n,t);var o=_o(e.children);o.length?this.setLayersVisible(o,r):this.map.style.fire("data",{dataType:"style"})}else this.setLayersVisible([e],r)}},{key:"setLayersVisible",value:function(e,t){var r=this;e.forEach(function(e){var n=r._getLayerVisibleId(e);if(r.layersVisibleMap.set(n,"visible"===t),e.CLASS_INSTANCE&&e.CLASS_INSTANCE.show&&e.CLASS_INSTANCE.hide)return"visible"===t?e.CLASS_INSTANCE.show():e.CLASS_INSTANCE.hide(),void r.map.style.fire("data",{dataType:"style"});e.renderLayers.forEach(function(n){("L7Layer"!==e.CLASS_NAME||r.map.getLayer(n))&&r.map.setLayoutProperty(n,"visibility",t)})})}},{key:"concatExpectLayers",value:function(e,t,r){var n=r.filter(function(e){return!t.some(function(t){return t===e.id})});return this._filterExpectedLayers(e.concat(n))}},{key:"destroy",value:function(){this.map.off("styledata",this._styleDataUpdatedHandler)}},{key:"initDatas",value:function(){this.map&&(this._styleDataUpdatedHandler(),this._registerMapEvent())}},{key:"removeLayerExtralFields",value:function(e){e.forEach(function(e){delete e.metadata})}},{key:"_initAppreciableLayers",value:function(e){var t=this;return e.reduce(function(e,r){var n=Po(r),o=e.find(function(e){return e.id===n});o||(o=t._createCommonFields(r,n),e.push(o));var i=o.renderLayers.concat(r.layerInfo?r.layerInfo.renderLayers:r.id);return o.renderLayers=Array.from(new Set(i)),e},[])}},{key:"_initSourceList",value:function(e){var t=this;return e.slice().reverse().reduce(function(e,r){var n=r.renderSource.sourceLayer?"".concat(r.renderSource.id,"_").concat(t.uniqueId):r.id,o=r.metadata.SM_Layer_Title||(r.renderSource.sourceLayer?r.renderSource.id:r.title),i=e.find(function(e){return e.id===n});if(!i){var a=new Bie(Vie(Vie({},r),{},{id:n,title:o}));e.push(a),i=a}return i.addLayer(r),e},[])}},{key:"_filterExpectedLayers",value:function(e){var t=this;return e.filter(function(e){return t._excludeLayer(e)})}},{key:"_excludeSource",value:function(e){for(var t=0;t0){var i=this._findLayerCatalog(o.children,t);if(i)return i}}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"_getLayerVisibleId",value:function(e){return"".concat(e.type,"-").concat(e.id)}},{key:"_getLayerVisible",value:function(e){var t=this._getLayerVisibleId(e);return this.layersVisibleMap.has(t)?this.layersVisibleMap.get(t):e.visible}},{key:"_updateLayerCatalogsVisible",value:function(e){var t,r=Fie(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;n.visible=this._getLayerVisible(n),"group"===n.type&&this._updateLayerCatalogsVisible(n.children)}}catch(e){r.e(e)}finally{r.f()}}},{key:"_registerMapEvent",value:function(){this.map.on("styledata",this._styleDataUpdatedHandler)}},{key:"_styleDataUpdatedHandler",value:function(){var e=this.getLayers();this.triggerEvent("layerupdatechanged",{layers:e,relevantLayers:this.getSelfLayers(e),layerCatalog:this.getLayerCatalog()})}},{key:"_updateImmutableOrderLayers",value:function(e,t){var r=e.filter(function(e){return e.layerOrder&&"top"===e.layerOrder.toLowerCase()}),n=r.filter(function(e){return"MIGRATION"===e.type}),o=r.filter(function(e){return"MIGRATION"!==e.type});r=n.concat(o);var i=e.filter(function(e){return e.layerOrder&&"bottom"===e.layerOrder.toLowerCase()}),a=e.filter(function(e){return!e.layerOrder||"auto"===e.layerOrder.toLowerCase()});return t?i.concat(a,r):r.concat(a,i)}}])&&Hie(r.prototype,n),o&&Hie(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Xie(e){"@babel/helpers - typeof";return(Xie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zie(e){return function(e){if(Array.isArray(e))return $ie(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return $ie(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$ie(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=iae(this,t,[r])).initDatas(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sae(e,t)}(t,Qie),r=t,(n=[{key:"createLayerCatalogs",value:function(){var e=this.getLayers(!1);return this._initSourceList(e)}},{key:"getSelfLayerIds",value:function(){return this.layers.reduce(function(e,t){return e.concat(t.renderLayers)},[])}},{key:"initLayers",value:function(){var e=this,t=this._getAllLayersOnMap(),r=t;this.appendLayers&&(r=t.filter(function(t){return e.layers.some(function(r){return e._isBelongToMapJSON(r,t)})}));var n=[],o=[];return this.layers.forEach(function(t){var i=r.filter(function(r){return e._isBelongToMapJSON(t,r)}),a=i.find(function(e){return e.id===t.id});if(i.length>0){if(a)n.push(tae(tae({},a),{},{layerInfo:tae(tae({},t),{},{dataSource:t.dataSource||t.serverId&&{serverId:t.serverId}})}));else{var s=i.map(function(e){var r=Object.assign({},e);return r.metadata=Object.assign({},r.metadata,{SM_Layer_Title:t.name}),r});n.push.apply(n,Zie(s))}o.push.apply(o,Zie(t.renderLayers))}}),this.concatExpectLayers(n,o,r)}},{key:"_isBelongToMapJSON",value:function(e,t){return e.renderLayers&&e.renderLayers.some(function(e){return e===t.id})}}])&&nae(r.prototype,n),o&&nae(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function lae(e){"@babel/helpers - typeof";return(lae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fae(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function bae(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function gae(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){bae(i,n,o,a,s,"next",e)}function s(e){bae(i,n,o,a,s,"throw",e)}a(void 0)})}}function wae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Sae(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{layerFilter:function(){return!0}},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{style:{version:8,sources:{},layers:[]}};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),t=Pae(this,o,[e,r,n]),"string"!=typeof e&&"number"!=typeof e||(t.mapId=e),t._centerValid(n.center)&&(t.center=n.center),t.zoom=n.zoom,t.renderWorldCopies=n.renderWorldCopies,t.bounds=n.bounds,t.bearing=n.bearing,t.pitch=n.pitch,t.rasterTileSize=n.rasterTileSize||256,t.layerFilter=r.layerFilter,t.checkSameLayer=r.checkSameLayer,t._taskID=new Date,t._cacheLayerId=new Map,t._layerTimerList=[],t._appendLayers=!1,t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jae(e,t)}(o,e),i=o,(a=[{key:"initializeMap",value:function(e,t){t&&(this._appendLayers=!0,this.map=t),this._getMapInfo(e,this._taskID)}},{key:"cleanLayers",value:function(e){kae(Eae(o.prototype),"cleanLayers",this).call(this,e),this.echartslayer.forEach(function(e){e.remove()})}},{key:"clean",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),this.stopCanvg(),e&&this.map.remove(),this.map=null,this._legendList=[],this.center=null,this.zoom=null,this._dataflowService&&(this._dataflowService.off("messageSucceeded",this._handleDataflowFeaturesCallback),this._dataflowService.off("subscribesucceeded",this._initDataflowLayerCallback)),this._unprojectProjection=null,this._cacheLayerId=new Map),this._layerTimerList.length&&(this._layerTimerList.forEach(function(e){clearInterval(e)}),this._layerTimerList=[])}},{key:"_initWebMap",value:function(){}},{key:"_loadLayers",value:function(e,t){var r=this;if(this.map){if(this.map.getCRS().epsgCode!==this.baseProjection&&!this.ignoreBaseProjection)return void this.fire("projectionnotmatch",{});this._handleLayerInfo(e,t)}else setTimeout(function(){r._createMap(e),r.map.on("load",function(){r._handleLayerInfo(e,t)})},0)}},{key:"_setCRS",value:function(e,t,r){if(!n.CRS.get(e)){var o=new n.CRS(e,t,r,r[2]>180?"meter":"degree");n.CRS.set(o)}}},{key:"_getMapInfo",value:function(e,t){var r=this;this._mapInfo=e;var o,i,a=e.projection;this.baseProjection=e_(a);var s=$O(this.baseProjection,this.specifiedProj4);if(s&&(i=s),n.CRS.get(this.baseProjection))this._defineProj4(a),o=[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],this._setCRS(this.baseProjection,i,o),this._loadLayers(e,t);else if(e.baseLayer&&"MAPBOXSTYLE"===e.baseLayer.layerType){var u=e.baseLayer.dataSource.url;u.indexOf("/restjsr/")>-1&&!/\/style\.json$/.test(u)&&(u+="/style.json"),this.webMapService.getMapBoxStyle(u).then(function(n){o=n&&n.metadata&&n.metadata.indexbounds?n.metadata.indexbounds:[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],r._defineProj4(a),r._setCRS(r.baseProjection,i,o),r._loadLayers(e,t)})}else if(e.baseLayer&&"TILE"===e.baseLayer.layerType)this.getEpsgCodeWKT("".concat(e.baseLayer.url,"/prjCoordSys.wkt"),{withoutFormatSuffix:!0,withCredentials:this.webMapService.handleWithCredentials("",e.baseLayer.url,!1)}).then(function(n){i||(i=n),r.getBounds("".concat(e.baseLayer.url,".json"),{withoutFormatSuffix:!0,withCredentials:r.webMapService.handleWithCredentials("",e.baseLayer.url,!1)}).then(function(n){o=n&&n.bounds?[n.bounds.leftBottom.x,n.bounds.leftBottom.y,n.bounds.rightTop.x,n.bounds.rightTop.y]:[e.extent.leftBottom.x,e.extent.leftBottom.y,e.extent.rightTop.x,e.extent.rightTop.y],r._defineProj4(i,a),r._setCRS(r.baseProjection,i,o),r._loadLayers(e,t)})});else{var l=new Error("Unsupported coordinate system!");console.log(l),this.fire("mapcreatefailed",{error:l})}}},{key:"_handleLayerInfo",value:function(e,t){var r=this;e=this._setLayerID(e),this._mapInfo=e,this.layerAdded=0,this.expectLayerLen=0;var n=e,o=n.layers,i=n.grid;if(this._setExpectLayerLen(e),0===this.expectLayerLen&&this._sendMapToUser(0,0),this._shouldLoadBaseLayer(e,this.layerFilter)&&this._initBaseLayer(e,function(){r._addLayerSucceeded()}),o&&0!==o.length){var a=o;"function"==typeof this.layerFilter&&(a=o.filter(this.layerFilter)),this._initOverlayLayers(a,t)}i&&i.graticule&&this._initGraticuleLayer(i.graticule)}},{key:"_setExpectLayerLen",value:function(e){this._shouldLoadBaseLayer(e,this.layerFilter)&&this.expectLayerLen++;var t=e.layers;t&&t.length>0&&("function"==typeof this.layerFilter&&(t=t.filter(this.layerFilter)),this.expectLayerLen+=t.length),e.grid&&e.grid.graticule&&this.expectLayerLen++}},{key:"_shouldLoadBaseLayer",value:function(e,t){var r=e.baseLayer;return!!r&&("function"!=typeof t||t(r))}},{key:"_createMap",value:function(e){var t=this,o=this._getLabelFontFamily(e),i=this._getMapCenter(e),a=e.level||0,s=this.mapOptions,u=s.bounds,l=s.minZoom,c=s.maxZoom,f=this.mapOptions.interactive;if(isNaN(l)&&(l=e.minScale?this._transformScaleToZoom(e.minScale,n.CRS.get(this.baseProjection)):0),isNaN(c)&&(c=e.maxScale?this._transformScaleToZoom(e.maxScale,n.CRS.get(this.baseProjection)):22),e.visibleExtent&&4===e.visibleExtent.length&&!u&&(u=[this._unproject([e.visibleExtent[0],e.visibleExtent[1]]),this._unproject([e.visibleExtent[2],e.visibleExtent[3]])]),l>c){var p=[c,l];l=p[0],c=p[1]}u||(a+=e.minScale&&e.maxScale?Math.min(this._transformScaleToZoom(e.minScale,n.CRS.get(this.baseProjection)),this._transformScaleToZoom(e.maxScale,n.CRS.get(this.baseProjection))):+Math.log2(this._getResolution(n.CRS.get(this.baseProjection).getExtent())/this._getResolution(e.extent)).toFixed(2)),this.map=new r(Sae(Sae({},this.mapOptions),{},{container:this.target,center:this.center||i,zoom:this.zoom||a,minZoom:l,maxZoom:c,bearing:this.bearing||0,pitch:this.pitch||0,bounds:u,interactive:void 0===f||f,style:{version:8,sources:{},layers:[]},crs:this.baseProjection,localIdeographFontFamily:o||"",renderWorldCopies:this.renderWorldCopies||!1,transformRequest:function(e,r){if("Tile"===r){t.isSuperMapOnline&&0===e.indexOf("http://")&&(e="https://www.supermapol.com/apps/viewer/getUrlResource.png?url=".concat(encodeURIComponent(e))),t.webMapService.isIportalResourceUrl(e)&&(e=t.webMapService.handleParentRes(e));var n=t.webMapService.handleProxy("image");return{url:e,credentials:t.webMapService.handleWithCredentials(n,e,!1)?"include":void 0}}return{url:e}},fadeDuration:0})),this.fire("mapinitialized",{map:this.map})}},{key:"_createMVTBaseLayer",value:function(e,t){var r=this,n=e.dataSource.url;n.indexOf("/restjsr/")>-1&&!/\/style\.json$/.test(n)&&(n+="/style.json"),this.webMapService.getMapBoxStyle(n).then(function(n){if(Object.keys(n.sources).some(function(e){return r.map.getSource(e)}))t&&t();else{n.layers.forEach(function(t){t.layout&&(t.layout.visibility=r._getVisibility(e.visible))}),r.map.addStyle(n);var o=[];n.layers.forEach(function(e){"background"!==e.type&&o.push(e.id)}),r._setCacheLayer({parentLayerId:e.layerID||e.name,subRenderLayers:o.map(function(e){return{layerId:e}})}),t&&t()}},function(e){throw t&&t(),new Error(e)}).catch(function(t){r.fire("layercreatefailed",{error:t,layer:e,map:r.map})})}},{key:"_initBaseLayer",value:function(e,t){var r,n=e.baseLayer||e,o=this.getBaseLayerType(n),i=this.getMapurls();switch(this.baseLayerProxy=this.webMapService.handleProxy("image"),o){case"TIANDITU":this.baseLayerProxy=null,this._createTiandituLayer(e,t);break;case"BING":this.baseLayerProxy=null,this._createBingLayer(n.layerID||n.name,n,t);break;case"WMS":this._createWMSLayer(n,t);break;case"WMTS":this._createWMTSLayer(n,t);break;case"TILE":this._createDynamicTiledLayer(n,t);break;case"CLOUD":case"XYZ":r=i[n.layerType].replace("{googleMapsLanguage}",this.googleMapsLanguage).replace("{googleMapsAPIKey}",this.googleMapsAPIKey),this._createXYZLayer(n,r,t);break;case"BAIDU":this.fire("baidumapnotsupport",{}),t&&t();break;case"MAPBOXSTYLE":this._createMVTBaseLayer(n,t)}}},{key:"_initOverlayLayers",value:function(e,t){var r=this;this.expectLayerLen>0&&e.forEach(function(e){var n=r.webMapService.getDatasourceType(e);if("SAMPLE_DATA"===n)return r._addLayerSucceeded(),void r.fire("layercreatefailed",{error:"SAMPLE DATA is not supported",layer:e,map:r.map});if(e.visibleScale){var o=e.visibleScale,i=o.minScale,a=o.maxScale,s=r.map.getCRS();e.minzoom=Math.max(r._transformScaleToZoom(i,s),0),e.maxzoom=Math.min(24,r._transformScaleToZoom(a,s)+1e-7)}"tile"===n?(e.autoUpdateTime&&r._layerTimerList.push(setInterval(function(){r._initBaseLayer(e)},e.autoUpdateTime)),r._initBaseLayer(e,function(){r._addLayerSucceeded()})):(r.getLayerFeatures(e,t,n),e.autoUpdateTime&&r._layerTimerList.push(setInterval(function(){r.getLayerFeatures(e,t,n)},e.autoUpdateTime)))},this)}},{key:"_initOverlayLayer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=e.layerID,o=e.layerType,i=e.visible,a=e.style,s=e.featureType,u=e.projection;e.visible=i?"visible":"none",t=Oo({sourceId:n,features:t,mergeByField:r,map:this.map}),"restMap"!==o?"mvt"!==o?(t&&t[0]&&t[0].geometry&&"Polygon"===t[0].geometry.type&&(t=this._handleMultyPolygon(t)),t&&u&&"EPSG:4326"!==u&&e.dataSource&&"REST_DATA"!==e.dataSource.type&&(this._unprojectProjection=this._defineProj4(u),t=this.transformFeatures(t)),t=this.handleLayerFeatures(t,e),"VECTOR"===o?"POINT"===s?"SYMBOL_POINT"===a.type?this._createSymbolLayer(e,t):this._createGraphicLayer(e,t):(this._createVectorLayer(e,t),this._addLayerSucceeded({layerInfo:e,features:t})):"UNIQUE"===o?this._createUniqueLayer(e,t):"RANGE"===o?this._createRangeLayer(e,t):"HEAT"===o?this._createHeatLayer(e,t):"MARKER"===o?this._createMarkerLayer(e,t):"MIGRATION"===o?this._createMigrationLayer(e,t):"RANK_SYMBOL"===o?this._createRankSymbolLayer(e,t):this._isDataflowLayer(o)&&this._createDataflowLayer(e)):this._createMvtLayer(t.info,e,t.featureType):this._createRestMapLayer(t,e)}},{key:"_initGraticuleLayer",value:function(e){var t=this._createGraticuleOptions(e),r=new n.supermap.GraticuleLayer(t);this._setGraticuleDash(t.strokeStyle,r),this._graticuleLayer=r,this.map.addLayer(r),this._setCacheLayer({parentLayerId:r.id,subRenderLayers:[{layerId:r.id},{layerId:r.sourceId}],metadata:{SM_Layer_Order:"Top"}}),this._addLayerSucceeded()}},{key:"_createGraticuleOptions",value:function(e){var t=e.extent,r=e.lonLabelStyle,n=e.latLabelStyle,o=e.strokeColor,i=e.lineDash,a=e.strokeWidth,s=e.interval,u={lineColor:o,lindDasharray:i,lineWidth:a};return r={textFont:r.fontFamily.split(","),textSize:r.fontSize,textAnchor:n.textBaseline,textColor:r.fill,textHaloColor:r.outlineColor,textHaloWidth:r.outlineWidth},n={textFont:n.fontFamily.split(","),textSize:n.fontSize,textAnchor:n.textBaseline,textColor:n.fill,textHaloColor:n.outlineColor,textHaloWidth:n.outlineWidth},t=t||this.map.getCRS().extent,{minZoom:1,strokeStyle:u,extent:t=[this._unproject([t[0],t[1]]),this._unproject([t[2],t[3]])],interval:s&&s[0],lngLabelStyle:r,latLabelStyle:n,layerID:"graticuleLayer_".concat(+new Date)}}},{key:"_setGraticuleDash",value:function(e,t){var r=this;this.map.on("zoomend",function(){r.map.getZoom()<3?t.setStrokeStyle(Sae(Sae({},e),{},{lineOpacity:.5,lineWidth:e.lineWidth/2,lindDasharray:[.1,3]})):t.setStrokeStyle(e)})}},{key:"_createTiandituLayer",value:function(e,t){var r=this._getTiandituUrl(e),n=e.baseLayer,o=n.labelLayerVisible,i=n.name,a=n.visible,s=Boolean(o),u=r.labelUrl,l=r.tiandituUrl;this._addBaselayer({url:l,layerID:i,visibility:a}),s&&this._addBaselayer({url:u,layerID:this._getTdtLabelLayerName(i),parentLayerId:i,visibility:a}),t&&t()}},{key:"_createWMTSLayer",value:function(e,t){var r=this;this.webMapService.getWmtsInfo(e,this.map.getCRS().epsgCode).then(function(n){var o=e.layerID||e.name;if(n.isMatched){var i=r._getWMTSUrl(Object.assign({},e,n));r._addBaselayer({url:[i],layerID:o,visibility:e.visible,minzoom:n.matchMinZoom,maxzoom:n.matchMaxZoom,isIserver:!1,bounds:n.bounds}),t&&t()}},function(e){throw t&&t(),new Error(e)}).catch(function(t){r.fire("layercreatefailed",{error:t,layer:e,map:r.map})})}},{key:"_createBingLayer",value:function(){var e=gae(vae().mark(function e(t,r,n){var o,i,a,s;return vae().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/RoadOnDemand?uriScheme=https&include=ImageryProviders&key=".concat(this.bingMapsKey,"&c=zh-cn"),e.next=3,this._fetchRequest(o,"json",{withoutFormatSuffix:!0});case 3:if(200===(i=e.sent).statusCode&&1===i.resourceSets.length&&1===i.resourceSets[0].resources.length){e.next=6;break}return e.abrupt("return");case 6:a=i.resourceSets[0].resources[0],s=a.imageUrlSubdomains.map(function(e){return a.imageUrl.replace("{subdomain}",e)}),this._addBaselayer({url:s,layerID:t,visibility:r.visible}),n&&n();case 10:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"_createXYZLayer",value:function(e,t,r){var n=[];if("OSM"===e.layerType){for(var o=t.match(/\w\-\w/g)[0],i=o[0],a=o[2],s="",u=97;u<123;u++)s+=String.fromCharCode(u);for(var l=s.split(""),c=l.indexOf(i),f=l.indexOf(a),p=l.slice(c,f+1),h=0;h1&&void 0!==arguments[1]?arguments[1]:"1.1.1",r=e.url,n={service:"WMS",request:"GetMap",layers:null!==e.layers&&"object"===mae(e.layers)?e.layers.join(","):e.layers||"0",styles:"",format:"image/png",transparent:"true",version:t,width:256,height:256};return"1.3.0"===t?(n.bbox="EPSG:4326"===this.baseProjection?"{bbox-wms-1.3.0}":"{bbox-epsg-3857}",n.crs=this.baseProjection):(n.bbox="{bbox-epsg-3857}",n.srs=this.baseProjection),L.urlAppend(r,this._getParamString(n,r))}},{key:"_setLayerID",value:function(e){var t=this,r={},n=e.baseLayer,o=e.layers,i=void 0===o?[]:o;if(!this.checkSameLayer){var a=this._generateUniqueLayerId({layerId:n.name,repeatIndex:0});n.title=n.name,n.name=a.newId}var s=i.map(function(e){return e.name}),u=i.map(function(e,o){e.name in r||(r[e.name]=n.name===e.name?1:0);var i=s.indexOf(e.name),a=s.lastIndexOf(e.name);o>i&&o<=a&&(r[e.name]=r[e.name]+1);var u=r[e.name]?"".concat(e.name,"-").concat(r[e.name]):e.name;if(!t.checkSameLayer||"raster"!==e.layerType){var l=t._generateUniqueLayerId({layerId:u,repeatIndex:r[e.name],layerType:e.layerType}),c=l.newId,f=l.newIndex;r[e.name]=f,u=c}return Object.assign(e,{layerID:u})});return e.layers=u,e.baseLayer=n,e}},{key:"_generateUniqueLayerId",value:function(e){var t=e.layerId,r=e.repeatIndex,n=e.layerType;return this.map.getLayer(t)?(r++,t=t.match(/-\d+&/gi)?t.replace(/\d+$/gi,r):"".concat(t,"-").concat(r),this._generateUniqueLayerId(Sae(Sae({},e),{},{layerId:t,repeatIndex:r}))):this._isDataflowLayer(n)?{newId:"".concat(t,"_").concat(+new Date),newIndex:r+1}:{newId:t,newIndex:r}}},{key:"_createRestMapLayer",value:function(e,t){var r=this;e.forEach(function(e){t=r.getRestMapLayerInfo(e,t),r._initBaseLayer(t)}),this._addLayerSucceeded()}},{key:"_addLayerSucceeded",value:function(e){(((e||{}).layerInfo||{}).labelStyle||{}).labelField&&"DATAFLOW_POINT_TRACK"!==e.layerInfo.layerType&&this._addLabelLayer(e.layerInfo,e.features,!1),this.layerAdded++,this._sendMapToUser(this.layerAdded,this.expectLayerLen)}},{key:"_createDataflowLayer",value:function(e){var t=new n.supermap.DataFlowService(e.wsUrl).initSubscribe();this._handleDataflowFeaturesCallback=this._handleDataflowFeatures.bind(this,e),this._initDataflowLayerCallback=this._initDataflowLayer.bind(this,e),t.on("subscribesucceeded",this._initDataflowLayerCallback),t.on("messageSucceeded",this._handleDataflowFeaturesCallback),this._dataflowService=t}},{key:"_initDataflowLayer",value:function(){this._addLayerSucceeded()}},{key:"_handleDataflowFeatures",value:function(e,t){var r=[JSON.parse(t.data)];if(this.fire("dataflowfeatureupdated",{features:r,identifyField:e.identifyField,layerID:e.layerID}),"EPSG:4326"!==e.projection&&(r=this.transformFeatures(r)),e.filterCondition){var n=this.replaceFilterCharacter(e.filterCondition),o=r[0].properties||{};n=this.parseCondition(n,Object.keys(o));var i=this.parseConditionFeature(o),a="select * from json where ("+n+")",s=window.jsonsql.query(a,{attributes:i});s&&s.length>0&&this._addDataflowLayer(e,r[0])}else this._addDataflowLayer(e,r[0])}},{key:"_getDataFlowRotateStyle",value:function(e,t,r){var n=["match",["get",r]];return e.forEach(function(e){var o;if((o=void 0!==t&&"未设置"!==t&&"None"!==t?e.properties[t]:0)>360||o<0)return null;n.push(e.properties[r],parseInt(o))}),n.push(0),n}},{key:"_addDataflowLayer",value:function(){var e=gae(vae().mark(function e(t,r){var n,o,i,a,s,u;return vae().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.layerID,"DATAFLOW_HEAT"!==t.layerType){e.next=5;break}this.map.getSource(n)?this._updateDataFlowFeature(n,r,t):this._createHeatLayer(t,[r],!1),e.next=20;break;case 5:if(o=t.pointStyle,t.style=o,this.map.getSource(n)){e.next=17;break}if(i=this._getDataFlowRotateStyle([r],t.directionField,t.identifyField),!["BASIC_POINT","SVG_POINT","IMAGE_POINT"].includes(o.type)){e.next=14;break}return e.next=12,this._createGraphicLayer(t,[r],null,i,!1);case 12:e.next=15;break;case 14:this._createSymbolLayer(t,[r],null,i,!1);case 15:e.next=18;break;case 17:this._updateDataFlowFeature(n,r,t,"point");case 18:t.labelStyle&&t.visible&&(a=this._getSymbolLabelLayerName(n),this.map.getSource(a)?this._updateDataFlowFeature(a,r,t):this._addLabelLayer(t,[r],!0)),t.lineStyle&&t.visible&&(this.map.getSource(n+"-line")?this._updateDataFlowFeature(n+"-line",r,t,"line"):(s=r.geometry.coordinates,u={type:"Feature",properties:r.properties,geometry:{type:"LineString",coordinates:[s]}},this._createVectorLayer({style:t.lineStyle,featureType:"LINE",visible:"visible",layerID:n+"-line",parentLayerId:n},[u])));case 20:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"_updateDataFlowFeature",value:function(e,t,r,n){var o=r.identifyField,i=r.maxPointCount,a=r.directionField,s=BS()(this.map.getSource(e)._data.features),u=!1;if(s.forEach(function(e,r){if(e.properties[o]===t.properties[o])if(u=!0,"line"===n){var a=e.geometry.coordinates;a.push(t.geometry.coordinates),i&&a.length>i&&a.splice(0,a.length-i),s[r].geometry.coordinates=a}else s[r]=t}),u||("line"===n?s.push({type:"Feature",properties:t.properties,geometry:{type:"LineString",coordinates:[t.geometry.coordinates]}}):s.push(t)),this.map.getSource(e).setData({type:"FeatureCollection",features:s}),"point"===n){var l=r.pointStyle.type,c=this._getDataFlowRotateStyle(s,a,o);["SVG_POINT","IMAGE_POINT"].includes(l)?this.map.setLayoutProperty(e,"icon-rotate",c):"SYMBOL_POINT"===l&&this.map.setLayoutProperty(e,"text-rotate",c)}}},{key:"_createMigrationLayer",value:function(e,t){var r=e.layerID,n=e.layerType,o=this.getEchartsLayerOptions(e,t,"GLMap");o.GLMap={roam:!0};var i=new window.EchartsLayer(this.map);i.chart.setOption(o),this.echartslayer.push(i),this._addLayer({id:r,type:n,setLayoutProperty:function(e,t){"visibility"===e&&(i.chart._dom.style.display="visible"===t?"block":"none")},metadata:{SM_Layer_Order:"top"}}),this._addLayerSucceeded({layerInfo:e,features:t})}},{key:"_createRankSymbolLayer",value:function(e,t){var r=e.minzoom,n=e.maxzoom,o=e.themeSetting.themeField,i=e.themeSetting.colors,a=e.style,s=e.featureType,u=this.createRankStyleSource(e,t).styleGroups;t=this.getFilterFeatures(e.filterCondition,t);for(var l=["match",["get","index"]],c=["match",["get","index"]],f=0;f0&&(a.fillColor=c),"SYMBOL_POINT"===a.type)this._createSymbolLayer(e,t,l);else if(["SVG_POINT","IMAGE_POINT"].includes(a.type))this._createGraphicLayer(e,t,l);else{var m={type:"geojson",data:{type:"FeatureCollection",features:t}},v={layout:{visibility:e.visible},style:this._transformStyleToMapBoxGl(e.style,s,l,"circle-radius")},b=e.layerID;this._addOverlayToMap({type:s,source:m,layerID:b,layerStyle:v,minzoom:r,maxzoom:n}),this._addLayerSucceeded({layerInfo:e,features:t})}}},{key:"_addTextBackgroundImage",value:function(e){if(!e[3])return"";for(var t=new Uint8Array(1600),r=0;r<20;r++)for(var n=0;n<20;n++){var o=4*(20*n+r);t[o+0]=e[0],t[o+1]=e[1],t[o+2]=e[2],t[o+3]=255*e[3]}var i="text-background-".concat(e.join("-"));return this.map.hasImage(i)||this.map.addImage(i,{width:20,height:20,data:t},{stretchX:[[0,20]],stretchY:[[0,20]],content:[0,0,20,20]}),i}},{key:"_addLabelLayer",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this._getSymbolLabelLayerName(e.layerID);if(!this.map.getLayer(n)){var o=e.labelStyle,i=t[0]&&t[0].properties,a=o.labelField.replace(/{(.+)}/g,"$1");if(i&&i[a]){var s=o.backgroundFill,u=void 0===s?[255,255,255,0]:s,l=o.fontFamily,c=e.minzoom,f=e.maxzoom,p=parseFloat(o.fontSize||14),h="";"line"!==o.placement&&(h=this._addTextBackgroundImage(u)),u="rgba(".concat(u.join(","),")");var y="rgba(255,255,255,0)";o.outlineColor&&o.outlineWidth>0&&(y=o.outlineColor);var d=(o.outlineWidth||0)/2,m=o.textAlign||"center";o.textBaseline&&"middle"!==o.textBaseline&&(m="".concat(o.textBaseline).concat("center"===m?"":"-".concat(m)));var v="POINT"===e.featureType?[o.offsetX/p||0,o.offsetY/p||0]:[0,0],b={"text-field":"{".concat(o.labelField,"}"),"text-size":p,"text-offset":v,"text-font":l?[l]:["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line"===o.placement?"POLYGON"===e.featureType?"line":"line-center":"point","text-max-angle":"POLYGON"===e.featureType?40:30,"symbol-spacing":"POLYGON"===e.featureType?200:50,"text-anchor":m,"text-line-height":1.2,visibility:e.visible};h&&Object.assign(b,{"icon-image":h,"icon-allow-overlap":!0,"icon-text-fit":"both","icon-text-fit-padding":[2,4,2,4]}),this._addLayer({id:n,type:"symbol",source:this.map.getSource(e.layerID)&&!r?e.layerID:{type:"geojson",data:{type:"FeatureCollection",features:t}},paint:{"text-color":o.fill,"text-halo-color":y,"text-halo-width":d},layout:b,minzoom:c||0,maxzoom:f||22},e.layerID)}}}},{key:"_createSymbolLayer",value:function(e,t,r,n){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=arguments.length>5?arguments[5]:void 0;document.getElementById("".concat(this.target)).classList.add("supermapol-icons-map");var a=e.layerID,s=e.minzoom,u=e.maxzoom,l=e.style,c=l.unicode,f=String.fromCharCode(parseInt(c.replace(/^&#x/,""),16)),p=r||(Array.isArray(l.fontSize)?l.fontSize:l.fontSize&&parseFloat(l.fontSize)||12),h=Array.isArray(l.rotation)?l.rotation:180*(l.rotation||0)/Math.PI;this.map.getSource(a)||this.map.addSource(a,{type:"geojson",data:{type:"FeatureCollection",features:[]}});var y={id:a,type:"symbol",source:a,paint:{"text-color":Array.isArray(l.fillColor)?l.fillColor:AO.getColorWithOpacity(l.fillColor,l.fillOpacity),"text-halo-color":Array.isArray(l.strokeColor)?l.strokeColor:AO.getColorWithOpacity(l.strokeColor||"rgba(0,0,0,0)",l.strokeOpacity),"text-halo-width":l.strokeWidth||0},layout:{"text-field":f,"text-size":p,"text-font":["supermapol-icons"],"text-rotate":n||h||0,"text-offset":Array.isArray(l.offsetX)?l.offsetX:[l.offsetX/2||0,l.offsetY/2||0],"text-allow-overlap":!0,visibility:e.visible},minzoom:s||0,maxzoom:u||22};i&&(y.filter=i),this._addLayer(y),this.map.getSource(a).setData({type:"FeatureCollection",features:t}),o&&this._addLayerSucceeded({layerInfo:e,features:t})}},{key:"_createGraphicLayer",value:function(){var e=gae(vae().mark(function e(t,r,n,o){var i,a,s=this,u=arguments;return vae().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=!(u.length>4&&void 0!==u[4])||u[4],a=u.length>5?u[5]:void 0,e.abrupt("return",new Promise(function(e){var u=t.layerID,l=t.minzoom,c=t.maxzoom,f=t.style,p={type:"geojson",data:{type:"FeatureCollection",features:r}};s.map.getSource(u)?s.map.getSource(u).setData(p.data):s.map.addSource(u,p);var h="imageIcon-".concat(u);if("IMAGE_POINT"===f.type){var y=f.imageInfo;s.map.loadImage(y.url,function(p,y){if(p)console.error(p);else{var d=2*Number.parseFloat((f.radius/y.width).toFixed(2));!s.map.hasImage(h)&&s.map.addImage(h,y);var m={id:u,type:"symbol",source:u,layout:{"icon-image":h,"icon-anchor":"bottom-right","icon-size":n||d,"icon-allow-overlap":!0,visibility:t.visible,"icon-offset":[f.offsetX*y.width||0,f.offsetY*y.height||0],"icon-rotate":o||180*(t.style.rotation||0)/Math.PI},minzoom:l||0,maxzoom:c||22};a&&(m.filter=a),s._addLayer(m),i&&s._addLayerSucceeded({layerInfo:t,features:r}),e()}})}else if("SVG_POINT"===f.type){var d=f.url;s._svgDiv||(s._svgDiv=document.createElement("div"),document.body.appendChild(s._svgDiv)),s.getCanvasFromSVG(d,s._svgDiv,function(p){var h=p.toDataURL("img/png");h&&s.map.loadImage(h,function(h,y){h&&console.log(h);var m=2*Number.parseFloat((f.radius/p.width).toFixed(2));n&&Array.isArray(n)&&(n=n.map(function(e,t){return"number"==typeof e&&t%2==1?e/p.width*2:e})),!s.map.hasImage(d)&&s.map.addImage(d,y,{sdf:!0});var v={id:u,type:"symbol",source:u,layout:{"icon-image":d,"icon-size":n||m,"icon-anchor":"bottom-right",visibility:t.visible,"icon-offset":[f.offsetX*p.width||0,f.offsetY*p.height||0],"icon-allow-overlap":!0,"icon-rotate":o||180*(t.style.rotation||0)/Math.PI},paint:{"icon-color":f.fillColor},minzoom:l||0,maxzoom:c||22};a&&(v.filter=a),s._addLayer(v),i&&s._addLayerSucceeded({layerInfo:t,features:r}),e()})})}else{var m={style:s._transformStyleToMapBoxGl(f,t.featureType),layout:{visibility:t.visible}};s._addOverlayToMap({type:"POINT",source:u,layerID:u,layerStyle:m,minzoom:l,maxzoom:c}),i&&s._addLayerSucceeded({layerInfo:t,features:r}),e()}}));case 3:case"end":return e.stop()}},e)}));return function(t,r,n,o){return e.apply(this,arguments)}}()},{key:"_createUniqueLayer",value:function(){var e=gae(vae().mark(function e(t,r){var n,o,i,a,s,u,l,c,f,p,h,y,d,m,v,b,g,w,S,O,_,x,P,k,E,j,T,C,A,I,L,N,M,R,D,B,F,U,G,z,V,q,H,W,J,K,Y,Q,X,Z,$,ee,te,re,ne=this;return vae().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n={unicode:function(e){var t=e.unicode;return String.fromCharCode(parseInt(t.replace(/^&#x/,""),16))},fontSize:function(e){var t=e.fontSize;return t?parseFloat(t):12},rotation:function(e){return 180*(e.rotation||0)/Math.PI},fillColor:function(e){var t=e.fillColor,r=e.fillOpacity;return AO.getColorWithOpacity(t,r)},strokeColor:function(e){var t=e.strokeColor,r=e.strokeOpacity;return AO.getColorWithOpacity(t||"rgba(0,0,0,0)",r)},strokeWidth:function(e){return e.strokeWidth||0},offsetX:function(e){var t=e.offsetX,r=e.offsetY;return[t/2||0,r/2||0]}},o={unicode:"",fontSize:12,rotation:0,strokeColor:"rgba(0,0,0,0)",fillColor:"rgba(0,0,0,0)",strokeWidth:0,offsetX:[0,0]},i=this.getUniqueStyleGroup(t,r),r=this.getFilterFeatures(t.filterCondition,r),a=t.layerID,s=t.minzoom,u=t.maxzoom,l=t.style,c=i[0].themeField,f=t.featureType,p=t.style,h={},y={},i.forEach(function(e){y[e.value]=e}),r.forEach(function(e){var t=e.properties,r=y[t[c]];if(r){var o=r.style;for(var i in o)if(Object.prototype.hasOwnProperty.call(o,i)){var a=o[i];a!==p[i]&&(h[i]||(h[i]=["match",["get","index"]]),h[i].push(t.index,n[i]?n[i](o):a))}}}),e.t0=vae().keys(h);case 13:if((e.t1=e.t0()).done){e.next=27;break}if(d=e.t1.value,!Object.prototype.hasOwnProperty.call(h,d)){e.next=25;break}if(m=h[d],Array.isArray(m)){e.next=19;break}return e.abrupt("continue",13);case 19:v=p[d]||o[d],b=Oae({},d,v),"fillColor"===d&&(h.fillOpacity=1,b.fillOpacity=isNaN(p.fillOpacity)?1:p.fillOpacity),"strokeColor"===d&&(h.strokeOpacity=1,b.strokeOpacity=isNaN(p.strokeOpacity)?1:p.strokeOpacity),g=n[d],m.push(void 0===v?null:g&&g(b)||v);case 25:e.next=13;break;case 27:if(this._initLegendConfigInfo(t,i),w={type:"geojson",data:{type:"FeatureCollection",features:r}},S=a,this.map.getSource(S)?this.map.getSource(S).setData(w.data):this.map.addSource(S,w),O=t.visible,_=function(e){var t=e.type,r=e.sourceID,n=e.layerID,o=e.parentLayerId,i=e.beforeId,a=e.style,s=e.minzoom,u=e.maxzoom,l=e.filter,c={style:ne._transformStyleToMapBoxGl(Sae({},a),t),layout:{visibility:O}};ne._addOverlayToMap({type:t,source:r,layerID:n,parentLayerId:o,beforeId:i,layerStyle:c,minzoom:s,maxzoom:u,filter:l})},!["POLYGON","LINE"].includes(f)){e.next=43;break}if(x=h.lineDash,P=["all"],k=!1,E="",x&&x.length>1){for(delete h.lineDash,j=x[1],T="POLYGON"===f?a+"-strokeLine":a,C=2;C1&&_({type:"LINE",sourceID:S,layerID:T,parentLayerId:a,style:Sae(Sae(Sae({},l),h),{},{lineDash:x[x.length]}),minzoom:s,maxzoom:u,filter:P}),k=!0}"LINE"!==f||k||_({type:"LINE",sourceID:S,layerID:a,style:Sae(Sae({},l),h),minzoom:s,maxzoom:u,filter:P}),"POLYGON"===f&&(_({type:"POLYGON",sourceID:S,layerID:a,beforeId:E,style:Sae(Sae({},l),h),minzoom:s,maxzoom:u}),E&&this.map.moveLayer(a,E),k||_({type:"LINE",sourceID:S,layerID:a+"-strokeLine",parentLayerId:a,style:Sae(Sae({},l),h),minzoom:s,maxzoom:u,filter:P})),e.next=80;break;case 43:if(L=["all"],N=h.unicode){for(M=h.className||[],delete h.unicode,delete h.classname,R="".concat(a,"-additional-symbol"),D=["any"],B=2;B1&&(U.filter=D),this._addLayer(U,a)}if(G=h.imageInfo||[],z=h.url||[],!(G.length>0||z.length>0)){e.next=66;break}for(delete h.imageInfo,delete h.url,V=[],q=G.length>0?[G[0],G[1]]:[],H=z.length>0?[z[0],z[1]]:[],W=["any"],J=["any"],K=2;K1){for(var l=["match",["get","index"]],c=2;c1){for(var d=["match",["get","index"]],m=2;m1?L:void 0),e.next=80;break;case 72:if("IMAGE_POINT"!==l.type&&"SVG_POINT"!==l.type){e.next=79;break}return(re=Sae({},t)).style=Sae(Sae(Sae({},l),h),{},{type:l.type}),e.next=77,this._createGraphicLayer(re,r,"","",!1,L.length>1?L:void 0);case 77:e.next=80;break;case 79:_({type:"POINT",sourceID:S,layerID:a,style:Sae(Sae({},l),h),minzoom:s,maxzoom:u,filter:L.length>1?L:void 0});case 80:this._addLayerSucceeded({layerInfo:t,features:r});case 81:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"_getWMTSUrl",value:function(e){if("REST"===e.requestEncoding&&e.restResourceURL)return e.restResourceURL.replace("{Style}",e.style||"").replace("{TileMatrixSet}",e.tileMatrixSet).replace("{TileRow}","{y}").replace("{TileCol}","{x}").replace("{TileMatrix}","{z}");var t={service:"WMTS",request:"GetTile",version:"1.0.0",style:e.style||"",layer:e.layer,tilematrixSet:e.tileMatrixSet,format:"image/png",tilematrix:"{z}",tilerow:"{y}",tilecol:"{x}"};return L.urlAppend(e.kvpResourceUrl,this._getParamString(t,e.kvpResourceUrl))}},{key:"_createMarkerLayer",value:function(e,t){var r=this,n=e.minzoom,o=e.maxzoom,i=e.layerID,a={};(t=t||[]).forEach(function(e,t){var n=e.dv_v5_markerStyle,o=e.geometry.type.toUpperCase();"POINT"===o&&n.text&&(o="TEXT");var s=0===t?i:i+"-"+o+"-"+t;"POINT"===o&&n.src&&-1===n.src.indexOf("http://")&&-1===n.src.indexOf("https://")&&(n.src=r.serverUrl+n.src),a[s]||(a[s]={src:n.src,defaultStyle:n,geomType:o})});var s=function(e,t){var n=t.src,o=t.defaultStyle,i=t.geomType;return new Promise(function(t){n||"TEXT"===i?n&&n.indexOf("svg")<0&&(n.startsWith("http://")||n.startsWith("https://"))?r.map.loadImage(n,function(o,i){if(o)return console.log(o),void t(o);!r.map.hasImage(n)&&r.map.addImage(n,i),t(Oae({},e,n))}):(r._svgDiv||(r._svgDiv=document.createElement("div"),document.body.appendChild(r._svgDiv)),r.getCanvasFromSVG(n,r._svgDiv,function(i){r.handleSvgColor(o,i);var a=i.toDataURL("img/png");r.map.loadImage(a,function(o,i){if(o)return console.log(o),void t(o);var s=n||a;!r.map.hasImage(s)&&r.map.addImage(s,i),t(Oae({},e,s))})})):t(Oae({},e,void 0))})},u=[];for(var l in a)u.push(s(l,a[l]));Promise.all(u).then(function(a){for(var s=0;s2&&void 0!==arguments[2])||arguments[2],o=e.minzoom,i=e.maxzoom,a=e.themeSetting,s={gradient:a.colors.slice(),radius:parseInt(a.radius)},u=a.customSettings;for(var l in u)s.gradient[l]=u[l];var c=["interpolate",["linear"],["heatmap-density"]],f=[.1,.3,.5,.7,1];s.gradient.forEach(function(e,t){c.push(f[t]),0===t&&(e=n.supermap.Util.hexToRgba(e,0)),1===t&&(e=n.supermap.Util.hexToRgba(e,.5)),c.push(e)}),this._initLegendConfigInfo(e,c);var p={"heatmap-color":c,"heatmap-radius":3*a.radius,"heatmap-intensity":2.8};if(a.weight&&t.length>=4){var h=[];t.forEach(function(e){e.properties[a.weight]=+e.properties[a.weight],h.push(e.properties[a.weight])});var y=MO.getMax(h),d=MO.getMin(h);p["heatmap-weight"]=["interpolate",["linear"],["get",a.weight],d,0,y,1]}this._addLayer({id:e.layerID,type:"heatmap",source:{type:"geojson",data:{type:"FeatureCollection",features:t}},paint:p,layout:{visibility:e.visible},minzoom:o||0,maxzoom:i||22}),r&&this._addLayerSucceeded({layerInfo:e,features:t})}},{key:"_createRangeLayer",value:function(e,t){var r=e.themeSetting.themeField,n=e.featureType,o=e.minzoom,i=e.maxzoom,a=e.style,s=this.getRangeStyleGroup(e,t),u=["match",["get","index"]],l=(t=this.getFilterFeatures(e.filterCondition,t)).filter(function(e){var t=parseFloat(e.properties[r]);if(!t&&0!==t)return!1;if(s)for(var n=0;n-1;a--){var s=n[a],u=this._getSymbolLabelLayerName(s);this.map.getLayer(u)&&i.push(u)}i.reverse().forEach(function(e){r.map.moveLayer(e)})}},{key:"_getParamString",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[];for(var o in e)n.push((r?o.toUpperCase():o)+"="+e[o]);return(t&&-1!==t.indexOf("?")?"&":"?")+n.join("&")}},{key:"_transformStyleToMapBoxGl",value:function(e,t,r,n){var o={};"POINT"!==e.type&&"BASIC_POINT"!==e.type&&"POINT"!==t||"LINE"===t?["LINE","LINESTRING","MULTILINESTRING"].includes(t)?o={strokeWidth:"line-width",strokeColor:"line-color",strokeOpacity:"line-opacity"}:["REGION","POLYGON","MULTIPOLYGON"].includes(t)&&(o={fillColor:"fill-color",fillOpacity:"fill-opacity"}):o={fillColor:"circle-color",strokeWidth:"circle-stroke-width",fillOpacity:"circle-opacity",radius:"circle-radius",strokeColor:"circle-stroke-color",strokeOpacity:"circle-stroke-opacity"};var i={};for(var a in e)o[a]&&(i[o[a]]=e[a]);if(r&&(n?i[n]=r:i["circle-color"]?i["circle-color"]=r:i["line-color"]?i["line-color"]=r:i["fill-color"]=r),e.lineDash&&!i["line-dasharray"]&&(Array.isArray(e.lineDash)?i["line-dasharray"]=e.lineDash:"solid"!==e.lineDash&&"LINE"===t&&(i["line-dasharray"]=this.getDashStyle(e.lineDash))),e.lineDash&&!i["circle-translate"])if(Array.isArray(e.circleTranslate))i["circle-translate"]=e.circleTranslate;else if("POINT"===e.type||"BASIC_POINT"===e.type||"POINT"===t){var s=e.offsetX||0,u=e.offsetY||0;i["circle-translate"]=[s*e.radius,u*e.radius]}return i}},{key:"_addOverlayToMap",value:function(e){var t=e.type,r=e.source,n=e.layerID,o=e.parentLayerId,i=e.beforeId,a=e.layerStyle,s=e.minzoom,u=e.maxzoom,l=e.filter,c={POINT:"circle",LINE:"line",POLYGON:"fill"}[t];if("circle"===c||"line"===c||"fill"===c){var f={id:n,type:c,source:r,paint:a.style,layout:a.layout||{},minzoom:s||0,maxzoom:u||22};l&&(f.filter=l),this._addLayer(f,o,i)}}},{key:"_addBaselayer",value:function(e){var t=e.url,r=e.layerID,n=e.parentLayerId,o=e.visibility,i=void 0===o||o,a=e.minzoom,s=void 0===a?0:a,u=e.maxzoom,l=void 0===u?22:u,c=e.isIserver,f=void 0!==c&&c,p=e.bounds,h={type:"raster",tiles:t,minzoom:s||0,maxzoom:l||22,tileSize:f?this.rasterTileSize:256,rasterSource:f?"iserver":"",prjCoordSys:f&&!this.isOnlineBaseLayer(t[0],this.baseProjection)&&+this.baseProjection.split(":")[1]>0?{epsgCode:this.baseProjection.split(":")[1]}:"",proxy:this.baseLayerProxy};p&&(h.bounds=p);var y=h;!this.map.getSource(r)||this.map.getLayer(r)&&this.checkSameLayer&&this._isSameRasterLayer(r,h)||(y="".concat(r,"_").concat(+new Date),this.map.addSource(y,h)),this._addLayer({id:r,type:"raster",source:y,minzoom:s||0,maxzoom:l||22,layout:{visibility:this._getVisibility(i)}},n),this.baseLayerProxy=null}},{key:"_addStrokeLineForPoly",value:function(e){var t=e.style,r=e.source,n=e.layerID,o=e.parentLayerId,i=e.visible,a=e.minzoom,s=e.maxzoom,u={style:this._transformStyleToMapBoxGl(t,"LINE"),layout:{visibility:i}};this._addOverlayToMap({type:"LINE",source:r,layerID:n,parentLayerId:o,layerStyle:u,minzoom:a,maxzoom:s})}},{key:"_initLegendConfigInfo",value:function(e,t){var r=this,n={layerId:e.layerID,layerTitle:e.layerID,themeField:"HEAT"===e.layerType?e.themeSetting.weight:e.themeSetting.themeField,styleGroup:t},o=function(e,t){var n={style:{shape:r._getShape(t.featureType),type:r._getType(e.style.type)}};return r._addProps(n,e),n};switch(e.layerType){case"UNIQUE":n.styleGroup=n.styleGroup.map(function(t){return Sae({fieldValue:t.value},o(t,e))});break;case"RANGE":case"RANK_SYMBOL":n.styleGroup=n.styleGroup.map(function(t){return Sae({start:t.start,end:t.end},o(t,e))});break;case"HEAT":n.styleGroup=[{style:{shape:"POINT",type:"style",colors:this._heatColorToGradient(n.styleGroup)}}]}var i=this._legendList.findIndex(function(t){return t.layerId===e.layerID});i>-1?this._legendList.splice(i,1,n):this._legendList.push(n)}},{key:"_heatColorToGradient",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[];return e.forEach(function(r,n){n>5&&n%2==0&&t.push({value:r,key:6===n?0:e[n-1]})}),t}},{key:"_getType",value:function(e){return["IMAGE_POINT","SVG_POINT"].includes(e)?"image":"style"}},{key:"_getShape",value:function(e){return"POLYGON"===e?"FILL":e}},{key:"_addProps",value:function(e,t){if("POINT"===e.style.shape){if(Object.assign(e.style,{color:t.style.fillColor||t.color,opacity:t.style.fillOpacity,fontSize:2*t.radius||t.style.fontSize||"14px"}),"image"===e.style.type)return void Object.assign(e.style,{url:(t.style.imageInfo||{}).url||t.style.url});if(t.style.className)return void Object.assign(e.style,{icon:t.style.className})}"LINE"!==e.style.shape?"FILL"===e.style.shape&&Object.assign(e.style,{backgroundColor:t.style.fillColor||t.color,opacity:t.style.fillOpacity,outlineColor:t.style.strokeColor,width:20,height:20}):Object.assign(e.style,{width:20,lineStyles:[{color:t.color,lineDash:[],lineOffset:0,lineWidth:2,opacity:t.style.strokeOpacity||1}]})}},{key:"_createMvtLayer",value:function(e,t,r){var o=this._getDataVectorTileStyle(r),i=this._transformStyleToMapBoxGl(o,r),a=e.url+"/tileFeature.mvt",s=n.CRS.get(this.baseProjection).getOrigin(),u=t.minzoom,l=t.maxzoom;a+="?&returnAttributes=true&width=512&height=512&x={x}&y={y}&scale={scale}&origin={x:".concat(s[0],",y:").concat(s[1],"}"),this._addLayer({id:t.layerID,type:o.mbglType,source:{type:"vector",tiles:[a],proxy:this.webMapService.handleProxy("image")},"source-layer":"".concat(e.datasetName,"@").concat(e.datasourceName),paint:i,layout:{visibility:t.visible?"visible":"none"},minzoom:u||0,maxzoom:l||22}),this._addLayerSucceeded()}},{key:"_getDataVectorTileStyle",value:function(e){var t={radius:8,fillColor:"#EE4D5A",fillOpacity:.9,strokeColor:"#ffffff",strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT",mbglType:"circle"};return["LINE","LINESTRING","MULTILINESTRING"].includes(e)?(t.strokeColor="#4CC8A3",t.strokeWidth=2,t.mbglType="line"):["REGION","POLYGON","MULTIPOLYGON"].includes(e)&&(t.fillColor="#826DBA",t.mbglType="fill"),t}},{key:"_unproject",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this._unprojectProjection||this.baseProjection;if("EPSG:4326"===r)return e;var n=t_({coordinates:e,sourceProjection:r,proj4:this.specifiedProj4}),o=$O(r,this.specifiedProj4);return t&&o.axis&&0===o.axis.indexOf("ne")&&n.reverse(),n}},{key:"_getMapCenter",value:function(e){var t=e.center&&[e.center.x,e.center.y];return t||(t=[0,0]),t=this._unproject(t,!1),t=new n.LngLat(t[0],t[1])}},{key:"_getLabelFontFamily",value:function(e){var t=["sans-serif"],r=e.layers;return r&&r.length>0&&r.forEach(function(e){e.labelStyle&&t.push(e.labelStyle.fontFamily)},this),t.push("supermapol-icons"),t.join(",")}},{key:"_getTiandituUrl",value:function(e){for(var t=/t0/gi,r={tiandituUrl:[],labelUrl:[]},n=e.baseLayer.layerType.split("_")[1].toLowerCase(),o=Boolean(e.baseLayer.labelLayerVisible),i=this.tiandituKey||e.baseLayer.tk,a="https://t0.tianditu.gov.cn/{layer}_{proj}/wmts?tk=".concat(i),s=a,u="EPSG:4326"===this.baseProjection?"c":"w",l={service:"WMTS",request:"GetTile",style:"default",version:"1.0.0",layer:n,tilematrixSet:u,format:"tiles",width:256,height:256},c=(a+=this._getParamString(l,a)+"&tilematrix={z}&tilerow={y}&tilecol={x}").replace("{layer}",n).replace("{proj}",u),f=[],p=0;p<8;p++)f.push(c.replace(t,"t".concat(p)));if(r.tiandituUrl=f,o){var h={vec:"cva",ter:"cta",img:"cia"}[n];l.layer=h,s=(s+=this._getParamString(l,s)+"&tilematrix={z}&tilerow={y}&tilecol={x}").replace("{layer}",h).replace("{proj}",u);for(var y=[],d=0;d<8;d++)y.push(s.replace(t,"t".concat(d)));r.labelUrl=y}return r}},{key:"_defineProj4",value:function(e,t){var r=e_(e),n=/^EPSG:/,o=r&&e.match(n)?$O(r,this.specifiedProj4):e;return!r&&t&&t.match(n)&&(r=t),ZO(r,o,this.specifiedProj4),r}},{key:"_fetchRequest",value:function(e,t,r){return z.get(e,null,r).then(function(e){return e[t]()}).then(function(e){return e}).catch(function(e){console.log(e)})}},{key:"getEpsgCodeWKT",value:function(e,t){if(e)return this._fetchRequest(e,"text",t)}},{key:"getBounds",value:function(e,t){if(e)return this._fetchRequest(e,"json",t)}},{key:"_addLayer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.id,r=arguments.length>2?arguments[2]:void 0,n=e.id;if(this.map.getLayer(n))return this.checkSameLayer&&this._isSameRasterLayer(n,e.source)?void this._setCacheLayer({layerInfo:e,parentLayerId:t,id:n,reused:!0,beforeId:r}):void this._updateLayer(e);var o=Object.assign({},e);o.metadata=Object.assign({},o.metadata,{SM_Layer_Id:t}),this.map.addLayer(o),this._setCacheLayer({layerInfo:e,parentLayerId:t,id:n,beforeId:r})}},{key:"_setCacheLayer",value:function(e){var t=e.parentLayerId,r=e.layerInfo,n=e.reused,o=void 0!==n&&n,i=e.beforeId,a=e.subRenderLayers,s=e.metadata,u=a||[{layerId:r.id,reused:o}];if(this._cacheLayerId.has(t)){var l,c=this._cacheLayerId.get(t),f=-1;i&&(f=c.renderLayers.findIndex(function(e){return e.layerId===i}));var p=f<0?c.renderLayers.length:f;(l=c.renderLayers).splice.apply(l,[p,0].concat(hae(u)))}else{var h=Object.assign({},s||r&&r.metadata,{SM_Layer_Id:t});this._cacheLayerId.set(t,{renderLayers:u,metadata:h})}if(this.addLayersSucceededLen&&this._cacheLayerId.size<=this.expectLayerLen){this._changeSourceListModel();var y=this.getLayers(),d=this.getSelfAppreciableLayers(y),m=this._findTopLayerBeforeId(d);this.rectifyLayersOrder(d,m),this.fire("layeraddchanged",this._getSelfAppreciableLayers(y))}}},{key:"_findTopLayerBeforeId",value:function(e){var t=this,r=e.filter(function(e){return!e.reused}).reduce(function(e,t){return e.concat(t.renderLayers)},[]),n=r.find(function(e){return t.map.style._layers[e]});if(n){var o,i=this.map.getStyle().layers,a=i.findIndex(function(e){return e.id===n}),s=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=yae(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(i.filter(function(e){return!r.some(function(t){return t===e.id})}).map(function(e){return e.id}));try{var u,l=function(){var e=o.value;if(i.findIndex(function(t){return t.id===e})>a)return{v:e}};for(s.s();!(o=s.n()).done;)if(u=l())return u.v}catch(e){s.e(e)}finally{s.f()}}}},{key:"_changeSourceListModel",value:function(){var e=this,t=[],r=[this._mapInfo.baseLayer].concat(this._mapInfo.layers);if(this._graticuleLayer){var n=this._graticuleLayer,o=n.id,i=n.visible;r.push({layerID:o,visible:i,name:"GraticuleLayer"})}if(r.forEach(function(r){var n=r.layerID||r.name,o=void 0===r.visible||"visible"===r.visible||!0===r.visible,i=e._cacheLayerId.get(n);if(i){var a=i.renderLayers.map(function(e){return e.layerId});if(!a.length)return;t.push(Sae(Sae(Sae({},r),i),{},{id:n,visible:o,renderLayers:a,reused:i.renderLayers.some(function(e){return e.reused})}))}}),!this._sourceListModel)return this._sourceListModel=new uae({map:this.map,layers:t,appendLayers:this._appendLayers}),void this._sourceListModel.on({layerupdatechanged:function(t){e.fire("layerupdatechanged",t)}});this._sourceListModel.setLayers(t)}},{key:"_getSelfAppreciableLayers",value:function(e){return{layers:this.getSelfAppreciableLayers(e),allLoaded:this._cacheLayerId.size===this.expectLayerLen}}},{key:"_isSameRasterLayer",value:function(e,t){return xo(t,this.map.getSource(e))}},{key:"_centerValid",value:function(e){return!(!e||!(e.length>0||mae(e)===n.LngLat||e.lng))}},{key:"_getResolution",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;return e.leftBottom&&e.rightTop?Math.max(e.rightTop.x-e.leftBottom.x,e.rightTop.y-e.leftBottom.y)/t:Math.max(e[2]-e[0],e[3]-e[1])/t}},{key:"_transformScaleToZoom",value:function(e,t){var r=t.getExtent(),n=t.unit,o=1/L.getScaleFromResolutionDpi((r[2]-r[0])/512,96,n),i=e.split(":")[1];return Math.min(24,+Math.log2(o/+i).toFixed(2))}},{key:"_updateLayer",value:function(e){var t=this,r=e.id,n=e.paint,o=e.source,i=o.type,a=o.tiles,s=o.data,u=o.proxy,l=this.map.getSource(r);l&&("geojson"===i||"geojson"===l.type?(Object.keys(n).forEach(function(e){t.map.setPaintProperty(r,e,n[e])}),s&&l.setData(s)):"raster"===i&&this._updateRasterSource(r,{proxy:u,tiles:a}))}},{key:"_updateRasterSource",value:function(e,t){if(e){var r=this.map.getSource(e);Object.assign(r,t),this.map.style.sourceCaches[e].clearTiles(),this.map.style.sourceCaches[e].update(this.map.transform),this.map.triggerRepaint()}}},{key:"updateOverlayLayer",value:function(e,t,r){var n=this._mapInfo.layers.find(function(t){return t.layerID===e.id});if(t)this._initOverlayLayer(n,t,r);else{var o=this.webMapService.getDatasourceType(n);this.getLayerFeatures(n,this._taskID,o)}}},{key:"isOnlineBaseLayer",value:function(e,t){return e.startsWith("https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark")&&"EPSG:3857"===t}},{key:"_handleMultyPolygon",value:function(e){var t=this;return e.forEach(function(e){if("Polygon"===e.geometry.type){var r=e.geometry.coordinates;if(r.length>1){for(var n=[[r[0]]],o=1;o0?n[n.length-1].push(r[o]):n.push([r[o]]))}e.geometry.coordinates=n,e.geometry.type="MultiPolygon"}}}),e}},{key:"signedArea",value:function(e){for(var t,r,n=0,o=0,i=e.length,a=i-1;oe.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=Dae(this,t,[r]))._mapInfo=r.mapInfo,e._layerCatalog=r.mapInfo.metadata.layerCatalog,e._mapResourceInfo=r.mapResourceInfo,e._l7LayerUtil=r.l7LayerUtil,e._legendList=r.legendList,e._immutableTopOrderLayers=["chart","point-extrusion"];var n=e._generateLayers();return e.setLayers(n),e.initDatas(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fae(e,t)}(t,Qie),r=t,(n=[{key:"createLayerCatalogs",value:function(){var e=this.getLayers(!1),t=this._createSourceCatalogs(this._layerCatalog,e),r=this.getSelfLayers(),n=e.filter(function(e){return!r.some(function(t){return t.id===e.id})});return this._initSourceList(n).concat(t)}},{key:"getSelfLayerIds",value:function(){return this.layers.reduce(function(e,t){return e.concat(t.layerInfo.renderLayers)},[])}},{key:"initLayers",value:function(){var e=this,t=this._getAllLayersOnMap();this.appendLayers&&(t=[]);var r=this.layers.map(function(t){var r=Object.assign({},t);return t["source-layer"]&&(r.sourceLayer=t["source-layer"]),e._pickLayerFields(r)}),n=this.layers.reduce(function(e,t){return e.concat(t.layerInfo.renderLayers)},[]);return this.concatExpectLayers(r,n,t)}},{key:"_createSourceCatalogs",value:function(e,t){var r=this;return e.map(function(e){var n,o=e.id,i=e.title,a=void 0===i?o:i,s=e.type,u=e.visible,l=e.children;if("group"===s)n={children:r._createSourceCatalogs(l,t),id:o,title:a,type:s,visible:u};else{var c=t.find(function(e){return e.id===o});r.removeLayerExtralFields([c]),n=Object.assign({},c)}return n})}},{key:"_generateLayers",value:function(){var e=this,t=this._mapResourceInfo,r=t.catalogs,n=void 0===r?[]:r,o=t.datas,i=void 0===o?[]:o,a=_o(n,"catalogType"),s=_o(this._mapInfo.metadata.layerCatalog),u=this._l7LayerUtil.getL7MarkerLayers(),l=s.map(function(t){var r=e._mapInfo.layers.find(function(e){return e.id===t.id})||{},n={id:r.id,title:t.title,renderLayers:e._getRenderLayers(t.parts,t.id),reused:r.metadata&&r.metadata.reused},o=(a.find(function(e){return e.id===t.id})||{}).msDatasetId,s={};if(o){var l,c=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Lae(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(i);try{for(c.s();!(l=c.n()).done;){var f=l.value,p=f.datasets&&f.datasets.find(function(e){return e.msDatasetId===o});if(p){if(s={serverId:p.datasetId,type:f.sourceType},"REST_DATA"===f.sourceType){var h=Iae(f.url.split("/rest/data/datasources/"),2),y=h[0],d=h[1];s.url="".concat(y,"/rest/data"),s.dataSourceName="".concat(d,":").concat(p.datasetName),delete s.serverId}break}}}catch(e){c.e(e)}finally{c.f()}}var m=e.map.getSource(r.source);if(!Object.keys(s).length&&m&&"vector"===m.type){var v=e._mapInfo.sources[r.source]||m;if(v.tiles&&v.tiles[0].includes("/rest/maps/")){var b=Iae(v.tiles[0].split("/rest/maps/"),2),g=b[0],w=Iae(b[1].split("/tileFeature"),1)[0];s.url="".concat(g,"/rest/maps"),s.mapName=w,s.type="REST_MAP"}}n.dataSource=s,e._l7LayerUtil.isL7Layer(r)&&(n.CLASS_NAME="L7Layer"),u[r.id]&&(n.CLASS_INSTANCE=u[r.id]);var S=e._legendList.filter(function(e){return e.layerId===r.id}).map(function(e){return e.themeField}).filter(function(e){return!!e}),O=Array.from(new Set(S));return O.length>0&&(n.themeSetting={themeField:O}),e._immutableTopOrderLayers.some(function(e){return e===r.type})&&(n.metadata=Object.assign({},r.metadata,{SM_Layer_Order:"top"})),Object.assign({},r,{layerInfo:n})});return l.reverse(),l}},{key:"_getRenderLayers",value:function(e,t){return e?e.includes(t)?e:[t].concat(Aae(e)):[t]}}])&&Mae(r.prototype,n),o&&Mae(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}();function Gae(e){return function(e){if(Array.isArray(e))return qae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Vae(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zae(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vae(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Vae(e,t){if(e){if("string"==typeof e)return qae(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qae(e,t):void 0}}function qae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Wae(e){"@babel/helpers - typeof";return(Wae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Jae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Kae(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(r=Zae(this,a)).mapId=e,r.options=t,r.mapOptions=n,r._mapResourceInfo={},r._relatedInfo=t.relatedInfo||{},r._sprite="",r._spriteDatas={},r._appendLayers=!1,r._baseProjection="",r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&tse(e,t)}(a,e),s=a,(u=[{key:"initializeMap",value:function(e,t){if(this._mapInfo=e,this._setBaseProjection()){if(t){this._appendLayers=!0,this.map=t;var r=this._mapInfo.sprite;return r&&(this._sprite=r,this.map.addStyle({sprite:r})),void this._initLayers()}this._createMap()}}},{key:"cleanLayers",value:function(e){$ae(ese(a.prototype),"cleanLayers",this).call(this,e);var t=i.getL7MarkerLayers();for(var r in t)i.removeL7MarkerLayer(r,this.map.$l7scene)}},{key:"clean",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.map){if(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),e){var t=this.map.$l7scene;t&&t.removeAllLayer(),this.map.remove()}this.map=null,this._legendList=[],this._mapResourceInfo={},this._sprite="",this._spriteDatas={},this.mapOptions={},this.options={}}}},{key:"copyLayer",value:function(){var e=Qae(Hae().mark(function e(t){var r,n,o,a,s,u=arguments;return Hae().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=u.length>1&&void 0!==u[1]?u[1]:{},(n=this._mapInfo.layers.find(function(e){return e.id===t}))&&!this._getLayerOnMap(r.id)){e.next=4;break}return e.abrupt("return");case 4:if(o=r.id||"".concat(n.id,"_copy"),a=Kae(Kae(Kae({},n),r),{},{id:o}),!i.isL7Layer(a)){e.next=12;break}return s=[a],e.next=10,i.addL7Layers({map:this.map,webMapInfo:Kae(Kae({},this._mapInfo),{},{layers:s,sources:this._mapInfo.sources}),l7Layers:s,spriteDatas:this._spriteDatas,options:this.options});case 10:e.next=14;break;case 12:"object"===Wae(a.source)&&(this.map.addSource(a.id,a.source),a.source=a.id),this.map.addLayer(a);case 14:return e.abrupt("return",a);case 15:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"updateOverlayLayer",value:function(e,t,r){if("geojson"===e.renderSource.type){var n=e.renderSource.id,o={type:"FeatureCollection",features:t=Oo({sourceId:n,features:t,mergeByField:r,map:this.map})};this.map.getSource(n).setData(o)}}},{key:"_createMap",value:function(){var e=this,t=this._mapInfo,o=t.name,i=void 0===o?"":o,a=t.center,s=void 0===a?new n.LngLat(0,0):a,u=t.zoom,l=void 0===u?0:u,c=t.bearing,f=void 0===c?0:c,p=t.pitch,h=void 0===p?0:p,y=t.minzoom,d=t.maxzoom,m=t.sprite,v=void 0===m?"":m;s=this.mapOptions.center||s,l=this.mapOptions.zoom||l,f=this.mapOptions.bearing||f,h=this.mapOptions.pitch||h;var b=this._getLabelFontFamily(),g=Kae(Kae({transformRequest:function(t,r){var n={url:t};return"Tile"===r&&e.options.iportalServiceProxyUrl&&t.indexOf(e.options.iportalServiceProxyUrl)>=0&&(n.credentials="include"),n}},this.mapOptions),{},{container:this.options.target,crs:this._baseProjection,center:s,zoom:l,style:{sprite:v,name:i,version:8,sources:{},layers:[]},minZoom:y,maxZoom:d,bearing:f,pitch:h,localIdeographFontFamily:b||""});this.map=new r(g),this._sprite=v,this.fire("mapinitialized",{map:this.map}),this.map.on("load",function(){e._initLayers()})}},{key:"_setBaseProjection",value:function(){var e=this._mapInfo.crs,t=e;if("object"===Wae(e)){if(t=e.name,!n.CRS){var r="The EPSG code ".concat(t," needs to include ").concat(o,"-enhance.js. Refer to the example: https://iclient.supermap.io/examples/").concat(o.replace("-",""),"/editor.html#mvtVectorTile_2362");return this.fire("mapcreatefailed",{error:r}),void console.error(r)}this._setCRS(e)}return this._baseProjection=t,this._baseProjection}},{key:"_setCRS",value:function(e){var t=e.name,r=e.wkt,o=e.extent;if(!n.CRS.get(t)){var i=new n.CRS(t,r,o,o[2]>180?"meter":"degree");n.CRS.set(i)}}},{key:"_initLayers",value:function(){var e=Qae(Hae().mark(function e(){var t=this;return Hae().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.map.getCRS||this.map.getCRS().epsgCode===this._baseProjection){e.next=3;break}return this.fire("projectionnotmatch"),e.abrupt("return");case 3:return e.next=5,this._getSpriteDatas();case 5:if("[object Object]"!==Object.prototype.toString.call(this.mapId)){e.next=11;break}return this.mapParams={title:this._mapInfo.name,description:this._relatedInfo.description},this._relatedInfo.projectInfo&&(this._mapResourceInfo=JSON.parse(this._relatedInfo.projectInfo)),this._createMapRelatedInfo(),this._addLayersToMap(),e.abrupt("return");case 11:this._getMapRelatedInfo().then(function(e){t.mapParams={title:t._mapInfo.name,description:e.description},t._mapResourceInfo=JSON.parse(e.projectInfo),t._createMapRelatedInfo(),t._addLayersToMap()}).catch(function(e){t.fire("mapcreatefailed",{error:e}),console.error(e)});case 12:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"_createMapRelatedInfo",value:function(){var e=this._mapInfo.glyphs;for(var t in e)this.map.style.addGlyphs(t,e[t])}},{key:"_getMapRelatedInfo",value:function(){var e=function(e){var t=e.url,r=e.server,n=e.excludePortalProxyUrl,o=e.credentialValue,i=e.credentialKey,a=-1===t.indexOf(".json")?"".concat(t,".json"):t,s="getUrlResource.json?url=";if(n&&r.indexOf(s)>-1){var u=r.split(s);u.length>1&&(a=u[0]+s+a)}return o&&i&&(a+="?"+i+"="+o),a}(Object.assign({url:"".concat(this.options.server,"web/maps/").concat(this.mapId)},this.options));return z.get(e,null,{withCredentials:this.options.withCredentials}).then(function(e){return e.json()})}},{key:"_addLayersToMap",value:function(){var e=Qae(Hae().mark(function e(){var t,r,n,o,a,s,u=this;return Hae().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,t=this._setUniqueId(this._mapInfo,this._mapResourceInfo),r=t.sources,n=t.layers,o=t.layerCatalog,a=t.catalogs,Object.assign(this._mapInfo,{sources:r,layers:n,metadata:Object.assign(this._mapInfo.metadata,{layerCatalog:o})}),Object.assign(this._mapResourceInfo,{catalogs:a}),n.filter(function(e){return!i.isL7Layer(e)}).forEach(function(e){e.metadata&&e.metadata.reused||(e.source&&!u.map.getSource(e.source)&&u.map.addSource(e.source,r[e.source]),"symbol"===e.type&&0===e.layout["text-z-offset"]&&delete e.layout["text-z-offset"],u.map.addLayer(e))}),!((s=n.filter(function(e){return i.isL7Layer(e)})).length>0)){e.next=10;break}return e.next=10,i.addL7Layers({map:this.map,webMapInfo:Kae(Kae({},this._mapInfo),{},{layers:n,sources:r}),l7Layers:s,spriteDatas:this._spriteDatas,options:Kae(Kae({},this.options),{},{emitterEvent:this.fire.bind(this)})});case 10:this._createLegendInfo(),this._sendMapToUser(),e.next=18;break;case 14:e.prev=14,e.t0=e.catch(0),this.fire("mapcreatefailed",{error:e.t0,map:this.map}),console.error(e.t0);case 18:case"end":return e.stop()}},e,this,[[0,14]])}));return function(){return e.apply(this,arguments)}}()},{key:"_setUniqueId",value:function(e,t){var r=this._handleUnSupportedLayers(e),n=JSON.parse(JSON.stringify(e.layers)).filter(function(e){return!r.includes(e.id)}),o={},i={},a=[],s="_".concat(+new Date);for(var u in e.sources){var l=u;this.map.getSource(u)&&(l=u+s),i[l]=u,o[l]=e.sources[u];var c,f=zae(n);try{for(f.s();!(c=f.n()).done;){var p=c.value;p.source===u&&(p.source=l)}}catch(e){f.e(e)}finally{f.f()}}var h,y=zae(n);try{for(y.s();!(h=y.n()).done;){var d=h.value,m=d.id,v=this._getLayerOnMap(d.id);if(v)if(this.options.checkSameLayer&&xo(o[d.source],this.map.getSource(v.source)))d.metadata=d.metadata||{},d.metadata.reused=!0,d.source=i[d.source];else{var b=d.id+s;d.id=b}a.push({originId:m,renderId:d.id})}}catch(e){y.e(e)}finally{y.f()}var g=JSON.parse(JSON.stringify(e.metadata.layerCatalog),"parts");this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(g)),catalogs:g,layerIdMapList:a,unspportedLayers:r});var w=JSON.parse(JSON.stringify(t.catalogs||[]));return this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(w)),catalogs:w,layerIdMapList:a,catalogTypeField:"catalogType",layerIdsField:"layersContent",unspportedLayers:r}),{sources:o,layers:n,layerCatalog:g,catalogs:w}}},{key:"_getLayerOnMap",value:function(e){var t=this.map.overlayLayersManager[e];if(t)return t;var r=i.getL7MarkerLayers()[e];return r||this.map.getLayer(e)}},{key:"_findLayerCatalog",value:function(e,t){var r,n=zae(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;if(o.id===t)return o;if(o.children){var i=this._findLayerCatalog(o.children,t);if(i)return i}}}catch(e){n.e(e)}finally{n.f()}return null}},{key:"_deleteLayerCatalog",value:function(e,t){for(var r=0;r0&&t.forEach(function(t){var r=t.layout&&t.layout["text-font"]||[];e.push.apply(e,Gae(r))}),e.join(",")}},{key:"_getSpriteDatas",value:function(){var e=this,t=this._sprite;if(t){var r=[];return"string"==typeof t?r.push(t):"object"===Wae(t)&&Object.keys(t).forEach(function(e){r.push(t[e])}),Promise.all(r.map(function(t){return e._getSpriteData(t)})).then(function(t){t.forEach(function(t){e._spriteDatas=Kae(Kae({},e._spriteDatas),t)})})}}},{key:"_getSpriteData",value:function(e){var t=e.replace(/.+(web\/maps\/.+)/,"".concat(this.options.server,"$1"));return z.get(t,null,{withCredentials:this.options.withCredentials}).then(function(e){return e.json()})}},{key:"_createLegendInfo",value:function(){var e,t=this,r=this._mapResourceInfo.catalogs,n=zae(_o(void 0===r?[]:r,"catalogType"));try{var o=function(){var r,n=e.value,o=n.visualization||{},i=o.renderer,a=o.label;if(!i)return 1;var s,u=t._mapInfo.layers.find(function(e){return e.id===n.id}),l=t._mapInfo.sources[u.source];"clusterField"in l&&(s=l.clusterField);var c=Object.assign({},u,{title:n.title,themeField:s}),f=t._parseRendererStyleData(i);a&&(f.push(Kae(Kae({},a),{},{type:"text"})),a.symbolsContent&&a.symbolsContent.value.symbolId&&f.push(Kae(Kae({},a),{},{type:"symbol"}))),f[0].textField&&f[0].textField.value&&f.push(Kae(Kae({},f[0]),{},{type:"text"}));var p=f.reduce(function(e,r){var n=t._createLayerLegendList(c,r);return n&&e.push.apply(e,Gae(n)),e},[]);(r=t._legendList).push.apply(r,Gae(p))};for(n.s();!(e=n.n()).done;)o()}catch(e){n.e(e)}finally{n.f()}}},{key:"_getAliasKey",value:function(e,t){return"isoline3D"===e&&"dashArray"===t?"lineDasharray":t}},{key:"_transStyleKeys",value:function(e,t){var r=this;return t.map(function(t){return r._getAliasKey(e,t)})}},{key:"_transStyleSetting",value:function(e,t){for(var r in t){var n=this._getAliasKey(e,r);n!==r&&(t[n]=t[r])}}},{key:"_getLegendSimpleStyle",value:function(e,t){var r={};t&&t.filter(function(t){return e[t]&&"simple"===e[t].type}).forEach(function(t){("outlineColor"!==t||(e.antialias||{}).value)&&(r[t]=(e[t]||{}).value)});return r}},{key:"_getLegendRenderType",value:function(e){switch(e){case"text":return ose.TEXT;case"circle":case"symbol":case"column":return ose.POINT;case"heatGrid":case"heatHexagon":case"heat3DGrid":case"heat3DHexagon":return ose.BUILTINSYMBOL;case"line":case"isoline3D":return ose.LINE;case"fill":return ose.FILL;case"fillExtrusion":return ose.FILLEXTRUSION;case"animatePoint":return ose.ANIMATEPOINT;case"line3D":case"animateLine":return ose.ANIMATELINE;case"radarPoint":return ose.RADARPOINT}}},{key:"_getLegendShape",value:function(e,t){switch(e){case"text":return ise.TEXT;case"circle":case"symbol":return ise.POINT;case"column":return{cylinder:ise.POINT,triangleColumn:ise.TRIANGLE,squareColumn:ise.RECTANGLE,hexagonColumn:ise.HEXAGON}[t.shape.value]||ise.POINT;case"heatHexagon":case"heat3DHexagon":return ise.HEXAGON;case"line":case"isoline3D":return ise.LINE;case"fill":case"heatGrid":case"heat3DGrid":case"fillExtrusion":return ise.RECTANGLE;case"animatePoint":return ise.ANIMATEPOINT;case"animateLine":case"line3D":return ise.ANIMATELINE;case"radarPoint":return ise.RADARPOINT;case"heat":case"heat3D":return ise.LINEGRADIENT}}},{key:"_isShowLegendSingleItem",value:function(e,t){return 0===e.length||1===e.length&&"color"===e[0]&&t}},{key:"_isWebsymbolById",value:function(e){return["line-","polygon-","point-"].some(function(t){return e&&e.startsWith(t)})}},{key:"_getSymbolSDFStatus",value:function(e,t){return!this._isWebsymbolById(e)&&(!!this._getIconById(e)||(t[e]&&t[e].sdf||!1))}},{key:"_isAllPicturePoint",value:function(e,t){var r=this;return"simple"===e.type?!this._getSymbolSDFStatus(e.value.symbolId,t):[].concat(Gae(e.values),[{value:e.defaultValue}]).filter(function(e){return e.value.symbolId}).every(function(e){return!r._getSymbolSDFStatus(e.value.symbolId,t)})}},{key:"_isAllPictureSymbolSaved",value:function(e,t,r){var n=this;return!!t&&("point"===e?this._isAllPicturePoint(t,r):"simple"===t.type?!!this._getImageIdFromValue(t.value.style,pse[e]).length:t.values.map(function(e){return e.value}).concat(t.defaultValue).every(function(t){return!!n._getImageIdFromValue(t.style,pse[e]).length}))}},{key:"_getDataDrivenStyleKeys",value:function(e,t,r){return(rse({},ose.TEXT,use)[e]||t).filter(function(e){return r[e]&&"simple"!==r[e].type})}},{key:"_createLayerLegendList",value:function(e,t){var r=this,n=e.id,o=e.title,i={themeField:e.themeField||t.field,layerId:n,layerTitle:o},a=t.type||e.type,s=this._getLegendRenderType(a),u=this._getLegendShape(a,t);if(["heat","heat3D"].includes(a)){var l=this._heatColorToGradient((e.paint||{})[{heat:"heatmap-color",heat3D:"heatmap-extrusion-color"}[a]]);return[Kae(Kae({},i),{},{styleGroup:[{style:{type:mse.STYLE,shape:u,colors:l}}]})]}var c=lse[s];if(c){var f=this._transStyleKeys(a,c);this._transStyleSetting(a,t);var p=this._getLegendSimpleStyle(t,f),h=this._parseLegendtyle({legendRenderType:s,customValue:p}),y=this._getDataDrivenStyleKeys(s,f,t);if(s===ose.ANIMATELINE){var d="replace"===t.textureBlend.value,m=!(!t.symbolsContent.value||!t.symbolsContent.value.symbolId);d&&m&&(y=y.filter(function(e){return"color"!==e}))}else{var v=hse[e.type];this._isAllPictureSymbolSaved(v,t.symbolsContent,this._spriteDatas)&&(y=y.filter(function(e){return"color"!==e}))}var b=t.color&&t.color.interpolateInfo&&"linear"===t.color.interpolateInfo.type,g=[];return this._isShowLegendSingleItem(y,b)&&g.push(Kae(Kae({},i),{},{styleGroup:[{fieldValue:o||n,style:Kae(Kae({},h),{},{shape:u})}]})),g.concat(y.map(function(e){var n=t[e],o=r._getSettingStyle(e,n.defaultValue,p),a=[],l=r._getSettingCustom(n),c=r._getSettingInterpolateInfo(n),f={legendRenderType:s,styleField:e,subStyleSetting:n,simpleStyle:p,defaultSetting:o,custom:l,interpolateInfo:c,shape:u};switch(r._getLegendStyleType({styleField:e,currentType:n.type,custom:l,interpolateInfo:c})){case fse.LINEAR:a=r._parseLinearStyle(f);break;case fse.RANGE:a=r._parseRangeStyle(f);break;case fse.UNIQUE:a=r._parseUniqueStyle(f)}return Kae(Kae({},i),{},{themeField:(n.field||[])[0],styleField:e,styleGroup:a})}))}}},{key:"_heatColorToGradient",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[];return e.forEach(function(r,n){n>5&&n%2==0&&t.push({value:r,key:6===n?0:e[n-1]})}),t}},{key:"_getSettingCustom",value:function(e){var t=e.value,r=e.values;return this._isLinear(e)?t:r}},{key:"_getSettingInterpolateInfo",value:function(e){var t=e.interpolateInfo,r=void 0===t?{}:t;return this._isLinear(e)?{type:"linear"}:r}},{key:"_isLinear",value:function(e){return"linear"===e.type}},{key:"_getLegendStyleType",value:function(e){var t=e.styleField,r=e.currentType,n=e.custom,o=e.interpolateInfo;return["unique","linear"].includes(r)?this._isColorAttr(t)&&"linear"===o.type&&n.length>1?fse.LINEAR:fse.UNIQUE:fse.RANGE}},{key:"_isColorAttr",value:function(e){return["color","textColor","outlineColor","textHaloColor"].includes(e)}},{key:"_parseLinearStyle",value:function(e){var t=e.shape,r=e.custom;return[{styleField:null,style:{type:mse.STYLE,shape:t,colors:r}}]}},{key:"_parseUniqueStyle",value:function(e){var t=this,r=e.legendRenderType,n=e.styleField,o=e.simpleStyle,i=e.defaultSetting,a=e.custom,s=e.interpolateInfo,u=e.shape,l=a.map(function(e){var i=t._getSettingStyle(n,e.value,o),a=t._parseLegendtyle({legendRenderType:r,customValue:i});return{fieldValue:e.key,style:Kae(Kae({},a),{},{shape:u})}});if(!s.type||"custom"===s.type){var c=this._parseLegendtyle({legendRenderType:r,customValue:i});l.push({fieldValue:null,style:Kae(Kae({},c),{},{shape:u})})}return l}},{key:"_parseRangeStyle",value:function(e){var t=this,r=e.legendRenderType,n=e.styleField,o=e.simpleStyle,i=e.defaultSetting,a=e.custom,s=e.shape,u=a.map(function(e){var i=t._getSettingStyle(n,e.value,o),a=t._parseLegendtyle({legendRenderType:r,customValue:i});return{start:e.start,end:e.end,style:Kae(Kae({},a),{},{shape:s})}}),l=this._parseLegendtyle({legendRenderType:r,customValue:i});return u.push({start:null,end:null,style:Kae(Kae({},l),{},{shape:s})}),u}},{key:"_getSettingStyle",value:function(e,t,r){var n=Object.assign({},r);return n[e]=t,n}},{key:"_parseLegendtyle",value:function(e){var t=this,r=e.legendRenderType,n=e.customValue,o=Kae({},sse[r]);Object.keys(o).forEach(function(e){var t=n[ase[e]||e];([ose.FILL,ose.FILLEXTRUSION].includes(r)||t)&&(o[e]=t)});var i=n.symbolsContent||{},a=i.symbolId,s=void 0===a?cse[r]:a,u=i.style;switch(r){case ose.TEXT:return Kae({type:mse.STYLE,icon:"supermapol-icons-text-layer"},o);case ose.POINT:return"BASE"===(this._getIconById(s)?"BASE":"SERVICE")?Kae({type:mse.STYLE},o):this._getSpriteStyle(s,o);case ose.BUILTINSYMBOL:return Kae({type:mse.STYLE},o);case ose.ANIMATEPOINT:case ose.RADARPOINT:return Kae({type:mse.STYLE},o);case ose.LINE:case ose.ANIMATELINE:u=u||[];var l=Object.assign({},n);delete l.symbolsContent;var c=Kae(Kae({type:mse.STYLE},l),{},{width:yse}),f=Kae({},sse.LINE),p=u instanceof Array?u:[u],h=p.some(function(e){return!!t._getImageIdByLegendType(e,r)}),y=p[0];if(h){var d=this._getImageIdByLegendType(y,r),m=Kae(Kae(Kae({},o),l),{},{height:o.width,width:yse});return r===ose.ANIMATELINE&&"replace"===l.textureBlend&&(m.backgroundColor="transparent"),this._getSpriteStyle(d,m)}if(!n.symbolsContent||r===ose.ANIMATELINE&&!h)return Kae(Kae({},c),{},{height:n.width||f.height,lineWidth:n.width||f.width,color:n.color||f.backgroundColor});if(n.symbolsContent){var v=this._getLineWidth(p),b=p.map(function(e){return t._transformLineStyle({oldWidth:v,symbol:e,defaultStyle:f,customValue:n})});return Kae(Kae({},c),{},{lineStyles:b})}return;case ose.FILL:case ose.FILLEXTRUSION:var g=o.backgroundColor,w=((u||{}).paint||{})["fill-color"],S=Kae({},sse.FILL);return g||Object.assign(o,{backgroundColor:w}),Object.keys(o).forEach(function(e){["backgroundColor","width","height","opacity"].includes(e)&&!o[e]&&(o[e]=S[e])}),o.outlineColor&&Object.assign(o,{outline:S.outline,marginLeft:"1px"}),this._spriteDatas[s]?this._getSpriteStyle(s,Kae(Kae({},o),{},{backgroundColor:"transparent"})):Kae({type:mse.STYLE},o)}}},{key:"_getIconById",value:function(e){if("image"!==(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"svg")){return[{id:"circle",name:"circle"}].find(function(t){return t.id===e})}}},{key:"_getImageIdFromValue",value:function(e,t){var r=Array.isArray(e)?e:[e],n={symbol:"icon-image",line:"line-pattern",fill:"fill-pattern","fill-extrusion":"fill-pattern"}[t];return"symbol"===t?r.map(function(e){return e.layout&&e.layout[n]}).filter(function(e){return e}):r.map(function(e){return e.paint&&e.paint[n]}).filter(function(e){return e})}},{key:"_getImageIdByLegendType",value:function(e,t){var r={ANIMATELINE:pse.point,LINE:pse.line}[t],n=e.paint||{};return r===pse.line?n["line-pattern"]:r===pse.polygon?n["fill-pattern"]:(e.layout||{})["icon-image"]}},{key:"_getSpriteStyle",value:function(e,t){if(this._spriteDatas[e]){var r=this._spriteDatas[e];if(r.width&&r.height)return Kae(Kae({type:mse.IMAGE,sprite:r},t),{},{url:"string"==typeof this._sprite?"".concat(this._sprite,".png"):""})}}},{key:"_transformLineStyle",value:function(e){var t,r=e.oldWidth,n=e.symbol,o=e.defaultStyle,i=e.customValue,a=n.paint,s=void 0===a?{}:a;return void 0!==i.height&&(t=this._updateSingleStyleByWidth(r,i.height,n)),{lineWidth:((t||{}).paint||{})[dse]||s[dse]||o.height,opacity:i.opacity||s["line-opacity"]||o.opacity,color:i.color||s["line-color"]||o.backgroundColor,lineDash:s["line-dasharray"]||[],lineOffset:s["line-offset"]||0}}},{key:"_updateSingleStyleByWidth",value:function(e,t,r){if(e===t)return r;var n=(r||{}).paint||{};if(0===e)return{paint:Object.assign({},n,{"line-width":Number(t.toFixed(2))})};var o=t/e,i=n["line-width"],a=n["line-offset"]||0,s=n["line-dasharray"]||[],u=this._updateDash(s,o);return{paint:Object.assign({},n,{"line-width":Number((i*o).toFixed(2)),"line-offset":Number((a*o).toFixed(2)),"line-dasharray":u&&u.map(function(e){return Number(e.toFixed(2))})})}}},{key:"_updateDash",value:function(e,t){if(e&&0!==e.length)return e.map(function(e){return e/t})}},{key:"_getLineWidth",value:function(e){return e instanceof Array?this._getWholeWidth(e):(e.paint||{})[dse]||0}},{key:"_getWholeWidth",value:function(e){var t,r;return e.forEach(function(e){var n=(e||{}).paint||{},o=n["line-width"],i=n["line-offset"]||0,a=i+o/2,s=i-o/2;(a>t||void 0===t)&&(t=a),(s=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function wse(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:function(){return Pse(function e(){Ese(this,e)})}();return function(t){function r(){var e;return Ese(this,r),(e=Sse(this,r))._sourceListModel=null,e._legendList=[],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_se(e,t)}(r,e),Pse(r,[{key:"initializeMap",value:function(){throw new Error("initializeMap is not implemented")}},{key:"clean",value:function(){throw new Error("clean is not implemented")}},{key:"getLayerCatalog",value:function(){return this._sourceListModel&&this._sourceListModel.getLayerCatalog()||[]}},{key:"getLayers",value:function(){return this._sourceListModel&&this._sourceListModel.getLayers()||[]}},{key:"getLegends",value:function(){return this._legendList}},{key:"getSelfAppreciableLayers",value:function(){var e;return this._sourceListModel&&(e=this._sourceListModel).getSelfLayers.apply(e,arguments)||[]}},{key:"setLayersVisible",value:function(){var e;this._sourceListModel&&(e=this._sourceListModel).setLayersVisible.apply(e,arguments)}},{key:"toggleLayerVisible",value:function(){var e;this._sourceListModel&&(e=this._sourceListModel).toggleLayerVisible.apply(e,arguments)}},{key:"rectifyLayersOrder",value:function(e,t){for(var r=this,n=e.filter(function(e){return!e.reused}).reduce(function(e,t){return e.concat(t.renderLayers)},[]).filter(function(e){return!!r.map.getLayer(e)}),o=n.length-1;o>-1;o--){var i=n[o],a=n.slice(o+1),s=a.find(function(e){return r.map.style._layers[e]});a.length||(s=t),this.map.moveLayer(i,s)}return n}},{key:"echartsLayerResize",value:function(){}},{key:"updateOverlayLayer",value:function(){}},{key:"copyLayer",value:function(){}},{key:"cleanLayers",value:function(e){var t,r=this,n=[],o=gse(e);try{var i=function(){var e=t.value;e.renderLayers.forEach(function(t){r.map.getLayer(t)&&(r.map.removeLayer(t),!e.l7Layer&&r.map.getSource(t)&&n.push(t))}),r.map.getSource(e.renderSource.id)&&!e.l7Layer&&n.push(e.renderSource.id)};for(o.s();!(t=o.n()).done;)i()}catch(e){o.e(e)}finally{o.f()}Array.from(new Set(n)).forEach(function(e){r.map.removeSource(e)})}}])}()}function Tse(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Cse(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Cse(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Cse(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=Dse(this,o)).options=r,t.mapOptions=n,t.webMapService=new lie(e,r),t._layerIdRenameMapList=[],t._appendLayers=!1,t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fse(e,t)}(o,e),i=o,(a=[{key:"initializeMap",value:function(e,t){var o=this;if(t)return this._appendLayers=!0,this.map=t,void this._addLayersToMap();this.mapOptions.container=this.options.target,"object"===Nse(this.mapOptions.crs)&&this.mapOptions.crs.epsgCode&&(this.mapOptions.crs=new n.CRS(this.mapOptions.crs.epsgCode,this.mapOptions.crs.WKT,this.mapOptions.crs.extent,this.mapOptions.crs.unit)),this.mapOptions.transformRequest||(this.mapOptions.transformRequest=function(e,t){var r="";if("string"==typeof o.options.proxy){var n="data";"Tile"===t&&(n="image"),r=o.webMapService.handleProxy(n)}return{url:r?"".concat(r).concat(encodeURIComponent(e)):e,credentials:o.webMapService.handleWithCredentials(r,e,o.options.withCredentials||!1)?"include":void 0}}),this.mapOptions.center=this.mapOptions.center||[0,0],this.mapOptions.zoom=this.mapOptions.zoom||0;var i=0;Object.prototype.hasOwnProperty.call(this.mapOptions,"fadeDuration")&&(i=this.mapOptions.fadeDuration),this.map=new r(Ise(Ise({},this.mapOptions),{},{fadeDuration:i})),this.fire("mapinitialized",{map:this.map}),this.map.on("load",function(){o._sendMapToUser()})}},{key:"clean",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),e&&this.map.remove(),this.map=null)}},{key:"_addLayersToMap",value:function(){var e=this,t=this._setUniqueId(this.mapOptions.style),r=t.sources,n=t.layers,o=t.layerIdMapList;n.forEach(function(t){var n=o.find(function(e){return e.renderId===t.id});n&&n.reused||(t.source&&!e.map.getSource(t.source)&&e.map.addSource(t.source,r[t.source]),e.map.addLayer(t))}),Object.assign(this.mapOptions.style,{layers:n,sources:r}),this._layerIdRenameMapList=o,this._sendMapToUser()}},{key:"_setUniqueId",value:function(e){var t=JSON.parse(JSON.stringify(e.layers)),r={},n={},o=[],i="_".concat(+new Date);for(var a in e.sources){var s=a;this.map.getSource(a)&&(s=a+i),n[s]=a,r[s]=e.sources[a];var u,l=Tse(t);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.source===a&&(c.source=s)}}catch(e){l.e(e)}finally{l.f()}}var f,p=Tse(t);try{for(p.s();!(f=p.n()).done;){var h=f.value,y=h.id,d=void 0,m=this.map.getLayer(h.id);if(m)if(this.options.checkSameLayer&&xo(r[h.source],this.map.getStyle().sources[m.source]))d=!0,h.source=n[h.source];else{var v=h.id+i;h.id=v}o.push({originId:y,renderId:h.id,reused:d})}}catch(e){p.e(e)}finally{p.f()}return{sources:r,layers:t,layerIdMapList:o}}},{key:"_generateAppreciableLayers",value:function(){var e=this;return this.mapOptions.style.layers.reduce(function(t,r){var n=Po(r["source-layer"]?r:Ise(Ise({},r),{},{layerInfo:{id:r.id}})),o=t.find(function(e){return e.id===n});if(o)o.renderLayers.push(r.id);else{var i=e._layerIdRenameMapList.find(function(e){return e.renderId===r.id});t.push(Ise(Ise({},r),{},{id:n,name:i&&i.originId,renderLayers:[r.id],reused:i&&i.reused}))}return t},[])}},{key:"_sendMapToUser",value:function(){var e=this,t=this._generateAppreciableLayers();this._sourceListModel=new uae({map:this.map,layers:t,appendLayers:this._appendLayers}),this._sourceListModel.on({layerupdatechanged:function(t){e.fire("layerupdatechanged",t)}}),this.fire("mapcreatesucceeded",{map:this.map,mapparams:{title:this.mapOptions.name,description:""},layers:this.getSelfAppreciableLayers()})}}])&&Mse(i.prototype,a),s&&Mse(i,s),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,a,s}()}var Gse=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8],"doc":"Style specification version number. Must be 8.","example":8},"fragment":{"type":"boolean","doc":"Indicates that a style is a fragment style.","example":true},"name":{"type":"string","doc":"A human-readable name for the style.","example":"Bright"},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"center":{"type":"array","value":"number","doc":"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":[-73.9749,40.7736]},"zoom":{"type":"number","doc":"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":12.5},"bearing":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Default bearing, in degrees. The bearing is the compass direction that is \\"up\\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":29},"pitch":{"type":"number","default":0,"units":"degrees","doc":"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":50},"light":{"type":"light","doc":"The global light source. Note: This API is deprecated. Prefer using `flat` light type instead in the `lights` API.","example":{"anchor":"viewport","color":"white","intensity":0.4}},"lights":{"required":false,"type":"array","value":"light-3d","doc":"Array of light sources affecting the whole map and the default for 3D style, mutually exclusive with the light property","example":[{"id":"environment","type":"ambient","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4}},{"id":"sun_light","type":"directional","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4,"direction":[200,40],"cast-shadows":true,"shadow-intensity":0.2}}],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"terrain":{"type":"terrain","optional":true,"doc":"A global modifier that elevates layers and markers based on a DEM data source."},"fog":{"type":"fog","doc":"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},"camera":{"type":"camera","doc":"Global setting to control additional camera intrinsics parameters, e.g. projection type (perspective / orthographic)."},"color-theme":{"type":"colorTheme","doc":"A global modifier for the colors of the style."},"imports":{"type":"array","value":"import","doc":"Imports other styles into this style.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"schema":{"type":"schema","doc":"Definition of the schema for configuration options.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"sources":{"required":true,"type":"sources","doc":"Data source specifications.","example":{"mapbox-streets":{"type":"vector","url":"mapbox://mapbox.mapbox-streets-v6"}}},"sprite":{"type":"string","doc":"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","example":"mapbox://sprites/mapbox/bright-v8"},"glyphs":{"type":"string","doc":"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf","example":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition","doc":"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style\'s `transition` property.","example":{"duration":300,"delay":0}},"projection":{"type":"projection","doc":"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.","example":{"name":"albers","center":[-154,50],"parallels":[55,65]}},"layers":{"required":true,"type":"array","value":"layer","doc":"Layers will be drawn in the order of this array.","example":[{"id":"water","source":"mapbox-streets","source-layer":"water","type":"fill","paint":{"fill-color":"#00ffff"}}]},"models":{"type":"models","doc":"Specification of models used in the style.","example":{"spruce1-lod0":"asset://spruce1-lod0.glb","spruce1-lod1":"asset://spruce1-lod1.glb","spruce1-lod2":"asset://spruce1-lod2.glb"}}},"model":{"type":"string","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`.","required":true},"import":{"id":{"type":"string","doc":"Unique import name.","required":true},"url":{"type":"string","doc":"The URL of the style.","required":true},"config":{"type":"config","doc":"Configuration values for the imported style\'s options."},"data":{"type":"$root","doc":"The inlined style that must correspond to the contents of the specified URL."}},"config":{"*":{"type":"*","doc":"Value of the imported style\'s configuration option."}},"schema":{"*":{"type":"option","doc":"Specification of a configuration option."}},"option":{"default":{"type":"*","doc":"Default configuration value for this option.","property-type":"data-constant","expression":{"interpolated":false},"required":true},"type":{"type":"enum","doc":"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.","values":{"string":{"doc":"The result will be coerced to a string."},"number":{"doc":"The result will be coerced to a number."},"boolean":{"doc":"The result will be coerced to a boolean."},"color":{"doc":"The result will be coerced to a color."}}},"array":{"type":"boolean","doc":"If true, this option is returned as an array"},"minValue":{"type":"number","doc":"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},"maxValue":{"type":"number","doc":"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},"stepValue":{"type":"number","doc":"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},"values":{"type":"array","value":"*","doc":"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."}},"models":{"*":{"type":"model","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{"id":{"type":"string","doc":"Unique light name.","required":true},"properties":{"type":"properties","doc":"Properties of the light."},"type":{"type":"enum","doc":"Type of the light to be added","values":{"ambient":{"doc":"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"directional":{"doc":"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"flat":{"doc":"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).","example":[90,40],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"cast-shadows":{"type":"boolean","default":false,"doc":"Enable/Disable shadow casting for this light","transition":false,"expression":{"interpolated":false},"property-type":"data-constant","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"sources":{"*":{"type":"source","doc":"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{"doc":"A vector tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{"doc":"A raster tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{"doc":"A RGB-encoded raster DEM source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"encoding":{"type":"enum","values":{"terrarium":{"doc":"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},"mapbox":{"doc":"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},"default":"mapbox","doc":"The encoding used by this source. Mapbox Terrain RGB is used by default"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_array":{"experimental":true,"type":{"required":true,"type":"enum","values":{"raster-array":{"doc":"A raster array source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"rasterLayers":{"type":"*","doc":"Contains the description of the raster data layers and the bands contained within the tiles."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{"doc":"A GeoJSON data source."}},"doc":"The data type of the GeoJSON source."},"data":{"type":"*","doc":"A URL to a GeoJSON file, or inline GeoJSON."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level at which to create vector tiles"},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0,"doc":"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},"filter":{"type":"*","doc":"An expression for filtering features prior to processing them for rendering."},"tolerance":{"type":"number","default":0.375,"doc":"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},"cluster":{"type":"boolean","default":false,"doc":"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count"},"clusterRadius":{"type":"number","default":50,"minimum":0,"doc":"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},"clusterMaxZoom":{"type":"number","doc":"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},"clusterMinPoints":{"type":"number","doc":"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},"clusterProperties":{"type":"*","doc":"An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{\\"property_name\\": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `\\"+\\"` or `\\"max\\"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{\\"sum\\": [\\"+\\", [\\"get\\", \\"scalerank\\"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `[\\"accumulated\\"]` value, e.g.:\\n`{\\"sum\\": [[\\"+\\", [\\"accumulated\\"], [\\"get\\", \\"sum\\"]], [\\"get\\", \\"scalerank\\"]]}`"},"lineMetrics":{"type":"boolean","default":false,"doc":"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},"generateId":{"type":"boolean","default":false,"doc":"Whether to generate ids for the GeoJSON features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."},"dynamic":{"type":"boolean","default":false,"doc":"Whether to optimize this source for frequent data updates (e.g. animating features).","sdk-support":{"basic functionality":{"js":"3.4.0"}}}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{"doc":"A video data source."}},"doc":"The data type of the video source."},"urls":{"required":true,"type":"array","value":"string","doc":"URLs to video content in order of preferred format."},"coordinates":{"required":true,"doc":"Corners of video specified in longitude, latitude pairs.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{"doc":"An image data source."}},"doc":"The data type of the image source."},"url":{"required":false,"type":"string","doc":"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},"coordinates":{"required":true,"doc":"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":{"doc":"A collection of 3D models"},"batched-model":{"doc":"A collection of 3D models with anchor data"}},"doc":"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which batched-model tiles are available"},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec."}},"layer":{"id":{"type":"string","doc":"Unique layer name.","required":true},"type":{"type":"enum","values":{"fill":{"doc":"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"line":{"doc":"A stroked line.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"symbol":{"doc":"An icon or a text label.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"circle":{"doc":"A filled circle.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"heatmap":{"doc":"A heatmap.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"fill-extrusion":{"doc":"An extruded (3D) polygon.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"raster":{"doc":"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"raster-particle":{"experimental":true,"doc":"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}}},"hillshade":{"doc":"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}}},"model":{"doc":"A 3D model","experimental":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"background":{"doc":"The background color or pattern of the map.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"sky":{"doc":"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"slot":{"doc":"Marks the position of a slot.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"clip":{"doc":"Layer that removes 3D content from map.","experimental":true,"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.6.0","ios":"11.6.0"}}}},"doc":"Rendering type of this layer.","required":true},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"source":{"type":"string","doc":"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{"type":"string","doc":"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},"slot":{"type":"string","doc":"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"minzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},"maxzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},"filter":{"type":"filter","doc":"An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\\"feature-state\\", ...]` expression is not supported in filter expressions. The `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions are supported only for filter expressions on the symbol layer."},"layout":{"type":"layout","doc":"Layout properties for the layer."},"paint":{"type":"paint","doc":"Default paint properties for this layer."}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"model-id":{"type":"string","default":"","doc":"Model to render. It can be either a string referencing an element to the models root property or an internal or external URL","property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":false,"requires":[{"source":["geojson","vector"]}]}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":{"doc":"If present the clip layer would remove all 3d model layers below it. Currently only instanced models (e.g. trees) are removed."},"symbol":{"doc":"If present the clip layer would remove all symbol layers below it."}},"default":[],"doc":"Layer types that will also be removed if fallen below this clip layer.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.6.0","ios":"11.6.0"}},"expression":{"interpolated":false},"property-type":"data-constant","experimental":true}},"layout_fill":{"fill-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"},"data-driven styling":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","experimental":true,"private":true,"default":0,"minimum":0,"maximum":1,"doc":"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{"doc":"A cap with a squared-off end which is drawn to the exact endpoint of the line."},"round":{"doc":"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"square":{"doc":"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."}},"default":"butt","doc":"The display of line endings.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{"doc":"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."},"round":{"doc":"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"miter":{"doc":"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."},"none":{"doc":"Line segments are not joined together, each one creates a separate line. Useful in combination with line-pattern. Line-cap property is not respected. Can\'t be used with data-driven styling."}},"default":"miter","doc":"The display of lines when joining.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"},"`none` value":{"js":"3.4.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"doc":"Used to automatically convert miter joins to bevel joins for sharp angles.","requires":[{"line-join":"miter"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"doc":"Used to automatically convert round joins to miter joins for shallow angles.","requires":[{"line-join":"round"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","experimental":true,"doc":"Vertical offset from ground, in meters. Defaults to 0. Not supported for globe projection at the moment.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"},"data-driven styling":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{"doc":"The label is placed at the point where the geometry is located."},"line":{"doc":"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{"doc":"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},"default":"point","doc":"Label placement relative to its geometry.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`line-center` value":{"js":"0.47.0","android":"6.4.0","ios":"4.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","doc":"Distance between two symbol anchors.","requires":[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"doc":"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don\'t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"},"data-driven styling":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{"doc":"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"source":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},"default":"auto","doc":"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{"js":"0.49.0","android":"6.6.0","ios":"4.5.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"doc":"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"requires":[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the icon will be visible even if it collides with other previously drawn symbols.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the icon.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"doc":"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},"viewport":{"doc":"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of icons.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","doc":"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{"doc":"The icon is displayed at its intrinsic aspect ratio."},"width":{"doc":"The icon is scaled in the x-dimension to fit the width of the text."},"height":{"doc":"The icon is scaled in the y-dimension to fit the height of the text."},"both":{"doc":"The icon is scaled in both x- and y-dimensions."}},"default":"none","doc":"Scales the icon to fit around the associated text.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"stretchable icons":{"js":"1.6.0","android":"9.2.0","ios":"5.8.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","doc":"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","doc":"Name of image in sprite to use for drawing an image background.","tokens":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the icon clockwise.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the icon bounding box used for detecting symbol collisions.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"doc":"If true, the icon may be flipped to prevent it from being rendered upside-down.","requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"doc":"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{"doc":"The center of the icon is placed closest to the anchor."},"left":{"doc":"The left side of the icon is placed closest to the anchor."},"right":{"doc":"The right side of the icon is placed closest to the anchor."},"top":{"doc":"The top of the icon is placed closest to the anchor."},"bottom":{"doc":"The bottom of the icon is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the icon is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the icon is placed closest to the anchor."}},"default":"center","doc":"Part of the icon placed closest to the anchor.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The icon is aligned to the plane of the map."},"viewport":{"doc":"The icon is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `icon-rotation-alignment`."}},"default":"auto","doc":"Orientation of icon when map is pitched.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The text is aligned to the plane of the map."},"viewport":{"doc":"The text is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `text-rotation-alignment`."}},"default":"auto","doc":"Orientation of text when map is pitched.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},"viewport":{"doc":"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"doc":"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"doc":"Font stack to use for displaying text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","doc":"Font size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","doc":"The maximum line width for text wrapping.","requires":["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","doc":"Text leading value for multi-line text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0","android":"10.0.0","ios":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","doc":"Text tracking amount.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{"doc":"The text is aligned towards the anchor position."},"left":{"doc":"The text is aligned to the left."},"center":{"doc":"The text is centered."},"right":{"doc":"The text is aligned to the right."}},"default":"center","doc":"Text justification options.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"},"auto":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"doc":"Radial offset of text, in the direction of the symbol\'s anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"},"data-driven styling":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"requires":["text-field",{"symbol-placement":["point"]}],"doc":"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"default":"center","doc":"Part of the text placed closest to the anchor.","requires":["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","doc":"Maximum angle change between adjacent characters.","requires":["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{"doc":"If a text\'s language supports horizontal writing mode, symbols would be laid out horizontally."},"vertical":{"doc":"If a text\'s language supports vertical writing mode, symbols would be laid out vertically."}},"doc":"The property allows control over a symbol\'s orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single \'vertical\' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either [\'horizontal\', \'vertical\'] or [\'vertical\', \'horizontal\'], the order doesn\'t affect the placement.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"1.3.0","android":"8.3.0","ios":"5.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the text clockwise.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the text bounding box used for detecting symbol collisions.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"doc":"If true, the text may be flipped vertically to prevent it from being rendered upside-down.","requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{"doc":"The text is not altered."},"uppercase":{"doc":"Forces all letters to be displayed in uppercase."},"lowercase":{"doc":"Forces all letters to be displayed in lowercase."}},"default":"none","doc":"Specifies how to capitalize text, similar to the CSS `text-transform` property.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","doc":"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the text will be visible even if it collides with other previously drawn symbols.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"doc":"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.","requires":["text-field","icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"},"expressions support":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"filter":{"type":"array","value":"*","doc":"A filter selects specific features from a layer."},"filter_symbol":{"type":"boolean","doc":"Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","doc":"Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","doc":"Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","doc":"Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{"doc":"`[\\"==\\", key, value]` equality: `feature[key] = value`"},"!=":{"doc":"`[\\"!=\\", key, value]` inequality: `feature[key] ≠ value`"},">":{"doc":"`[\\">\\", key, value]` greater than: `feature[key] > value`"},">=":{"doc":"`[\\">=\\", key, value]` greater than or equal: `feature[key] ≥ value`"},"<":{"doc":"`[\\"<\\", key, value]` less than: `feature[key] < value`"},"<=":{"doc":"`[\\"<=\\", key, value]` less than or equal: `feature[key] ≤ value`"},"in":{"doc":"`[\\"in\\", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`"},"!in":{"doc":"`[\\"!in\\", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`"},"all":{"doc":"`[\\"all\\", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`"},"any":{"doc":"`[\\"any\\", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`"},"none":{"doc":"`[\\"none\\", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`"},"has":{"doc":"`[\\"has\\", key]` `feature[key]` exists"},"!has":{"doc":"`[\\"!has\\", key]` `feature[key]` does not exist"}},"doc":"The filter operator."},"geometry_type":{"type":"enum","values":{"Point":{"doc":"Filter to point geometries."},"LineString":{"doc":"Filter to line geometries."},"Polygon":{"doc":"Filter to polygon geometries."}},"doc":"The geometry type for the filter to select."},"function":{"expression":{"type":"expression","doc":"An expression."},"stops":{"type":"array","doc":"An array of stops.","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0,"doc":"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},"property":{"type":"string","doc":"The name of a feature property to use as the function input.","default":"$zoom"},"type":{"type":"enum","values":{"identity":{"doc":"Return the input value as the output value."},"exponential":{"doc":"Generate an output by interpolating between stops just less than and just greater than the function input."},"interval":{"doc":"Return the output value of the stop just less than the function input."},"categorical":{"doc":"Return the output value of the stop equal to the function input."}},"doc":"The interpolation strategy to use in function evaluation.","default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{"doc":"Use the RGB color space to interpolate color values"},"lab":{"doc":"Use the LAB color space to interpolate color values."},"hcl":{"doc":"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},"doc":"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.","default":"rgb"},"default":{"type":"*","required":false,"doc":"A value to serve as a fallback function result when a value isn\'t otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property\'s default is used in these circumstances."}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2,"doc":"Zoom level and value pair."},"expression":{"type":"array","value":"*","minimum":1,"doc":"An expression defines a function that can be used for data-driven style properties or feature filters."},"expression_name":{"doc":"","type":"enum","values":{"let":{"doc":"Binds expressions to named variables, which can then be referenced in the result expression using [\\"var\\", \\"variable_name\\"].","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"var":{"doc":"References variable bound using \\"let\\".","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"config":{"doc":"Retrieves the configuration value for the given option.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"literal":{"doc":"Provides a literal array or object value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"array":{"doc":"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"at":{"doc":"Retrieves an item from an array.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"in":{"doc":"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.6.0","android":"9.1.0","ios":"5.8.0"}}},"index-of":{"doc":"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"slice":{"doc":"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"case":{"doc":"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"match":{"doc":"Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `[\\"get\\", \\"building_type\\"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `[\\"c\\", \\"b\\"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `\\"in\\"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"coalesce":{"doc":"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`\'image\'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"step":{"doc":"Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\\n\\nInterpolation types:\\n- `[\\"linear\\"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `[\\"exponential\\", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `[\\"cubic-bezier\\", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate-hcl":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"interpolate-lab":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"ln2":{"doc":"Returns mathematical constant ln(2).","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pi":{"doc":"Returns the mathematical constant pi.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"e":{"doc":"Returns the mathematical constant e.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"typeof":{"doc":"Returns a string describing the type of the given value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"string":{"doc":"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"number":{"doc":"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"boolean":{"doc":"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"object":{"doc":"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"collator":{"doc":"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.","group":"Types","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"format":{"doc":"Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `\\"text-font\\"`: Overrides the font stack specified by the root layout property.\\n- `\\"text-color\\"`: Overrides the color specified by the root paint property.\\n- `\\"font-scale\\"`: Applies a scaling factor on `text-size` as specified by the root layout property.","group":"Types","sdk-support":{"basic functionality":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-font":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"font-scale":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-color":{"js":"1.3.0","android":"7.3.0","ios":"4.10.0"},"image":{"js":"1.6.0","android":"8.6.0","ios":"5.7.0"}}},"image":{"doc":"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`\'format\'`](#types-format) expression. A [`\'coalesce\'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `\'image\'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `\'image\'` expression.","group":"Types","sdk-support":{"basic functionality":{"js":"1.4.0","android":"8.6.0","ios":"5.7.0"}}},"number-format":{"doc":"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.","group":"Types","sdk-support":{"basic functionality":{"js":"0.54.0","android":"8.4.0","ios":"5.4.0"}}},"to-string":{"doc":"Converts the input value to a string. If the input is `null`, the result is `\\"\\"`. If the input is a [`boolean`](#types-boolean), the result is `\\"true\\"` or `\\"false\\"`. If the input is a number, it is converted to a string as specified by the [\\"NumberToString\\" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `\\"rgba(r,g,b,a)\\"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-number":{"doc":"Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the [\\"ToNumber Applied to the String Type\\" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-boolean":{"doc":"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-rgba":{"doc":"Returns a four-element array containing the input color\'s red, green, blue, and alpha components, in that order.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-color":{"doc":"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgb":{"doc":"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgba":{"doc":"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"hsl":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"hsla":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"get":{"doc":"Retrieves a property value from the current feature\'s properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"has":{"doc":"Tests for the presence of an property value in the current feature\'s properties, or from another object if a second argument is provided.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"length":{"doc":"Returns the length of an array or string.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"properties":{"doc":"Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\\"get\\", \\"property_name\\"]` directly.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"feature-state":{"doc":"Retrieves a property value from the current feature\'s state. Returns `null` if the requested property is not present on the feature\'s state. A feature\'s state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\"feature-state\\"] can only be used with paint properties that support data-driven styling.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.46.0","android":"10.0.0","ios":"10.0.0"}}},"geometry-type":{"doc":"Returns the feature\'s geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"id":{"doc":"Returns the feature\'s id, if it has one.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"zoom":{"doc":"Returns the current zoom level. Note that in style layout and paint properties, [\\"zoom\\"] may only appear as the input to a top-level \\"step\\" or \\"interpolate\\" expression.","group":"Camera","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pitch":{"doc":"Returns the current pitch in degrees. `[\\"pitch\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"distance-from-center":{"doc":"Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `[\\"distance-from-center\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"measure-light":{"doc":"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"heatmap-density":{"doc":"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.","group":"Heatmap","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"line-progress":{"doc":"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.6.0"}}},"sky-radial-progress":{"doc":"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.","group":"sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"accumulated":{"doc":"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.53.0","android":"8.4.0","ios":"5.5.0"}}},"+":{"doc":"Returns the sum of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"*":{"doc":"Returns the product of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"-":{"doc":"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"/":{"doc":"Returns the result of floating point division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"%":{"doc":"Returns the remainder after integer division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"^":{"doc":"Returns the result of raising the first input to the power specified by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sqrt":{"doc":"Returns the square root of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"log10":{"doc":"Returns the base-ten logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"ln":{"doc":"Returns the natural logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"log2":{"doc":"Returns the base-two logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sin":{"doc":"Returns the sine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"cos":{"doc":"Returns the cosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"tan":{"doc":"Returns the tangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"asin":{"doc":"Returns the arcsine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"acos":{"doc":"Returns the arccosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"atan":{"doc":"Returns the arctangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"min":{"doc":"Returns the minimum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"max":{"doc":"Returns the maximum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"round":{"doc":"Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `[\\"round\\", -1.5]` evaluates to -2.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"abs":{"doc":"Returns the absolute value of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"ceil":{"doc":"Returns the smallest integer that is greater than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"floor":{"doc":"Returns the largest integer that is less than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"distance":{"doc":"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"9.2.0","ios":"5.9.0"}}},"==":{"doc":"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"!=":{"doc":"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">":{"doc":"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<":{"doc":"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">=":{"doc":"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<=":{"doc":"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"all":{"doc":"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"any":{"doc":"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"!":{"doc":"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"within":{"doc":"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line\'s endpoint is on the boundary.","group":"Decision","sdk-support":{"basic functionality":{"js":"1.9.0","android":"9.1.0","ios":"5.8.0"}}},"is-supported-script":{"doc":"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.6.0","ios":"4.1.0"}}},"upcase":{"doc":"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"downcase":{"doc":"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"concat":{"doc":"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"resolved-locale":{"doc":"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"raster-value":{"doc":"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.","group":"Raster Colorization","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-particle-speed":{"doc":"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.","group":"Raster Particle Animation","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}}},"random":{"doc":"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"camera":{"camera-projection":{"doc":"Camera projection describes how 3D world geometry get projected into 2D screen","type":"enum","values":{"perspective":{"doc":"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},"orthographic":{"doc":"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","doc":"Expects a base64 encoded PNG image which represents a cube strip LUT. The height of the image cannot exceed 32 pixels and the width must be equal to the height squared.","transition":false,"property-type":"data-constant","expression":{"interpolated":false}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}}},"projection":{"name":{"type":"enum","values":{"albers":{"doc":"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"equalEarth":{"doc":"An Equal Earth projection."},"equirectangular":{"doc":"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},"lambertConformalConic":{"doc":"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"mercator":{"doc":"The Mercator projection is the default projection."},"naturalEarth":{"doc":"A Natural Earth projection."},"winkelTripel":{"doc":"A Winkel Tripel projection."},"globe":{"doc":"A globe projection."}},"default":"mercator","doc":"The name of the projection to be used for rendering the map.","required":true,"sdk-support":{"basic functionality":{"js":"2.6.0","ios":"10.5.0","android":"10.5.0"}}},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"doc":"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].","example":[-96,37.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"doc":"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).","example":[29.5,45.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}}},"terrain":{"source":{"type":"string","doc":"Name of a source of `raster_dem` type to be used for terrain elevation.","required":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","requires":["source"],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"doc":"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","doc":"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color\'s opacity will not affect the opacity of the 1px stroke, if it is used.","transition":true,"requires":[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","doc":"The outline color of the fill. Matches the value of `fill-color` if unspecified.","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill is translated relative to the map."},"viewport":{"doc":"The fill is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-translate`.","default":"map","requires":["fill-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","doc":"The base color of the extruded fill. The extrusion\'s surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill extrusion is translated relative to the map."},"viewport":{"doc":"The fill extrusion is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-extrusion-translate`.","default":"map","requires":["fill-extrusion-translate"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude this layer.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.","transition":true,"requires":["fill-extrusion-height"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"doc":"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.","transition":false,"sdk-support":{"basic functionality":{"js":"0.50.0","android":"7.0.0","ios":"4.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.","requires":["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.","requires":["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","doc":"The color of the flood light effect on the walls of the extruded buildings.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"doc":"The intensity of the flood light color.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"units":"meters","default":0,"minimum":0,"doc":"The extent of the flood light effect on the walls of the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"units":"meters","default":0,"doc":"The extent of the flood light effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"doc":"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"doc":"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.","requires":["fill-extrusion-edge-radius"],"transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.10.0","ios":"10.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","doc":"The opacity at which the line will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","doc":"The color with which the line will be drawn.","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.23.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{"doc":"The line is translated relative to the map."},"viewport":{"doc":"The line is translated relative to the viewport."}},"doc":"Controls the frame of reference for `line-translate`.","default":"map","requires":["line-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","doc":"Stroke thickness.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"doc":"Draws a line casing outside of a line\'s actual path. Value indicates the width of the inner gap.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"doc":"The line\'s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.12.1","android":"3.0.0","ios":"3.1.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","doc":"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won\'t render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","doc":"A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\\"lineMetrics\\": true`.","example":["interpolate",["linear"],["line-progress"],0,"blue",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.4.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","doc":"The line part between [trim-start, trim-end] will be painted using `line-trim-color,` which is transparent by default to produce a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.5.0","ios":"10.5.0"}},"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","doc":"The fade range for the trim-start and trim-end points is defined by the `line-trim-offset` property. The first element of the array represents the fade range from the trim-start point toward the end of the line, while the second element defines the fade range from the trim-end point toward the beginning of the line. The fade result is achieved by interpolating between `line-trim-color` and the color specified by the `line-color` or the `line-gradient` property.","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":["line-trim-offset",{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.6.0","android":"11.6.0","ios":"11.6.0"}},"property-type":"data-constant"},"line-trim-color":{"type":"color","doc":"The color to be used for rendering the trimmed line section that is defined by the `line-trim-offset` property.","experimental":true,"default":"transparent","transition":true,"requires":["line-trim-offset",{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"3.6.0","android":"11.6.0","ios":"11.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"doc":"The width of the line border. A value of zero means no border.","default":0,"minimum":0,"transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"doc":"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.","default":"rgba(0, 0, 0, 0)","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"experimental":true,"doc":"Opacity multiplier (multiplies line-opacity value) of the line part that is occluded by 3D objects. Value 0 hides occluded part, value 1 means the same opacity as non-occluded part. The property is not supported when `line-opacity` has data-driven styling.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","doc":"Circle radius.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","doc":"The fill color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"doc":"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","doc":"The opacity at which the circle will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{"doc":"The circle is translated relative to the map."},"viewport":{"doc":"The circle is translated relative to the viewport."}},"doc":"Controls the frame of reference for `circle-translate`.","default":"map","requires":["circle-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{"doc":"Circles are scaled according to their apparent distance to the camera."},"viewport":{"doc":"Circles are not scaled."}},"default":"map","doc":"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The circle is aligned to the plane of the map."},"viewport":{"doc":"The circle is aligned to the plane of the viewport."}},"default":"viewport","doc":"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The width of the circle\'s stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","doc":"The stroke color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","doc":"The opacity of the circle\'s stroke.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","doc":"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"doc":"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"doc":"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"doc":"Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\\"heatmap-density\\"]` as input.","transition":false,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","doc":"The global opacity at which the heatmap layer will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"doc":"The opacity at which the icon will be drawn.","type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"doc":"The opacity at which the icon will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.","type":"number","minimum":0,"maximum":1,"default":1,"transition":true,"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"},"data-driven styling":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"doc":"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the icon\'s halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the icon outline.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Fade out the halo towards the outside.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the icon\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{"doc":"Icons are translated relative to the map."},"viewport":{"doc":"Icons are translated relative to the viewport."}},"doc":"Controls the frame of reference for `icon-translate`.","default":"map","requires":["icon-image","icon-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"doc":"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.","transition":true},"text-opacity":{"type":"number","doc":"The opacity at which the text will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","doc":"The opacity at which the text will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.","minimum":0,"maximum":1,"default":1,"transition":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"},"data-driven styling":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","doc":"The color with which the text will be drawn.","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the text\'s halo, which helps it stand out from backgrounds.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The halo\'s fadeout distance towards the outside.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the text\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{"doc":"The text is translated relative to the map."},"viewport":{"doc":"The text is translated relative to the viewport."}},"doc":"Controls the frame of reference for `text-translate`.","default":"map","requires":["text-field","text-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":false,"doc":"Increase or reduce the saturation of the symbol icon.","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}},"expression":{"interpolated":false},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":false,"doc":"Increase or reduce the contrast of the symbol icon.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","doc":"Increase or reduce the brightness of the symbols. The value is the minimum brightness.","default":0,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","doc":"Increase or reduce the brightness of the symbols. The value is the maximum brightness.","default":1,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","doc":"The opacity at which the image will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","doc":"Defines a color map by which to colorize a raster layer, parameterized by the `[\\"raster-value\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.","transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.","example":[0.2126,0.7152,0.0722,0],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source\'s stated data range is used.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","doc":"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the minimum brightness.","default":0,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the maximum brightness.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","doc":"Increase or reduce the saturation of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","doc":"Increase or reduce the contrast of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","doc":"The resampling/interpolation method to use for overscaling, also known as texture magnification filter","values":{"linear":{"doc":"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},"nearest":{"doc":"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},"default":"linear","sdk-support":{"basic functionality":{"js":"0.47.0","android":"6.3.0","ios":"4.2.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","doc":"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant","transition":false,"requires":[{"source":"raster-array"}],"doc":"Displayed band of raster array source layer. Defaults to the first band if not set.","example":"band-name","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}}},"raster-elevation":{"type":"number","doc":"Specifies an uniform elevation from the ground, in meters.","default":0,"minimum":0,"transition":true,"experimental":true,"sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.2.0","ios":"11.2.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant","transition":false,"doc":"Displayed band of raster array source layer","example":"\\"1713348000\\"","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}}},"raster-particle-count":{"type":"number","doc":"Defines the amount of particles per tile.","default":512,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"property-type":"data-constant"},"raster-particle-color":{"type":"color","doc":"Defines a color map by which to colorize a raster particle layer, parameterized by the `[\\"raster-particle-speed\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.","transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","doc":"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.","default":1,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","doc":"Defines a coefficient for the speed of particles’ motion.","default":0.2,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","doc":"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.","default":0.98,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","doc":"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).","default":0.8,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"doc":"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.","transition":false,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{"doc":"The hillshade illumination is relative to the north direction."},"viewport":{"doc":"The hillshade illumination is relative to the top of the viewport."}},"default":"viewport","doc":"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","doc":"Intensity of the hillshade","default":0.5,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","doc":"The shading color of areas that face away from the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","doc":"The shading color of areas that faces towards the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","doc":"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","doc":"The color with which the background will be drawn.","transition":true,"requires":[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity at which the background will be drawn.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{"doc":"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},"atmosphere":{"doc":"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},"default":"atmosphere","doc":"The type of the sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"doc":"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"doc":"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"doc":"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.","transition":false,"requires":[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","doc":"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","doc":"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire sky layer.","transition":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the model layer.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"units":"degrees","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"doc":"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{"type":"color","default":"#ffffff","doc":"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"doc":"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model\'s colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-type":{"type":"enum","values":{"common-3d":{"doc":"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{"doc":"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"common-3d","doc":"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow casting for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow receiving for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Intensity of the ambient occlusion if present in the 3D model.","expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"units":"intensity","doc":"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","doc":"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"doc":"An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}}}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds","doc":"Time allotted for transitions to complete."},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds","doc":"Length of time before a transition begins."}},"property-type":{"data-driven":{"type":"property-type","doc":"Property is interpolable and can be represented using a property expression."},"color-ramp":{"type":"property-type","doc":"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{"type":"property-type","doc":"Property is interpolable but cannot be represented using a property expression."},"constant":{"type":"property-type","doc":"Property is constant across all zoom levels and property values."}},"promoteId":{"*":{"type":"string","doc":"A name of a feature property to use as ID for feature state."}}}');function zse(e){"@babel/helpers - typeof";return(zse="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Vse(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=Array.isArray(e)&&e.filter(function(e){return e.metaData.tileType===t.tileType||fue(e.metaData.prjCoordSys)===fue(t.prjCoordSys)});return r&&r[0]&&r[0].metaData}function yue(e,t){var r=e.scale,n=e.dpi,o=e.coordUnit,i=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:22,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=[],o=Math.abs(e.left-e.right)/r,i=0;iMath.abs(e-t[o])&&(r=Math.abs(e-t[o]),n=o);return n}(uf(r,n,o),i)}function due(e){"@babel/helpers - typeof";return(due="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mue(){mue=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new C(n||[]);return o(a,"_invoke",{value:k(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var p="suspendedStart",h="suspendedYield",y="executing",d="completed",m={};function v(){}function b(){}function g(){}var w={};l(w,a,function(){return this});var S=Object.getPrototypeOf,O=S&&S(S(A([])));O&&O!==r&&n.call(O,a)&&(w=O);var _=g.prototype=v.prototype=Object.create(w);function x(e){["next","throw","return"].forEach(function(t){l(e,t,function(e){return this._invoke(t,e)})})}function P(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==due(c)&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){l.value=e,a(l)},function(e){return r("throw",e,a,s)})}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t(function(t,o){r(e,n,t,o)})}return i=i?i.then(o,o):o()}})}function k(t,r,n){var o=p;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=E(s,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?d:h,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function E(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,E(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function A(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function vue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function bue(e){for(var t=1;t=1&&(this.beforeLayerId=e.getStyle().layers[0].id),e.addLayer({id:this.id,type:"raster",source:this.id},this.beforeLayerId),this.map.fitBounds([t[1],t[3]]),this._afterAddVideoLayer()}}},{key:"_afterAddVideoLayer",value:function(){this.fire("loaded",{originCoordsRightBottom:this.originCoordsRightBottom,originCoordsLeftTop:this.originCoordsLeftTop,videoWidth:this.videoWidth,videoHeight:this.videoHeight})}},{key:"_calcCoords",value:function(e){var t=this,r=e.width,n=e.height,o=e.videoHeight,i=e.videoWidth||this.videoWidth,a=o||this.videoHeight,s=i/r,u=a/n,l=Math.min(s,u),c=r/2,f=n/2,p=i/l/2,h=a/l/2,y=[[c-p,f-h],[c+p,f-h],[c+p,f+h],[c-p,f+h]].map(function(e){return t.map.unproject(e)});return this.originCoordsLeftTop=y[0],this.originCoordsRightBottom=y[2],y}},{key:"play",value:function(){this.video.play()}},{key:"pause",value:function(){this.video.pause()}},{key:"remove",value:function(){this.id&&(this.map.removeLayer(this.id),this.map.removeSource(this.id),document.body.removeChild(document.getElementById(this.id)))}}])&&Tue(r.prototype,n),i&&Tue(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Mue(e){return function(e){if(Array.isArray(e))return Rue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Rue(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rue(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rue(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:A(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),m}},t}function Yue(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Que(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Xue(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=new lue(XF,e,t);return r.getMapInfo((n=Sue(mue().mark(function n(i,a,s){var u,l,c,f,p,h;return mue().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"processCompleted"!==i.type){n.next=15;break}if(u=i.result,l=u.dynamicProjection,c=u.prjCoordSys,f=c.epsgCode,!cue(c.type)){n.next=6;break}return s(new Error("mapbox-gl cannot support plane coordinate system.")),n.abrupt("return");case 6:if(3857===f||l||o().CRS){n.next=9;break}return s(new Error("The EPSG code ".concat(f," needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362"))),n.abrupt("return");case 9:return n.next=11,kue(e,i.result,bue(bue({},t),{},{initMapService:r}));case 11:return p=n.sent,(h=new(o().Map)(p)).loaded()?a({map:h}):h.on("load",function(){a({map:h})}),n.abrupt("return");case 15:s(new Error("Fetch mapService is failed.")),n.next=21;break;case 18:n.prev=18,n.t0=n.catch(0),s(n.t0);case 21:case"end":return n.stop()}},n,null,[[0,18]])})),function(e,t,r){return n.apply(this,arguments)}));var n},o().supermap.Graphic=ij,o().supermap.map.getDefaultVectorTileStyle=function(e,t){t=t||{};var r={};r.version=t.version||8,r.layers=t.layers||[],r.light=t.light||{anchor:"viewport",color:"#fcf6ef",intensity:.5,position:[1.15,201,20]};var n={version:r.version,sources:{"vector-tiles":{type:"vector",tiles:[e]}},layers:r.layers,light:r.light};return null!=t.sprite&&(n.sprite=t.sprite),null!=t.glyphs&&(n.glyphs=t.glyphs),n},o().supermap.map.setBackground=function(e,t){t&&e&&e.addLayer({id:"background",type:"background",paint:{"background-color":t}},"background")},o().supermap.map.setPaintProperty=function(e,t,r,n,o,i){if(t&&e){"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]);for(var a=0;ac;)if((l=s[c++])!=l)return!0}else for(;u>c;c++)if((e||c in s)&&s[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},4538:function(e,t,r){"use strict";var n=r(398),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},578:function(e,t,r){"use strict";var n=r(2791),o=r(7197),i=r(1805),a=r(1807);e.exports=function(e,t,r){for(var s=o(t),u=a.f,l=i.f,c=0;c0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},1009:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3768:function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(1697),i=r(1805).f,a=r(5233),s=r(5414),u=r(6507),l=r(578),c=r(3670);e.exports=function(e,t){var r,f,p,h,y,d=e.target,m=e.global,v=e.stat;if(r=m?o:v?o[d]||u(d,{}):o[d]&&o[d].prototype)for(f in t){if(h=t[f],p=e.dontCallGetSet?(y=i(r,f))&&y.value:r[f],!c(m?f:d+(v?".":"#")+f,e.forced)&&void 0!==p){if(n(h)==n(p))continue;l(h,p)}(e.sham||p&&p.sham)&&a(h,"sham",!0),s(r,f,h,e)}}},4877:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},8574:function(e,t,r){"use strict";var n=r(4877);e.exports=!n(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},9707:function(e,t,r){"use strict";var n=r(8574),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},2756:function(e,t,r){"use strict";var n=r(9234),o=r(2791),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),u=s&&"something"===function(){}.name,l=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:u,CONFIGURABLE:l}},398:function(e,t,r){"use strict";var n=r(8574),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}},5189:function(e,t,r){"use strict";var n=r(1697),o=r(2631);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},2968:function(e,t,r){"use strict";var n=r(7644),o=r(155);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},1697:function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=function(e){return e&&e.Math===Math&&e};e.exports=o("object"==("undefined"==typeof globalThis?"undefined":n(globalThis))&&globalThis)||o("object"==("undefined"==typeof window?"undefined":n(window))&&window)||o("object"==("undefined"==typeof self?"undefined":n(self))&&self)||o("object"==(void 0===r.g?"undefined":n(r.g))&&r.g)||o("object"==n(this)&&this)||function(){return this}()||Function("return this")()},2791:function(e,t,r){"use strict";var n=r(398),o=r(6079),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},8551:function(e){"use strict";e.exports={}},107:function(e,t,r){"use strict";var n=r(9234),o=r(4877),i=r(2533);e.exports=!n&&!o(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},9213:function(e,t,r){"use strict";var n=r(398),o=r(4877),i=r(4538),a=Object,s=n("".split);e.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?s(e,""):a(e)}:a},3128:function(e,t,r){"use strict";var n=r(398),o=r(2631),i=r(4243),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},7863:function(e,t,r){"use strict";var n,o,i,a=r(5032),s=r(1697),u=r(6220),l=r(5233),c=r(2791),f=r(4243),p=r(109),h=r(8551),y=s.TypeError,d=s.WeakMap;if(a||f.state){var m=f.state||(f.state=new d);m.get=m.get,m.has=m.has,m.set=m.set,n=function(e,t){if(m.has(e))throw new y("Object already initialized");return t.facade=e,m.set(e,t),t},o=function(e){return m.get(e)||{}},i=function(e){return m.has(e)}}else{var v=p("state");h[v]=!0,n=function(e,t){if(c(e,v))throw new y("Object already initialized");return t.facade=e,l(e,v,t),t},o=function(e){return c(e,v)?e[v]:{}},i=function(e){return c(e,v)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!u(t)||(r=o(t)).type!==e)throw new y("Incompatible receiver, "+e+" required");return r}}}},2631:function(e){"use strict";function t(e){"@babel/helpers - typeof";return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r="object"==("undefined"==typeof document?"undefined":t(document))&&document.all;e.exports=void 0===r&&void 0!==r?function(e){return"function"==typeof e||e===r}:function(e){return"function"==typeof e}},3670:function(e,t,r){"use strict";var n=r(4877),o=r(2631),i=/#|\.prototype\./,a=function(e,t){var r=u[s(e)];return r===c||r!==l&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},u=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";e.exports=a},155:function(e){"use strict";e.exports=function(e){return null===e||void 0===e}},6220:function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(2631);e.exports=function(e){return"object"==n(e)?null!==e:o(e)}},497:function(e){"use strict";e.exports=!1},3443:function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(5189),i=r(2631),a=r(7123),s=r(5970),u=Object;e.exports=s?function(e){return"symbol"==n(e)}:function(e){var t=o("Symbol");return i(t)&&a(t.prototype,u(e))}},428:function(e,t,r){"use strict";var n=r(9800);e.exports=function(e){return n(e.length)}},7773:function(e,t,r){"use strict";var n=r(398),o=r(4877),i=r(2631),a=r(2791),s=r(9234),u=r(2756).CONFIGURABLE,l=r(3128),c=r(7863),f=c.enforce,p=c.get,h=String,y=Object.defineProperty,d=n("".slice),m=n("".replace),v=n([].join),b=s&&!o(function(){return 8!==y(function(){},"length",{value:8}).length}),g=String(String).split("String"),w=e.exports=function(e,t,r){"Symbol("===d(h(t),0,7)&&(t="["+m(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||u&&e.name!==t)&&(s?y(e,"name",{value:t,configurable:!0}):e.name=t),b&&r&&a(r,"arity")&&e.length!==r.arity&&y(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&y(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=f(e);return a(n,"source")||(n.source=v(g,"string"==typeof t?t:"")),e};Function.prototype.toString=w(function(){return i(this)&&p(this).source||l(this)},"toString")},7443:function(e){"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},6355:function(e,t,r){"use strict";var n=r(9234),o=r(398),i=r(9707),a=r(4877),s=r(3334),u=r(791),l=r(15),c=r(6079),f=r(9213),p=Object.assign,h=Object.defineProperty,y=o([].concat);e.exports=!p||a(function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection");return e[r]=7,"abcdefghijklmnopqrst".split("").forEach(function(e){t[e]=e}),7!==p({},e)[r]||"abcdefghijklmnopqrst"!==s(p({},t)).join("")})?function(e,t){for(var r=c(e),o=arguments.length,a=1,p=u.f,h=l.f;o>a;)for(var d,m=f(arguments[a++]),v=p?y(s(m),p(m)):s(m),b=v.length,g=0;b>g;)d=v[g++],n&&!i(h,m,d)||(r[d]=m[d]);return r}:p},1807:function(e,t,r){"use strict";var n=r(9234),o=r(107),i=r(4796),a=r(9809),s=r(6779),u=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.f=n?i?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=c(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return l(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},1805:function(e,t,r){"use strict";var n=r(9234),o=r(9707),i=r(15),a=r(1718),s=r(1059),u=r(6779),l=r(2791),c=r(107),f=Object.getOwnPropertyDescriptor;t.f=n?f:function(e,t){if(e=s(e),t=u(t),c)try{return f(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},3602:function(e,t,r){"use strict";var n=r(7386),o=r(1009).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},791:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},7123:function(e,t,r){"use strict";var n=r(398);e.exports=n({}.isPrototypeOf)},7386:function(e,t,r){"use strict";var n=r(398),o=r(2791),i=r(1059),a=r(7943).indexOf,s=r(8551),u=n([].push);e.exports=function(e,t){var r,n=i(e),l=0,c=[];for(r in n)!o(s,r)&&o(n,r)&&u(c,r);for(;t.length>l;)o(n,r=t[l++])&&(~a(c,r)||u(c,r));return c}},3334:function(e,t,r){"use strict";var n=r(7386),o=r(1009);e.exports=Object.keys||function(e){return n(e,o)}},15:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},5720:function(e,t,r){"use strict";var n=r(9707),o=r(2631),i=r(6220),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&o(r=e.toString)&&!i(s=n(r,e)))return s;if(o(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&o(r=e.toString)&&!i(s=n(r,e)))return s;throw new a("Can't convert object to primitive value")}},7197:function(e,t,r){"use strict";var n=r(5189),o=r(398),i=r(3602),a=r(791),s=r(9809),u=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?u(t,r(e)):t}},5329:function(e,t,r){"use strict";var n=r(1697);e.exports=n},1308:function(e,t,r){"use strict";var n=r(155),o=TypeError;e.exports=function(e){if(n(e))throw new o("Can't call method on "+e);return e}},109:function(e,t,r){"use strict";var n=r(4499),o=r(606),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},4243:function(e,t,r){"use strict";var n=r(497),o=r(1697),i=r(6507),a=e.exports=o["__core-js_shared__"]||i("__core-js_shared__",{});(a.versions||(a.versions=[])).push({version:"3.37.1",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})},4499:function(e,t,r){"use strict";var n=r(4243);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},7161:function(e,t,r){"use strict";var n=r(5950),o=r(4877),i=r(1697).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41})},7636:function(e,t,r){"use strict";var n=r(7105),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},1059:function(e,t,r){"use strict";var n=r(9213),o=r(1308);e.exports=function(e){return n(o(e))}},7105:function(e,t,r){"use strict";var n=r(7443);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},9800:function(e,t,r){"use strict";var n=r(7105),o=Math.min;e.exports=function(e){var t=n(e);return t>0?o(t,9007199254740991):0}},6079:function(e,t,r){"use strict";var n=r(1308),o=Object;e.exports=function(e){return o(n(e))}},8167:function(e,t,r){"use strict";var n=r(9707),o=r(6220),i=r(3443),a=r(2968),s=r(5720),u=r(7709),l=TypeError,c=u("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,u=a(e,c);if(u){if(void 0===t&&(t="default"),r=n(u,e,t),!o(r)||i(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6779:function(e,t,r){"use strict";var n=r(8167),o=r(3443);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},4861:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},606:function(e,t,r){"use strict";var n=r(398),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},5970:function(e,t,r){"use strict";function n(e){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(7161);e.exports=o&&!Symbol.sham&&"symbol"==n(Symbol.iterator)},4796:function(e,t,r){"use strict";var n=r(9234),o=r(4877);e.exports=n&&o(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},5032:function(e,t,r){"use strict";var n=r(1697),o=r(2631),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},2461:function(e,t,r){"use strict";var n=r(5329),o=r(2791),i=r(9385),a=r(1807).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},9385:function(e,t,r){"use strict";var n=r(7709);t.f=n},7709:function(e,t,r){"use strict";var n=r(1697),o=r(4499),i=r(2791),a=r(606),s=r(7161),u=r(5970),l=n.Symbol,c=o("wks"),f=u?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return i(c,e)||(c[e]=s&&i(l,e)?l[e]:f("Symbol."+e)),c[e]}},7851:function(e,t,r){"use strict";var n=r(3768),o=r(6355);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},494:function(e,t,r){"use strict";r(2461)("asyncIterator")},3712:function(e,t,r){"use strict";var n=r(9435);e.exports=n},6433:function(e,t,r){"use strict";var n=r(8142);e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.amdO={},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r(9784),r(961),r(8857);r(4539)}(); \ No newline at end of file +*/!function(){var t={6018:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(t,e){var r=t.nodes,n=t.edges,i=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(t,e){o[t.id]=e,i.push([])}),n&&n.forEach(function(t){var r=t.source,n=t.target,a=o[r],s=o[n];!a&&0!==a||!s&&0!==s||(i[a][s]=1,e||(i[s][a]=1))}),i};e.default=r},6156:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return n.GADDIAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return n.connectedComponentAsync}}),e.default=void 0,Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return n.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return n.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return n.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return n.detectCycleAsync}}),e.detectDirectedCycleAsync=void 0,Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return n.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return n.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return n.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return n.floydWarshallAsync}}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return n.getAdjMatrixAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return n.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return n.getInDegreeAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return n.getNeighborsAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return n.getOutDegreeAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return n.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return n.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return n.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return n.pageRankAsync}});var n=r(8305),i=n.detectCycleAsync;e.detectDirectedCycleAsync=i;var o={getAdjMatrixAsync:n.getAdjMatrixAsync,connectedComponentAsync:n.connectedComponentAsync,getDegreeAsync:n.getDegreeAsync,getInDegreeAsync:n.getInDegreeAsync,getOutDegreeAsync:n.getOutDegreeAsync,detectCycleAsync:n.detectCycleAsync,detectDirectedCycleAsync:i,detectAllCyclesAsync:n.detectAllCyclesAsync,detectAllDirectedCycleAsync:n.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:n.detectAllUndirectedCycleAsync,dijkstraAsync:n.dijkstraAsync,findAllPathAsync:n.findAllPathAsync,findShortestPathAsync:n.findShortestPathAsync,floydWarshallAsync:n.floydWarshallAsync,labelPropagationAsync:n.labelPropagationAsync,louvainAsync:n.louvainAsync,minimumSpanningTreeAsync:n.minimumSpanningTreeAsync,pageRankAsync:n.pageRankAsync,getNeighborsAsync:n.getNeighborsAsync,GADDIAsync:n.GADDIAsync};e.default=o},5799:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(2500))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r,n){void 0===n&&(n=!0);var a=function(t){void 0===t&&(t={});var e,r=t,n=function(){},i=(e={},function(t){var r=t.next;return!e[r]&&(e[r]=!0,!0)});return r.allowTraversal=t.allowTraversal||i,r.enter=t.enter||n,r.leave=t.leave||n,r}(r),s=new i.default,u=t.edges,l=void 0===u?[]:u;s.enqueue(e);for(var c="",f=function(){var t=s.dequeue();a.enter({current:t,previous:c}),(0,o.getNeighbors)(t,l,n?"target":void 0).forEach(function(e){a.allowTraversal({previous:c,current:t,next:e})&&s.enqueue(e)}),a.leave({current:t,previous:c}),c=t};!s.isEmpty();)f()};e.default=a},2111:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){return e?o(t):i(t)},e.detectStrongConnectComponents=e.detectConnectedComponents=void 0;var n=r(5696),i=function(t){for(var e=t.nodes,r=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u=[],l=function t(e){u.push(e),s[e.id]=!0;for(var i=(0,n.getNeighbors)(e.id,o),a=function(e){var n=i[e];if(!s[n]){var o=r.filter(function(t){return t.id===n});o.length>0&&t(o[0])}},l=0;l0;)h.push(u.pop());a.push(h)}}return a};e.detectConnectedComponents=i;var o=function(t){for(var e=t.nodes,r=void 0===e?[]:e,i=t.edges,o=void 0===i?[]:i,a=[],s={},u={},l={},c=[],f=0,h=function t(e){u[e.id]=f,l[e.id]=f,f+=1,a.push(e),s[e.id]=!0;for(var i=(0,n.getNeighbors)(e.id,o,"target").filter(function(t){return r.map(function(t){return t.id}).indexOf(t)>-1}),h=function(n){var o=i[n];if(u[o]||0===u[o])s[o]&&(l[e.id]=Math.min(l[e.id],u[o]));else{var a=r.filter(function(t){return t.id===o});a.length>0&&t(a[0]),l[e.id]=Math.min(l[e.id],l[o])}},p=0;p0;){var y=a.pop();if(s[y.id]=!1,d.push(y),y===e)break}d.length>0&&c.push(d)}},p=0,d=r;p0;)for(var v=p.pop(),g=v.id,m=(0,s.getNeighbors)(g,t.edges),b=function(n){var i,a=m[n],s=t.nodes.find(function(t){return t.id===a});if(a===g)o.push(((i={})[a]=v,i));else if(a in y){if(!y[g].has(s)){for(var u=!0,l=[s,v],c=d[g];y[a].size&&!y[a].has(c)&&(l.push(c),c!==d[c.id]);)c=d[c.id];if(l.push(c),e&&r?(u=!1,l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!0)):e&&!r&&l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!1),u){for(var f={},h=1;h-1)return f;n.push(a),i.add(a);for(var h=c[a.id],p=0;p0;){var r=e.pop();i.has(r)&&(i.delete(r),o[r.id].forEach(function(t){e.push(t)}),o[r.id].clear())}}(a);else for(p=0;p-1});g-1?y[v.id].push(c[b]):u.push(((i={})[v.id]=v,i))}}return{component:d,adjList:y,minIdx:a}},b=0;b=b}),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter(function(t){return t.length>1});if(0===w.length)break;var _=m(w),S=_.minIdx,E=_.adjList,k=_.component;if(!(k.length>1))break;k.forEach(function(t){o[t.id]=new Set});var T=l[S];if(e&&r&&-1===e.indexOf(T.id))return u;f(T,T,E),b=S+1}return u};e.detectAllDirectedCycle=c;e.detectAllCycles=function(t,e,r,n){return void 0===n&&(n=!0),e?c(t,r,n):l(t,r,n)};var f=function(t){var e=null,r=t.nodes,n={},i={},a={},s={};(void 0===r?[]:r).forEach(function(t){i[t.id]=t});for(var u={enter:function(t){var r=t.current,o=t.previous;if(a[r]){e={};for(var s=r,u=o;u!==r;)e[s]=u,s=u,u=n[u];e[s]=u}else a[r]=r,delete i[r],n[r]=o},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var r=t.next;return!e&&!s[r]}};Object.keys(i).length;){var l=Object.keys(i)[0];(0,o.default)(t,l,u)}return e};e.default=f},8133:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,i){void 0===i&&(i=!0);!function t(e,r,i,o,a){void 0===a&&(a=!0);o.enter({current:r,previous:i});var s=e.edges,u=void 0===s?[]:s;(0,n.getNeighbors)(r,u,a?"target":void 0).forEach(function(n){o.allowTraversal({previous:i,current:r,next:n})&&t(e,n,r,o,a)});o.leave({current:r,previous:i})}(t,e,"",function(t){void 0===t&&(t={});var e=t,r=function(){},n=(i={},function(t){var e=t.next;return!i[e]&&(i[e]=!0,!0)});var i;return e.allowTraversal=t.allowTraversal||n,e.enter=t.enter||r,e.leave=t.leave||r,e}(r),i)};var n=r(5696)},7606:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(1635),i=r(1359),o=r(5696),a=function(t,e,r,n){var i=t.nodes,a=void 0===i?[]:i,u=t.edges,l=void 0===u?[]:u,c=[],f={},h={},p={};a.forEach(function(t,r){var n=t.id;c.push(n),h[n]=1/0,n===e&&(h[n]=0)});for(var d=a.length,y=function(t){var e=function(t,e,r){for(var n,i=1/0,o=0;oh[e.id]+s?(h[a]=h[e.id]+s,p[a]=[e.id]):h[a]===h[e.id]+s&&p[a].push(e.id)})},v=0;v0&&c.length>0;){var p=c[c.length-1];if(p.length){var d=p.shift();if(d&&(u.push(d),l[d]=!0,h=n?(0,o.getNeighbors)(d,s,"target"):(0,o.getNeighbors)(d,s),c.push(h.filter(function(t){return!l[t]}))),u[u.length-1]===r){var y=u.map(function(t){return t});f.push(y),v=u.pop(),l[v]=!1,c.pop()}}else{var v=u.pop();l[v]=!1,c.pop()}}return f}},564:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(6018))&&n.__esModule?n:{default:n};var o=function(t,e){for(var r=(0,i.default)(t,e),n=[],o=r.length,a=0;an[a][u]+n[u][s]&&(n[a][s]=n[a][u]+n[u][s]);return n};e.default=o},9233:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(1359),i=r(9943),o=function(){function t(t,e,r,n,o){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:r||i.VACANT_NODE_LABEL,edgeLabel:n||i.VACANT_EDGE_LABEL,nodeLabel2:o||i.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var r=0;r=0;e--){var r=this.dfsEdgeList[e],n=r.fromNode,i=r.toNode;nf||n.hasNode(o[c.to])||(e.labelg&&"break"!==m(b);b--);if(y){var x=t.findMinLabel(d);l.dfsEdgeList.push(new o(p,v,i.VACANT_NODE_LABEL,x.edgeLabel,i.VACANT_NODE_LABEL));var w=l.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[w]===l.dfsEdgeList[w]&&a(d[x.edgeLabel].projected)}var _={};y=!1;var S=0;c.forEach(function(e){var r=new s(e),i=t.findForwardPureEdges(n,r.edges[f[0]],h,r);i.length>0&&(y=!0,S=p,i.forEach(function(t){var r="".concat(t.label,"-").concat(u[t.to].label);_[r]||(_[r]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[r].projected.push({graphId:n.id,edge:t,preNode:e})}))});var E=f.length,k=function(e){if(y)return"break";var r=f[e];c.forEach(function(e){var i=new s(e),o=t.findForwardRmpathEdges(n,i.edges[r],h,i);o.length>0&&(y=!0,S=l.dfsEdgeList[r].fromNode,o.forEach(function(t){var r="".concat(t.label,"-").concat(u[t.to].label);_[r]||(_[r]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[r].projected.push({graphId:n.id,edge:t,preNode:e})}))})};for(b=0;b=0;h--){var p=e.findBackwardEdge(i,f.edges[n[h]],f.edges[n[0]],f);if(p){var d="".concat(e.dfsCode.dfsEdgeList[n[h]].fromNode,"-").concat(p.label);c[d]||(c[d]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[n[h]].fromNode,edgeLabel:p.label}),c[d].projected.push({graphId:t.graphId,edge:p,preNode:t})}}if(!(r>=e.maxNodeNum)){e.findForwardPureEdges(i,f.edges[n[0]],u,f).forEach(function(e){var r="".concat(a,"-").concat(e.label,"-").concat(o[e.to].label);l[r]||(l[r]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:o[e.to].label}),l[r].projected.push({graphId:t.graphId,edge:e,preNode:t})});var y=function(r){e.findForwardRmpathEdges(i,f.edges[n[r]],u,f).forEach(function(i){var a="".concat(e.dfsCode.dfsEdgeList[n[r]].fromNode,"-").concat(i.label,"-").concat(o[i.to].label);l[a]||(l[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[n[r]].fromNode,edgeLabel:i.label,nodeLabel2:o[i.to].label}),l[a].projected.push({graphId:t.graphId,edge:i,preNode:t})})};for(h=0;hi){var a=i;i=n,n=a}var c=t.label,f="".concat(r,"-").concat(n,"-").concat(c,"-").concat(i),h="".concat(n,"-").concat(c,"-").concat(i);if(!o[h]){var p=o[h]||0;p++,o[h]=p}s[f]={graphId:r,nodeLabel1:n,edgeLabel:c,nodeLabel2:i}})})}),Object.keys(i).forEach(function(t){if(!(i[t]e&&(s=e);var n=r[t.id].inDegree;u>n&&(u=n);var i=r[t.id].outDegree;l>i&&(l=i)}),t[e]={degree:s,inDegree:u,outDegree:l}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:l}},m=function(t,e,r,s,u,m,b){var x;if(void 0===r&&(r=!1),void 0===m&&(m="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var w=t.nodes.length;if(w){var _=(0,i.default)(t,r),S=(0,i.default)(e,r),E=y(t.nodes,_,r),k=y(e.nodes,S,r),T=p(t.nodes,m),C=T.nodeMap,O=T.nodeLabelMap,A=p(e.nodes,m),P=A.nodeMap,M=A.nodeLabelMap;d(t.edges,b,C);var I=d(e.edges,b,P).edgeLabelMap,L=[];null===S||void 0===S||S.forEach(function(t){L=L.concat(t)}),u||(u=Math.max.apply(Math,(0,n.__spreadArray)((0,n.__spreadArray)([],L,!1),[2],!1))),s||(s=u);var j=l(t,_,m,s),N=l(e,S,m,s),R=function(t,e,r,n,i){var o=Math.ceil(r/e),a={},s=0;return n.forEach(function(t,n){for(var u=0,l=0,c=t.nodeIdxs,f=t.neighborNum-1;u2*e)););if(p<2*e&&(a["".concat(n,"-").concat(h)]={start:n,end:h,distance:i[n][h]},u++,++s>=r))return a;if(++l>2*e)break}uX&&(X=r.length,q=r,Y=e,W=t)});var Z={},K={},J={},Q={},$={},tt={};Object.keys(M).forEach(function(n,i){$[n]=[],r&&(tt[n]=[]);var o=-1/0,a={};M[n].forEach(function(t){var e=k["".concat(W.id,"-").concat(t.id)];if(e&&$[n].push(e),o$[n][l]){u=!0;break}if(u)return q.splice(e,1),"continue";var c={};i.neighbors.forEach(function(t){var e=E["".concat(r.id,"-").concat(t.id)];c["".concat(r.id,"-").concat(t.id)]={start:C[r.id].idx,end:C[t.id].idx,distance:e}}),D=f(c,j,t,D);var p=[];Object.keys(c).forEach(function(t){if(H[t])p.push(H[t]);else{var e=D[t];H[t]=h(e,V,m,b),p.push(H[t])}}),p=p.sort(function(t,e){return e-t});var d=!1;for(l=0;l=0;l--)u(l)});var et=[];null===q||void 0===q||q.forEach(function(n){for(var i=C[n.id].idx,o=c(t.nodes,_[i],i,m,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1$[f][d])o.splice(s,1);else{if(r){var y="".concat(l.id,"-").concat(n.id),x=E[y];if(d=tt[f].length-1,x>tt[f][d]){o.splice(s,1);continue}}var w=H[h]?H[h]:v(t,n,l,C,p,j,V,m,b,H,D),S="".concat(W.id,"-").concat(f);if(w=0&&"break"!==x(p);p--);if(v)return et.splice(n,1),"continue";i.edges=l;var w=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach(function(t){if(t!==i.nodes[0].id&&!v){if(w[t]===1/0){var e=u[t].node[m];if(s[e]--,s[e]nt[n][nt[n].length-1]){if(e=u[t].node[m],s[e]--,s[e]=0;E--){var k=i.nodes[E],T=u[k.id].degree,O=u[k.id].inDegree,A=u[k.id].outDegree,L=k[m],j=g(Z,L,P,M),N=j.minPatternNodeLabelDegree,R=j.minPatternNodeLabelInDegree,D=j.minPatternNodeLabelOutDegree;if(r?T=0;B--){var F=l[B];if(!u[F.source]||!u[F.target]){l.splice(B,1);var z=F[b];if(c[z]--,u[F.source]&&(u[F.source].degree--,u[F.source].outDegree--),u[F.target]&&(u[F.target].degree--,u[F.target].inDegree--),I[z]&&c[z]=0&&"break"!==it(ot);ot--);var at=et.length,st=function(t){var e={};et[t].edges.forEach(function(t){var r="".concat(t.source,"-").concat(t.target,"-").concat(t.label);e[r]?e[r]++:e[r]=1});for(var r=function(t){var r={};et[t].edges.forEach(function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1});var n=!0;Object.keys(r).length!==Object.keys(e).length?n=!1:Object.keys(e).forEach(function(t){r[t]!==e[t]&&(n=!1)}),n&&et.splice(t,1)},n=at-1;n>t;n--)r(n);at=et.length};for(ot=0;ot<=at-1;ot++)st(ot);return et}}};e.default=m},8683:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(6018))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,l=void 0===u?[]:u,c={},f={};s.forEach(function(t,e){var r=(0,o.uniqueId)();t.clusterId=r,c[r]={id:r,nodes:[t]},f[t.id]={node:t,idx:e}});var h=[],p={};(0,i.default)(t,e).forEach(function(t,e){var r=0,n=s[e].id;p[n]={},t.forEach(function(t,e){if(t){r+=t;var i=s[e].id;p[n][i]=t}}),h.push(r)});for(var d=0,y=function(){var t=!1;if(s.forEach(function(e){var r={};Object.keys(p[e.id]).forEach(function(t){var n=p[e.id][t],i=f[t].node.clusterId;r[i]||(r[i]=0),r[i]+=n});var n=-1/0,i=[];if(Object.keys(r).forEach(function(t){n=0&&i.splice(o,1),i&&i.length){t=!0;var a=c[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),l=c[i[u]];l.nodes.push(e),e.clusterId=l.id}}}),!t)return"break";d++};d0&&A>P&&A-PP&&(I=v.map(function(t){return{node:t,clusterId:t.clusterId}}),L=(0,n.clone)(S),P=A),j||M>100)break;M++,Object.keys(S).forEach(function(t){var e=0;m.forEach(function(n){var i=n.source,o=n.target,a=E[i].node.clusterId,s=E[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=n[r]||1)}),S[t].sumTot=e}),v.forEach(function(t,e){var n,i=S[t.clusterId],o=0,a=T[e]/(2*O),s=0,l=i.nodes;l.forEach(function(t){var r=E[t.id].idx;s+=k[e][r]||0});var f=s-i.sumTot*a,h=l.filter(function(e){return e.id!==t.id}),p=[];h.forEach(function(t,e){p[e]=b[t.originIndex]});var y=c(h,b)*d,v=C[t.id];if(Object.keys(v).forEach(function(r){var i=E[r].node.clusterId;if(i!==t.clusterId){var s=S[i],l=s.nodes;if(l&&l.length){var h=0;l.forEach(function(t){var r=E[t.id].idx;h+=k[e][r]||0});var p=h-s.sumTot*a,v=l.concat([t]),g=[];v.forEach(function(t,e){g[e]=b[t.originIndex]});var m=c(v,b)*d,x=p-f;u&&(x=p+m-(f+y)),x>o&&(o=x,n=s)}}}),o>0){n.nodes.push(t);var g=t.clusterId;t.clusterId=n.id;var x=i.nodes.indexOf(t);i.nodes.splice(x,1);var w=0,_=0;m.forEach(function(t){var e=t.source,i=t.target,o=E[e].node.clusterId,a=E[i].node.clusterId;(o===n.id&&a!==n.id||a===n.id&&o!==n.id)&&(w+=t[r]||1),(o===g&&a!==g||a===g&&o!==g)&&(_+=t[r]||1)}),n.sumTot=w,i.sumTot=_}})}var N={},R=0;Object.keys(L).forEach(function(t){var e=L[t];if(e.nodes&&e.nodes.length){var r=String(R+1);r!==t&&(e.id=r,e.nodes=e.nodes.map(function(t){return{id:t.id,clusterId:r}}),L[r]=e,N[t]=r,delete L[t],R++)}else delete L[t]}),I.forEach(function(t){var e=t.node,r=t.clusterId;e&&(e.clusterId=r,e.clusterId&&N[e.clusterId]&&(e.clusterId=N[e.clusterId]))});var D=[],B={};m.forEach(function(t){var e=t.source,n=t.target,i=t[r]||1,o=E[e].node.clusterId,a=E[n].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(B[s])B[s].weight+=i,B[s].count++;else{var u={source:o,target:a,weight:i,count:1};B[s]=u,D.push(u)}}});var F=[];return Object.keys(L).forEach(function(t){F.push(L[t])}),{clusters:F,clusterEdges:D}};e.default=f},9324:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(r(8882)),i=a(r(4073)),o=r(5696);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var r=[],n=t.nodes,a=void 0===n?[]:n,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return r;var l=a[0],c=new Set;c.add(l);var f=new i.default(function(t,r){return e?t.weight-r.weight:0});for((0,o.getEdgesByNodeId)(l.id,u).forEach(function(t){f.insert(t)});!f.isEmpty();){var h=f.delMin(),p=h.source,d=h.target;c.has(p)&&c.has(d)||(r.push(h),c.has(p)||(c.add(p),(0,o.getEdgesByNodeId)(p,u).forEach(function(t){f.insert(t)})),c.has(d)||(c.add(d),(0,o.getEdgesByNodeId)(d,u).forEach(function(t){f.insert(t)})))}return r},u=function(t,e){var r=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return r;var u=s.map(function(t){return t});e&&u.sort(function(t,e){return t.weight-e.weight});for(var l=new n.default(o.map(function(t){return t.id}));u.length>0;){var c=u.shift(),f=c.source,h=c.target;l.connected(f,h)||(r.push(c),l.union(f,h))}return r},l=function(t,e,r){return r?{prim:s,kruskal:u}[r](t,e):u(t,e)};e.default=l},2653:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(5240))&&n.__esModule?n:{default:n},o=r(5696);var a=function(t,e,r){"number"!=typeof e&&(e=1e-6),"number"!=typeof r&&(r=.85);for(var n,a=1,s=0,u=1e3,l=t.nodes,c=void 0===l?[]:l,f=t.edges,h=void 0===f?[]:f,p=c.length,d={},y={},v=0;v0&&a>e;){for(s=0,v=0;v0&&(n+=y[w]/_)}d[m]=r*n,s+=d[m]}}for(s=(1-s)/p,a=0,v=0;v0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==n&&n0?r=n:null!==i&&i0&&(r=i),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},t}();e.default=n},7875:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LinkedListNode=void 0;var r=function(t,e){return t===e},n=function(){function t(t,e){void 0===e&&(e=null),this.value=t,this.next=e}return t.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},t}();e.LinkedListNode=n;var i=function(){function t(t){void 0===t&&(t=r),this.head=null,this.tail=null,this.compare=t}return t.prototype.prepend=function(t){var e=new n(t,this.head);return this.head=e,this.tail||(this.tail=e),this},t.prototype.append=function(t){var e=new n(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},t.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var r=this.head;if(null!==r)for(;r.next;)this.compare(r.next.value,t)?(e=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,t)&&(this.tail=r),e},t.prototype.find=function(t){var e=t.value,r=void 0===e?void 0:e,n=t.callback,i=void 0===n?void 0:n;if(!this.head)return null;for(var o=this.head;o;){if(i&&i(o.value))return o;if(void 0!==r&&this.compare(o.value,r))return o;o=o.next}return null},t.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},t.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},t.prototype.fromArray=function(t){var e=this;return t.forEach(function(t){return e.append(t)}),this},t.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},t.prototype.reverse=function(){for(var t=this.head,e=null,r=null;t;)r=t.next,t.next=e,e=t,t=r;this.tail=this.head,this.head=e},t.prototype.toString=function(t){return void 0===t&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},t}();e.default=i},2500:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,i=(n=r(7875))&&n.__esModule?n:{default:n};var o=function(){function t(){this.linkedList=new i.default}return t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},t.prototype.enqueue=function(t){this.linkedList.append(t)},t.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toString=function(t){return this.linkedList.toString(t)},t}();e.default=o},8882:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,r=t;e>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===r?C(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===r?C(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=v.exec(t))?new A(e[1],e[2],e[3],1):(e=g.exec(t))?new A(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=m.exec(t))?C(e[1],e[2],e[3],e[4]):(e=b.exec(t))?C(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=x.exec(t))?N(e[1],e[2]/100,e[3]/100,1):(e=w.exec(t))?N(e[1],e[2]/100,e[3]/100,e[4]):_.hasOwnProperty(t)?T(_[t]):"transparent"===t?new A(NaN,NaN,NaN,0):null}function T(t){return new A(t>>16&255,t>>8&255,255&t,1)}function C(t,e,r,n){return n<=0&&(t=e=r=NaN),new A(t,e,r,n)}function O(t,e,r,n){return 1===arguments.length?((i=t)instanceof f||(i=k(i)),i?new A((i=i.rgb()).r,i.g,i.b,i.opacity):new A):new A(t,e,r,null==n?1:n);var i}function A(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function P(){return"#".concat(j(this.r)).concat(j(this.g)).concat(j(this.b))}function M(){var t=I(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(L(this.r),", ").concat(L(this.g),", ").concat(L(this.b)).concat(1===t?")":", ".concat(t,")"))}function I(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function L(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function j(t){return((t=L(t))<16?"0":"")+t.toString(16)}function N(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new D(t,e,r,n)}function R(t){if(t instanceof D)return new D(t.h,t.s,t.l,t.opacity);if(t instanceof f||(t=k(t)),!t)return new D;if(t instanceof D)return t;var e=(t=t.rgb()).r/255,r=t.g/255,n=t.b/255,i=Math.min(e,r,n),o=Math.max(e,r,n),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(r-n)/s+6*(r0&&u<1?0:a,new D(a,s,u,t.opacity)}function D(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function B(t){return(t=(t||0)%360)<0?t+360:t}function F(t){return Math.max(0,Math.min(1,t||0))}function z(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function G(t,e,r,n,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*r+(1+3*t+3*o-3*a)*n+a*i)/6}l(f,k,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:S,formatHex:S,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return R(this).formatHsl()},formatRgb:E,toString:E}),l(A,O,c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new A(L(this.r),L(this.g),L(this.b),I(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:P,formatHex:P,formatHex8:function(){return"#".concat(j(this.r)).concat(j(this.g)).concat(j(this.b)).concat(j(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:M,toString:M})),l(D,function(t,e,r,n){return 1===arguments.length?R(t):new D(t,e,r,null==n?1:n)},c(f,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new D(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new D(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new A(z(t>=240?t-240:t+120,i,n),z(t,i,n),z(t<120?t+240:t-120,i,n),this.opacity)},clamp:function(){return new D(B(this.h),F(this.s),F(this.l),I(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=I(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(B(this.h),", ").concat(100*F(this.s),"%, ").concat(100*F(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));var U=function(t){return function(){return t}};function V(t,e){return function(r){return t+r*e}}function H(t){return 1==(t=+t)?W:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):U(isNaN(e)?r:e)}}function W(t,e){var r=e-t;return r?V(t,r):U(isNaN(t)?e:t)}var q=function t(e){var r=H(e);function n(t,e){var n=r((t=O(t)).r,(e=O(e)).r),i=r(t.g,e.g),o=r(t.b,e.b),a=W(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return n.gamma=t,n}(1);function Y(t){return function(e){var r,n,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(r=0;r=1?(r=1,e-1):Math.floor(r*e),i=t[n],o=t[n+1],a=n>0?t[n-1]:2*i-o,s=no&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:J(r,n)})),o=tt.lastIndex;return oh.length?(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.fillPathByDiff(h,f),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f):e.pathFormatted||(f=it.parsePathString(o[c]),h=it.parsePathString(i[c]),h=it.formatPath(h,f),e.fromAttrs.path=h,e.toAttrs.path=f,e.pathFormatted=!0),n[c]=[];for(var p=0;p0){for(var o=n.animators.length-1;o>=0;o--)if((t=n.animators[o]).destroyed)n.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)r=e[a],ut(t,r,i)&&(e.splice(a,1),!1,r.callback&&r.callback());0===e.length&&n.removeAnimator(o)}n.canvas.get("autoDraw")||n.canvas.draw()}})},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach(function(e){e.stopAnimate(t)}),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ct=r(7158),ft=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function ht(t,e,r){r.name=e,r.target=t,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}function pt(t,e,r){if(r.bubbles){var n=void 0,i=!1;if("mouseenter"===e?(n=r.fromShape,i=!0):"mouseleave"===e&&(i=!0,n=r.toShape),t.isCanvas()&&i)return;if(n&&(0,a.pu)(t,n))return void(r.bubbles=!1);r.name=e,r.currentTarget=t,r.delegateTarget=t,t.emit(e,r)}}var dt=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var r=t.type;e._triggerEvent(r,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var r=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,r,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var r=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,r,null),e._emitEvent("dragend",t,r,e.draggingShape),e._afterDrag(e.draggingShape,r,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");(0,a.__)(ft,function(r){e.addEventListener(r,t._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");(0,a.__)(ft,function(r){e.removeEventListener(r,t._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,r,n,i,o){var a=new ct.A(t,e);return a.fromShape=i,a.toShape=o,a.x=r.x,a.y=r.y,a.clientX=r.clientX,a.clientY=r.clientY,a.propagationPath.push(n),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,r=e.getClientByEvent(t),n=e.getPointByEvent(t);return{x:n.x,y:n.y,clientX:r.x,clientY:r.y}},t.prototype._triggerEvent=function(t,e){var r=this._getPointInfo(e),n=this._getShape(r,e),i=this["_on"+t],o=!1;if(i)i.call(this,r,n,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,r,null,null,n),n&&this._emitEvent(t,e,r,n,null,n),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,r,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,r,a,a,null),this._emitEvent(t,e,r,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,r,null)):this._emitEvent(t,e,r,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=n.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,r){0===r.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=r.timeStamp),this._emitEvent("mousedown",r,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,r,n){var i=this.canvas.get("el");r!==n&&(r&&(this._emitEvent("mouseout",t,e,r,r,n),this._emitEvent("mouseleave",t,e,r,r,n),n&&!n.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",t,e,n,r,n),this._emitEvent("mouseenter",t,e,n,r,n)))},t.prototype._emitDragoverEvents=function(t,e,r,n,i){n?(n!==r&&(r&&this._emitEvent("dragleave",t,e,r,r,n),this._emitEvent("dragenter",t,e,n,r,n)),i||this._emitEvent("dragover",t,e,n)):r&&this._emitEvent("dragleave",t,e,r,r,n),i&&this._emitEvent("dragover",t,e,n)},t.prototype._afterDrag=function(t,e,r){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(e,r);n!==t&&this._emitMouseoverEvents(r,e,t,n),this.currentShape=n},t.prototype._onmouseup=function(t,e,r){if(0===r.button){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",r,t,e),this._emitEvent("dragend",r,t,n),this._afterDrag(n,t,r)):(this._emitEvent("mouseup",r,t,e),e===this.mousedownShape&&this._emitEvent("click",r,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,r){r.preventDefault();var n=this.currentShape;this._emitDragoverEvents(r,t,n,e,!0)},t.prototype._onmousemove=function(t,e,r){var n=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(r,t,i,e,!1),this._emitEvent("drag",r,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=r.timeStamp-this.mousedownTimeStamp,l=a.clientX-t.clientX,c=a.clientY-t.clientY;u>120||l*l+c*c>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",r,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",r,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)):(this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e))}else this._emitMouseoverEvents(r,t,i,e),this._emitEvent("mousemove",r,t,e)}},t.prototype._emitEvent=function(t,e,r,n,i,o){var a=this._getEventObj(t,e,r,n,i,o);if(n){a.shape=n,ht(n,t,a);for(var s=n.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||pt(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{ht(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),yt=(0,i.o0)(),vt=yt&&"firefox"===yt.name,gt=function(t){function e(e){var r=t.call(this,e)||this;return r.initContainer(),r.initDom(),r.initEvents(),r.initTimeline(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");(0,a.Kg)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new dt({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new lt(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var r=this.get("el");a.Bd&&(r.style.width=t+"px",r.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");a.Bd&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(vt&&!(0,a.gD)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,a.gD)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),r=e.x,n=e.y;return this.getPointByClient(r,n)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t-r.left,y:e-r.top}},e.prototype.getClientByPoint=function(t,e){var r=this.get("el").getBoundingClientRect();return{x:t+r.left,y:e+r.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(o.A)},3428:function(t,e,r){"use strict";var n=r(1635),i=r(8679),o=r(4389),a={},s="_INDEX";var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,n.__extends)(e,t),e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.__)(i,function(i){var o=i.getBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;ae&&(e=s),un&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,r=1/0,n=-1/0,i=this.getChildren().filter(function(t){return t.get("visible")&&(!t.isGroup()||t.isGroup()&&t.getChildren().length>0)});return i.length>0?(0,o.__)(i,function(i){var o=i.getCanvasBBox(),a=o.minX,s=o.maxX,u=o.minY,l=o.maxY;ae&&(e=s),un&&(n=l)}):(t=0,e=0,r=0,n=0),{x:t,y:r,minX:t,minY:r,maxX:e,maxY:n,width:e-t,height:n-r}},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.children=[],e},e.prototype.onAttrChange=function(e,r,n){if(t.prototype.onAttrChange.call(this,e,r,n),"matrix"===e){var i=this.getTotalMatrix();this._applyChildrenMarix(i)}},e.prototype.applyMatrix=function(e){var r=this.getTotalMatrix();t.prototype.applyMatrix.call(this,e);var n=this.getTotalMatrix();n!==r&&this._applyChildrenMarix(n)},e.prototype._applyChildrenMarix=function(t){var e=this.getChildren();(0,o.__)(e,function(e){e.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],e=0;e=0;a--){var s=t[a];if((0,o.OK)(s)&&(s.isGroup()?i=s.getShape(e,r,n):s.isHit(e,r)&&(i=s)),i)break}return i},e.prototype.add=function(t){var e=this.getCanvas(),r=this.getChildren(),n=this.get("timeline"),i=t.getParent();i&&function(t,e,r){void 0===r&&(r=!0),r?e.destroy():(e.set("parent",null),e.set("canvas",null)),(0,o.E6)(t.getChildren(),e)}(i,t,!1),t.set("parent",this),e&&function t(e,r){if(e.set("canvas",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,e),n&&function t(e,r){if(e.set("timeline",r),e.isGroup()){var n=e.get("children");n.length&&n.forEach(function(e){t(e,r)})}}(t,n),r.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},e.prototype.getChildren=function(){return this.get("children")||[]},e.prototype.sort=function(){var t,e=this.getChildren();(0,o.__)(e,function(t,e){return t[s]=e,t}),e.sort((t=function(t,e){return t.get("zIndex")-e.get("zIndex")},function(e,r){var n=t(e,r);return 0===n?e[s]-r[s]:n})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),t.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){return this.getChildren()[t]},e.prototype.getCount=function(){return this.getChildren().length},e.prototype.contain=function(t){return this.getChildren().indexOf(t)>-1},e.prototype.removeChild=function(t,e){void 0===e&&(e=!0),this.contain(t)&&t.remove(e)},e.prototype.findAll=function(t){var e=[],r=this.getChildren();return(0,o.__)(r,function(r){t(r)&&e.push(r),r.isGroup()&&(e=e.concat(r.findAll(t)))}),e},e.prototype.find=function(t){var e=null,r=this.getChildren();return(0,o.__)(r,function(r){if(t(r)?e=r:r.isGroup()&&(e=r.find(t)),e)return!1}),e},e.prototype.findById=function(t){return this.find(function(e){return e.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(e){return e.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(e){return e.get("name")===t})},e}(i.A);e.A=u},8679:function(t,e,r){"use strict";var n=r(1635),i=r(1359),o=r(5776),a=r(4389),s=r(1344),u=r(686),l=o.pd,c=["zIndex","capture","visible","type"],f=["repeat"];var h=function(t){function e(e){var r=t.call(this,e)||this;r.attrs={};var n=r.getDefaultAttrs();return(0,i.mix)(n,e.attrs),r.attrs=n,r.initAttrs(n),r.initAnimate(),r}return(0,n.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,e=[],r=0;r0?n=function(t,e){if(e.onFrame)return t;var r=e.startTime,n=e.delay,o=e.duration,a=Object.prototype.hasOwnProperty;return(0,i.each)(t,function(t){r+nt.delay&&(0,i.each)(e.toAttrs,function(e,r){a.call(t.toAttrs,r)&&(delete t.toAttrs[r],delete t.fromAttrs[r])})}),t}(n,x):r.addAnimator(this),n.push(x),this.set("animations",n),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var e=this;void 0===t&&(t=!0);var r=this.get("animations");(0,i.each)(r,function(r){t&&(r.onFrame?e.attr(r.onFrame(1)):e.attr(r.toAttrs)),r.callback&&r.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),r=t.getTime();return(0,i.each)(e,function(t){t._paused=!0,t._pauseTime=r,t.pauseCallback&&t.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:r}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline").getTime(),e=this.get("animations"),r=this.get("_pause").pauseTime;return(0,i.each)(e,function(e){e.startTime=e.startTime+(t-r),e._paused=!1,e._pauseTime=null,e.resumeCallback&&e.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",e),this},e.prototype.emitDelegation=function(t,e){var r,n=this,o=e.propagationPath;this.getEvents();"mouseenter"===t?r=e.fromShape:"mouseleave"===t&&(r=e.toShape);for(var s=function(t){var s=o[t],l=s.get("name");if(l){if((s.isGroup()||s.isCanvas&&s.isCanvas())&&r&&(0,a.pu)(s,r))return"break";(0,i.isArray)(l)?(0,i.each)(l,function(t){n.emitDelegateEvent(s,t,e)}):u.emitDelegateEvent(s,l,e)}},u=this,l=0;l=t&&r.minY<=e&&r.maxY>=e},e.prototype.afterAttrsChange=function(e){t.prototype.afterAttrsChange.call(this,e),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(e){t.prototype.applyMatrix.call(this,e),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),r=t.minX,n=t.minY,i=t.maxX,a=t.maxY;if(e){var s=(0,o.$F)(e,[t.minX,t.minY]),u=(0,o.$F)(e,[t.maxX,t.minY]),l=(0,o.$F)(e,[t.minX,t.maxY]),c=(0,o.$F)(e,[t.maxX,t.maxY]);r=Math.min(s[0],u[0],l[0],c[0]),i=Math.max(s[0],u[0],l[0],c[0]),n=Math.min(s[1],u[1],l[1],c[1]),a=Math.max(s[1],u[1],l[1],c[1])}var f=this.attrs;if(f.shadowColor){var h=f.shadowBlur,p=void 0===h?0:h,d=f.shadowOffsetX,y=void 0===d?0:d,v=f.shadowOffsetY,g=void 0===v?0:v,m=r-p+y,b=i+p+y,x=n-p+g,w=a+p+g;r=Math.min(r,m),i=Math.max(i,b),n=Math.min(n,x),a=Math.max(a,w)}return{x:r,y:n,minX:r,minY:n,maxX:i,maxY:a,width:i-r,height:a-n}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,e){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,e){var r=this.get("startArrowShape"),n=this.get("endArrowShape"),i=[t,e,1],o=(i=this.invertFromMatrix(i))[0],a=i[1],s=this._isInBBox(o,a);if(this.isOnlyHitBox())return s;if(s&&!this.isClipped(o,a)){if(this.isInShape(o,a))return!0;if(r&&r.isHit(o,a))return!0;if(n&&n.isHit(o,a))return!0}return!1},e}(i.A);e.A=a},2867:function(t,e,r){"use strict";r.d(e,{i:function(){return Y},f:function(){return X}});var n={};function i(t){return+t}function o(t){return t*t}function a(t){return t*(2-t)}function s(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function u(t){return t*t*t}function l(t){return--t*t*t+1}function c(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}r.r(n),r.d(n,{easeBack:function(){return G},easeBackIn:function(){return F},easeBackInOut:function(){return G},easeBackOut:function(){return z},easeBounce:function(){return D},easeBounceIn:function(){return R},easeBounceInOut:function(){return B},easeBounceOut:function(){return D},easeCircle:function(){return k},easeCircleIn:function(){return S},easeCircleInOut:function(){return k},easeCircleOut:function(){return E},easeCubic:function(){return c},easeCubicIn:function(){return u},easeCubicInOut:function(){return c},easeCubicOut:function(){return l},easeElastic:function(){return H},easeElasticIn:function(){return V},easeElasticInOut:function(){return W},easeElasticOut:function(){return H},easeExp:function(){return _},easeExpIn:function(){return x},easeExpInOut:function(){return _},easeExpOut:function(){return w},easeLinear:function(){return i},easePoly:function(){return p},easePolyIn:function(){return f},easePolyInOut:function(){return p},easePolyOut:function(){return h},easeQuad:function(){return s},easeQuadIn:function(){return o},easeQuadInOut:function(){return s},easeQuadOut:function(){return a},easeSin:function(){return m},easeSinIn:function(){return v},easeSinInOut:function(){return m},easeSinOut:function(){return g}});var f=function t(e){function r(t){return Math.pow(t,e)}return e=+e,r.exponent=t,r}(3),h=function t(e){function r(t){return 1-Math.pow(1-t,e)}return e=+e,r.exponent=t,r}(3),p=function t(e){function r(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,r.exponent=t,r}(3),d=Math.PI,y=d/2;function v(t){return 1==+t?1:1-Math.cos(t*y)}function g(t){return Math.sin(t*y)}function m(t){return(1-Math.cos(d*t))/2}function b(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function x(t){return b(1-+t)}function w(t){return 1-b(t)}function _(t){return((t*=2)<=1?b(1-t):2-b(t-1))/2}function S(t){return 1-Math.sqrt(1-t*t)}function E(t){return Math.sqrt(1- --t*t)}function k(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var T=4/11,C=6/11,O=8/11,A=.75,P=9/11,M=10/11,I=.9375,L=21/22,j=63/64,N=1/T/T;function R(t){return 1-D(1-t)}function D(t){return(t=+t)Math.PI/2?Math.PI-l:l,c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-l)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",function(t){for(var e=t.attr().points,r=[],n=[],i=0;i2&&(r.push([i].concat(s.splice(0,2))),u="l",i="m"===i?"l":"L"),"o"===u&&1===s.length&&r.push([i,s[0]]),"r"===u)r.push([i].concat(s));else for(;s.length>=e[u]&&(r.push([i].concat(s.splice(0,e[u]))),e[u]););return t}),r},u=function(t,e){for(var r=[],n=0,i=t.length;i-2*!e>n;n+=2){var o=[{x:+t[n-2],y:+t[n-1]},{x:+t[n],y:+t[n+1]},{x:+t[n+2],y:+t[n+3]},{x:+t[n+4],y:+t[n+5]}];e?n?i-4===n?o[3]={x:+t[0],y:+t[1]}:i-2===n&&(o[2]={x:+t[0],y:+t[1]},o[3]={x:+t[2],y:+t[3]}):o[0]={x:+t[i-2],y:+t[i-1]}:i-4===n?o[3]=o[2]:n||(o[0]={x:+t[n],y:+t[n+1]}),r.push(["C",(-o[0].x+6*o[1].x+o[2].x)/6,(-o[0].y+6*o[1].y+o[2].y)/6,(o[1].x+6*o[2].x-o[3].x)/6,(o[1].y+6*o[2].y-o[3].y)/6,o[2].x,o[2].y])}return r},l=function(t,e,r,n,i){var o=[];if(null===i&&null===n&&(n=r),t=+t,e=+e,r=+r,n=+n,null!==i){var a=Math.PI/180,s=t+r*Math.cos(-n*a),u=t+r*Math.cos(-i*a);o=[["M",s,e+r*Math.sin(-n*a)],["A",r,r,0,+(i-n>180),0,u,e+r*Math.sin(-i*a)]]}else o=[["M",t,e],["m",0,-n],["a",r,n,0,1,1,0,2*n],["a",r,n,0,1,1,0,-2*n],["z"]];return o},c=function(t){if(!(t=s(t))||!t.length)return[["M",0,0]];var e,r,n=[],i=0,o=0,a=0,c=0,f=0;"M"===t[0][0]&&(a=i=+t[0][1],c=o=+t[0][2],f++,n[0]=["M",i,o]);for(var h=3===t.length&&"M"===t[0][0]&&"R"===t[1][0].toUpperCase()&&"Z"===t[2][0].toUpperCase(),p=void 0,d=void 0,y=f,v=t.length;y1&&(n*=_=Math.sqrt(_),i*=_);var S=n*n,E=i*i,k=(a===s?-1:1)*Math.sqrt(Math.abs((S*E-S*w*w-E*x*x)/(S*w*w+E*x*x)));d=k*n*w/i+(e+u)/2,y=k*-i*x/n+(r+l)/2,h=Math.asin(((r-y)/i).toFixed(9)),p=Math.asin(((l-y)/i).toFixed(9)),h=ep&&(h-=2*Math.PI),!s&&p>h&&(p-=2*Math.PI)}var T=p-h;if(Math.abs(T)>v){var C=p,O=u,A=l;p=h+v*(s&&p>h?1:-1),m=t(u=d+n*Math.cos(p),l=y+i*Math.sin(p),n,i,o,0,s,O,A,[p,C,d,y])}T=p-h;var P=Math.cos(h),M=Math.sin(h),I=Math.cos(p),L=Math.sin(p),j=Math.tan(T/4),N=4/3*n*j,R=4/3*i*j,D=[e,r],B=[e+N*M,r-R*P],F=[u+N*L,l-R*I],z=[u,l];if(B[0]=2*D[0]-B[0],B[1]=2*D[1]-B[1],c)return[B,F,z].concat(m);for(var G=[],U=0,V=(m=[B,F,z].concat(m).join().split(",")).length;U7){t[e].shift();for(var o=t[e];o.length;)s[e]="A",i&&(u[e]="A"),t.splice(e++,0,["C"].concat(o.splice(0,6)));t.splice(e,1),r=Math.max(n.length,i&&i.length||0)}},v=function(t,e,o,a,s){t&&e&&"M"===t[s][0]&&"M"!==e[s][0]&&(e.splice(s,0,["M",a.x,a.y]),o.bx=0,o.by=0,o.x=t[s][1],o.y=t[s][2],r=Math.max(n.length,i&&i.length||0))};r=Math.max(n.length,i&&i.length||0);for(var g=0;g1?1:u<0?0:u)/2,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],h=0,p=0;p<12;p++){var d=l*c[p]+l,y=v(d,t,r,i,a),g=v(d,e,n,o,s),m=y*y+g*g;h+=f[p]*Math.sqrt(m)}return l*h},m=function(t,e,r,n,i,o,a,s){if(!(Math.max(t,r)Math.max(i,a)||Math.max(e,n)Math.max(o,s))){var u=(t-r)*(o-s)-(e-n)*(i-a);if(u){var l=((t*n-e*r)*(i-a)-(t-r)*(i*s-o*a))/u,c=((t*n-e*r)*(o-s)-(e-n)*(i*s-o*a))/u,f=+l.toFixed(2),h=+c.toFixed(2);if(!(f<+Math.min(t,r).toFixed(2)||f>+Math.max(t,r).toFixed(2)||f<+Math.min(i,a).toFixed(2)||f>+Math.max(i,a).toFixed(2)||h<+Math.min(e,n).toFixed(2)||h>+Math.max(e,n).toFixed(2)||h<+Math.min(o,s).toFixed(2)||h>+Math.max(o,s).toFixed(2)))return{x:l,y:c}}}},b=function(t,e,r){return e>=t.x&&e<=t.x+t.width&&r>=t.y&&r<=t.y+t.height},x=function(t,e,r,n,i){if(i)return[["M",+t+ +i,e],["l",r-2*i,0],["a",i,i,0,0,1,i,i],["l",0,n-2*i],["a",i,i,0,0,1,-i,i],["l",2*i-r,0],["a",i,i,0,0,1,-i,-i],["l",0,2*i-n],["a",i,i,0,0,1,i,-i],["z"]];var o=[["M",t,e],["l",r,0],["l",0,n],["l",-r,0],["z"]];return o.parsePathArray=y,o},w=function(t,e,r,n){return null===t&&(t=e=r=n=0),null===e&&(e=t.y,r=t.width,n=t.height,t=t.x),{x:t,y:e,width:r,w:r,height:n,h:n,x2:t+r,y2:e+n,cx:t+r/2,cy:e+n/2,r1:Math.min(r,n)/2,r2:Math.max(r,n)/2,r0:Math.sqrt(r*r+n*n)/2,path:x(t,e,r,n),vb:[t,e,r,n].join(" ")}},_=function(t,e,r,i,o,a,s,u){(0,n.isArray)(t)||(t=[t,e,r,i,o,a,s,u]);var l=function(t,e,r,n,i,o,a,s){for(var u,l,c,f,h=[],p=[[],[]],d=0;d<2;++d)if(0===d?(l=6*t-12*r+6*i,u=-3*t+9*r-9*i+3*a,c=3*r-3*t):(l=6*e-12*n+6*o,u=-3*e+9*n-9*o+3*s,c=3*n-3*e),Math.abs(u)<1e-12){if(Math.abs(l)<1e-12)continue;(f=-c/l)>0&&f<1&&h.push(f)}else{var y=l*l-4*c*u,v=Math.sqrt(y);if(!(y<0)){var g=(-l+v)/(2*u);g>0&&g<1&&h.push(g);var m=(-l-v)/(2*u);m>0&&m<1&&h.push(m)}}for(var b,x=h.length,w=x;x--;)b=1-(f=h[x]),p[0][x]=b*b*b*t+3*b*b*f*r+3*b*f*f*i+f*f*f*a,p[1][x]=b*b*b*e+3*b*b*f*n+3*b*f*f*o+f*f*f*s;return p[0][w]=t,p[1][w]=e,p[0][w+1]=a,p[1][w+1]=s,p[0].length=p[1].length=w+2,{min:{x:Math.min.apply(0,p[0]),y:Math.min.apply(0,p[1])},max:{x:Math.max.apply(0,p[0]),y:Math.max.apply(0,p[1])}}}.apply(null,t);return w(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},S=function(t,e,r,n,i,o,a,s,u){var l=1-u,c=Math.pow(l,3),f=Math.pow(l,2),h=u*u,p=h*u,d=t+2*u*(r-t)+h*(i-2*r+t),y=e+2*u*(n-e)+h*(o-2*n+e),v=r+2*u*(i-r)+h*(a-2*i+r),g=n+2*u*(o-n)+h*(s-2*o+n);return{x:c*t+3*f*u*r+3*l*u*u*i+p*a,y:c*e+3*f*u*n+3*l*u*u*o+p*s,m:{x:d,y:y},n:{x:v,y:g},start:{x:l*t+u*r,y:l*e+u*n},end:{x:l*i+u*a,y:l*o+u*s},alpha:90-180*Math.atan2(d-v,y-g)/Math.PI}},E=function(t,e,r){if(!function(t,e){return t=w(t),e=w(e),b(e,t.x,t.y)||b(e,t.x2,t.y)||b(e,t.x,t.y2)||b(e,t.x2,t.y2)||b(t,e.x,e.y)||b(t,e.x2,e.y)||b(t,e.x,e.y2)||b(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)}(_(t),_(e)))return r?0:[];for(var n=~~(g.apply(0,t)/8),i=~~(g.apply(0,e)/8),o=[],a=[],s={},u=r?0:[],l=0;l=0&&k<=1&&T>=0&&T<=1&&(r?u+=1:u.push({x:E.x,y:E.y,t1:k,t2:T}))}}return u},k=function(t,e){return function(t,e,r){var n,i,o,a,s,u,l,c,f,h;t=p(t),e=p(e);for(var d=r?0:[],y=0,v=t.length;y=3&&(3===t.length&&e.push("Q"),e=e.concat(t[1])),2===t.length&&e.push("L"),e=e.concat(t[t.length-1])})}(t,e,r));else{var i=[].concat(t);"M"===i[0]&&(i[0]="L");for(var o=0;o<=r-1;o++)n.push(i)}return n},O=function(t,e){if(1===t.length)return t;var r=t.length-1,n=e.length-1,i=r/n,o=[];if(1===t.length&&"M"===t[0][0]){for(var a=0;a=0;u--)a=o[u].index,"add"===o[u].type?t.splice(a,0,[].concat(t[a])):t.splice(a,1)}var f=i-(n=t.length);if(n0)){t[n]=e[n];break}r=I(r,t[n-1],1)}t[n]=["Q"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"T":t[n]=["T"].concat(r[0]);break;case"C":if(r.length<3){if(!(n>0)){t[n]=e[n];break}r=I(r,t[n-1],2)}t[n]=["C"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;case"S":if(r.length<2){if(!(n>0)){t[n]=e[n];break}r=I(r,t[n-1],1)}t[n]=["S"].concat(r.reduce(function(t,e){return t.concat(e)},[]));break;default:t[n]=e[n]}return t}},8358:function(t,e,r){"use strict";r.d(e,{ei:function(){return s},lb:function(){return o},q_:function(){return a}});var n=r(4389),i=r(8204);function o(t,e,r){var i=1;return(0,n.Kg)(t)&&(i=t.split("\n").length),i>1?e*i+function(t,e){return e?e-t:.14*t}(e,r)*(i-1):e}function a(t,e){var r=(0,i.X)(),o=0;if((0,n.gD)(t)||""===t)return o;if(r.save(),r.font=e,(0,n.Kg)(t)&&t.includes("\n")){var a=t.split("\n");(0,n.__)(a,function(t){var e=r.measureText(t).width;o(r-t)*(r-t)+(n-e)*(n-e)?o(r,n,i,a):this.pointToLine(t,e,r,n,i,a)},pointToLine:function(t,e,r,n,i,o){var a=[r-t,n-e];if(c.exactEquals(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];c.normalize(s,s);var u=[i-t,o-e];return Math.abs(c.dot(u,s))},tangentAngle:function(t,e,r,n){return Math.atan2(n-e,r-t)}},h=1e-4;function p(t,e,r,n,i,a){var s,u=1/0,l=[r,n],c=20;a&&a>200&&(c=a/10);for(var f=1/c,p=f/10,d=0;d<=c;d++){var y=d*f,v=[i.apply(null,t.concat([y])),i.apply(null,e.concat([y]))];(x=o(l[0],l[1],v[0],v[1]))=0&&x=0?[i]:[]}function v(t,e,r,n){return 2*(1-n)*(e-t)+2*n*(r-e)}function g(t,e,r,n,i,o,a){var s=d(t,r,i,a),u=d(e,n,o,a),l=f.pointAt(t,e,r,n,a),c=f.pointAt(r,n,i,o,a);return[[t,e,l.x,l.y,s,u],[s,u,c.x,c.y,i,o]]}var m={box:function(t,e,r,n,i,o){var a=y(t,r,i)[0],u=y(e,n,o)[0],l=[t,i],c=[e,o];return void 0!==a&&l.push(d(t,r,i,a)),void 0!==u&&c.push(d(e,n,o,u)),s(l,c)},length:function(t,e,r,n,i,a){return function t(e,r,n,i,a,s,u){if(0===u)return(o(e,r,n,i)+o(n,i,a,s)+o(e,r,a,s))/2;var l=g(e,r,n,i,a,s,.5),c=l[0],f=l[1];return c.push(u-1),f.push(u-1),t.apply(null,c)+t.apply(null,f)}(t,e,r,n,i,a,3)},nearestPoint:function(t,e,r,n,i,o,a,s){return p([t,r,i],[e,n,o],a,s,d)},pointDistance:function(t,e,r,n,i,a,s,u){var l=this.nearestPoint(t,e,r,n,i,a,s,u);return o(l.x,l.y,s,u)},interpolationAt:d,pointAt:function(t,e,r,n,i,o,a){return{x:d(t,r,i,a),y:d(e,n,o,a)}},divide:function(t,e,r,n,i,o,a){return g(t,e,r,n,i,o,a)},tangentAngle:function(t,e,r,n,i,o,a){var s=v(t,r,i,a),u=v(e,n,o,a);return l(Math.atan2(u,s))}};function b(t,e,r,n,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*r*i*i*o+n*i*i*i}function x(t,e,r,n,i){var o=1-i;return 3*(o*o*(e-t)+2*o*i*(r-e)+i*i*(n-r))}function w(t,e,r,n){var i,o,s,u=-3*t+9*e-9*r+3*n,l=6*t-12*e+6*r,c=3*e-3*t,f=[];if(a(u,0))a(l,0)||(i=-c/l)>=0&&i<=1&&f.push(i);else{var h=l*l-4*u*c;a(h,0)?f.push(-l/(2*u)):h>0&&(o=(-l-(s=Math.sqrt(h)))/(2*u),(i=(-l+s)/(2*u))>=0&&i<=1&&f.push(i),o>=0&&o<=1&&f.push(o))}return f}function _(t,e,r,n,i,o,a,s,u){var l=b(t,r,i,a,u),c=b(e,n,o,s,u),h=f.pointAt(t,e,r,n,u),p=f.pointAt(r,n,i,o,u),d=f.pointAt(i,o,a,s,u),y=f.pointAt(h.x,h.y,p.x,p.y,u),v=f.pointAt(p.x,p.y,d.x,d.y,u);return[[t,e,h.x,h.y,y.x,y.y,l,c],[l,c,v.x,v.y,d.x,d.y,a,s]]}function S(t,e,r,n,i,a,s,u,l){if(0===l)return function(t,e){for(var r=0,n=t.length,i=0;i0?r:-1*r}var T=function(t,e,r,n,i,o){var a=r,s=n;if(0===a||0===s)return{x:t,y:e};for(var u,l,c=i-t,f=o-e,h=Math.abs(c),p=Math.abs(f),d=a*a,y=s*s,v=Math.PI/4,g=0;g<4;g++){u=a*Math.cos(v),l=s*Math.sin(v);var m=(d-y)*Math.pow(Math.cos(v),3)/a,b=(y-d)*Math.pow(Math.sin(v),3)/s,x=u-m,w=l-b,_=h-m,S=p-b,E=Math.hypot(w,x),T=Math.hypot(S,_);v+=E*Math.asin((x*S-w*_)/(E*T))/Math.sqrt(d+y-u*u-l*l),v=Math.min(Math.PI/2,Math.max(0,v))}return{x:t+k(u,c),y:e+k(l,f)}};function C(t,e,r,n,i,o){return r*Math.cos(i)*Math.cos(o)-n*Math.sin(i)*Math.sin(o)+t}function O(t,e,r,n,i,o){return r*Math.sin(i)*Math.cos(o)+n*Math.cos(i)*Math.sin(o)+e}function A(t,e,r){return{x:t*Math.cos(r),y:e*Math.sin(r)}}function P(t,e,r){var n=Math.cos(r),i=Math.sin(r);return[t*n-e*i,t*i+e*n]}var M={box:function(t,e,r,n,i,o,a){for(var s=function(t,e,r){return Math.atan(-e/t*Math.tan(r))}(r,n,i),u=1/0,l=-1/0,c=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var h=s+f;ol&&(l=p)}var d=function(t,e,r){return Math.atan(e/(t*Math.tan(r)))}(r,n,i),y=1/0,v=-1/0,g=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var m=d+f;ov&&(v=b)}return{x:u,y:y,width:l-u,height:v-y}},length:function(t,e,r,n,i,o,a){},nearestPoint:function(t,e,r,n,i,o,a,s,u){var l=P(s-t,u-e,-i),c=l[0],f=l[1],h=T(0,0,r,n,c,f),p=function(t,e,r,n){return(Math.atan2(n*t,r*e)+2*Math.PI)%(2*Math.PI)}(r,n,h.x,h.y);pa&&(h=A(r,n,a));var d=P(h.x,h.y,i);return{x:d[0]+t,y:d[1]+e}},pointDistance:function(t,e,r,n,i,a,s,u,l){var c=this.nearestPoint(t,e,r,n,u,l);return o(c.x,c.y,u,l)},pointAt:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o;return{x:C(t,0,r,n,i,u),y:O(0,e,r,n,i,u)}},tangentAngle:function(t,e,r,n,i,o,a,s){var u=(a-o)*s+o,c=function(t,e,r,n,i,o,a,s){return-1*r*Math.cos(i)*Math.sin(s)-n*Math.sin(i)*Math.cos(s)}(0,0,r,n,i,0,0,u),f=function(t,e,r,n,i,o,a,s){return-1*r*Math.sin(i)*Math.sin(s)+n*Math.cos(i)*Math.cos(s)}(0,0,r,n,i,0,0,u);return l(Math.atan2(f,c))}};function I(t){for(var e=0,r=[],n=0;n1||e<0||t.length<2)return null;var r=I(t),n=r.segments,i=r.totalLength;if(0===i)return{x:t[0][0],y:t[0][1]};for(var o=0,a=null,s=0;s=o&&e<=o+h){var p=(e-o)/h;a=f.pointAt(l[0],l[1],c[0],c[1],p);break}o+=h}return a}function N(t,e){if(e>1||e<0||t.length<2)return 0;for(var r=I(t),n=r.segments,i=r.totalLength,o=0,a=0,s=0;s=o&&e<=o+f){a=Math.atan2(c[1]-l[1],c[0]-l[0]);break}o+=f}return a}function R(t,e,r){for(var n=1/0,i=0;i0&&void 0!==i[0]?i[0]:1,!this.dirty){t.next=6;break}return this.compiledBundle.context&&(e>1?this.compiledBundle.context.maxIteration=e:this.compiledBundle.context.maxIteration++),t.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(t){return t.isReferer}).forEach(function(t){var e=t.data,r=t.name;n.model.confirmInput(e.model,r)}),r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);r16)throw new Error("invalid data type ".concat(r));i[e]=function(){return t.data}}});var o=this.getOuputDataTexture(),a=o.textureWidth,s=o.texelCount;i.u_OutputTextureSize=[a,a],i.u_OutputTexelCount=s,this.context.output.textureSize=[a,a];var l={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:"#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n".concat(this.context.shader),uniforms:i,vert:ht,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(l)}return c(t,[{key:"run",value:function(){var t=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){t.computeCommand()}),dt&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var t=i(m().mark(function t(){var e,r,n,i,o,a,s,u,l=this;return m().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){e=l.reGl.read()}),!e){t.next=6;break}if(r=this.getOuputDataTexture(),n=r.originalDataLength,i=r.elementsPerTexel,o=r.typedArrayConstructor,a=void 0===o?Float32Array:o,s=[],4!==i)for(u=0;u2&&void 0!==arguments[2]&&arguments[2];var r=this.context.uniforms.find(function(e){return e.name===t});if(r){var n=this.calcDataTexture(t,r.type,e),i=n.texture,o=n.data;this.textureCache[t].data=o,this.textureCache[t].texture=i}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var t=this.context.output.name;this.textureCache[t].id=this.getOuputDataTexture().id,this.textureCache[t].texture=this.getOuputDataTexture().texture}var e=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=e,dt&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var t=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=t}},{key:"cloneDataTexture",value:function(t){var e=t.data,r=t.textureWidth;return ft(ft({},t),{},{id:pt++,texture:this.reGl.texture({width:r,height:r,data:e,type:"float"})})}},{key:"calcDataTexture",value:function(t,e,r){var n=1;e===_.Vector4FloatArray&&(n=4);for(var i=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:{},r=new t;return r.setConfig(e),r.setEngine(new kt),r}}]),t}()},288:function(t,e,r){"use strict";r.r(e),r.d(e,{Graph:function(){return x},GraphWithEvent:function(){return C},algorithm:function(){return n},comparision:function(){return o},essence:function(){return i},generate:function(){return s}});var n={};r.r(n),r.d(n,{components:function(){return M},dfs:function(){return I},dijkstra:function(){return D},dijkstraAll:function(){return B},findCycles:function(){return z},floydWarshall:function(){return et},isAcyclic:function(){return J},postorder:function(){return Q},preorder:function(){return $},prim:function(){return P},tarjan:function(){return F},topsort:function(){return K}});var i={};r.r(i),r.d(i,{hasSelfLoop:function(){return vt},isGraph:function(){return pt},isNullGraph:function(){return yt},isSimpleGraph:function(){return dt}});var o={};r.r(o),r.d(o,{containAllSameEdges:function(){return ut},containAllSameNodes:function(){return st},containSameEdges:function(){return nt},containSameNodes:function(){return rt},getSameEdges:function(){return ot},getSameNodes:function(){return it},isGraphComplement:function(){return gt},isGraphContainsAnother:function(){return ct},isGraphOptionSame:function(){return at},isGraphSame:function(){return lt}});var a,s={};function u(t,e){var r=t.get(e)||0;t.set(e,r+1)}function l(t,e){var r=t.get(e);void 0!==r&&((r-=1)>0?t.set(e,r):t.delete(e))}function c(t,e,r,n){var i=String(e),o=String(r);if(!t&&i>o){var s=i;i=o,o=s}return i+a.EDGE_KEY_DELIM+o+a.EDGE_KEY_DELIM+(void 0===n?a.DEFAULT_EDGE_NAME:n)}function f(t,e,r,n){var i=String(e),o=String(r),a={v:e,w:r};if(!t&&i>o){var s=a.v;a.v=a.w,a.w=s}return void 0!==n&&(a.name=n),a}function h(t,e){return c(t,e.v,e.w,e.name)}function p(t){return"function"==typeof t}r.r(s),r.d(s,{getGraphComplement:function(){return mt}}),function(t){t.DEFAULT_EDGE_NAME="\0",t.GRAPH_NODE="\0",t.EDGE_KEY_DELIM=""}(a||(a={}));var d=function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:function(t){return t.nodes().map(function(e){var r={id:e,value:t.node(e),parent:t.parent(e)};return void 0===r.value&&delete r.value,void 0===r.parent&&delete r.parent,r})}(t),edges:function(t){return t.edges().map(function(e){var r=t.edge(e),n={v:e.v,w:e.w,value:r,name:e.name};return void 0===n.name&&delete n.name,void 0===n.value&&delete n.value,n})}(t),value:t.graph()};return void 0===e.value&&delete e.value,e};function y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function v(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=a.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return e.directed},this.isMultigraph=function(){return e.multigraph},this.isCompound=function(){return e.compound},this.setGraph=function(t){return e.label=t,e},this.graph=function(){return e.label},this.setDefaultNodeLabel=function(t){return p(t)?e.defaultNodeLabelFn=t:e.defaultNodeLabelFn=function(){return t},e},this.nodeCount=function(){return e.nodeCountNum},this.node=function(t){return e.nodesLabelMap.get(t)},this.nodes=function(){return Array.from(e.nodesLabelMap.keys())},this.sources=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.inEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.sinks=function(){return e.nodes().filter(function(t){var r;return!(null===(r=e.outEdgesMap.get(t))||void 0===r?void 0:r.size)})},this.setNodes=function(t,r){return t.map(function(t){return e.setNode(t,r)}),e},this.hasNode=function(t){return e.nodesLabelMap.has(t)},this.checkCompound=function(){if(!e.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(t){if(e.isCompound()){var r,n=null===(r=e.parentMap)||void 0===r?void 0:r.get(t);if(n!==e.GRAPH_NODE)return n}},this.removeFromParentsChildList=function(t){var r=e.parentMap.get(t);e.childrenMap.get(r).delete(t)},this.setParent=function(t,r){var n,i;e.checkCompound();for(var o=void 0===r?e.GRAPH_NODE:r,a=e.parent(o);a;){if(t===a)throw new Error("Setting "+r+" as parent of "+t+" would create a cycle");a=e.parent(a)}r&&e.setNode(r),e.setNode(t),e.removeFromParentsChildList(t),null===(n=e.parentMap)||void 0===n||n.set(t,o);var s=e.childrenMap.get(o);return s.set(t,!0),null===(i=e.childrenMap)||void 0===i||i.set(o,s),e},this.children=function(t){var r=void 0===t?e.GRAPH_NODE:t;if(e.isCompound()){var n,i=null===(n=e.childrenMap)||void 0===n?void 0:n.get(r);return i?Array.from(i.keys()):void 0}return r===e.GRAPH_NODE?e.nodes():t&&e.hasNode(t)?[]:void 0},this.predecessors=function(t){var r=e.predecessorsMap.get(t);return r?Array.from(r.keys()):void 0},this.successors=function(t){var r=e.successorsMap.get(t);return r?Array.from(r.keys()):void 0},this.neighbors=function(t){var r;if(e.hasNode(t))return Array.from(new Set(null===(r=e.predecessors(t))||void 0===r?void 0:r.concat(e.successors(t))))},this.isLeaf=function(t){var r,n;return e.isDirected()?!(null===(n=e.successors(t))||void 0===n?void 0:n.length):!(null===(r=e.neighbors(t))||void 0===r?void 0:r.length)},this.filterNodes=function(r){var n=e.directed,i=e.multigraph,o=e.compound,a=new t({directed:n,multigraph:i,compound:o});if(a.setGraph(e.graph()),e.nodes().forEach(function(t){r(t)&&a.setNode(t,e.node(t))}),e.edges().forEach(function(t){a.hasNode(t.v)&&a.hasNode(t.w)&&a.setEdgeObj(t,e.edge(t))}),o){a.nodes().forEach(function(t){a.setParent(t,function(t){for(var r=e.parent(t);void 0!==r&&!a.hasNode(r);)r=e.parent(r);return r}(t))})}return a},this.setDefaultEdgeLabel=function(t){return p(t)?e.defaultEdgeLabelFn=t:e.defaultEdgeLabelFn=function(){return t},e},this.edgeCount=function(){return e.edgeCountNum},this.setEdgeObj=function(t,r){return e.setEdge(t.v,t.w,r,t.name)},this.setPath=function(t,r){return t.reduce(function(t,n){return e.setEdge(t,n,r),n}),e},this.edgeFromArgs=function(t,r,n){return e.edge({v:t,w:r,name:n})},this.edge=function(t){return e.edgesLabelsMap.get(h(e.isDirected(),t))},this.hasEdge=function(t,r,n){return e.edgesLabelsMap.has(h(e.isDirected(),{v:t,w:r,name:n}))},this.removeEdgeObj=function(t){var r=t.v,n=t.w,i=t.name;return e.removeEdge(r,n,i)},this.edges=function(){return Array.from(e.edgesMap.values())},this.inEdges=function(t,r){var n=e.inEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.v===r})},this.outEdges=function(t,r){var n=e.outEdgesMap.get(t);if(n)return Array.from(n.values()).filter(function(t){return!r||t.w===r})},this.nodeEdges=function(t,r){var n;if(e.hasNode(t))return null===(n=e.inEdges(t,r))||void 0===n?void 0:n.concat(e.outEdges(t,r))},this.toJSON=function(){return d(e)},this.nodeInDegree=function(t){var r=e.inEdgesMap.get(t);return r?r.size:0},this.nodeOutDegree=function(t){var r=e.outEdgesMap.get(t);return r?r.size:0},this.nodeDegree=function(t){return e.nodeInDegree(t)+e.nodeOutDegree(t)},this.source=function(t){return t.v},this.target=function(t){return t.w};var n=v(v({},b),r);this.compound=n.compound,this.directed=n.directed,this.multigraph=n.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}var e,r,n;return e=t,(r=[{key:"setNode",value:function(t,e){var r,n=this.nodesLabelMap,i=this.defaultNodeLabelFn,o=this.isCompound,a=this.parentMap,s=this.childrenMap,u=this.inEdgesMap,l=this.outEdgesMap,c=this.predecessorsMap,f=this.successorsMap;if(n.has(t))return void 0!==e&&n.set(t,e),this;(n.set(t,e||i(t)),o())&&(null===a||void 0===a||a.set(t,this.GRAPH_NODE),null===s||void 0===s||s.set(t,new Map),(null===s||void 0===s?void 0:s.has(this.GRAPH_NODE))||null===s||void 0===s||s.set(this.GRAPH_NODE,new Map),null===s||void 0===s||null===(r=s.get(this.GRAPH_NODE))||void 0===r||r.set(t,!0));return[u,l,c,f].forEach(function(e){return e.set(t,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(t){var e=this;if(this.hasNode(t)){var r,n,i,o=function(t){e.removeEdge(t.v,t.w,t.name)},a=this.inEdgesMap,s=this.outEdgesMap,u=this.predecessorsMap,l=this.successorsMap,c=this.nodesLabelMap;if(this.isCompound())this.removeFromParentsChildList(t),null===(r=this.parentMap)||void 0===r||r.delete(t),null===(n=this.children(t))||void 0===n||n.forEach(function(t){return e.setParent(t)}),null===(i=this.childrenMap)||void 0===i||i.delete(t);var f=a.get(t),h=s.get(t);Array.from(f.values()).forEach(function(t){return o(t)}),Array.from(h.values()).forEach(function(t){return o(t)}),c.delete(t),a.delete(t),s.delete(t),u.delete(t),l.delete(t),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(t,e,r,n){var i,o,a=f(this.isDirected(),t,e,n),s=h(this.isDirected(),a),l=a.v,c=a.w;if(this.edgesLabelsMap.has(s))return this.edgesLabelsMap.set(s,r),this;if(void 0!==n&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(c),this.edgesLabelsMap.set(s,r||this.defaultEdgeLabelFn(l,c,n)),Object.freeze(a),this.edgesMap.set(s,a);var p=this.predecessorsMap.get(c),d=this.successorsMap.get(l);return u(p,l),u(d,c),null===(i=this.inEdgesMap.get(c))||void 0===i||i.set(s,a),null===(o=this.outEdgesMap.get(l))||void 0===o||o.set(s,a),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(t,e,r){var n=c(this.isDirected(),t,e,r);if(this.edgesMap.get(n)){var i=f(this.isDirected(),t,e,r),o=i.v,a=i.w;this.edgesLabelsMap.delete(n),this.edgesMap.delete(n);var s=this.predecessorsMap.get(a),u=this.successorsMap.get(o);l(s,o),l(u,a),this.inEdgesMap.get(a).delete(n),this.outEdgesMap.get(o).delete(n),this.edgeCountNum-=1}return this}}])&&m(e.prototype,r),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function w(t){"@babel/helpers - typeof";return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(t,e){for(var r=0;r-1&&this.eventPool[t].splice(r,1)}}},{key:"emitEvent",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n>1])||void 0===a?void 0:a.priority)e.arr[n].priority)throw new Error("New priority is greater than current priority.Key: ".concat(t," Old: + ").concat(e.arr[n].priority," New: ").concat(r));e.arr[n].priority=r,e.innerDecrease(n)}}),P=function(t,e){var r,n=new x,i=new Map,o=new A;function a(t){var n=t.v===r?t.w:t.v,a=o.priority(n);if(void 0!==a){var s=e(t);s0;){var u;if(r=o.removeMin(),i.has(r))n.setEdge(r,i.get(r));else{if(s)throw new Error("Input graph is not connected: "+t.graph());s=!0}null===(u=t.nodeEdges(r))||void 0===u||u.forEach(a)}return n},M=function(t){var e=new Set,r=[];return t.nodes().forEach(function(n){for(var i=[],o=[n];o.length>0;){var a,s,u=o.pop();e.has(u)||(e.add(u),i.push(u),null===(a=t.successors(u))||void 0===a||a.forEach(function(t){return o.push(t)}),null===(s=t.predecessors(u))||void 0===s||s.forEach(function(t){return o.push(t)}))}i.length&&r.push(i)}),r},I=function(t,e,r){var n=function(e){return t.isDirected()?t.successors(e):t.neighbors(e)},i=[],o=[];return(Array.isArray(e)?e:[e]).forEach(function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,r,n,i,o,a){i.includes(r)||(i.push(r),n||a.push(r),o(r).forEach(function(r){return t(e,r,n,i,o,a)}),n&&a.push(r))}(t,e,"post"===r,o,n,i)}),i};function L(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return j(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(i=s.removeMin(),!(o=a.get(i))||o.distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);var l={};return Array.from(a.entries()).forEach(function(t){var e=L(t,2),r=e[0],n=e[1];return l[String(r)]=n,l}),l},D=function(t,e,r,n){return R(t,e,r||N,n||function(e){return t.outEdges(e)})},B=function(t,e,r){var n={};return t.nodes().forEach(function(i){return n[String(i)]=D(t,i,e,r),n}),n},F=function(t){var e=0,r=[],n=new Map,i=[];return t.nodes().forEach(function(o){n.has(o)||function o(a){var s,u={onStack:!0,lowlink:e,index:e};if(n.set(a,u),e+=1,r.push(a),null===(s=t.successors(a))||void 0===s||s.forEach(function(t){var e;if(n.has(t)){if(null===(e=n.get(t))||void 0===e?void 0:e.onStack){var r=n.get(t);u.lowlink=Math.min(u.lowlink,r.index)}}else{o(t);var i=n.get(t);u.lowlink=Math.min(u.lowlink,i.lowlink)}}),u.lowlink===u.index){var l,c=[];do{l=r.pop(),n.get(l).onStack=!1,c.push(l)}while(a!==l);i.push(c)}}(o)}),i},z=function(t){return F(t).filter(function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})};function G(t){"@babel/helpers - typeof";return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);ro&&(o=e.depth);var r=e.children,n=r.length,i=new function(t,e){void 0===t&&(t=0),void 0===e&&(e=[]);var r=this;r.x=r.y=0,r.leftChild=r.rightChild=null,r.height=0,r.children=e}(e.height,[]);return r.forEach(function(e,r){var o=t(e);i.children.push(o),0===r&&(i.leftChild=o),r===n-1&&(i.rightChild=o)}),i.originNode=e,i.isLeaf=e.isLeaf(),i}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=o;else{var r=e.children.map(function(e){return t(e)}),n=Math.min.apply(null,r);e.drawingDepth=n-1}return e.drawingDepth}(a),function t(n){n.x=n.drawingDepth*e.rankSep,n.isLeaf?(n.y=0,r&&(n.y=r.y+r.height+e.nodeSep,n.originNode.parent!==r.originNode.parent&&(n.y+=e.subTreeSep)),r=n):(n.children.forEach(function(e){t(e)}),n.y=(n.leftChild.y+n.rightChild.y)/2)}(a),function t(e,r,n){n?(r.x=e.x,r.y=e.y):(r.x=e.y,r.y=e.x),e.children.forEach(function(e,i){t(e,r.children[i],n)})}(a,t,e.isHorizontal),t}},8725:function(t,e,r){var n=r(4711),i=["LR","RL","TB","BT","H","V"],o=["LR","RL","H"],a=i[0];t.exports=function(t,e,r){var s=e.direction||a;if(e.isHorizontal=function(t){return o.indexOf(t)>-1}(s),s&&-1===i.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===i[0])r(t,e);else if(s===i[1])r(t,e),t.right2left();else if(s===i[2])r(t,e);else if(s===i[3])r(t,e),t.bottom2top();else if(s===i[4]||s===i[5]){var u=n(t,e),l=u.left,c=u.right;r(l,e),r(c,e),e.isHorizontal?l.right2left():l.bottom2top(),c.translate(l.x-c.x,l.y-c.y),t.x=l.x,t.y=c.y;var f=t.getBoundingBox();e.isHorizontal?f.top<0&&t.translate(0,-f.top):f.left<0&&t.translate(-f.left,0)}var h=e.fixedRoot;return void 0===h&&(h=!0),h&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),t}},3848:function(t,e,r){var n=r(2394),i={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function o(t,e){var r=this;if(r.vgap=r.hgap=0,t instanceof o)return t;r.data=t;var n=e.getHGap(t),i=e.getVGap(t);return r.preH=e.getPreH(t),r.preV=e.getPreV(t),r.width=e.getWidth(t),r.height=e.getHeight(t),r.width+=r.preH,r.height+=r.preV,r.id=e.getId(t),r.x=r.y=0,r.depth=0,r.children||(r.children=[]),r.addGap(n,i),r}n.assign(o.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){this.hgap+=t,this.vgap+=e,this.width+=2*t,this.height+=2*e},eachNode:function(t){for(var e,r=[this];e=r.shift();)t(e),r=e.children.concat(r)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,r=[this];e=r.shift();)t(e),r=r.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)}),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode(function(r){r.x+=t,r.y+=e,r.x+=r.preH,r.y+=r.preV})},right2left:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.x=e.x-2*(e.x-t.left)-e.width}),this.translate(t.width,0)},bottom2top:function(){var t=this.getBoundingBox();this.eachNode(function(e){e.y=e.y-2*(e.y-t.top)-e.height}),this.translate(0,t.height)}}),t.exports=function(t,e,r){void 0===e&&(e={});var a,s=new o(t,e=n.assign({},i,e)),u=[s];if(!r&&!t.collapsed)for(;a=u.shift();)if(!a.data.collapsed){var l=e.getChildren(a.data),c=l?l.length:0;if(a.children=new Array(c),l&&c)for(var f=0;ft.y?u:t.y}}else t.y=0}(t,o,e,r,i),o=t})}},6401:function(t,e,r){var n=r(2394);var i={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=n.assign({},i,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse(function(t){t.x=t.parent.x+t.parent.width}),t.parent=null,function t(e,r){var n=0;return e.children.length?e.children.forEach(function(e){n+=t(e,r)}):n=e.height,e._subTreeSep=r.getSubTreeSep(e.data),e.totalHeight=Math.max(e.height,n)+2*e._subTreeSep,e.totalHeight}(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode(function(t){var e=t.children,r=e.length;if(r){var n=e[0];if(n.startY=t.startY+t._subTreeSep,1===r)n.y=t.y+t.height/2-n.height/2;else{n.y=n.startY+n.totalHeight/2-n.height/2;for(var i=1;ie.height)e.y=i.y+a/2-e.height/2;else if(1!==r.length||e.height>s){var u=e.y+(e.height-a)/2-i.y;r.forEach(function(t){t.translate(0,u)})}else e.y=(i.y+i.height/2+o.y+o.height/2)/2-e.height/2}}(t)}},514:function(t){function e(t,e,r,n){void 0===n&&(n=[]);var i=this;i.w=t||0,i.h=e||0,i.y=r||0,i.x=0,i.c=n||[],i.cs=n.length,i.prelim=0,i.mod=0,i.shift=0,i.change=0,i.tl=null,i.tr=null,i.el=null,i.er=null,i.msel=0,i.mser=0}function r(t,e){!function t(e,r,n){n?e.y+=r:e.x+=r,e.children.forEach(function(e){t(e,r,n)})}(t,-function t(e,r){var n=r?e.y:e.x;return e.children.forEach(function(e){n=Math.min(t(e,r),n)}),n}(t,e),e)}e.fromNode=function(t,r){if(!t)return null;var n=[];return t.children.forEach(function(t){n.push(e.fromNode(t,r))}),r?new e(t.height,t.width,t.x,n):new e(t.width,t.height,t.y,n)},t.exports=function(t,n){void 0===n&&(n={});var i=n.isHorizontal;function o(t){0===t.cs?(t.el=t,t.er=t,t.msel=t.mser=0):(t.el=t.c[0].el,t.msel=t.c[0].msel,t.er=t.c[t.cs-1].er,t.mser=t.c[t.cs-1].mser)}function a(t,e,r){for(var n=t.c[e-1],i=n.mod,o=t.c[e],a=o.mod;null!==n&&null!==o;){c(n)>r.low&&(r=r.nxt);var f=i+n.prelim+n.w-(a+o.prelim);f>0&&(a+=f,s(t,e,r.index,f));var h=c(n),p=c(o);h<=p&&null!==(n=l(n))&&(i+=n.mod),h>=p&&null!==(o=u(o))&&(a+=o.mod)}!n&&o?function(t,e,r,n){var i=t.c[0].el;i.tl=r;var o=n-r.mod-t.c[0].msel;i.mod+=o,i.prelim-=o,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,o,a):n&&!o&&function(t,e,r,n){var i=t.c[e].er;i.tr=r;var o=n-r.mod-t.c[e].mser;i.mod+=o,i.prelim-=o,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,n,i)}function s(t,e,r,n){t.c[e].mod+=n,t.c[e].msel+=n,t.c[e].mser+=n,function(t,e,r,n){if(r!==e-1){var i=e-r;t.c[r+1].shift+=n/i,t.c[e].shift-=n/i,t.c[e].change-=n-n/i}}(t,e,r,n)}function u(t){return 0===t.cs?t.tl:t.c[0]}function l(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function c(t){return t.y+t.h}function f(t,e,r){for(;null!==r&&t>=r.low;)r=r.nxt;return{low:t,index:e,nxt:r}}!function t(e,r,n){void 0===n&&(n=0),r?(e.x=n,n+=e.width):(e.y=n,n+=e.height),e.children.forEach(function(e){t(e,r,n)})}(t,i);var h=e.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var r=f(c(e.c[0].el),0,null),n=1;nn?1:0}var u=function(t){function e(e){var r=t.call(this)||this;return r.radius=null,r.nodeSize=void 0,r.startRadius=null,r.endRadius=null,r.startAngle=0,r.endAngle=2*Math.PI,r.clockwise=!0,r.divisions=1,r.ordering=null,r.angleRatio=1,r.nodes=[],r.edges=[],r.nodeMap={},r.degrees=[],r.width=300,r.height=300,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},e.prototype.execute=function(){var t,e=this.nodes,r=this.edges,n=e.length;if(0!==n){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n)return e[0].x=i[0],e[0].y=i[1],void(this.onLayoutEnd&&this.onLayoutEnd());var o=this.radius,s=this.startRadius,u=this.endRadius,l=this.divisions,c=this.startAngle,f=this.endAngle,h=this.angleRatio,p=this.ordering,d=this.clockwise,y=this.nodeSpacing,v=this.nodeSize,g=(f-c)/n,m={};e.forEach(function(t,e){m[t.id]=e}),this.nodeMap=m;var b=(0,a.getDegree)(e.length,m,r);if(this.degrees=b,y){var x=(0,a.getFuncByUnknownType)(10,y),w=(0,a.getFuncByUnknownType)(10,v),_=-1/0;e.forEach(function(t){var e=w(t);_this.width?this.width/2:this.height/2;var E=g*h,k=[];k="topology"===p?this.topologyOrdering():"topology-directed"===p?this.topologyOrdering(!0):"degree"===p?this.degreeOrdering():e;for(var T=Math.ceil(n/l),C=0;C=0;S--)_(S);return{nodes:e,edges:r,combos:n,comboEdges:i}},e.prototype.getInnerGraphs=function(t){var e=this.comboTrees,r=this.nodeSize,n=this.edges,i=this.comboPadding,a=this.spacing,s={},c=this.innerLayout||new l.ConcentricLayout({type:"concentric",sortBy:"id"});return c.center=[0,0],c.preventOverlap=!0,c.nodeSpacing=a,(e||[]).forEach(function(e){(0,u.traverseTreeUp)(e,function(e){var a,l=(null===i||void 0===i?void 0:i(e))||10;if((0,u.isArray)(l)&&(l=Math.max.apply(Math,l)),null===(a=e.children)||void 0===a?void 0:a.length){var f=e.children.map(function(e){if("combo"===e.itemType)return s[e.id];var r=t[e.id]||{};return o(o({},r),e)}),h=f.map(function(t){return t.id}),p={nodes:f,edges:n.filter(function(t){return h.includes(t.source)&&h.includes(t.target)})},d=1/0;f.forEach(function(t){var e;t.size||(t.size=(null===(e=s[t.id])||void 0===e?void 0:e.size)||(null===r||void 0===r?void 0:r(t))||[30,30]),(0,u.isNumber)(t.size)&&(t.size=[t.size,t.size]),d>t.size[0]&&(d=t.size[0]),d>t.size[1]&&(d=t.size[1])}),c.layout(p);var y=(0,u.getLayoutBBox)(f),v=y.minX,g=y.minY,m=y.maxX,b=y.maxY,x={x:(m+v)/2,y:(b+g)/2};p.nodes.forEach(function(t){t.x-=x.x,t.y-=x.y});var w=Math.max(m-v,d)+2*l,_=Math.max(b-g,d)+2*l;s[e.id]={id:e.id,nodes:f,size:[w,_]}}else if("combo"===e.itemType){var S=l?[2*l,2*l]:[30,30];s[e.id]={id:e.id,nodes:[],size:S}}return!0})}),s},e.prototype.initVals=function(){var t,e,r=this.nodeSize,n=this.spacing;if(e=(0,u.isNumber)(n)?function(){return n}:(0,u.isFunction)(n)?n:function(){return 0},this.spacing=e,r)if((0,u.isFunction)(r))t=function(t){var n=r(t),i=e(t);return(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+i)/2:((n||10)+i)/2};else if((0,u.isArray)(r)){var i=(r[0]>r[1]?r[0]:r[1])/2;t=function(t){return i+e(t)/2}}else{var o=r/2;t=function(t){return o+e(t)/2}}else t=function(t){var r=e(t);return t.size?(0,u.isArray)(t.size)?((t.size[0]>t.size[1]?t.size[0]:t.size[1])+r)/2:(0,u.isObject)(t.size)?((t.size.width>t.size.height?t.size.width:t.size.height)+r)/2:(t.size+r)/2:10+r/2};this.nodeSize=t;var a,s=this.comboPadding;a=(0,u.isNumber)(s)?function(){return s}:(0,u.isArray)(s)?function(){return Math.max.apply(null,s)}:(0,u.isFunction)(s)?s:function(){return 0},this.comboPadding=a},e.prototype.getType=function(){return"comboCombined"},e}(s.Base);e.ComboCombinedLayout=c},5773:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.ComboForceLayout=void 0;var o=r(8933),a=r(864),s=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.maxIteration=100,r.gravity=10,r.comboGravity=10,r.linkDistance=10,r.alpha=1,r.alphaMin=.001,r.alphaDecay=1-Math.pow(r.alphaMin,1/300),r.alphaTarget=0,r.velocityDecay=.6,r.edgeStrength=.6,r.nodeStrength=30,r.preventOverlap=!1,r.preventNodeOverlap=!1,r.preventComboOverlap=!1,r.collideStrength=void 0,r.nodeCollideStrength=.5,r.comboCollideStrength=.5,r.comboSpacing=20,r.comboPadding=10,r.optimizeRangeFactor=1,r.onTick=function(){},r.onLayoutEnd=function(){},r.depthAttractiveForceScale=1,r.depthRepulsiveForceScale=2,r.nodes=[],r.edges=[],r.combos=[],r.comboTrees=[],r.width=300,r.height=300,r.bias=[],r.nodeMap={},r.oriComboMap={},r.indexMap={},r.comboMap={},r.previousLayouted=!1,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},e.prototype.execute=function(){var t=this.nodes,e=this.center;if(this.comboTree={id:"comboTreeRoot",depth:-1,children:this.comboTrees},t&&0!==t.length){if(1===t.length)return t[0].x=e[0],t[0].y=e[1],void(this.onLayoutEnd&&this.onLayoutEnd());this.initVals(),this.run(),this.onLayoutEnd&&this.onLayoutEnd()}else this.onLayoutEnd&&this.onLayoutEnd()},e.prototype.run=function(){var t=this,e=t.nodes,r=t.previousLayouted?t.maxIteration/5:t.maxIteration;t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight);var n=t.center,i=t.velocityDecay,o=t.comboMap;t.previousLayouted||t.initPos(o);for(var s=function(r){var n=[];e.forEach(function(t,e){n[e]={x:0,y:0}}),t.applyCalculate(n),t.applyComboCenterForce(n),e.forEach(function(t,e){(0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)&&(t.x+=n[e].x*i,t.y+=n[e].y*i)}),t.alpha+=(t.alphaTarget-t.alpha)*t.alphaDecay,t.onTick()},u=0;uv[1]?v[0]:v[1])/2;d=function(t){return m}}else{var b=v/2;d=function(t){return b}}else d=function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2:(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2:t.size/2:10};this.nodeSize=d;var x,w=this.comboSpacing;x=(0,a.isNumber)(w)?function(){return w}:(0,a.isFunction)(w)?w:function(){return 0},this.comboSpacing=x;var _,S=this.comboPadding;_=(0,a.isNumber)(S)?function(){return S}:(0,a.isArray)(S)?function(){return Math.max.apply(null,S)}:(0,a.isFunction)(S)?S:function(){return 0},this.comboPadding=_;var E,k=this.linkDistance;k||(k=10),E=(0,a.isNumber)(k)?function(t){return k}:k,this.linkDistance=E;var T,C=this.edgeStrength;C||(C=1),T=(0,a.isNumber)(C)?function(t){return C}:C,this.edgeStrength=T;var O,A=this.nodeStrength;A||(A=30),O=(0,a.isNumber)(A)?function(t){return A}:A,this.nodeStrength=O},e.prototype.initPos=function(t){this.nodes.forEach(function(e,r){var n=e.comboId,i=t[n];n&&i?(e.x=i.cx+100/(r+1),e.y=i.cy+100/(r+1)):(e.x=100/(r+1),e.y=100/(r+1))})},e.prototype.getComboMap=function(){var t=this,e=t.nodeMap,r=t.comboTrees,n=t.oriComboMap,i={};return(r||[]).forEach(function(r){var o=[];(0,a.traverseTreeUp)(r,function(r){if("node"===r.itemType)return!0;if(!n[r.id])return!0;if(void 0===i[r.id]){var s={id:r.id,name:r.id,cx:0,cy:0,count:0,depth:t.oriComboMap[r.id].depth||0,children:[]};i[r.id]=s}var u=r.children;u&&u.forEach(function(t){if(!i[t.id]&&!e[t.id])return!0;o.push(t)});var l=i[r.id];if(l.cx=0,l.cy=0,0===o.length){l.empty=!0;var c=n[r.id];l.cx=c.x,l.cy=c.y}return o.forEach(function(t){if(l.count++,"node"!==t.itemType){var r=i[t.id];return(0,a.isNumber)(r.cx)&&(l.cx+=r.cx),void((0,a.isNumber)(r.cy)&&(l.cy+=r.cy))}var n=e[t.id];n&&((0,a.isNumber)(n.x)&&(l.cx+=n.x),(0,a.isNumber)(n.y)&&(l.cy+=n.y))}),l.cx/=l.count||1,l.cy/=l.count||1,l.children=o,!0})}),i},e.prototype.applyComboCenterForce=function(t){var e=this.gravity,r=this.comboGravity||e,n=this.alpha,i=this.comboTrees,o=this.indexMap,s=this.nodeMap,u=this.comboMap;(i||[]).forEach(function(e){(0,a.traverseTreeUp)(e,function(e){if("node"===e.itemType)return!0;if(!u[e.id])return!0;var i=u[e.id],l=(i.depth+1)/10*.5,c=i.cx,f=i.cy;return i.cx=0,i.cy=0,i.children.forEach(function(e){if("node"!==e.itemType){var h=u[e.id];return h&&(0,a.isNumber)(h.cx)&&(i.cx+=h.cx),void(h&&(0,a.isNumber)(h.cy)&&(i.cy+=h.cy))}var p=s[e.id],d=p.x-c||.005,y=p.y-f||.005,v=Math.sqrt(d*d+y*y),g=o[p.id],m=r*n/v*l;t[g].x-=d*m,t[g].y-=y*m,(0,a.isNumber)(p.x)&&(i.cx+=p.x),(0,a.isNumber)(p.y)&&(i.cy+=p.y)}),i.cx/=i.count||1,i.cy/=i.count||1,!0})})},e.prototype.applyCalculate=function(t){var e=this.comboMap,r=this.nodes,n={};r.forEach(function(t,e){r.forEach(function(r,i){if(!(eo&&(l.minX=o),l.minY>a&&(l.minY=a),l.maxX1&&a.forEach(function(r,s){if("node"===r.itemType)return!1;var u=e[r.id];u&&a.forEach(function(a,l){if(s<=l)return!1;if("node"===a.itemType)return!1;var c=e[a.id];if(!c)return!1;var f=u.cx-c.cx||.005,h=u.cy-c.cy||.005,p=f*f+h*h,d=u.r||1,y=c.r||1,v=d+y,g=y*y,m=d*d;if(pi)){var g=e["".concat(p.id,"-").concat(r.id)],m=g.vx,b=g.vy,x=Math.log(Math.abs(r.depth-p.depth)/10)+1||1;x=x<1?1:x,r.comboId!==p.comboId&&(x+=1);var w=x?Math.pow(f,x):1,_=o(r)*a/y*w;if(t[d].x+=m*_,t[d].y+=b*_,d0){var e=Math.abs(g[0][r.sortBy]-t[r.sortBy]);r.maxLevelDiff&&e>=r.maxLevelDiff&&(g=[],v.push(g))}g.push(t)});var m=u+(h||r.minNodeSpacing);if(!r.preventOverlap){var b=v.length>0&&v[0].length>1,x=(Math.min(r.width,r.height)/2-m)/(v.length+(b?1:0));m=Math.min(m,x)}var w=0;if(v.forEach(function(t){var e=r.sweep;void 0===e&&(e=2*Math.PI-2*Math.PI/t.length);var n=t.dTheta=e/Math.max(1,t.length-1);if(t.length>1&&r.preventOverlap){var i=Math.cos(n)-Math.cos(0),o=Math.sin(n)-Math.sin(0),a=Math.sqrt(m*m/(i*i+o*o));w=Math.max(a,w)}t.r=w,w+=m}),r.equidistant){for(var _=0,S=0,E=0;Ee.x&&(L=e.x),j>e.y&&(j=e.y)}),w.edges().forEach(function(t){var e;null===(e=w.edge(t).points)||void 0===e||e.forEach(function(t){L>t.x&&(L=t.x),j>t.y&&(j=t.y)})}),I[0]=d[0]-L,I[1]=d[1]-j}var N="LR"===h||"RL"===h;if(y){var R=this.focusNode,D=this.ranksep,B=this.getRadialPos,F=(0,s.isString)(R)?R:null===R||void 0===R?void 0:R.id,z=F?null===(n=w.node(F))||void 0===n?void 0:n._rank:0,G=[],U=N?"y":"x",V=N?"height":"width",H=1/0,W=-1/0;w.nodes().forEach(function(t){var e=w.node(t);if(o.nodeMap[t]){var r=C(o.nodeMap[t]);if(0===z)G[e._rank]||(G[e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),G[e._rank].nodes.push(t),G[e._rank].totalWidth+=2*r+e[V],G[e._rank].maxSizeW&&(W=s)}});var q=D||50,Y={},X=(W-H)/.9,Z=[.5*(H+W-X),.5*(H+W+X)],K=function(t,e,r,n){void 0===r&&(r=-1/0),void 0===n&&(n=[0,1]);var i=r;return t.forEach(function(t){var r=w.node(t);Y[t]=e;var a=B(r[U],Z,X,e,n),s=a.x,u=a.y;if(o.nodeMap[t]){o.nodeMap[t].x=s+I[0],o.nodeMap[t].y=u+I[1],o.nodeMap[t]._order=r._order;var l=T(o.nodeMap[t]);i=i})}:function(t,e,r){var n=Math.max(e.x,r.x),i=Math.min(e.x,r.x);return t.filter(function(t){return t.x<=n&&t.x>=i})};w.edges().forEach(function(t){var e,r=w.edge(t),n=x.findIndex(function(e){var r=(0,s.getEdgeTerminal)(e,"source"),n=(0,s.getEdgeTerminal)(e,"target");return r===t.v&&n===t.w});if(!(n<=-1)&&o.edgeLabelSpace&&o.controlPoints&&"loop"!==x[n].type){null===(e=null===r||void 0===r?void 0:r.points)||void 0===e||e.forEach(function(t){t.x+=I[0],t.y+=I[1]});var i=o.nodeMap[t.v],a=o.nodeMap[t.w];x[n].controlPoints=f(null===r||void 0===r?void 0:r.points,i,a,tt,N,et,rt)}})}return o.onLayoutEnd&&o.onLayoutEnd(),{nodes:u,edges:x}}},e.prototype.getRadialPos=function(t,e,r,n,i){void 0===i&&(i=[0,1]);var o=(t-e[0])/r,a=2*(o=o*(i[1]-i[0])+i[0])*Math.PI;return{x:Math.cos(a)*n,y:Math.sin(a)*n}},e.prototype.getType=function(){return"dagre"},e}(u.Base);e.DagreLayout=c;var f=function(t,e,r,n,i,o,a){var s=(null===t||void 0===t?void 0:t.slice(1,t.length-1))||[];if(e&&r){var u=e.x,l=e.y,c=r.x,f=r.y;if(i&&(u=e.y,l=e.x,c=r.y,f=r.x),f!==l&&u!==c){var h=n.indexOf(l),p=n[h+1];if(p){var d=s[0],y=i?{x:(l+p)/2,y:(null===d||void 0===d?void 0:d.y)||c}:{x:(null===d||void 0===d?void 0:d.x)||c,y:(l+p)/2};d&&!o(d,y)||s.unshift(y)}var v=n.indexOf(f),g=Math.abs(v-h);if(1===g)(s=a(s,e,r)).length||s.push(i?{x:(l+f)/2,y:u}:{x:u,y:(l+f)/2});else if(g>1){var m=n[v-1];if(m){var b=s[s.length-1],x=i?{x:(f+m)/2,y:(null===b||void 0===b?void 0:b.y)||c}:{x:(null===b||void 0===b?void 0:b.x)||u,y:(f+m)/2};b&&!o(b,x)||s.push(x)}}}}return s}},6006:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__assign||function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;rt.x&&(i=t.x),o>t.y&&(o=t.y)}),e.forEach(function(t){t.points.forEach(function(t){i>t.x&&(i=t.x),o>t.y&&(o=t.y)})}),n[0]=r[0]-i,n[1]=r[1]-o}return n},e.prototype.updateNodePosition=function(t,e){var r=this.combos,n=this.nodes,i=this.edges,o=this.anchorPoint,a=this.graphSettings,s=this.getBegin(t,e);t.forEach(function(t){var l,c=t.x,f=t.y,h=t.id,p=t.type,d=t.coreBox;if(p===u.HierarchyNodeType.META&&h!==u.ROOT_NAME){var y=r.findIndex(function(t){return t.id===h}),v=null===(l=null===a||void 0===a?void 0:a.subScene)||void 0===l?void 0:l.meta;r[y].offsetX=c+s[0],r[y].offsetY=f+s[1],r[y].fixSize=[d.width,d.height],r[y].fixCollapseSize=[d.width,d.height],t.expanded?r[y].padding=[null===v||void 0===v?void 0:v.paddingTop,null===v||void 0===v?void 0:v.paddingRight,null===v||void 0===v?void 0:v.paddingBottom,null===v||void 0===v?void 0:v.paddingLeft]:r[y].padding=[0,0,0,0]}else if(p===u.HierarchyNodeType.OP){y=n.findIndex(function(t){return t.id===h});if(n[y].x=c+s[0],n[y].y=f+s[1],o){var g=[],m=e.filter(function(t){return t.v===h}),b=e.filter(function(t){return t.w===h});m.length>0&&m.forEach(function(e){var r=e.points[0],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;g.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.sourceAnchor=g.length-1)})}),b.length>0&&b.forEach(function(e){var r=e.points[e.points.length-1],n=(r.x-c)/t.width+.5,o=(r.y-f)/t.height+.5;g.push([n,o]),e.baseEdgeList.forEach(function(t){var e=i.find(function(e){return e.source===t.v&&e.target===t.w});e&&(e.targetAnchor=g.length-1)})}),n[y].anchorPoints=g.length>0?g:n[y].anchorPoints||[]}}})},e.prototype.updateEdgePosition=function(t,e){var r=this,n=r.combos,i=r.edges,s=r.controlPoints,l=this.getBegin(t,e);s&&(n.forEach(function(t){t.inEdges=[],t.outEdges=[]}),i.forEach(function(e){var i,s,c,f,h=t.find(function(t){return t.id===e.source}),p=t.find(function(t){return t.id===e.target}),d=[],y=[];if(h&&p)y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t);else if(!h||!p){var v=r.getNodePath(e.source),g=r.getNodePath(e.target),m=v.reverse().slice(h?0:1).find(function(e){return t.find(function(t){return t.id===e})}),b=g.reverse().slice(p?0:1).find(function(e){return t.find(function(t){return t.id===e})});h=t.find(function(t){return t.id===m}),p=t.find(function(t){return t.id===b}),y=(0,u.getEdges)(null===h||void 0===h?void 0:h.id,null===p||void 0===p?void 0:p.id,t,{v:e.source,w:e.target})}if(d=(d=y.reduce(function(t,e){return a(a([],t,!0),e.points.map(function(t){return o(o({},t),{x:t.x+l[0],y:t.y+l[1]})}),!0)},[])).slice(1,-1),e.controlPoints=d,(null===p||void 0===p?void 0:p.type)===u.NodeType.META){var x=n.findIndex(function(t){return t.id===(null===p||void 0===p?void 0:p.id)});if(!n[x]||(null===(i=n[x].inEdges)||void 0===i?void 0:i.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(s=n[x].inEdges)||void 0===s||s.push({source:h.id,target:p.id,controlPoints:d})}if((null===h||void 0===h?void 0:h.type)===u.NodeType.META){x=n.findIndex(function(t){return t.id===(null===h||void 0===h?void 0:h.id)});if(!n[x]||(null===(c=n[x].outEdges)||void 0===c?void 0:c.some(function(t){return t.source===h.id&&t.target===p.id})))return;null===(f=n[x].outEdges)||void 0===f||f.push({source:h.id,target:p.id,controlPoints:d})}}))},e.prototype.getType=function(){return"dagreCompound"},e.prototype.getDataByOrder=function(t){return t.every(function(t){return void 0!==t.layoutOrder})||t.forEach(function(t,e){t.layoutOrder=e}),t.sort(function(t,e){return t.layoutOrder-e.layoutOrder})},e}(s.Base);e.DagreCompoundLayout=c},4804:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e}(r(288).Graph);e.Graph=o},2016:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(2731)),o=r(2929);e.default={layout:i.default,util:{time:o.time,notime:o.notime}}},9441:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(4818)),o=function(t){var e=[],r={},n={};return t.nodes().forEach(function i(o){var a;n[o]||(n[o]=!0,r[o]=!0,null===(a=t.outEdges(o))||void 0===a||a.forEach(function(t){r[t.w]?e.push(t):i(t.w)}),delete r[o])}),e};e.default={run:function(t){var e="greedy"===t.graph().acyclicer?(0,i.default)(t,function(t){return function(e){var r;return(null===(r=t.edge(e))||void 0===r?void 0:r.weight)||1}}(t)):o(t);null===e||void 0===e||e.forEach(function(e){var r=t.edge(e);t.removeEdgeObj(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,"rev-".concat(Math.random()))})},undo:function(t){t.edges().forEach(function(e){var r=t.edge(e);if(r.reversed){t.removeEdgeObj(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}}},3868:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2929),i=function(t,e,r,i,o,a){var s={rank:a,borderType:e,width:0,height:0},u=o[e][a-1],l=(0,n.addDummyNode)(t,"border",s,r);o[e][a]=l,t.setParent(l,i),u&&t.setEdge(u,l,{weight:1})};e.default=function(t){var e;null===(e=t.children())||void 0===e||e.forEach(function(e){return function e(r){var n=t.children(r),o=t.node(r);if((null===n||void 0===n?void 0:n.length)&&n.forEach(function(t){return e(t)}),o.hasOwnProperty("minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,s=o.maxRank+1;a0;--s)if(n=e[s].dequeue()){i=i.concat(h(t,e,r,n,!0));break}}return i},h=function(t,e,r,n,i){var o,a,s=[];return null===(o=t.inEdges(n.v))||void 0===o||o.forEach(function(n){var o=t.edge(n),a=t.node(n.v);i&&s.push({v:n.v,w:n.w,in:0,out:0}),void 0===a.out&&(a.out=0),a.out-=o,d(e,r,a)}),null===(a=t.outEdges(n.v))||void 0===a||a.forEach(function(n){var i=t.edge(n),o=n.w,a=t.node(o);void 0===a.in&&(a.in=0),a.in-=i,d(e,r,a)}),t.removeNode(n.v),i?s:void 0},p=function(t,e){var r=new l,n=0,i=0;t.nodes().forEach(function(t){r.setNode(t,{v:t,in:0,out:0})}),t.edges().forEach(function(t){var o=r.edge(t)||0,a=(null===e||void 0===e?void 0:e(t))||1,s=o+a;r.setEdge(t.v,t.w,s),i=Math.max(i,r.node(t.v).out+=a),n=Math.max(n,r.node(t.w).in+=a)});for(var o=[],a=i+n+3,s=0;s0;)e%2&&(r+=u[e+1]),u[e=e-1>>1]+=t.weight;l+=t.weight*r}}),l};e.default=function(t,e){for(var r=0,n=1;n<(null===e||void 0===e?void 0:e.length);n+=1)r+=i(t,e[n-1],e[n]);return r}},1422:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9987)),o=n(r(1100)),a=n(r(7611)),s=n(r(9285)),u=n(r(5959)),l=r(864),c=r(4804),f=r(2929),h=function(t,e,r){return e.map(function(e){return(0,a.default)(t,e,r)})},p=function(t,e,r,n){var i=new c.Graph;null===t||void 0===t||t.forEach(function(t){for(var o,a=t.graph().root,l=(0,u.default)(t,a,i,e,r,n),c=0;c<(null===(o=l.vs)||void 0===o?void 0:o.length);c++){var f=t.node(l.vs[c]);f&&(f.order=c)}(0,s.default)(t,i,l.vs)})},d=function(t,e){null===e||void 0===e||e.forEach(function(e){null===e||void 0===e||e.forEach(function(e,r){t.node(e).order=r})})};e.default=function(t,e){for(var r=(0,f.maxRank)(t),n=[],a=[],s=1;s-1;s--)a.push(s);var u=h(t,n,"inEdges"),c=h(t,a,"outEdges"),y=(0,i.default)(t);d(t,y);for(var v,g=Number.POSITIVE_INFINITY,m=(s=0,0);m<4;++s,++m)p(s%2?u:c,s%4>=2,!1,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y))=2,!0,e),y=(0,f.buildLayerMatrix)(t),(b=(0,o.default)(t,y))=e.barycenter)&&n(e,t)})(t);var e}),null===(r=o.out)||void 0===r||r.forEach(function(e){return(r=o,function(e){e.in.push(r),0==--e.indegree&&t.push(e)})(e);var r})};null===t||void 0===t?void 0:t.length;)o();var a=["vs","i","barycenter","weight"];return i.filter(function(t){return!t.merged}).map(function(t){var e={};return null===a||void 0===a||a.forEach(function(r){void 0!==t[r]&&(e[r]=t[r])}),e})},n=function(t,e){var r,n=0,i=0;t.weight&&(n+=t.barycenter*t.weight,i+=t.weight),e.weight&&(n+=e.barycenter*e.weight,i+=e.weight),t.vs=null===(r=e.vs)||void 0===r?void 0:r.concat(t.vs),t.barycenter=n/i,t.weight=i,t.i=Math.min(e.i,t.i),e.merged=!0};e.default=function(t,e){var n,i,o,a={};null===t||void 0===t||t.forEach(function(t,e){a[t.v]={i:e,indegree:0,in:[],out:[],vs:[t.v]};var r=a[t.v];void 0!==t.barycenter&&(r.barycenter=t.barycenter,r.weight=t.weight)}),null===(n=e.edges())||void 0===n||n.forEach(function(t){var e=a[t.v],r=a[t.w];void 0!==e&&void 0!==r&&(r.indegree++,e.out.push(a[t.w]))});var s=null===(o=(i=Object.values(a)).filter)||void 0===o?void 0:o.call(i,function(t){return!t.indegree});return r(s)}},5959:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(4561)),o=n(r(7396)),a=n(r(572)),s=function(t,e){null===t||void 0===t||t.forEach(function(t){var r,n=null===(r=t.vs)||void 0===r?void 0:r.map(function(t){return e[t]?e[t].vs:t});t.vs=n.flat()})},u=function(t,e){void 0!==t.barycenter?(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight):(t.barycenter=e.barycenter,t.weight=e.weight)};e.default=function t(e,r,n,l,c,f){var h,p,d,y,v=e.children(r),g=e.node(r),m=g?g.borderLeft:void 0,b=g?g.borderRight:void 0,x={};m&&(v=null===v||void 0===v?void 0:v.filter(function(t){return t!==m&&t!==b}));var w=(0,i.default)(e,v||[]);null===w||void 0===w||w.forEach(function(r){var i;if(null===(i=e.children(r.v))||void 0===i?void 0:i.length){var o=t(e,r.v,n,l,f);x[r.v]=o,o.hasOwnProperty("barycenter")&&u(r,o)}});var _=(0,o.default)(w,n);s(_,x),null===(h=_.filter(function(t){return t.vs.length>0}))||void 0===h||h.forEach(function(t){var r=e.node(t.vs[0]);r&&(t.fixorder=r.fixorder,t.order=r.order)});var S=(0,a.default)(_,l,c,f);if(m&&(S.vs=[m,S.vs,b].flat(),null===(p=e.predecessors(m))||void 0===p?void 0:p.length)){var E=e.node((null===(d=e.predecessors(m))||void 0===d?void 0:d[0])||""),k=e.node((null===(y=e.predecessors(b))||void 0===y?void 0:y[0])||"");S.hasOwnProperty("barycenter")||(S.barycenter=0,S.weight=0),S.barycenter=(S.barycenter*S.weight+E.order+k.order)/(S.weight+2),S.weight+=2}return S}},572:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2929),i=function(t,e,r){for(var n,i=r;e.length&&(n=e[e.length-1]).i<=i;)e.pop(),null===t||void 0===t||t.push(n.vs),i++;return i},o=function(t,e){return function(r,n){if(void 0!==r.fixorder&&void 0!==n.fixorder)return r.fixorder-n.fixorder;if(r.barycentern.barycenter)return 1;if(e&&void 0!==r.order&&void 0!==n.order){if(r.ordern.order)return 1}return t?n.i-r.i:r.i-n.i}};e.default=function(t,e,r,a){var s=(0,n.partition)(t,function(t){var e=t.hasOwnProperty("fixorder")&&!isNaN(t.fixorder);return a?!e&&t.hasOwnProperty("barycenter"):e||t.hasOwnProperty("barycenter")}),u=s.lhs,l=s.rhs.sort(function(t,e){return-t.i- -e.i}),c=[],f=0,h=0,p=0;null===u||void 0===u||u.sort(o(!!e,!!r)),p=i(c,l,p),null===u||void 0===u||u.forEach(function(t){var e;p+=null===(e=t.vs)||void 0===e?void 0:e.length,c.push(t.vs),f+=t.barycenter*t.weight,h+=t.weight,p=i(c,l,p)});var d={vs:c.flat()};return h&&(d.barycenter=f/h,d.weight=h),d}},8011:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e,r=function(t){var e,r={},n=0;return null===(e=t.children())||void 0===e||e.forEach(function e(i){var o,a=n;null===(o=t.children(i))||void 0===o||o.forEach(e),r[i]={low:a,lim:n++}}),r}(t);null===(e=t.graph().dummyChains)||void 0===e||e.forEach(function(e){var n,i,o=e,a=t.node(o),s=a.edgeObj;if(s)for(var u=function(t,e,r,n){var i,o,a=[],s=[],u=Math.min(e[r].low,e[n].low),l=Math.max(e[r].lim,e[n].lim);i=r;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||l>e[i].lim));for(o=i,i=n;i&&i!==o;)s.push(i),i=t.parent(i);return{lca:o,path:a.concat(s.reverse())}}(t,r,s.v,s.w),l=u.path,c=u.lca,f=0,h=l[f],p=!0;o!==s.w;){if(a=t.node(o),p){for(;h!==c&&(null===(n=t.node(h))||void 0===n?void 0:n.maxRank)s)&&(0,e.addConflict)(n,r,c)}))}.apply(void 0,r),i.set(o,!0))}return(null===r||void 0===r?void 0:r.length)&&r.reduce(function(e,r){var n,o=-1,a=0,s=new Map;return null===r||void 0===r||r.forEach(function(u,l){var c;if("border"===(null===(c=t.node(u))||void 0===c?void 0:c.dummy)){var f=t.predecessors(u)||[];f.length&&(n=t.node(f[0]).order,i([r,a,l,o,n],s),a=l,o=n)}i([r,a,r.length,n,e.length],s)}),r}),n};e.findOtherInnerSegmentNode=function(t,e){var r,n;if(null===(r=t.node(e))||void 0===r?void 0:r.dummy)return null===(n=t.predecessors(e))||void 0===n?void 0:n.find(function(e){return t.node(e).dummy})};e.addConflict=function(t,e,r){var n=e,i=r;if(n>i){var o=n;n=i,i=o}var a=t[n];a||(t[n]=a={}),a[i]=!0};e.hasConflict=function(t,e,r){var n=e;n>r&&(n=r);return!!t[n]};e.verticalAlignment=function(t,r,n,i){var o={},a={},s={};return null===r||void 0===r||r.forEach(function(t){null===t||void 0===t||t.forEach(function(t,e){o[t]=t,a[t]=t,s[t]=e})}),null===r||void 0===r||r.forEach(function(t){var r=-1;null===t||void 0===t||t.forEach(function(t){var u=i(t);if(u.length)for(var l=((u=u.sort(function(t,e){return s[t]-s[e]})).length-1)/2,c=Math.floor(l),f=Math.ceil(l);c<=f;++c){var h=u[c];a[t]===t&&ru.lim&&(l=u,c=!0);var f=e.edges().filter(function(e){return c===p(t,t.node(e.v),l)&&c!==p(t,t.node(e.w),l)});return(0,o.minBy)(f,function(t){return(0,i.slack)(e,t)})};e.exchangeEdges=function(t,r,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),(0,e.initLowLimValues)(t),(0,e.initCutValues)(t,r),f(t,r)};var f=function(t,e){var r=t.nodes().find(function(t){var r;return!(null===(r=e.node(t))||void 0===r?void 0:r.parent)}),n=s(t,r);null===(n=null===n||void 0===n?void 0:n.slice(1))||void 0===n||n.forEach(function(r){var n=t.node(r).parent,i=e.edgeFromArgs(r,n),o=!1;i||(i=e.edgeFromArgs(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})},h=function(t,e,r){return t.hasEdge(e,r)},p=function(t,e,r){return r.low<=e.lim&&e.lim<=r.lim};e.default=function(t){var r=(0,o.simplify)(t);(0,i.longestPath)(r);var a,s,u=(0,n.feasibleTree)(r);for((0,e.initLowLimValues)(u),(0,e.initCutValues)(u,r);a=(0,e.leaveEdge)(u);)s=(0,e.enterEdge)(u,r,a),(0,e.exchangeEdges)(u,r,a,s)}},4166:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.slack=e.longestPathWithLayer=e.longestPath=void 0;var r=function(t){var e,r={};null===(e=t.sources())||void 0===e||e.forEach(function(e){return function e(n){var i,o,a=t.node(n);return a?r[n]?a.rank:(r[n]=!0,null===(i=t.outEdges(n))||void 0===i||i.forEach(function(r){var n=e(r.w)-t.edge(r).minlen;n&&(void 0===o||nMath.abs(a)*l?(s<0&&(l=-l),r=l*a/s,n=l):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}):{x:0,y:0}};e.buildLayerMatrix=function(t){for(var r=[],n=(0,e.maxRank)(t)+1,i=0;ie)&&(e=i)}),e||(e=0),e};e.partition=function(t,e){var r={lhs:[],rhs:[]};return null===t||void 0===t||t.forEach(function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r};e.time=function(t,e){var r=Date.now();try{return e()}finally{console.log("".concat(t," time: ").concat(Date.now()-r,"ms"))}};e.notime=function(t,e){return e()};e.minBy=function(t,e){return t.reduce(function(t,r){return e(t)>e(r)?r:t})}},4077:function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1){var e=n({},t);delete e.size,s.push(e)}});var h=[];i.forEach(function(t){var e=s.find(function(e){return e.id===t.source}),r=s.find(function(e){return e.id===t.target});e&&r&&h.push(t)});var p=new f.DagreLayout({type:"dagre",ranksep:e.nodeMinGap,nodesep:e.nodeMinGap}).layout({nodes:s,edges:h}).nodes;r.forEach(function(t){var e=(p||[]).find(function(e){return e.id===t.id});t.x=(null===e||void 0===e?void 0:e.x)||o/2,t.y=(null===e||void 0===e?void 0:e.y)||a/2});var d=JSON.parse(JSON.stringify(r)),y=JSON.parse(JSON.stringify(i)),v=u.forceSimulation().nodes(d).force("link",u.forceLink(y).id(function(t){return t.id}).distance(function(t){return h.find(function(e){return e.source===t.source&&e.target===t.target})?30:20})).force("charge",u.forceManyBody()).force("center",u.forceCenter(o/2,a/2)).force("x",u.forceX(o/2)).force("y",u.forceY(a/2)).alpha(.3).alphaDecay(.08).alphaMin(.001);return new Promise(function(t){v.on("end",function(){r.forEach(function(t){var e=d.find(function(e){return e.id===t.id});e&&(t.x=e.x,t.y=e.y)});var n=Math.min.apply(Math,r.map(function(t){return t.x})),s=Math.max.apply(Math,r.map(function(t){return t.x})),u=Math.min.apply(Math,r.map(function(t){return t.y})),f=Math.max.apply(Math,r.map(function(t){return t.y})),h=o/(s-n),p=a/(f-u);r.forEach(function(t){void 0!==t.x&&h<1&&(t.x=(t.x-n)*h),void 0!==t.y&&p<1&&(t.y=(t.y-u)*p)}),r.forEach(function(t){t.sizeTemp=t.size,t.size=[10,10]}),(0,c.default)(r,i),r.forEach(function(t){t.size=t.sizeTemp||[],delete t.sizeTemp}),(0,l.default)({nodes:r,edges:i},e),t()})})}},5791:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(2558));e.default=function(t,e){if(!t.nodes||0===t.nodes.length)return t;var r=e.width,n=e.height,o=e.nodeMinGap,a=1e4,s=1e4;t.nodes.forEach(function(t){var e=t.size[0]||50,r=t.size[1]||50;a=Math.min(e,a),s=Math.min(r,s)});var u=new i.default;u.init(r,n,{CELL_H:s,CELL_W:a}),t.nodes.forEach(function(t){var e=u.occupyNearest(t);e&&(e.node={id:t.id,size:t.size},t.x=e.x,t.y=e.y,t.dx=e.dx,t.dy=e.dy)});for(var l=0;la){for(var d=v=Math.ceil((c.size[0]+o)/a)-1,y=0;y-1&&!u.cells[h+y+1][p].node);y++)d--;u.insertColumn(h,d)}if(c.size[1]+o>s){var v;for(d=v=Math.ceil((c.size[1]+o)/s)-1,y=0;y-1&&!u.cells[h][p+y+1].node);y++)d--;u.insertRow(p,d)}}for(l=0;lt;n--)for(i=0;i=t&&(this.additionColumn[i]+=e);for(n=0;nt;n--)this.cells[i][n+e]=r(r({},this.cells[i][n]),{dx:i,dy:n+e,x:i*this.CELL_W,y:(n+e)*this.CELL_H}),this.cells[i][n]={dx:i,dy:n,x:i*this.CELL_W,y:n*this.CELL_H,occupied:!1,node:null};for(n=0;n=t&&(this.additionRow[n]+=e);for(i=0;ia?e:t,h=n>a?t:e,p=f.x-f.size[0]/2,d=f.y-f.size[1]/2,y=f.x+f.size[0]/2,v=f.y+f.size[1]/2,g=h.x-h.size[0]/2,m=h.y-h.size[1]/2,b=h.x+h.size[0]/2,x=h.y+h.size[1]/2,w=f.x,_=f.y,S=h.x,E=h.y,k=0,T=0;if(y>=g&&b>=p&&v>=m&&x>=d){0===(T=Math.sqrt(Math.pow(S-w,2)+Math.pow(E-_,2)))&&(T=1e-7),k=1*o/T*100+((yg?p:g))*((vm?d:m)),k*=i}else{var C=!1,O=function(t,e,r){var n=t.x-t.size[0]/2,i=t.y-t.size[1]/2,o=t.x+t.size[0]/2,a=t.y+t.size[1]/2,c=e.x-e.size[0]/2,f=e.y-e.size[1]/2,h=e.x+e.size[0]/2,p=e.y+e.size[1]/2,d=t.x,y=t.y,v=e.x,g=e.y,m=v-d,b=Math.atan2(m,g-y),x=0,w=0,_=0,S=0;b>s?(w=i-p,x=c-o,_=parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)),S=parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2))):_=S=0(x=c-o)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):b<-s?(w=i-p)>(x=-(h-n))?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x?(x/Math.sin(b)).toFixed(2):w.toFixed(2)):(w=f-a)>(x=Math.abs(m)>(o-n)/2?n-h:m)?parseFloat(w?(w/Math.cos(b)).toFixed(2):x.toFixed(2)):parseFloat(x&&0!==b?(x/Math.sin(b)).toFixed(2):w.toFixed(2));var E=parseFloat(b.toFixed(2)),k=r;return r&&(k=ur||o.y>n)&&(e+=1e12);for(var a=i+1;a150)&&!(c<30||c>150)||l*c<0){a=!1;break}if(l>70&&l<110&&!(c>70&&c<110)||l*c<0){a=!1;break}if((u.x-t.x)*(u.x-e.x)<0){a=!1;break}if((u.y-t.y)*(u.y-e.y)<0){a=!1;break}}return a}function b(t,e){for(var r=!1,n=1*f,i=1*h,o=[n,-n,0,0],a=[0,0,i,-i],s=0;sd?(l=v,r=!0):(u.x-=o[c],u.y-=a[c])}}return p>d&&(p*=y),r?g(t):0}function x(t,e){var i=0;(t.x<0||t.y<0||t.x+t.size[0]+20>r||t.y+t.size[1]+20>n)&&(i+=1e12);for(var o=0;o0&&!(++a>=50);){var s=b(t,e);0!==s&&(o=s),i=o-r,r=o,0===i?--n:n=20}return t.forEach(function(t){t.x=t.x-t.size[0]/2,t.y=t.y-t.size[1]/2}),{nodes:t,edges:e}}},7333:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.forceNBody=void 0;var n=r(3487);function i(t){var e=0,r=0,n=0;if(t.length){for(var i=0;i<4;i++){(o=t[i])&&o.weight&&(e+=o.weight,r+=o.x*o.weight,n+=o.y*o.weight)}t.x=r/e,t.y=n/e,t.weight=e}else{var o=t;t.x=o.data.x,t.y=o.data.y,t.weight=o.data.weight}}e.forceNBody=function(t,e,r,a,s){var u=r/a,l=t.map(function(t,r){var n=e[t.id],i=n.data,o=n.x,a=n.y,s=n.size,l=i.layout.force.nodeStrength;return{x:o,y:a,size:s,index:r,vx:0,vy:0,weight:u*l}}),c=(0,n.quadtree)(l,function(t){return t.x},function(t){return t.y}).visitAfter(i);return l.forEach(function(t){!function(t,e){e.visit(function(e,r,n,i,a){return o(e,r,n,i,a,t)})}(t,c)}),l.map(function(r,n){var i=e[t[n].id].data.layout.force.mass,o=void 0===i?1:i;s[2*n]=r.vx/o,s[2*n+1]=r.vy/o}),s};var o=function(t,e,r,n,i,o){var a=o.x-t.x||.1,s=o.y-t.y||.1,u=n-e,l=a*a+s*s,c=Math.sqrt(l)*l;if(u*u*.811&&(o=(0,s.getAvgNodePosition)(l))}else o=void 0;return{x:null===o||void 0===o?void 0:o.x,y:null===o||void 0===o?void 0:o.y}}}}if(n){t||(t=this.getSameTypeLeafMap());var p={};Array.from(new Set(a.map(function(t,e){return t[i]}))).filter(function(t){return void 0!==t}).forEach(function(t){var e=a.filter(function(e){return e[i]===t}).map(function(t){return u[t.id]});p[t]=(0,s.getAvgNodePosition)(e)}),f={single:function(t){return c(t)},leaf:function(t){return c(t)},others:function(t){return c(t)},center:function(t,e,r){var n=p[t[i]];return{x:null===n||void 0===n?void 0:n.x,y:null===n||void 0===n?void 0:n.y}}}}this.centripetalOptions=o(o({},this.centripetalOptions),f);var d=this.centripetalOptions,y=d.leaf,v=d.single,g=d.others;y&&"function"!=typeof y&&(this.centripetalOptions.leaf=function(){return y}),v&&"function"!=typeof v&&(this.centripetalOptions.single=function(){return v}),g&&"function"!=typeof g&&(this.centripetalOptions.others=function(){return g})},e.prototype.updateCfg=function(t){t&&Object.assign(this,t)},e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t=this;t.stop();var e=t.nodes,r=t.edges,n=t.defSpringLen;if(t.judgingDistance=0,e&&0!==e.length){t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),t.center||(t.center=[t.width/2,t.height/2]);var i=t.center;if(1===e.length)return e[0].x=i[0],e[0].y=i[1],void t.onLayoutEnd([o({},e[0])]);t.degreesMap=(0,s.getDegreeMap)(e,r),t.propsGetMass?t.getMass=t.propsGetMass:t.getMass=function(e){var r=1;(0,s.isNumber)(e.mass)&&(r=e.mass);var n=t.degreesMap[e.id].all;return!n||n<5?r:5*n*r};var a,u=t.nodeSize;if(t.preventOverlap){var c,f=t.nodeSpacing;c=(0,s.isNumber)(f)?function(){return f}:(0,s.isFunction)(f)?f:function(){return 0},a=u?(0,s.isArray)(u)?function(t){return Math.max(u[0],u[1])+c(t)}:function(t){return u+c(t)}:function(t){return t.size?(0,s.isArray)(t.size)?Math.max(t.size[0],t.size[1])+c(t):(0,s.isObject)(t.size)?Math.max(t.size.width,t.size.height)+c(t):t.size+c(t):10+c(t)}}t.nodeSize=a,t.linkDistance=l(t.linkDistance,1),t.nodeStrength=l(t.nodeStrength,1),t.edgeStrength=l(t.edgeStrength,1);var h={},p={};e.forEach(function(e,n){(0,s.isNumber)(e.x)||(e.x=Math.random()*t.width),(0,s.isNumber)(e.y)||(e.y=Math.random()*t.height);var i=t.degreesMap[e.id];h[e.id]=o(o({},e),{data:o(o({},e.data),{size:t.nodeSize(e)||30,layout:{inDegree:i.in,outDegree:i.out,degree:i.all,tDegree:i.in,sDegree:i.out,force:{mass:t.getMass(e),nodeStrength:t.nodeStrength(e,r)}}})}),p[e.id]=n}),t.nodeMap=h,t.nodeIdxMap=p,t.edgeInfos=[],null===r||void 0===r||r.forEach(function(e){var r=h[e.source],i=h[e.target];r&&i?t.edgeInfos.push({edgeStrength:t.edgeStrength(e),linkDistance:n?n(o(o({},e),{source:r,target:i}),r,i):t.linkDistance(e,r,i)||1+(u(r)+u(r)||0)/2}):elf.edgeInfos.push({})}),this.getCentripetalOptions(),t.onLayoutEnd=t.onLayoutEnd||function(){},t.run()}else t.onLayoutEnd([])},e.prototype.run=function(){var t=this,e=t.maxIteration,r=t.nodes,n=t.edges,i=t.workerEnabled,o=t.minMovement,a=t.animate,s=t.nodeMap,u=t.height;if(t.currentMinY=0,t.currentMaxY=u,r){var l=[];if(r.forEach(function(t,e){l[2*e]=0,l[2*e+1]=0}),this.defSideCoe&&"function"==typeof this.defSideCoe){var c={};n.forEach(function(t){var e=t.source,r=t.target;c[e]=c[e]||[],c[e].push(t),c[r]=c[r]||[],c[r].push(t)}),this.relatedEdges=c}var f=e;if(i||!a){for(var h=0;(t.judgingDistance>o||h<1)&&h=f||t.judgingDistanceo){var c=o/l;s*=c,u*=c}e[2*a]=s,e[2*a+1]=u})},e.prototype.updatePosition=function(t,e){var r=this,n=r.nodes,i=r.distanceThresholdMode,o=r.nodeMap;if(null===n||void 0===n?void 0:n.length){var a=0;"max"===i?r.judgingDistance=-1/0:"min"===i&&(r.judgingDistance=1/0);var u=1/0,l=-1/0;n.forEach(function(n,c){var f=o[n.id];if((0,s.isNumber)(n.fx)&&(0,s.isNumber)(n.fy))return n.x=n.fx,n.y=n.fy,f.x=n.x,void(f.y=n.y);var h=t[2*c]*e,p=t[2*c+1]*e;n.x+=h,n.y+=p,f.x=n.x,f.y=n.y,n.yl&&(l=n.y);var d=Math.sqrt(h*h+p*p);switch(i){case"max":r.judgingDistanced&&(r.judgingDistance=d);break;default:a+=d}}),this.currentMinY=u,this.currentMaxY=l,i&&"mean"!==i||(r.judgingDistance=a/n.length)}else this.judgingDistance=0},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"force2"},e.prototype.getSameTypeLeafMap=function(){var t=this,e=t.nodeClusterBy,r=t.nodes,n=t.edges,i=t.nodeMap,o=t.degreesMap;if(null===r||void 0===r?void 0:r.length){var a={};return r.forEach(function(t,r){1===o[t.id].all&&(a[t.id]=(0,s.getCoreNodeAndRelativeLeafNodes)("leaf",t,n,e,o,i))}),a}},e}(a.Base);e.Force2Layout=c},5257:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.id=t.id||0,this.rx=t.rx,this.ry=t.ry,this.fx=0,this.fy=0,this.mass=t.mass,this.degree=t.degree,this.g=t.g||0}return t.prototype.distanceTo=function(t){var e=this.rx-t.rx,r=this.ry-t.ry;return Math.hypot(e,r)},t.prototype.setPos=function(t,e){this.rx=t,this.ry=e},t.prototype.resetForce=function(){this.fx=0,this.fy=0},t.prototype.addForce=function(t){var e=t.rx-this.rx,r=t.ry-this.ry,n=Math.hypot(e,r);n=n<1e-4?1e-4:n;var i=this.g*(this.degree+1)*(t.degree+1)/n;this.fx+=i*e/n,this.fy+=i*r/n},t.prototype.in=function(t){return t.contains(this.rx,this.ry)},t.prototype.add=function(e){var r=this.mass+e.mass;return new t({rx:(this.rx*this.mass+e.rx*e.mass)/r,ry:(this.ry*this.mass+e.ry*e.mass)/r,mass:r,degree:this.degree+e.degree})},t}();e.default=r},3209:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.ForceAtlas2Layout=void 0;var a=r(8933),s=r(864),u=o(r(5257)),l=o(r(5138)),c=o(r(5490)),f=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.kr=5,r.kg=1,r.mode="normal",r.preventOverlap=!1,r.dissuadeHubs=!1,r.barnesHut=void 0,r.maxIteration=0,r.ks=.1,r.ksmax=10,r.tao=.1,r.onLayoutEnd=function(){},r.prune=void 0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.execute=function(){var t=this.nodes,e=this.onLayoutEnd,r=this.prune,n=this.maxIteration;this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight);for(var i=[],o=t.length,a=0;a250&&(this.barnesHut=!0),void 0===this.prune&&o>100&&(this.prune=!0),0!==this.maxIteration||this.prune?0===this.maxIteration&&r&&(n=100,o<=200&&o>100?n=500:o>200&&(n=950),this.maxIteration=n):(n=250,o<=200&&o>100?n=1e3:o>200&&(n=1200),this.maxIteration=n),this.kr||(this.kr=50,o>100&&o<=500?this.kr=20:o>500&&(this.kr=1)),this.kg||(this.kg=20,o>100&&o<=500?this.kg=10:o>500&&(this.kg=1)),this.nodes=this.updateNodesByForces(i),e()},e.prototype.updateNodesByForces=function(t){for(var e=this.edges,r=this.maxIteration,n=this.nodes,i=e.filter(function(t){return(0,s.getEdgeTerminal)(t,"source")!==(0,s.getEdgeTerminal)(t,"target")}),o=n.length,a=i.length,u=[],l={},c={},f=[],h=0;h0;){for(g=0;g50||!l)?this.getOptRepGraForces(d,v,i):this.getRepGraForces(p,50,d,100,o,i);var b=this.updatePos(d,y,h,i);a=b.nodes,h=b.sg,p--,this.tick&&this.tick()}return a},e.prototype.getAttrForces=function(t,e,r,n,i,o,a,s){for(var u=this.nodes,l=this.preventOverlap,c=this.dissuadeHubs,f=this.mode,h=this.prune,p=0;p0&&(x=b,w=b),s[2*n[d.id]]+=x*m[0],s[2*n[v.id]]-=w*m[0],s[2*n[d.id]+1]+=x*m[1],s[2*n[v.id]+1]-=w*m[1]}}return s},e.prototype.getRepGraForces=function(t,e,r,n,i,o){for(var a=this.nodes,s=this.preventOverlap,u=this.kr,l=this.kg,c=this.center,f=this.prune,h=a.length,p=0;p0&&(g=u*(o[p]+1)*(o[d]+1)/v),r[2*p]-=g*y[0],r[2*d]+=g*y[0],r[2*p+1]-=g*y[1],r[2*d+1]+=g*y[1]}var m=[a[p].x-c[0],a[p].y-c[1]],b=Math.hypot(m[0],m[1]);m[0]=m[0]/b,m[1]=m[1]/b;var x=l*(o[p]+1);r[2*p]-=x*m[0],r[2*p+1]-=x*m[1]}return r},e.prototype.getOptRepGraForces=function(t,e,r){for(var n=this.nodes,i=this.kg,o=this.center,a=this.prune,s=n.length,u=9e10,f=-9e10,h=9e10,p=-9e10,d=0;d=f&&(f=n[d].x),n[d].x<=u&&(u=n[d].x),n[d].y>=p&&(p=n[d].y),n[d].y<=h&&(h=n[d].y));var y={xmid:(f+u)/2,ymid:(p+h)/2,length:Math.max(f-u,p-h),massCenter:o,mass:s},v=new l.default(y),g=new c.default(v);for(d=0;d1.5*x?1.5*x:r);for(y=0;yS?S:w)*t[2*y],k=w*t[2*y+1];i[y].x+=E,i[y].y+=k}return{nodes:i,sg:r}},e}(a.Base);e.ForceAtlas2Layout=f},5138:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.xmid=t.xmid,this.ymid=t.ymid,this.length=t.length,this.massCenter=t.massCenter||[0,0],this.mass=t.mass||1}return t.prototype.getLength=function(){return this.length},t.prototype.contains=function(t,e){var r=this.length/2;return t<=this.xmid+r&&t>=this.xmid-r&&e<=this.ymid+r&&e>=this.ymid-r},t.prototype.NW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.NE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid+this.length/4,length:this.length/2})},t.prototype.SW=function(){return new t({xmid:this.xmid-this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t.prototype.SE=function(){return new t({xmid:this.xmid+this.length/4,ymid:this.ymid-this.length/4,length:this.length/2})},t}();e.default=r},5490:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,null!=t&&(this.quad=t)}return t.prototype.insert=function(e){null!=this.body?this._isExternal()?(this.quad&&(this.NW=new t(this.quad.NW()),this.NE=new t(this.quad.NE()),this.SW=new t(this.quad.SW()),this.SE=new t(this.quad.SE())),this._putBody(this.body),this._putBody(e),this.body=this.body.add(e)):(this.body=this.body.add(e),this._putBody(e)):this.body=e},t.prototype._putBody=function(t){this.quad&&(t.in(this.quad.NW())&&this.NW?this.NW.insert(t):t.in(this.quad.NE())&&this.NE?this.NE.insert(t):t.in(this.quad.SW())&&this.SW?this.SW.insert(t):t.in(this.quad.SE())&&this.SE&&this.SE.insert(t))},t.prototype._isExternal=function(){return null==this.NW&&null==this.NE&&null==this.SW&&null==this.SE},t.prototype.updateForce=function(t){null!=this.body&&t!==this.body&&(this._isExternal()?t.addForce(this.body):(this.quad?this.quad.getLength():0)/this.body.distanceTo(t)-1||(e[n]=t[n])}),e}),this.ticking=!1},e.prototype.execute=function(t){var e=this,r=e.nodes,n=e.edges;if(!e.ticking){var i=e.forceSimulation,o=e.alphaMin,a=e.alphaDecay,s=e.alpha;if(i){if(t)if(e.clustering&&e.clusterForce&&(e.clusterForce.nodes(r),e.clusterForce.links(n)),i.nodes(r),n&&e.edgeForce)e.edgeForce.links(n);else if(n&&!e.edgeForce){h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}e.preventOverlap&&e.overlapProcess(i),i.alpha(s).restart(),this.ticking=!0}else try{var u=l.forceManyBody();if(e.nodeStrength&&u.strength(e.nodeStrength),i=l.forceSimulation().nodes(r),e.clustering){var f=(0,c.default)();f.centerX(e.center[0]).centerY(e.center[1]).template("force").strength(e.clusterFociStrength),n&&f.links(n),r&&f.nodes(r),f.forceLinkDistance(e.clusterEdgeDistance).forceLinkStrength(e.clusterEdgeStrength).forceCharge(e.clusterNodeStrength).forceNodeSize(e.clusterNodeSize),e.clusterForce=f,i.force("group",f)}if(i.force("center",l.forceCenter(e.center[0],e.center[1])).force("charge",u).alpha(s).alphaDecay(a).alphaMin(o),e.preventOverlap&&e.overlapProcess(i),n){var h=l.forceLink().id(function(t){return t.id}).links(n);e.edgeStrength&&h.strength(e.edgeStrength),e.linkDistance&&h.distance(e.linkDistance),e.edgeForce=h,i.force("link",h)}if(e.workerEnabled&&!y()&&(e.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),e.workerEnabled){i.stop();for(var d=function(t){var e=t.alphaMin(),r=t.alphaTarget(),n=t.alpha(),i=Math.log((e-r)/(n-r))/Math.log(1-t.alphaDecay());return Math.ceil(i)}(i),v=1;v<=d;v++)i.tick(),postMessage({nodes:r,currentTick:v,totalTicks:d,type:p.LAYOUT_MESSAGE.TICK},void 0);e.ticking=!1}else i.on("tick",function(){e.tick()}).on("end",function(){e.ticking=!1,e.onLayoutEnd&&e.onLayoutEnd()}),e.ticking=!0;e.forceSimulation=i,e.ticking=!0}catch(t){e.ticking=!1,console.warn(t)}}},e.prototype.overlapProcess=function(t){var e,r,n=this.nodeSize,i=this.nodeSpacing,o=this.collideStrength;if(r=(0,f.isNumber)(i)?function(){return i}:(0,f.isFunction)(i)?i:function(){return 0},n)if((0,f.isFunction)(n))e=function(t){return n(t)+r(t)};else if((0,f.isArray)(n)){var a=(n[0]>n[1]?n[0]:n[1])/2;e=function(t){return a+r(t)}}else if((0,f.isNumber)(n)){var s=n/2;e=function(t){return s+r(t)}}else e=function(){return 10};else e=function(t){return t.size?(0,f.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])/2+r(t):(0,f.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)/2+r(t):t.size/2+r(t):10+r(t)};t.force("collisionForce",l.forceCollide(e).strength(o))},e.prototype.updateCfg=function(t){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.forceSimulation=null,Object.assign(this,t)},e.prototype.destroy=function(){this.ticking&&(this.forceSimulation.stop(),this.ticking=!1),this.nodes=null,this.edges=null,this.destroyed=!0},e}(h.Base);function y(){return"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope}e.ForceLayout=d},574:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(5989),e)},6983:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.FruchtermanLayout=void 0;var o=r(8933),a=r(864),s=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=1e3,r.workerEnabled=!1,r.gravity=10,r.speed=5,r.clustering=!1,r.clusterGravity=10,r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.onLayoutEnd=function(){},r.tick=function(){},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=this.nodes;if(void 0!==this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval),n&&0!==n.length){this.width||"undefined"==typeof window||(this.width=window.innerWidth),this.height||"undefined"==typeof window||(this.height=window.innerHeight),this.center||(this.center=[this.width/2,this.height/2]);var i=this.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=this.onLayoutEnd)||void 0===e||e.call(this));var o={},s={};return n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,s[t.id]=e}),this.nodeMap=o,this.nodeIdxMap=s,this.run()}null===(t=this.onLayoutEnd)||void 0===t||t.call(this)},e.prototype.run=function(){var t,e=this,r=e.nodes;if(r){var n=e.edges,i=e.maxIteration,o=e.workerEnabled,a=e.clustering,s=e.animate,u={};if(a&&r.forEach(function(t){void 0===u[t.cluster]&&(u[t.cluster]={name:t.cluster,cx:0,cy:0,count:0})}),o||!s){for(var l=0;l=i&&(null===(t=e.onLayoutEnd)||void 0===t||t.call(e),window.clearInterval(e.timeInterval))},0)}return{nodes:r,edges:n}}},e.prototype.runOneStep=function(t){var e,r=this.nodes;if(r){var n=this.edges,i=this.center,o=this.gravity,s=this.speed,u=this.clustering,l=this.height*this.width,c=Math.sqrt(l)/10,f=l/(r.length+1),h=Math.sqrt(f),p=[];if(r.forEach(function(t,e){p[e]={x:0,y:0}}),this.applyCalculate(r,n,p,h,f),u){for(var d in t)t[d].cx=0,t[d].cy=0,t[d].count=0;for(var d in r.forEach(function(e){var r=t[e.cluster];(0,a.isNumber)(e.x)&&(r.cx+=e.x),(0,a.isNumber)(e.y)&&(r.cy+=e.y),r.count++}),t)t[d].cx/=t[d].count,t[d].cy/=t[d].count;var y=this.clusterGravity||o;r.forEach(function(e,r){if((0,a.isNumber)(e.x)&&(0,a.isNumber)(e.y)){var n=t[e.cluster],i=Math.sqrt((e.x-n.cx)*(e.x-n.cx)+(e.y-n.cy)*(e.y-n.cy)),o=h*y;p[r].x-=o*(e.x-n.cx)/i,p[r].y-=o*(e.y-n.cy)/i}})}r.forEach(function(t,e){if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=.01*h*o;p[e].x-=r*(t.x-i[0]),p[e].y-=r*(t.y-i[1])}}),r.forEach(function(t,e){if((0,a.isNumber)(t.fx)&&(0,a.isNumber)(t.fy))return t.x=t.fx,void(t.y=t.fy);if((0,a.isNumber)(t.x)&&(0,a.isNumber)(t.y)){var r=Math.sqrt(p[e].x*p[e].x+p[e].y*p[e].y);if(r>0){var n=Math.min(c*(s/800),r);t.x+=p[e].x/r*n,t.y+=p[e].y/r*n}}}),null===(e=this.tick)||void 0===e||e.call(this)}},e.prototype.applyCalculate=function(t,e,r,n,i){this.calRepulsive(t,r,i),e&&this.calAttractive(e,r,n)},e.prototype.calRepulsive=function(t,e,r){t.forEach(function(n,i){e[i]={x:0,y:0},t.forEach(function(t,o){if(i!==o&&(0,a.isNumber)(n.x)&&(0,a.isNumber)(t.x)&&(0,a.isNumber)(n.y)&&(0,a.isNumber)(t.y)){var s=n.x-t.x,u=n.y-t.y,l=s*s+u*u;if(0===l){l=1;var c=i>o?1:-1;s=.01*c,u=.01*c}var f=r/l;e[i].x+=s*f,e[i].y+=u*f}})})},e.prototype.calAttractive=function(t,e,r){var n=this;t.forEach(function(t){var i=(0,a.getEdgeTerminal)(t,"source"),o=(0,a.getEdgeTerminal)(t,"target");if(i&&o){var s=n.nodeIdxMap[i],u=n.nodeIdxMap[o];if(s!==u){var l=n.nodeMap[i],c=n.nodeMap[o];if((0,a.isNumber)(c.x)&&(0,a.isNumber)(l.x)&&(0,a.isNumber)(c.y)&&(0,a.isNumber)(l.y)){var f=c.x-l.x,h=c.y-l.y,p=Math.sqrt(f*f+h*h),d=p*p/r;e[u].x-=f/p*d,e[u].y-=h/p*d,e[s].x+=f/p*d,e[s].y+=h/p*d}}}})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"fruchterman"},e}(o.Base);e.FruchtermanLayout=s},4600:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.GForceLayout=void 0;var o=r(8933),a=r(864),s=function(t,e){return t?(0,a.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},u=function(t){function e(e){var r=t.call(this)||this;return r.maxIteration=500,r.workerEnabled=!1,r.edgeStrength=200,r.nodeStrength=1e3,r.coulombDisScale=.005,r.damping=.9,r.maxSpeed=1e3,r.minMovement=.5,r.interval=.02,r.factor=1,r.linkDistance=1,r.gravity=10,r.preventOverlap=!0,r.collideStrength=1,r.tick=function(){},r.nodes=[],r.edges=[],r.width=300,r.height=300,r.nodeMap={},r.nodeIdxMap={},r.animate=!0,r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},e.prototype.execute=function(){var t,e,r=this,n=r.nodes;if(void 0!==r.timeInterval&&"undefined"!=typeof window&&window.clearInterval(r.timeInterval),n&&0!==n.length){r.width||"undefined"==typeof window||(r.width=window.innerWidth),r.height||"undefined"==typeof window||(r.height=window.innerHeight),r.center||(r.center=[r.width/2,r.height/2]);var i=r.center;if(1===n.length)return n[0].x=i[0],n[0].y=i[1],void(null===(e=r.onLayoutEnd)||void 0===e||e.call(r));var o={},u={};n.forEach(function(t,e){(0,a.isNumber)(t.x)||(t.x=Math.random()*r.width),(0,a.isNumber)(t.y)||(t.y=Math.random()*r.height),o[t.id]=t,u[t.id]=e}),r.nodeMap=o,r.nodeIdxMap=u,r.linkDistance=s(r.linkDistance,1),r.nodeStrength=s(r.nodeStrength,1),r.edgeStrength=s(r.edgeStrength,1);var l,c=r.nodeSize;if(r.preventOverlap){var f,h=r.nodeSpacing;f=(0,a.isNumber)(h)?function(){return h}:(0,a.isFunction)(h)?h:function(){return 0},l=c?(0,a.isArray)(c)?function(t){return Math.max(c[0],c[1])+f(t)}:function(t){return c+f(t)}:function(t){return t.size?(0,a.isArray)(t.size)?Math.max(t.size[0],t.size[1])+f(t):(0,a.isObject)(t.size)?Math.max(t.size.width,t.size.height)+f(t):t.size+f(t):10+f(t)}}r.nodeSize=l;var p=r.edges;r.degrees=(0,a.getDegree)(n.length,r.nodeIdxMap,p),r.getMass||(r.getMass=function(t){return t.mass||r.degrees[r.nodeIdxMap[t.id]].all||1}),r.run()}else null===(t=r.onLayoutEnd)||void 0===t||t.call(r)},e.prototype.run=function(){var t,e=this,r=e.maxIteration,n=e.nodes,i=e.workerEnabled,o=e.minMovement,a=e.animate;if(n)if(i||!a){for(var s=0;s=r&&(null===(i=e.onLayoutEnd)||void 0===i||i.call(e),window.clearInterval(e.timeInterval))}},0)}},e.prototype.reachMoveThreshold=function(t,e,r){var n=0;return t.forEach(function(t,r){var i=t.x-e[r].x,o=t.y-e[r].y;n+=Math.sqrt(i*i+o*o)}),(n/=t.length)=h)){var p=a.x-e.x,d=a.y-e.y;0===p&&0===d&&(p=.01*Math.random(),d=.01*Math.random());var y=p*p+d*d,v=Math.sqrt(y),g=(v+.1)*i,m=p/v,b=d/v,x=.5*(u(a)+u(e))*n/(g*g),w=r?r(e):1;if(t[2*c]+=m*x,t[2*c+1]+=b*x,t[2*h]-=m*x,t[2*h+1]-=b*x,o&&(l(a)+l(e))/2>v){var _=s*(u(a)+u(e))*.5/y;t[2*c]+=m*_/f,t[2*c+1]+=b*_/f,t[2*h]-=m*_/w,t[2*h+1]-=b*_/w}}})})},e.prototype.calAttractive=function(t,e){var r=this.nodeMap,n=this.nodeIdxMap,i=this.linkDistance,o=this.edgeStrength,s=this.nodeSize,u=this.getMass;e.forEach(function(e,l){var c=(0,a.getEdgeTerminal)(e,"source"),f=(0,a.getEdgeTerminal)(e,"target"),h=r[c],p=r[f],d=p.x-h.x,y=p.y-h.y;0===d&&0===y&&(d=.01*Math.random(),y=.01*Math.random());var v=Math.sqrt(d*d+y*y),g=d/v,m=y/v,b=((i(e,h,p)||1+(s(h)+s(p)||0)/2)-v)*o(e),x=n[c],w=n[f],_=u?u(h):1,S=u?u(p):1;t[2*x]-=g*b/_,t[2*x+1]-=m*b/_,t[2*w]+=g*b/S,t[2*w+1]+=m*b/S})},e.prototype.calGravity=function(t,e){for(var r=this.center,n=this.gravity,i=this.degrees,o=e.length,s=0;si.maxSpeed){var l=i.maxSpeed/u;a*=l,s*=l}e[2*n]=a,e[2*n+1]=s})},e.prototype.updatePosition=function(t,e,r){r.forEach(function(r,n){if((0,a.isNumber)(r.fx)&&(0,a.isNumber)(r.fy))return r.x=r.fx,void(r.y=r.fy);var i=t[2*n]*e,o=t[2*n+1]*e;r.x+=i,r.y+=o})},e.prototype.stop=function(){this.timeInterval&&"undefined"!=typeof window&&window.clearInterval(this.timeInterval)},e.prototype.destroy=function(){this.stop(),this.tick=null,this.nodes=null,this.edges=null,this.destroyed=!0},e.prototype.getType=function(){return"gForce"},e}(o.Base);e.GForceLayout=u},8834:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},a=this&&this.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]t.cells)((x=t.small())-1)*(b=t.large())>=t.cells?t.small(x-1):(b-1)*x>=t.cells&&t.large(b-1);else for(;t.cols*t.rows=t.cells?t.large(b+1):t.small(x+1)}if(t.cellWidth=s/t.cols,t.cellHeight=u/t.rows,l&&(t.cellWidth=0,t.cellHeight=0),f||h){var w=(0,o.getFuncByUnknownType)(10,h),_=(0,o.getFuncByUnknownType)(30,p,!1);d.forEach(function(e){e.x&&e.y||(e.x=0,e.y=0);var r,n,i=_(e)||30;(0,o.isArray)(i)?(r=i[0],n=i[1]):(r=i,n=i);var a=void 0!==w?w(e):c,s=r+a,u=n+a;t.cellWidth=Math.max(t.cellWidth,s),t.cellHeight=Math.max(t.cellHeight,u)})}t.cellUsed={},t.row=0,t.col=0,t.id2manPos={};for(var S=0;S=t&&(this.col=0,this.row++)},e.prototype.getPos=function(t){var e,r,n=this.begin,i=this.cellWidth,o=this.cellHeight,a=this.id2manPos[t.id];if(a)e=a.col*i+i/2+n[0],r=a.row*o+o/2+n[1];else{for(;this.used(this.row,this.col);)this.moveToNextCell();e=this.col*i+i/2+n[0],r=this.row*o+o/2+n[1],this.use(this.row,this.col),this.moveToNextCell()}t.x=e,t.y=r},e.prototype.getType=function(){return"grid"},e}(r(8933).Base);e.GridLayout=a},9390:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&("get"in i?e.__esModule:!i.writable&&!i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ERLayout=e.ForceAtlas2Layout=e.ComboCombinedLayout=e.ComboForceLayout=e.GForceGPULayout=e.FruchtermanGPULayout=e.FruchtermanLayout=e.MDSLayout=e.ConcentricLayout=e.RadialLayout=e.DagreCompoundLayout=e.DagreLayout=e.CircularLayout=e.ForceLayout=e.Force2Layout=e.GForceLayout=e.RandomLayout=e.GridLayout=e.Layouts=e.Layout=void 0;var o=r(7808);Object.defineProperty(e,"GridLayout",{enumerable:!0,get:function(){return o.GridLayout}});var a=r(1783);Object.defineProperty(e,"RandomLayout",{enumerable:!0,get:function(){return a.RandomLayout}});var s=r(4600);Object.defineProperty(e,"GForceLayout",{enumerable:!0,get:function(){return s.GForceLayout}});var u=r(8944);Object.defineProperty(e,"Force2Layout",{enumerable:!0,get:function(){return u.Force2Layout}});var l=r(574);Object.defineProperty(e,"ForceLayout",{enumerable:!0,get:function(){return l.ForceLayout}});var c=r(2381);Object.defineProperty(e,"CircularLayout",{enumerable:!0,get:function(){return c.CircularLayout}});var f=r(4855);Object.defineProperty(e,"DagreLayout",{enumerable:!0,get:function(){return f.DagreLayout}});var h=r(6006);Object.defineProperty(e,"DagreCompoundLayout",{enumerable:!0,get:function(){return h.DagreCompoundLayout}});var p=r(1884);Object.defineProperty(e,"RadialLayout",{enumerable:!0,get:function(){return p.RadialLayout}});var d=r(3080);Object.defineProperty(e,"ConcentricLayout",{enumerable:!0,get:function(){return d.ConcentricLayout}});var y=r(5084);Object.defineProperty(e,"MDSLayout",{enumerable:!0,get:function(){return y.MDSLayout}});var v=r(6983);Object.defineProperty(e,"FruchtermanLayout",{enumerable:!0,get:function(){return v.FruchtermanLayout}});var g=r(8834);Object.defineProperty(e,"FruchtermanGPULayout",{enumerable:!0,get:function(){return g.FruchtermanGPULayout}});var m=r(1011);Object.defineProperty(e,"GForceGPULayout",{enumerable:!0,get:function(){return m.GForceGPULayout}});var b=r(5773);Object.defineProperty(e,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var x=r(995);Object.defineProperty(e,"ComboCombinedLayout",{enumerable:!0,get:function(){return x.ComboCombinedLayout}});var w=r(3209);Object.defineProperty(e,"ForceAtlas2Layout",{enumerable:!0,get:function(){return w.ForceAtlas2Layout}});var _=r(6244);Object.defineProperty(e,"ERLayout",{enumerable:!0,get:function(){return _.ERLayout}});var S=r(2766);Object.defineProperty(e,"Layout",{enumerable:!0,get:function(){return S.Layout}}),Object.defineProperty(e,"Layouts",{enumerable:!0,get:function(){return S.Layouts}}),i(r(6451),e)},2766:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Layouts=e.Layout=void 0;var n=r(521),i=r(7808),o=r(1783),a=r(8944),s=r(4600),u=r(574),l=r(2381),c=r(4855),f=r(1884),h=r(3080),p=r(5084),d=r(6983),y=r(8834),v=r(1011),g=r(5773),m=r(995),b=r(3209),x=r(6244),w=r(6006),_=r(864),S=function(){function t(t){var e=(0,n.getLayoutByName)(t.type);this.layoutInstance=new e(t)}return t.prototype.layout=function(t){return this.layoutInstance.layout(t)},t.prototype.updateCfg=function(t){this.layoutInstance.updateCfg(t)},t.prototype.init=function(t){this.correctLayers(t.nodes),this.layoutInstance.init(t)},t.prototype.correctLayers=function(t){if(null===t||void 0===t?void 0:t.length){var e=1/0,r=[];if(t.forEach(function(t){(0,_.isString)(t.layer)&&(t.layer=parseInt(t.layer,10)),void 0===t.layer||isNaN(t.layer)||(r.push(t),t.layern[0]?n[0]:b-n[0],_=x-n[1]>n[1]?n[1]:x-n[1];0===w&&(w=b/2),0===_&&(_=x/2);var S=_>w?w:_,E=Math.max.apply(Math,m),k=[];m.forEach(function(e,r){t.unitRadius||(t.unitRadius=S/E),k[r]=e*t.unitRadius}),t.radii=k;var T=t.eIdealDisMatrix();t.eIdealDistances=T;var C=function(t){for(var e=t.length,r=t[0].length,n=[],i=0;iM[1]?M[0]:M[1])+L(t)}:function(t){return M+L(t)}:function(t){return t.size?(0,a.isArray)(t.size)?(t.size[0]>t.size[1]?t.size[0]:t.size[1])+L(t):(0,a.isObject)(t.size)?(t.size.width>t.size.height?t.size.width:t.size.height)+L(t):t.size+L(t):10+L(t)};var N={nodes:e,nodeSizeFunc:A,adjMatrix:y,positions:O,radii:k,height:x,width:b,strictRadial:I,focusID:d,iterations:t.maxPreventOverlapIteration||200,k:O.length/4.5},R=new l.default(N);O=R.layout()}return O.forEach(function(t,r){e[r].x=t[0]+n[0],e[r].y=t[1]+n[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:r}}t.onLayoutEnd&&t.onLayoutEnd()},e.prototype.run=function(){for(var t=this.maxIteration,e=this.positions||[],r=this.weights||[],n=this.eIdealDistances||[],i=this.radii||[],o=0;o<=t;o++){var a=o/t;this.oneIteration(a,e,i,n,r)}},e.prototype.oneIteration=function(t,e,r,n,i){var o=1-t,a=this.focusIndex;e.forEach(function(s,u){var l=c(s,[0,0]),f=0===l?0:1/l;if(u!==a){var h=0,p=0,d=0;e.forEach(function(t,e){if(u!==e){var r=c(s,t),o=0===r?0:1/r,a=n[e][u];d+=i[u][e],h+=i[u][e]*(t[0]+a*(s[0]-t[0])*o),p+=i[u][e]*(t[1]+a*(s[1]-t[1])*o)}});var y=0===r[u]?0:1/r[u];d*=o,d+=t*y*y,h*=o,h+=t*y*s[0]*f,s[0]=h/d,p*=o,p+=t*y*s[1]*f,s[1]=p/d}})},e.prototype.eIdealDisMatrix=function(){var t=this,e=t.nodes;if(!e)return[];var r=t.distances,n=t.linkDistance,i=t.radii||[],o=t.unitRadius||50,s=[];return r&&r.forEach(function(r,u){var l=[];r.forEach(function(r,s){if(u===s)l.push(0);else if(i[u]===i[s])if("data"===t.sortBy)l.push(r*(Math.abs(u-s)*t.sortStrength)/(i[u]/o));else if(t.sortBy){var c=e[u][t.sortBy]||0,f=e[s][t.sortBy]||0;(0,a.isString)(c)&&(c=c.charCodeAt(0)),(0,a.isString)(f)&&(f=f.charCodeAt(0)),l.push(r*(Math.abs(c-f)*t.sortStrength)/(i[u]/o))}else l.push(r*n/(i[u]/o));else{var h=(n+o)/2;l.push(r*h)}}),s.push(l)}),s},e.prototype.handleInfinity=function(t,e,r){for(var n=t.length,i=0;ir?t[e][n]:r);return r},e.prototype.getType=function(){return"radial"},e}(s.Base);e.RadialLayout=f},9088:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.disp=[],this.positions=t.positions,this.adjMatrix=t.adjMatrix,this.focusID=t.focusID,this.radii=t.radii,this.iterations=t.iterations||10,this.height=t.height||10,this.width=t.width||10,this.speed=t.speed||100,this.gravity=t.gravity||10,this.nodeSizeFunc=t.nodeSizeFunc,this.k=t.k||5,this.strictRadial=t.strictRadial,this.nodes=t.nodes}return t.prototype.layout=function(){var t=this.positions,e=[],r=this.iterations,n=this.width/10;this.maxDisplace=n,this.disp=e;for(var i=0;iu?1:-1;l=.01*h,c=.01*h}if(fMath.PI/2&&(c-=Math.PI/2,s*=-1,u*=-1);var f=Math.cos(c)*l;e.x=s*f,e.y=u*f});var a=this.radii;t.forEach(function(s,u){if(u!==i){var l=Math.sqrt(e[u].x*e[u].x+e[u].y*e[u].y);if(l>0&&u!==i){var c=Math.min(o*(r/800),l);if(s[0]+=e[u].x/l*c,s[1]+=e[u].y/l*c,n){var f=s[0]-t[i][0],h=s[1]-t[i][1],p=Math.sqrt(f*f+h*h);f=f/p*a[u],h=h/p*a[u],s[0]=t[i][0]+f,s[1]=t[i][1]+h}}}})},t}();e.default=r},1783:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.RandomLayout=void 0;var o=function(t){function e(e){var r=t.call(this)||this;return r.center=[0,0],r.width=300,r.height=300,r.nodes=[],r.edges=[],r.onLayoutEnd=function(){},r.updateCfg(e),r}return i(e,t),e.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},e.prototype.execute=function(){var t=this,e=t.nodes,r=t.center;return t.width||"undefined"==typeof window||(t.width=window.innerWidth),t.height||"undefined"==typeof window||(t.height=window.innerHeight),e&&e.forEach(function(e){e.x=.9*(Math.random()-.5)*t.width+r[0],e.y=.9*(Math.random()-.5)*t.height+r[1]}),t.onLayoutEnd&&t.onLayoutEnd(),{nodes:e,edges:this.edges}},e.prototype.getType=function(){return"random"},e}(r(8933).Base);e.RandomLayout=o},6451:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},521:function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.getLayoutByName=e.unRegisterLayout=e.registerLayout=void 0;var o=r(8933),a=r(864),s=new Map;e.registerLayout=function(t,e){if(s.get(t)&&console.warn("The layout with the name ".concat(t," exists already, it will be overridden")),(0,a.isObject)(e)){var r=function(t){function r(r){var n,i,o=n=t.call(this)||this,a={},s=Object.assign({},o.getDefaultCfg(),(null===(i=e.getDefaultCfg)||void 0===i?void 0:i.call(e))||{});return Object.assign(a,s,e,r),Object.keys(a).forEach(function(t){var e=a[t];o[t]=e}),n}return i(r,t),r}(o.Base);s.set(t,r)}else s.set(t,e);return s.get(t)};e.unRegisterLayout=function(t){s.has(t)&&s.delete(t)};e.getLayoutByName=function(t){return s.has(t)?s.get(t):null}},1049:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=void 0,e.isArray=Array.isArray},8514:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getFuncByUnknownType=e.getFunc=e.isFunction=void 0;var n=r(864),i=r(9759);e.isFunction=function(t){return"function"==typeof t};e.getFunc=function(t,e,r){return r||((0,i.isNumber)(t)?function(){return t}:function(){return e})};e.getFuncByUnknownType=function(t,r,o){return void 0===o&&(o=!0),r||0===r?(0,e.isFunction)(r)?r:(0,i.isNumber)(r)?function(){return r}:(0,n.isArray)(r)?function(){if(o){var e=Math.max.apply(Math,r);return isNaN(e)?t:e}return r}:(0,n.isObject)(r)?function(){if(o){var e=Math.max(r.width,r.height);return isNaN(e)?t:e}return[r.width,r.height]}:function(){return t}:function(e){return e.size?(0,n.isArray)(e.size)?e.size[0]>e.size[1]?e.size[0]:e.size[1]:(0,n.isObject)(e.size)?e.size.width>e.size.height?e.size.width:e.size.height:e.size:t}}},2590:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.arrayToTextureData=e.attributesToTextureData=e.buildTextureDataWithTwoEdgeAttr=e.buildTextureData=e.proccessToFunc=void 0;var n=r(864),i=r(6268);e.proccessToFunc=function(t,e){return t?(0,n.isNumber)(t)?function(){return t}:t:function(){return e||1}};e.buildTextureData=function(t,e){var r=[],n=[],o={},a=0;for(a=0;ae[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e};e.getAdjMatrix=function(t,r){var n=t.nodes,i=t.edges,o=[],a={};if(!n)throw new Error("invalid nodes data!");return n&&n.forEach(function(t,e){a[t.id]=e,o.push([])}),null===i||void 0===i||i.forEach(function(t){var n=(0,e.getEdgeTerminal)(t,"source"),i=(0,e.getEdgeTerminal)(t,"target"),s=a[n],u=a[i];void 0!==s&&void 0!==u&&(o[s][u]=1,r||(o[u][s]=1))}),o};e.scaleMatrix=function(t,e){var r=[];return t.forEach(function(t){var n=[];t.forEach(function(t){n.push(t*e)}),r.push(n)}),r};e.traverseTreeUp=function(t,e){"function"==typeof e&&function t(e,r){if(e&&e.children)for(var n=e.children.length-1;n>=0;n--)if(!t(e.children[n],r))return;return!!r(e)}(t,e)};e.getLayoutBBox=function(t){var e=1/0,r=1/0,o=-1/0,a=-1/0;return t.forEach(function(t){var s=t.size;(0,n.isArray)(s)?1===s.length&&(s=[s[0],s[0]]):(0,i.isNumber)(s)?s=[s,s]:(void 0===s||isNaN(s))&&(s=[30,30]);var u=[s[0]/2,s[1]/2],l=t.x-u[0],c=t.x+u[0],f=t.y-u[1],h=t.y+u[1];e>l&&(e=l),r>f&&(r=f),oi&&(n=r,a(1),++e),r[t]=o}function a(t){e=0,r=Object.create(null),t||(n=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==r[t]||void 0!==n[t]},get:function(t){var e=r[t];return void 0!==e?e:void 0!==(e=n[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==r[t]?r[t]=e:o(t,e)}}}(r),n},l=/rgba?\(([\s.,0-9]+)\)/;var c=u(function(t){if("#"===t[0]&&7===t.length)return t;var e;s||((e=document.createElement("i")).title="Web Colour Picker",e.style.display="none",document.body.appendChild(e),s=e),s.style.color=t;var r=document.defaultView.getComputedStyle(s,"").getPropertyValue("color");return r=o(l.exec(r)[1].split(/\s*,\s*/).map(function(t){return Number(t)}))},function(t){return t},256);function f(t,e,r,n){return t[n]+(e[n]-t[n])*r}function h(t){var e=("string"==typeof t?t.split("-"):t).map(function(t){return n(-1===t.indexOf("#")?c(t):t)});return function(t){return function(t,e){var r=isNaN(Number(e))||e<0?0:e>1?1:Number(e),n=t.length-1,i=Math.floor(n*r),a=n*r-i,s=t[i],u=i===n?s:t[i+1];return o([f(s,u,a,0),f(s,u,a,1),f(s,u,a,2)])}(e,t)}}var p=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,d=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,y=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function v(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,r=void 0;if("l"===t[0]){var n=+(i=p.exec(t))[1]+90;r=i[2],e="linear-gradient("+n+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",r=(i=d.exec(t))[4]}var o=r.match(y);return o.forEach(function(t,r){var n=t.split(":");e+=n[1]+" "+100*Number(n[0])+"%",r!==o.length-1&&(e+=", ")}),e+=")"}return t}var g=r(9019);function m(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return g.fromRotation(n,r),g.multiply(t,n,e)}function b(t,e,r){var n=[0,0,0,0,0,0,0,0,0];return g.fromScaling(n,r),g.multiply(t,n,e)}function x(t,e,r){return g.multiply(t,r,e)}function w(t,e){for(var r,n,i,o,a=t?[].concat(t):[1,0,0,0,1,0,0,0,1],s=0,u=e.length;s=0;return r?i?2*Math.PI-n:n:i?n:2*Math.PI-n}function k(t,e,r){return r?(t[0]=e[1],t[1]=-1*e[0]):(t[0]=-1*e[1],t[1]=e[0]),t}function T(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var r="number"==typeof e&&e>=1?Math.pow(10,e):1;return t.map(function(t){var n=t.slice(1).map(Number).map(function(t){return e?Math.round(t*r)/r:Math.round(t)});return[t[0]].concat(n)})}(t,e).map(function(t){return t[0]+t.slice(1).join(" ")}).join("")}var C=r(1635),O={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function A(t,e,r){if(t[r].length>7){t[r].shift();for(var n=t[r],i=r;n.length;)e[r]="A",t.splice(i+=1,0,["C"].concat(n.splice(0,6)));t.splice(r,1)}}var P={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function M(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return P[e]===t.length-1&&"achlmqstvz".includes(e)})}function I(t){return M(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function L(t){return I(t)&&t.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function j(t){for(var e=t.pathValue[t.segmentStart],r=e.toLowerCase(),n=t.data;n.length>=P[r]&&("m"===r&&n.length>2?(t.segments.push([e].concat(n.splice(0,2))),r="l",e="m"===e?"l":"L"):t.segments.push([e].concat(n.splice(0,P[r]))),P[r]););}function N(t){var e=t.index,r=t.pathValue,n=r.charCodeAt(e);return 48===n?(t.param=0,void(t.index+=1)):49===n?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+r[e]+'", expecting 0 or 1 at index '+e)}function R(t){return t>=48&&t<=57||43===t||45===t||46===t}function D(t){return t>=48&&t<=57}function B(t){var e,r=t.max,n=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(o>=r)t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param';else if(43!==(e=n.charCodeAt(o))&&45!==e||(o+=1,e=n.charCodeAt(o)),D(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=n.charCodeAt(o),a&&o=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function z(t){var e=t.max,r=t.pathValue,n=t.index,i=r.charCodeAt(n),o=P[r[n].toLowerCase()];if(t.segmentStart=n,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,F(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?B(t):N(t),t.err.length)return;t.data.push(t.param),F(t),t.index=t.max)break;if(!R(r.charCodeAt(t.index)))break}j(t)}else j(t);else t.err='[path-util]: Invalid path value "'+r[n]+'" is not a path command'}var G=function(){return function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}}();function U(t){if(M(t))return[].concat(t);var e=new G(t);for(F(e);e.index1&&(g*=T=Math.sqrt(T),m*=T);var C=g*g,O=m*m,A=(o===a?-1:1)*Math.sqrt(Math.abs((C*O-C*k*k-O*E*E)/(C*k*k+O*E*E)));p=A*g*k/m+(y+b)/2,d=A*-m*E/g+(v+x)/2,f=Math.asin(((v-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-d)/m*Math.pow(10,9)>>0)/Math.pow(10,9)),f=yh&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var P=h-f;if(Math.abs(P)>w){var M=h,I=b,L=x;h=f+w*(a&&h>f?1:-1),S=Y(b=p+g*Math.cos(h),x=d+m*Math.sin(h),g,m,i,0,a,I,L,[h,M,p,d])}P=h-f;var j=Math.cos(f),N=Math.sin(f),R=Math.cos(h),D=Math.sin(h),B=Math.tan(P/4),F=4/3*g*B,z=4/3*m*B,G=[y,v],U=[y+F*N,v-z*j],V=[b+F*D,x-z*R],H=[b,x];if(U[0]=2*G[0]-U[0],U[1]=2*G[1]-U[1],l)return U.concat(V,H,S);for(var W=[],X=0,Z=(S=U.concat(V,H,S)).length;X=o)a={x:r,y:n};else{var s=X([t,e],[r,n],i/o);a={x:s[0],y:s[1]}}return{length:o,point:a,min:{x:Math.min(t,r),y:Math.min(e,n)},max:{x:Math.max(t,r),y:Math.max(e,n)}}}function nt(t,e){var r=t.x,n=t.y,i=e.x,o=e.y,a=r*i+n*o,s=Math.sqrt((Math.pow(r,2)+Math.pow(n,2))*(Math.pow(i,2)+Math.pow(o,2)));return(r*o-n*i<0?-1:1)*Math.acos(a/s)}function it(t,e,r,n,i,o,a,s,u,l){var c=Math.abs,f=Math.sin,h=Math.cos,p=Math.sqrt,d=Math.PI,y=c(r),v=c(n),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return rt(t,e,s,u,l).point;var m=(t-s)/2,b=(e-u)/2,x={x:h(g)*m+f(g)*b,y:-f(g)*m+h(g)*b},w=Math.pow(x.x,2)/Math.pow(y,2)+Math.pow(x.y,2)/Math.pow(v,2);w>1&&(y*=p(w),v*=p(w));var _=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(y,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2));_=_<0?0:_;var S=(o!==a?1:-1)*p(_),E=S*(y*x.y/v),k=S*(-v*x.x/y),T=h(g)*E-f(g)*k+(t+s)/2,C=f(g)*E+h(g)*k+(e+u)/2,O={x:(x.x-E)/y,y:(x.y-k)/v},A=nt({x:1,y:0},O),P=nt(O,{x:(-x.x-E)/y,y:(-x.y-k)/v});!a&&P>0?P-=2*d:a&&P<0&&(P+=2*d);var M=A+(P%=2*d)*l,I=y*h(M),L=v*f(M);return{x:h(g)*I-f(g)*L+T,y:f(g)*I+h(g)*L+C}}function ot(t,e,r,n,i,o,a,s,u,l,c){var f,h=c.bbox,p=void 0===h||h,d=c.length,y=void 0===d||d,v=c.sampleSize,g=void 0===v?30:v,m="number"==typeof l,b=t,x=e,w=0,_=[b,x,w],S=[b,x],E={x:0,y:0},k=[{x:b,y:x}];m&&l<=0&&(E={x:b,y:x});for(var T=0;T<=g;T+=1){if(b=(f=it(t,e,r,n,i,o,a,s,u,T/g)).x,x=f.y,p&&k.push({x:b,y:x}),y&&(w+=et(S,[b,x])),S=[b,x],m&&w>=l&&l>_[2]){var C=(w-l)/(w-_[2]);E={x:S[0]*(1-C)+_[0]*C,y:S[1]*(1-C)+_[1]*C}}_=[b,x,w]}return m&&l>=w&&(E={x:s,y:u}),{length:w,point:E,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,k.map(function(t){return t.x})),y:Math.max.apply(null,k.map(function(t){return t.y}))}}}function at(t,e,r,n,i,o,a,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function st(t,e,r,n,i,o,a,s,u,l){var c,f=l.bbox,h=void 0===f||f,p=l.length,d=void 0===p||p,y=l.sampleSize,v=void 0===y?10:y,g="number"==typeof u,m=t,b=e,x=0,w=[m,b,x],_=[m,b],S={x:0,y:0},E=[{x:m,y:b}];g&&u<=0&&(S={x:m,y:b});for(var k=0;k<=v;k+=1){if(m=(c=at(t,e,r,n,i,o,a,s,k/v)).x,b=c.y,h&&E.push({x:m,y:b}),d&&(x+=et(_,[m,b])),_=[m,b],g&&x>=u&&u>w[2]){var T=(x-u)/(x-w[2]);S={x:_[0]*(1-T)+w[0]*T,y:_[1]*(1-T)+w[1]*T}}w=[m,b,x]}return g&&u>=x&&(S={x:a,y:s}),{length:x,point:S,min:{x:Math.min.apply(null,E.map(function(t){return t.x})),y:Math.min.apply(null,E.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function ut(t,e,r,n,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*r+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*n+Math.pow(a,2)*o}}function lt(t,e,r,n,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,f=s.length,h=void 0===f||f,p=s.sampleSize,d=void 0===p?10:p,y="number"==typeof a,v=t,g=e,m=0,b=[v,g,m],x=[v,g],w={x:0,y:0},_=[{x:v,y:g}];y&&a<=0&&(w={x:v,y:g});for(var S=0;S<=d;S+=1){if(v=(u=ut(t,e,r,n,i,o,S/d)).x,g=u.y,c&&_.push({x:v,y:g}),h&&(m+=et(x,[v,g])),x=[v,g],y&&m>=a&&a>b[2]){var E=(m-a)/(m-b[2]);w={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[v,g,m]}return y&&a>=m&&(w={x:i,y:o}),{length:m,point:w,min:{x:Math.min.apply(null,_.map(function(t){return t.x})),y:Math.min.apply(null,_.map(function(t){return t.y}))},max:{x:Math.max.apply(null,_.map(function(t){return t.x})),y:Math.max.apply(null,_.map(function(t){return t.y}))}}}function ct(t,e,r){for(var n,i,o,a,s,u,l,c,f,h=W(t),p="number"==typeof e,d=[],y=0,v=0,g=0,m=0,b=[],x=[],w=0,_={x:0,y:0},S=_,E=_,k=_,T=0,C=0,O=h.length;C=e&&(k=E),x.push(S),b.push(_),T+=w,y=(u="Z"!==c?f.slice(-2):[g,m])[0],v=u[1];return p&&e>=T&&(k={x:y,y:v}),{length:T,point:k,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,x.map(function(t){return t.x})),y:Math.max.apply(null,x.map(function(t){return t.y}))}}}function ft(t,e){if(!t)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{length:!1})),n=r.min,i=n.x,o=n.y,a=r.max,s=a.x,u=a.y,l=s-i,c=u-o;return{width:l,height:c,x:i,y:o,x2:s,y2:u,cx:i+l/2,cy:o+c/2,cz:Math.max(l,c)+Math.min(l,c)/2}}function ht(t,e){return ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!1,length:!0})).length}function pt(t,e){if(!t)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var r=ct(t,void 0,(0,C.__assign)((0,C.__assign)({},e),{bbox:!0,length:!0})),n=r.length,i=r.min,o=i.x,a=i.y,s=r.max,u=s.x,l=s.y,c=u-o,f=l-a;return{length:n,width:c,height:f,x:o,y:a,x2:u,y2:l,cx:o+c/2,cy:a+f/2,cz:Math.max(c,f)+Math.min(c,f)/2}}function dt(t,e){var r=t.length-1,n=[],i=0,o=function(t){var e=t.length,r=e-1;return t.map(function(n,i){return t.map(function(n,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=r),t[s])})})}(t);return o.forEach(function(o,a){t.slice(1).forEach(function(n,o){i+=et(t[(a+o)%r].slice(-2),e[o%r].slice(-2))}),n[a]=i,i=0}),o[n.indexOf(Math.min.apply(null,n))]}function yt(t){var e=0,r=0,n=0;return J(t).map(function(t){var i;switch(t[0]){case"M":return e=t[1],r=t[2],0;default:var o=t.slice(1),a=o[0],s=o[1],u=o[2],l=o[3],c=o[4],f=o[5];return n=function(t,e,r,n,i,o,a,s){return 3*((s-e)*(r+i)-(a-t)*(n+o)+n*(t-i)-r*(e-o)+s*(i+t/3)-a*(o+e/3))/20}(e,r,a,s,u,l,c,f),i=t.slice(-2),e=i[0],r=i[1],n}}).reduce(function(t,e){return t+e},0)}function vt(t){return yt(t)>=0}function gt(t,e,r){return ct(t,e,(0,C.__assign)((0,C.__assign)({},r),{bbox:!1,length:!0})).point}function mt(t,e){for(var r,n,i,o,a=U(t),s=W(a),u=ht(a),l=function(t){var r=t.x-e.x,n=t.y-e.y;return r*r+n*n},c=8,f=0,h=0,p=1/0,d=0;d<=u;d+=c)(f=l(r=gt(s,d))).5;)g=l(i=gt(s,y=h-c)),m=l(o=gt(s,v=h+c)),y>=0&&g=i)return s=i-(a=ht(n=r.slice(0,-1))),{segment:r[o],index:o,length:s,lengthAtSegment:a};for(var f=[];o>0;)u=n[o],s=i-(a=ht(n=n.slice(0,-1))),i=a,f.push({segment:u,index:o,length:s,lengthAtSegment:a}),o-=1;return f.find(function(t){return t.lengthAtSegment<=e})}(a,h);return{closest:n,distance:Math.sqrt(p),segment:b}}function bt(t,e){var r=mt(t,e).distance;return Math.abs(r)<.001}function xt(t){return t.map(function(t,e,r){var n=e&&r[e-1].slice(-2).concat(t.slice(1)),i=e?st(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var r=t.slice(0,2),n=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=X(r,n,e),s=X(n,i,e),u=X(i,o,e),l=X(a,s,e),c=X(s,u,e),f=X(l,c,e);return[["C"].concat(a,l,f),["C"].concat(c,u,o)]}(n):[t,t]:[t],l:i}})}function wt(t,e,r){var n=xt(t),i=xt(e),o=n.length,a=i.length,s=n.filter(function(t){return t.l}).length,u=i.filter(function(t){return t.l}).length,l=n.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/s||0,c=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/u||0,f=r||Math.max(o,a),h=[l,c],p=[f-o,f-a],d=0,y=[n,i].map(function(t,e){return t.l===f?t.map(function(t){return t.s}):t.map(function(t,r){return d=r&&p[e]&&t.l>=h[e],p[e]-=d?1:0,d?t.ss:[t.s]}).flat()});return y[0].length===y[1].length?y:wt(y[0],y[1],f)}var _t=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},St=function(t,e){return!!_t(t)&&t.indexOf(e)>-1},Et=function(t,e){if(!_t(t))return t;for(var r=[],n=0;n-1;)Yt.call(t,o,1);return t},Kt=Array.prototype.splice,Jt=function(t,e){if(!_t(t))return[];for(var r=t?e.length:0,n=r-1;r--;){var i=void 0,o=e[r];r!==n&&o===i||(i=o,Kt.call(t,o,1))}return t},Qt=function(t,e,r){if(!At(t)&&!Dt(t))return t;var n=r;return It(t,function(t,r){n=e(n,t,r)}),n},$t=function(t,e){var r=[];if(!_t(t))return r;for(var n=-1,i=[],o=t.length;++ne[i])return 1;if(t[i]r?r:t},we=function(t,e){var r=e.toString(),n=r.indexOf(".");if(-1===n)return Math.round(t);var i=r.substr(n+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},_e=function(t){return Ot(t,"Number")},Se=function(t){return _e(t)&&t%1!=0},Ee=function(t){return _e(t)&&t%2==0},ke=Number.isInteger?Number.isInteger:function(t){return _e(t)&&t%1==0},Te=function(t){return _e(t)&&t<0},Ce=1e-5;function Oe(t,e,r){return void 0===r&&(r=Ce),Math.abs(t-e)0},Me=function(t,e){if(At(t)){for(var r,n=-1/0,i=0;in&&(r=o,n=s)}return r}},Ie=function(t,e){if(At(t)){for(var r,n=1/0,i=0;ie?(n&&(clearTimeout(n),n=null),s=l,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(n),s=0,n=i=o=null},l},Rr=function(t){return _t(t)?Array.prototype.slice.call(t):[]},Dr={},Br=function(t){return Dr[t=t||"g"]?Dr[t]+=1:Dr[t]=1,t+Dr[t]},Fr=function(){},zr=function(t){return t};function Gr(t){return Tt(t)?0:_t(t)?t.length:Object.keys(t).length}var Ur=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var r=this.map[t];return void 0===r?e:r},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}(),Vr=1e-6;function Hr(t){return Math.abs(t)0!=Hr(s[1]-r)>0&&Hr(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}var Yr=function(t,e,r){return t>=e&&t<=r};function Xr(t){for(var e=[],r=t.length,n=0;n1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function Zr(t,e){var r=!1;return t.forEach(function(t){if(function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)/c,p=(i*s-o*a)/c;Yr(h,0,1)&&Yr(p,0,1)&&(f={x:t.x+h*a,y:t.y+h*s})}return f}(t.from,t.to,e.from,e.to))return r=!0,!1}),r}function Kr(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,r),maxY:Math.max.apply(null,r)}}function Jr(t,e){if(t.length<2||e.length<2)return!1;var r,n,i=Kr(t),o=Kr(e);if(r=i,(n=o).minX>r.maxX||n.maxXr.maxY||n.maxY1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");if(void 0!==r.output){if(!i(r.output))throw new TypeError("output option must be an array if specified");e=r.output}else e=new Array(t.length);var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;u1&&void 0!==arguments[1]?arguments[1]:{};if(!i(t))throw new TypeError("input must be an array");if(0===t.length)throw new TypeError("input must not be empty");var r=e.fromIndex,n=void 0===r?0:r,o=e.toIndex,a=void 0===o?t.length:o;if(n<0||n>=t.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(a<=n||a>t.length||!Number.isInteger(a))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var s=t[n],u=n+1;us&&(s=t[u]);return s}(t);if(n===o)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var a=r.min,s=void 0===a?r.autoMinMax?n:0:a,u=r.max,l=void 0===u?r.autoMinMax?o:1:u;if(s>=l)throw new RangeError("min option must be smaller than max option");for(var c=(l-s)/(o-n),f=0;f1&&void 0!==arguments[1]?arguments[1]:{},r=e.maxRows,n=void 0===r?15:r,i=e.maxColumns,o=void 0===i?10:i,u=e.maxNumSize,c=void 0===u?8:u;return"".concat(t.constructor.name," {\n").concat(a,"[\n").concat(s).concat(function(t,e,r,n){for(var i=t.rows,o=t.columns,a=Math.min(i,e),u=Math.min(o,r),c=[],f=0;fn)throw new RangeError("Row index out of range")}function h(t,e,r){var n=r?t.columns:t.columns-1;if(e<0||e>n)throw new RangeError("Column index out of range")}function p(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function d(t,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==t.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function y(t,e,r){return{row:v(t,e),column:g(t,r)}}function v(t,e){if("object"!==c(e))throw new TypeError("unexpected type for row indices");if(e.some(function(e){return e<0||e>=t.rows}))throw new RangeError("row indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function g(t,e){if("object"!==c(e))throw new TypeError("unexpected type for column indices");if(e.some(function(e){return e<0||e>=t.columns}))throw new RangeError("column indices are out of range");return Array.isArray(e)||(e=Array.from(e)),e}function m(t,e,r,n,i){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(x("startRow",e),x("endRow",r),x("startColumn",n),x("endColumn",i),e>r||n>i||e<0||e>=t.rows||r<0||r>=t.rows||n<0||n>=t.columns||i<0||i>=t.columns)throw new RangeError("Submatrix indices are out of range")}function b(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=[],n=0;nr?(i=!0,r=e):(n=!1,i=!0);t++}return n}},{key:"isReducedEchelonForm",value:function(){for(var t=0,e=0,r=-1,n=!0,i=!1;tr?(i=!0,r=e):(n=!1,i=!0);for(var o=e+1;ot.get(n,r)&&(n=i);if(0===t.get(n,r))r++;else{t.swapRows(e,n);for(var o=t.get(e,r),a=r;a=0;)if(0===t.maxRow(n))n--;else{for(var i=0,o=!1;i0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==k(t))throw new TypeError("options must be an object");var e=t.rows,r=void 0===e?1:e,n=t.columns,i=void 0===n?1:n;if(!Number.isInteger(r)||r<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");for(var o=new I(this.rows*r,this.columns*i),a=0;at&&(t=this.get(e,r));return t}},{key:"maxIndex",value:function(){for(var t=this.get(0,0),e=[0,0],r=0;rt&&(t=this.get(r,n),e[0]=r,e[1]=n);return e}},{key:"min",value:function(){for(var t=this.get(0,0),e=0;ee&&(e=this.get(t,r));return e}},{key:"maxRowIndex",value:function(t){f(this,t);for(var e=this.get(t,0),r=[t,0],n=1;ne&&(e=this.get(t,n),r[1]=n);return r}},{key:"minRow",value:function(t){f(this,t);for(var e=this.get(t,0),r=1;re&&(e=this.get(r,t));return e}},{key:"maxColumnIndex",value:function(t){h(this,t);for(var e=this.get(0,t),r=[0,t],n=1;ne&&(e=this.get(n,t),r[0]=n);return r}},{key:"minColumn",value:function(t){h(this,t);for(var e=this.get(0,t),r=1;r0&&void 0!==arguments[0]?arguments[0]:"frobenius",e=0;if("max"===t)return this.max();if("frobenius"===t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==k(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new I(this.rows,this.columns),s=0;s0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==k(t))throw new TypeError("options must be an object");var e=t.min,r=void 0===e?0:e,n=t.max,i=void 0===n?1:n;if(!Number.isFinite(r))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(r>=i)throw new RangeError("min must be smaller than max");for(var a=new I(this.rows,this.columns),s=0;s0&&void 0!==arguments[0]?arguments[0]:M,e=0;e0&&void 0!==arguments[0]?arguments[0]:M,e=0;er||e<0||e>=this.columns||r<0||r>=this.columns)throw new RangeError("Argument out of range");for(var n=new I(t.length,r-e+1),i=0;i=this.rows)throw new RangeError("Row index out of range: ".concat(t[i]));n.set(i,o-e,this.get(t[i],o))}return n}},{key:"subMatrixColumn",value:function(t,e,r){if(void 0===e&&(e=0),void 0===r&&(r=this.rows-1),e>r||e<0||e>=this.rows||r<0||r>=this.rows)throw new RangeError("Argument out of range");for(var n=new I(r-e+1,t.length),i=0;i=this.columns)throw new RangeError("Column index out of range: ".concat(t[i]));n.set(o-e,i,this.get(o,t[i]))}return n}},{key:"setSubMatrix",value:function(t,e,r){m(this,e,e+(t=I.checkMatrix(t)).rows-1,r,r+t.columns-1);for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if("object"===k(t)&&(e=t,t=void 0),"object"!==k(e))throw new TypeError("options must be an object");var r=e,n=r.unbiased,i=void 0===n||n,o=r.mean,a=void 0===o?this.mean(t):o;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(t){case"row":if(!Array.isArray(a))throw new TypeError("mean must be an array");return function(t,e,r){for(var n=t.rows,i=t.columns,o=[],a=0;a1&&void 0!==arguments[1]?arguments[1]:{};if("object"===k(t)&&(e=t,t=void 0),"object"!==k(e))throw new TypeError("options must be an object");var r=e.center,n=void 0===r?this.mean(t):r;switch(t){case"row":if(!Array.isArray(n))throw new TypeError("center must be an array");return function(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if("object"===k(t)&&(e=t,t=void 0),"object"!==k(e))throw new TypeError("options must be an object");var r=e.scale;switch(t){case"row":if(void 0===r)r=function(t){for(var e=[],r=0;r2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==k(r))throw new TypeError("options must be an object");for(var n=r.random,i=void 0===n?Math.random:n,o=new I(t,e),a=0;a2&&void 0!==arguments[2]?arguments[2]:{};if("object"!==k(r))throw new TypeError("options must be an object");var n=r.min,i=void 0===n?0:n,o=r.max,a=void 0===o?1e3:o,s=r.random,u=void 0===s?Math.random:s;if(!Number.isInteger(i))throw new TypeError("min must be an integer");if(!Number.isInteger(a))throw new TypeError("max must be an integer");if(i>=a)throw new RangeError("min must be smaller than max");for(var l=a-i,c=new I(t,e),f=0;f0){if(n.data=[],!(Number.isInteger(r)&&r>0))throw new TypeError("nColumns must be a positive integer");for(var i=0;i>t);return this},t.prototype.signPropagatingRightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r>t.get(r,n));return this},t.signPropagatingRightShift=function(t,r){return new e(t).signPropagatingRightShift(r)},t.prototype.rightShift=function(t){return"number"==typeof t?this.rightShiftS(t):this.rightShiftM(t)},t.prototype.rightShiftS=function(t){for(var e=0;e>>t);return this},t.prototype.rightShiftM=function(t){if(t=e.checkMatrix(t),this.rows!==t.rows||this.columns!==t.columns)throw new RangeError("Matrices dimensions must be equal");for(var r=0;r>>t.get(r,n));return this},t.rightShift=function(t,r){return new e(t).rightShift(r)},t.prototype.zeroFillRightShift=t.prototype.rightShift,t.prototype.zeroFillRightShiftS=t.prototype.rightShiftS,t.prototype.zeroFillRightShiftM=t.prototype.rightShiftM,t.zeroFillRightShift=t.rightShift,t.prototype.not=function(){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var i=n.rows,o=void 0===i?1:i;if(t.length%o!=0)throw new Error("the data length is not divisible by the number of rows");return(r=Qt(this,e)).rows=o,r.columns=t.length/o,r.data=t,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&te(t,e)}(e,P),r=e,(n=[{key:"set",value:function(t,e,r){var n=this._calculateIndex(t,e);return this.data[n]=r,this}},{key:"get",value:function(t,e){var r=this._calculateIndex(t,e);return this.data[r]}},{key:"_calculateIndex",value:function(t,e){return t*this.columns+e}}])&&Kt(r.prototype,n),i&&Kt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function re(t){"@babel/helpers - typeof";return(re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ne(t,e){for(var r=0;rMath.abs(l[o])&&(o=r);if(o!==n){for(i=0;i=0;i--){for(n=0;no?n.set(i,o,t.get(i,o)):i===o?n.set(i,o,1):n.set(i,o,0);return n}},{key:"upperTriangularMatrix",get:function(){for(var t=this.LU,e=t.rows,r=t.columns,n=new I(e,r),i=0;iMath.abs(e)?(r=e/t,Math.abs(t)*Math.sqrt(1+r*r)):0!==e?(r=t/e,Math.abs(e)*Math.sqrt(1+r*r)):0}function ye(t){"@babel/helpers - typeof";return(ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ve(t,e){for(var r=0;r=0;o--){for(i=0;i=0;r--){for(t=0;t1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n,i=(e=ue.checkMatrix(e)).rows,o=e.columns,a=r.computeLeftSingularVectors,s=void 0===a||a,u=r.computeRightSingularVectors,l=void 0===u||u,c=r.autoTranspose,f=void 0!==c&&c,h=Boolean(s),p=Boolean(l),d=!1;if(i=0;Z--)if(0!==m[Z]){for(var K=Z+1;K=0;nt--){if(nt0;){var ft=void 0,ht=void 0;for(ft=q-2;ft>=-1&&-1!==ft;ft--){var pt=Number.MIN_VALUE+ct*Math.abs(m[ft]+Math.abs(m[ft+1]));if(Math.abs(w[ft])<=pt||Number.isNaN(w[ft])){w[ft]=0;break}}if(ft===q-2)ht=4;else{var dt=void 0;for(dt=q-1;dt>=ft&&dt!==ft;dt--){var yt=(dt!==q?Math.abs(w[dt]):0)+(dt!==ft+1?Math.abs(w[dt-1]):0);if(Math.abs(m[dt])<=ct*yt){m[dt]=0;break}}dt===ft?ht=3:dt===q-1?ht=1:(ht=2,ft=dt)}switch(ft++,ht){case 1:var vt=w[q-2];w[q-2]=0;for(var gt=q-2;gt>=ft;gt--){var mt=de(m[gt],vt),bt=m[gt]/mt,xt=vt/mt;if(m[gt]=mt,gt!==ft&&(vt=-xt*w[gt-1],w[gt-1]=bt*w[gt-1]),p)for(var wt=0;wt=m[ft+1]);){var qt=m[ft];if(m[ft]=m[ft+1],m[ft+1]=qt,p&&fte&&i.set(o,a,t.get(o,a)/this.s[a]);for(var s=this.U,u=s.rows,l=s.columns,c=new I(r,u),f=0;ft&&e++;return e}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return I.diag(this.s)}}])&&xe(t.prototype,e),r&&xe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Se(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t=ue.checkMatrix(t),e?new _e(t).inverse():Ee(t,I.eye(t.rows))}function Ee(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t=ue.checkMatrix(t),e=ue.checkMatrix(e),r?new _e(t).solve(e):t.isSquare()?new pe(t).solve(e):new me(t).solve(e)}function ke(t){var e,r,n,i,o,a;if((t=I.checkMatrix(t)).isSquare())return 2===t.columns?(e=t.get(0,0),r=t.get(0,1),n=t.get(1,0),e*t.get(1,1)-r*n):3===t.columns?(i=new jt(t,[1,2],[1,2]),o=new jt(t,[1,2],[0,2]),a=new jt(t,[1,2],[0,1]),e=t.get(0,0),r=t.get(0,1),n=t.get(0,2),e*ke(i)-r*ke(o)+n*ke(a)):new pe(t).determinant;throw Error("determinant can only be calculated for a square matrix")}function Te(t,e){for(var r=[],n=0;n3&&void 0!==arguments[3]?arguments[3]:1e-9;if(t>(arguments.length>4&&void 0!==arguments[4]?arguments[4]:1e-9))return new Array(e.rows+1).fill(0);for(var i=e.addRow(r,[0]),o=0;o1&&void 0!==arguments[1]?arguments[1]:{},r=e.thresholdValue,n=void 0===r?1e-9:r,i=e.thresholdError,o=void 0===i?1e-9:i,a=(t=I.checkMatrix(t)).rows,s=new I(a,a),u=0;u1&&void 0!==arguments[1]?arguments[1]:Number.EPSILON;t=I.checkMatrix(t);for(var r=new _e(t,{autoTranspose:!0}),n=r.leftSingularVectors,i=r.rightSingularVectors,o=r.diagonal,a=0;ae?o[a]=1/o[a]:o[a]=0;return i.mmul(I.diag(o).mmul(n.transpose()))}function Pe(t){"@babel/helpers - typeof";return(Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Me(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new I(t);var n=!1;if("object"!==Pe(e)||I.isMatrix(e)||Array.isArray(e)?e=new I(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=r.center;(void 0===i||i)&&(t=t.center("column"),n||(e=e.center("column")));for(var o=t.transpose().mmul(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:t,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};t=new I(t);var n=!1;if("object"!==Ie(e)||I.isMatrix(e)||Array.isArray(e)?e=new I(e):(r=e,e=t,n=!0),t.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");var i=r,o=i.center,a=void 0===o||o,s=i.scale,u=void 0===s||s;a&&(t.center("column"),n||e.center("column")),u&&(t.scale("column"),n||e.scale("column"));for(var l=t.standardDeviation("column",{unbiased:!0}),c=n?l:e.standardDeviation("column",{unbiased:!0}),f=t.transpose().mmul(e),h=0;h1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var n=r.assumeSymmetric,i=void 0!==n&&n;if(!(e=ue.checkMatrix(e)).isSquare())throw new Error("Matrix is not a square matrix");var o,a,s=e.columns,u=new I(s,s),l=new Float64Array(s),c=new Float64Array(s),f=e;if(i||e.isSymmetric()){for(o=0;o0;s--){for(f=0,a=0,l=0;l0&&(o=-o),e[s]=f*o,a-=i*o,r[s-1]=i-o,u=0;ul)do{for(i=r[l],f=(r[l+1]-i)/(2*e[l]),h=de(f,1),f<0&&(h=-h),r[l]=e[l]/(f+h),r[l+1]=e[l]*(f+h),p=r[l+1],o=i-r[l],a=l+2;a=l;a--)for(v=y,y=d,b=m,i=d*e[a],o=d*f,h=de(f,e[a]),e[a+1]=m*h,m=e[a]/h,f=(d=f/h)*r[a]-m*i,r[a+1]=o+m*(d*i+m*r[a]),u=0;u_*w);r[l]=r[l]+x,e[l]=0}for(a=0;a=l;s--)r[s]=e.get(s,l-1)/c,a+=r[s]*r[s];for(o=Math.sqrt(a),r[l]>0&&(o=-o),a-=r[l]*o,r[l]=r[l]-o,u=l;u=l;s--)i+=r[s]*e.get(s,u);for(i/=a,s=l;s<=f;s++)e.set(s,u,e.get(s,u)-i*r[s])}for(s=0;s<=f;s++){for(i=0,u=f;u>=l;u--)i+=r[u]*e.get(s,u);for(i/=a,u=l;u<=f;u++)e.set(s,u,e.get(s,u)-i*r[u])}r[l]=c*r[l],e.set(l,l-1,c*o)}}for(s=0;s=1;l--)if(0!==e.get(l,l-1)){for(s=l+1;s<=f;s++)r[s]=e.get(s,l-1);for(u=l;u<=f;u++){for(o=0,s=l;s<=f;s++)o+=r[s]*n.get(s,u);for(o=o/r[l]/e.get(l,l-1),s=l;s<=f;s++)n.set(s,u,n.get(s,u)+o*r[s])}}}(s,h,p,u),function(t,e,r,n,i){var o,a,s,u,l,c,f,h,p,d,y,v,g,m,b,x=t-1,w=t-1,_=Number.EPSILON,S=0,E=0,k=0,T=0,C=0,O=0,A=0,P=0;for(o=0;ow)&&(r[o]=i.get(o,o),e[o]=0),a=Math.max(o-1,0);a=0;){for(u=x;u>0&&(0===(O=Math.abs(i.get(u-1,u-1))+Math.abs(i.get(u,u)))&&(O=E),!(Math.abs(i.get(u,u-1))<_*O));)u--;if(u===x)i.set(x,x,i.get(x,x)+S),r[x]=i.get(x,x),e[x]=0,x--,P=0;else if(u===x-1){if(f=i.get(x,x-1)*i.get(x-1,x),k=(i.get(x-1,x-1)-i.get(x,x))/2,T=k*k+f,A=Math.sqrt(Math.abs(T)),i.set(x,x,i.get(x,x)+S),i.set(x-1,x-1,i.get(x-1,x-1)+S),h=i.get(x,x),T>=0){for(A=k>=0?k+A:k-A,r[x-1]=h+A,r[x]=r[x-1],0!==A&&(r[x]=h-f/A),e[x-1]=0,e[x]=0,h=i.get(x,x-1),O=Math.abs(h)+Math.abs(A),k=h/O,T=A/O,C=Math.sqrt(k*k+T*T),k/=C,T/=C,a=x-1;a0){for(O=Math.sqrt(O),p=u&&(A=i.get(l,l),k=((C=h-A)*(O=p-A)-f)/i.get(l+1,l)+i.get(l,l+1),T=i.get(l+1,l+1)-A-C-O,C=i.get(l+2,l+1),O=Math.abs(k)+Math.abs(T)+Math.abs(C),k/=O,T/=O,C/=O,l!==u)&&!(Math.abs(i.get(l,l-1))*(Math.abs(T)+Math.abs(C))<_*(Math.abs(k)*(Math.abs(i.get(l-1,l-1))+Math.abs(A)+Math.abs(i.get(l+1,l+1)))));)l--;for(o=l+2;o<=x;o++)i.set(o,o-2,0),o>l+2&&i.set(o,o-3,0);for(s=l;s<=x-1&&(m=s!==x-1,s!==l&&(k=i.get(s,s-1),T=i.get(s+1,s-1),C=m?i.get(s+2,s-1):0,0!==(h=Math.abs(k)+Math.abs(T)+Math.abs(C))&&(k/=h,T/=h,C/=h)),0!==h);s++)if(O=Math.sqrt(k*k+T*T+C*C),k<0&&(O=-O),0!==O){for(s!==l?i.set(s,s-1,-O*h):u!==l&&i.set(s,s-1,-i.get(s,s-1)),h=(k+=O)/O,p=T/O,A=C/O,T/=k,C/=k,a=s;a=0;x--)if(k=r[x],0===(T=e[x]))for(u=x,i.set(x,x,1),o=x-1;o>=0;o--){for(f=i.get(o,o)-k,C=0,a=u;a<=x;a++)C+=i.get(o,a)*i.get(a,x);if(e[o]<0)A=f,O=C;else if(u=o,0===e[o]?i.set(o,x,0!==f?-C/f:-C/(_*E)):(h=i.get(o,o+1),p=i.get(o+1,o),T=(r[o]-k)*(r[o]-k)+e[o]*e[o],c=(h*O-A*C)/T,i.set(o,x,c),i.set(o+1,x,Math.abs(h)>Math.abs(A)?(-C-f*c)/h:(-O-p*c)/A)),c=Math.abs(i.get(o,x)),_*c*c>1)for(a=o;a<=x;a++)i.set(a,x,i.get(a,x)/c)}else if(T<0)for(u=x-1,Math.abs(i.get(x,x-1))>Math.abs(i.get(x-1,x))?(i.set(x-1,x-1,T/i.get(x,x-1)),i.set(x-1,x,-(i.get(x,x)-k)/i.get(x,x-1))):(b=Be(0,-i.get(x-1,x),i.get(x-1,x-1)-k,T),i.set(x-1,x-1,b[0]),i.set(x-1,x,b[1])),i.set(x,x-1,0),i.set(x,x,1),o=x-2;o>=0;o--){for(d=0,y=0,a=u;a<=x;a++)d+=i.get(o,a)*i.get(a,x-1),y+=i.get(o,a)*i.get(a,x);if(f=i.get(o,o)-k,e[o]<0)A=f,C=d,O=y;else if(u=o,0===e[o]?(b=Be(-d,-y,f,T),i.set(o,x-1,b[0]),i.set(o,x,b[1])):(h=i.get(o,o+1),p=i.get(o+1,o),v=(r[o]-k)*(r[o]-k)+e[o]*e[o]-T*T,g=2*(r[o]-k)*T,0===v&&0===g&&(v=_*E*(Math.abs(f)+Math.abs(T)+Math.abs(h)+Math.abs(p)+Math.abs(A))),b=Be(h*C-A*d+T*y,h*O-A*y-T*d,v,g),i.set(o,x-1,b[0]),i.set(o,x,b[1]),Math.abs(h)>Math.abs(A)+Math.abs(T)?(i.set(o+1,x-1,(-d-f*i.get(o,x-1)+T*i.get(o,x))/h),i.set(o+1,x,(-y-f*i.get(o,x)-T*i.get(o,x-1))/h)):(b=Be(-C-p*i.get(o,x-1),-O-p*i.get(o,x),A,T),i.set(o+1,x-1,b[0]),i.set(o+1,x,b[1]))),c=Math.max(Math.abs(i.get(o,x-1)),Math.abs(i.get(o,x))),_*c*c>1)for(a=o;a<=x;a++)i.set(a,x-1,i.get(a,x-1)/c),i.set(a,x,i.get(a,x)/c)}for(o=0;ow)for(a=o;a=0;a--)for(o=0;o<=w;o++){for(A=0,s=0;s<=Math.min(a,w);s++)A+=n.get(o,s)*i.get(s,a);n.set(o,a,A)}}}(s,c,l,u,h)}this.n=s,this.e=c,this.d=l,this.V=u},(e=[{key:"realEigenvalues",get:function(){return Array.from(this.d)}},{key:"imaginaryEigenvalues",get:function(){return Array.from(this.e)}},{key:"eigenvectorMatrix",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){var t,e,r=this.n,n=this.e,i=this.d,o=new I(r,r);for(t=0;t0?o.set(t,t+1,n[t]):n[t]<0&&o.set(t,t-1,n[t])}return o}}])&&Ne(t.prototype,e),r&&Ne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Be(t,e,r,n){var i,o;return Math.abs(r)>Math.abs(n)?[(t+(i=n/r)*e)/(o=r+i*n),(e-i*t)/o]:[((i=r/n)*t+e)/(o=n+i*r),(i*e-t)/o]}function Fe(t){"@babel/helpers - typeof";return(Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ze(t,e){for(var r=0;r0,s.set(n,n,Math.sqrt(Math.max(l,0))),i=n+1;i=0;o--)for(i=0;i1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=ue.checkMatrix(e);var n,i=r.Y,o=r.scaleScores,a=void 0!==o&&o,s=r.maxIterations,u=void 0===s?1e3:s,l=r.terminationCriteria,c=void 0===l?1e-10:l;if(i){if(!(i=Array.isArray(i)&&"number"==typeof i[0]?I.columnVector(i):ue.checkMatrix(i)).isColumnVector()||i.rows!==e.rows)throw new Error("Y must be a column vector of length X.rows");n=i}else n=e.getColumnVector(0);for(var f,h,p,d,y=1,v=0;vc;v++)p=(p=e.transpose().mmul(n).div(n.transpose().mmul(n).get(0,0))).div(p.norm()),f=e.mmul(p).div(p.transpose().mmul(p).get(0,0)),v>0&&(y=f.clone().sub(d).pow(2).sum()),d=f.clone(),i?(h=(h=i.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0))).div(h.norm()),n=i.mmul(h).div(h.transpose().mmul(h).get(0,0))):n=f;if(i){var g=e.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0));g=g.div(g.norm());var m=e.clone().sub(f.clone().mmul(g.transpose())),b=n.transpose().mmul(f).div(f.transpose().mmul(f).get(0,0)),x=i.clone().sub(f.clone().mulS(b.get(0,0)).mmul(h.transpose()));this.t=f,this.p=g.transpose(),this.w=p.transpose(),this.q=h,this.u=n,this.s=f.transpose().mmul(f),this.xResidual=m,this.yResidual=x,this.betas=b}else this.w=p.transpose(),this.s=f.transpose().mmul(f).sqrt(),this.t=a?f.clone().div(this.s.get(0,0)):f,this.xResidual=e.sub(f.mmul(p.transpose()))})},5776:function(t,e,r){"use strict";r.d(e,{IW:function(){return o},LL:function(){return l},XA:function(){return a},g:function(){return s},pd:function(){return u}});var n=r(9019),i=r(4732);function o(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromTranslation(i,r),n.multiply(t,i,e)}function a(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromRotation(i,r),n.multiply(t,i,e)}function s(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.fromScaling(i,r),n.multiply(t,i,e)}function u(t,e){for(var r,i,u,l=t?[].concat(t):[1,0,0,0,1,0,0,0,1],c=0,f=e.length;c=0;return r?o?2*Math.PI-n:n:o?n:2*Math.PI-n}},2596:function(t,e,r){"use strict";var n=r(621);function i(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromTranslation(i,r),n.mat3.multiply(t,i,e)}function o(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromRotation(i,r),n.mat3.multiply(t,i,e)}function a(t,e,r){var i=[0,0,0,0,0,0,0,0,0];return n.mat3.fromScaling(i,r),n.mat3.multiply(t,i,e)}function s(t,e){return t[0]*e[1]-e[0]*t[1]}e.pd=function(t,e){for(var r,s,u,l=t?[].concat(t):[1,0,0,0,1,0,0,0,1],c=0,f=e.length;c1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}(0,n.each)(t,function(e,r){isNaN(e)||(t[r]=+e)}),e[r]=t}),e):void 0},s=r(4732);var u=function(t,e,r){void 0===e&&(e=!1),void 0===r&&(r=[[0,0],[1,1]]);for(var n=!!e,i=[],o=0,a=t.length;o2&&(r.push([n].concat(o.splice(0,2))),a="l",n="m"===n?"l":"L"),"o"===a&&1===o.length&&r.push([n,o[0]]),"r"===a)r.push([n].concat(o));else for(;o.length>=e[a]&&(r.push([n].concat(o.splice(0,e[a]))),e[a]););return""}),r}var p=/[a-z]/;function d(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function y(t){var e=h(t);if(!e||!e.length)return[["M",0,0]];for(var r=!1,n=0;n=0){r=!0;break}}if(!r)return e;var o=[],a=0,s=0,u=0,l=0,c=0,f=e[0];"M"!==f[0]&&"m"!==f[0]||(u=a=+f[1],l=s=+f[2],c++,o[0]=["M",a,s]);n=c;for(var y=e.length;n1&&(r*=Math.sqrt(d),i*=Math.sqrt(d));var y=r*r*(p*p)+i*i*(h*h),v=y?Math.sqrt((r*r*(i*i)-y)/y):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var x=i?v*r*p/i:0,w=r?v*-i*h/r:0,_=(u+c)/2+Math.cos(o)*x-Math.sin(o)*w,S=(l+f)/2+Math.sin(o)*x+Math.cos(o)*w,E=[(h-x)/r,(p-w)/i],k=[(-1*h-x)/r,(-1*p-w)/i],T=m([1,0],E),C=m(E,k);return g(E,k)<=-1&&(C=Math.PI),g(E,k)>=1&&(C=0),0===s&&C>0&&(C-=2*Math.PI),1===s&&C<0&&(C+=2*Math.PI),{cx:_,cy:S,rx:b(t,[c,f])?0:r,ry:b(t,[c,f])?0:i,startAngle:T,endAngle:T+C,xRotation:o,arcFlag:a,sweepFlag:s}}function w(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function _(t){for(var e=[],r=null,n=null,i=null,o=0,s=(t=a(t)).length,u=0;u0!=E(s[1]-r)>0&&E(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}var C=function(t,e,r){return t>=e&&t<=r};function O(t){for(var e=[],r=t.length,n=0;n1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e}function A(t,e){var r=!1;return(0,n.each)(t,function(t){if(function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=null;if(c*c>.001*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)/c,p=(i*s-o*a)/c;C(h,0,1)&&C(p,0,1)&&(f={x:t.x+h*a,y:t.y+h*s})}return f}(t.from,t.to,e.from,e.to))return r=!0,!1}),r}function P(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,r),maxY:Math.max.apply(null,r)}}function M(t,e){if(t.length<2||e.length<2)return!1;var r,i,o=P(t),a=P(e);if(r=o,(i=a).minX>r.maxX||i.maxXr.maxY||i.maxY-1},o=function(t,e){if(!n(t))return t;for(var r=[],i=0;i-1;)A.call(t,o,1);return t},I=Array.prototype.splice,L=function(t,e){if(!n(t))return[];for(var r=t?e.length:0,i=r-1;r--;){var o=void 0,a=e[r];r!==i&&a===o||(o=a,I.call(t,a,1))}return t},j=function(t,e,r){if(!f(t)&&!b(t))return t;var n=r;return d(t,function(t,r){n=e(n,t,r)}),n},N=function(t,e){var r=[];if(!n(t))return r;for(var i=-1,o=[],a=t.length;++ie[i])return 1;if(t[i]r?r:t},nt=function(t,e){var r=e.toString(),n=r.indexOf(".");if(-1===n)return Math.round(t);var i=r.substr(n+1).length;return i>20&&(i=20),parseFloat(t.toFixed(i))},it=function(t){return u(t,"Number")},ot=function(t){return it(t)&&t%1!=0},at=function(t){return it(t)&&t%2==0},st=Number.isInteger?Number.isInteger:function(t){return it(t)&&t%1==0},ut=function(t){return it(t)&&t<0},lt=1e-5;function ct(t,e,r){return void 0===r&&(r=lt),Math.abs(t-e)0},pt=function(t,e){if(f(t)){for(var r,n=-1/0,i=0;in&&(r=o,n=a)}return r}},dt=function(t,e){if(f(t)){for(var r,n=1/0,i=0;ie?(n&&(clearTimeout(n),n=null),s=l,a=t.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,c)),a};return l.cancel=function(){clearTimeout(n),s=0,n=i=o=null},l},me=function(t){return n(t)?Array.prototype.slice.call(t):[]},be={},xe=function(t){return be[t=t||"g"]?be[t]+=1:be[t]=1,t+be[t]},we=function(){},_e=function(t){return t};function Se(t){return c(t)?0:n(t)?t.length:Object.keys(t).length}var Ee,ke=r(1635),Te=$t(function(t,e){void 0===e&&(e={});var r=e.fontSize,n=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Ee||(Ee=document.createElement("canvas").getContext("2d")),Ee.font=[o,a,i,r+"px",n].join(" "),Ee.measureText(R(t)?t:"").width},function(t,e){return void 0===e&&(e={}),(0,ke.__spreadArrays)([t],Et(e)).join("")}),Ce=function(t,e,r,n){void 0===n&&(n="...");var i,o,a=Te(n,r),s=R(t)?t:Tt(t),u=e,l=[];if(Te(t,r)<=e)return t;for(;i=s.substr(0,16),!((o=Te(i,r))+a>u&&o>u);)if(l.push(i),u-=o,!(s=s.substr(16)))return l.join("");for(;i=s.substr(0,1),!((o=Te(i,r))+a>u);)if(l.push(i),u-=o,!(s=s.substr(1)))return l.join("");return""+l.join("")+n},Oe=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var r=this.map[t];return void 0===r?e:r},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}()},5805:function(t,e,r){var n=r(3970),i={};for(var o in n)n.hasOwnProperty(o)&&(i[n[o]]=o);var a=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var s in a)if(a.hasOwnProperty(s)){if(!("channels"in a[s]))throw new Error("missing channels property: "+s);if(!("labels"in a[s]))throw new Error("missing channel labels property: "+s);if(a[s].labels.length!==a[s].channels)throw new Error("channel and label counts mismatch: "+s);var u=a[s].channels,l=a[s].labels;delete a[s].channels,delete a[s].labels,Object.defineProperty(a[s],"channels",{value:u}),Object.defineProperty(a[s],"labels",{value:l})}a.rgb.hsl=function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a;return s===a?e=0:n===s?e=(i-o)/u:i===s?e=2+(o-n)/u:o===s&&(e=4+(n-i)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(a+s)/2,[e,100*(s===a?0:r<=.5?u/(s+a):u/(2-s-a)),100*r]},a.rgb.hsv=function(t){var e,r,n,i,o,a=t[0]/255,s=t[1]/255,u=t[2]/255,l=Math.max(a,s,u),c=l-Math.min(a,s,u),f=function(t){return(l-t)/6/c+.5};return 0===c?i=o=0:(o=c/l,e=f(a),r=f(s),n=f(u),a===l?i=n-r:s===l?i=1/3+e-n:u===l&&(i=2/3+r-e),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*l]},a.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[a.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(r,n))),100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},a.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-i)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-i-e)/(1-e)||0),100*e]},a.rgb.keyword=function(t){var e=i[t];if(e)return e;var r,o,a,s=1/0;for(var u in n)if(n.hasOwnProperty(u)){var l=n[u],c=(o=t,a=l,Math.pow(o[0]-a[0],2)+Math.pow(o[1]-a[1],2)+Math.pow(o[2]-a[2],2));c.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},a.rgb.lab=function(t){var e=a.rgb.xyz(t),r=e[0],n=e[1],i=e[2];return n/=100,i/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},a.hsl.rgb=function(t){var e,r,n,i,o,a=t[0]/360,s=t[1]/100,u=t[2]/100;if(0===s)return[o=255*u,o,o];e=2*u-(r=u<.5?u*(1+s):u+s-u*s),i=[0,0,0];for(var l=0;l<3;l++)(n=a+1/3*-(l-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,i[l]=255*o;return i},a.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,i=r,o=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,i*=o<=1?o:2-o,[e,100*(0===n?2*i/(o+i):2*r/(n+r)),100*((n+r)/2)]},a.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,i=Math.floor(e)%6,o=e-Math.floor(e),a=255*n*(1-r),s=255*n*(1-r*o),u=255*n*(1-r*(1-o));switch(n*=255,i){case 0:return[n,u,a];case 1:return[s,n,a];case 2:return[a,n,u];case 3:return[a,s,n];case 4:return[u,a,n];case 5:return[n,a,s]}},a.hsv.hsl=function(t){var e,r,n,i=t[0],o=t[1]/100,a=t[2]/100,s=Math.max(a,.01);return n=(2-o)*a,r=o*s,[i,100*(r=(r/=(e=(2-o)*s)<=1?e:2-e)||0),100*(n/=2)]},a.hwb.rgb=function(t){var e,r,n,i,o,a,s,u=t[0]/360,l=t[1]/100,c=t[2]/100,f=l+c;switch(f>1&&(l/=f,c/=f),r=1-c,n=6*u-(e=Math.floor(6*u)),0!=(1&e)&&(n=1-n),i=l+n*(r-l),e){default:case 6:case 0:o=r,a=i,s=l;break;case 1:o=i,a=r,s=l;break;case 2:o=l,a=r,s=i;break;case 3:o=l,a=i,s=r;break;case 4:o=i,a=l,s=r;break;case 5:o=r,a=l,s=i}return[255*o,255*a,255*s]},a.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,i=t[3]/100;return[255*(1-Math.min(1,e*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},a.xyz.rgb=function(t){var e,r,n,i=t[0]/100,o=t[1]/100,a=t[2]/100;return r=-.9689*i+1.8758*o+.0415*a,n=.0557*i+-.204*o+1.057*a,e=(e=3.2406*i+-1.5372*o+-.4986*a)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},a.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},a.lab.xyz=function(t){var e,r,n,i=t[0],o=t[1],a=t[2];e=o/500+(r=(i+16)/116),n=r-a/200;var s=Math.pow(r,3),u=Math.pow(e,3),l=Math.pow(n,3);return r=s>.008856?s:(r-16/116)/7.787,e=u>.008856?u:(e-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},a.lab.lch=function(t){var e,r=t[0],n=t[1],i=t[2];return(e=360*Math.atan2(i,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+i*i),e]},a.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},a.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],i=1 in arguments?arguments[1]:a.rgb.hsv(t)[2];if(0===(i=Math.round(i/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===i&&(o+=60),o},a.hsv.ansi16=function(t){return a.rgb.ansi16(a.hsv.rgb(t),t[2])},a.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},a.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},a.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},a.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map(function(t){return t+t}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.max(Math.max(n,i),o),s=Math.min(Math.min(n,i),o),u=a-s;return e=u<1?s/(1-u):0,r=u<=0?0:a===n?(i-o)/u%6:a===i?2+(o-n)/u:4+(n-i)/u+4,r/=6,[360*(r%=1),100*u,100*e]},a.hsl.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=1,i=0;return(n=r<.5?2*e*r:2*e*(1-r))<1&&(i=(r-.5*n)/(1-n)),[t[0],100*n,100*i]},a.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},a.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var i,o=[0,0,0],a=e%1*6,s=a%1,u=1-s;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return i=(1-r)*n,[255*(r*o[0]+i),255*(r*o[1]+i),255*(r*o[2]+i)]},a.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},a.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},a.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},a.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,i=0;return n<1&&(i=(r-n)/(1-n)),[t[0],100*n,100*i]},a.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},a.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},a.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},a.gray.hsl=a.gray.hsv=function(t){return[0,0,t[0]]},a.gray.hwb=function(t){return[0,100,t[0]]},a.gray.cmyk=function(t){return[0,0,0,t[0]]},a.gray.lab=function(t){return[t[0],0,0]},a.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},2832:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(5805),o=r(3617),a={};Object.keys(i).forEach(function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:i[t].channels}),Object.defineProperty(a[t],"labels",{value:i[t].labels});var e=o(t);Object.keys(e).forEach(function(r){var i=e[r];a[t][r]=function(t){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var r=t(e);if("object"===n(r))for(var i=r.length,o=0;o1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(i)})}),t.exports=a},3617:function(t,e,r){var n=r(5805);function i(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,i=0;i=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return a[t.slice(0,3)]}},2630:function(t,e,r){"use strict";function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=r(1288),o=r(2832),a=[].slice,s=["keyword","gray","hex"],u={};Object.keys(o).forEach(function(t){u[a.call(o[t].labels).sort().join("")]=t});var l={};function c(t,e){if(!(this instanceof c))return new c(t,e);if(e&&e in s&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var r,n;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof c)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var f=i.get(t);if(null===f)throw new Error("Unable to parse color from string: "+t);this.model=f.model,n=o[this.model].channels,this.color=f.value.slice(0,n),this.valpha="number"==typeof f.value[n]?f.value[n]:1}else if(t.length){this.model=e||"rgb",n=o[this.model].channels;var h=a.call(t,0,n);this.color=p(h,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var d=Object.keys(t);"alpha"in t&&(d.splice(d.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var y=d.sort().join("");if(!(y in u))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=u[y];var v=o[this.model].labels,g=[];for(r=0;rr?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return c.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+n(t));var r=t.rgb(),i=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=r.alpha()-i.alpha(),u=((a*s==-1?a:(a+s)/(1+a*s))+1)/2,l=1-u;return c.rgb(u*r.red()+l*i.red(),u*r.green()+l*i.green(),u*r.blue()+l*i.blue(),r.alpha()*o+i.alpha()*(1-o))}},Object.keys(o).forEach(function(t){if(-1===s.indexOf(t)){var e=o[t].channels;c.prototype[t]=function(){if(this.model===t)return new c(this);if(arguments.length)return new c(arguments,t);var r,n="number"==typeof arguments[e]?e:this.valpha;return new c((r=o[this.model][t].raw(this.color),Array.isArray(r)?r:[r]).concat(n),t)},c[t]=function(r){return"number"==typeof r&&(r=p(a.call(arguments),e)),new c(r,t)}}}),t.exports=c},3472:function(t,e,r){"use strict";function n(t,e){var r,n=1;function i(){var i,o,a=r.length,s=0,u=0;for(i=0;ip+c||id+c||of.index){var h=p-s.x-s.vx,g=d-s.y-s.vy,m=h*h+g*g;mt.r&&(t.r=t[e].r)}function p(){if(e){var n,i,o=e.length;for(r=new Array(o),n=0;n=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}})),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a0)for(var r,n,i=new Array(r),o=0;o1?(null==r?u.delete(t):u.set(t,y(r)),e):u.get(t)},find:function(e,r,n){var i,o,a,s,u,l=0,c=t.length;for(null==n?n=1/0:n*=n,l=0;l1?(c.on(t,r),e):c.on(t)}}}function A(){var t,e,r,n,s,u=o(-30),l=1,c=1/0,f=.81;function h(r){var o,a=t.length,s=(0,i.A)(t,E,k).visitAfter(d);for(n=r,o=0;o=c)){(t.data!==e||t.next)&&(0===h&&(y+=(h=a(r))*h),0===p&&(y+=(p=a(r))*p),y=(o=(y+g)/2))?y=o:g=o,(c=r>=(a=(v+m)/2))?v=a:m=a,i=p,!(p=p[f=c<<1|l]))return i[f]=d,t;if(s=+t._x.call(null,p.data),u=+t._y.call(null,p.data),e===s&&r===u)return d.next=p,i?i[f]=d:t._root=d,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(y+g)/2))?y=o:g=o,(c=r>=(a=(v+m)/2))?v=a:m=a}while((f=c<<1|l)==(h=(u>=a)<<1|s>=o));return i[h]=p,i[f]=d,t}function i(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i}function o(t){return t[0]}function a(t){return t[1]}function s(t,e,r){var n=new u(null==e?o:e,null==r?a:r,NaN,NaN,NaN,NaN);return null==t?n:n.addAll(t)}function u(t,e,r,n,i,o){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=o,this._root=void 0}function l(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}r.d(e,{A:function(){return s}});var c=s.prototype=u.prototype;c.copy=function(){var t,e,r=new u(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=l(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=l(e));return r},c.add=function(t){var e=+this._x.call(null,t),r=+this._y.call(null,t);return n(this.cover(e,r),e,r,t)},c.addAll=function(t){var e,r,i,o,a=t.length,s=new Array(a),u=new Array(a),l=1/0,c=1/0,f=-1/0,h=-1/0;for(r=0;rf&&(f=i),oh&&(h=o));if(l>f||c>h)return this;for(this.cover(l,c).cover(f,h),r=0;rt||t>=i||n>e||e>=o;)switch(s=(ep||(a=l.y0)>d||(s=l.x1)=m)<<1|t>=g)&&(l=y[y.length-1],y[y.length-1]=y[y.length-1-c],y[y.length-1-c]=l)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),w=b*b+x*x;if(w=(s=(d+v)/2))?d=s:v=s,(c=a>=(u=(y+g)/2))?y=u:g=u,e=p,!(p=p[f=c<<1|l]))return this;if(!p.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;p.data!==t;)if(n=p,!(p=p.next))return this;return(i=p.next)&&delete p.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(p=e[0]||e[1]||e[2]||e[3])&&p===(e[3]||e[2]||e[1]||e[0])&&!p.length&&(r?r[h]=p:this._root=p),this):(this._root=i,this)},c.removeAll=function(t){for(var e=0,r=t.length;e=0&&e._call.call(null,t),e=e._next;--a}()}finally{a=0,function(){var t,e,r=i,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:i=e);o=t,w(n)}(),f=0}}function x(){var t=p.now(),e=t-c;e>l&&(h-=e,c=t)}function w(t){a||(s&&(s=clearTimeout(s)),t-f>24?(t<1/0&&(s=setTimeout(b,t-p.now()-h)),u&&(u=clearInterval(u))):(u||(c=p.now(),u=setInterval(x,l)),a=1,d(b)))}g.prototype=m.prototype={constructor:g,restart:function(t,e,r){if("function"!=typeof t)throw new TypeError("callback is not a function");r=(null==r?y():+r)+(null==e?0:+e),this._next||o===this||(o?o._next=this:i=this,o=this),this._call=t,this._time=r,w()},stop:function(){this._call&&(this._call=null,this._time=1/0,w())}}},3963:function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=l(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function i(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e,r){return e=a(e),function(t,e){if(e&&("object"==y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return function(){return!!t}()}()?Reflect.construct(e,r||[],a(t).constructor):e.apply(t,r))}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function u(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,a=JSON.parse(JSON.stringify(o)),s=(null===(t=null==i?void 0:i.graph)||void 0===t?void 0:t.meta)||{},u=(null===(e=null==i?void 0:i.subScene)||void 0===e?void 0:e.meta)||{},l=(null===(r=null==i?void 0:i.nodeSize)||void 0===r?void 0:r.meta)||{},c=(null===(n=null==i?void 0:i.nodeSize)||void 0===n?void 0:n.node)||{},f=a.nodeSize.bridge;return{graph:{meta:Object.assign(a.graph.meta,s)},subScene:{meta:Object.assign(a.subScene.meta,u)},nodeSize:{meta:Object.assign(a.nodeSize.meta,l),node:Object.assign(a.nodeSize.node,c),bridge:f}}}function m(t){return"◬".concat(t,"◬")}var b,x,w,_,S=m("ROOT"),E=m("BRIDGE_GRAPH");!function(t){t[t.META=0]="META",t[t.NODE=1]="NODE",t[t.BRIDGE=2]="BRIDGE"}(b||(b={})),function(t){t[t.INCLUDE=0]="INCLUDE",t[t.EXCLUDE=1]="EXCLUDE",t[t.UNSPECIFIED=2]="UNSPECIFIED"}(x||(x={})),function(t){t[t.META=0]="META",t[t.CORE=1]="CORE",t[t.BRIDGE=2]="BRIDGE"}(w||(w={})),function(t){t[t.META=0]="META",t[t.OP=1]="OP",t[t.SERIES=2]="SERIES"}(_||(_={}));var k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function T(t,e){return t(e={exports:{}},e.exports),e.exports}var C=function(t,e){return t===e||t!=t&&e!=e},O=function(t,e){for(var r=t.length;r--;)if(C(t[r][0],e))return r;return-1},A=Array.prototype.splice;function P(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1},P.prototype.set=function(t,e){var r=this.__data__,n=O(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var M,I=P,L="object"==y(k)&&k&&k.Object===Object&&k,j="object"==("undefined"==typeof self?"undefined":y(self))&&self&&self.Object===Object&&self,N=L||j||Function("return this")(),R=N.Symbol,D=Object.prototype,B=D.hasOwnProperty,F=D.toString,z=R?R.toStringTag:void 0,G=Object.prototype.toString,U=R?R.toStringTag:void 0,V=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":U&&U in Object(t)?function(t){var e=B.call(t,z),r=t[z];try{t[z]=void 0;var n=!0}catch(t){}var i=F.call(t);return n&&(e?t[z]=r:delete t[z]),i}(t):function(t){return G.call(t)}(t)},H=function(t){var e=y(t);return null!=t&&("object"==e||"function"==e)},W=function(t){if(!H(t))return!1;var e=V(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},q=N["__core-js_shared__"],Y=(M=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",X=Function.prototype.toString,Z=function(t){if(null!=t){try{return X.call(t)}catch(t){}try{return t+""}catch(t){}}return""},K=/^\[object .+?Constructor\]$/,J=Function.prototype,Q=Object.prototype,$=J.toString,tt=Q.hasOwnProperty,et=RegExp("^"+$.call(tt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=function(t){return!(!H(t)||function(t){return!!Y&&Y in t}(t))&&(W(t)?et:K).test(Z(t))},nt=function(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return rt(r)?r:void 0},it=nt(N,"Map"),ot=nt(Object,"create"),at=Object.prototype.hasOwnProperty,st=Object.prototype.hasOwnProperty;function ut(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Lt={};Lt["[object Float32Array]"]=Lt["[object Float64Array]"]=Lt["[object Int8Array]"]=Lt["[object Int16Array]"]=Lt["[object Int32Array]"]=Lt["[object Uint8Array]"]=Lt["[object Uint8ClampedArray]"]=Lt["[object Uint16Array]"]=Lt["[object Uint32Array]"]=!0,Lt["[object Arguments]"]=Lt["[object Array]"]=Lt["[object ArrayBuffer]"]=Lt["[object Boolean]"]=Lt["[object DataView]"]=Lt["[object Date]"]=Lt["[object Error]"]=Lt["[object Function]"]=Lt["[object Map]"]=Lt["[object Number]"]=Lt["[object Object]"]=Lt["[object RegExp]"]=Lt["[object Set]"]=Lt["[object String]"]=Lt["[object WeakMap]"]=!1;var jt=function(t){return function(e){return t(e)}},Nt=T(function(t,e){var r=e&&!e.nodeType&&e,n=r&&t&&!t.nodeType&&t,i=n&&n.exports===r&&L.process,o=function(){try{return n&&n.require&&n.require("util").types||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o}),Rt=Nt&&Nt.isTypedArray,Dt=Rt?jt(Rt):function(t){return wt(t)&&It(t.length)&&!!Lt[V(t)]},Bt=Object.prototype.hasOwnProperty,Ft=function(t,e){var r=Ct(t),n=!r&&Tt(t),i=!r&&!n&&At(t),o=!r&&!n&&!i&&Dt(t),a=r||n||i||o,s=a?function(t,e){for(var r=-1,n=Array(t);++rs))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,h=!0,p=2&r?new qe:void 0;for(o.set(t,e),o.set(e,t);++f0&&n(u)?r>1?t(u,r-1,n,i,o):ie(o,u):i||(o[o.length]=u)}return o},on=Math.max,an=function(t,e,r){return e=on(void 0===e?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=on(n.length-e,0),a=Array(o);++i0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(sn),cn=function(t,e){return ln(an(t,e,Ge),t+"")},fn=function(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o-1},dn=function(t,e,r){for(var n=-1,i=null==t?0:t.length;++n=200){var l=e?null:yn(t);if(l)return Je(l);a=!1,i=Xe,u=new qe}else u=e?[]:s;t:for(;++no){var a=i;i=o,o=a}return i+""+o+""+(bn.isUndefined(n)?"\0":n)}function kn(t,e){return En(t,e.v,e.w,e.name)}wn.prototype._nodeCount=0,wn.prototype._edgeCount=0,wn.prototype.isDirected=function(){return this._isDirected},wn.prototype.isMultigraph=function(){return this._isMultigraph},wn.prototype.isCompound=function(){return this._isCompound},wn.prototype.setGraph=function(t){return this._label=t,this},wn.prototype.graph=function(){return this._label},wn.prototype.setDefaultNodeLabel=function(t){return bn.isFunction(t)||(t=bn.constant(t)),this._defaultNodeLabelFn=t,this},wn.prototype.nodeCount=function(){return this._nodeCount},wn.prototype.nodes=function(){return bn.keys(this._nodes)},wn.prototype.sources=function(){var t=this;return bn.filter(this.nodes(),function(e){return bn.isEmpty(t._in[e])})},wn.prototype.sinks=function(){var t=this;return bn.filter(this.nodes(),function(e){return bn.isEmpty(t._out[e])})},wn.prototype.setNodes=function(t,e){var r=arguments,n=this;return bn.each(t,function(t){r.length>1?n.setNode(t,e):n.setNode(t)}),this},wn.prototype.setNode=function(t,e){return bn.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]="\0",this._children[t]={},this._children["\0"][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)},wn.prototype.node=function(t){return this._nodes[t]},wn.prototype.hasNode=function(t){return bn.has(this._nodes,t)},wn.prototype.removeNode=function(t){var e=this;if(bn.has(this._nodes,t)){var r=function(t){e.removeEdge(e._edgeObjs[t])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],bn.each(this.children(t),function(t){e.setParent(t)}),delete this._children[t]),bn.each(bn.keys(this._in[t]),r),delete this._in[t],delete this._preds[t],bn.each(bn.keys(this._out[t]),r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this},wn.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(bn.isUndefined(e))e="\0";else{for(var r=e+="";!bn.isUndefined(r);r=this.parent(r))if(r===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this},wn.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]},wn.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if("\0"!==e)return e}},wn.prototype.children=function(t){if(bn.isUndefined(t)&&(t="\0"),this._isCompound){var e=this._children[t];if(e)return bn.keys(e)}else{if("\0"===t)return this.nodes();if(this.hasNode(t))return[]}},wn.prototype.predecessors=function(t){var e=this._preds[t];if(e)return bn.keys(e)},wn.prototype.successors=function(t){var e=this._sucs[t];if(e)return bn.keys(e)},wn.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return bn.union(e,this.successors(t))},wn.prototype.isLeaf=function(t){return 0===(this.isDirected()?this.successors(t):this.neighbors(t)).length},wn.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var r=this;bn.each(this._nodes,function(r,n){t(n)&&e.setNode(n,r)}),bn.each(this._edgeObjs,function(t){e.hasNode(t.v)&&e.hasNode(t.w)&&e.setEdge(t,r.edge(t))});var n={};return this._isCompound&&bn.each(e.nodes(),function(t){e.setParent(t,function t(i){var o=r.parent(i);return void 0===o||e.hasNode(o)?(n[i]=o,o):o in n?n[o]:t(o)}(t))}),e},wn.prototype.setDefaultEdgeLabel=function(t){return bn.isFunction(t)||(t=bn.constant(t)),this._defaultEdgeLabelFn=t,this},wn.prototype.edgeCount=function(){return this._edgeCount},wn.prototype.edges=function(){return bn.values(this._edgeObjs)},wn.prototype.setPath=function(t,e){var r=this,n=arguments;return bn.reduce(t,function(t,i){return n.length>1?r.setEdge(t,i,e):r.setEdge(t,i),i}),this},wn.prototype.setEdge=function(){var t,e,r,n,i=!1,o=arguments[0];"object"==y(o)&&null!==o&&"v"in o?(t=o.v,e=o.w,r=o.name,2===arguments.length&&(n=arguments[1],i=!0)):(t=o,e=arguments[1],r=arguments[3],arguments.length>2&&(n=arguments[2],i=!0)),t=""+t,e=""+e,bn.isUndefined(r)||(r=""+r);var a=En(this._isDirected,t,e,r);if(bn.has(this._edgeLabels,a))return i&&(this._edgeLabels[a]=n),this;if(!bn.isUndefined(r)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[a]=i?n:this._defaultEdgeLabelFn(t,e,r);var s=function(t,e,r,n){var i=""+e,o=""+r;if(!t&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return n&&(s.name=n),s}(this._isDirected,t,e,r);return t=s.v,e=s.w,Object.freeze(s),this._edgeObjs[a]=s,_n(this._preds[e],t),_n(this._sucs[t],e),this._in[e][a]=s,this._out[t][a]=s,this._edgeCount++,this},wn.prototype.edge=function(t,e,r){var n=1===arguments.length?kn(this._isDirected,arguments[0]):En(this._isDirected,t,e,r);return this._edgeLabels[n]},wn.prototype.hasEdge=function(t,e,r){var n=1===arguments.length?kn(this._isDirected,arguments[0]):En(this._isDirected,t,e,r);return bn.has(this._edgeLabels,n)},wn.prototype.removeEdge=function(t,e,r){var n=1===arguments.length?kn(this._isDirected,arguments[0]):En(this._isDirected,t,e,r),i=this._edgeObjs[n];return i&&(t=i.v,e=i.w,delete this._edgeLabels[n],delete this._edgeObjs[n],Sn(this._preds[e],t),Sn(this._sucs[t],e),delete this._in[e][n],delete this._out[t][n],this._edgeCount--),this},wn.prototype.inEdges=function(t,e){var r=this._in[t];if(r){var n=bn.values(r);return e?bn.filter(n,function(t){return t.v===e}):n}},wn.prototype.outEdges=function(t,e){var r=this._out[t];if(r){var n=bn.values(r);return e?bn.filter(n,function(t){return t.w===e}):n}},wn.prototype.nodeEdges=function(t,e){var r=this.inEdges(t,e);if(r)return r.concat(this.outEdges(t,e))};var Tn={Graph:xn,version:"2.1.8"},Cn={write:function(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:function(t){return bn.map(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return bn.isUndefined(r)||(i.value=r),bn.isUndefined(n)||(i.parent=n),i})}(t),edges:function(t){return bn.map(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return bn.isUndefined(e.name)||(n.name=e.name),bn.isUndefined(r)||(n.value=r),n})}(t)};return bn.isUndefined(t.graph())||(e.value=bn.clone(t.graph())),e},read:function(t){var e=new xn(t.options).setGraph(t.value);return bn.each(t.nodes,function(t){e.setNode(t.v,t.value),t.parent&&e.setParent(t.v,t.parent)}),bn.each(t.edges,function(t){e.setEdge({v:t.v,w:t.w,name:t.name},t.value)}),e}};var On=An;function An(){this._arr=[],this._keyIndices={}}An.prototype.size=function(){return this._arr.length},An.prototype.keys=function(){return this._arr.map(function(t){return t.key})},An.prototype.has=function(t){return bn.has(this._keyIndices,t)},An.prototype.priority=function(t){var e=this._keyIndices[t];if(void 0!==e)return this._arr[e].priority},An.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},An.prototype.add=function(t,e){var r=this._keyIndices;if(t=String(t),!bn.has(r,t)){var n=this._arr,i=n.length;return r[t]=i,n.push({key:t,priority:e}),this._decrease(i),!0}return!1},An.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key},An.prototype.decrease=function(t,e){var r=this._keyIndices[t];if(e>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+e);this._arr[r].priority=e,this._decrease(r)},An.prototype._heapify=function(t){var e=this._arr,r=2*t,n=r+1,i=t;r>1].priority0&&(i=s.removeMin(),(o=a[i]).distance!==Number.POSITIVE_INFINITY);)n(i).forEach(u);return a}(t,String(e),r||Mn,n||function(e){return t.outEdges(e)})},Mn=bn.constant(1),In=function(t){var e=0,r=[],n={},i=[];function o(a){var s=n[a]={onStack:!0,lowlink:e,index:e++};if(r.push(a),t.successors(a).forEach(function(t){bn.has(n,t)?n[t].onStack&&(s.lowlink=Math.min(s.lowlink,n[t].index)):(o(t),s.lowlink=Math.min(s.lowlink,n[t].lowlink))}),s.lowlink===s.index){var u,l=[];do{u=r.pop(),n[u].onStack=!1,l.push(u)}while(a!==u);i.push(l)}}return t.nodes().forEach(function(t){bn.has(n,t)||o(t)}),i},Ln=bn.constant(1),jn=Nn;function Nn(t){var e={},r={},n=[];if(bn.each(t.sinks(),function i(o){if(bn.has(r,o))throw new Rn;bn.has(e,o)||(r[o]=!0,e[o]=!0,bn.each(t.predecessors(o),i),delete r[o],n.push(o))}),bn.size(e)!==t.nodeCount())throw new Rn;return n}function Rn(){}Nn.CycleException=Rn,Rn.prototype=new Error;var Dn=function(t,e,r){bn.isArray(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],o={};return bn.each(e,function(e){if(!t.hasNode(e))throw new Error("Graph does not have node: "+e);!function t(e,r,n,i,o,a){bn.has(i,r)||(i[r]=!0,n||a.push(r),bn.each(o(r),function(r){t(e,r,n,i,o,a)}),n&&a.push(r))}(t,e,"post"===r,o,n,i)}),i};var Bn,Fn={Graph:Tn.Graph,json:Cn,alg:{components:function(t){var e,r={},n=[];function i(n){bn.has(r,n)||(r[n]=!0,e.push(n),bn.each(t.successors(n),i),bn.each(t.predecessors(n),i))}return bn.each(t.nodes(),function(t){e=[],i(t),e.length&&n.push(e)}),n},dijkstra:Pn,dijkstraAll:function(t,e,r){return bn.transform(t.nodes(),function(n,i){n[i]=Pn(t,i,e,r)},{})},findCycles:function(t){return bn.filter(In(t),function(e){return e.length>1||1===e.length&&t.hasEdge(e[0],e[0])})},floydWarshall:function(t,e,r){return function(t,e,r){var n={},i=t.nodes();return i.forEach(function(t){n[t]={},n[t][t]={distance:0},i.forEach(function(e){t!==e&&(n[t][e]={distance:Number.POSITIVE_INFINITY})}),r(t).forEach(function(r){var i=r.v===t?r.w:r.v,o=e(r);n[t][i]={distance:o,predecessor:t}})}),i.forEach(function(t){var e=n[t];i.forEach(function(r){var o=n[r];i.forEach(function(r){var n=o[t],i=e[r],a=o[r],s=n.distance+i.distance;s0;){if(r=o.removeMin(),bn.has(i,r))n.setEdge(r,i[r]);else{if(s)throw new Error("Input graph is not connected: "+t);s=!0}t.nodeEdges(r).forEach(a)}return n},tarjan:In,topsort:jn},version:Tn.version};try{Bn=Fn}catch(v){}Bn||(Bn=window.graphlib);var zn,Gn=Bn,Un=function(t,e,r){if(!H(r))return!1;var n=y(e);return!!("number"==n?qt(r)&&Mt(e,r.length):"string"==n&&e in r)&&C(r[e],t)},Vn=Object.prototype,Hn=Vn.hasOwnProperty,Wn=cn(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&Un(e[0],e[1],i)&&(n=1);++r-1?i[o?e[a]:a]:void 0}}(function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:function(t){var e=Jn(t),r=e%1;return e==e?r?e-r:e:0}(r);return i<0&&(i=Qn(n+i,0)),fn(t,Mr(e),i)}),ti=function(t){return null!=t&&t.length?nn(t,1):[]},ei=function(t,e,r){for(var n=-1,i=t.length;++ne},ni=function(t,e,r){(void 0!==r&&!C(t[e],r)||void 0===r&&!(e in t))&>(t,e,r)},ii=Function.prototype,oi=Object.prototype,ai=ii.toString,si=oi.hasOwnProperty,ui=ai.call(Object),li=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},ci=function(t,e,r,n,i,o,a){var s=li(t,r),u=li(e,r),l=a.get(u);if(l)ni(t,r,l);else{var c=o?o(s,u,r+"",t,e,a):void 0,f=void 0===c;if(f){var h=Ct(u),p=!h&&At(u),d=!h&&!p&&Dt(u);c=u,h||p||d?Ct(s)?c=s:vn(s)?c=Qt(s):p?(f=!1,c=Jt(u,!0)):d?(f=!1,c=Te(u,!0)):c=[]:function(t){if(!wt(t)||"[object Object]"!=V(t))return!1;var e=oe(t);if(null===e)return!0;var r=si.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ai.call(r)==ui}(u)||Tt(u)?(c=s,Tt(s)?c=function(t){return xt(t,Kt(t))}(s):H(s)&&!W(s)||(c=Pe(u))):f=!1}f&&(a.set(u,c),i(c,u,n,o,a),a.delete(u)),ni(t,r,c)}},fi=function(t){return cn(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,a&&Un(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),e=Object(e);++ne||o&&a&&u&&!s&&!l||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!l&&t=s?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)})},wi=cn(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Un(t,e[0],e[1])?e=[]:r>2&&Un(e[0],e[1],e[2])&&(e=[e[0]]),xi(t,nn(e,1),[])}),_i=0;try{zn={cloneDeep:function(t){return Re(t,5)},constant:De,defaults:Wn,each:He,filter:Ir,find:$n,flatten:ti,forEach:Ve,forIn:function(t,e){return null==t?t:Be(t,Ue(e),Kt)},has:Nr,isUndefined:Dr,last:function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0},map:Fr,mapValues:function(t,e){var r={};return e=Mr(e),Fe(t,function(t,n,i){gt(r,n,e(t,n,i))}),r},max:function(t){return t&&t.length?ei(t,Ge,ri):void 0},merge:fi,min:function(t){return t&&t.length?ei(t,Ge,hi):void 0},minBy:function(t,e){return t&&t.length?ei(t,Mr(e),hi):void 0},now:function(){return N.Date.now()},pick:yi,range:mi,reduce:Ur,sortBy:wi,uniqueId:function(t){var e=++_i;return wr(t)+e},values:mn,zipObject:function(t,e){return function(t,e,r){for(var n=-1,i=t.length,o=e.length,a={};++n0;--s)if(n=e[s].dequeue()){i=i.concat(Pi(t,e,r,n,!0));break}}return i}(r.graph,r.buckets,r.zeroIdx);return Si.flatten(Si.map(n,function(e){return t.outEdges(e.v,e.w)}),!0)}(t,function(t){return function(e){return t.edge(e).weight}}(t)):function(t){var e=[],r={},n={};return Si.forEach(t.nodes(),function i(o){Si.has(n,o)||(n[o]=!0,r[o]=!0,Si.forEach(t.outEdges(o),function(t){Si.has(r,t.w)?e.push(t):i(t.w)}),delete r[o])}),e}(t);Si.forEach(e,function(e){var r=t.edge(e);t.removeEdge(e),r.forwardName=e.name,r.reversed=!0,t.setEdge(e.w,e.v,r,Si.uniqueId("rev"))})},Li=function(t){Si.forEach(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})},ji=Gn.Graph,Ni={addDummyNode:Ri,simplify:function(t){var e=(new ji).setGraph(t.graph());return Si.forEach(t.nodes(),function(r){e.setNode(r,t.node(r))}),Si.forEach(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e},asNonCompoundGraph:function(t){var e=new ji({multigraph:t.isMultigraph()}).setGraph(t.graph());return Si.forEach(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),Si.forEach(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e},successorWeights:function(t){var e=Si.map(t.nodes(),function(e){var r={};return Si.forEach(t.outEdges(e),function(e){r[e.w]=(r[e.w]||0)+t.edge(e).weight}),r});return Si.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=Si.map(t.nodes(),function(e){var r={};return Si.forEach(t.inEdges(e),function(e){r[e.v]=(r[e.v]||0)+t.edge(e).weight}),r});return Si.zipObject(t.nodes(),e)},intersectRect:function(t,e){var r,n,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,l=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*u>Math.abs(a)*l?(s<0&&(l=-l),r=l*a/s,n=l):(a<0&&(u=-u),r=u,n=u*s/a),{x:i+r,y:o+n}},buildLayerMatrix:function(t){var e=Si.map(Si.range(Di(t)+1),function(){return[]});return Si.forEach(t.nodes(),function(r){var n=t.node(r),i=n.rank;Si.isUndefined(i)||(e[i][n.order]=r)}),e},normalizeRanks:function(t){var e=Si.min(Si.map(t.nodes(),function(e){return t.node(e).rank}));Si.forEach(t.nodes(),function(r){var n=t.node(r);Si.has(n,"rank")&&(n.rank-=e)})},removeEmptyRanks:function(t){var e=Si.min(Si.map(t.nodes(),function(e){return t.node(e).rank})),r=[];Si.forEach(t.nodes(),function(n){var i=t.node(n).rank-e;r[i]||(r[i]=[]),r[i].push(n)});var n=0,i=t.graph().nodeRankFactor;Si.forEach(r,function(e,r){Si.isUndefined(e)&&r%i!=0?--n:n&&Si.forEach(e,function(e){t.node(e).rank+=n})})},addBorderNode:function(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),Ri(t,"border",i,e)},maxRank:Di,partition:function(t,e){var r={lhs:[],rhs:[]};return Si.forEach(t,function(t){e(t)?r.lhs.push(t):r.rhs.push(t)}),r},time:function(t,e){var r=Si.now();try{return e()}finally{console.log(t+" time: "+(Si.now()-r)+"ms")}},notime:function(t,e){return e()}};function Ri(t,e,r,n){var i;do{i=Si.uniqueId(n)}while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function Di(t){return Si.max(Si.map(t.nodes(),function(e){var r=t.node(e).rank;if(!Si.isUndefined(r))return r}))}var Bi=function(t){t.graph().dummyChains=[],Si.forEach(t.edges(),function(e){!function(t,e){var r,n,i,o=e.v,a=t.node(o).rank,s=e.w,u=t.node(s).rank,l=e.name,c=t.edge(e),f=c.labelRank;if(u!==a+1){for(t.removeEdge(e),i=0,++a;aa.lim&&(s=a,u=!0);var l=Si.filter(e.edges(),function(e){return u===so(t,t.node(e.v),s)&&u!==so(t,t.node(e.w),s)});return Si.minBy(l,function(t){return Xi(e,t)})}function ao(t,e,r,n){var i=r.v,o=r.w;t.removeEdge(i,o),t.setEdge(n.v,n.w,{}),no(t),eo(t,e),function(t,e){var r=Si.find(t.nodes(),function(t){return!e.node(t).parent}),n=Ki(t,r);n=n.slice(1),Si.forEach(n,function(r){var n=t.node(r).parent,i=e.edge(r,n),o=!1;i||(i=e.edge(n,r),o=!0),e.node(r).rank=e.node(n).rank+(o?i.minlen:-i.minlen)})}(t,e)}function so(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}to.initLowLimValues=no,to.initCutValues=eo,to.calcCutValue=ro,to.leaveEdge=io,to.enterEdge=oo,to.exchangeEdges=ao;var uo=zi,lo=uo;function co(t){$i(t)}var fo=function(t){var e=Ni.addDummyNode(t,"root",{},"_root"),r=function(t){var e={};function r(n,i){var o=t.children(n);o&&o.length&&Si.forEach(o,function(t){r(t,i+1)}),e[n]=i}return Si.forEach(t.children(),function(t){r(t,1)}),e}(t),n=Si.max(Si.values(r))-1,i=2*n+1;t.graph().nestingRoot=e,Si.forEach(t.edges(),function(e){t.edge(e).minlen*=i});var o=function(t){return Si.reduce(t.edges(),function(e,r){return e+t.edge(r).weight},0)}(t)+1;Si.forEach(t.children(),function(a){!function t(e,r,n,i,o,a,s){var u=e.children(s);if(u.length){var l=Ni.addBorderNode(e,"_bt"),c=Ni.addBorderNode(e,"_bb"),f=e.node(s);e.setParent(l,s),f.borderTop=l,e.setParent(c,s),f.borderBottom=c,Si.forEach(u,function(u){t(e,r,n,i,o,a,u);var f=e.node(u),h=f.borderTop?f.borderTop:u,p=f.borderBottom?f.borderBottom:u,d=f.borderTop?i:2*i,y=h!==p?1:o-a[s]+1;e.setEdge(l,h,{weight:d,minlen:y,nestingEdge:!0}),e.setEdge(p,c,{weight:d,minlen:y,nestingEdge:!0})}),e.parent(s)||e.setEdge(r,l,{weight:0,minlen:o+a[s]})}else s!==r&&e.setEdge(r,s,{weight:0,minlen:n})}(t,e,i,o,n,r,a)}),t.graph().nodeRankFactor=i},ho=function(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,Si.forEach(t.edges(),function(e){t.edge(e).nestingEdge&&t.removeEdge(e)})};function po(t,e,r,n,i,o){var a={width:0,height:0,rank:o,borderType:e},s=i[e][o-1],u=Ni.addDummyNode(t,"border",a,r);i[e][o]=u,t.setParent(u,n),s&&t.setEdge(s,u,{weight:1})}var yo=function(t){var e=t.graph().rankdir.toLowerCase();"lr"!==e&&"rl"!==e||go(t)},vo=function(t){var e=t.graph().rankdir.toLowerCase();"bt"!==e&&"rl"!==e||function(t){Si.forEach(t.nodes(),function(e){bo(t.node(e))}),Si.forEach(t.edges(),function(e){var r=t.edge(e);Si.forEach(r.points,bo),Si.has(r,"y")&&bo(r)})}(t),"lr"!==e&&"rl"!==e||(function(t){Si.forEach(t.nodes(),function(e){xo(t.node(e))}),Si.forEach(t.edges(),function(e){var r=t.edge(e);Si.forEach(r.points,xo),Si.has(r,"x")&&xo(r)})}(t),go(t))};function go(t){Si.forEach(t.nodes(),function(e){mo(t.node(e))}),Si.forEach(t.edges(),function(e){mo(t.edge(e))})}function mo(t){var e=t.width;t.width=t.height,t.height=e}function bo(t){t.y=-t.y}function xo(t){var e=t.x;t.x=t.y,t.y=e}var wo=function(t,e){for(var r=0,n=1;n0;)e%2&&(r+=s[e+1]),s[e=e-1>>1]+=t.weight;u+=t.weight*r})),u}function So(t,e,r){for(var n;e.length&&(n=Si.last(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}var Eo=function t(e,r,n,i){var o=e.children(r),a=e.node(r),s=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,l={};s&&(o=Si.filter(o,function(t){return t!==s&&t!==u}));var c=function(t,e){return Si.map(e,function(e){var r=t.inEdges(e);if(r.length){var n=Si.reduce(r,function(e,r){var n=t.edge(r),i=t.node(r.v);return{sum:e.sum+n.weight*i.order,weight:e.weight+n.weight}},{sum:0,weight:0});return{v:e,barycenter:n.sum/n.weight,weight:n.weight}}return{v:e}})}(e,o);Si.forEach(c,function(r){if(e.children(r.v).length){var o=t(e,r.v,n,i);l[r.v]=o,Si.has(o,"barycenter")&&(a=r,s=o,Si.isUndefined(a.barycenter)?(a.barycenter=s.barycenter,a.weight=s.weight):(a.barycenter=(a.barycenter*a.weight+s.barycenter*s.weight)/(a.weight+s.weight),a.weight+=s.weight))}var a,s});var f=function(t,e){var r={};return Si.forEach(t,function(t,e){var n=r[t.v]={indegree:0,in:[],out:[],vs:[t.v],i:e};Si.isUndefined(t.barycenter)||(n.barycenter=t.barycenter,n.weight=t.weight)}),Si.forEach(e.edges(),function(t){var e=r[t.v],n=r[t.w];Si.isUndefined(e)||Si.isUndefined(n)||(n.indegree++,e.out.push(r[t.w]))}),function(t){var e=[];function r(t){return function(e){e.merged||(Si.isUndefined(e.barycenter)||Si.isUndefined(t.barycenter)||e.barycenter>=t.barycenter)&&function(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function n(e){return function(r){r.in.push(e),0==--r.indegree&&t.push(r)}}for(;t.length;){var i=t.pop();e.push(i),Si.forEach(i.in.reverse(),r(i)),Si.forEach(i.out,n(i))}return Si.map(Si.filter(e,function(t){return!t.merged}),function(t){return Si.pick(t,["vs","i","barycenter","weight"])})}(Si.filter(r,function(t){return!t.indegree}))}(c,n);!function(t,e){Si.forEach(t,function(t){t.vs=Si.flatten(t.vs.map(function(t){return e[t]?e[t].vs:t}),!0)})}(f,l);var h=function(t,e){var r,n=Ni.partition(t,function(t){return Si.has(t,"barycenter")}),i=n.lhs,o=Si.sortBy(n.rhs,function(t){return-t.i}),a=[],s=0,u=0,l=0;i.sort((r=!!e,function(t,e){return t.barycentere.barycenter?1:r?e.i-t.i:t.i-e.i})),l=So(a,o,l),Si.forEach(i,function(t){l+=t.vs.length,a.push(t.vs),s+=t.barycenter*t.weight,u+=t.weight,l=So(a,o,l)});var c={vs:Si.flatten(a,!0)};return u&&(c.barycenter=s/u,c.weight=u),c}(f,i);if(s&&(h.vs=Si.flatten([s,h.vs,u],!0),e.predecessors(s).length)){var p=e.node(e.predecessors(s)[0]),d=e.node(e.predecessors(u)[0]);Si.has(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+p.order+d.order)/(h.weight+2),h.weight+=2}return h},ko=Gn.Graph,To=function(t,e,r){var n=function(t){for(var e;t.hasNode(e=Si.uniqueId("_root")););return e}(t),i=new ko({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(e){return t.node(e)});return Si.forEach(t.nodes(),function(o){var a=t.node(o),s=t.parent(o);(a.rank===e||a.minRank<=e&&e<=a.maxRank)&&(i.setNode(o),i.setParent(o,s||n),Si.forEach(t[r](o),function(e){var r=e.v===o?e.w:e.v,n=i.edge(r,o),a=Si.isUndefined(n)?0:n.weight;i.setEdge(r,o,{weight:t.edge(e).weight+a})}),Si.has(a,"minRank")&&i.setNode(o,{borderLeft:a.borderLeft[e],borderRight:a.borderRight[e]}))}),i},Co=function(t,e,r){var n,i={};Si.forEach(r,function(r){for(var o,a,s=t.parent(r);s;){if((o=t.parent(s))?(a=i[o],i[o]=s):(a=n,n=s),a&&a!==s)return void e.setEdge(a,s);s=o}})},Oo=Gn.Graph,Ao=function(t){var e=Ni.maxRank(t),r=Po(t,Si.range(1,e+1),"inEdges"),n=Po(t,Si.range(e-1,-1,-1),"outEdges"),i=function(t){var e={},r=Si.filter(t.nodes(),function(e){return!t.children(e).length}),n=Si.max(Si.map(r,function(e){return t.node(e).rank})),i=Si.map(Si.range(n+1),function(){return[]});var o=Si.sortBy(r,function(e){return t.node(e).rank});return Si.forEach(o,function r(n){if(!Si.has(e,n)){e[n]=!0;var o=t.node(n);i[o.rank].push(n),Si.forEach(t.successors(n),r)}}),i}(t);Io(t,i);for(var o,a=Number.POSITIVE_INFINITY,s=0,u=0;u<4;++s,++u){Mo(s%2?r:n,s%4>=2),i=Ni.buildLayerMatrix(t);var l=wo(t,i);lr){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function No(t,e,r){if(e>r){var n=e;e=r,r=n}return Si.has(t[e],r)}var Ro=function(t){var e,r=Ni.buildLayerMatrix(t),n=Si.merge(function(t,e){var r={};return Si.reduce(e,function(e,n){var i=0,o=0,a=e.length,s=Si.last(n);return Si.forEach(n,function(e,u){var l=function(t,e){if(t.node(e).dummy)return Si.find(t.predecessors(e),function(e){return t.node(e).dummy})}(t,e),c=l?t.node(l).order:a;(l||e===s)&&(Si.forEach(n.slice(o,u+1),function(e){Si.forEach(t.predecessors(e),function(n){var o=t.node(n),a=o.order;!(aa)&&jo(r,e,s)})})}return Si.reduce(e,function(e,r){var i,o=-1,a=0;return Si.forEach(r,function(s,u){if("border"===t.node(s).dummy){var l=t.predecessors(s);l.length&&(i=t.node(l[0]).order,n(r,a,u,o,i),a=u,o=i)}n(r,a,r.length,i,e.length)}),r}),r}(t,r)),i={};Si.forEach(["u","d"],function(o){e="u"===o?r:Si.values(r).reverse(),Si.forEach(["l","r"],function(r){"r"===r&&(e=Si.map(e,function(t){return Si.values(t).reverse()}));var a=("u"===o?t.predecessors:t.successors).bind(t),s=function(t,e,r,n){var i={},o={},a={};return Si.forEach(e,function(t){Si.forEach(t,function(t,e){i[t]=t,o[t]=t,a[t]=e})}),Si.forEach(e,function(t){var e=-1;Si.forEach(t,function(t){var s=n(t);if(s.length)for(var u=((s=Si.sortBy(s,function(t){return a[t]})).length-1)/2,l=Math.floor(u),c=Math.ceil(u);l<=c;++l){var f=s[l];o[t]===t&&eu||l>e[i].lim));for(o=i,i=n;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,l=a[u],c=!0;r!==i.w;){if(n=t.node(r),c){for(;(l=a[u])!==s&&t.node(l).maxRank1&&void 0!==arguments[1]?arguments[1]:{};d(this,t),this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=x.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=b.META,this.path=[],this.name=e,this.metaGraph=sa(e,w.META,r)},[{key:"getFirstChild",value:function(){return this.metaGraph.node(this.metaGraph.nodes()[0])}},{key:"getChildren",value:function(){var t=this;return this.metaGraph.nodes().map(function(e){return t.metaGraph.node(e)})}},{key:"leaves",value:function(){for(var t,e=[],r=[this];r.length;){var n=r.shift();n.isGroupNode?(t=n.metaGraph).nodes().forEach(function(e){return r.push(t.node(e))}):e.push(n.name)}return e}}])}(),ia=function(){return h(function t(e,r){d(this,t),this.v=e,this.w=r,this.baseEdgeList=[],this.inbound=null,this.name=null},[{key:"addBaseEdge",value:function(t,e){this.baseEdgeList.push(t)}}])}();function oa(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new na(t,e)}function aa(t,e){return new ia(t,e)}function sa(t,e,r){var n=r||{},i=new $o.Graph(n);return i.setGraph({name:t,rankdir:n.rankdir,type:e,align:n.align}),i}var ua=function(){return h(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d(this,t),this.graphOptions=e,this.index={},this.graphOptions.compound=!0,this.root=oa(S,this.graphOptions),this.index[S]=this.root},[{key:"getNodeMap",value:function(){return this.index}},{key:"node",value:function(t){return this.index[t]}},{key:"setNode",value:function(t,e){this.index[t]=e}},{key:"getBridgeGraph",value:function(t){var e=this,r=this.index[t];if(!r)throw Error("Could not find node in hierarchy: "+t);if(!("metaGraph"in r))return null;var n=r;if(n.bridgeGraph)return n.bridgeGraph;var i=sa(E,w.BRIDGE,this.graphOptions);if(n.bridgeGraph=i,!(r.parentNode&&"metaGraph"in r.parentNode))return i;var o=r.parentNode;return[o.metaGraph,this.getBridgeGraph(o.name)].forEach(function(r){r.edges().filter(function(e){return e.v===t||e.w===t}).forEach(function(n){var o=n.w===t;r.edge(n).baseEdgeList.forEach(function(r){var a=u(o?[r.w,n.v]:[r.v,n.w],2),s=a[0],l=a[1],c=e.getChildName(t,s),f={v:o?l:c,w:o?c:l},h=i.edge(f);h||((h=aa(f.v,f.w)).inbound=o,i.setEdge(f.v,f.w,h)),h.addBaseEdge(r,e)})})}),i}},{key:"getChildName",value:function(t,e){for(var r=this.index[e];r;){if(r.parentNode&&r.parentNode.name===t)return r.name;r=r.parentNode}throw Error("Could not find immediate child for descendant: "+e)}},{key:"getPredecessors",value:function(t){var e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!0)}},{key:"getSuccessors",value:function(t){var e=this.index[t];if(!e)throw Error("Could not find node with name: "+t);return this.getOneWayEdges(e,!1)}},{key:"getOneWayEdges",value:function(t,e){var r=[];if(!t.parentNode||!t.parentNode.isGroupNode)return r;var n=t.parentNode,i=n.metaGraph,o=this.getBridgeGraph(n.name);return la(i,t,e,r),la(o,t,e,r),r}}])}();function la(t,e,r,n){(r?t.inEdges(e.name):t.outEdges(e.name)).forEach(function(e){var r=t.edge(e);n.push(r)})}var ca=function(){return h(function t(e){d(this,t),this.hierarchy=e,this.index={},this.hasSubHierarchy={},this.root=new pa(this.hierarchy.root,this.hierarchy.graphOptions),this.index[e.root.name]=this.root,this.buildSubHierarchy(e.root.name),this.root.expanded=!0},[{key:"getRenderInfoNodes",value:function(){return Object.values(this.index)}},{key:"getSubHierarchy",value:function(){return this.hasSubHierarchy}},{key:"buildSubHierarchy",value:function(t){var e=this;if(!(t in this.hasSubHierarchy)){this.hasSubHierarchy[t]=!0;var r=this.index[t];if(r.node.type===b.META){var n=r,i=n.node.metaGraph,o=n.coreGraph;i.nodes().forEach(function(t){var r=e.getOrCreateRenderNodeByName(t);o.setNode(t,r)}),i.edges().forEach(function(t){var e=i.edge(t),r=new ha(e);o.setEdge(t.v,t.w,r)});var a=n.node.parentNode;if(a){var s=this.getRenderNodeByName(a.name),l=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]&&arguments[1];if(t.coreBox.width=t.width,t.coreBox.height=t.height,!e){var r="".concat(t.displayName).length;t.width=Math.max(t.coreBox.width,3*r)}}(t,e&&(0===t.node.type&&!!(null===(i=null===(n=null==e?void 0:e.nodeSize)||void 0===n?void 0:n.meta)||void 0===i?void 0:i.width)||1===t.node.type&&(!!(null===(a=null===(o=null==e?void 0:e.nodeSize)||void 0===o?void 0:o.node)||void 0===a?void 0:a.width)||!!f.width)||2===t.node.type&&!!(null===(u=null===(s=null==e?void 0:e.nodeSize)||void 0===s?void 0:s.bridge)||void 0===u?void 0:u.width)))}})}(t,e),t.node.type===b.META&&function(t,e){var r=g(e),n=r.subScene.meta;Object.assign(t,n);var i=r.graph.meta,o={nodesep:i.nodeSep,ranksep:i.rankSep,edgesep:i.edgeSep,align:i.align};Object.assign(t.coreBox,function(t,e){var r=e.ranksep,n=e.nodesep,i=e.edgesep,o=e.align;Object.assign(t.graph(),{ranksep:r,nodesep:n,edgesep:i,align:o});var a=[];if(t.nodes().forEach(function(e){t.node(e).node.type!==b.BRIDGE&&a.push(e)}),!a.length)return{width:0,height:0};ta(t);var s=1/0,u=1/0,l=-1/0,c=-1/0;return a.forEach(function(e){var r=t.node(e),n=.5*r.width,i=r.x-n,o=r.x+n;s=il?o:l;var a=.5*r.height,f=r.y-a,h=r.y+a;u=fc?h:c}),t.edges().forEach(function(e){var r=t.edge(e),n=t.node(r.metaEdge.v),i=t.node(r.metaEdge.w);if(3===r.points.length&&function(t){for(var e=ya(t[0],t[1]),r=1;r1)return!1;e=n}return!0}(r.points)){if(null!=n){var o=n.expanded?n.x:va(n);r.points[0].x=o}if(null!=i){var a=i.expanded?i.x:va(i);r.points[2].x=a}r.points=[r.points[0],r.points[1]]}var f=r.points[r.points.length-2];null!=i&&(r.points[r.points.length-1]=ga(f,i));var h=r.points[1];null!=n&&(r.points[0]=ga(h,n)),r.points.forEach(function(t){s=t.xl?t.x:l,u=t.yc?t.y:c})}),t.nodes().forEach(function(e){var r=t.node(e);r.x-=s,r.y-=u}),t.edges().forEach(function(e){t.edge(e).points.forEach(function(t){t.x-=s,t.y-=u})}),{width:l-s,height:c-u}}(t.coreGraph,o));var a=0;t.coreGraph.nodeCount()>0&&a++;var s=a<=1?0:a;t.coreBox.width+=s+s,t.coreBox.height=n.labelHeight+t.coreBox.height,t.width=t.coreBox.width+n.paddingLeft+n.paddingRight,t.height=t.paddingTop+t.coreBox.height+t.paddingBottom}(t,e)}function ya(t,e){var r=e.x-t.x,n=e.y-t.y;return 180*Math.atan(n/r)/Math.PI}function va(t){return t.expanded?t.x:t.x-t.width/2+0+t.coreBox.width/2}function ga(t,e){var r,n,i=e.expanded?e.x:va(e),o=e.y,a=t.x-i,s=t.y-o,u=e.expanded?e.width:e.coreBox.width,l=e.expanded?e.height:e.coreBox.height;return Math.abs(s)*u/2>Math.abs(a)*l/2?(s<0&&(l=-l),r=0===s?0:l/2*a/s,n=l/2):(a<0&&(u=-u),r=u/2,n=0===a?0:u/2*s/a),{x:i+r,y:o+n}}function ma(t,e,r){var o,a,s,l,c=t.nodes.filter(function(t,e,r){return r.findIndex(function(e){return e.id===t.id})!==e}).map(function(t){return t.id});if(c.length)throw new Error("Duplicated ids found: ".concat(c.join(", ")));var f=function(t){var e={nodes:[]},r=t.compound,n=Object.keys(r||{}),o=new Map,a=function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(o.has(e))return o.get(e);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:[];if(0===Object.keys(e).length)return i(new Set(o));var a,s=new Map(Object.keys(e).map(function(t){return[t,e[t]]})),l={},c=n(s);try{for(c.s();!(a=c.n()).done;){var f=u(a.value,2),h=f[0],p=f[1];r(h,s)?l[h]=p:o=o.concat(h,p)}}catch(t){c.e(t)}finally{c.f()}return t(l,o)}(t).filter(function(t){return e.includes(t)})}(t.compound||{},(null==e?void 0:e.expanded)||[]),p=function(t,e){return function(t){return new ca(t)}(function(t,e){var r=e.rankDirection,n=e.align,i=new ua({rankdir:r,align:n});return function(t,e){Object.keys(e.nodes).forEach(function(r){var n=e.nodes[r],i=n.path,o=t.root;o.depth=Math.max(i.length,o.depth);for(var a=0;a1&&void 0!==arguments[1]&&arguments[1],r=JSON.parse(JSON.stringify(t)),n={nodes:[r],edges:i(r.edges)};return r.nodes.forEach(function t(e){(0===e.type||1===e.type)&&n.nodes.push(e),0===e.type&&(n.edges=n.edges.concat(e.edges)),Array.isArray(e.nodes)&&e.nodes.forEach(t)}),e&&n.nodes.forEach(function(t){var e=n.nodes.find(function(e){return e.id===t.parentNodeName});if(e){var r=e.x-e.width/2+e.paddingLeft,i=e.y-e.height/2+e.labelHeight+e.paddingTop;e.id!==S&&(t.x+=r,t.y+=i),0===t.type&&t.edges.forEach(function(e){e.points.forEach(function(e){e.x+=t.x-t.width/2+t.paddingLeft,e.y+=t.y-t.height/2+t.labelHeight+t.paddingTop})})}}),n}function xa(t,e,r,n){var o,a,s=[],u=(null===(o=r.find(function(e){return e.id===t}))||void 0===o?void 0:o.path)||[],l=(null===(a=r.find(function(t){return t.id===e}))||void 0===a?void 0:a.path)||[],c=[S].concat(i(u)).slice(0,u.length).reverse(),f=[S].concat(i(l)).slice(0,l.length);return c.forEach(function(i){var o=r.find(function(t){return t.id===i});s=s.concat(o.edges.filter(function(r){return r.baseEdgeList.some(function(r){return r.v===((null==n?void 0:n.v)||t)&&r.w===((null==n?void 0:n.w)||e)})}))}),f.filter(function(t){return!c.includes(t)}).forEach(function(i){var o=r.find(function(t){return t.id===i});s=s.concat(o.edges.filter(function(r){return r.baseEdgeList.some(function(r){return r.v===((null==n?void 0:n.v)||t)&&r.w===((null==n?void 0:n.w)||e)})}))}),s}function wa(t){var e,r=t.coreGraph.nodes().map(function(e){return t.coreGraph.node(e)});return Object.assign(Object.assign({},_a(t)),{expanded:t.expanded,nodes:t.expanded?(e=r,e.map(function(t){return t.node.type===b.META?wa(t):_a(t)})):[],edges:t.expanded?function(t){return t.coreGraph.edges().map(function(e){return{renderInfoEdge:t.coreGraph.edge(e),edge:e}}).filter(function(t){var e=t.renderInfoEdge;return e.metaEdge}).map(function(e){var r=e.edge,n=e.renderInfoEdge,i=function(t,e){var r=e.points.map(function(t){return Object.assign({},t)});if(e.adjoiningMetaEdge){var n=e.adjoiningMetaEdge.points,i=e.metaEdge.inbound,o=i?n[n.length-1]:n[0],a=r[i?0:r.length-1],s=t.x-t.width/2,u=t.y-t.height/2,l=o.x-s,c=o.y-u,f=-t.paddingLeft,h=-(t.paddingTop+t.labelHeight);a.x=l+f,a.y=c+h}return r}(t,n);return{adjoiningEdge:n.adjoiningMetaEdge?{w:n.adjoiningMetaEdge.metaEdge.w,v:n.adjoiningMetaEdge.metaEdge.v}:null,inbound:n.metaEdge.inbound,w:r.w,v:r.v,points:i,weight:n.weight,baseEdgeList:n.metaEdge.baseEdgeList,parentNodeName:t.node.name}})}(t):[]})}function _a(t){return{id:t.node.name,name:t.node.name,type:t.node.type,cardinality:t.node.cardinality,attr:t.attr,parentNodeName:t.node.parentNode?t.node.parentNode.name:null,coreBox:Object.assign({},t.coreBox),x:t.x,y:t.y,width:t.width,height:t.height,radius:t.radius,labelHeight:t.labelHeight,labelOffset:t.labelOffset,outboxWidth:t.outboxWidth,paddingLeft:t.paddingLeft,paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,path:t.node.path}}},3950:function(t,e,r){"use strict";r.d(e,{o0:function(){return p}});var n=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i5&&"xml"===n)return d("InvalidXml","XML declaration allowed only at the start of the document.",v(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function s(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e"===t[e]&&0===--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e"===t[e+2]){e+=2;break}return e}e.validate=function(t,e){e=Object.assign({},i,e);var r,u=[],l=!1,f=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var y=0;y"!==t[y]&&" "!==t[y]&&"\t"!==t[y]&&"\n"!==t[y]&&"\r"!==t[y];y++)b+=t[y];if("/"===(b=b.trim())[b.length-1]&&(b=b.substring(0,b.length-1),y--),r=b,!n.isName(r)){return d("InvalidTag",0===b.trim().length?"Invalid space after '<'.":"Tag '"+b+"' is an invalid name.",v(t,y))}var x=c(t,y);if(!1===x)return d("InvalidAttr","Attributes for '"+b+"' have open quote.",v(t,y));var w=x.value;if(y=x.index,"/"===w[w.length-1]){var _=y-w.length,S=h(w=w.substring(0,w.length-1),e);if(!0!==S)return d(S.err.code,S.err.msg,v(t,_+S.err.line));l=!0}else if(m){if(!x.tagClosed)return d("InvalidTag","Closing tag '"+b+"' doesn't have proper closing.",v(t,y));if(w.trim().length>0)return d("InvalidTag","Closing tag '"+b+"' can't have attributes or invalid starting.",v(t,g));if(0===u.length)return d("InvalidTag","Closing tag '"+b+"' has not been opened.",v(t,g));var E=u.pop();if(b!==E.tagName){var k=v(t,E.tagStartPos);return d("InvalidTag","Expected closing tag '"+E.tagName+"' (opened in line "+k.line+", col "+k.col+") instead of closing tag '"+b+"'.",v(t,g))}0==u.length&&(f=!0)}else{var T=h(w,e);if(!0!==T)return d(T.err.code,T.err.msg,v(t,y-w.length+T.err.line));if(!0===f)return d("InvalidXml","Multiple possible root nodes found.",v(t,y));-1!==e.unpairedTags.indexOf(b)||u.push({tagName:b,tagStartPos:g}),l=!0}for(y++;y0)||d("InvalidXml","Invalid '"+JSON.stringify(u.map(function(t){return t.tagName}),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};var u='"',l="'";function c(t,e){for(var r="",n="",i=!1;e"===t[e]&&""===n){i=!0;break}r+=t[e]}return""===n&&{value:r,index:e,tagClosed:i}}var f=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function h(t,e){for(var r=n.getAllMatches(t,f),i={},o=0;o","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(t){this.options=Object.assign({},a,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=c),this.processTextOrObjNode=u,this.options.format?(this.indentate=l,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function u(t,e,r){var n=this.j2x(t,r+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function l(t){return this.options.indentBy.repeat(t)}function c(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}s.prototype.build=function(t){return this.options.preserveOrder?o(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t=i({},this.options.arrayNodeName,t)),this.j2x(t,0).val)},s.prototype.j2x=function(t,e){var r="",i="";for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(i+="");else if(null===t[o])this.isAttribute(o)?i+="":"?"===o[0]?i+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)i+=this.buildTextValNode(t[o],o,"",e);else if("object"!==n(t[o])){var a=this.isAttribute(o);if(a)r+=this.buildAttrPairStr(a,""+t[o]);else if(o===this.options.textNodeName){var s=this.options.tagValueProcessor(o,""+t[o]);i+=this.replaceEntitiesValue(s)}else i+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){for(var u=t[o].length,l="",c=0;c"+t+i},s.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":">")+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+"\x3c!--".concat(t,"--\x3e")+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;var i=this.options.tagValueProcessor(e,t);return""===(i=this.replaceEntitiesValue(i))?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+i+"0&&this.options.processEntities)for(var e=0;e0&&e.processEntities)for(var r=0;r0&&(s=e),function t(e,a,s,u){for(var l="",c=!1,f=0;f":l+=g+"/>":m&&0!==m.length||!a.suppressEmptyNode?m&&m.endsWith(">")?l+=g+">".concat(m).concat(u,""):(l+=g+">",m&&""!==u&&(m.includes("/>")||m.includes("")):l+=g+"/>",c=!0}else{var b=n(h[":@"],a),x="?xml"===p?"":u,w=h[p][0][a.textNodeName];w=0!==w.length?" "+w:"",l+=x+"<".concat(p).concat(w).concat(b,"?>"),c=!0}else l+=u+"\x3c!--".concat(h[p][0][a.textNodeName],"--\x3e"),c=!0;else c&&(l+=u),l+=""),c=!1;else{var _=h[p];i(d,a)||(_=o(_=a.tagValueProcessor(p,_),a)),c&&(l+=u),l+=_,c=!1}}}return l}(t,a,"",s)}},3214:function(t,e,r){function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r"===t[e]){if(p?"-"===t[e-1]&&"-"===t[e-2]&&(p=!1,i--):i--,0===i)break}else"["===t[e]?o=!0:t[e];else{if(o&&u(t,e)){var d=n(a(t,(e+=7)+1),3);entityName=d[0],val=d[1],e=d[2],-1===val.indexOf("&")&&(r[h(entityName)]={regx:RegExp("&".concat(entityName,";"),"g"),val:val})}else if(o&&l(t,e))e+=8;else if(o&&c(t,e))e+=8;else if(o&&f(t,e))e+=9;else{if(!s)throw new Error("Invalid DOCTYPE");p=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}}},3070:function(t,e){var r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t}};e.buildOptions=function(t){return Object.assign({},r,t)},e.defaultOptions=r},2246:function(t,e,r){"use strict";function n(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(t,e){return String.fromCharCode(Number.parseInt(e,10))}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(t,e){return String.fromCharCode(Number.parseInt(e,16))}}},this.addExternalEntities=h,this.parseXml=g,this.parseTextData=p,this.resolveNameSpace=d,this.buildAttributesMap=v,this.isItStopNode=w,this.replaceEntitiesValue=b,this.readStopNodeData=E,this.saveTextToParentTag=x,this.addChild=m});function h(t){for(var e=Object.keys(t),r=0;r0)){s||(t=this.replaceEntitiesValue(t));var u=this.options.tagValueProcessor(e,t,r,o,a);return null===u||void 0===u?t:i(u)!==i(t)||u!==t?u:this.options.trimValues?k(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?k(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function d(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var y=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function v(t,e,r){if(!this.options.ignoreAttributes&&"string"==typeof t){for(var n=s.getAllMatches(t,y),o=n.length,a={},u=0;u",a,"Closing Tag is not closed."),c=t.substring(a+2,s).trim();if(this.options.removeNSPrefix){var f=c.indexOf(":");-1!==f&&(c=c.substr(f+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&(i=this.saveTextToParentTag(i,r,o));var h=o.substring(o.lastIndexOf(".")+1);if(c&&-1!==this.options.unpairedTags.indexOf(c))throw new Error("Unpaired tag can not be used as closing tag: "));var p=0;h&&-1!==this.options.unpairedTags.indexOf(h)?(p=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):p=o.lastIndexOf("."),o=o.substring(0,p),r=this.tagsNodeStack.pop(),i="",a=s}else if("?"===t[a+1]){var d=S(t,a,!1,"?>");if(!d)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,o),this.options.ignoreDeclaration&&"?xml"===d.tagName||this.options.ignorePiTags);else{var y=new u(d.tagName);y.add(this.options.textNodeName,""),d.tagName!==d.tagExp&&d.attrExpPresent&&(y[":@"]=this.buildAttributesMap(d.tagExp,o,d.tagName)),this.addChild(r,y,o)}a=d.closeIndex+1}else if("!--"===t.substr(a+1,3)){var v=_(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var g=t.substring(a+4,v-2);i=this.saveTextToParentTag(i,r,o),r.add(this.options.commentPropName,[n({},this.options.textNodeName,g)])}a=v}else if("!D"===t.substr(a+1,2)){var m=l(t,a);this.docTypeEntities=m.entities,a=m.i}else if("!["===t.substr(a+1,2)){var b=_(t,"]]>",a,"CDATA is not closed.")-2,x=t.substring(a+9,b);i=this.saveTextToParentTag(i,r,o);var w=this.parseTextData(x,r.tagname,o,!0,!1,!0,!0);void 0==w&&(w=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[n({},this.options.textNodeName,x)]):r.add(this.options.textNodeName,w),a=b+2}else{var E=S(t,a,this.options.removeNSPrefix),k=E.tagName,T=E.rawTagName,C=E.tagExp,O=E.attrExpPresent,A=E.closeIndex;this.options.transformTagName&&(k=this.options.transformTagName(k)),r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,o,!1));var P=r;if(P&&-1!==this.options.unpairedTags.indexOf(P.tagname)&&(r=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),k!==e.tagname&&(o+=o?"."+k:k),this.isItStopNode(this.options.stopNodes,o,k)){var M="";if(C.length>0&&C.lastIndexOf("/")===C.length-1)"/"===k[k.length-1]?(k=k.substr(0,k.length-1),o=o.substr(0,o.length-1),C=k):C=C.substr(0,C.length-1),a=E.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(k))a=E.closeIndex;else{var I=this.readStopNodeData(t,T,A+1);if(!I)throw new Error("Unexpected end of ".concat(T));a=I.i,M=I.tagContent}var L=new u(k);k!==C&&O&&(L[":@"]=this.buildAttributesMap(C,o,k)),M&&(M=this.parseTextData(M,k,o,!0,O,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),L.add(this.options.textNodeName,M),this.addChild(r,L,o)}else{if(C.length>0&&C.lastIndexOf("/")===C.length-1){"/"===k[k.length-1]?(k=k.substr(0,k.length-1),o=o.substr(0,o.length-1),C=k):C=C.substr(0,C.length-1),this.options.transformTagName&&(k=this.options.transformTagName(k));var j=new u(k);k!==C&&O&&(j[":@"]=this.buildAttributesMap(C,o,k)),this.addChild(r,j,o),o=o.substr(0,o.lastIndexOf("."))}else{var N=new u(k);this.tagsNodeStack.push(r),k!==C&&O&&(N[":@"]=this.buildAttributesMap(C,o,k)),this.addChild(r,N,o),r=N}i="",a=A}}else i+=t[a]}return e.child};function m(t,e,r){var n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e)):t.addChild(e))}var b=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(var n in this.lastEntities){var i=this.lastEntities[n];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(var o in this.htmlEntities){var a=this.htmlEntities[o];t=t.replace(a.regex,a.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function x(t,e,r,n){return t&&(void 0===n&&(n=0===Object.keys(e.child).length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function w(t,e,r){var n="*."+r;for(var i in t){var o=t[i];if(n===o||e===o)return!0}return!1}function _(t,e,r,n){var i=t.indexOf(e,r);if(-1===i)throw new Error(n);return i+e.length-1}function S(t,e,r){var n=function(t,e){for(var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:">",i="",o=e;o3&&void 0!==arguments[3]?arguments[3]:">");if(n){var i=n.data,o=n.index,a=i.search(/\s/),s=i,u=!0;-1!==a&&(s=i.substring(0,a),i=i.substring(a+1).trimStart());var l=s;if(r){var c=s.indexOf(":");-1!==c&&(u=(s=s.substr(c+1))!==n.data.substr(c+1))}return{tagName:s,tagExp:i,closeIndex:o,attrExpPresent:u,rawTagName:l}}}function E(t,e,r){for(var n=r,i=1;r",r,"".concat(e," is not closed"));if(t.substring(r+2,o).trim()===e&&0===--i)return{tagContent:t.substring(n,r),i:o};r=o}else if("?"===t[r+1]){r=_(t,"?>",r+1,"StopNode is not closed.")}else if("!--"===t.substr(r+1,3)){r=_(t,"--\x3e",r+3,"StopNode is not closed.")}else if("!["===t.substr(r+1,2)){r=_(t,"]]>",r,"StopNode is not closed.")-2}else{var a=S(t,r,">");if(a)(a&&a.tagName)===e&&"/"!==a.tagExp[a.tagExp.length-1]&&i++,r=a.closeIndex}}function k(t,e,r){if(e&&"string"==typeof t){var n=t.trim();return"true"===n||"false"!==n&&c(t,r)}return s.isExist(t)?t:""}t.exports=f},5045:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var r=0;r0&&(u[o.textNodeName]=s):void 0!==s&&(u[o.textNodeName]=s),u}(t,e)}},4670:function(t){"use strict";function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e,r){return(e=i(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){for(var r=0;r0?this.child.push(r(r({},t.tagname,t.child),":@",t[":@"])):this.child.push(r({},t.tagname,t.child))}}])&&n(t.prototype,e),i&&n(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,i}();t.exports=o},1358:function(t){!function(e){"use strict";if(e.__disableNativeFetch||!e.fetch){s.prototype.append=function(t,e){t=o(t),e=a(e);var r=this.map[t];r||(r=[],this.map[t]=r),r.push(e)},s.prototype.delete=function(t){delete this.map[o(t)]},s.prototype.get=function(t){var e=this.map[o(t)];return e?e[0]:null},s.prototype.getAll=function(t){return this.map[o(t)]||[]},s.prototype.has=function(t){return this.map.hasOwnProperty(o(t))},s.prototype.set=function(t,e){this.map[o(t)]=[a(e)]},s.prototype.forEach=function(t,e){Object.getOwnPropertyNames(this.map).forEach(function(r){this.map[r].forEach(function(n){t.call(e,n,r,this)},this)},this)};var r={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},n=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this)},f.call(h.prototype),f.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},d.error=function(){var t=new d(null,{status:0,statusText:""});return t.type="error",t};var i=[301,302,303,307,308];d.redirect=function(t,e){if(-1===i.indexOf(e))throw new RangeError("Invalid status code");return new d(null,{status:e,headers:{location:t}})},e.Headers=s,e.Request=h,e.Response=d,e.fetch=function(t,e){return new Promise(function(n,i){var o;o=h.prototype.isPrototypeOf(t)&&!e?t:new h(t,e);var a=new XMLHttpRequest;var u=!1;function l(){if(4===a.readyState){var t=1223===a.status?204:a.status;if(t<100||t>599){if(u)return;return u=!0,void i(new TypeError("Network request failed"))}var e={status:t,statusText:a.statusText,headers:function(t){var e=new s;return t.getAllResponseHeaders().trim().split("\n").forEach(function(t){var r=t.trim().split(":"),n=r.shift().trim(),i=r.join(":").trim();e.append(n,i)}),e}(a),url:"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0},r="response"in a?a.response:a.responseText;u||(u=!0,n(new d(r,e)))}}a.onreadystatechange=l,a.onload=l,a.onerror=function(){u||(u=!0,i(new TypeError("Network request failed")))},a.open(o.method,o.url,!0);try{"include"===o.credentials&&("withCredentials"in a?a.withCredentials=!0:console&&console.warn&&console.warn("withCredentials is not supported, you can ignore this warning"))}catch(t){console&&console.warn&&console.warn("set withCredentials error:"+t)}"responseType"in a&&r.blob&&(a.responseType="blob"),o.headers.forEach(function(t,e){a.setRequestHeader(e,t)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0,t.exports&&(t.exports=e.fetch)}function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){this.map={},t instanceof s?t.forEach(function(t,e){this.append(e,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function u(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function c(t){var e=new FileReader;return e.readAsArrayBuffer(t),l(e)}function f(){return this.bodyUsed=!1,this._initBody=function(t,e){if(this._bodyInit=t,"string"==typeof t)this._bodyText=t;else if(r.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t,this._options=e;else if(r.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(t){if(!r.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t))throw new Error("unsupported BodyInit type")}else this._bodyText=""},r.blob?(this.blob=function(){var t=u(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this.blob().then(c)},this.text=function(){var t,e,r,n,i,o,a,s=u(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,e=this._options,r=new FileReader,n=e.headers.map["content-type"]?e.headers.map["content-type"].toString():"",i=/charset\=[0-9a-zA-Z\-\_]*;?/,o=t.type.match(i)||n.match(i),a=[t],o&&a.push(o[0].replace(/^charset\=/,"").replace(/;$/,"")),r.readAsText.apply(r,a),l(r);if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)}):this.text=function(){var t=u(this);return t||Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(p)}),this.json=function(){return this.text().then(JSON.parse)},this}function h(t,e){var r,i,o=(e=e||{}).body;if(h.prototype.isPrototypeOf(t)){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,o||(o=t._bodyInit,t.bodyUsed=!0)}else this.url=t;if(this.credentials=e.credentials||this.credentials||"omit",!e.headers&&this.headers||(this.headers=new s(e.headers)),this.method=(r=e.method||this.method||"GET",i=r.toUpperCase(),n.indexOf(i)>-1?i:r),this.mode=e.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(o,e)}function p(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}}),e}function d(t,e){e||(e={}),this._initBody(t,e),this.type="default",this.status=e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText,this.headers=e.headers instanceof s?e.headers:new s(e.headers),this.url=e.url||""}}("undefined"!=typeof self?self:this)},3678:function(t,e){var r,n,i;n=[e,t],void 0===(i="function"==typeof(r=function(t,e){"use strict";var r={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function n(t){try{delete window[t]}catch(e){window[t]=void 0}}function i(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=t,a=e.timeout||r.timeout,s=e.jsonpCallback||r.jsonpCallback,u=void 0;return new Promise(function(r,l){var c=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),f=s+"_"+c;window[c]=function(t){r({ok:!0,json:function(){return Promise.resolve(t)}}),u&&clearTimeout(u),i(f),n(c)},o+=-1===o.indexOf("?")?"?":"&";var h=document.createElement("script");h.setAttribute("src",""+o+s+"="+c),e.charset&&h.setAttribute("charset",e.charset),h.id=f,document.getElementsByTagName("head")[0].appendChild(h),u=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),n(c),i(f),window[c]=function(){n(c)}},a),h.onerror=function(){l(new Error("JSONP request to "+t+" failed")),n(c),i(f),u&&clearTimeout(u)}})}})?r.apply(e,n):r)||(t.exports=i)},5629:function(t,e,r){"use strict";r.r(e),r.d(e,{ARRAY_TYPE:function(){return i},EPSILON:function(){return n},RANDOM:function(){return o},equals:function(){return l},setMatrixArrayType:function(){return a},toRadian:function(){return u}});var n=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array,o=Math.random;function a(t){i=t}var s=Math.PI/180;function u(t){return t*s}function l(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},621:function(t,e,r){"use strict";r.r(e),r.d(e,{glMatrix:function(){return l},mat2:function(){return n},mat2d:function(){return i},mat3:function(){return st},mat4:function(){return o},quat:function(){return s},quat2:function(){return u},vec2:function(){return kn},vec3:function(){return oe},vec4:function(){return a}});var n={};r.r(n),r.d(n,{LDU:function(){return C},add:function(){return O},adjoint:function(){return m},clone:function(){return f},copy:function(){return h},create:function(){return c},determinant:function(){return b},equals:function(){return M},exactEquals:function(){return P},frob:function(){return T},fromRotation:function(){return S},fromScaling:function(){return E},fromValues:function(){return d},identity:function(){return p},invert:function(){return g},mul:function(){return j},multiply:function(){return x},multiplyScalar:function(){return I},multiplyScalarAndAdd:function(){return L},rotate:function(){return w},scale:function(){return _},set:function(){return y},str:function(){return k},sub:function(){return N},subtract:function(){return A},transpose:function(){return v}});var i={};r.r(i),r.d(i,{add:function(){return $},clone:function(){return D},copy:function(){return B},create:function(){return R},determinant:function(){return V},equals:function(){return it},exactEquals:function(){return nt},frob:function(){return Q},fromRotation:function(){return X},fromScaling:function(){return Z},fromTranslation:function(){return K},fromValues:function(){return z},identity:function(){return F},invert:function(){return U},mul:function(){return ot},multiply:function(){return H},multiplyScalar:function(){return et},multiplyScalarAndAdd:function(){return rt},rotate:function(){return W},scale:function(){return q},set:function(){return G},str:function(){return J},sub:function(){return at},subtract:function(){return tt},translate:function(){return Y}});var o={};r.r(o),r.d(o,{add:function(){return Jt},adjoint:function(){return vt},clone:function(){return lt},copy:function(){return ct},create:function(){return ut},determinant:function(){return gt},equals:function(){return re},exactEquals:function(){return ee},frob:function(){return Kt},fromQuat:function(){return Bt},fromQuat2:function(){return It},fromRotation:function(){return Ct},fromRotationTranslation:function(){return Mt},fromRotationTranslationScale:function(){return Rt},fromRotationTranslationScaleOrigin:function(){return Dt},fromScaling:function(){return Tt},fromTranslation:function(){return kt},fromValues:function(){return ft},fromXRotation:function(){return Ot},fromYRotation:function(){return At},fromZRotation:function(){return Pt},frustum:function(){return Ft},getRotation:function(){return Nt},getScaling:function(){return jt},getTranslation:function(){return Lt},identity:function(){return pt},invert:function(){return yt},lookAt:function(){return Yt},mul:function(){return ne},multiply:function(){return mt},multiplyScalar:function(){return $t},multiplyScalarAndAdd:function(){return te},ortho:function(){return Wt},orthoNO:function(){return Ht},orthoZO:function(){return qt},perspective:function(){return Gt},perspectiveFromFieldOfView:function(){return Vt},perspectiveNO:function(){return zt},perspectiveZO:function(){return Ut},rotate:function(){return wt},rotateX:function(){return _t},rotateY:function(){return St},rotateZ:function(){return Et},scale:function(){return xt},set:function(){return ht},str:function(){return Zt},sub:function(){return ie},subtract:function(){return Qt},targetTo:function(){return Xt},translate:function(){return bt},transpose:function(){return dt}});var a={};r.r(a),r.d(a,{add:function(){return fe},ceil:function(){return ye},clone:function(){return se},copy:function(){return le},create:function(){return ae},cross:function(){return Pe},dist:function(){return Ve},distance:function(){return _e},div:function(){return Ue},divide:function(){return de},dot:function(){return Ae},equals:function(){return Be},exactEquals:function(){return De},floor:function(){return ve},forEach:function(){return Ye},fromValues:function(){return ue},inverse:function(){return Ce},len:function(){return We},length:function(){return Ee},lerp:function(){return Me},max:function(){return me},min:function(){return ge},mul:function(){return Ge},multiply:function(){return pe},negate:function(){return Te},normalize:function(){return Oe},random:function(){return Ie},round:function(){return be},scale:function(){return xe},scaleAndAdd:function(){return we},set:function(){return ce},sqrDist:function(){return He},sqrLen:function(){return qe},squaredDistance:function(){return Se},squaredLength:function(){return ke},str:function(){return Re},sub:function(){return ze},subtract:function(){return he},transformMat4:function(){return Le},transformQuat:function(){return je},zero:function(){return Ne}});var s={};r.r(s),r.d(s,{add:function(){return Er},calculateW:function(){return nr},clone:function(){return xr},conjugate:function(){return cr},copy:function(){return _r},create:function(){return Xe},dot:function(){return Cr},equals:function(){return Nr},exactEquals:function(){return jr},exp:function(){return ir},fromEuler:function(){return hr},fromMat3:function(){return fr},fromValues:function(){return wr},getAngle:function(){return Qe},getAxisAngle:function(){return Je},identity:function(){return Ze},invert:function(){return lr},len:function(){return Pr},length:function(){return Ar},lerp:function(){return Or},ln:function(){return or},mul:function(){return kr},multiply:function(){return $e},normalize:function(){return Lr},pow:function(){return ar},random:function(){return ur},rotateX:function(){return tr},rotateY:function(){return er},rotateZ:function(){return rr},rotationTo:function(){return Rr},scale:function(){return Tr},set:function(){return Sr},setAxes:function(){return Br},setAxisAngle:function(){return Ke},slerp:function(){return sr},sqlerp:function(){return Dr},sqrLen:function(){return Ir},squaredLength:function(){return Mr},str:function(){return pr}});var u={};r.r(u),r.d(u,{add:function(){return ln},clone:function(){return zr},conjugate:function(){return vn},copy:function(){return Yr},create:function(){return Fr},dot:function(){return pn},equals:function(){return En},exactEquals:function(){return Sn},fromMat4:function(){return qr},fromRotation:function(){return Wr},fromRotationTranslation:function(){return Vr},fromRotationTranslationValues:function(){return Ur},fromTranslation:function(){return Hr},fromValues:function(){return Gr},getDual:function(){return Jr},getReal:function(){return Kr},getTranslation:function(){return tn},identity:function(){return Xr},invert:function(){return yn},len:function(){return mn},length:function(){return gn},lerp:function(){return dn},mul:function(){return fn},multiply:function(){return cn},normalize:function(){return wn},rotateAroundAxis:function(){return un},rotateByQuatAppend:function(){return an},rotateByQuatPrepend:function(){return sn},rotateX:function(){return rn},rotateY:function(){return nn},rotateZ:function(){return on},scale:function(){return hn},set:function(){return Zr},setDual:function(){return $r},setReal:function(){return Qr},sqrLen:function(){return xn},squaredLength:function(){return bn},str:function(){return _n},translate:function(){return en}});var l=r(5629);function c(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function f(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function h(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function p(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function d(t,e,r,n){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function y(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function v(t,e){if(t===e){var r=e[1];t[1]=e[2],t[2]=r}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function g(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*o-i*n;return a?(a=1/a,t[0]=o*a,t[1]=-n*a,t[2]=-i*a,t[3]=r*a,t):null}function m(t,e){var r=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=r,t}function b(t){return t[0]*t[3]-t[2]*t[1]}function x(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*s+o*u,t[1]=i*s+a*u,t[2]=n*l+o*c,t[3]=i*l+a*c,t}function w(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*s,t[1]=i*u+a*s,t[2]=n*-s+o*u,t[3]=i*-s+a*u,t}function _(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1];return t[0]=n*s,t[1]=i*s,t[2]=o*u,t[3]=a*u,t}function S(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t}function E(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function k(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function T(t){return Math.hypot(t[0],t[1],t[2],t[3])}function C(t,e,r,n){return t[2]=n[2]/n[0],r[0]=n[0],r[1]=n[1],r[3]=n[3]-t[2]*r[1],[t,e,r]}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function A(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function P(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function M(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}function I(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function L(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}var j=x,N=A;function R(){var t=new l.ARRAY_TYPE(6);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[4]=0,t[5]=0),t[0]=1,t[3]=1,t}function D(t){var e=new l.ARRAY_TYPE(6);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function B(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function F(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function z(t,e,r,n,i,o){var a=new l.ARRAY_TYPE(6);return a[0]=t,a[1]=e,a[2]=r,a[3]=n,a[4]=i,a[5]=o,a}function G(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function U(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=r*o-n*i;return u?(u=1/u,t[0]=o*u,t[1]=-n*u,t[2]=-i*u,t[3]=r*u,t[4]=(i*s-o*a)*u,t[5]=(n*a-r*s)*u,t):null}function V(t){return t[0]*t[3]-t[1]*t[2]}function H(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1],f=r[2],h=r[3],p=r[4],d=r[5];return t[0]=n*l+o*c,t[1]=i*l+a*c,t[2]=n*f+o*h,t[3]=i*f+a*h,t[4]=n*p+o*d+s,t[5]=i*p+a*d+u,t}function W(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=Math.sin(r),c=Math.cos(r);return t[0]=n*c+o*l,t[1]=i*c+a*l,t[2]=n*-l+o*c,t[3]=i*-l+a*c,t[4]=s,t[5]=u,t}function q(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1];return t[0]=n*l,t[1]=i*l,t[2]=o*c,t[3]=a*c,t[4]=s,t[5]=u,t}function Y(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=r[0],c=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=n*l+o*c+s,t[5]=i*l+a*c+u,t}function X(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=0,t[5]=0,t}function Z(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function K(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function J(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Q(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],1)}function $(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t}function tt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t}function et(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t}function rt(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t}function nt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]}function it(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=e[0],c=e[1],f=e[2],h=e[3],p=e[4],d=e[5];return Math.abs(r-u)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-c)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(c))&&Math.abs(i-f)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(o-h)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(h))&&Math.abs(a-p)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))&&Math.abs(s-d)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))}var ot=H,at=tt,st=r(9019);function ut(){var t=new l.ARRAY_TYPE(16);return l.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function lt(t){var e=new l.ARRAY_TYPE(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function ct(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ft(t,e,r,n,i,o,a,s,u,c,f,h,p,d,y,v){var g=new l.ARRAY_TYPE(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=n,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=u,g[9]=c,g[10]=f,g[11]=h,g[12]=p,g[13]=d,g[14]=y,g[15]=v,g}function ht(t,e,r,n,i,o,a,s,u,l,c,f,h,p,d,y,v){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=f,t[11]=h,t[12]=p,t[13]=d,t[14]=y,t[15]=v,t}function pt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function dt(t,e){if(t===e){var r=e[1],n=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function yt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,x=r*l-o*a,w=n*u-i*s,_=n*l-o*s,S=i*l-o*u,E=c*y-f*d,k=c*v-h*d,T=c*g-p*d,C=f*v-h*y,O=f*g-p*y,A=h*g-p*v,P=m*A-b*O+x*C+w*T-_*k+S*E;return P?(P=1/P,t[0]=(s*A-u*O+l*C)*P,t[1]=(i*O-n*A-o*C)*P,t[2]=(y*S-v*_+g*w)*P,t[3]=(h*_-f*S-p*w)*P,t[4]=(u*T-a*A-l*k)*P,t[5]=(r*A-i*T+o*k)*P,t[6]=(v*x-d*S-g*b)*P,t[7]=(c*S-h*x+p*b)*P,t[8]=(a*O-s*T+l*E)*P,t[9]=(n*T-r*O-o*E)*P,t[10]=(d*_-y*x+g*m)*P,t[11]=(f*x-c*_-p*m)*P,t[12]=(s*k-a*C-u*E)*P,t[13]=(r*C-n*k+i*E)*P,t[14]=(y*b-d*w-v*m)*P,t[15]=(c*w-f*b+h*m)*P,t):null}function vt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],v=e[14],g=e[15];return t[0]=s*(h*g-p*v)-f*(u*g-l*v)+y*(u*p-l*h),t[1]=-(n*(h*g-p*v)-f*(i*g-o*v)+y*(i*p-o*h)),t[2]=n*(u*g-l*v)-s*(i*g-o*v)+y*(i*l-o*u),t[3]=-(n*(u*p-l*h)-s*(i*p-o*h)+f*(i*l-o*u)),t[4]=-(a*(h*g-p*v)-c*(u*g-l*v)+d*(u*p-l*h)),t[5]=r*(h*g-p*v)-c*(i*g-o*v)+d*(i*p-o*h),t[6]=-(r*(u*g-l*v)-a*(i*g-o*v)+d*(i*l-o*u)),t[7]=r*(u*p-l*h)-a*(i*p-o*h)+c*(i*l-o*u),t[8]=a*(f*g-p*y)-c*(s*g-l*y)+d*(s*p-l*f),t[9]=-(r*(f*g-p*y)-c*(n*g-o*y)+d*(n*p-o*f)),t[10]=r*(s*g-l*y)-a*(n*g-o*y)+d*(n*l-o*s),t[11]=-(r*(s*p-l*f)-a*(n*p-o*f)+c*(n*l-o*s)),t[12]=-(a*(f*v-h*y)-c*(s*v-u*y)+d*(s*h-u*f)),t[13]=r*(f*v-h*y)-c*(n*v-i*y)+d*(n*h-i*f),t[14]=-(r*(s*v-u*y)-a*(n*v-i*y)+d*(n*u-i*s)),t[15]=r*(s*h-u*f)-a*(n*h-i*f)+c*(n*u-i*s),t}function gt(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],f=t[10],h=t[11],p=t[12],d=t[13],y=t[14],v=t[15];return(e*a-r*o)*(f*v-h*y)-(e*s-n*o)*(c*v-h*d)+(e*u-i*o)*(c*y-f*d)+(r*s-n*a)*(l*v-h*p)-(r*u-i*a)*(l*y-f*p)+(n*u-i*s)*(l*d-c*p)}function mt(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],b=r[0],x=r[1],w=r[2],_=r[3];return t[0]=b*n+x*s+w*f+_*y,t[1]=b*i+x*u+w*h+_*v,t[2]=b*o+x*l+w*p+_*g,t[3]=b*a+x*c+w*d+_*m,b=r[4],x=r[5],w=r[6],_=r[7],t[4]=b*n+x*s+w*f+_*y,t[5]=b*i+x*u+w*h+_*v,t[6]=b*o+x*l+w*p+_*g,t[7]=b*a+x*c+w*d+_*m,b=r[8],x=r[9],w=r[10],_=r[11],t[8]=b*n+x*s+w*f+_*y,t[9]=b*i+x*u+w*h+_*v,t[10]=b*o+x*l+w*p+_*g,t[11]=b*a+x*c+w*d+_*m,b=r[12],x=r[13],w=r[14],_=r[15],t[12]=b*n+x*s+w*f+_*y,t[13]=b*i+x*u+w*h+_*v,t[14]=b*o+x*l+w*p+_*g,t[15]=b*a+x*c+w*d+_*m,t}function bt(t,e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y=r[0],v=r[1],g=r[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=e[9],p=e[10],d=e[11],t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=f,t[9]=h,t[10]=p,t[11]=d,t[12]=n*y+s*v+f*g+e[12],t[13]=i*y+u*v+h*g+e[13],t[14]=o*y+l*v+p*g+e[14],t[15]=a*y+c*v+d*g+e[15]),t}function xt(t,e,r){var n=r[0],i=r[1],o=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function wt(t,e,r,n){var i,o,a,s,u,c,f,h,p,d,y,v,g,m,b,x,w,_,S,E,k,T,C,O,A=n[0],P=n[1],M=n[2],I=Math.hypot(A,P,M);return I0?(r[0]=2*(s*a+f*n+u*o-c*i)/h,r[1]=2*(u*a+f*i+c*n-s*o)/h,r[2]=2*(c*a+f*o+s*i-u*n)/h):(r[0]=2*(s*a+f*n+u*o-c*i),r[1]=2*(u*a+f*i+c*n-s*o),r[2]=2*(c*a+f*o+s*i-u*n)),Mt(t,e,r),t}function Lt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jt(t,e){var r=e[0],n=e[1],i=e[2],o=e[4],a=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.hypot(r,n,i),t[1]=Math.hypot(o,a,s),t[2]=Math.hypot(u,l,c),t}function Nt(t,e){var r=new l.ARRAY_TYPE(3);jt(r,e);var n=1/r[0],i=1/r[1],o=1/r[2],a=e[0]*n,s=e[1]*i,u=e[2]*o,c=e[4]*n,f=e[5]*i,h=e[6]*o,p=e[8]*n,d=e[9]*i,y=e[10]*o,v=a+f+y,g=0;return v>0?(g=2*Math.sqrt(v+1),t[3]=.25*g,t[0]=(h-d)/g,t[1]=(p-u)/g,t[2]=(s-c)/g):a>f&&a>y?(g=2*Math.sqrt(1+a-f-y),t[3]=(h-d)/g,t[0]=.25*g,t[1]=(s+c)/g,t[2]=(p+u)/g):f>y?(g=2*Math.sqrt(1+f-a-y),t[3]=(p-u)/g,t[0]=(s+c)/g,t[1]=.25*g,t[2]=(h+d)/g):(g=2*Math.sqrt(1+y-a-f),t[3]=(s-c)/g,t[0]=(p+u)/g,t[1]=(h+d)/g,t[2]=.25*g),t}function Rt(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,l=o+o,c=a+a,f=i*u,h=i*l,p=i*c,d=o*l,y=o*c,v=a*c,g=s*u,m=s*l,b=s*c,x=n[0],w=n[1],_=n[2];return t[0]=(1-(d+v))*x,t[1]=(h+b)*x,t[2]=(p-m)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+v))*w,t[6]=(y+g)*w,t[7]=0,t[8]=(p+m)*_,t[9]=(y-g)*_,t[10]=(1-(f+d))*_,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function Dt(t,e,r,n,i){var o=e[0],a=e[1],s=e[2],u=e[3],l=o+o,c=a+a,f=s+s,h=o*l,p=o*c,d=o*f,y=a*c,v=a*f,g=s*f,m=u*l,b=u*c,x=u*f,w=n[0],_=n[1],S=n[2],E=i[0],k=i[1],T=i[2],C=(1-(y+g))*w,O=(p+x)*w,A=(d-b)*w,P=(p-x)*_,M=(1-(h+g))*_,I=(v+m)*_,L=(d+b)*S,j=(v-m)*S,N=(1-(h+y))*S;return t[0]=C,t[1]=O,t[2]=A,t[3]=0,t[4]=P,t[5]=M,t[6]=I,t[7]=0,t[8]=L,t[9]=j,t[10]=N,t[11]=0,t[12]=r[0]+E-(C*E+P*k+L*T),t[13]=r[1]+k-(O*E+M*k+j*T),t[14]=r[2]+T-(A*E+I*k+N*T),t[15]=1,t}function Bt(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,l=r*a,c=n*a,f=n*s,h=i*a,p=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-f-d,t[1]=c+g,t[2]=h-v,t[3]=0,t[4]=c-g,t[5]=1-l-d,t[6]=p+y,t[7]=0,t[8]=h+v,t[9]=p-y,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ft(t,e,r,n,i,o,a){var s=1/(r-e),u=1/(i-n),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t}function zt(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=(i+n)*o,t[14]=2*i*n*o):(t[10]=-1,t[14]=-2*n),t}var Gt=zt;function Ut(t,e,r,n,i){var o,a=1/Math.tan(e/2);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(o=1/(n-i),t[10]=i*o,t[14]=i*n*o):(t[10]=-1,t[14]=-n),t}function Vt(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),l=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*l*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function Ht(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=(a+o)*l,t[15]=1,t}var Wt=Ht;function qt(t,e,r,n,i,o,a){var s=1/(e-r),u=1/(n-i),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*u,t[14]=o*l,t[15]=1,t}function Yt(t,e,r,n){var i,o,a,s,u,c,f,h,p,d,y=e[0],v=e[1],g=e[2],m=n[0],b=n[1],x=n[2],w=r[0],_=r[1],S=r[2];return Math.abs(y-w)0&&(c*=p=1/Math.sqrt(p),f*=p,h*=p);var d=u*h-l*f,y=l*c-s*h,v=s*f-u*c;return(p=d*d+y*y+v*v)>0&&(d*=p=1/Math.sqrt(p),y*=p,v*=p),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=f*v-h*y,t[5]=h*d-c*v,t[6]=c*y-f*d,t[7]=0,t[8]=c,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function Zt(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Kt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Jt(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Qt(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function $t(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function te(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function ee(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function re(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=t[8],h=t[9],p=t[10],d=t[11],y=t[12],v=t[13],g=t[14],m=t[15],b=e[0],x=e[1],w=e[2],_=e[3],S=e[4],E=e[5],k=e[6],T=e[7],C=e[8],O=e[9],A=e[10],P=e[11],M=e[12],I=e[13],L=e[14],j=e[15];return Math.abs(r-b)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(n-x)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-w)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(o-_)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(_))&&Math.abs(a-S)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(S))&&Math.abs(s-E)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(u-k)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(c-T)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(f-C)<=l.EPSILON*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(h-O)<=l.EPSILON*Math.max(1,Math.abs(h),Math.abs(O))&&Math.abs(p-A)<=l.EPSILON*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(d-P)<=l.EPSILON*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(y-M)<=l.EPSILON*Math.max(1,Math.abs(y),Math.abs(M))&&Math.abs(v-I)<=l.EPSILON*Math.max(1,Math.abs(v),Math.abs(I))&&Math.abs(g-L)<=l.EPSILON*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(m-j)<=l.EPSILON*Math.max(1,Math.abs(m),Math.abs(j))}var ne=mt,ie=Qt,oe=r(4995);function ae(){var t=new l.ARRAY_TYPE(4);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function se(t){var e=new l.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function ue(t,e,r,n){var i=new l.ARRAY_TYPE(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}function le(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function ce(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function fe(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function he(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}function pe(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}function de(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}function ye(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}function ve(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}function ge(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}function me(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}function be(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}function xe(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function we(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}function _e(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(r,n,i,o)}function Se(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function Ee(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}function ke(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}function Te(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}function Ce(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}function Oe(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}function Ae(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Pe(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],l=r[2]*n[3]-r[3]*n[2],c=e[0],f=e[1],h=e[2],p=e[3];return t[0]=f*l-h*u+p*s,t[1]=-c*l+h*a-p*o,t[2]=c*u-f*a+p*i,t[3]=-c*s+f*o-h*i,t}function Me(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}function Ie(t,e){var r,n,i,o,a,s;e=e||1;do{a=(r=2*l.RANDOM()-1)*r+(n=2*l.RANDOM()-1)*n}while(a>=1);do{s=(i=2*l.RANDOM()-1)*i+(o=2*l.RANDOM()-1)*o}while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}function Le(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}function je(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],l=r[3],c=l*n+s*o-u*i,f=l*i+u*n-a*o,h=l*o+a*i-s*n,p=-a*n-s*i-u*o;return t[0]=c*l+p*-a+f*-u-h*-s,t[1]=f*l+p*-s+h*-a-c*-u,t[2]=h*l+p*-u+c*-s-f*-a,t[3]=e[3],t}function Ne(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}function Re(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function De(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function Be(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))}var Fe,ze=he,Ge=pe,Ue=de,Ve=_e,He=Se,We=Ee,qe=ke,Ye=(Fe=ae(),function(t,e,r,n,i,o){var a,s;for(e||(e=4),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;al.EPSILON?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r}function Qe(t,e){var r=Cr(t,e);return Math.acos(2*r*r-1)}function $e(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-n*l,t[2]=o*c+a*l+n*u-i*s,t[3]=a*c-n*s-i*u-o*l,t}function tr(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+a*s,t[1]=i*u+o*s,t[2]=o*u-i*s,t[3]=a*u-n*s,t}function er(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u-o*s,t[1]=i*u+a*s,t[2]=o*u+n*s,t[3]=a*u-i*s,t}function rr(t,e,r){r*=.5;var n=e[0],i=e[1],o=e[2],a=e[3],s=Math.sin(r),u=Math.cos(r);return t[0]=n*u+i*s,t[1]=i*u-n*s,t[2]=o*u+a*s,t[3]=a*u-o*s,t}function nr(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t}function ir(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=Math.exp(o),u=a>0?s*Math.sin(a)/a:0;return t[0]=r*u,t[1]=n*u,t[2]=i*u,t[3]=s*Math.cos(a),t}function or(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=Math.sqrt(r*r+n*n+i*i),s=a>0?Math.atan2(a,o)/a:0;return t[0]=r*s,t[1]=n*s,t[2]=i*s,t[3]=.5*Math.log(r*r+n*n+i*i+o*o),t}function ar(t,e,r){return or(t,e),Tr(t,t,r),ir(t,t),t}function sr(t,e,r,n){var i,o,a,s,u,c=e[0],f=e[1],h=e[2],p=e[3],d=r[0],y=r[1],v=r[2],g=r[3];return(o=c*d+f*y+h*v+p*g)<0&&(o=-o,d=-d,y=-y,v=-v,g=-g),1-o>l.EPSILON?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-n)*i)/a,u=Math.sin(n*i)/a):(s=1-n,u=n),t[0]=s*c+u*d,t[1]=s*f+u*y,t[2]=s*h+u*v,t[3]=s*p+u*g,t}function ur(t){var e=l.RANDOM(),r=l.RANDOM(),n=l.RANDOM(),i=Math.sqrt(1-e),o=Math.sqrt(e);return t[0]=i*Math.sin(2*Math.PI*r),t[1]=i*Math.cos(2*Math.PI*r),t[2]=o*Math.sin(2*Math.PI*n),t[3]=o*Math.cos(2*Math.PI*n),t}function lr(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o,s=a?1/a:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=o*s,t}function cr(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function fr(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*o+o]-e[3*a+a]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*o+a]-e[3*a+o])*r,t[o]=(e[3*o+i]+e[3*i+o])*r,t[a]=(e[3*a+i]+e[3*i+a])*r}return t}function hr(t,e,r,n){var i=.5*Math.PI/180;e*=i,r*=i,n*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(r),u=Math.cos(r),l=Math.sin(n),c=Math.cos(n);return t[0]=o*u*c-a*s*l,t[1]=a*s*c+o*u*l,t[2]=a*u*l-o*s*c,t[3]=a*u*c+o*s*l,t}function pr(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}var dr,yr,vr,gr,mr,br,xr=se,wr=ue,_r=le,Sr=ce,Er=fe,kr=$e,Tr=xe,Cr=Ae,Or=Me,Ar=Ee,Pr=Ar,Mr=ke,Ir=Mr,Lr=Oe,jr=De,Nr=Be,Rr=(dr=oe.create(),yr=oe.fromValues(1,0,0),vr=oe.fromValues(0,1,0),function(t,e,r){var n=oe.dot(e,r);return n<-.999999?(oe.cross(dr,yr,e),oe.len(dr)<1e-6&&oe.cross(dr,vr,e),oe.normalize(dr,dr),Ke(t,dr,Math.PI),t):n>.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(oe.cross(dr,e,r),t[0]=dr[0],t[1]=dr[1],t[2]=dr[2],t[3]=1+n,Lr(t,t))}),Dr=(gr=Xe(),mr=Xe(),function(t,e,r,n,i,o){return sr(gr,e,i,o),sr(mr,r,n,o),sr(t,gr,mr,2*o*(1-o)),t}),Br=(br=st.create(),function(t,e,r,n){return br[0]=r[0],br[3]=r[1],br[6]=r[2],br[1]=n[0],br[4]=n[1],br[7]=n[2],br[2]=-e[0],br[5]=-e[1],br[8]=-e[2],Lr(t,fr(t,br))});function Fr(){var t=new l.ARRAY_TYPE(8);return l.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0),t[3]=1,t}function zr(t){var e=new l.ARRAY_TYPE(8);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function Gr(t,e,r,n,i,o,a,s){var u=new l.ARRAY_TYPE(8);return u[0]=t,u[1]=e,u[2]=r,u[3]=n,u[4]=i,u[5]=o,u[6]=a,u[7]=s,u}function Ur(t,e,r,n,i,o,a){var s=new l.ARRAY_TYPE(8);s[0]=t,s[1]=e,s[2]=r,s[3]=n;var u=.5*i,c=.5*o,f=.5*a;return s[4]=u*n+c*r-f*e,s[5]=c*n+f*t-u*r,s[6]=f*n+u*e-c*t,s[7]=-u*t-c*e-f*r,s}function Vr(t,e,r){var n=.5*r[0],i=.5*r[1],o=.5*r[2],a=e[0],s=e[1],u=e[2],l=e[3];return t[0]=a,t[1]=s,t[2]=u,t[3]=l,t[4]=n*l+i*u-o*s,t[5]=i*l+o*a-n*u,t[6]=o*l+n*s-i*a,t[7]=-n*a-i*s-o*u,t}function Hr(t,e){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=.5*e[0],t[5]=.5*e[1],t[6]=.5*e[2],t[7]=0,t}function Wr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function qr(t,e){var r=Xe();Nt(r,e);var n=new l.ARRAY_TYPE(3);return Lt(n,e),Vr(t,r,n),t}function Yr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t}function Xr(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t}function Zr(t,e,r,n,i,o,a,s,u){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t}var Kr=_r;function Jr(t,e){return t[0]=e[4],t[1]=e[5],t[2]=e[6],t[3]=e[7],t}var Qr=_r;function $r(t,e){return t[4]=e[0],t[5]=e[1],t[6]=e[2],t[7]=e[3],t}function tn(t,e){var r=e[4],n=e[5],i=e[6],o=e[7],a=-e[0],s=-e[1],u=-e[2],l=e[3];return t[0]=2*(r*l+o*a+n*u-i*s),t[1]=2*(n*l+o*s+i*a-r*u),t[2]=2*(i*l+o*u+r*s-n*a),t}function en(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=.5*r[0],u=.5*r[1],l=.5*r[2],c=e[4],f=e[5],h=e[6],p=e[7];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=a*s+i*l-o*u+c,t[5]=a*u+o*s-n*l+f,t[6]=a*l+n*u-i*s+h,t[7]=-n*s-i*u-o*l+p,t}function rn(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return tr(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function nn(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return er(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function on(t,e,r){var n=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=s*a+c*n+u*o-l*i,h=u*a+c*i+l*n-s*o,p=l*a+c*o+s*i-u*n,d=c*a-s*n-u*i-l*o;return rr(t,e,r),n=t[0],i=t[1],o=t[2],a=t[3],t[4]=f*a+d*n+h*o-p*i,t[5]=h*a+d*i+p*n-f*o,t[6]=p*a+d*o+f*i-h*n,t[7]=d*a-f*n-h*i-p*o,t}function an(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],l=e[2],c=e[3];return t[0]=s*a+c*n+u*o-l*i,t[1]=u*a+c*i+l*n-s*o,t[2]=l*a+c*o+s*i-u*n,t[3]=c*a-s*n-u*i-l*o,s=e[4],u=e[5],l=e[6],c=e[7],t[4]=s*a+c*n+u*o-l*i,t[5]=u*a+c*i+l*n-s*o,t[6]=l*a+c*o+s*i-u*n,t[7]=c*a-s*n-u*i-l*o,t}function sn(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=r[0],u=r[1],l=r[2],c=r[3];return t[0]=n*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-n*l,t[2]=o*c+a*l+n*u-i*s,t[3]=a*c-n*s-i*u-o*l,s=r[4],u=r[5],l=r[6],c=r[7],t[4]=n*c+a*s+i*l-o*u,t[5]=i*c+a*u+o*s-n*l,t[6]=o*c+a*l+n*u-i*s,t[7]=a*c-n*s-i*u-o*l,t}function un(t,e,r,n){if(Math.abs(n)0){r=Math.sqrt(r);var n=e[0]/r,i=e[1]/r,o=e[2]/r,a=e[3]/r,s=e[4],u=e[5],l=e[6],c=e[7],f=n*s+i*u+o*l+a*c;t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=(s-n*f)/r,t[5]=(u-i*f)/r,t[6]=(l-o*f)/r,t[7]=(c-a*f)/r}return t}function _n(t){return"quat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+")"}function Sn(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]}function En(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],f=e[0],h=e[1],p=e[2],d=e[3],y=e[4],v=e[5],g=e[6],m=e[7];return Math.abs(r-f)<=l.EPSILON*Math.max(1,Math.abs(r),Math.abs(f))&&Math.abs(n-h)<=l.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(i-p)<=l.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-d)<=l.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-y)<=l.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(s-v)<=l.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-g)<=l.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(c-m)<=l.EPSILON*Math.max(1,Math.abs(c),Math.abs(m))}var kn=r(4732)},9019:function(t,e,r){"use strict";r.r(e),r.d(e,{add:function(){return O},adjoint:function(){return p},clone:function(){return a},copy:function(){return s},create:function(){return i},determinant:function(){return d},equals:function(){return L},exactEquals:function(){return I},frob:function(){return C},fromMat2d:function(){return _},fromMat4:function(){return o},fromQuat:function(){return S},fromRotation:function(){return x},fromScaling:function(){return w},fromTranslation:function(){return b},fromValues:function(){return u},identity:function(){return c},invert:function(){return h},mul:function(){return j},multiply:function(){return y},multiplyScalar:function(){return P},multiplyScalarAndAdd:function(){return M},normalFromMat4:function(){return E},projection:function(){return k},rotate:function(){return g},scale:function(){return m},set:function(){return l},str:function(){return T},sub:function(){return N},subtract:function(){return A},translate:function(){return v},transpose:function(){return f}});var n=r(5629);function i(){var t=new n.ARRAY_TYPE(9);return n.ARRAY_TYPE!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t}function a(t){var e=new n.ARRAY_TYPE(9);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function u(t,e,r,i,o,a,s,u,l){var c=new n.ARRAY_TYPE(9);return c[0]=t,c[1]=e,c[2]=r,c[3]=i,c[4]=o,c[5]=a,c[6]=s,c[7]=u,c[8]=l,c}function l(t,e,r,n,i,o,a,s,u,l){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t}function c(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function f(t,e){if(t===e){var r=e[1],n=e[2],i=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=i}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function h(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=c*a-s*l,h=-c*o+s*u,p=l*o-a*u,d=r*f+n*h+i*p;return d?(d=1/d,t[0]=f*d,t[1]=(-c*n+i*l)*d,t[2]=(s*n-i*a)*d,t[3]=h*d,t[4]=(c*r-i*u)*d,t[5]=(-s*r+i*o)*d,t[6]=p*d,t[7]=(-l*r+n*u)*d,t[8]=(a*r-n*o)*d,t):null}function p(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8];return t[0]=a*c-s*l,t[1]=i*l-n*c,t[2]=n*s-i*a,t[3]=s*u-o*c,t[4]=r*c-i*u,t[5]=i*o-r*s,t[6]=o*l-a*u,t[7]=n*u-r*l,t[8]=r*a-n*o,t}function d(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8];return e*(l*o-a*u)+r*(-l*i+a*s)+n*(u*i-o*s)}function y(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=r[0],p=r[1],d=r[2],y=r[3],v=r[4],g=r[5],m=r[6],b=r[7],x=r[8];return t[0]=h*n+p*a+d*l,t[1]=h*i+p*s+d*c,t[2]=h*o+p*u+d*f,t[3]=y*n+v*a+g*l,t[4]=y*i+v*s+g*c,t[5]=y*o+v*u+g*f,t[6]=m*n+b*a+x*l,t[7]=m*i+b*s+x*c,t[8]=m*o+b*u+x*f,t}function v(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=r[0],p=r[1];return t[0]=n,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=h*n+p*a+l,t[7]=h*i+p*s+c,t[8]=h*o+p*u+f,t}function g(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],f=e[8],h=Math.sin(r),p=Math.cos(r);return t[0]=p*n+h*a,t[1]=p*i+h*s,t[2]=p*o+h*u,t[3]=p*a-h*n,t[4]=p*s-h*i,t[5]=p*u-h*o,t[6]=l,t[7]=c,t[8]=f,t}function m(t,e,r){var n=r[0],i=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=i*e[3],t[4]=i*e[4],t[5]=i*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function b(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=e[0],t[7]=e[1],t[8]=1,t}function x(t,e){var r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=-r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function w(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=e[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}function _(t,e){return t[0]=e[0],t[1]=e[1],t[2]=0,t[3]=e[2],t[4]=e[3],t[5]=0,t[6]=e[4],t[7]=e[5],t[8]=1,t}function S(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r+r,s=n+n,u=i+i,l=r*a,c=n*a,f=n*s,h=i*a,p=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-f-d,t[3]=c-g,t[6]=h+v,t[1]=c+g,t[4]=1-l-d,t[7]=p-y,t[2]=h-v,t[5]=p+y,t[8]=1-l-f,t}function E(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],f=e[9],h=e[10],p=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=r*s-n*a,b=r*u-i*a,x=r*l-o*a,w=n*u-i*s,_=n*l-o*s,S=i*l-o*u,E=c*y-f*d,k=c*v-h*d,T=c*g-p*d,C=f*v-h*y,O=f*g-p*y,A=h*g-p*v,P=m*A-b*O+x*C+w*T-_*k+S*E;return P?(P=1/P,t[0]=(s*A-u*O+l*C)*P,t[1]=(u*T-a*A-l*k)*P,t[2]=(a*O-s*T+l*E)*P,t[3]=(i*O-n*A-o*C)*P,t[4]=(r*A-i*T+o*k)*P,t[5]=(n*T-r*O-o*E)*P,t[6]=(y*S-v*_+g*w)*P,t[7]=(v*x-d*S-g*b)*P,t[8]=(d*_-y*x+g*m)*P,t):null}function k(t,e,r){return t[0]=2/e,t[1]=0,t[2]=0,t[3]=0,t[4]=-2/r,t[5]=0,t[6]=-1,t[7]=1,t[8]=1,t}function T(t){return"mat3("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+")"}function C(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}function O(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t}function A(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t}function P(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t}function M(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t}function I(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]}function L(t,e){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],l=t[6],c=t[7],f=t[8],h=e[0],p=e[1],d=e[2],y=e[3],v=e[4],g=e[5],m=e[6],b=e[7],x=e[8];return Math.abs(r-h)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(h))&&Math.abs(i-p)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(p))&&Math.abs(o-d)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(d))&&Math.abs(a-y)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(y))&&Math.abs(s-v)<=n.EPSILON*Math.max(1,Math.abs(s),Math.abs(v))&&Math.abs(u-g)<=n.EPSILON*Math.max(1,Math.abs(u),Math.abs(g))&&Math.abs(l-m)<=n.EPSILON*Math.max(1,Math.abs(l),Math.abs(m))&&Math.abs(c-b)<=n.EPSILON*Math.max(1,Math.abs(c),Math.abs(b))&&Math.abs(f-x)<=n.EPSILON*Math.max(1,Math.abs(f),Math.abs(x))}var j=y,N=A},4732:function(t,e,r){"use strict";r.r(e),r.d(e,{add:function(){return l},angle:function(){return R},ceil:function(){return p},clone:function(){return o},copy:function(){return s},create:function(){return i},cross:function(){return O},dist:function(){return q},distance:function(){return x},div:function(){return W},divide:function(){return h},dot:function(){return C},equals:function(){return z},exactEquals:function(){return F},floor:function(){return d},forEach:function(){return Z},fromValues:function(){return a},inverse:function(){return k},len:function(){return U},length:function(){return _},lerp:function(){return A},max:function(){return v},min:function(){return y},mul:function(){return H},multiply:function(){return f},negate:function(){return E},normalize:function(){return T},random:function(){return P},rotate:function(){return N},round:function(){return g},scale:function(){return m},scaleAndAdd:function(){return b},set:function(){return u},sqrDist:function(){return Y},sqrLen:function(){return X},squaredDistance:function(){return w},squaredLength:function(){return S},str:function(){return B},sub:function(){return V},subtract:function(){return c},transformMat2:function(){return M},transformMat2d:function(){return I},transformMat3:function(){return L},transformMat4:function(){return j},zero:function(){return D}});var n=r(5629);function i(){var t=new n.ARRAY_TYPE(2);return n.ARRAY_TYPE!=Float32Array&&(t[0]=0,t[1]=0),t}function o(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r}function s(t,e){return t[0]=e[0],t[1]=e[1],t}function u(t,e,r){return t[0]=e,t[1]=r,t}function l(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function f(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t}function h(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t}function p(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function d(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function y(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function v(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}function g(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function m(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function b(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t}function x(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.hypot(r,n)}function w(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function _(t){var e=t[0],r=t[1];return Math.hypot(e,r)}function S(t){var e=t[0],r=t[1];return e*e+r*r}function E(t,e){return t[0]=-e[0],t[1]=-e[1],t}function k(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function T(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t}function C(t,e){return t[0]*e[0]+t[1]*e[1]}function O(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t}function A(t,e,r,n){var i=e[0],o=e[1];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t}function P(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t}function M(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t}function I(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t}function L(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t}function j(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t}function N(t,e,r,n){var i=e[0]-r[0],o=e[1]-r[1],a=Math.sin(n),s=Math.cos(n);return t[0]=i*s-o*a+r[0],t[1]=i*a+o*s+r[1],t}function R(t,e){var r=t[0],n=t[1],i=e[0],o=e[1],a=Math.sqrt(r*r+n*n)*Math.sqrt(i*i+o*o),s=a&&(r*i+n*o)/a;return Math.acos(Math.min(Math.max(s,-1),1))}function D(t){return t[0]=0,t[1]=0,t}function B(t){return"vec2("+t[0]+", "+t[1]+")"}function F(t,e){return t[0]===e[0]&&t[1]===e[1]}function z(t,e){var r=t[0],i=t[1],o=e[0],a=e[1];return Math.abs(r-o)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-a)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(a))}var G,U=_,V=c,H=f,W=h,q=x,Y=w,X=S,Z=(G=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=2),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function C(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function O(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2];return t[0]=i*u-o*s,t[1]=o*a-n*u,t[2]=n*s-i*a,t}function A(t,e,r,n){var i=e[0],o=e[1],a=e[2];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t}function P(t,e,r,n,i,o){var a=o*o,s=a*(2*o-3)+1,u=a*(o-2)+o,l=a*(o-1),c=a*(3-2*o);return t[0]=e[0]*s+r[0]*u+n[0]*l+i[0]*c,t[1]=e[1]*s+r[1]*u+n[1]*l+i[1]*c,t[2]=e[2]*s+r[2]*u+n[2]*l+i[2]*c,t}function M(t,e,r,n,i,o){var a=1-o,s=a*a,u=o*o,l=s*a,c=3*o*s,f=3*u*a,h=u*o;return t[0]=e[0]*l+r[0]*c+n[0]*f+i[0]*h,t[1]=e[1]*l+r[1]*c+n[1]*f+i[1]*h,t[2]=e[2]*l+r[2]*c+n[2]*f+i[2]*h,t}function I(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,o=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=i*e,t}function L(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[3]*n+r[7]*i+r[11]*o+r[15];return a=a||1,t[0]=(r[0]*n+r[4]*i+r[8]*o+r[12])/a,t[1]=(r[1]*n+r[5]*i+r[9]*o+r[13])/a,t[2]=(r[2]*n+r[6]*i+r[10]*o+r[14])/a,t}function j(t,e,r){var n=e[0],i=e[1],o=e[2];return t[0]=n*r[0]+i*r[3]+o*r[6],t[1]=n*r[1]+i*r[4]+o*r[7],t[2]=n*r[2]+i*r[5]+o*r[8],t}function N(t,e,r){var n=r[0],i=r[1],o=r[2],a=r[3],s=e[0],u=e[1],l=e[2],c=i*l-o*u,f=o*s-n*l,h=n*u-i*s,p=i*h-o*f,d=o*c-n*h,y=n*f-i*c,v=2*a;return c*=v,f*=v,h*=v,p*=2,d*=2,y*=2,t[0]=s+c+p,t[1]=u+f+d,t[2]=l+h+y,t}function R(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0],o[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),o[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function D(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),o[1]=i[1],o[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function B(t,e,r,n){var i=[],o=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],o[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),o[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),o[2]=i[2],t[0]=o[0]+r[0],t[1]=o[1]+r[1],t[2]=o[2]+r[2],t}function F(t,e){var r=t[0],n=t[1],i=t[2],o=e[0],a=e[1],s=e[2],u=Math.sqrt(r*r+n*n+i*i)*Math.sqrt(o*o+a*a+s*s),l=u&&C(t,e)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function z(t){return t[0]=0,t[1]=0,t[2]=0,t}function G(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function U(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function V(t,e){var r=t[0],i=t[1],o=t[2],a=e[0],s=e[1],u=e[2];return Math.abs(r-a)<=n.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(o-u)<=n.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))}var H,W=f,q=h,Y=p,X=w,Z=_,K=a,J=S,Q=(H=i(),function(t,e,r,n,i,o){var a,s;for(e||(e=3),r||(r=0),s=n?Math.min(n*e+r,t.length):t.length,a=r;a=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},5611:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t);var i=200,o="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Boolean]",l="[object Date]",c="[object Function]",f="[object GeneratorFunction]",h="[object Map]",p="[object Number]",d="[object Object]",y="[object RegExp]",v="[object Set]",g="[object String]",m="[object Symbol]",b="[object ArrayBuffer]",x="[object DataView]",w="[object Float32Array]",_="[object Float64Array]",S="[object Int8Array]",E="[object Int16Array]",k="[object Int32Array]",T="[object Uint8Array]",C="[object Uint8ClampedArray]",O="[object Uint16Array]",A="[object Uint32Array]",P=/\w*$/,M=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,L={};L[s]=L["[object Array]"]=L[b]=L[x]=L[u]=L[l]=L[w]=L[_]=L[S]=L[E]=L[k]=L[h]=L[p]=L[d]=L[y]=L[v]=L[g]=L[m]=L[T]=L[C]=L[O]=L[A]=!0,L["[object Error]"]=L[c]=L["[object WeakMap]"]=!1;var j="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,N="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,R=j||N||Function("return this")(),D="object"==n(e)&&e&&!e.nodeType&&e,B=D&&"object"==n(t)&&t&&!t.nodeType&&t,F=B&&B.exports===D;function z(t,e){return t.set(e[0],e[1]),t}function G(t,e){return t.add(e),t}function U(t,e,r,n){var i=-1,o=t?t.length:0;for(n&&o&&(r=t[++i]);++i-1},Ct.prototype.set=function(t,e){var r=this.__data__,n=It(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Ot.prototype.clear=function(){this.__data__={hash:new Tt,map:new(dt||Ct),string:new Tt}},Ot.prototype.delete=function(t){return Dt(this,t).delete(t)},Ot.prototype.get=function(t){return Dt(this,t).get(t)},Ot.prototype.has=function(t){return Dt(this,t).has(t)},Ot.prototype.set=function(t,e){return Dt(this,t).set(t,e),this},At.prototype.clear=function(){this.__data__=new Ct},At.prototype.delete=function(t){return this.__data__.delete(t)},At.prototype.get=function(t){return this.__data__.get(t)},At.prototype.has=function(t){return this.__data__.has(t)},At.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Ct){var n=r.__data__;if(!dt||n.length-1&&t%1==0&&t-1&&t%1==0&&t<=a}(t.length)&&!Xt(t)}var Yt=ft||function(){return!1};function Xt(t){var e=Zt(t)?et.call(t):"";return e==c||e==f}function Zt(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function Kt(t){return qt(t)?Pt(t):function(t){if(!Ut(t))return ht(t);var e=[];for(var r in Object(t))tt.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}t.exports=function(t){return Lt(t,!0,!0)}},1855:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i="Expected a function",o=NaN,a="[object Symbol]",s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,h="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,d=h||p||Function("return this")(),y=Object.prototype.toString,v=Math.max,g=Math.min,m=function(){return d.Date.now()};function b(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function x(t){return"symbol"==n(t)||function(t){return!!t&&"object"==n(t)}(t)&&y.call(t)==a}function w(t){if("number"==typeof t)return t;if(x(t))return o;if(b(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=b(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var r=l.test(t);return r||c.test(t)?f(t.slice(2),r?2:8):u.test(t)?o:+t}t.exports=function(t,e,r){var n,o,a,s,u,l,c=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError(i);function d(e){var r=n,i=o;return n=o=void 0,c=e,s=t.apply(i,r)}function y(t){var r=t-l;return void 0===l||r>=e||r<0||h&&t-c>=a}function x(){var t=m();if(y(t))return _(t);u=setTimeout(x,function(t){var r=e-(t-l);return h?g(r,a-(t-c)):r}(t))}function _(t){return u=void 0,p&&n?d(t):(n=o=void 0,s)}function S(){var t=m(),r=y(t);if(n=arguments,o=this,l=t,r){if(void 0===u)return function(t){return c=t,u=setTimeout(x,e),f?d(t):s}(l);if(h)return u=setTimeout(x,e),d(l)}return void 0===u&&(u=setTimeout(x,e)),s}return e=w(e)||0,b(r)&&(f=!!r.leading,a=(h="maxWait"in r)?v(w(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p),S.cancel=function(){void 0!==u&&clearTimeout(u),c=0,n=l=o=u=void 0},S.flush=function(){return void 0===u?s:_(m())},S}},311:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=200,o="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",u="[object Function]",l="[object GeneratorFunction]",c=/^\[object .+?Constructor\]$/,f="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,h="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,p=f||h||Function("return this")();function d(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var i=t.length,o=r+(n?1:-1);for(;n?o--:++o-1}function y(t,e,r){for(var n=-1,i=t?t.length:0;++n=i&&(s=m,u=!1,e=new F(e));t:for(;++a-1},D.prototype.set=function(t,e){var r=this.__data__,n=z(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},B.prototype.clear=function(){this.__data__={hash:new R,map:new(j||D),string:new R}},B.prototype.delete=function(t){return V(this,t).delete(t)},B.prototype.get=function(t){return V(this,t).get(t)},B.prototype.has=function(t){return V(this,t).has(t)},B.prototype.set=function(t,e){return V(this,t).set(t,e),this},F.prototype.add=F.prototype.push=function(t){return this.__data__.set(t,o),this},F.prototype.has=function(t){return this.__data__.has(t)};var q,Y,X=(q=function(t,e){return J(t)?G(t,function t(e,r,n,i,o){var a=-1,s=e.length;for(n||(n=W),o||(o=[]);++a0&&n(u)?r>1?t(u,r-1,n,i,o):v(o,u):i||(o[o.length]=u)}return o}(e,1,J,!0)):[]},Y=L(void 0===Y?q.length-1:Y,0),function(){for(var t=arguments,e=-1,r=L(t.length-Y,0),n=Array(r);++e-1&&t%1==0&&t<=a}(t.length)&&!Q(t)}function J(t){return function(t){return!!t&&"object"==n(t)}(t)&&K(t)}function Q(t){var e=$(t)?C.call(t):"";return e==u||e==l}function $(t){var e=n(t);return!!t&&("object"==e||"function"==e)}t.exports=X},8676:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i="Expected a function",o=NaN,a="[object Symbol]",s=/^\s+|\s+$/g,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt,h="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,d=h||p||Function("return this")(),y=Object.prototype.toString,v=Math.max,g=Math.min,m=function(){return d.Date.now()};function b(t,e,r){var n,o,a,s,u,l,c=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new TypeError(i);function d(e){var r=n,i=o;return n=o=void 0,c=e,s=t.apply(i,r)}function y(t){var r=t-l;return void 0===l||r>=e||r<0||h&&t-c>=a}function b(){var t=m();if(y(t))return w(t);u=setTimeout(b,function(t){var r=e-(t-l);return h?g(r,a-(t-c)):r}(t))}function w(t){return u=void 0,p&&n?d(t):(n=o=void 0,s)}function S(){var t=m(),r=y(t);if(n=arguments,o=this,l=t,r){if(void 0===u)return function(t){return c=t,u=setTimeout(b,e),f?d(t):s}(l);if(h)return u=setTimeout(b,e),d(l)}return void 0===u&&(u=setTimeout(b,e)),s}return e=_(e)||0,x(r)&&(f=!!r.leading,a=(h="maxWait"in r)?v(_(r.maxWait)||0,e):a,p="trailing"in r?!!r.trailing:p),S.cancel=function(){void 0!==u&&clearTimeout(u),c=0,n=l=o=u=void 0},S.flush=function(){return void 0===u?s:w(m())},S}function x(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function w(t){return"symbol"==n(t)||function(t){return!!t&&"object"==n(t)}(t)&&y.call(t)==a}function _(t){if("number"==typeof t)return t;if(w(t))return o;if(x(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=x(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var r=l.test(t);return r||c.test(t)?f(t.slice(2),r?2:8):u.test(t)?o:+t}t.exports=function(t,e,r){var n=!0,o=!0;if("function"!=typeof t)throw new TypeError(i);return x(r)&&(n="leading"in r?!!r.leading:n,o="trailing"in r?!!r.trailing:o),b(t,e,{leading:n,maxWait:e,trailing:o})}},8518:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=9007199254740991,o="[object Arguments]",a="[object Function]",s="[object GeneratorFunction]",u="[object Map]",l="[object Set]",c=/^\[object .+?Constructor\]$/,f=/^(?:0|[1-9]\d*)$/,h="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,p="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,d=h||p||Function("return this")();function y(t,e){return function(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r-1&&t%1==0&&t-1&&t%1==0&&t<=i}(t.length)&&!X(t)}function X(t){var e=Z(t)?k.call(t):"";return e==a||e==s}function Z(t){var e=n(t);return!!t&&("object"==e||"function"==e)}var K,J=(K=function(t){return Y(t)?F(t):G(t)},function(t){var e,r,n,i=V(t);return i==u?(e=t,r=-1,n=Array(e.size),e.forEach(function(t,e){n[++r]=[e,t]}),n):i==l?function(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=[t,t]}),r}(t):y(t,K(t))});t.exports=J},44:function(t,e,r){function n(t){"@babel/helpers - typeof";return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t);var i=200,o="Expected a function",a="__lodash_hash_undefined__",s=1,u=2,l=1/0,c=9007199254740991,f="[object Arguments]",h="[object Array]",p="[object Boolean]",d="[object Date]",y="[object Error]",v="[object Function]",g="[object GeneratorFunction]",m="[object Map]",b="[object Number]",x="[object Object]",w="[object RegExp]",_="[object Set]",S="[object String]",E="[object Symbol]",k="[object ArrayBuffer]",T="[object DataView]",C=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,A=/^\./,P=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,M=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,j={};j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j[f]=j[h]=j[k]=j[p]=j[T]=j[d]=j[y]=j[v]=j[m]=j[b]=j[x]=j[w]=j[_]=j[S]=j["[object WeakMap]"]=!1;var N="object"==(void 0===r.g?"undefined":n(r.g))&&r.g&&r.g.Object===Object&&r.g,R="object"==("undefined"==typeof self?"undefined":n(self))&&self&&self.Object===Object&&self,D=N||R||Function("return this")(),B="object"==n(e)&&e&&!e.nodeType&&e,F=B&&"object"==n(t)&&t&&!t.nodeType&&t,z=F&&F.exports===B&&N.process,G=function(){try{return z&&z.binding("util")}catch(t){}}(),U=G&&G.isTypedArray;function V(t,e){return!!(t?t.length:0)&&function(t,e,r){if(e!=e)return function(t,e,r,n){var i=t.length,o=r+(n?1:-1);for(;n?o--:++o-1}function H(t,e,r){for(var n=-1,i=t?t.length:0;++n-1},At.prototype.set=function(t,e){var r=this.__data__,n=jt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Pt.prototype.clear=function(){this.__data__={hash:new Ot,map:new(yt||At),string:new Ot}},Pt.prototype.delete=function(t){return Ht(this,t).delete(t)},Pt.prototype.get=function(t){return Ht(this,t).get(t)},Pt.prototype.has=function(t){return Ht(this,t).has(t)},Pt.prototype.set=function(t,e){return Ht(this,t).set(t,e),this},Mt.prototype.add=Mt.prototype.push=function(t){return this.__data__.set(t,a),this},Mt.prototype.has=function(t){return this.__data__.has(t)},It.prototype.clear=function(){this.__data__=new At},It.prototype.delete=function(t){return this.__data__.delete(t)},It.prototype.get=function(t){return this.__data__.get(t)},It.prototype.has=function(t){return this.__data__.has(t)},It.prototype.set=function(t,e){var r=this.__data__;if(r instanceof At){var n=r.__data__;if(!yt||n.lengthl))return!1;var f=o.get(t);if(f&&o.get(e))return f==e;var h=-1,p=!0,d=i&s?new Mt:void 0;for(o.set(t,e),o.set(e,t);++h-1&&t%1==0&&t-1&&t%1==0&&t<=c}function se(t){var e=n(t);return!!t&&("object"==e||"function"==e)}function ue(t){return!!t&&"object"==n(t)}function le(t){return"symbol"==n(t)||ue(t)&&st.call(t)==E}var ce=U?function(t){return function(e){return t(e)}}(U):function(t){return ue(t)&&ae(t.length)&&!!j[st.call(t)]};function fe(t){return ie(t)?Lt(t):zt(t)}function he(t){return t}t.exports=function(t,e){return t&&t.length?function(t,e,r){var n=-1,o=V,a=t.length,s=!0,u=[],l=u;if(r)s=!1,o=H;else if(a>=i){var c=e?null:Ut(t);if(c)return K(c);s=!1,o=Y,l=new Mt}else l=e?[]:u;t:for(;++n-1&&t%1==0&&t<=e}},7473:function(t,e,r){var n=r(522),i=r(9484),o="[object Number]";t.exports=function(t){return"number"==typeof t||i(t)&&n(t)==o}},9484:function(t){function e(t){"@babel/helpers - typeof";return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return null!=t&&"object"==e(t)}},6601:function(t,e,r){var n=r(522),i=r(7969),o=r(9484),a="[object Object]",s=Function.prototype,u=Object.prototype,l=s.toString,c=u.hasOwnProperty,f=l.call(Object);t.exports=function(t){if(!o(t)||n(t)!=a)return!1;var e=i(t);if(null===e)return!0;var r=c.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&l.call(r)==f}},2021:function(t,e,r){var n=r(6171),i=r(6683),o=r(4123),a=o&&o.isTypedArray,s=a?i(a):n;t.exports=s},7915:function(t,e,r){var n,i,o,a;function s(t){"@babel/helpers - typeof";return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),window,a=function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==s(t)&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=32)}([function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,r){(function(e){var n=r(0),i=r(35),o=t.exports=n.util=n.util||{};function a(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function u(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(o.isArrayBuffer(t)||o.isArrayBufferView(t))if("undefined"!=typeof Buffer&&t instanceof Buffer)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var r=0;r15?(r=Date.now(),a(t)):(e.push(t),1===e.length&&i.setAttribute("a",n=!n))}}o.nextTick=o.setImmediate}(),o.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,o.globalScope=o.isNodejs?e:"undefined"==typeof self?window:self,o.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},o.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},o.isArrayBufferView=function(t){return t&&o.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},o.ByteBuffer=u,o.ByteStringBuffer=u,o.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},o.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},o.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},o.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(o.encodeUtf8(t))},o.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},o.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},o.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},o.ByteStringBuffer.prototype.putInt=function(t,e){a(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e},o.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},o.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},o.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var t=o.createBuffer(this.data);return t.read=this.read,t},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},o.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},o.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},o.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},o.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},o.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},o.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(t,e){a(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},o.DataBuffer.prototype.putSignedInt=function(t,e){return a(e),this.accommodate(e/8),t<0&&(t+=2<0);return e},o.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},o.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},o.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},o.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},o.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},o.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},o.xorBytes=function(t,e,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+o},o.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],f="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";o.encode64=function(t,e){for(var r,n,i,o="",a="",s=0;s>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+o},o.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,o="",a=0;a>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},o.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},o.decodeUtf8=function(t){return decodeURIComponent(escape(t))},o.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},o.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},o.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o>2),o+=l.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=l.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":l.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+o},o.binary.base64.decode=function(t,e,r){var n,i,o,a,s=e;s||(s=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u>4,64!==o&&(s[l++]=(15&i)<<4|o>>2,64!==a&&(s[l++]=(3&o)<<6|a));return e?l-r:s.subarray(0,l)},o.binary.base58.encode=function(t,e){return o.binary.baseN.encode(t,f,e)},o.binary.base58.decode=function(t,e){return o.binary.baseN.decode(t,f,e)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(t,e,r){t=o.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,a=0;a0&&o.push(r),a=n.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(t.substring(a)),o.join("")},o.formatNumber=function(t,e,r,n){var i=t,o=isNaN(e=Math.abs(e))?2:e,a=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-l).toFixed(o).slice(2):"")},o.formatSize=function(t){return t>=1073741824?o.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?o.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?o.formatNumber(t/1024,0)+" KiB":o.formatNumber(t,0)+" bytes"},o.bytesFromIP=function(t){return-1!==t.indexOf(".")?o.bytesFromIPv4(t):-1!==t.indexOf(":")?o.bytesFromIPv6(t):null},o.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=o.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}e.push(a)}if(r.length>0){var l=r[n];l.end-l.start>0&&(e.splice(l.start,l.end-l.start+1,""),0===l.start&&e.unshift(""),7===l.end&&e.push(""))}return e.join(":")},o.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in o&&!t.update)return e(null,o.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,e(null,o.cores);if("undefined"==typeof Worker)return o.cores=1,e(null,o.cores);if("undefined"==typeof Blob)return o.cores=2,e(null,o.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),r=e+4;Date.now()s.st&&i.sti.st&&s.ste){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(t,e,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;ur){if(a.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=r,d.requested=p,d}p=r}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(o(e,r,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),r-=2;break}s=e.length(),f.push(t(e,r,n+1,a)),r-=s-e.length()}else for(;p>0;)s=e.length(),f.push(t(e,p,n+1,a)),r-=s-e.length(),p-=s-e.length();if(void 0===f&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&a.decodeBitStrings&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&p>1){var v=e.read,g=r,m=0;if(c===i.Type.BITSTRING&&(o(e,r,1),m=e.getByte(),r--),0===m)try{s=e.length();var b=t(e,r,n+1,{strict:!0,decodeBitStrings:!0}),x=s-e.length();r-=x,c==i.Type.BITSTRING&&x++;var w=b.tagClass;x!==p||w!==i.Class.UNIVERSAL&&w!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(t){}void 0===f&&(e.read=v,r=g)}if(void 0===f){if(void 0===p){if(a.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=r}if(c===i.Type.BMPSTRING)for(f="";p>0;p-=2)o(e,r,2),f+=String.fromCharCode(e.getInt16()),r-=2;else f=e.getBytes(p),r-=p}var _=void 0===h?null:{bitStringContents:h};return i.create(l,c,y,f,_)}(t,t.length(),0,e);if(e.parseAllBytes&&0!==t.length()){var s=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw s.byteCount=r,s.remaining=t.length(),s}return a},i.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=i.equals(t,t.original))),a)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:o.putByte(0);for(var s=0;s1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(r),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(e.putByte(128|l.length),s=l.length-1;s>=0;--s)e.putByte(l.charCodeAt(s))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,r,i,o,a=t.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u>>=7,e||(o|=128),r.push(o),e=!1}while(i>0);for(var l=r.length-1;l>=0;--l)s.putByte(r[l])}return s},i.derToOid=function(t){var e;"string"==typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)i<<=7,128&(r=t.getByte())?i+=127&r:(e+="."+(i+r),i=0);return e},i.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),l+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,0),l&&("+"===(u=t.charAt(l))||"-"===u)){var c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10);c*=6e4,"+"===u?e.setTime(+e-c):e.setTime(+e+c)}return e},i.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,l=0,c=!1;"Z"===t.charAt(t.length-1)&&(c=!0);var f=t.length-5,h=t.charAt(f);return"+"!==h&&"-"!==h||(l=60*parseInt(t.substr(f+1,2),10)+parseInt(t.substr(f+4,2),10),l*=6e4,"+"===h&&(l*=-1),c=!0),"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),c?(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,u),e.setTime(+e+l)):(e.setFullYear(r,n,i),e.setHours(o,a,s,u)),e},i.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},i.derToInteger=function(t){"string"==typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,r,o){var a=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(a=!0,e.value&&n.util.isArray(e.value))for(var s=0,u=0;a&&u0&&(o+="\n");for(var s="",u=0;u1?o+="0x"+n.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var h=t.value.charCodeAt(0);1==h?o+=" (1 unused bit shown)":h>1&&(o+=" ("+h+" unused bits shown)")}}else if(t.type===i.Type.OCTETSTRING)a.test(t.value)||(o+="("+t.value+") "),o+="0x"+n.util.bytesToHex(t.value);else if(t.type===i.Type.UTF8)try{o+=n.util.decodeUtf8(t.value)}catch(e){if("URI malformed"!==e.message)throw e;o+="0x"+n.util.bytesToHex(t.value)+" (malformed UTF8)"}else t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:a.test(t.value)?o+="0x"+n.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},function(t,e,r){var n=r(0);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(t,e,r){var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.aes.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},n.aes.createEncryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},n.aes.createDecryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){c||f();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return p(r._w,t,e,!1)},decrypt:function(t,e){return p(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var i=0;i>>=2,i=0;i>8^255&f^99,o[y]=f,a[f]=y,p=(h=t[f])<<24^f<<16^f<<8^f^h,d=((r=t[y])^(n=t[r])^(i=t[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,l[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^t[t[t[r^i]]],v^=t[t[v]])}}function h(t,e){for(var r,n=t.slice(0),i=1,a=n.length,u=4*(a+6+1),c=a;c>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^s[i]<<24,i++):a>6&&c%a==4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[c]=n[c-a]^r;if(e){for(var f,h=l[0],p=l[1],d=l[2],y=l[3],v=n.slice(0),g=(c=0,(u=n.length)-4);c>>24]]^p[o[f>>>16&255]]^d[o[f>>>8&255]]^y[o[255&f]];n=v}return n}function p(t,e,r,n){var i,s,c,f,h,p,d,y,v,g,m,b,x=t.length/4-1;n?(i=l[0],s=l[1],c=l[2],f=l[3],h=a):(i=u[0],s=u[1],c=u[2],f=u[3],h=o),p=e[0]^t[0],d=e[n?3:1]^t[1],y=e[2]^t[2],v=e[n?1:3]^t[3];for(var w=3,_=1;_>>24]^s[d>>>16&255]^c[y>>>8&255]^f[255&v]^t[++w],m=i[d>>>24]^s[y>>>16&255]^c[v>>>8&255]^f[255&p]^t[++w],b=i[y>>>24]^s[v>>>16&255]^c[p>>>8&255]^f[255&d]^t[++w],v=i[v>>>24]^s[p>>>16&255]^c[d>>>8&255]^f[255&y]^t[++w],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^t[++w],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^t[++w],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^t[++w],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^t[++w]}function d(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(0);n.pki=n.pki||{};var i=t.exports=n.pki.oids=n.oids=n.oids||{};function o(t,e){i[t]=e,i[e]=t}function a(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("1.3.14.3.2.29","sha1WithRSASignature"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("2.16.840.1.101.3.4.2.4","sha224"),o("2.16.840.1.101.3.4.2.5","sha512-224"),o("2.16.840.1.101.3.4.2.6","sha512-256"),o("1.2.840.113549.2.2","md2"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.4","surname"),o("2.5.4.5","serialNumber"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.12","title"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("2.5.4.42","givenName"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e,r){var n=r(0);r(1);var i=t.exports=n.pem=n.pem||{};function o(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i65&&-1!==a){var s=e[a];","===s?(++a,e=e.substr(0,a)+"\r\n "+e.substr(a)):e=e.substr(0,a)+"\r\n"+s+e.substr(a+1),o=i-a-1,a=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(a=i);return e}function a(t){return t.replace(/^\s+/,"")}i.encode=function(t,e){e=e||{};var r,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=o(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=o(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),i+=o(r)),t.headers)for(var a=0;ae.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),l=a.length(),u=0;u>>0,u>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=u[1],u[1]=u[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),s(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=u>>>0;a.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};s(h,r,a);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var o=null,a=!1;function s(t,e,r){for(var n,i,o,a,s,u,l,c=r.length();c>=64;){for(i=t.h0,o=t.h1,a=t.h2,s=t.h3,u=t.h4,l=0;l<16;++l)n=r.getInt32(),e[l]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<20;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<32;++l)n=(n=e[l-3]^e[l-8]^e[l-14]^e[l-16])<<1|n>>>31,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<40;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<60;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;l<80;++l)n=(n=e[l-6]^e[l-16]^e[l-28]^e[l-32])<<2|n>>>30,e[l]=n,n=(i<<5|i>>>27)+(o^a^s)+u+3395469782+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,c-=64}}},function(t,e,r){var n=r(0);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.des.Algorithm(t,e)})}r(13),r(19),r(1),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createEncryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var i=d({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createDecryptionCipher=function(t,e){return d({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return p(r._keys,t,e,!1)},decrypt:function(t,e){return p(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=t.length()>8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,x=0;x>>4^_))<<4,w^=e=65535&((_^=e)>>>-16^w),w^=(e=858993459&(w>>>2^(_^=e<<-16)))<<2,w^=e=65535&((_^=e)>>>-16^w),w^=(e=1431655765&(w>>>1^(_^=e<<-16)))<<1,w^=e=16711935&((_^=e)>>>8^w),e=(w^=(e=1431655765&(w>>>1^(_^=e<<8)))<<1)<<8|(_^=e)>>>20&240,w=_<<24|_<<8&16711680|_>>>8&65280|_>>>24&240,_=e;for(var S=0;S>>26,_=_<<2|_>>>26):(w=w<<1|w>>>27,_=_<<1|_>>>27);var E=r[(w&=-15)>>>28]|n[w>>>24&15]|i[w>>>20&15]|o[w>>>16&15]|a[w>>>12&15]|s[w>>>8&15]|u[w>>>4&15],k=l[(_&=-15)>>>28]|c[_>>>24&15]|f[_>>>20&15]|h[_>>>16&15]|p[_>>>12&15]|d[_>>>8&15]|y[_>>>4&15];e=65535&(k>>>16^E),g[b++]=E^e,g[b++]=k^e<<16}}return g}(e),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],l=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],c=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function p(t,e,r,n){var i,p,d=32===t.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=e[0],v=e[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g>>4|v<<28)^t[x+1];p=y,y=v,v=p^(a[w>>>24&63]|u[w>>>16&63]|c[w>>>8&63]|h[63&w]|o[_>>>24&63]|s[_>>>16&63]|l[_>>>8&63]|f[63&_])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(0);if(r(3),r(12),r(6),r(26),r(27),r(2),r(1),void 0===i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(16):null,a=n.asn1,u=n.util;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var l=n.pki,c=[6,4,2,4,2,4,6,2],f={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},h={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},p={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},y={name:"DigestInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},v=function(t){var e;if(!(t.algorithm in l.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=l.oids[t.algorithm];var n=a.oidToDer(e).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);o.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),o.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(o),i.value.push(s),a.toDer(i).getBytes()},g=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var a=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(s)<0;)a=a.add(e.p);var u=a.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return u.multiply(o.modInverse(e.n)).mod(e.n)};function m(t,e,r){var i=n.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s,u=o-3-t.length;if(0===r||1===r){s=0===r?0:255;for(var l=0;l0;){var c=0,f=n.random.getBytes(u);for(l=0;l1;){if(255!==a.getByte()){--a.read;break}++l}else if(2===u)for(l=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++l}if(0!==a.getByte()||l!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function x(t,e,r){"function"==typeof e&&(r=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};function a(){s(t.pBits,function(e,n){return e?r(e):(t.p=n,null!==t.q?u(e,t.q):void s(t.qBits,u))})}function s(t,e){n.prime.generateProbablePrime(t,o,e)}function u(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void a();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void s(t.qBits,u);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void a();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void s(t.qBits,u);var c=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,c,t.p,t.q,c.mod(t.p1),c.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}"prng"in e&&(o.prng=e.prng),a()}function w(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function _(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function S(t){return n.util.isNodejs&&"function"==typeof o[t]}function E(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.crypto)&&"object"==s(u.globalScope.crypto.subtle)&&"function"==typeof u.globalScope.crypto.subtle[t]}function k(t){return void 0!==u.globalScope&&"object"==s(u.globalScope.msCrypto)&&"object"==s(u.globalScope.msCrypto.subtle)&&"function"==typeof u.globalScope.msCrypto.subtle[t]}function T(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),c.getBytes()},l.rsa.decrypt=function(t,e,r,o){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=a,s}var u=new i(n.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var l=g(u,e,r).toString(16),c=n.util.createBuffer(),f=a-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),!1!==o?b(c.getBytes(),e,r):c.getBytes()},l.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var o,a=(r=r||{}).prng||n.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),r=0;r>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},l.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,a=function(t,e){return t|e},s=+new Date,u=0;null===t.keys&&(e<=0||uf?t.pqState=0:t.num.isProbablePrime(_(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(c[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var p=t.e.modInverse(t.phi);t.keys={privateKey:l.rsa.setPrivateKey(t.n,t.e,p,t.p,t.q,p.mod(t.p1),p.mod(t.q1),t.q.modInverse(t.p)),publicKey:l.rsa.setPublicKey(t.n,t.e)}}u+=(n=+new Date)-s,s=n}return null!==t.keys},l.rsa.generateKeyPair=function(t,e,r,i){if(1===arguments.length?"object"==s(t)?(r=t,t=void 0):"function"==typeof t&&(i=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(i=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,i=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(i=r,r=void 0):(i=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&t>=256&&t<=16384&&(65537===e||3===e))if(i){if(S("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},function(t,e,r){if(t)return i(t);i(null,{privateKey:l.privateKeyFromPem(r),publicKey:l.publicKeyFromPem(e)})});if(E("generateKey")&&E("exportKey"))return u.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:T(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return u.globalScope.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){i(t)}).then(function(t){if(t){var e=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));i(null,{privateKey:e,publicKey:l.setRsaPublicKey(e.n,e.e)})}});if(k("generateKey")&&k("exportKey")){var c=u.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:T(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(t){var e=t.target.result,r=u.globalScope.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=l.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));i(null,{privateKey:r,publicKey:l.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){i(t)}},void(c.onerror=function(t){i(t)})}}else if(S("generateKeyPairSync")){var f=o.generateKeyPairSync("rsa",{modulusLength:t,publicExponent:e,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:l.privateKeyFromPem(f.privateKey),publicKey:l.publicKeyFromPem(f.publicKey)}}var h=l.rsa.createKeyPairGenerationState(t,e,r);if(!i)return l.rsa.stepKeyPairGenerationState(h,0),h.keys;x(h,r,i)},l.setRsaPublicKey=l.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return m(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,r,!0);return l.rsa.encrypt(o,r,!0)},verify:function(t,e,i,o){"string"==typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===o&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(t,e){e=b(e,r,!0);var i=a.fromDer(e,{parseAllBytes:o._parseAllDigestBytes}),s={},u=[];if(!a.validate(i,y,s,u))throw(l=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,l;var l,c=a.derToOid(s.algorithmIdentifier);if(c!==n.oids.md2&&c!==n.oids.md5&&c!==n.oids.sha1&&c!==n.oids.sha224&&c!==n.oids.sha256&&c!==n.oids.sha384&&c!==n.oids.sha512&&c!==n.oids["sha512-224"]&&c!==n.oids["sha512-256"])throw(l=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=c,l;if(!(c!==n.oids.md2&&c!==n.oids.md5||"parameters"in s))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return t===s.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(t,e){return t===b(e,r,!0)}});var s=l.rsa.decrypt(e,r,!0,!1);return i.verify(t,s,r.n.bitLength())}};return r},l.setRsaPrivateKey=l.rsa.setPrivateKey=function(t,e,r,i,o,a,s,u){var c={n:t,e:e,d:r,p:i,q:o,dP:a,dQ:s,qInv:u,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=l.rsa.decrypt(t,c,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:b};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,c,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:v},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,c.n.bitLength());return l.rsa.encrypt(n,c,r)}};return c},l.wrapRsaPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(t).getBytes())])},l.privateKeyFromAsn1=function(t){var e,r,o,s,u,c,p,d,y={},v=[];if(a.validate(t,f,y,v)&&(t=a.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!a.validate(t,h,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return e=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),u=n.util.createBuffer(y.privateKeyPrime2).toHex(),c=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),l.setRsaPrivateKey(new i(e,16),new i(r,16),new i(o,16),new i(s,16),new i(u,16),new i(c,16),new i(p,16),new i(d,16))},l.privateKeyToAsn1=l.privateKeyToRSAPrivateKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.qInv))])},l.publicKeyFromAsn1=function(t){var e={},r=[];if(a.validate(t,d,e,r)){var o,s=a.derToOid(e.publicKeyOid);if(s!==l.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=s,o;t=e.rsaPublicKey}if(r=[],!a.validate(t,p,e,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var u=n.util.createBuffer(e.publicKeyModulus).toHex(),c=n.util.createBuffer(e.publicKeyExponent).toHex();return l.setRsaPublicKey(new i(u,16),new i(c,16))},l.publicKeyToAsn1=l.publicKeyToSubjectPublicKeyInfo=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(l.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[l.publicKeyToRSAPublicKey(t)])])},l.publicKeyToRSAPublicKey=function(t){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(t.e))])}},function(t,e,r){var n,i=r(0);function o(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new o(null)}function s(t,e,r,n,i,o){for(var a=16383&e,s=e>>14;--o>=0;){var u=16383&this.data[t],l=this.data[t++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+r.data[n]+i)>>28)+(c>>14)+s*l,r.data[n++]=268435455&u}return i}t.exports=i.jsbn=i.jsbn||{},i.jsbn.BigInteger=o,"undefined"==typeof navigator?(o.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(var a=32767&e,s=e>>15;--o>=0;){var u=32767&this.data[t],l=this.data[t++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+r.data[n]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var a=e*this.data[t++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i},n=26):(o.prototype.am=s,n=28),o.prototype.DB=n,o.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function y(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function _(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function S(){}function E(t){return t}function k(t){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}y.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},y.prototype.revert=function(t){return t},y.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},y.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},y.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.convert=function(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},v.prototype.revert=function(t){var e=a();return t.copyTo(e),this.reduce(e),e},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},o.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var s=8==r?255&t[n]:h(t,n);s<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-a):this.data[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},o.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e.data[r+a+1]=this.data[r]>>i|s,s=(this.data[r]&o)<=0;--r)e.data[r]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<>n;for(var a=r+1;a>n;n>0&&(e.data[this.t-r-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()},o.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},o.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<=0&&(r.data[r.t++]=1,r.subTo(x,r)),o.ONE.dlShiftTo(f,x),x.subTo(s,s);s.t=0;){var w=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,w,r,b,0,f))0&&r.rShiftTo(c,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var r=a(),n=a(),i=e.convert(this),s=d(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var u=r;r=n,n=u}return e.revert(r)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<0)for(s>s)>0&&(i=!0,o=f(r));a>=0;)s>(s+=this.DB-e)):(r=this.data[a]>>(s-=e)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=f(r));return i?o:"0"},o.prototype.negate=function(){var t=a();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new y(e):new v(e),this.exp(t,r)},o.ZERO=p(0),o.ONE=p(1),S.prototype.convert=E,S.prototype.revert=E,S.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},S.prototype.sqrTo=function(t,e){t.squareTo(e)},k.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e},k.prototype.revert=function(t){return t},k.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},k.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},k.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var T=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],C=(1<<26)/T[T.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=p(r),i=a(),o=a(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},o.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),a={nextBytes:function(t){for(var e=0;e=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var l=1;l++>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<=0;)n<8?(r=(this.data[t]&(1<>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=a();return this.bitwiseTo(t,g,e),e},o.prototype.or=function(t){var e=a();return this.bitwiseTo(t,m,e),e},o.prototype.xor=function(t){var e=a();return this.bitwiseTo(t,b,e),e},o.prototype.andNot=function(t){var e=a();return this.bitwiseTo(t,x,e),e},o.prototype.not=function(){for(var t=a(),e=0;e=this.t?0!=this.s:0!=(this.data[e]&1<1){var f=a();for(n.sqrTo(s[1],f);u<=c;)s[u]=a(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=t.t-1,b=!0,x=a();for(i=d(t.data[m])-1;m>=0;){for(i>=l?h=t.data[m]>>i-l&c:(h=(t.data[m]&(1<0&&(h|=t.data[m-1]>>this.DB+i-l)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(o),b=!1;else{for(;u>1;)n.sqrTo(o,x),n.sqrTo(x,o),u-=2;u>0?n.sqrTo(o,x):(g=o,o=x,x=g),n.mulTo(x,s[h],o)}for(;m>=0&&0==(t.data[m]&1<=0?(r.subTo(n,r),e&&i.subTo(s,i),a.subTo(u,a)):(n.subTo(r,n),e&&s.subTo(i,s),u.subTo(a,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new S)},o.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=T[T.length-1]){for(e=0;e>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),c(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-s));for(var u,l=0,f=i.fullMessageLength.length-1;f>=0;--f)l=(u=8*i.fullMessageLength[f]+l)/4294967296>>>0,a.putInt32Le(u>>>0);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3};c(h,r,a);var p=n.util.createBuffer();return p.putInt32Le(h.h0),p.putInt32Le(h.h1),p.putInt32Le(h.h2),p.putInt32Le(h.h3),p},i};var o=null,a=null,s=null,u=null,l=!1;function c(t,e,r){for(var n,i,o,l,c,f,h,p=r.length();p>=64;){for(i=t.h0,o=t.h1,l=t.h2,c=t.h3,h=0;h<16;++h)e[h]=r.getInt32Le(),n=i+(c^o&(l^c))+u[h]+e[h],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<32;++h)n=i+(l^c&(o^l))+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<48;++h)n=i+(o^l^c)+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;for(;h<64;++h)n=i+(l^(o|~c))+u[h]+e[a[h]],i=c,c=l,l=o,o+=n<<(f=s[h])|n>>>32-f;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+l|0,t.h3=t.h3+c|0,p-=64}}},function(t,e,r){var n=r(0);r(8),r(4),r(1);var i,o=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(16)),t.exports=n.pbkdf2=o.pbkdf2=function(t,e,r,o,a,u){if("function"==typeof a&&(u=a,a=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===a||"object"!=s(a))&&(i.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!=typeof a&&(a="sha1"),t=Buffer.from(t,"binary"),e=Buffer.from(e,"binary"),u?4===i.pbkdf2Sync.length?i.pbkdf2(t,e,r,o,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):i.pbkdf2(t,e,r,o,a,function(t,e){if(t)return u(t);u(null,e.toString("binary"))}):4===i.pbkdf2Sync.length?i.pbkdf2Sync(t,e,r,o).toString("binary"):i.pbkdf2Sync(t,e,r,o,a).toString("binary");if(null==a&&(a="sha1"),"string"==typeof a){if(!(a in n.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=n.md[a].create()}var l=a.digestLength;if(o>4294967295*l){var c=new Error("Derived key is too long.");if(u)return u(c);throw c}var f=Math.ceil(o/l),h=o-(f-1)*l,p=n.hmac.create();p.start(a,t);var d,y,v,g="";if(!u){for(var m=1;m<=f;++m){p.start(null,null),p.update(e),p.update(n.util.int32ToBytes(m)),d=v=p.digest().getBytes();for(var b=2;b<=r;++b)p.start(null,null),p.update(v),y=p.digest().getBytes(),d=n.util.xorBytes(d,y,l),v=y;g+=mf)return u(null,g);p.start(null,null),p.update(e),p.update(n.util.int32ToBytes(m)),d=v=p.digest().getBytes(),b=2,w()}function w(){if(b<=r)return p.start(null,null),p.update(v),y=p.digest().getBytes(),d=n.util.xorBytes(d,y,l),v=y,++b,n.util.setImmediate(w);g+=m128)throw new Error('Invalid "nsComment" content.');t.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,t.comment)}else if("subjectKeyIdentifier"===t.name&&e.cert){var p=e.cert.generateSubjectKeyIdentifier();t.subjectKeyIdentifier=p.toHex(),t.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===t.name&&e.cert){if(t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=t.value.value,t.keyIdentifier){var d=!0===t.keyIdentifier?e.cert.generateSubjectKeyIdentifier().getBytes():t.keyIdentifier;c.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(t.authorityCertIssuer){var y=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[m(!0===t.authorityCertIssuer?e.cert.issuer:t.authorityCertIssuer)])];c.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,y))}if(t.serialNumber){var v=n.util.hexToBytes(!0===t.serialNumber?e.cert.serialNumber:t.serialNumber);c.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,v))}}else if("cRLDistributionPoints"===t.name){t.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=t.value.value;var g,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),x=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,e){u.md=v({signatureOid:u.signatureOid,type:"certificate"});var h=i.toDer(u.tbsCertificate);u.md.update(h.getBytes())}var p=n.md.sha1.create(),g=i.toDer(r.certIssuer);p.update(g.getBytes()),u.issuer.getField=function(t){return d(u.issuer,t)},u.issuer.addField=function(t){b([t]),u.issuer.attributes.push(t)},u.issuer.attributes=o.RDNAttributesAsArray(r.certIssuer),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=p.digest().toHex();var m=n.md.sha1.create(),x=i.toDer(r.certSubject);return m.update(x.getBytes()),u.subject.getField=function(t){return d(u.subject,t)},u.subject.addField=function(t){b([t]),u.subject.attributes.push(t)},u.subject.attributes=o.RDNAttributesAsArray(r.certSubject),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=o.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=o.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},o.certificateExtensionsFromAsn1=function(t){for(var e=[],r=0;r1&&(r=u.value.charCodeAt(1),o=u.value.length>2?u.value.charCodeAt(2):0),e.digitalSignature=128==(128&r),e.nonRepudiation=64==(64&r),e.keyEncipherment=32==(32&r),e.dataEncipherment=16==(16&r),e.keyAgreement=8==(8&r),e.keyCertSign=4==(4&r),e.cRLSign=2==(2&r),e.encipherOnly=1==(1&r),e.decipherOnly=128==(128&o)}else if("basicConstraints"===e.name){(u=i.fromDer(e.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?e.cA=0!==u.value[0].value.charCodeAt(0):e.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(e.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===e.name)for(var u=i.fromDer(e.value),l=0;l1&&(r=u.value.charCodeAt(1)),e.client=128==(128&r),e.server=64==(64&r),e.email=32==(32&r),e.objsign=16==(16&r),e.reserved=8==(8&r),e.sslCA=4==(4&r),e.emailCA=2==(2&r),e.objCA=1==(1&r);else if("subjectAltName"===e.name||"issuerAltName"===e.name){var f;e.altNames=[],u=i.fromDer(e.value);for(var h=0;h=_&&t0&&a.value.push(o.certificateExtensionsToAsn1(t.extensions)),a},o.getCertificationRequestInfo=function(t){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),m(t.subject),o.publicKeyToAsn1(t.publicKey),function(t){var e=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===t.attributes.length)return e;for(var r=t.attributes,o=0;of.validity.notAfter)&&(l={message:"Certificate is not valid yet or has expired.",error:o.certificateError.certificate_expired,notBefore:f.validity.notBefore,notAfter:f.validity.notAfter,now:a}),null===l){if(null===(h=e[0]||t.getIssuer(f))&&f.isIssuer(f)&&(p=!0,h=f),h){var d=h;n.util.isArray(d)||(d=[d]);for(var y=!1;!y&&d.length>0;){h=d.shift();try{y=h.verify(f)}catch(t){}}y||(l={message:"Certificate signature is invalid.",error:o.certificateError.bad_certificate})}null!==l||h&&!p||t.hasCertificate(f)||(l={message:"Certificate is not trusted.",error:o.certificateError.unknown_ca})}if(null===l&&h&&!f.isIssuer(h)&&(l={message:"Certificate issuer is invalid.",error:o.certificateError.bad_certificate}),null===l)for(var v={keyUsage:!0,basicConstraints:!0},g=0;null===l&&gb.pathLenConstraint&&(l={message:"Certificate basicConstraints pathLenConstraint violated.",error:o.certificateError.bad_certificate})}var w=null===l||l.error,_=r.verify?r.verify(w,c,i):w;if(!0!==_)throw!0===w&&(l={message:"The application rejected the certificate.",error:o.certificateError.bad_certificate}),(_||0===_)&&("object"!=s(_)||n.util.isArray(_)?"string"==typeof _&&(l.error=_):(_.message&&(l.message=_.message),_.error&&(l.error=_.error))),l;l=null,u=!1,++c}while(e.length>0);return!0}},function(t,e,r){var n=r(0);r(2),r(1),(t.exports=n.pss=n.pss||{}).create=function(t){3===arguments.length&&(t={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var e,r=t.md,i=t.mgf,o=r.digestLength,a=t.salt||null;if("string"==typeof a&&(a=n.util.createBuffer(a)),"saltLength"in t)e=t.saltLength;else{if(null===a)throw new Error("Salt length not specified or specific salt not given.");e=a.length()}if(null!==a&&a.length()!==e)throw new Error("Given salt length does not match length of given salt.");var s=t.prng||n.random;return{encode:function(t,u){var l,c,f=u-1,h=Math.ceil(f/8),p=t.digest().getBytes();if(h>8*h-f&255;return(x=String.fromCharCode(x.charCodeAt(0)&~w)+x.substr(1))+y+String.fromCharCode(188)},verify:function(t,a,s){var u,l=s-1,c=Math.ceil(l/8);if(a=a.substr(-c),c>8*c-l&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u4){var r=t;t=n.util.createBuffer();for(var i=0;i0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},i.cbc=function(t){t=t||{},this.name="CBC",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(t){if(null===t.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(t,e,r){if(t.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)return!1;var r=t.length(),n=t.at(r-1);return!(n>this.blockSize<<2||(t.truncate(n),0))},i.cfb=function(t){t=t||{},this.name="CFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(t){t=t||{},this.name="OFB",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(t,e,r){var n=t.length();if(0===t.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0)t.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(t){t=t||{},this.name="CTR",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");this._iv=o(t.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0&&(t.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(t){t=t||{},this.name="GCM",this.cipher=t.cipher,this.blockSize=t.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(t){if(!("iv"in t))throw new Error("Invalid IV parameter.");var e,r=n.util.createBuffer(t.iv);if(this._cipherLength=0,e="additionalData"in t?n.util.createBuffer(t.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in t?t.tagLength:128,this._tag=null,t.decrypt&&(this._tag=n.util.createBuffer(t.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,e=n.util.createBuffer(e),this._aDataLength=s(8*e.length());var o=e.length()%this.blockSize;for(o&&e.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];e.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[e.getInt32(),e.getInt32(),e.getInt32(),e.getInt32()])},i.gcm.prototype.encrypt=function(t,e,r){var n=t.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i0&&(o=this.blockSize-o),this._partialOutput.clear(),i=0;i0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.read-=this.blockSize,e.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;e.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(t,e,r){var n=t.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=t.getInt32(),this._hashBlock[1]=t.getInt32(),this._hashBlock[2]=t.getInt32(),this._hashBlock[3]=t.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i0;--n)e[n]=t[n]>>>1|(1&t[n-1])<<31;e[0]=t[0]>>>1,r&&(e[0]^=this._R)},i.gcm.prototype.tableMultiply=function(t){for(var e=[0,0,0,0],r=0;r<32;++r){var n=t[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];e[0]^=i[0],e[1]^=i[1],e[2]^=i[2],e[3]^=i[3]}return e},i.gcm.prototype.ghash=function(t,e,r){return e[0]^=r[0],e[1]^=r[1],e[2]^=r[2],e[3]^=r[3],this.tableMultiply(e)},i.gcm.prototype.generateHashTable=function(t,e){for(var r=8/e,n=4*r,i=16*r,o=new Array(i),a=0;a>>1,i=new Array(r);i[n]=t.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o>1,s=a+(1&t.length),u=t.substr(0,s),l=t.substr(a,s),c=n.util.createBuffer(),f=n.hmac.create();r=e+r;var h=Math.ceil(i/16),p=Math.ceil(i/20);f.start("MD5",u);var d=n.util.createBuffer();c.putBytes(r);for(var y=0;y0&&(c.queue(t,c.createAlert(t,{level:c.Alert.Level.warning,description:c.Alert.Description.no_renegotiation})),c.flush(t)),t.process()},c.parseHelloMessage=function(t,e,r){var i=null,o=t.entity===c.ConnectionEnd.client;if(r<38)t.error(t,{message:o?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});else{var a=e.fragment,s=a.length();if(i={version:{major:a.getByte(),minor:a.getByte()},random:n.util.createBuffer(a.getBytes(32)),session_id:u(a,1),extensions:[]},o?(i.cipher_suite=a.getBytes(2),i.compression_method=a.getByte()):(i.cipher_suites=u(a,2),i.compression_methods=u(a,1)),(s=r-(s-a.length()))>0){for(var l=u(a,2);l.length()>0;)i.extensions.push({type:[l.getByte(),l.getByte()],data:u(l,2)});if(!o)for(var f=0;f0&&0===p.getByte();)t.session.extensions.server_name.serverNameList.push(u(p,2).getBytes())}}if(t.session.version&&(i.version.major!==t.session.version.major||i.version.minor!==t.session.version.minor))return t.error(t,{message:"TLS version change is disallowed during renegotiation.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});if(o)t.session.cipherSuite=c.getCipherSuite(i.cipher_suite);else for(var d=n.util.createBuffer(i.cipher_suites.bytes());d.length()>0&&(t.session.cipherSuite=c.getCipherSuite(d.getBytes(2)),null===t.session.cipherSuite););if(null===t.session.cipherSuite)return t.error(t,{message:"No cipher suites in common.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure},cipherSuite:n.util.bytesToHex(i.cipher_suite)});t.session.compressionMethod=o?i.compression_method:c.CompressionMethod.none}return i},c.createSecurityParameters=function(t,e){var r=t.entity===c.ConnectionEnd.client,n=e.random.bytes(),i=r?t.session.sp.client_random:n,o=r?n:c.createRandom().getBytes();t.session.sp={entity:t.entity,prf_algorithm:c.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,compression_algorithm:t.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:i,server_random:o}},c.handleServerHello=function(t,e,r){var n=c.parseHelloMessage(t,e,r);if(!t.fail){if(!(n.version.minor<=t.version.minor))return t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}});t.version.minor=n.version.minor,t.session.version=t.version;var i=n.session_id.bytes();i.length>0&&i===t.session.id?(t.expect=y,t.session.resuming=!0,t.session.sp.server_random=n.random.bytes()):(t.expect=f,t.session.resuming=!1,c.createSecurityParameters(t,n)),t.session.id=i,t.process()}},c.handleClientHello=function(t,e,r){var i=c.parseHelloMessage(t,e,r);if(!t.fail){var o=i.session_id.bytes(),a=null;if(t.sessionCache&&(null===(a=t.sessionCache.getSession(o))?o="":(a.version.major!==i.version.major||a.version.minor>i.version.minor)&&(a=null,o="")),0===o.length&&(o=n.random.getBytes(32)),t.session.id=o,t.session.clientHelloVersion=i.version,t.session.sp={},a)t.version=t.session.version=a.version,t.session.sp=a.sp;else{for(var s,u=1;u0;)i=u(s.certificate_list,3),o=n.asn1.fromDer(i),i=n.pki.certificateFromAsn1(o,!0),l.push(i)}catch(e){return t.error(t,{message:"Could not parse certificate list.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_certificate}})}var f=t.entity===c.ConnectionEnd.client;!f&&!0!==t.verifyClient||0!==l.length?0===l.length?t.expect=f?h:x:(f?t.session.serverCertificate=l[0]:t.session.clientCertificate=l[0],c.verifyCertificateChain(t,l)&&(t.expect=f?h:x)):t.error(t,{message:f?"No server certificate provided.":"No client certificate provided.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}}),t.process()},c.handleServerKeyExchange=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});t.expect=p,t.process()},c.handleClientKeyExchange=function(t,e,r){if(r<48)return t.error(t,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.unsupported_certificate}});var i=e.fragment,o={enc_pre_master_secret:u(i,2).getBytes()},a=null;if(t.getPrivateKey)try{a=t.getPrivateKey(t,t.session.serverCertificate),a=n.pki.privateKeyFromPem(a)}catch(e){t.error(t,{message:"Could not get private key.",cause:e,send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}})}if(null===a)return t.error(t,{message:"No private key set.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}});try{var s=t.session.sp;s.pre_master_secret=a.decrypt(o.enc_pre_master_secret);var l=t.session.clientHelloVersion;if(l.major!==s.pre_master_secret.charCodeAt(0)||l.minor!==s.pre_master_secret.charCodeAt(1))throw new Error("TLS version rollback attack detected.")}catch(t){s.pre_master_secret=n.random.getBytes(48)}t.expect=_,null!==t.session.clientCertificate&&(t.expect=w),t.process()},c.handleCertificateRequest=function(t,e,r){if(r<3)return t.error(t,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var n=e.fragment,i={certificate_types:u(n,1),certificate_authorities:u(n,2)};t.session.certificateRequest=i,t.expect=d,t.process()},c.handleCertificateVerify=function(t,e,r){if(r<2)return t.error(t,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var i=e.fragment;i.read-=4;var o=i.bytes();i.read+=4;var a={signature:u(i,2).getBytes()},s=n.util.createBuffer();s.putBuffer(t.session.md5.digest()),s.putBuffer(t.session.sha1.digest()),s=s.getBytes();try{if(!t.session.clientCertificate.publicKey.verify(s,a.signature,"NONE"))throw new Error("CertificateVerify signature does not match.");t.session.md5.update(o),t.session.sha1.update(o)}catch(e){return t.error(t,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.handshake_failure}})}t.expect=_,t.process()},c.handleServerHelloDone=function(t,e,r){if(r>0)return t.error(t,{message:"Invalid ServerHelloDone message. Invalid length.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.record_overflow}});if(null===t.serverCertificate){var i={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.insufficient_security}},o=t.verify(t,i.alert.description,0,[]);if(!0!==o)return(o||0===o)&&("object"!=s(o)||n.util.isArray(o)?"number"==typeof o&&(i.alert.description=o):(o.message&&(i.message=o.message),o.alert&&(i.alert.description=o.alert))),t.error(t,i)}null!==t.session.certificateRequest&&(e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificate(t)}),c.queue(t,e)),e=c.createRecord(t,{type:c.ContentType.handshake,data:c.createClientKeyExchange(t)}),c.queue(t,e),t.expect=m;var a=function(t,e){null!==t.session.certificateRequest&&null!==t.session.clientCertificate&&c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createCertificateVerify(t,e)})),c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.pending=c.createConnectionState(t),t.state.current.write=t.state.pending.write,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)})),t.expect=y,c.flush(t),t.process()};if(null===t.session.certificateRequest||null===t.session.clientCertificate)return a(t,null);c.getClientSignature(t,a)},c.handleChangeCipherSpec=function(t,e){if(1!==e.fragment.getByte())return t.error(t,{message:"Invalid ChangeCipherSpec message received.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.illegal_parameter}});var r=t.entity===c.ConnectionEnd.client;(t.session.resuming&&r||!t.session.resuming&&!r)&&(t.state.pending=c.createConnectionState(t)),t.state.current.read=t.state.pending.read,(!t.session.resuming&&r||t.session.resuming&&!r)&&(t.state.pending=null),t.expect=r?v:S,t.process()},c.handleFinished=function(t,e,r){var o=e.fragment;o.read-=4;var a=o.bytes();o.read+=4;var s=e.fragment.getBytes();(o=n.util.createBuffer()).putBuffer(t.session.md5.digest()),o.putBuffer(t.session.sha1.digest());var u=t.entity===c.ConnectionEnd.client,l=u?"server finished":"client finished",f=t.session.sp;if((o=i(f.master_secret,l,o.getBytes(),12)).getBytes()!==s)return t.error(t,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decrypt_error}});t.session.md5.update(a),t.session.sha1.update(a),(t.session.resuming&&u||!t.session.resuming&&!u)&&(c.queue(t,c.createRecord(t,{type:c.ContentType.change_cipher_spec,data:c.createChangeCipherSpec()})),t.state.current.write=t.state.pending.write,t.state.pending=null,c.queue(t,c.createRecord(t,{type:c.ContentType.handshake,data:c.createFinished(t)}))),t.expect=u?g:E,t.handshaking=!1,++t.handshakes,t.peerCertificate=u?t.session.serverCertificate:t.session.clientCertificate,c.flush(t),t.isConnected=!0,t.connected(t),t.process()},c.handleAlert=function(t,e){var r,n=e.fragment,i={level:n.getByte(),description:n.getByte()};switch(i.description){case c.Alert.Description.close_notify:r="Connection closed.";break;case c.Alert.Description.unexpected_message:r="Unexpected message.";break;case c.Alert.Description.bad_record_mac:r="Bad record MAC.";break;case c.Alert.Description.decryption_failed:r="Decryption failed.";break;case c.Alert.Description.record_overflow:r="Record overflow.";break;case c.Alert.Description.decompression_failure:r="Decompression failed.";break;case c.Alert.Description.handshake_failure:r="Handshake failure.";break;case c.Alert.Description.bad_certificate:r="Bad certificate.";break;case c.Alert.Description.unsupported_certificate:r="Unsupported certificate.";break;case c.Alert.Description.certificate_revoked:r="Certificate revoked.";break;case c.Alert.Description.certificate_expired:r="Certificate expired.";break;case c.Alert.Description.certificate_unknown:r="Certificate unknown.";break;case c.Alert.Description.illegal_parameter:r="Illegal parameter.";break;case c.Alert.Description.unknown_ca:r="Unknown certificate authority.";break;case c.Alert.Description.access_denied:r="Access denied.";break;case c.Alert.Description.decode_error:r="Decode error.";break;case c.Alert.Description.decrypt_error:r="Decrypt error.";break;case c.Alert.Description.export_restriction:r="Export restriction.";break;case c.Alert.Description.protocol_version:r="Unsupported protocol version.";break;case c.Alert.Description.insufficient_security:r="Insufficient security.";break;case c.Alert.Description.internal_error:r="Internal error.";break;case c.Alert.Description.user_canceled:r="User canceled.";break;case c.Alert.Description.no_renegotiation:r="Renegotiation not supported.";break;default:r="Unknown error."}if(i.description===c.Alert.Description.close_notify)return t.close();t.error(t,{message:r,send:!1,origin:t.entity===c.ConnectionEnd.client?"server":"client",alert:i}),t.process()},c.handleHandshake=function(t,e){var r=e.fragment,i=r.getByte(),o=r.getInt24();if(o>r.length())return t.fragmented=e,e.fragment=n.util.createBuffer(),r.read-=4,t.process();t.fragmented=null,r.read-=4;var a=r.bytes(o+4);r.read+=4,i in F[t.entity][t.expect]?(t.entity!==c.ConnectionEnd.server||t.open||t.fail||(t.handshaking=!0,t.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:n.md.md5.create(),sha1:n.md.sha1.create()}),i!==c.HandshakeType.hello_request&&i!==c.HandshakeType.certificate_verify&&i!==c.HandshakeType.finished&&(t.session.md5.update(a),t.session.sha1.update(a)),F[t.entity][t.expect][i](t,e,o)):c.handleUnexpected(t,e)},c.handleApplicationData=function(t,e){t.data.putBuffer(e.fragment),t.dataReady(t),t.process()},c.handleHeartbeat=function(t,e){var r=e.fragment,i=r.getByte(),o=r.getInt16(),a=r.getBytes(o);if(i===c.HeartbeatMessageType.heartbeat_request){if(t.handshaking||o>a.length)return t.process();c.queue(t,c.createRecord(t,{type:c.ContentType.heartbeat,data:c.createHeartbeat(c.HeartbeatMessageType.heartbeat_response,a)})),c.flush(t)}else if(i===c.HeartbeatMessageType.heartbeat_response){if(a!==t.expectedHeartbeatPayload)return t.process();t.heartbeatReceived&&t.heartbeatReceived(t,n.util.createBuffer(a))}t.process()};var f=1,h=2,p=3,d=4,y=5,v=6,g=7,m=8,b=1,x=2,w=3,_=4,S=5,E=6,k=c.handleUnexpected,T=c.handleChangeCipherSpec,C=c.handleAlert,O=c.handleHandshake,A=c.handleApplicationData,P=c.handleHeartbeat,M=[];M[c.ConnectionEnd.client]=[[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[T,C,k,k,P],[k,C,O,k,P],[k,C,O,A,P],[k,C,O,k,P]],M[c.ConnectionEnd.server]=[[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[k,C,O,k,P],[T,C,k,k,P],[k,C,O,k,P],[k,C,O,A,P],[k,C,O,k,P]];var I=c.handleHelloRequest,L=c.handleServerHello,j=c.handleCertificate,N=c.handleServerKeyExchange,R=c.handleCertificateRequest,D=c.handleServerHelloDone,B=c.handleFinished,F=[];F[c.ConnectionEnd.client]=[[k,k,L,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,j,N,R,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,N,R,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,R,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,D,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,B],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[I,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]];var z=c.handleClientHello,G=c.handleClientKeyExchange,U=c.handleCertificateVerify;F[c.ConnectionEnd.server]=[[k,z,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,j,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,G,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,U,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,B],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k],[k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k,k]],c.generateKeys=function(t,e){var r=i,n=e.client_random+e.server_random;t.session.resuming||(e.master_secret=r(e.pre_master_secret,"master secret",n,48).bytes(),e.pre_master_secret=null),n=e.server_random+e.client_random;var o=2*e.mac_key_length+2*e.enc_key_length,a=t.version.major===c.Versions.TLS_1_0.major&&t.version.minor===c.Versions.TLS_1_0.minor;a&&(o+=2*e.fixed_iv_length);var s=r(e.master_secret,"key expansion",n,o),u={client_write_MAC_key:s.getBytes(e.mac_key_length),server_write_MAC_key:s.getBytes(e.mac_key_length),client_write_key:s.getBytes(e.enc_key_length),server_write_key:s.getBytes(e.enc_key_length)};return a&&(u.client_write_IV=s.getBytes(e.fixed_iv_length),u.server_write_IV=s.getBytes(e.fixed_iv_length)),u},c.createConnectionState=function(t){var e=t.entity===c.ConnectionEnd.client,r=function(){var t={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,cipherState:null,cipherFunction:function(t){return!0},compressionState:null,compressFunction:function(t){return!0},updateSequenceNumber:function(){4294967295===t.sequenceNumber[1]?(t.sequenceNumber[1]=0,++t.sequenceNumber[0]):++t.sequenceNumber[1]}};return t},n={read:r(),write:r()};if(n.read.update=function(t,e){return n.read.cipherFunction(e,n.read)?n.read.compressFunction(t,e,n.read)||t.error(t,{message:"Could not decompress record.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.decompression_failure}}):t.error(t,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.bad_record_mac}}),!t.fail},n.write.update=function(t,e){return n.write.compressFunction(t,e,n.write)?n.write.cipherFunction(e,n.write)||t.error(t,{message:"Could not encrypt record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}):t.error(t,{message:"Could not compress record.",send:!1,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.internal_error}}),!t.fail},t.session){var i=t.session.sp;switch(t.session.cipherSuite.initSecurityParameters(i),i.keys=c.generateKeys(t,i),n.read.macKey=e?i.keys.server_write_MAC_key:i.keys.client_write_MAC_key,n.write.macKey=e?i.keys.client_write_MAC_key:i.keys.server_write_MAC_key,t.session.cipherSuite.initConnectionState(n,t,i),i.compression_algorithm){case c.CompressionMethod.none:break;case c.CompressionMethod.deflate:n.read.compressFunction=a,n.write.compressFunction=o;break;default:throw new Error("Unsupported compression algorithm.")}}return n},c.createRandom=function(){var t=new Date,e=+t+6e4*t.getTimezoneOffset(),r=n.util.createBuffer();return r.putInt32(e),r.putBytes(n.random.getBytes(28)),r},c.createRecord=function(t,e){return e.data?{type:e.type,version:{major:t.version.major,minor:t.version.minor},length:e.data.length(),fragment:e.data}:null},c.createAlert=function(t,e){var r=n.util.createBuffer();return r.putByte(e.level),r.putByte(e.description),c.createRecord(t,{type:c.ContentType.alert,data:r})},c.createClientHello=function(t){t.session.clientHelloVersion={major:t.version.major,minor:t.version.minor};for(var e=n.util.createBuffer(),r=0;r0&&(d+=2);var y=t.session.id,v=y.length+1+2+4+28+2+o+1+s+d,g=n.util.createBuffer();return g.putByte(c.HandshakeType.client_hello),g.putInt24(v),g.putByte(t.version.major),g.putByte(t.version.minor),g.putBytes(t.session.sp.client_random),l(g,1,n.util.createBuffer(y)),l(g,2,e),l(g,1,a),d>0&&l(g,2,u),g},c.createServerHello=function(t){var e=t.session.id,r=e.length+1+2+4+28+2+1,i=n.util.createBuffer();return i.putByte(c.HandshakeType.server_hello),i.putInt24(r),i.putByte(t.version.major),i.putByte(t.version.minor),i.putBytes(t.session.sp.server_random),l(i,1,n.util.createBuffer(e)),i.putByte(t.session.cipherSuite.id[0]),i.putByte(t.session.cipherSuite.id[1]),i.putByte(t.session.compressionMethod),i},c.createCertificate=function(t){var e,r=t.entity===c.ConnectionEnd.client,i=null;t.getCertificate&&(e=r?t.session.certificateRequest:t.session.extensions.server_name.serverNameList,i=t.getCertificate(t,e));var o=n.util.createBuffer();if(null!==i)try{n.util.isArray(i)||(i=[i]);for(var a=null,s=0;sc.MaxFragment;)i.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(o.slice(0,c.MaxFragment))})),o=o.slice(c.MaxFragment);o.length>0&&i.push(c.createRecord(t,{type:e.type,data:n.util.createBuffer(o)}))}for(var a=0;a0&&(i=r.order[0]),null!==i&&i in r.cache)for(var o in e=r.cache[i],delete r.cache[i],r.order)if(r.order[o]===i){r.order.splice(o,1);break}return e},r.setSession=function(t,e){if(r.order.length===r.capacity){var i=r.order.shift();delete r.cache[i]}i=n.util.bytesToHex(t),r.order.push(i),r.cache[i]=e}}return r},c.createConnection=function(t){var e;e=t.caStore?n.util.isArray(t.caStore)?n.pki.createCaStore(t.caStore):t.caStore:n.pki.createCaStore();var r=t.cipherSuites||null;if(null===r)for(var i in r=[],c.CipherSuites)r.push(c.CipherSuites[i]);var o=t.server?c.ConnectionEnd.server:c.ConnectionEnd.client,a=t.sessionCache?c.createSessionCache(t.sessionCache):null,s={version:{major:c.Version.major,minor:c.Version.minor},entity:o,sessionId:t.sessionId,caStore:e,sessionCache:a,cipherSuites:r,connected:t.connected,virtualHost:t.virtualHost||null,verifyClient:t.verifyClient||!1,verify:t.verify||function(t,e,r,n){return e},verifyOptions:t.verifyOptions||{},getCertificate:t.getCertificate||null,getPrivateKey:t.getPrivateKey||null,getSignature:t.getSignature||null,input:n.util.createBuffer(),tlsData:n.util.createBuffer(),data:n.util.createBuffer(),tlsDataReady:t.tlsDataReady,dataReady:t.dataReady,heartbeatReceived:t.heartbeatReceived,closed:t.closed,error:function(e,r){r.origin=r.origin||(e.entity===c.ConnectionEnd.client?"client":"server"),r.send&&(c.queue(e,c.createAlert(e,r.alert)),c.flush(e));var n=!1!==r.fatal;n&&(e.fail=!0),t.error(e,r),n&&e.close(!1)},deflate:t.deflate||null,inflate:t.inflate||null,reset:function(t){s.version={major:c.Version.major,minor:c.Version.minor},s.record=null,s.session=null,s.peerCertificate=null,s.state={pending:null,current:null},s.expect=(s.entity,c.ConnectionEnd.client,0),s.fragmented=null,s.records=[],s.open=!1,s.handshakes=0,s.handshaking=!1,s.isConnected=!1,s.fail=!(t||void 0===t),s.input.clear(),s.tlsData.clear(),s.data.clear(),s.state.current=c.createConnectionState(s)}};return s.reset(),s.handshake=function(t){if(s.entity!==c.ConnectionEnd.client)s.error(s,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(s.handshaking)s.error(s,{message:"Handshake already in progress.",fatal:!1});else{s.fail&&!s.open&&0===s.handshakes&&(s.fail=!1),s.handshaking=!0;var e=null;(t=t||"").length>0&&(s.sessionCache&&(e=s.sessionCache.getSession(t)),null===e&&(t="")),0===t.length&&s.sessionCache&&null!==(e=s.sessionCache.getSession())&&(t=e.id),s.session={id:t,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:n.md.md5.create(),sha1:n.md.sha1.create()},e&&(s.version=e.version,s.session.sp=e.sp),s.session.sp.client_random=c.createRandom().getBytes(),s.open=!0,c.queue(s,c.createRecord(s,{type:c.ContentType.handshake,data:c.createClientHello(s)})),c.flush(s)}},s.process=function(t){var e=0;return t&&s.input.putBytes(t),s.fail||(null!==s.record&&s.record.ready&&s.record.fragment.isEmpty()&&(s.record=null),null===s.record&&(e=function(t){var e=0,r=t.input,i=r.length();if(i<5)e=5-i;else{t.record={type:r.getByte(),version:{major:r.getByte(),minor:r.getByte()},length:r.getInt16(),fragment:n.util.createBuffer(),ready:!1};var o=t.record.version.major===t.version.major;o&&t.session&&t.session.version&&(o=t.record.version.minor===t.version.minor),o||t.error(t,{message:"Incompatible TLS version.",send:!0,alert:{level:c.Alert.Level.fatal,description:c.Alert.Description.protocol_version}})}return e}(s)),s.fail||null===s.record||s.record.ready||(e=function(t){var e=0,r=t.input,n=r.length();return n=0;u--)A>>=8,A+=k.at(u)+O.at(u),O.setAt(u,255&A);C.putBuffer(O)}x=C,f.putBuffer(S)}return f.truncate(f.length()-o),f},a.pbe.getCipher=function(t,e,r){switch(t){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(t,e,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(t,e,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=t,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(t,e,r){var i,s={},u=[];if(!o.validate(e,l,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((t=o.derToOid(s.kdfOid))!==a.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=t,i.supportedOids=["pkcs5PBKDF2"],i;if((t=o.derToOid(s.encOid))!==a.oids["aes128-CBC"]&&t!==a.oids["aes192-CBC"]&&t!==a.oids["aes256-CBC"]&&t!==a.oids["des-EDE3-CBC"]&&t!==a.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=t,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var c,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),a.oids[t]){case"aes128-CBC":c=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=n.des.createDecryptionCipher;break;case"desCBC":c=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,c,y),g=s.encIv,m=f(v);return m.start(g),m},a.pbe.getCipherForPKCS12PBE=function(t,e,r){var i={},s=[];if(!o.validate(e,c,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,l,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),t){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(t,e){var r=n.rc2.createDecryptionCipher(t,40);return r.start(e,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=t,y}var v=h(i.prfOid),g=a.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,a.pbe.generatePkcs12Key(r,p,2,d,l,v))},a.pbe.opensslDeriveBytes=function(t,e,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===e&&(e="");for(var o=[f(i,t+e)],a=16,s=1;a>>0,s>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=s[1],s[1]=s[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return e.putBytes(o),u(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var s,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,a.putInt32(c>>>0),c=s>>>0;a.putInt32(c);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4,h5:t.h5,h6:t.h6,h7:t.h7};u(h,r,a);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var o=null,a=!1,s=null;function u(t,e,r){for(var n,i,o,a,u,l,c,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)e[u]=r.getInt32();for(;u<64;++u)n=((n=e[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=e[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,e[u]=n+e[u-7]+i+e[u-16]|0;for(l=t.h0,c=t.h1,f=t.h2,h=t.h3,p=t.h4,d=t.h5,y=t.h6,v=t.h7,u=0;u<64;++u)o=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),a=l&c|f&(l^c),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+e[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=c,c=l,l=n+(i=o+a)>>>0;t.h0=t.h0+l|0,t.h1=t.h1+c|0,t.h2=t.h2+f|0,t.h3=t.h3+h|0,t.h4=t.h4+p|0,t.h5=t.h5+d|0,t.h6=t.h6+y|0,t.h7=t.h7+v|0,g-=64}}},function(t,e,r){var n=r(0);r(1);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(16)),(t.exports=n.prng=n.prng||{}).create=function(t){for(var e={plugin:t,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=t.md,o=new Array(32),a=0;a<32;++a)o[a]=r.create();function s(){if(e.pools[0].messageLength>=32)return u();var t=32-e.pools[0].messageLength<<5;e.collect(e.seedFileSync(t)),u()}function u(){e.reseeds=4294967295===e.reseeds?0:e.reseeds+1;var t=e.plugin.md.create();t.update(e.keyBytes);for(var r=1,n=0;n<32;++n)e.reseeds%r==0&&(t.update(e.pools[n].digest().getBytes()),e.pools[n].start()),r<<=1;e.keyBytes=t.digest().getBytes(),t.start(),t.update(e.keyBytes);var i=t.digest().getBytes();e.key=e.plugin.formatKey(e.keyBytes),e.seed=e.plugin.formatSeed(i),e.generated=0}function l(t){var e=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(e=function(t){return i.getRandomValues(t)});var o=n.util.createBuffer();if(e)for(;o.length()>16)))<<16,h=4294967295&(c=(2147483647&(c+=l>>15))+(c>>31)),u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),o.putByte(255&f);return o.getBytes(t)}return e.pools=o,e.pool=0,e.generate=function(t,r){if(!r)return e.generateSync(t);var i=e.plugin.cipher,o=e.plugin.increment,a=e.plugin.formatKey,s=e.plugin.formatSeed,l=n.util.createBuffer();e.key=null,function c(f){if(f)return r(f);if(l.length()>=t)return r(null,l.getBytes(t));if(e.generated>1048575&&(e.key=null),null===e.key)return n.util.nextTick(function(){!function(t){if(e.pools[0].messageLength>=32)return u(),t();var r=32-e.pools[0].messageLength<<5;e.seedFile(r,function(r,n){if(r)return t(r);e.collect(n),u(),t()})}(c)});var h=i(e.key,e.seed);e.generated+=h.length,l.putBytes(h),e.key=a(i(e.key,o(e.seed))),e.seed=s(i(e.key,e.seed)),n.util.setImmediate(c)}()},e.generateSync=function(t){var r=e.plugin.cipher,i=e.plugin.increment,o=e.plugin.formatKey,a=e.plugin.formatSeed;e.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(e.key=null),null===e.key&&s();var l=r(e.key,e.seed);e.generated+=l.length,u.putBytes(l),e.key=o(r(e.key,i(e.seed))),e.seed=a(r(e.key,e.seed))}return u.getBytes(t)},i?(e.seedFile=function(t,e){i.randomBytes(t,function(t,r){if(t)return e(t);e(null,r.toString())})},e.seedFileSync=function(t){return i.randomBytes(t).toString()}):(e.seedFile=function(t,e){try{e(null,l(t))}catch(t){e(t)}},e.seedFileSync=l),e.collect=function(t){for(var r=t.length,n=0;n>i&255);e.collect(n)},e.registerWorker=function(t){t===self?e.seedFile=function(t,e){self.addEventListener("message",function t(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",t),e(n.forge.prng.err,n.forge.prng.bytes))}),self.postMessage({forge:{prng:{needed:t}}})}:t.addEventListener("message",function(r){var n=r.data;n.forge&&n.forge.prng&&e.seedFile(n.forge.prng.needed,function(e,r){t.postMessage({forge:{prng:{err:e,bytes:r}}})})})},e}},function(t,e,r){var n=r(0);r(1);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],a=function(t,e){return t<>16-e},s=function(t,e){return(65535&t)>>e|t<<16-e&65535};t.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(t,e){"string"==typeof t&&(t=n.util.createBuffer(t)),e=e||128;var r,o=t,a=t.length(),s=e,u=Math.ceil(s/8),l=255>>(7&s);for(r=a;r<128;r++)o.putByte(i[o.at(r-1)+o.at(r-a)&255]);for(o.setAt(128-u,i[o.at(128-u)&l]),r=127-u;r>=0;r--)o.setAt(r,i[o.at(r+1)^o.at(r+u)]);return o};var u=function(t,e,r){var i,u,l,c,f=!1,h=null,p=null,d=null,y=[];for(t=n.rc2.expandKey(t,e),l=0;l<64;l++)y.push(t.getInt16Le());r?(i=function(t){for(l=0;l<4;l++)t[l]+=y[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),t[l]=a(t[l],o[l]),c++},u=function(t){for(l=0;l<4;l++)t[l]+=y[63&t[(l+3)%4]]}):(i=function(t){for(l=3;l>=0;l--)t[l]=s(t[l],o[l]),t[l]-=y[c]+(t[(l+3)%4]&t[(l+2)%4])+(~t[(l+3)%4]&t[(l+1)%4]),c--},u=function(t){for(l=3;l>=0;l--)t[l]-=y[63&t[(l+3)%4]]});var v=function(t){var e=[];for(l=0;l<4;l++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),e.push(65535&n)}c=r?0:63;for(var i=0;i=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(t){var e=!0;if(r)if(t)e=t(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(e&&(f=!0,g.update()),!r&&(e=0===h.length()))if(t)e=t(8,p,!r);else{var i=p.length(),o=p.at(i-1);o>i?e=!1:p.truncate(o)}return e}}};n.rc2.startEncrypting=function(t,e,r){var i=n.rc2.createEncryptionCipher(t,128);return i.start(e,r),i},n.rc2.createEncryptionCipher=function(t,e){return u(t,e,!0)},n.rc2.startDecrypting=function(t,e,r){var i=n.rc2.createDecryptionCipher(t,128);return i.start(e,r),i},n.rc2.createDecryptionCipher=function(t,e){return u(t,e,!1)}},function(t,e,r){var n=r(0);r(1),r(2),r(9);var i=t.exports=n.pkcs1=n.pkcs1||{};function o(t,e,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(e/r.digestLength),a=0;a>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(t+s),i+=r.digest().getBytes()}return i.substring(0,e)}i.encode_rsa_oaep=function(t,e,r){var i,a,s,u;"string"==typeof r?(i=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var l=Math.ceil(t.n.bitLength()/8),c=l-2*s.digestLength-2;if(e.length>c)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=e.length,y.maxLength=c,y;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=c-e.length,d=0;dt&&(a=u(t,e));var p=a.toString(16);i.target.postMessage({hex:p,workLoad:c}),a.dAddOffset(f,0)}}}p()}(t,e,i,o):s(t,e,i,o)}(t,l,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function s(t,e,r,o){var a=u(t,e),s=function(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}(a.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function t(e,r,o,a,s,l,c){var f=+new Date;do{if(e.bitLength()>r&&(e=u(r,o)),e.isProbablePrime(s))return c(null,e);e.dAddOffset(i[a++%8],0)}while(l<0||+new Date-f=0&&i.push(s):i.push(s))}return i}function p(t){if(t.composed||t.constructed){for(var e=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==e&&(p=n.util.isArray(e)?e:[e]);for(var d=[],y=0;y0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),x=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(x)}var w=null;if(null!==t){var _=o.wrapRsaPrivateKey(o.privateKeyToAsn1(t));w=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[_]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[o.encryptPrivateKeyInfo(_,r,s)]),u]);var S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[w]),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(S).getBytes())])]);h.push(E)}var k,T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var C=n.md.sha1.create(),O=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),A=s.count,P=(t=a.generateKey(r,O,3,A,20),n.hmac.create());P.start(C,t),P.update(i.toDer(T).getBytes());var M=P.getMac();k=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,M.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(A).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(T).getBytes())])]),k])},a.generateKey=n.pbe.generatePkcs12Key},function(t,e,r){var n=r(0);r(3),r(1);var i=n.asn1,o=t.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=o;var a={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};o.contentInfoValidator=a;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};o.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},o.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};o.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},a,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},o.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter",optional:!0}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(t,e,r){var n=r(0);r(1),n.mgf=n.mgf||{},(t.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(t){return{generate:function(e,r){for(var i=new n.util.ByteBuffer,o=Math.ceil(r/t.digestLength),a=0;a>>0,a>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=a[1],a[1]=a[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(t),c(r,o,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var e=n.util.createBuffer();e.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;e.putBytes(a.substr(0,p.blockLength-u));for(var l=8*p.fullMessageLength[0],f=0;f>>0,e.putInt32(l>>>0),l=s>>>0;e.putInt32(l);var h=new Array(r.length);for(f=0;f=128;){for(P=0;P<16;++P)e[P][0]=r.getInt32()>>>0,e[P][1]=r.getInt32()>>>0;for(;P<80;++P)n=(((M=(L=e[P-2])[0])>>>19|(I=L[1])<<13)^(I>>>29|M<<3)^M>>>6)>>>0,i=((M<<13|I>>>19)^(I<<3|M>>>29)^(M<<26|I>>>6))>>>0,o=(((M=(N=e[P-15])[0])>>>1|(I=N[1])<<31)^(M>>>8|I<<24)^M>>>7)>>>0,a=((M<<31|I>>>1)^(M<<24|I>>>8)^(M<<25|I>>>7))>>>0,j=e[P-7],R=e[P-16],I=i+j[1]+a+R[1],e[P][0]=n+j[0]+o+R[0]+(I/4294967296>>>0)>>>0,e[P][1]=I>>>0;for(d=t[0][0],y=t[0][1],v=t[1][0],g=t[1][1],m=t[2][0],b=t[2][1],x=t[3][0],w=t[3][1],_=t[4][0],S=t[4][1],E=t[5][0],k=t[5][1],T=t[6][0],C=t[6][1],O=t[7][0],A=t[7][1],P=0;P<80;++P)c=((_>>>14|S<<18)^(_>>>18|S<<14)^(S>>>9|_<<23))>>>0,f=(T^_&(E^T))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,l=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,I=A+(((_<<18|S>>>14)^(_<<14|S>>>18)^(S<<23|_>>>9))>>>0)+((C^S&(k^C))>>>0)+u[P][1]+e[P][1],n=O+c+f+u[P][0]+e[P][0]+(I/4294967296>>>0)>>>0,i=I>>>0,o=s+h+((I=l+p)/4294967296>>>0)>>>0,a=I>>>0,O=T,A=C,T=E,C=k,E=_,k=S,_=x+n+((I=w+i)/4294967296>>>0)>>>0,S=I>>>0,x=m,w=b,m=v,b=g,v=d,g=y,d=n+o+((I=i+a)/4294967296>>>0)>>>0,y=I>>>0;I=t[0][1]+y,t[0][0]=t[0][0]+d+(I/4294967296>>>0)>>>0,t[0][1]=I>>>0,I=t[1][1]+g,t[1][0]=t[1][0]+v+(I/4294967296>>>0)>>>0,t[1][1]=I>>>0,I=t[2][1]+b,t[2][0]=t[2][0]+m+(I/4294967296>>>0)>>>0,t[2][1]=I>>>0,I=t[3][1]+w,t[3][0]=t[3][0]+x+(I/4294967296>>>0)>>>0,t[3][1]=I>>>0,I=t[4][1]+S,t[4][0]=t[4][0]+_+(I/4294967296>>>0)>>>0,t[4][1]=I>>>0,I=t[5][1]+k,t[5][0]=t[5][0]+E+(I/4294967296>>>0)>>>0,t[5][1]=I>>>0,I=t[6][1]+C,t[6][0]=t[6][0]+T+(I/4294967296>>>0)>>>0,t[6][1]=I>>>0,I=t[7][1]+A,t[7][0]=t[7][0]+O+(I/4294967296>>>0)>>>0,t[7][1]=I>>>0,D-=128}}},function(t,e,r){t.exports=r(33)},function(t,e,r){t.exports=r(0),r(5),r(36),r(3),r(13),r(10),r(38),r(8),r(40),r(41),r(42),r(30),r(15),r(7),r(26),r(28),r(43),r(21),r(27),r(24),r(18),r(2),r(25),r(44),r(20),r(1)},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==("undefined"==typeof window?"undefined":s(window))&&(r=window)}t.exports=r},function(t,e){var r={};t.exports=r;var n={};r.encode=function(t,e,r){if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(t instanceof Uint8Array){var i=0,o=e.length,a=e.charAt(0),s=[0];for(i=0;i0;)s.push(l%o),l=l/o|0}for(i=0;0===t[i]&&i=0;--i)n+=e[s[i]]}else n=function(t,e){var r=0,n=e.length,i=e.charAt(0),o=[0];for(r=0;r0;)o.push(s%n),s=s/n|0}var u="";for(r=0;0===t.at(r)&&r=0;--r)u+=e[o[r]];return u}(t,e);if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join("\r\n")}return n},r.decode=function(t,e){if("string"!=typeof t)throw new TypeError('"input" must be a string.');if("string"!=typeof e)throw new TypeError('"alphabet" must be a string.');var r=n[e];if(!r){r=n[e]=[];for(var i=0;i>=8;for(;c>0;)s.push(255&c),c>>=8}for(var f=0;t[f]===a&&f=i.Versions.TLS_1_1.minor&&u.output.putBytes(r),u.update(t.fragment),u.finish(s)&&(t.fragment=u.output,t.length=t.fragment.length(),o=!0),o}function s(t,e,r){if(!r){var n=t-e.length()%t;e.fillWithByte(n-1,n)}return!0}function u(t,e,r){var n=!0;if(r){for(var i=e.length(),o=e.last(),a=i-1-o;a=s?(t.fragment=a.output.getBytes(c-s),l=a.output.getBytes(s)):t.fragment=a.output.getBytes(),t.fragment=n.util.createBuffer(t.fragment),t.length=t.fragment.length();var f=e.macFunction(e.macKey,e.sequenceNumber,t);return e.updateSequenceNumber(),function(t,e,r){var i=n.hmac.create();return i.start("SHA1",t),i.update(e),e=i.digest().getBytes(),i.start(null,null),i.update(r),e===(r=i.digest().getBytes())}(e.macKey,l,f)&&o}i.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,t.cipher_type=i.CipherType.block,t.enc_key_length=16,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=i.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:o},i.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(t){t.bulk_cipher_algorithm=i.BulkCipherAlgorithm.aes,t.cipher_type=i.CipherType.block,t.enc_key_length=32,t.block_length=16,t.fixed_iv_length=16,t.record_iv_length=16,t.mac_algorithm=i.MACAlgorithm.hmac_sha1,t.mac_length=20,t.mac_key_length=20},initConnectionState:o}},function(t,e,r){var n=r(0);r(30),t.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(t,e,r){var n=r(0);r(12),r(2),r(31),r(1);var i=r(39),o=i.publicKeyValidator,a=i.privateKeyValidator;if(void 0===s)var s=n.jsbn.BigInteger;var u=n.util.ByteBuffer,l="undefined"==typeof Buffer?Uint8Array:Buffer;n.pki=n.pki||{},t.exports=n.pki.ed25519=n.ed25519=n.ed25519||{};var c=n.ed25519;function f(t){var e=t.message;if(e instanceof Uint8Array||e instanceof l)return e;var r=t.encoding;if(void 0===e){if(!t.md)throw new TypeError('"options.message" or "options.md" not specified.');e=t.md.digest().getBytes(),r="binary"}if("string"==typeof e&&!r)throw new TypeError('"options.encoding" must be "binary" or "utf8".');if("string"==typeof e){if("undefined"!=typeof Buffer)return Buffer.from(e,r);e=new u(e,r)}else if(!(e instanceof u))throw new TypeError('"options.message" must be a node.js Buffer, a Uint8Array, a forge ByteBuffer, or a string with "options.encoding" specifying its encoding.');for(var n=new l(e.length()),i=0;i=0;--r)B(n,n),1!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(r,r),F(r,r,i),F(r,r,o),F(r,r,o),F(t[0],r,o),B(n,t[0]),F(n,n,o),C(n,i)&&F(t[0],t[0],b),B(n,t[0]),F(n,n,o),C(n,i)?-1:(A(t[0])===e[31]>>7&&D(t[0],h,t[0]),F(t[3],t[0],t[1]),0)}(s,n))return-1;for(i=0;i=0};var h=N(),p=N([1]),d=N([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=N([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=N([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),g=N([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),m=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),b=N([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function x(t,e){var r=n.md.sha512.create(),i=new u(t);r.update(i.getBytes(e),"binary");var o=r.digest().getBytes();if("undefined"!=typeof Buffer)return Buffer.from(o,"binary");for(var a=new l(c.constants.HASH_BYTE_LENGTH),s=0;s<64;++s)a[s]=o.charCodeAt(s);return a}function w(t,e){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i>8,e[i]-=256*r;e[i]+=r,e[n]=0}for(r=0,i=0;i<32;++i)e[i]+=r-(e[31]>>4)*m[i],r=e[i]>>8,e[i]&=255;for(i=0;i<32;++i)e[i]-=r*m[i];for(n=0;n<32;++n)e[n+1]+=e[n]>>8,t[n]=255&e[n]}function _(t){for(var e=new Float64Array(64),r=0;r<64;++r)e[r]=t[r],t[r]=0;w(t,e)}function S(t,e){var r=N(),n=N(),i=N(),o=N(),a=N(),s=N(),u=N(),l=N(),c=N();D(r,t[1],t[0]),D(c,e[1],e[0]),F(r,r,c),R(n,t[0],t[1]),R(c,e[0],e[1]),F(n,n,c),F(i,t[3],e[3]),F(i,i,y),F(o,t[2],e[2]),R(o,o,o),D(a,n,r),D(s,o,i),R(u,o,i),R(l,n,r),F(t[0],a,s),F(t[1],l,u),F(t[2],u,s),F(t[3],a,l)}function E(t,e,r){for(var n=0;n<4;++n)j(t[n],e[n],r)}function k(t,e){var r=N(),n=N(),i=N();!function(t,e){var r,n=N();for(r=0;r<16;++r)n[r]=e[r];for(r=253;r>=0;--r)B(n,n),2!==r&&4!==r&&F(n,n,e);for(r=0;r<16;++r)t[r]=n[r]}(i,e[2]),F(r,e[0],i),F(n,e[1],i),T(t,n),t[31]^=A(r)<<7}function T(t,e){var r,n,i,o=N(),a=N();for(r=0;r<16;++r)a[r]=e[r];for(L(a),L(a),L(a),n=0;n<2;++n){for(o[0]=a[0]-65517,r=1;r<15;++r)o[r]=a[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=a[15]-32767-(o[14]>>16&1),i=o[15]>>16&1,o[14]&=65535,j(a,o,1-i)}for(r=0;r<16;r++)t[2*r]=255&a[r],t[2*r+1]=a[r]>>8}function C(t,e){var r=new l(32),n=new l(32);return T(r,t),T(n,e),O(r,0,n,0)}function O(t,e,r,n){return function(t,e,r,n,i){var o,a=0;for(o=0;o<32;++o)a|=t[e+o]^r[n+o];return(1&a-1>>>8)-1}(t,e,r,n)}function A(t){var e=new l(32);return T(e,t),1&e[0]}function P(t,e,r){var n,i;for(I(t[0],h),I(t[1],p),I(t[2],p),I(t[3],h),i=255;i>=0;--i)E(t,e,n=r[i/8|0]>>(7&i)&1),S(e,t),S(t,t),E(t,e,n)}function M(t,e){var r=[N(),N(),N(),N()];I(r[0],v),I(r[1],g),I(r[2],p),F(r[3],v,g),P(t,r,e)}function I(t,e){var r;for(r=0;r<16;r++)t[r]=0|e[r]}function L(t){var e,r,n=1;for(e=0;e<16;++e)r=t[e]+n+65535,n=Math.floor(r/65536),t[e]=r-65536*n;t[0]+=n-1+37*(n-1)}function j(t,e,r){for(var n,i=~(r-1),o=0;o<16;++o)n=i&(t[o]^e[o]),t[o]^=n,e[o]^=n}function N(t){var e,r=new Float64Array(16);if(t)for(e=0;e0&&(a=n.util.fillString(String.fromCharCode(0),u)+a),{encapsulation:e.encrypt(a,"NONE"),key:t.generate(a,o)}},decrypt:function(e,r,n){var i=e.decrypt(r,"NONE");return t.generate(i,n)}}},n.kem.kdf1=function(t,e){o(this,t,0,e||t.digestLength)},n.kem.kdf2=function(t,e){o(this,t,1,e||t.digestLength)}},function(t,e,r){var n=r(0);r(1),t.exports=n.log=n.log||{},n.log.levels=["none","error","warning","info","debug","verbose","max"];var i={},o=[],a=null;n.log.LEVEL_LOCKED=2,n.log.NO_LEVEL_CHECK=4,n.log.INTERPOLATE=8;for(var s=0;s0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),o=0;o=r&&a0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,e)),o.length>0&&a.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,o)),a.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,t.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),a])},addSigner:function(e){var r=e.issuer,i=e.serialNumber;if(e.certificate){var o=e.certificate;"string"==typeof o&&(o=n.pki.certificateFromPem(o)),r=o.issuer.attributes,i=o.serialNumber}var a=e.key;if(!a)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof a&&(a=n.pki.privateKeyFromPem(a));var s=e.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=e.authenticatedAttributes||[];if(u.length>0){for(var l=!1,c=!1,f=0;f="8"&&(r="00"+r);var i=n.util.hexToBytes(r);t.putInt32(i.length),t.putBytes(i)}function a(t,e){t.putInt32(e.length),t.putString(e)}function s(){for(var t=n.md.sha1.create(),e=arguments.length,r=0;r=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,r,i,o){for(var a,s=[e,r];s.length;)(r=s.pop())-(e=s.pop())<=i||(a=e+Math.ceil((r-e)/i/2)*i,n(t,a,e,r,o),s.push(e,a,a,r))}i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,r=[],n=this.toBBox;if(!d(t,e))return r;for(var i,o,a,s,u=[];e;){for(i=0,o=e.children.length;i=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);var o=this._chooseSplitIndex(r,i,n),s=y(r.children.splice(o,r.children.length-o));s.height=r.height,s.leaf=r.leaf,a(r,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(r,s)},_splitRoot:function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,r){var n,i,o,a,u,l,c,h,p,d,y,v,g,m;for(l=c=1/0,n=e;n<=r-e;n++)i=s(t,0,n,this.toBBox),o=s(t,n,r,this.toBBox),p=i,d=o,void 0,void 0,void 0,void 0,y=Math.max(p.minX,d.minX),v=Math.max(p.minY,d.minY),g=Math.min(p.maxX,d.maxX),m=Math.min(p.maxY,d.maxY),a=Math.max(0,g-y)*Math.max(0,m-v),u=f(i)+f(o),a=e;i--)o=t.children[i],u(c,t.leaf?a(o):o),f+=h(c);return f},_adjustParentBBoxes:function(t,e,r){for(var n=r;n>=0;n--)u(e[n],t)},_condense:function(t){for(var e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children).splice(e.indexOf(t[r]),1):this.clear():a(t[r],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},2299:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";function t(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function e(t,e){return te?1:0}return function(r,n,i,o,a){!function e(r,n,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=n-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*c*(s-c)/s)*(u-s/2<0?-1:1),h=Math.max(i,Math.floor(n-u*c/s+f)),p=Math.min(o,Math.floor(n+(s-u)*c/s+f));e(r,n,h,p,a)}var d=r[n],y=i,v=o;for(t(r,i,n),a(r[o],d)>0&&t(r,i,o);y0;)v--}0===a(r[i],d)?t(r,i,v):t(r,++v,o),v<=n&&(i=v+1),n<=v&&(o=v-1)}}(r,n,i||0,o||r.length-1,a||e)}},"object"===a(e)?t.exports=o():void 0===(i="function"==typeof(n=o)?n.call(e,r,e,t):n)||(t.exports=i)},7058:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}o=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var r=Object.keys(e),n=0;n=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+o(e)+". must be a nonnegative integer")},oneOf:u,shaderError:function(t,e,n,o,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),u=o===t.FRAGMENT_SHADER?"fragment":"vertex";b(n,"string",u+" shader source must be a string",a);var l=v(n,a),f=function(t){var e=[];return t.split("\n").forEach(function(t){if(!(t.length<5)){var r=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);r?e.push(new p(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new p("unknown",0,t))}}),e}(s);!function(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}(l,f),Object.keys(l).forEach(function(t){var e=l[t];if(e.hasErrors){var n=[""],i=[""];o("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach(function(t){if(t.errors.length>0){o(c(t.number,4)+"| ","background-color:yellow; font-weight:bold"),o(t.line+r,"color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*'(.*)'\s*:\s*(.*)$/.exec(i);if(a){var s=a[1];switch(i=a[2],s){case"assign":s="="}e=Math.max(t.line.indexOf(s,e),0)}else e=0;o(c("| ",6)),o(c("^^^",e+3)+r,"font-weight:bold"),o(c("| ",6)),o(i+r,"font-weight:bold")}),o(c("| ",6)+r)}else o(c(t.number,4)+"| "),o(t.line+r,"color:red")}),"undefined"==typeof document||window.chrome?console.log(n.join("")):(i[0]=n.join("%c"),console.log.apply(console,i))}function o(t,e){n.push(t),i.push(e||"")}}),i.raise("Error compiling "+u+" shader, "+l[0].name)}},linkError:function(t,e,n,o,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var s=t.getProgramInfoLog(e),u=v(n,a),l='Error linking program with vertex shader, "'+v(o,a)[0].name+'", and fragment shader "'+u[0].name+'"';"undefined"!=typeof document?console.log("%c"+l+r+"%c"+s,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(l+r+s),i.raise(l)}},callSite:y,saveCommandRef:g,saveDrawInfo:function(t,e,r,n){function i(t){return t?n.id(t):0}function o(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,r.static),o(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,r){t.texture?u(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):u(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")},guessCommand:d,texture2D:function(t,e,r){var n,o=e.width,a=e.height,s=e.channels;i(o>0&&o<=r.maxTextureSize&&a>0&&a<=r.maxTextureSize,"invalid texture shape"),t.wrapS===x&&t.wrapT===x||i(L(o)&&L(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&i(t.minFilter!==_&&t.minFilter!==E&&t.minFilter!==S&&t.minFilter!==k,"min filter requires mipmap"):(i(L(o)&&L(a),"texture must be a square power of 2 to support mipmapping"),i(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),e.type===T&&(r.extensions.indexOf("oes_texture_float_linear")<0&&i(t.minFilter===w&&t.magFilter===w,"filter not supported, must enable oes_texture_float_linear"),i(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(n=0;n<16;++n)if(u[n]){var l=o>>n,c=a>>n;i(e.mipmask&1<0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),i(o===a,"cube map must be square"),i(e.wrapS===x&&e.wrapT===x,"wrap mode not supported by cube map");for(var u=0;u>f,d=a>>f;i(l.mipmask&1<1&&r===n&&('"'===r||"'"===r))return['"'+z(e.substr(1,e.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return['"'+z(e)+'"'];for(var a=[],s=0;s0,"invalid pixel ratio"))):i=(o=u).canvas:j.raise("invalid arguments to regl"),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!o){if(!i){j("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var v=function(t,r,n){var i,o=document.createElement("canvas");function a(){var r=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();r=a.right-a.left,i=a.bottom-a.top}o.width=n*r,o.height=n*i,e(o.style,{width:r+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver(function(){setTimeout(a)})).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(n||document.body,0,h);if(!v)return null;i=v.canvas,y=v.onDestroy}void 0===l.premultipliedAlpha&&(l.premultipliedAlpha=!0),o=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,l)}return o?{gl:o,canvas:i,container:n,extensions:c,optionalExtensions:f,pixelRatio:h,profile:p,onDone:d,onDestroy:y}:(y(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function X(t,e){for(var r=Array(t),n=0;n65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1}function nt(){var t=X(8,function(){return[]});function e(e){var r=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),n=t[rt(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(e){t[rt(e.byteLength)>>2].push(e)}return{alloc:e,free:r,allocType:function(t,r){var n=null;switch(t){case Z:n=new Int8Array(e(r),0,r);break;case K:n=new Uint8Array(e(r),0,r);break;case J:n=new Int16Array(e(2*r),0,r);break;case Q:n=new Uint16Array(e(2*r),0,r);break;case $:n=new Int32Array(e(4*r),0,r);break;case tt:n=new Uint32Array(e(4*r),0,r);break;case et:n=new Float32Array(e(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(t){r(t.buffer)}}}var it=nt();it.zero=nt();var ot=function(t,e){var r=1;e.ext_texture_filter_anisotropic&&(r=t.getParameter(34047));var n=1,i=1;e.webgl_draw_buffers&&(n=t.getParameter(34852),i=t.getParameter(36063));var o=!!e.oes_texture_float;if(o){var a=t.createTexture();t.bindTexture(3553,a),t.texImage2D(3553,0,6408,1,1,0,6408,5126,null);var s=t.createFramebuffer();if(t.bindFramebuffer(36160,s),t.framebufferTexture2D(36160,36064,3553,a,0),t.bindTexture(3553,null),36053!==t.checkFramebufferStatus(36160))o=!1;else{t.viewport(0,0,1,1),t.clearColor(1,0,0,1),t.clear(16384);var u=it.allocType(5126,4);t.readPixels(0,0,1,1,6408,5126,u),t.getError()?o=!1:(t.deleteFramebuffer(s),t.deleteTexture(a),o=1===u[0]),it.freeType(u)}}var l=!0;if(!("undefined"!=typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)))){var c=t.createTexture(),f=it.allocType(5121,36);t.activeTexture(33984),t.bindTexture(34067,c),t.texImage2D(34069,0,6408,3,3,0,6408,5121,f),it.freeType(f),t.bindTexture(34067,null),t.deleteTexture(c),l=!t.getError()}return{colorBits:[t.getParameter(3410),t.getParameter(3411),t.getParameter(3412),t.getParameter(3413)],depthBits:t.getParameter(3414),stencilBits:t.getParameter(3415),subpixelBits:t.getParameter(3408),extensions:Object.keys(e).filter(function(t){return!!e[t]}),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:t.getParameter(33901),lineWidthDims:t.getParameter(33902),maxViewportDims:t.getParameter(3386),maxCombinedTextureUnits:t.getParameter(35661),maxCubeMapSize:t.getParameter(34076),maxRenderbufferSize:t.getParameter(34024),maxTextureUnits:t.getParameter(34930),maxTextureSize:t.getParameter(3379),maxAttributes:t.getParameter(34921),maxVertexUniforms:t.getParameter(36347),maxVertexTextureUnits:t.getParameter(35660),maxVaryingVectors:t.getParameter(36348),maxFragmentUniforms:t.getParameter(36349),glsl:t.getParameter(35724),renderer:t.getParameter(7937),vendor:t.getParameter(7936),version:t.getParameter(7938),readFloat:o,npotTextureCube:l}};function at(e){return!!e&&"object"===a(e)&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}var st=function(t){return Object.keys(t).map(function(e){return t[e]})},ut={shape:function(t){for(var e=[],r=t;r.length;r=r[0])e.push(r.length);return e},flatten:function(t,e,r,n){var i=1;if(e.length)for(var o=0;o>>31<<15,o=(n<<1>>>24)-127,a=n>>13&1023;if(o<-24)e[r]=i;else if(o<-14){var s=-14-o;e[r]=i+(a+1024>>s)}else e[r]=o>15?i+31744:i+(o+15<<10)+a}return e}function zt(e){return Array.isArray(e)||t(e)}var Gt=function(t){return!(t&t-1||!t)},Ut=34467,Vt=3553,Ht=34067,Wt=34069,qt=6408,Yt=6406,Xt=6407,Zt=6409,Kt=6410,Jt=32854,Qt=32855,$t=36194,te=32819,ee=32820,re=33635,ne=34042,ie=6402,oe=34041,ae=35904,se=35906,ue=36193,le=33776,ce=33777,fe=33778,he=33779,pe=35986,de=35987,ye=34798,ve=35840,ge=35841,me=35842,be=35843,xe=36196,we=5121,_e=5123,Se=5125,Ee=5126,ke=10242,Te=10243,Ce=10497,Oe=33071,Ae=33648,Pe=10240,Me=10241,Ie=9728,Le=9729,je=9984,Ne=9985,Re=9986,De=9987,Be=33170,Fe=4352,ze=4353,Ge=4354,Ue=34046,Ve=3317,He=37440,We=37441,qe=37443,Ye=37444,Xe=33984,Ze=[je,Re,Ne,De],Ke=[0,Zt,Kt,Xt,qt],Je={};function Qe(t){return"[object "+t+"]"}Je[Zt]=Je[Yt]=Je[ie]=1,Je[oe]=Je[Kt]=2,Je[Xt]=Je[ae]=3,Je[qt]=Je[se]=4;var $e=Qe("HTMLCanvasElement"),tr=Qe("OffscreenCanvas"),er=Qe("CanvasRenderingContext2D"),rr=Qe("ImageBitmap"),nr=Qe("HTMLImageElement"),ir=Qe("HTMLVideoElement"),or=Object.keys(ct).concat([$e,tr,er,rr,nr,ir]),ar=[];ar[we]=1,ar[Ee]=4,ar[ue]=2,ar[_e]=2,ar[Se]=4;var sr=[];function ur(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function lr(t){return!!Array.isArray(t)&&!(0===t.length||!zt(t[0]))}function cr(t){return Object.prototype.toString.call(t)}function fr(t){return cr(t)===$e}function hr(t){return cr(t)===tr}function pr(t){if(!t)return!1;var e=cr(t);return or.indexOf(e)>=0||(ur(t)||lr(t)||at(t))}function dr(t){return 0|ct[Object.prototype.toString.call(t)]}function yr(t,e){return it.allocType(t.type===ue?Ee:t.type,e)}function vr(t,e){t.type===ue?(t.data=Ft(e),it.freeType(e)):t.data=e}function gr(t,e,r,n,i,o){var a;if(a=void 0!==sr[t]?sr[t]:Je[t]*ar[e],o&&(a*=6),i){for(var s=0,u=r;u>=1;)s+=a*u*u,u/=2;return s}return a*r*n}function mr(r,n,i,o,s,u,l){var c={"don't care":Fe,"dont care":Fe,nice:Ge,fast:ze},f={repeat:Ce,clamp:Oe,mirror:Ae},h={nearest:Ie,linear:Le},p=e({mipmap:De,"nearest mipmap nearest":je,"linear mipmap nearest":Ne,"nearest mipmap linear":Re,"linear mipmap linear":De},h),d={none:0,browser:Ye},y={uint8:we,rgba4:te,rgb565:re,"rgb5 a1":ee},v={alpha:Yt,luminance:Zt,"luminance alpha":Kt,rgb:Xt,rgba:qt,rgba4:Jt,"rgb5 a1":Qt,rgb565:$t},g={};n.ext_srgb&&(v.srgb=ae,v.srgba=se),n.oes_texture_float&&(y.float32=y.float=Ee),n.oes_texture_half_float&&(y.float16=y["half float"]=ue),n.webgl_depth_texture&&(e(v,{depth:ie,"depth stencil":oe}),e(y,{uint16:_e,uint32:Se,"depth stencil":ne})),n.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":le,"rgba s3tc dxt1":ce,"rgba s3tc dxt3":fe,"rgba s3tc dxt5":he}),n.webgl_compressed_texture_atc&&e(g,{"rgb atc":pe,"rgba atc explicit alpha":de,"rgba atc interpolated alpha":ye}),n.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":ve,"rgb pvrtc 2bppv1":ge,"rgba pvrtc 4bppv1":me,"rgba pvrtc 2bppv1":be}),n.webgl_compressed_texture_etc1&&(g["rgb etc1"]=xe);var m=Array.prototype.slice.call(r.getParameter(Ut));Object.keys(g).forEach(function(t){var e=g[t];m.indexOf(e)>=0&&(v[t]=e)});var b=Object.keys(v);i.textureFormats=b;var x=[];Object.keys(v).forEach(function(t){var e=v[t];x[e]=t});var w=[];Object.keys(y).forEach(function(t){var e=y[t];w[e]=t});var _=[];Object.keys(h).forEach(function(t){var e=h[t];_[e]=t});var S=[];Object.keys(p).forEach(function(t){var e=p[t];S[e]=t});var E=[];Object.keys(f).forEach(function(t){var e=f[t];E[e]=t});var k=b.reduce(function(t,e){var r=v[e];return r===Zt||r===Yt||r===Zt||r===Kt||r===ie||r===oe||n.ext_srgb&&(r===ae||r===se)?t[r]=r:r===Qt||e.indexOf("rgba")>=0?t[r]=qt:t[r]=Xt,t},{});function T(){this.internalformat=qt,this.format=qt,this.type=we,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=Ye,this.width=0,this.height=0,this.channels=0}function C(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function O(t,e){if("object"===a(e)&&e){if("premultiplyAlpha"in e&&(j.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(j.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(j.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(j.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var r=e.type;j(n.oes_texture_float||!("float"===r||"float32"===r),"you must enable the OES_texture_float extension in order to use floating point textures."),j(n.oes_texture_half_float||!("half float"===r||"float16"===r),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),j(n.webgl_depth_texture||!("uint16"===r||"uint32"===r||"depth stencil"===r),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),j.parameter(r,y,"invalid texture type"),t.type=y[r]}var o=t.width,s=t.height,u=t.channels,l=!1;"shape"in e?(j(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],s=e.shape[1],3===e.shape.length&&(u=e.shape[2],j(u>0&&u<=4,"invalid number of channels"),l=!0),j(o>=0&&o<=i.maxTextureSize,"invalid width"),j(s>=0&&s<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=s=e.radius,j(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,j(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(s=e.height,j(s>=0&&s<=i.maxTextureSize,"invalid height")),"channels"in e&&(u=e.channels,j(u>0&&u<=4,"invalid number of channels"),l=!0)),t.width=0|o,t.height=0|s,t.channels=0|u;var c=!1;if("format"in e){var f=e.format;j(n.webgl_depth_texture||!("depth"===f||"depth stencil"===f),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),j.parameter(f,v,"invalid texture format");var h=t.internalformat=v[f];t.format=k[h],f in y&&("type"in e||(t.type=y[f])),f in g&&(t.compressed=!0),c=!0}!l&&c?t.channels=Je[t.format]:l&&!c?t.channels!==Ke[t.format]&&(t.format=t.internalformat=Ke[t.channels]):c&&l&&j(t.channels===Je[t.format],"number of channels inconsistent with specified format")}}function A(t){r.pixelStorei(He,t.flipY),r.pixelStorei(We,t.premultiplyAlpha),r.pixelStorei(qe,t.colorSpace),r.pixelStorei(Ve,t.unpackAlignment)}function P(){T.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function M(e,r){var n=null;if(pr(r)?n=r:r&&(j.type(r,"object","invalid pixel data type"),O(e,r),"x"in r&&(e.xOffset=0|r.x),"y"in r&&(e.yOffset=0|r.y),pr(r.data)&&(n=r.data)),j(!e.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),r.copy){j(!n,"can not specify copy and data field for the same texture");var o=s.viewportWidth,a=s.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||a-e.yOffset,e.needsCopy=!0,j(e.xOffset>=0&&e.xOffset=0&&e.yOffset0&&e.width<=o&&e.height>0&&e.height<=a,"copy texture read out of bounds")}else if(n){if(t(n))e.channels=e.channels||4,e.data=n,"type"in r||e.type!==we||(e.type=dr(n));else if(ur(n))e.channels=e.channels||4,function(t,e){var r=e.length;switch(t.type){case we:case _e:case Se:case Ee:var n=it.allocType(t.type,r);n.set(e),t.data=n;break;case ue:t.data=Ft(e);break;default:j.raise("unsupported texture type, must specify a typed array")}}(e,n),e.alignment=1,e.needsFree=!0;else if(at(n)){var u=n.data;Array.isArray(u)||e.type!==we||(e.type=dr(u));var l,c,f,h,p,d,y=n.shape,v=n.stride;3===y.length?(f=y[2],d=v[2]):(j(2===y.length,"invalid ndarray pixel data, must be 2 or 3D"),f=1,d=1),l=y[0],c=y[1],h=v[0],p=v[1],e.alignment=1,e.width=l,e.height=c,e.channels=f,e.format=e.internalformat=Ke[f],e.needsFree=!0,function(t,e,r,n,i,o){for(var a=t.width,s=t.height,u=t.channels,l=yr(t,a*s*u),c=0,f=0;f=0,"oes_texture_float extension not enabled"):e.type===ue&&j(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function I(t,e,n){var i=t.element,a=t.data,s=t.internalformat,u=t.format,l=t.type,c=t.width,f=t.height;A(t),i?r.texImage2D(e,n,u,u,l,i):t.compressed?r.compressedTexImage2D(e,n,s,c,f,0,a):t.needsCopy?(o(),r.copyTexImage2D(e,n,u,t.xOffset,t.yOffset,c,f,0)):r.texImage2D(e,n,u,c,f,0,u,l,a||null)}function L(t,e,n,i,a){var s=t.element,u=t.data,l=t.internalformat,c=t.format,f=t.type,h=t.width,p=t.height;A(t),s?r.texSubImage2D(e,a,n,i,c,f,s):t.compressed?r.compressedTexSubImage2D(e,a,n,i,l,h,p,u):t.needsCopy?(o(),r.copyTexSubImage2D(e,a,n,i,t.xOffset,t.yOffset,h,p)):r.texSubImage2D(e,a,n,i,h,p,c,f,u)}var N=[];function R(){return N.pop()||new P}function D(t){t.needsFree&&it.freeType(t.data),P.call(t),N.push(t)}function B(t,e,r){var n=t.images[0]=R();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function F(t,e){var r=null;if(pr(e))C(r=t.images[0]=R(),t),M(r,e),t.mipmask=1;else if(O(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,M(r,n[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var n=e.mag;j.parameter(n,h),t.magFilter=h[n]}var o=t.wrapS,s=t.wrapT;if("wrap"in e){var u=e.wrap;"string"==typeof u?(j.parameter(u,f),o=s=f[u]):Array.isArray(u)&&(j.parameter(u[0],f),j.parameter(u[1],f),o=f[u[0]],s=f[u[1]])}else{if("wrapS"in e){var l=e.wrapS;j.parameter(l,f),o=f[l]}if("wrapT"in e){var d=e.wrapT;j.parameter(d,f),s=f[d]}}if(t.wrapS=o,t.wrapT=s,"anisotropic"in e){var y=e.anisotropic;j("number"==typeof y&&y>=1&&y<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var v=!1;switch(a(e.mipmap)){case"string":j.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,v=!0;break;case"boolean":v=t.genMipmaps=e.mipmap;break;case"object":j(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,v=!0;break;default:j.raise("invalid mipmap type")}!v||"min"in e||(t.minFilter=je)}}function q(t,e){r.texParameteri(e,Me,t.minFilter),r.texParameteri(e,Pe,t.magFilter),r.texParameteri(e,ke,t.wrapS),r.texParameteri(e,Te,t.wrapT),n.ext_texture_filter_anisotropic&&r.texParameteri(e,Ue,t.anisotropic),t.genMipmaps&&(r.hint(Be,t.mipmapHint),r.generateMipmap(e))}var Y=0,X={},Z=i.maxTextureUnits,K=Array(Z).map(function(){return null});function J(t){T.call(this),this.mipmask=0,this.internalformat=qt,this.id=Y++,this.refCount=1,this.target=t,this.texture=r.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new H,l.profile&&(this.stats={size:0})}function Q(t){r.activeTexture(Xe),r.bindTexture(t.target,t.texture)}function $(){var t=K[0];t?r.bindTexture(t.target,t.texture):r.bindTexture(Vt,null)}function tt(t){var e=t.texture;j(e,"must not double destroy texture");var n=t.unit,i=t.target;n>=0&&(r.activeTexture(Xe+n),r.bindTexture(i,null),K[n]=null),r.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete X[t.id],u.textureCount--}return e(J.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e0)continue;n.unit=-1}K[e]=this,t=e;break}t>=Z&&j.raise("insufficient number of texture units"),l.profile&&u.maxTextureUnits>u)-a,l.height=l.height||(n.height>>u)-s,j(n.type===l.type&&n.format===l.format&&n.internalformat===l.internalformat,"incompatible format for texture.subimage"),j(a>=0&&s>=0&&a+l.width<=n.width&&s+l.height<=n.height,"texture.subimage write out of bounds"),j(n.mipmask&1<>s;++s){var u=i>>s,c=a>>s;if(!u||!c)break;r.texImage2D(Vt,s,n.format,u,c,0,n.format,n.type,null)}return $(),l.profile&&(n.stats.size=gr(n.internalformat,n.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=n,l.profile&&(o.stats=n.stats),o.destroy=function(){n.decRef()},o},createCube:function(t,e,n,o,s,c){var f=new J(Ht);X[f.id]=f,u.cubeCount++;var h=new Array(6);function p(t,e,r,n,o,s){var u,c=f.texInfo;for(H.call(c),u=0;u<6;++u)h[u]=U();if("number"!=typeof t&&t)if("object"===a(t))if(e)F(h[0],t),F(h[1],e),F(h[2],r),F(h[3],n),F(h[4],o),F(h[5],s);else if(W(c,t),O(f,t),"faces"in t){var d=t.faces;for(j(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),u=0;u<6;++u)j("object"===a(d[u])&&!!d[u],"invalid input for cube map face"),C(h[u],f),F(h[u],d[u])}else for(u=0;u<6;++u)F(h[u],t);else j.raise("invalid arguments to cube map");else{var y=0|t||1;for(u=0;u<6;++u)B(h[u],y,y)}for(C(f,h[0]),i.npotTextureCube||j(Gt(f.width)&&Gt(f.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?f.mipmask=(h[0].width<<1)-1:f.mipmask=h[0].mipmask,j.textureCube(f,c,h,i),f.internalformat=h[0].internalformat,p.width=h[0].width,p.height=h[0].height,Q(f),u=0;u<6;++u)z(h[u],Wt+u);for(q(c,Ht),$(),l.profile&&(f.stats.size=gr(f.internalformat,f.type,p.width,p.height,c.genMipmaps,!0)),p.format=x[f.internalformat],p.type=w[f.type],p.mag=_[c.magFilter],p.min=S[c.minFilter],p.wrapS=E[c.wrapS],p.wrapT=E[c.wrapT],u=0;u<6;++u)V(h[u]);return p}return p(t,e,n,o,s,c),p.subimage=function(t,e,r,n,i){j(!!e,"must specify image data"),j("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|r,a=0|n,s=0|i,u=R();return C(u,f),u.width=0,u.height=0,M(u,e),u.width=u.width||(f.width>>s)-o,u.height=u.height||(f.height>>s)-a,j(f.type===u.type&&f.format===u.format&&f.internalformat===u.internalformat,"incompatible format for texture.subimage"),j(o>=0&&a>=0&&o+u.width<=f.width&&a+u.height<=f.height,"texture.subimage write out of bounds"),j(f.mipmask&1<>i;++i)r.texImage2D(Wt+n,i,f.format,e>>i,e>>i,0,f.format,f.type,null);return $(),l.profile&&(f.stats.size=gr(f.internalformat,f.type,p.width,p.height,!1,!0)),p}},p._reglType="textureCube",p._texture=f,l.profile&&(p.stats=f.stats),p.destroy=function(){f.decRef()},p},clear:function(){for(var t=0;t>e,t.height>>e,0,t.internalformat,t.type,null);else for(var n=0;n<6;++n)r.texImage2D(Wt+n,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);q(t.texInfo,t.target)})},refresh:function(){for(var t=0;t=2,"invalid renderbuffer shape"),u=0|d[0],l=0|d[1]}else"radius"in p&&(u=l=0|p.radius),"width"in p&&(u=0|p.width),"height"in p&&(l=0|p.height);"format"in p&&(j.parameter(p.format,o,"invalid renderbuffer format"),c=o[p.format])}else"number"==typeof e?(u=0|e,l="number"==typeof n?0|n:u):e?j.raise("invalid arguments to renderbuffer constructor"):u=l=1;if(j(u>0&&l>0&&u<=r.maxRenderbufferSize&&l<=r.maxRenderbufferSize,"invalid renderbuffer size"),u!==f.width||l!==f.height||c!==f.format)return h.width=f.width=u,h.height=f.height=l,f.format=c,t.bindRenderbuffer(br,f.renderbuffer),t.renderbufferStorage(br,c,u,l),j(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=_r(f.format,f.width,f.height)),h.format=s[f.format],h}return l[f.id]=f,n.renderbufferCount++,h(e,u),h.resize=function(e,n){var o=0|e,a=0|n||o;return o===f.width&&a===f.height?h:(j(o>0&&a>0&&o<=r.maxRenderbufferSize&&a<=r.maxRenderbufferSize,"invalid renderbuffer size"),h.width=f.width=o,h.height=f.height=a,t.bindRenderbuffer(br,f.renderbuffer),t.renderbufferStorage(br,f.format,o,a),j(0===t.getError(),"invalid render buffer format"),i.profile&&(f.stats.size=_r(f.format,f.width,f.height)),h)},h._reglType="renderbuffer",h._renderbuffer=f,i.profile&&(h.stats=f.stats),h.destroy=function(){f.decRef()},h},clear:function(){st(l).forEach(f)},restore:function(){st(l).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(br,e.renderbuffer),t.renderbufferStorage(br,e.format,e.width,e.height)}),t.bindRenderbuffer(br,null)}}},Er=36160,kr=36161,Tr=3553,Cr=34069,Or=36064,Ar=36096,Pr=36128,Mr=33306,Ir=36053,Lr=6402,jr=[6407,6408],Nr=[];Nr[6408]=4,Nr[6407]=3;var Rr=[];Rr[5121]=1,Rr[5126]=4,Rr[36193]=2;var Dr=33189,Br=36168,Fr=34041,zr=[32854,32855,36194,35907,34842,34843,34836],Gr={};Gr[Ir]="complete",Gr[36054]="incomplete attachment",Gr[36057]="incomplete dimensions",Gr[36055]="incomplete, missing attachment",Gr[36061]="unsupported";var Ur=5126,Vr=34962;function Hr(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Ur,this.offset=0,this.stride=0,this.divisor=0}var Wr=35632,qr=35633,Yr=35718,Xr=35721;function Zr(t,r,n,i){var o={},a={};function s(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function u(t,e){for(var r=0;r1)for(var g=0;gt&&(t=e.stats.uniformsCount)}),t},n.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);st(o).forEach(e),o={},st(a).forEach(e),a={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,c={},n.shaderCount=0},program:function(r,s,u,l){j.command(r>=0,"missing vertex shader",u),j.command(s>=0,"missing fragment shader",u);var d=c[s];d||(d=c[s]={});var y=d[r];if(y&&(y.refCount++,!l))return y;var v=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(s,r);return n.shaderCount++,p(v,u,l),y||(d[r]=v),f.push(v),e(v,{destroy:function(){if(v.refCount--,v.refCount<=0){t.deleteProgram(v.program);var e=f.indexOf(v);f.splice(e,1),n.shaderCount--}d[v.vertId].refCount<=0&&(t.deleteShader(a[v.vertId]),delete a[v.vertId],delete c[v.fragId][v.vertId]),Object.keys(c[v.fragId]).length||(t.deleteShader(o[v.fragId]),delete o[v.fragId],delete c[v.fragId])}})},restore:function(){o={},a={};for(var t=0;t=0&&c=0&&f0&&h+c<=i.framebufferWidth,"invalid width for read pixels"),j(p>0&&p+f<=i.framebufferHeight,"invalid height for read pixels"),n();var y=h*p*4;return d||(l===Jr?d=new Uint8Array(y):l===$r&&(d=d||new Float32Array(y))),j.isTypedArray(d,"data buffer for regl.read() must be a typedarray"),j(d.byteLength>=y,"data buffer for regl.read() too small"),e.pixelStorei(Qr,4),e.readPixels(c,f,h,p,Kr,l,d),d}return function(t){return t&&"framebuffer"in t?function(t){var e;return r.setFBO({framebuffer:t.framebuffer},function(){e=u(t)}),e}(t):u(t)}}function en(t){return Array.prototype.slice.call(t)}function rn(t){return en(t).join("")}var nn="xyzw".split(""),on=5121,an=1,sn=2,un=0,ln=1,cn=2,fn=3,hn=4,pn=5,dn=6,yn="dither",vn="blend.enable",gn="blend.color",mn="blend.equation",bn="blend.func",xn="depth.enable",wn="depth.func",_n="depth.range",Sn="depth.mask",En="colorMask",kn="cull.enable",Tn="cull.face",Cn="frontFace",On="lineWidth",An="polygonOffset.enable",Pn="polygonOffset.offset",Mn="sample.alpha",In="sample.enable",Ln="sample.coverage",jn="stencil.enable",Nn="stencil.mask",Rn="stencil.func",Dn="stencil.opFront",Bn="stencil.opBack",Fn="scissor.enable",zn="scissor.box",Gn="viewport",Un="profile",Vn="framebuffer",Hn="vert",Wn="frag",qn="elements",Yn="primitive",Xn="count",Zn="offset",Kn="instances",Jn="vao",Qn=Vn+"Width",$n=Vn+"Height",ti=Gn+"Width",ei=Gn+"Height",ri="drawingBufferWidth",ni="drawingBufferHeight",ii=[bn,mn,Rn,Dn,Bn,Ln,Gn,zn,Pn],oi=34962,ai=34963,si=3553,ui=34067,li=2884,ci=3042,fi=3024,hi=2960,pi=2929,di=3089,yi=32823,vi=32926,gi=32928,mi=5126,bi=35664,xi=35665,wi=35666,_i=5124,Si=35667,Ei=35668,ki=35669,Ti=35670,Ci=35671,Oi=35672,Ai=35673,Pi=35674,Mi=35675,Ii=35676,Li=35678,ji=35680,Ni=4,Ri=1028,Di=1029,Bi=2304,Fi=2305,zi=32775,Gi=32776,Ui=519,Vi=7680,Hi=0,Wi=1,qi=32774,Yi=513,Xi=36160,Zi=36064,Ki={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ji=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Qi={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},$i={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},to={frag:35632,vert:35633},eo={cw:Bi,ccw:Fi};function ro(e){return Array.isArray(e)||t(e)||at(e)}function no(t){return t.sort(function(t,e){return t===Gn?-1:e===Gn?1:t=1,n>=2,e)}if(r===hn){var i=t.data;return new io(i.thisDep,i.contextDep,i.propDep,e)}if(r===pn)return new io(!1,!1,!1,e);if(r===dn){for(var o=!1,a=!1,s=!1,u=0;u=1&&(a=!0),c>=2&&(s=!0)}else l.type===hn&&(o=o||l.data.thisDep,a=a||l.data.contextDep,s=s||l.data.propDep)}return new io(o,a,s,e)}return new io(r===fn,r===cn,r===ln,e)}var uo=new io(!1,!1,!1,function(){});function lo(t,r,n,i,o,s,u,l,c,f,h,p,d,y,v){var g=f.Record,m={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(m.min=zi,m.max=Gi);var b=n.angle_instanced_arrays,x=n.webgl_draw_buffers,w={dirty:!0,profile:v.profile},_={},S=[],E={},k={};function T(t){return t.replace(".","_")}function C(t,e,r){var n=T(t);S.push(t),_[n]=w[n]=!!r,E[n]=e}function O(t,e,r){var n=T(t);S.push(t),Array.isArray(r)?(w[n]=r.slice(),_[n]=r.slice()):w[n]=_[n]=r,k[n]=e}C(yn,fi),C(vn,ci),O(gn,"blendColor",[0,0,0,0]),O(mn,"blendEquationSeparate",[qi,qi]),O(bn,"blendFuncSeparate",[Wi,Hi,Wi,Hi]),C(xn,pi,!0),O(wn,"depthFunc",Yi),O(_n,"depthRange",[0,1]),O(Sn,"depthMask",!0),O(En,En,[!0,!0,!0,!0]),C(kn,li),O(Tn,"cullFace",Di),O(Cn,Cn,Fi),O(On,On,1),C(An,yi),O(Pn,"polygonOffset",[0,0]),C(Mn,vi),C(In,gi),O(Ln,"sampleCoverage",[1,!1]),C(jn,hi),O(Nn,"stencilMask",-1),O(Rn,"stencilFunc",[Ui,0,-1]),O(Dn,"stencilOpSeparate",[Ri,Vi,Vi,Vi]),O(Bn,"stencilOpSeparate",[Di,Vi,Vi,Vi]),C(Fn,di),O(zn,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),O(Gn,Gn,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var A={gl:t,context:d,strings:r,next:_,current:w,draw:p,elements:s,buffer:o,shader:h,attributes:f.state,vao:f,uniforms:c,framebuffer:l,extensions:n,timer:y,isBufferArgs:ro},P={primTypes:St,compareFuncs:Qi,blendFuncs:Ki,blendEquations:m,stencilOps:$i,glTypes:ft,orientationType:eo};j.optional(function(){A.isArrayLike=zt}),x&&(P.backBuffer=[Di],P.drawBuffer=X(i.maxDrawbuffers,function(t){return 0===t?[0]:X(t,function(t){return Zi+t})}));var M=0;function I(){var t=function(){var t=0,r=[],n=[];function i(){var r=[],n=[];return e(function(){r.push.apply(r,en(arguments))},{def:function(){var e="v"+t++;return n.push(e),arguments.length>0&&(r.push(e,"="),r.push.apply(r,en(arguments)),r.push(";")),e},toString:function(){return rn([n.length>0?"var "+n.join(",")+";":"",rn(r)])}})}function o(){var t=i(),r=i(),n=t.toString,o=r.toString;function a(e,n){r(e,n,"=",t.def(e,n),";")}return e(function(){t.apply(t,en(arguments))},{def:t.def,entry:t,exit:r,save:a,set:function(e,r,n){a(e,r),t(e,r,"=",n,";")},toString:function(){return n()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i=0,'unknown parameter "'+e+'"',p.commandStr)})}e(d),e(y)});var v=function(t,e){var r=t.static;if("string"==typeof r[Wn]&&"string"==typeof r[Hn]){if(Object.keys(e.dynamic).length>0)return null;var n=e.static,i=Object.keys(n);if(i.length>0&&"number"==typeof n[i[0]]){for(var o=[],a=0;a=0,"invalid "+t,r.commandStr)):u=!1,"height"in o?(s=0|o.height,j.command(s>=0,"invalid "+t,r.commandStr)):u=!1,new io(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,function(t,e){var r=t.shared.context,n=a;"width"in o||(n=e.def(r,".",Qn,"-",l));var i=s;return"height"in o||(i=e.def(r,".",$n,"-",c)),[l,c,n,i]})}if(t in i){var f=i[t],h=so(f,function(e,r){var n=e.invoke(r,f);j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,o=r.def(n,".x|0"),a=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Qn,"-",o,")"),u=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",$n,"-",a,")");return j.optional(function(){e.assert(r,s+">=0&&"+u+">=0","invalid "+t)}),[o,a,s,u]});return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new io(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Qn),e.def(r,".",$n)]}):null}var a=o(Gn);if(a){var s=a;a=new io(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+ti,r[2]),e.set(n,"."+ei,r[3]),r})}return{viewport:a,scissor_box:o(zn)}}(t,x,p),_=function(t,e){var r=t.static,n=t.dynamic,i=function(){if(qn in r){var t=r[qn];ro(t)?t=s.getElements(s.create(t,!0)):t&&(t=s.getElements(t),j.command(t,"invalid elements",e.commandStr));var i=ao(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return i.value=t,i}if(qn in n){var o=n[qn];return so(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(n,"(",a,")"),l=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return j.optional(function(){t.assert(l.else,"!"+a+"||"+s,"invalid elements")}),e.entry(l),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}();function o(t,o){if(t in r){var a=0|r[t];return j.command(!o||a>=0,"invalid "+t,e.commandStr),ao(function(t,e){return o&&(t.OFFSET=a),a})}if(t in n){var s=n[t];return so(s,function(e,r){var n=e.invoke(r,s);return o&&(e.OFFSET=n,j.optional(function(){e.assert(r,n+">=0","invalid "+t)})),n})}return o&&i?ao(function(t,e){return t.OFFSET="0",0}):null}var a=o(Zn,!0);return{elements:i,primitive:function(){if(Yn in r){var t=r[Yn];return j.commandParameter(t,St,"invalid primitve",e.commandStr),ao(function(e,r){return St[t]})}if(Yn in n){var o=n[Yn];return so(o,function(t,e){var r=t.constants.primTypes,n=t.invoke(e,o);return j.optional(function(){t.assert(e,n+" in "+r,"invalid primitive, must be one of "+Object.keys(St))}),e.def(r,"[",n,"]")})}return i?oo(i)?i.value?ao(function(t,e){return e.def(t.ELEMENTS,".primType")}):ao(function(){return Ni}):new io(i.thisDep,i.contextDep,i.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",Ni)}):null}(),count:function(){if(Xn in r){var t=0|r[Xn];return j.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),ao(function(){return t})}if(Xn in n){var o=n[Xn];return so(o,function(t,e){var r=t.invoke(e,o);return j.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">=0&&"+r+"===("+r+"|0)","invalid vertex count")}),r})}if(i){if(oo(i)){if(i)return a?new io(a.thisDep,a.contextDep,a.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return j.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):ao(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var s=ao(function(){return-1});return j.optional(function(){s.MISSING=!0}),s}var u=new io(i.thisDep||a.thisDep,i.contextDep||a.contextDep,i.propDep||a.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return j.optional(function(){u.DYNAMIC=!0}),u}return null}(),instances:o(Kn,!1),offset:a}}(t,p),E=function(t,e){var r=t.static,n=t.dynamic,o={};return S.forEach(function(t){var s=T(t);function u(e,i){if(t in r){var a=e(r[t]);o[s]=ao(function(){return a})}else if(t in n){var u=n[t];o[s]=so(u,function(t,e){return i(t,e,t.invoke(e,u))})}}switch(t){case kn:case vn:case yn:case jn:case xn:case Fn:case An:case Mn:case In:case Sn:return u(function(r){return j.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return j.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case wn:return u(function(r){return j.commandParameter(r,Qi,"invalid "+t,e.commandStr),Qi[r]},function(e,r,n){var i=e.constants.compareFuncs;return j.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Qi))}),r.def(i,"[",n,"]")});case _n:return u(function(t){return j.command(zt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return j.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case bn:return u(function(t){j.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return j.commandParameter(r,Ki,s+".srcRGB",e.commandStr),j.commandParameter(n,Ki,s+".srcAlpha",e.commandStr),j.commandParameter(i,Ki,s+".dstRGB",e.commandStr),j.commandParameter(o,Ki,s+".dstAlpha",e.commandStr),j.command(-1===Ji.indexOf(r+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ki[r],Ki[i],Ki[n],Ki[o]]},function(e,r,n){var i=e.constants.blendFuncs;function o(o,a){var s=r.def('"',o,a,'" in ',n,"?",n,".",o,a,":",n,".",o);return j.optional(function(){e.assert(r,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Ki))}),s}j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var a=o("src","RGB"),s=o("dst","RGB");j.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var u=r.def(i,"[",a,"]"),l=r.def(i,"[",o("src","Alpha"),"]");return[u,r.def(i,"[",s,"]"),l,r.def(i,"[",o("dst","Alpha"),"]")]});case mn:return u(function(r){return"string"==typeof r?(j.commandParameter(r,m,"invalid "+t,e.commandStr),[m[r],m[r]]):"object"===a(r)?(j.commandParameter(r.rgb,m,t+".rgb",e.commandStr),j.commandParameter(r.alpha,m,t+".alpha",e.commandStr),[m[r.rgb],m[r.alpha]]):void j.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,o=r.def(),a=r.def(),s=e.cond("typeof ",n,'==="string"');return j.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(m))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(o,"=",a,"=",i,"[",n,"];"),s.else(o,"=",i,"[",n,".rgb];",a,"=",i,"[",n,".alpha];"),r(s),[o,a]});case gn:return u(function(t){return j.command(zt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),X(4,function(e){return+t[e]})},function(t,e,r){return j.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),X(4,function(t){return e.def("+",r,"[",t,"]")})});case Nn:return u(function(t){return j.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return j.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Rn:return u(function(r){j.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,o="mask"in r?r.mask:-1;return j.commandParameter(n,Qi,t+".cmp",e.commandStr),j.commandType(i,"number",t+".ref",e.commandStr),j.commandType(o,"number",t+".mask",e.commandStr),[Qi[n],i,o]},function(t,e,r){var n=t.constants.compareFuncs;return j.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Vi),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Dn:case Bn:return u(function(r){j.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",o=r.zpass||"keep";return j.commandParameter(n,$i,t+".fail",e.commandStr),j.commandParameter(i,$i,t+".zfail",e.commandStr),j.commandParameter(o,$i,t+".zpass",e.commandStr),[t===Bn?Di:Ri,$i[n],$i[i],$i[o]]},function(e,r,n){var i=e.constants.stencilOps;function o(o){return j.optional(function(){e.assert(r,'!("'+o+'" in '+n+")||("+n+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys($i))}),r.def('"',o,'" in ',n,"?",i,"[",n,".",o,"]:",Vi)}return j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Bn?Di:Ri,o("fail"),o("zfail"),o("zpass")]});case Pn:return u(function(t){j.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return j.commandType(r,"number",s+".factor",e.commandStr),j.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return j.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case Tn:return u(function(t){var r=0;return"front"===t?r=Ri:"back"===t&&(r=Di),j.command(!!r,s,e.commandStr),r},function(t,e,r){return j.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Ri,":",Di)});case On:return u(function(t){return j.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t},function(t,e,r){return j.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+i.lineWidthDims[0]+"&&"+r+"<="+i.lineWidthDims[1],"invalid line width")}),r});case Cn:return u(function(t){return j.commandParameter(t,eo,s,e.commandStr),eo[t]},function(t,e,r){return j.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+Bi+":"+Fi)});case En:return u(function(t){return j.command(zt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return j.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),X(4,function(t){return"!!"+r+"["+t+"]"})});case Ln:return u(function(t){j.command("object"===a(t)&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return j.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return j.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),o}(t,p),k=function(t,e,n){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=r.id(i[t]);j.optional(function(){h.shader(to[t],e,j.guessCommand())});var n=ao(function(){return e});return n.id=e,n}if(t in o){var a=o[t];return so(a,function(e,r){var n=e.invoke(r,a),i=r.def(e.shared.strings,".id(",n,")");return j.optional(function(){r(e.shared.shader,".shader(",to[t],",",i,",",e.command,");")}),i})}return null}var s,u=a(Wn),l=a(Hn),c=null;return oo(u)&&oo(l)?(c=h.program(l.id,u.id,null,n),s=ao(function(t,e){return t.link(c)})):s=new io(u&&u.thisDep||l&&l.thisDep,u&&u.contextDep||l&&l.contextDep,u&&u.propDep||l&&l.propDep,function(t,e){var r,n=t.shared.shader;r=u?u.append(t,e):e.def(n,".",Wn);var i=n+".program("+(l?l.append(t,e):e.def(n,".",Hn))+","+r;return j.optional(function(){i+=","+t.command}),e.def(i+")")}),{frag:u,vert:l,progVar:s,program:c}}(t,0,v);function C(t){var e=w[t];e&&(E[t]=e)}C(Gn),C(T(zn));var O=Object.keys(E).length>0,A={framebuffer:x,draw:_,shader:k,state:E,dirty:O,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(A.profile=function(t){var e,r=t.static,n=t.dynamic;if(Un in r){var i=!!r[Un];(e=ao(function(t,e){return i})).enable=i}else if(Un in n){var o=n[Un];e=so(o,function(t,e){return t.invoke(e,o)})}return e}(t),A.uniforms=function(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,o=r[t];if("number"==typeof o||"boolean"==typeof o)n=ao(function(){return o});else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?n=ao(function(t){return t.link(o)}):"framebuffer"===a||"framebufferCube"===a?(j.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=ao(function(t){return t.link(o.color[0])})):j.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else zt(o)?n=ao(function(e){return e.global.def("[",X(o.length,function(r){return j.command("number"==typeof o[r]||"boolean"==typeof o[r],"invalid uniform "+t,e.commandStr),o[r]}),"]")}):j.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=o,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=so(e,function(t,r){return t.invoke(r,e)})}),i}(u,p),A.drawVAO=A.scopeVAO=function(t,e){var r=t.static,n=t.dynamic;if(Jn in r){var i=r[Jn];return null!==i&&null===f.getVAO(i)&&(i=f.createVAO(i)),ao(function(t){return t.link(f.getVAO(i))})}if(Jn in n){var o=n[Jn];return so(o,function(t,e){var r=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+r+")")})}return null}(t),!A.drawVAO&&k.program&&!v&&n.angle_instanced_arrays){var P=!0,M=k.program.attributes.map(function(t){var r=e.static[t];return P=P&&!!r,r});if(P&&M.length>0){var I=f.getVAO(f.createVAO(M));A.drawVAO=new io(null,null,null,function(t,e){return t.link(I)}),A.useVAO=!0}}return v?A.useVAO=!0:A.attributes=function(t,e){var n=t.static,i=t.dynamic,s={};return Object.keys(n).forEach(function(t){var i=n[t],u=r.id(t),l=new g;if(ro(i))l.state=an,l.buffer=o.getBuffer(o.create(i,oi,!1,!0)),l.type=0;else{var c=o.getBuffer(i);if(c)l.state=an,l.buffer=c,l.type=0;else if(j.command("object"===a(i)&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var f=i.constant;l.buffer="null",l.state=sn,"number"==typeof f?l.x=f:(j.command(zt(f)&&f.length>0&&f.length<=4,"invalid constant for attribute "+t,e.commandStr),nn.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',e.commandStr);var p=0|i.stride;j.command(p>=0&&p<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;j.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var y=!!i.normalized,v=0;"type"in i&&(j.commandParameter(i.type,ft,"invalid type for attribute "+t,e.commandStr),v=ft[i.type]);var m=0|i.divisor;"divisor"in i&&(j.command(0===m||b,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),j.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),j.optional(function(){var r=e.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach(function(e){j.command(n.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",r)})}),l.buffer=c,l.state=an,l.size=d,l.normalized=y,l.type=v||c.dtype,l.offset=h,l.stride=p,l.divisor=m}}s[t]=ao(function(t,e){var r=t.attribCache;if(u in r)return r[u];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[u]=n,n})}),Object.keys(i).forEach(function(t){var e=i[t];s[t]=so(e,function(r,n){var i=r.invoke(n,e),o=r.shared,a=r.constants,s=o.isBufferArgs,u=o.buffer;j.optional(function(){r.assert(n,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')});var l={isStream:n.def(!1)},c=new g;c.state=an,Object.keys(c).forEach(function(t){l[t]=n.def(""+c[t])});var f=l.buffer,h=l.type;function p(t){n(l[t],"=",i,".",t,"|0;")}return n("if(",s,"(",i,")){",l.isStream,"=true;",f,"=",u,".createStream(",oi,",",i,");",h,"=",f,".dtype;","}else{",f,"=",u,".getBuffer(",i,");","if(",f,"){",h,"=",f,".dtype;",'}else if("constant" in ',i,"){",l.state,"=",sn,";","if(typeof "+i+'.constant === "number"){',l[nn[0]],"=",i,".constant;",nn.slice(1).map(function(t){return l[t]}).join("="),"=0;","}else{",nn.map(function(t,e){return l[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",i,".buffer)){",f,"=",u,".createStream(",oi,",",i,".buffer);","}else{",f,"=",u,".getBuffer(",i,".buffer);","}",h,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",f,".dtype;",l.normalized,"=!!",i,".normalized;"),p("size"),p("offset"),p("stride"),p("divisor"),n("}}"),n.exit("if(",l.isStream,"){",u,".destroyStream(",f,");","}"),l})}),s}(e,p),A.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=ao(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=so(e,function(t,r){return t.invoke(r,e)})}),n}(c),A}function N(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(o){e.save(n,"."+o);var a=r[o].append(t,e);Array.isArray(a)?i(n,".",o,"=[",a.join(),"];"):i(n,".",o,"=",a,";")}),e(i)}function R(t,e,r,n){var i,o=t.shared,a=o.gl,s=o.framebuffer;x&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,l=t.constants,c=l.drawBuffer,f=l.backBuffer;u=r?r.append(t,e):e.def(s,".next"),n||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",Xi,",",u,".framebuffer);"),x&&e(i,".drawBuffersWEBGL(",c,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",Xi,",null);"),x&&e(i,".drawBuffersWEBGL(",f,");"),e("}",s,".cur=",u,";"),n||e("}")}function D(t,e,r){var n=t.shared,i=n.gl,o=t.current,a=t.next,s=n.current,u=n.next,l=t.cond(s,".dirty");S.forEach(function(e){var n,c,f=T(e);if(!(f in r.state))if(f in a){n=a[f],c=o[f];var h=X(w[f].length,function(t){return l.def(n,"[",t,"]")});l(t.cond(h.map(function(t,e){return t+"!=="+c+"["+e+"]"}).join("||")).then(i,".",k[f],"(",h,");",h.map(function(t,e){return c+"["+e+"]="+t}).join(";"),";"))}else{n=l.def(u,".",f);var p=t.cond(n,"!==",s,".",f);l(p),f in E?p(t.cond(n).then(i,".enable(",E[f],");").else(i,".disable(",E[f],");"),s,".",f,"=",n,";"):p(i,".",k[f],"(",n,");",s,".",f,"=",n,";")}}),0===Object.keys(r.state).length&&l(s,".dirty=false;"),e(l)}function B(t,e,r,n){var i=t.shared,o=t.current,a=i.current,s=i.gl;no(Object.keys(r)).forEach(function(i){var u=r[i];if(!n||n(u)){var l=u.append(t,e);if(E[i]){var c=E[i];oo(u)?e(s,l?".enable(":".disable(",c,");"):e(t.cond(l).then(s,".enable(",c,");").else(s,".disable(",c,");")),e(a,".",i,"=",l,";")}else if(zt(l)){var f=o[i];e(s,".",k[i],"(",l,");",l.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",k[i],"(",l,");",a,".",i,"=",l,";")}})}function F(t,e){b&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,r,n,i){var o,a,s,u=t.shared,l=t.stats,c=u.current,f=u.timer,h=r.profile;function p(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function d(t){t(o=e.def(),"=",p(),";"),"string"==typeof i?t(l,".count+=",i,";"):t(l,".count++;"),y&&(n?t(a=e.def(),"=",f,".getNumPendingQueries();"):t(f,".beginQuery(",l,");"))}function v(t){t(l,".cpuTime+=",p(),"-",o,";"),y&&(n?t(f,".pushScopeStats(",a,",",f,".getNumPendingQueries(),",l,");"):t(f,".endQuery();"))}function g(t){var r=e.def(c,".profile");e(c,".profile=",t,";"),e.exit(c,".profile=",r,";")}if(h){if(oo(h))return void(h.enable?(d(e),v(e.exit),g("true")):g("false"));g(s=h.append(t,e))}else s=e.def(c,".profile");var m=t.block();d(m),e("if(",s,"){",m,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function G(t,e,r,n,i){var o=t.shared;n.forEach(function(n){var a,s=n.name,u=r.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(uo))return;var l=t.scopeAttrib(s);j.optional(function(){t.assert(e,l+".state","missing attribute "+s)}),a={},Object.keys(new g).forEach(function(t){a[t]=e.def(l,".",t)})}!function(r,n,i){var a=o.gl,s=e.def(r,".location"),u=e.def(o.attributes,"[",s,"]"),l=i.state,c=i.buffer,f=[i.x,i.y,i.z,i.w],h=["buffer","normalized","offset","stride"];function p(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var r,o=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",o,"||",u,".size!==",r,"||",h.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",a,".bindBuffer(",oi,",",c,".buffer);",a,".vertexAttribPointer(",[s,r,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",r,";",h.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),b){var l=i.divisor;e("if(",u,".divisor!==",l,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,l],");",u,".divisor=",l,";}")}}function d(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",nn.map(function(t,e){return u+"."+t+"!=="+f[e]}).join("||"),"){",a,".vertexAttrib4f(",s,",",f,");",nn.map(function(t,e){return u+"."+t+"="+f[e]+";"}).join(""),"}")}l===an?p():l===sn?d():(e("if(",l,"===",an,"){"),p(),e("}else{"),d(),e("}"))}(t.link(n),function(t){switch(t){case bi:case Si:case Ci:return 2;case xi:case Ei:case Oi:return 3;case wi:case ki:case Ai:return 4;default:return 1}}(n.info.type),a)})}function V(t,e,n,i,o){for(var a,s=t.shared,u=s.gl,l=0;l1?e(X(x,function(t){return Array.isArray(c)?c[t]:c+"["+t+"]"})):(j(!Array.isArray(c),"uniform value must not be an array"),e(c));e(");")}}function H(t,e,r,n){var i=t.shared,o=i.gl,a=i.draw,s=n.draw;var u=function(){var i,u=s.elements,l=e;return u?((u.contextDep&&n.contextDynamic||u.propDep)&&(l=r),i=u.append(t,l)):i=l.def(a,".",qn),i&&l("if("+i+")"+o+".bindBuffer("+ai+","+i+".buffer.buffer);"),i}();function l(i){var o=s[i];return o?o.contextDep&&n.contextDynamic||o.propDep?o.append(t,r):o.append(t,e):e.def(a,".",i)}var c,f,h=l(Yn),p=l(Zn),d=function(){var i,o=s.count,u=e;return o?((o.contextDep&&n.contextDynamic||o.propDep)&&(u=r),i=o.append(t,u),j.optional(function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")})):(i=u.def(a,".",Xn),j.optional(function(){t.assert(u,i+">=0","missing vertex count")})),i}();if("number"==typeof d){if(0===d)return}else r("if(",d,"){"),r.exit("}");b&&(c=l(Kn),f=t.instancing);var y=u+".type",v=s.elements&&oo(s.elements);function g(){function t(){r(f,".drawElementsInstancedANGLE(",[h,d,y,p+"<<(("+y+"-"+on+")>>1)",c],");")}function e(){r(f,".drawArraysInstancedANGLE(",[h,p,d,c],");")}u?v?t():(r("if(",u,"){"),t(),r("}else{"),e(),r("}")):e()}function m(){function t(){r(o+".drawElements("+[h,d,y,p+"<<(("+y+"-"+on+")>>1)"]+");")}function e(){r(o+".drawArrays("+[h,p,d]+");")}u?v?t():(r("if(",u,"){"),t(),r("}else{"),e(),r("}")):e()}b&&("number"!=typeof c||c>=0)?"string"==typeof c?(r("if(",c,">0){"),g(),r("}else if(",c,"<0){"),m(),r("}")):g():m()}function W(t,e,r,n,i){var o=I(),a=o.proc("body",i);return j.optional(function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)}),b&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,r,n),o.compile().body}function q(t,e,r,n){F(t,e),r.useVAO?r.drawVAO?e(t.shared.vao,".setVAO(",r.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),G(t,e,r,n.attributes,function(){return!0})),V(t,e,r,n.uniforms,function(){return!0}),H(t,e,e,r)}function Y(t,e,r,n){function i(){return!0}t.batchId="a1",F(t,e),G(t,e,r,n.attributes,i),V(t,e,r,n.uniforms,i),H(t,e,e,r)}function Z(t,e,r,n){F(t,e);var i=r.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function l(t){return t.contextDep&&i||t.propDep}function c(t){return!l(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),r.needsContext&&N(t,u,r.context),r.needsFramebuffer&&R(t,u,r.framebuffer),B(t,u,r.state,l),r.profile&&l(r.profile)&&z(t,u,r,!1,!0),n)r.useVAO?r.drawVAO?l(r.drawVAO)?u(t.shared.vao,".setVAO(",r.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",r.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),G(t,s,r,n.attributes,c),G(t,u,r,n.attributes,l)),V(t,s,r,n.uniforms,c),V(t,u,r,n.uniforms,l),H(t,s,u,r);else{var f=t.global.def("{}"),h=r.shader.progVar.append(t,u),p=u.def(h,".id"),d=u.def(f,"[",p,"]");u(t.shared.gl,".useProgram(",h,".program);","if(!",d,"){",d,"=",f,"[",p,"]=",t.link(function(e){return W(Y,t,r,e,2)}),"(",h,");}",d,".call(this,a0[",o,"],",o,");")}}function K(t,e,r){var n=e.static[r];if(n&&function(t){if("object"===a(t)&&!zt(t)){for(var e=Object.keys(t),r=0;r0&&r(t.shared.current,".dirty=true;")}(s,u),function(t,e){var n=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(r){var o=e.shader[r];o&&n.set(i.shader,"."+r,o.append(t,n))}N(t,n,e.context),e.framebuffer&&e.framebuffer.append(t,n),no(Object.keys(e.state)).forEach(function(r){var o=e.state[r].append(t,n);zt(o)?o.forEach(function(e,i){n.set(t.next[r],"["+i+"]",e)}):n.set(i.next,"."+r,o)}),z(t,n,e,!0,!0),[qn,Zn,Xn,Kn,Yn].forEach(function(r){var o=e.draw[r];o&&n.set(i.draw,"."+r,""+o.append(t,n))}),Object.keys(e.uniforms).forEach(function(o){var a=e.uniforms[o].append(t,n);Array.isArray(a)&&(a="["+a.join()+"]"),n.set(i.uniforms,"["+r.id(o)+"]",a)}),Object.keys(e.attributes).forEach(function(r){var i=e.attributes[r].append(t,n),o=t.scopeAttrib(r);Object.keys(new g).forEach(function(t){n.set(o,"."+t,i[t])})}),e.scopeVAO&&n.set(i.vao,".targetVAO",e.scopeVAO.append(t,n)),a(Hn),a(Wn),Object.keys(e.state).length>0&&(n(o,".dirty=true;"),n.exit(o,".dirty=true;")),n("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var r=t.proc("batch",2);t.batchId="0",F(t,r);var n=!1,i=!0;Object.keys(e.context).forEach(function(t){n=n||e.context[t].propDep}),n||(N(t,r,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&n||t.propDep}o?(o.propDep?n=a=!0:o.contextDep&&n&&(a=!0),a||R(t,r,o)):R(t,r,null),e.state.viewport&&e.state.viewport.propDep&&(n=!0),D(t,r,e),B(t,r,e.state,function(t){return!s(t)}),e.profile&&s(e.profile)||z(t,r,e,!1,"a1"),e.contextDep=n,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&n||u.propDep)Z(t,r,e,null);else{var l=u.append(t,r);if(r(t.shared.gl,".useProgram(",l,".program);"),e.shader.program)Z(t,r,e,e.shader.program);else{r(t.shared.vao,".setVAO(null);");var c=t.global.def("{}"),f=r.def(l,".id"),h=r.def(c,"[",f,"]");r(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",c,"[",f,"]=",t.link(function(r){return W(Z,t,e,r,2)}),"(",l,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var co=34918,fo=34919,ho=35007,po=function(t,e){if(!e.ext_disjoint_timer_query)return null;var r=[];function n(t){r.push(t)}var i=[];var o=[];function a(t){o.push(t)}var s=[];function u(t,e,r){var n=o.pop()||new function(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null};n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,s.push(n)}var l=[],c=[];return{beginQuery:function(t){var n=r.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(ho,n),i.push(n),u(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(ho)},pushScopeStats:u,update:function(){var t,r,o=i.length;if(0!==o){c.length=Math.max(c.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,c[0]=0;var u=0;for(t=0,r=0;r0)if(Array.isArray(r[0])){s=dt(r);for(var c=1,f=1;f0)if("number"==typeof e[0]){var o=it.allocType(h.dtype,e.length);wt(o,e),d(o,i),it.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){n=dt(e);var a=pt(e,n,h.dtype);d(a,i),it.freeType(a)}else j.raise("invalid buffer data")}else if(at(e)){n=e.shape;var s=e.stride,u=0,l=0,c=0,f=0;1===n.length?(u=n[0],l=1,c=s[0],f=0):2===n.length?(u=n[0],l=n[1],c=s[0],f=s[1]):j.raise("invalid shape");var y=Array.isArray(e.data)?h.dtype:xt(e.data),v=it.allocType(y,u*l);_t(v,e.data,u,l,c,f,e.offset),d(v,i),it.freeType(v)}else j.raise("invalid data for buffer subdata");return p},n.profile&&(p.stats=h.stats),p.destroy=function(){f(h)},p},createStream:function(t,e){var r=u.pop();return r||(r=new s(t)),r.bind(),c(r,e,vt,0,1,!1),r},destroyStream:function(t){u.push(t)},clear:function(){st(a).forEach(f),u.forEach(f)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){st(a).forEach(function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)})},_initBuffer:c}}(i,h,n,function(t){return w.destroyBuffer(t)}),w=function(e,r,n,i,o){for(var a=n.maxAttributes,s=new Array(a),u=0;u0,"must specify at least one attribute");var i={},u=n.attributes;u.length=e.length;for(var l=0;l=p.byteLength?c.subdata(p):(c.destroy(),n.buffers[l]=null)),n.buffers[l]||(c=n.buffers[l]=o.create(f,Vr,!1,!0)),h.buffer=o.getBuffer(c),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1,i[l]=1):o.getBuffer(f)?(h.buffer=o.getBuffer(f),h.size=0|h.buffer.dimension,h.normalized=!1,h.type=h.buffer.dtype,h.offset=0,h.stride=0,h.divisor=0,h.state=1):o.getBuffer(f.buffer)?(h.buffer=o.getBuffer(f.buffer),h.size=0|(+f.size||h.buffer.dimension),h.normalized=!!f.normalized||!1,"type"in f?(j.parameter(f.type,ft,"invalid buffer type"),h.type=ft[f.type]):h.type=h.buffer.dtype,h.offset=0|(f.offset||0),h.stride=0|(f.stride||0),h.divisor=0|(f.divisor||0),h.state=1,j(h.size>=1&&h.size<=4,"size must be between 1 and 4"),j(h.offset>=0,"invalid offset"),j(h.stride>=0&&h.stride<=255,"stride must be between 0 and 255"),j(h.divisor>=0,"divisor must be positive"),j(!h.divisor||!!r.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in f?(j(l>0,"first attribute must not be a constant"),h.x=+f.x||0,h.y=+f.y||0,h.z=+f.z||0,h.w=+f.w||0,h.state=2):j(!1,"invalid attribute spec for location "+l)}for(var d=0;d>=1:f===It&&(p>>=2)),i.vertCount=p;var d=s;if(s<0){d=Tt;var y=i.buffer.dimension;1===y&&(d=Et),2===y&&(d=kt),3===y&&(d=Tt)}i.primType=d}function f(t){i.elementsCount--,j(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,r){var o=n.create(null,Lt,!0),a=new u(o._buffer);function l(e){if(e)if("number"==typeof e)o(e),a.primType=Tt,a.vertCount=0|e,a.type=Ot;else{var r=null,n=Nt,i=-1,u=-1,f=0,h=0;Array.isArray(e)||t(e)||at(e)?r=e:(j.type(e,"object","invalid arguments for elements"),"data"in e&&(r=e.data,j(Array.isArray(r)||t(r)||at(r),"invalid data for element buffer")),"usage"in e&&(j.parameter(e.usage,ht,"invalid element buffer usage"),n=ht[e.usage]),"primitive"in e&&(j.parameter(e.primitive,St,"invalid element buffer primitive"),i=St[e.primitive]),"count"in e&&(j("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(j.parameter(e.type,s,"invalid buffer type"),h=s[e.type]),"length"in e?f=0|e.length:(f=u,h===Pt||h===At?f*=2:h!==It&&h!==Mt||(f*=4))),c(a,r,n,i,u,f,h)}else o(),a.primType=Tt,a.vertCount=0,a.type=Ot;return l}return i.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(t,e){return o.subdata(t,e),l},l.destroy=function(){f(a)},l},createStream:function(t){var e=l.pop();return e||(e=new u(n.create(null,Lt,!0,!1)._buffer)),c(e,t,jt,-1,-1,0,0),e},destroyStream:function(t){l.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){st(o).forEach(f)}}}(i,p,x,h),S=Zr(i,f,h,n),E=mr(i,p,b,function(){C.procs.poll()},m,h,n),k=Sr(i,p,b,h,n),T=function(t,r,n,i,o,s){var u={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var f=["uint8"];function h(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=0,i=0;e?(n=e.width,i=e.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function p(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,r){if(t)if(t.texture){var n=t.texture._texture,i=Math.max(1,n.width),o=Math.max(1,n.height);j(i===e&&o===r,"inconsistent width/height for supplied texture"),n.refCount+=1}else{var a=t.renderbuffer._renderbuffer;j(a.width===e&&a.height===r,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function y(e,r){r&&(r.texture?t.framebufferTexture2D(Er,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(Er,e,kr,r.renderbuffer._renderbuffer.renderbuffer))}function v(t){var e=Tr,r=null,n=null,i=t;"object"===a(t)&&(i=t.data,"target"in t&&(e=0|t.target)),j.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(r=i,j(e===Tr)):"textureCube"===o?(r=i,j(e>=Cr&&e=2,"invalid shape for framebuffer"),s=M[0],h=M[1]}else"radius"in P&&(s=h=P.radius),"width"in P&&(s=P.width),"height"in P&&(h=P.height);("color"in P||"colors"in P)&&(b=P.color||P.colors,Array.isArray(b)&&j(1===b.length||r.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in P&&(E=0|P.colorCount,j(E>0,"invalid color buffer count")),"colorTexture"in P&&(x=!!P.colorTexture,w="rgba4"),"colorType"in P&&(_=P.colorType,x?(j(r.oes_texture_float||!("float"===_||"float32"===_),"you must enable OES_texture_float in order to use floating point framebuffer objects"),j(r.oes_texture_half_float||!("half float"===_||"float16"===_),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===_||"float16"===_?(j(r.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),w="rgba16f"):"float"!==_&&"float32"!==_||(j(r.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),w="rgba32f"),j.oneOf(_,f,"invalid color type")),"colorFormat"in P&&(w=P.colorFormat,l.indexOf(w)>=0?x=!0:c.indexOf(w)>=0?x=!1:x?j.oneOf(P.colorFormat,l,"invalid color format for texture"):j.oneOf(P.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in P||"depthStencilTexture"in P)&&(A=!(!P.depthTexture&&!P.depthStencilTexture),j(!A||r.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in P&&("boolean"==typeof P.depth?p=P.depth:(T=P.depth,y=!1)),"stencil"in P&&("boolean"==typeof P.stencil?y=P.stencil:(C=P.stencil,p=!1)),"depthStencil"in P&&("boolean"==typeof P.depthStencil?p=y=P.depthStencil:(O=P.depthStencil,p=!1,y=!1))}else s=h=1;var I=null,L=null,N=null,R=null;if(Array.isArray(b))I=b.map(v);else if(b)I=[v(b)];else for(I=new Array(E),i=0;i=0||I[i].renderbuffer&&zr.indexOf(I[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),I[i]&&I[i].texture){var B=Nr[I[i].texture._texture.format]*Rr[I[i].texture._texture.type];null===D?D=B:j(D===B,"all color attachments much have the same number of bits per pixel.")}return d(L,s,h),j(!L||L.texture&&L.texture._texture.format===Lr||L.renderbuffer&&L.renderbuffer._renderbuffer.format===Dr,"invalid depth attachment for framebuffer object"),d(N,s,h),j(!N||N.renderbuffer&&N.renderbuffer._renderbuffer.format===Br,"invalid stencil attachment for framebuffer object"),d(R,s,h),j(!R||R.texture&&R.texture._texture.format===Fr||R.renderbuffer&&R.renderbuffer._renderbuffer.format===Fr,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=s,o.height=h,o.colorAttachments=I,o.depthAttachment=L,o.stencilAttachment=N,o.depthStencilAttachment=R,a.color=I.map(m),a.depth=m(L),a.stencil=m(N),a.depthStencil=m(R),a.width=o.width,a.height=o.height,k(o),a}return s.framebufferCount++,a(t,i),e(a,{resize:function(t,e){j(u.next!==o,"can not resize a framebuffer which is currently in use");var r=Math.max(0|t,1),n=Math.max(0|e||r,1);if(r===o.width&&n===o.height)return a;for(var i=o.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),j(m[0]===m[1],"cube framebuffer must be square"),h=m[0]}else"radius"in g&&(h=0|g.radius),"width"in g?(h=0|g.width,"height"in g&&j(g.height===h,"must be square")):"height"in g&&(h=0|g.height);("color"in g||"colors"in g)&&(p=g.color||g.colors,Array.isArray(p)&&j(1===p.length||r.webgl_draw_buffers,"multiple render targets not supported")),p||("colorCount"in g&&(v=0|g.colorCount,j(v>0,"invalid color buffer count")),"colorType"in g&&(j.oneOf(g.colorType,f,"invalid color type"),y=g.colorType),"colorFormat"in g&&(d=g.colorFormat,j.oneOf(g.colorFormat,l,"invalid color format for texture"))),"depth"in g&&(c.depth=g.depth),"stencil"in g&&(c.stencil=g.stencil),"depthStencil"in g&&(c.depthStencil=g.depthStencil)}else h=1;if(p)if(Array.isArray(p))for(s=[],n=0;n0&&(c.depth=o[0].depth,c.stencil=o[0].stencil,c.depthStencil=o[0].depthStencil),o[n]?o[n](c):o[n]=T(c)}return e(a,{width:h,height:h,color:s})}return a(t),e(a,{faces:o,resize:function(t){var e,r=0|t;if(j(r>0&&r<=n.maxCubeMapSize,"invalid radius for cube fbo"),r===a.width)return a;var i=a.color;for(e=0;e=0;--t){var e=M[t];e&&e(m,null,0)}i.flush(),d&&d.update()}function B(){!R&&M.length>0&&(R=V.next(D))}function F(){R&&(V.cancel(D),R=null)}function z(t){t.preventDefault(),s=!0,F(),I.forEach(function(t){t()})}function G(t){i.getError(),s=!1,u.restore(),S.restore(),x.restore(),E.restore(),k.restore(),T.restore(),w.restore(),d&&d.restore(),C.procs.refresh(),B(),L.forEach(function(t){t()})}function W(t){function r(t,e){var r={},n={};return Object.keys(t).forEach(function(i){var o=t[i];if(U.isDynamic(o))n[i]=U.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a0)return f.call(this,function(t){for(;p.length=0,"cannot cancel a frame twice"),M[e]=function t(){var e=Eo(M,t);M[e]=M[M.length-1],M.length-=1,M.length<=0&&F()}}}}function K(){var t=A.viewport,e=A.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function J(){m.tick+=1,m.time=$(),K(),C.procs.poll()}function Q(){E.refresh(),K(),C.procs.refresh(),d&&d.update()}function $(){return(H()-y)/1e3}Q();var tt=e(W,{clear:function(t){if(j("object"===a(t)&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var r=0;r<6;++r)q(e({framebuffer:t.framebuffer.faces[r]},t),X);else q(t,X);else X(0,t)},prop:U.define.bind(null,wo),context:U.define.bind(null,_o),this:U.define.bind(null,So),draw:W({}),buffer:function(t){return x.create(t,mo,!1,!1)},elements:function(t){return _.create(t,!1)},texture:E.create2D,cube:E.createCube,renderbuffer:k.create,framebuffer:T.create,framebufferCube:T.createCube,vao:w.createVAO,attributes:o,frame:Z,on:function(t,e){var r;switch(j.type(e,"function","listener callback must be a function"),t){case"frame":return Z(e);case"lost":r=I;break;case"restore":r=L;break;case"destroy":r=N;break;default:j.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(e),{cancel:function(){for(var t=0;t=0},read:O,destroy:function(){M.length=0,F(),P&&(P.removeEventListener(bo,z),P.removeEventListener(xo,G)),S.clear(),T.clear(),k.clear(),E.clear(),_.clear(),x.clear(),w.clear(),d&&d.clear(),N.forEach(function(t){t()})},_gl:i,_refresh:Q,poll:function(){J(),d&&d.update()},now:$,stats:h});return n.onDone(null,tt),tt}},"object"===a(e)?t.exports=o():void 0===(i="function"==typeof(n=o)?n.call(e,r,e,t):n)||(t.exports=i)},7742:function(t,e,r){"use strict";var n=r(1897),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],r=0,a=t.length;r1&&void 0!==arguments[1]?arguments[1]:{};if(i=Object.assign({},n,i),!t||"string"!=typeof t)return t;var o=t.trim();if(void 0!==i.skipLike&&i.skipLike.test(o))return t;if(i.hex&&e.test(o))return Number.parseInt(o,16);var a=r.exec(o);if(a){var s=a[1],u=a[2],l=function(t){return t&&-1!==t.indexOf(".")?("."===(t=t.replace(/0+$/,""))?t="0":"."===t[0]?t="0"+t:"."===t[t.length-1]&&(t=t.substr(0,t.length-1)),t):t}(a[3]),c=a[4]||a[6];if(!i.leadingZeros&&u.length>0&&s&&"."!==o[2])return t;if(!i.leadingZeros&&u.length>0&&!s&&"."!==o[1])return t;var f=Number(o),h=""+f;return-1!==h.search(/[eE]/)?i.eNotation?f:t:c?i.eNotation?f:t:-1!==o.indexOf(".")?"0"===h&&""===l?f:h===l?f:s&&h==="-"+l?f:t:u?l===h?f:s+l===h?f:t:o===h?f:o===s+h?f:t}return t}},5400:function(t,e,r){var n,i;function o(t){"@babel/helpers - typeof";return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(a,s){"use strict";"object"===o(t)&&t.exports?t.exports=s():void 0===(i="function"==typeof(n=s)?n.call(e,r,e,t):n)||(t.exports=i)}(0,function(t){"use strict";var e=t&&t.IPv6;return{best:function(t){var e,r,n=t.toLowerCase().split(":"),i=n.length,o=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[i-1]&&""===n[i-2]&&n.pop(),-1!==n[(i=n.length)-1].indexOf(".")&&(o=7),e=0;e1;s++)r.splice(0,1);n[a]=r.join("")}var u=-1,l=0,c=0,f=-1,h=!1;for(a=0;al&&(u=f,l=c)):"0"===n[a]&&(h=!0,f=a,c=1);c>l&&(u=f,l=c),l>1&&n.splice(u,l,""),i=n.length;var p="";for(""===n[0]&&(p=":"),a=0;a=t.length-1)return!1;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return!1;var i=r.list[t.slice(e+1)];return!!i&&i.indexOf(" "+t.slice(n+1,e)+" ")>=0},is:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return!1;if(t.lastIndexOf(".",e-1)>=0)return!1;var n=r.list[t.slice(e+1)];return!!n&&n.indexOf(" "+t.slice(0,e)+" ")>=0},get:function(t){var e=t.lastIndexOf(".");if(e<=0||e>=t.length-1)return null;var n=t.lastIndexOf(".",e-1);if(n<=0||n>=e-1)return null;var i=r.list[t.slice(e+1)];return i?i.indexOf(" "+t.slice(n+1,e)+" ")<0?null:t.slice(n+1):null},noConflict:function(){return t.SecondLevelDomains===this&&(t.SecondLevelDomains=e),this}};return r})},7411:function(t,e,r){var n,i,o;function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t=r.nmd(t),function(s,u){"use strict";"object"===a(t)&&t.exports?t.exports=u(r(9018),r(5400),r(2714)):(i=[r(9018),r(5400),r(2714)],void 0===(o="function"==typeof(n=u)?n.apply(e,i):n)||(t.exports=o))}(0,function(t,e,r,n){"use strict";var i=n&&n.URI;function o(t,e){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof o))return r?n?new o(t,e):new o(t):new o;if(void 0===t){if(r)throw new TypeError("undefined is not a valid argument for URI");t="undefined"!=typeof location?location.href+"":""}if(null===t&&r)throw new TypeError("null is not a valid argument for URI");return this.href(t),void 0!==e?this.absoluteTo(e):this}o.version="1.19.11";var s=o.prototype,u=Object.prototype.hasOwnProperty;function l(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(t){return void 0===t?"Undefined":String(Object.prototype.toString.call(t)).slice(8,-1)}function f(t){return"Array"===c(t)}function h(t,e){var r,n,i={};if("RegExp"===c(e))i=null;else if(f(e))for(r=0,n=e.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(t){if(t&&t.nodeName){var e=t.nodeName.toLowerCase();if("input"!==e||"image"===t.type)return o.domAttributes[e]}},o.encode=g,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=g,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(t,e){var r=o.encode(t+"");return void 0===e&&(e=o.escapeQuerySpace),e?r.replace(/%20/g,"+"):r},o.decodeQuery=function(t,e){t+="",void 0===e&&(e=o.escapeQuerySpace);try{return o.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};var m,b={encode:"encode",decode:"decode"},x=function(t,e){return function(r){try{return o[e](r+"").replace(o.characters[t][e].expression,function(r){return o.characters[t][e].map[r]})}catch(t){return r}}};for(m in b)o[m+"PathSegment"]=x("pathname",b[m]),o[m+"UrnPathSegment"]=x("urnpath",b[m]);var w=function(t,e,r){return function(n){var i;i=r?function(t){return o[e](o[r](t))}:o[e];for(var a=(n+"").split(t),s=0,u=a.length;s-1&&(e.fragment=t.substring(r+1)||null,t=t.substring(0,r)),(r=t.indexOf("?"))>-1&&(e.query=t.substring(r+1)||null,t=t.substring(0,r)),"//"===(t=(t=t.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(e.protocol=null,t=t.substring(2),t=o.parseAuthority(t,e)):(r=t.indexOf(":"))>-1&&(e.protocol=t.substring(0,r)||null,e.protocol&&!e.protocol.match(o.protocol_expression)?e.protocol=void 0:"//"===t.substring(r+1,r+3).replace(/\\/g,"/")?(t=t.substring(r+3),t=o.parseAuthority(t,e)):(t=t.substring(r+1),e.urn=!0)),e.path=t,e},o.parseHost=function(t,e){t||(t="");var r,n,i=(t=t.replace(/\\/g,"/")).indexOf("/");if(-1===i&&(i=t.length),"["===t.charAt(0))r=t.indexOf("]"),e.hostname=t.substring(1,r)||null,e.port=t.substring(r+2,i)||null,"/"===e.port&&(e.port=null);else{var a=t.indexOf(":"),s=t.indexOf("/"),u=t.indexOf(":",a+1);-1!==u&&(-1===s||u-1?i:t.length-1);return a>-1&&(-1===i||a-1?p.slice(0,d)+p.slice(d).replace(a,""):p.replace(a,"")).length<=l[0].length||r.ignore&&r.ignore.test(p))){var g=e(p,c,h=c+p.length,t);void 0!==g?(g=String(g),t=t.slice(0,c)+g+t.slice(h),n.lastIndex=c+g.length):n.lastIndex=h}}return n.lastIndex=0,t},o.ensureValidHostname=function(e,r){var n=!!e,i=!1;if(!!r&&(i=p(o.hostProtocols,r)),i&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(e&&e.match(o.invalid_hostname_characters)){if(!t)throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(t.toASCII(e).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(t){if(t){var e=Number(t);if(!(/^[0-9]+$/.test(e)&&e>0&&e<65536))throw new TypeError('Port "'+t+'" is not a valid port')}},o.noConflict=function(t){if(t){var e={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(e.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(e.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(e.SecondLevelDomains=n.SecondLevelDomains.noConflict()),e}return n.URI===this&&(n.URI=i),this},s.build=function(t){return!0===t?this._deferred_build=!0:(void 0===t||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new o(this)},s.valueOf=s.toString=function(){return this.build(!1)._string},s.protocol=_("protocol"),s.username=_("username"),s.password=_("password"),s.hostname=_("hostname"),s.port=_("port"),s.query=S("query","?"),s.fragment=S("fragment","#"),s.search=function(t,e){var r=this.query(t,e);return"string"==typeof r&&r.length?"?"+r:r},s.hash=function(t,e){var r=this.fragment(t,e);return"string"==typeof r&&r.length?"#"+r:r},s.pathname=function(t,e){if(void 0===t||!0===t){var r=this._parts.path||(this._parts.hostname?"/":"");return t?(this._parts.urn?o.decodeUrnPath:o.decodePath)(r):r}return this._parts.urn?this._parts.path=t?o.recodeUrnPath(t):"":this._parts.path=t?o.recodePath(t):"/",this.build(!e),this},s.path=s.pathname,s.href=function(t,e){var r;if(void 0===t)return this.toString();this._string="",this._parts=o._parts();var n=t instanceof o,i="object"===a(t)&&(t.hostname||t.path||t.pathname);t.nodeName&&(t=t[o.getDomAttribute(t)]||"",i=!1);if(!n&&i&&void 0!==t.pathname&&(t=t.toString()),"string"==typeof t||t instanceof String)this._parts=o.parse(String(t),this._parts);else{if(!n&&!i)throw new TypeError("invalid input");var s=n?t._parts:t;for(r in s)"query"!==r&&u.call(this._parts,r)&&(this._parts[r]=s[r]);s.query&&this.query(s.query,!1)}return this.build(!e),this},s.is=function(t){var e=!1,n=!1,i=!1,a=!1,s=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,n=o.ip4_expression.test(this._parts.hostname),i=o.ip6_expression.test(this._parts.hostname),s=(a=!(e=n||i))&&r&&r.has(this._parts.hostname),u=a&&o.idn_expression.test(this._parts.hostname),l=a&&o.punycode_expression.test(this._parts.hostname)),t.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return a;case"sld":return s;case"ip":return e;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return i;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var E=s.protocol,k=s.port,T=s.hostname;s.protocol=function(t,e){if(t&&!(t=t.replace(/:(\/\/)?$/,"")).match(o.protocol_expression))throw new TypeError('Protocol "'+t+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return E.call(this,t,e)},s.scheme=s.protocol,s.port=function(t,e){return this._parts.urn?void 0===t?"":this:(void 0!==t&&(0===t&&(t=null),t&&(":"===(t+="").charAt(0)&&(t=t.substring(1)),o.ensureValidPort(t))),k.call(this,t,e))},s.hostname=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0!==t){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==o.parseHost(t,r))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');t=r.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(t,this._parts.protocol)}return T.call(this,t,e)},s.origin=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=o(t);return this.protocol(n.protocol()).authority(n.authority()).build(!e),this},s.host=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?o.buildHost(this._parts):"";if("/"!==o.parseHost(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.authority=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t)return this._parts.hostname?o.buildAuthority(this._parts):"";if("/"!==o.parseAuthority(t,this._parts))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-]');return this.build(!e),this},s.userinfo=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){var r=o.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==t[t.length-1]&&(t+="@"),o.parseUserinfo(t,this._parts),this.build(!e),this},s.resource=function(t,e){var r;return void 0===t?this.path()+this.search()+this.hash():(r=o.parse(t),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!e),this)},s.subdomain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,i=this._parts.hostname.substring(0,n),a=new RegExp("^"+l(i));if(t&&"."!==t.charAt(t.length-1)&&(t+="."),-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");return t&&o.ensureValidHostname(t,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(a,t),this.build(!e),this},s.domain=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(e).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!t)throw new TypeError("cannot set domain empty");if(-1!==t.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(t,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=t;else{var i=new RegExp(l(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(i,t)}return this.build(!e),this},s.tld=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("boolean"==typeof t&&(e=t,t=void 0),void 0===t){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),i=this._parts.hostname.substring(n+1);return!0!==e&&r&&r.list[i.toLowerCase()]&&r.get(this._parts.hostname)||i}var o;if(!t)throw new TypeError("cannot set TLD empty");if(t.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(t))throw new TypeError('TLD "'+t+'" contains characters other than [A-Z0-9]');o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,t)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");o=new RegExp(l(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(o,t)}return this.build(!e),this},s.directory=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return t?o.decodePath(n):n}var i=this._parts.path.length-this.filename().length,a=this._parts.path.substring(0,i),s=new RegExp("^"+l(a));return this.is("relative")||(t||(t="/"),"/"!==t.charAt(0)&&(t="/"+t)),t&&"/"!==t.charAt(t.length-1)&&(t+="/"),t=o.recodePath(t),this._parts.path=this._parts.path.replace(s,t),this.build(!e),this},s.filename=function(t,e){if(this._parts.urn)return void 0===t?"":this;if("string"!=typeof t){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return t?o.decodePathSegment(n):n}var i=!1;"/"===t.charAt(0)&&(t=t.substring(1)),t.match(/\.?\//)&&(i=!0);var a=new RegExp(l(this.filename())+"$");return t=o.recodePath(t),this._parts.path=this._parts.path.replace(a,t),i?this.normalizePath(e):this.build(!e),this},s.suffix=function(t,e){if(this._parts.urn)return void 0===t?"":this;if(void 0===t||!0===t){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,i=this.filename(),a=i.lastIndexOf(".");return-1===a?"":(r=i.substring(a+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",t?o.decodePathSegment(n):n)}"."===t.charAt(0)&&(t=t.substring(1));var s,u=this.suffix();if(u)s=t?new RegExp(l(u)+"$"):new RegExp(l("."+u)+"$");else{if(!t)return this;this._parts.path+="."+o.recodePath(t)}return s&&(t=o.recodePath(t),this._parts.path=this._parts.path.replace(s,t)),this.build(!e),this},s.segment=function(t,e,r){var n=this._parts.urn?":":"/",i=this.path(),o="/"===i.substring(0,1),a=i.split(n);if(void 0!==t&&"number"!=typeof t&&(r=e,e=t,t=void 0),void 0!==t&&"number"!=typeof t)throw new Error('Bad segment "'+t+'", must be 0-based integer');if(o&&a.shift(),t<0&&(t=Math.max(a.length+t,0)),void 0===e)return void 0===t?a:a[t];if(null===t||void 0===a[t])if(f(e)){a=[];for(var s=0,u=e.length;s= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=h-p,k=Math.floor,T=String.fromCharCode;function C(t){throw new RangeError(S[t])}function O(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function A(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+O((t=t.replace(_,".")).split("."),e).join(".")}function P(t){for(var e,r,n=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=T((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=T(t)}).join("")}function I(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function L(t,e,r){var n=0;for(t=r?k(t/v):t>>1,t+=k(t/e);t>E*d>>1;n+=h)t=k(t/E);return k(n+(E+1)*t/(t+y))}function j(t){var e,r,n,i,o,a,s,u,l,c,y,v=[],x=t.length,w=0,_=m,S=g;for((r=t.lastIndexOf(b))<0&&(r=0),n=0;n=128&&C("not-basic"),v.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=x&&C("invalid-input"),((u=(y=t.charCodeAt(i++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:h)>=h||u>k((f-w)/a))&&C("overflow"),w+=u*a,!(u<(l=s<=S?p:s>=S+d?d:s-S));s+=h)a>k(f/(c=h-l))&&C("overflow"),a*=c;S=L(w-o,e=v.length+1,0==o),k(w/e)>f-_&&C("overflow"),_+=k(w/e),w%=e,v.splice(w++,0,_)}return M(v)}function N(t){var e,r,n,i,o,a,s,u,l,c,y,v,x,w,_,S=[];for(v=(t=P(t)).length,e=m,r=0,o=g,a=0;a=e&&yk((f-r)/(x=n+1))&&C("overflow"),r+=(s-e)*x,e=s,a=0;af&&C("overflow"),y==e){for(u=r,l=h;!(u<(c=l<=o?p:l>=o+d?d:l-o));l+=h)_=u-c,w=h-c,S.push(T(I(c+_%w,0))),u=k(_/w);S.push(T(I(u,0))),o=L(r,x,n==i),r=0,++n}++r,++e}return S.join("")}if(l={version:"1.3.2",ucs2:{decode:P,encode:M},decode:j,encode:N,toASCII:function(t){return A(t,function(t){return w.test(t)?"xn--"+N(t):t})},toUnicode:function(t){return A(t,function(t){return x.test(t)?j(t.slice(4).toLowerCase()):t})}},"object"==i(r.amdO)&&r.amdO)void 0===(n=function(){return l}.call(e,r,e,t))||(t.exports=n);else if(a&&s)if(t.exports==a)s.exports=l;else for(c in l)l.hasOwnProperty(c)&&(a[c]=l[c]);else o.punycode=l}(this)},4539:function(){"use strict"},2617:function(t,e,r){"use strict";var n={};r.r(n),r.d(n,{GADDI:function(){return cS},Stack:function(){return fS},breadthFirstSearch:function(){return r_},connectedComponent:function(){return o_},cosineSimilarity:function(){return j_},default:function(){return pS},depthFirstSearch:function(){return c_},detectAllCycles:function(){return p_},detectAllDirectedCycle:function(){return h_},detectAllUndirectedCycle:function(){return f_},detectCycle:function(){return d_},detectDirectedCycle:function(){return hS},dijkstra:function(){return y_},findAllPath:function(){return b_},findShortestPath:function(){return m_},floydWarshall:function(){return x_},getAdjMatrix:function(){return Xw},getDegree:function(){return s_},getInDegree:function(){return u_},getNeighbors:function(){return $w},getOutDegree:function(){return l_},iLouvain:function(){return P_},kCore:function(){return M_},kMeans:function(){return L_},labelPropagation:function(){return w_},louvain:function(){return A_},minimumSpanningTree:function(){return G_},nodesCosineSimilarity:function(){return N_},pageRank:function(){return U_}});var i={};r.r(i),r.d(i,{Line:function(){return zS},applyMatrix:function(){return ES},compare:function(){return mS},distance:function(){return CS},floydWarshall:function(){return AS},fractionToLine:function(){return HS},getAdjMatrix:function(){return PS},getBBoxBoundLine:function(){return GS},getCircleCenterByPoints:function(){return TS},getCircleIntersectByPoint:function(){return _S},getDegree:function(){return NS},getEllipseIntersectByPoint:function(){return SS},getLineIntersect:function(){return xS},getPointsCenter:function(){return WS},getRectIntersectByPoint:function(){return wS},intersectBBox:function(){return BS},invertMatrix:function(){return kS},isPointInPolygon:function(){return DS},isPointsOverlap:function(){return XS},isPolygonsIntersect:function(){return FS},itemIntersectByLine:function(){return VS},lerp:function(){return JS},lerpArray:function(){return QS},move:function(){return IS},pointLineDistance:function(){return KS},pointLineSquareDist:function(){return YS},pointRectSquareDist:function(){return ZS},rotate:function(){return jS},scale:function(){return LS},scaleMatrix:function(){return OS},squareDist:function(){return qS},translate:function(){return MS}});var o={};r.r(o),r.d(o,{cloneBesidesImg:function(){return SE},getAnimateCfgWithCallback:function(){return EE},getBBox:function(){return fE},getComboBBox:function(){return wE},getLabelPosition:function(){return pE},getLetterWidth:function(){return vE},getLoopCfgs:function(){return hE},getTextSize:function(){return gE},plainCombosToTrees:function(){return bE},reconstructTree:function(){return xE},shouldRefreshEdge:function(){return _E},traverseTree:function(){return dE},traverseTreeUp:function(){return yE},truncateLabelByLength:function(){return mE}});var a={};r.r(a),r.d(a,{calculationItemsBBox:function(){return jE},cloneEvent:function(){return ME},formatPadding:function(){return PE},isNaN:function(){return LE},isViewportChanged:function(){return IE},processParallelEdges:function(){return NE},uniqueId:function(){return AE}});var s={};r.r(s),r.d(s,{getClosedSpline:function(){return lk},getControlPoint:function(){return ak},getSpline:function(){return ok},getStarPath:function(){return yk},paddedHull:function(){return dk},pathToPoints:function(){return uk},pointsToPolygon:function(){return sk},roundedHull:function(){return pk}});var u={};r.r(u),r.d(u,{defaultSubjectColors:function(){return Hk}});var l={};r.r(l),r.d(l,{isForce:function(){return Wk}});var c={};r.r(c),r.d(c,{Base:function(){return RT},Circle:function(){return DT},Ellipse:function(){return FT},Image:function(){return GT},Line:function(){return HT},Marker:function(){return qT},Path:function(){return rC},Polygon:function(){return iC},Polyline:function(){return oC},Rect:function(){return aC},Text:function(){return sC}});var f={};r.r(f),r.d(f,{Canvas:function(){return cC},Group:function(){return NT},Shape:function(){return c},getArcParams:function(){return yT},version:function(){return fC}});var h={};r.r(h),r.d(h,{Base:function(){return _C},Circle:function(){return SC},Dom:function(){return EC},Ellipse:function(){return kC},Image:function(){return TC},Line:function(){return CC},Marker:function(){return PC},Path:function(){return MC},Polygon:function(){return IC},Polyline:function(){return LC},Rect:function(){return jC},Text:function(){return FC}});var p={};r.r(p),r.d(p,{Canvas:function(){return nO},Group:function(){return wC},Shape:function(){return h},version:function(){return iO}});var d={};r.r(d),r.d(d,{getColorSetsBySubjectColors:function(){return aA},getColorsWithSubjectColor:function(){return oA},mixColor:function(){return iA}});var y={};r.r(y),r.d(y,{arrayToTextureData:function(){return SA},attributesToTextureData:function(){return _A},buildTextureData:function(){return bA},buildTextureDataWithOneEdgeAttr:function(){return xA},buildTextureDataWithTwoEdgeAttr:function(){return wA},proccessToFunc:function(){return mA},radialLayout:function(){return EA}});var v={};r.r(v),r.d(v,{gpuDetector:function(){return kA}});var g={};r.r(g),r.d(g,{getBrowserName:function(){return TA}});var m={};r.r(m),r.d(m,{assign:function(){return eM},default:function(){return wM},defaultI18n:function(){return oM},format:function(){return bM},parse:function(){return xM},setGlobalDateI18n:function(){return sM},setGlobalDateMasks:function(){return mM}});var b={};r.r(b),r.d(b,{Arc:function(){return gD},DataMarker:function(){return xD},DataRegion:function(){return wD},Html:function(){return OD},Image:function(){return bD},Line:function(){return yD},Region:function(){return mD},RegionFilter:function(){return _D},Shape:function(){return SD},Text:function(){return vD}});var x={};r.r(x),r.d(x,{ellipsisHead:function(){return LD},ellipsisMiddle:function(){return ND},ellipsisTail:function(){return jD},getDefault:function(){return ID}});var w={};r.r(w),r.d(w,{equidistance:function(){return HD},equidistanceWithReverseBoth:function(){return WD},getDefault:function(){return zD},reserveBoth:function(){return VD},reserveFirst:function(){return GD},reserveLast:function(){return UD}});var _={};r.r(_),r.d(_,{fixedAngle:function(){return XD},getDefault:function(){return YD},unfixedAngle:function(){return ZD}});var S={};r.r(S),r.d(S,{autoEllipsis:function(){return x},autoHide:function(){return w},autoRotate:function(){return _}});var E={};r.r(E),r.d(E,{Base:function(){return $D},Circle:function(){return eB},Html:function(){return nB},Line:function(){return tB}});var k={};r.r(k),r.d(k,{CONTAINER_CLASS:function(){return dB},CROSSHAIR_X:function(){return wB},CROSSHAIR_Y:function(){return _B},LIST_CLASS:function(){return vB},LIST_ITEM_CLASS:function(){return gB},MARKER_CLASS:function(){return mB},NAME_CLASS:function(){return xB},TITLE_CLASS:function(){return yB},VALUE_CLASS:function(){return bB}});var T={};r.r(T),r.d(T,{Action:function(){return AF},BRUSH_FILTER_EVENTS:function(){return SW},Chart:function(){return pG},ComponentController:function(){return dG},Coordinate:function(){return IR},DIRECTION:function(){return LN},ELEMENT_RANGE_HIGHLIGHT_EVENTS:function(){return FH},Element:function(){return EG},Event:function(){return iG},Facet:function(){return kF},Geometry:function(){return GG},GeometryLabel:function(){return KG},Interaction:function(){return vz},InteractionAction:function(){return AF},LAYER:function(){return IN},Scale:function(){return XP},TooltipController:function(){return yG},Util:function(){return gU},VERSION:function(){return vU},VIEW_LIFE_CIRCLE:function(){return RN},View:function(){return hG},getActionClass:function(){return IF},getAnimation:function(){return gG},getEngine:function(){return qN},getFacet:function(){return CF},getGeometryLabel:function(){return CG},getGeometryLabelLayout:function(){return AG},getInteraction:function(){return Tz},getShapeFactory:function(){return RG},getTheme:function(){return Vz},registerAction:function(){return LF},registerAnimation:function(){return mG},registerComponentController:function(){return rG},registerEngine:function(){return YN},registerFacet:function(){return OF},registerGeometry:function(){return fG},registerGeometryLabel:function(){return OG},registerGeometryLabelLayout:function(){return PG},registerInteraction:function(){return Cz},registerShape:function(){return NG},registerShapeFactory:function(){return jG},registerTheme:function(){return Hz}});var C=r(3331),O=r.n(C),A={values:[],set:function(t){return this.values=t,this.values},add:function(t){return this.values.push(t),this.values}},P=(r(5246),r(1358),r(3678)),M=r.n(P);function I(t){"@babel/helpers - typeof";return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function L(t,e){for(var r=0;r0&&(r=parseFloat(t.toPrecision(e))),r},format:function(t,e,r,n){e=void 0!==e?e:0,r=void 0!==r?r:D.thousandsSeparator,n=void 0!==n?n:D.decimalSeparator,null!=e&&(t=parseFloat(t.toFixed(e)));var i=t.toString().split(".");1===i.length&&null==e&&(e=0);var o,a=i[0];if(r)for(var s=/(-?[0-9]+)([0-9]{3})/;s.test(a);)a=a.replace(s,"$1"+r+"$2");if(0==e)o=a;else{var u=i.length>1?i[1]:"0";null!=e&&(u+=new Array(e-u.length+1).join("0")),o=a+n+u}return o}};Number.prototype.limitSigDigs||(Number.prototype.limitSigDigs=function(t){return D.limitSigDigs(this,t)});var B={bind:function(t,e){var r=Array.prototype.slice.apply(arguments,[2]);return function(){var n=r.concat(Array.prototype.slice.apply(arguments,[0]));return t.apply(e,n)}},bindAsEventListener:function(t,e){return function(r){return t.call(e,r||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}},F={filter:function(t,e,r){var n=[];if(Array.prototype.filter)n=t.filter(e,r);else{var i=t.length;if("function"!=typeof e)throw new TypeError;for(var o=0;o-1||i.indexOf("trident")>-1&&i.indexOf("rv")>-1?(e="msie",t=i.match(/msie ([\d.]+)/)||i.match(/rv:([\d.]+)/)):i.indexOf("chrome")>-1?(e="chrome",t=i.match(/chrome\/([\d.]+)/)):i.indexOf("firefox")>-1?(e="firefox",t=i.match(/firefox\/([\d.]+)/)):i.indexOf("opera")>-1?(e="opera",t=i.match(/version\/([\d.]+)/)):i.indexOf("safari")>-1&&(e="safari",t=i.match(/version\/([\d.]+)/)),r=t?t[1]:"",i.indexOf("ipad")>-1||i.indexOf("ipod")>-1||i.indexOf("iphone")>-1?n="apple":i.indexOf("android")>-1&&(r=(t=i.match(/version\/([\d.]+)/))?t[1]:"",n="android"),{name:e,version:r,device:n}}(),J=(Y=!0,X=K,document.createElement("canvas").getContext?("firefox"===X.name&&parseFloat(X.version)<5&&(Y=!1),"safari"===X.name&&parseFloat(X.version)<4&&(Y=!1),"opera"===X.name&&parseFloat(X.version)<10&&(Y=!1),"msie"===X.name&&parseFloat(X.version)<9&&(Y=!1)):Y=!1,Y),Q=-1===(Z=navigator.userAgent.toLowerCase()).indexOf("webkit")&&-1!==Z.indexOf("gecko"),$={assign:function(t){for(var e=0;e=0;r--)t[r]===e&&t.splice(r,1);return t},indexOf:function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r=0&&parseFloat(s)<1?(t.style.filter="alpha(opacity="+100*s+")",t.style.opacity=s):1===parseFloat(s)&&(t.style.filter="",t.style.opacity="")},applyDefaults:function(t,e){t=t||{};var r="function"==typeof window.Event&&e instanceof window.Event;for(var n in e)(void 0===t[n]||!r&&e.hasOwnProperty&&e.hasOwnProperty(n)&&!t.hasOwnProperty(n))&&(t[n]=e[n]);return!r&&e&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&!t.hasOwnProperty("toString")&&(t.toString=e.toString),t},getParameterString:function(t){var e=[];for(var r in t){var n,i=t[r];if(null!=i&&"function"!=typeof i)n=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},urlAppend:function(t,e){var r=t;if(e){0===e.indexOf("?")&&(e=e.substring(1));var n=(t+" ").split(/[?&]/);r+=" "===n.pop()?e:n.length?"&"+e:"?"+e}return r},urlPathAppend:function(t,e){var r=t;if(!e)return r;0===e.indexOf("/")&&(e=e.substring(1));var n=t.split("?");return n[0].indexOf("/",n[0].length-1)<0&&(n[0]+="/"),r="".concat(n[0]).concat(e).concat(n.length>1?"?".concat(n[1]):"")},DEFAULT_PRECISION:14,toFloat:function(t,e){return null==e&&(e=$.DEFAULT_PRECISION),"number"!=typeof t&&(t=parseFloat(t)),0===e?t:parseFloat(t.toPrecision(e))},rad:function(t){return t*Math.PI/180},getParameters:function(t){t=null===t||void 0===t?window.location.href:t;var e="";if(R.contains(t,"?")){var r=t.indexOf("?")+1,n=R.contains(t,"#")?t.indexOf("#"):t.length;e=t.substring(r,n)}for(var i={},o=e.split(/[&;]/),a=0,s=o.length;a1?1/t:t},getResolutionFromScale:function(t,e){var r;t&&(null==e&&(e="degrees"),r=1/($.normalizeScale(t)*tt[e]*96));return r},getScaleFromResolution:function(t,e){return null==e&&(e="degrees"),t*tt[e]*96},getBrowser:function(){return K},isSupportCanvas:J,supportCanvas:function(){return $.isSupportCanvas},isInTheSameDomain:function(t){return!t||(-1===t.indexOf("//")||$.isSameDomain(t,document.location.toString()))},isSameDomain:function(t,e){return new(W())(t).normalize().origin()===new(W())(e).normalize().origin()},calculateDpi:function(t,e,r,n,i){if(t&&e&&r){var o,a=t.getWidth(),s=t.getHeight(),u=e.w,l=e.h;if(i=i||6378137,"degree"===(n=n||"degrees").toLowerCase()||"degrees"===n.toLowerCase()||"dd"===n.toLowerCase()){var c=a/u,f=s/l;o=254/(c>f?c:f)/r/(2*Math.PI*i/360)/1e4}else{o=254/(a/u)/r/1e4}return o}},toJSON:function(t){var e=t;if(null==e)return null;switch(e.constructor){case String:return e=(e=(e=(e=(e=(e=(e='"'+e.replace(/(["\\])/g,"\\$1")+'"').replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace("<","<")).replace(">",">")).replace(/%/g,"%25")).replace(/&/g,"%26");case Array:for(var r="",n=0,i=e.length;n0?"{"+u.join(",")+"}":"{}"}return e.toString()}},getResolutionFromScaleDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?(t=$.normalizeScale(t),"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4):-1},getScaleFromResolutionDpi:function(t,e,r,n){return n=n||6378137,r=r||"",t>0&&e>0?"degree"===r.toLowerCase()||"degrees"===r.toLowerCase()||"dd"===r.toLowerCase()?254/e/t/(2*Math.PI*n/360)/1e4:254/e/t/1e4:-1},transformResult:function(t){return t.responseText&&"string"==typeof t.responseText&&(t=JSON.parse(t.responseText)),t},copyAttributes:function(t,e){if(t=t||{},e)for(var r in e){var n=e[r];void 0!==n&&"CLASS_NAME"!==r&&"function"!=typeof n&&(t[r]=n)}return t},copyAttributesWithClip:function(t,e,r){if(t=t||{},e)for(var n in e){var i=!1;if(r&&r.length)for(var o=0,a=r.length;o=0&&o<=1&&i<=1&&o>=0?new V.Point(t.x+i*(e.x-t.x),t.y+i*(e.y-t.y)):"No Intersection";else if(0==s&&0==u){var c=Math.max(t.y,e.y),f=Math.min(t.y,e.y),h=Math.max(t.x,e.x),p=Math.min(t.x,e.x);a=(r.y>=f&&r.y<=c||n.y>=f&&n.y<=c)&&r.x>=p&&r.x<=h||n.x>=p&&n.x<=h?"Coincident":"Parallel"}else a="Parallel";return a},getTextBounds:function(t,e,r){document.body.appendChild(r),r.style.width="auto",r.style.height="auto",t.fontSize&&(r.style.fontSize=t.fontSize),t.fontFamily&&(r.style.fontFamily=t.fontFamily),t.fontWeight&&(r.style.fontWeight=t.fontWeight),r.style.position="relative",r.style.visibility="hidden",r.style.display="inline-block",r.innerHTML=e;var n=r.clientWidth,i=r.clientHeight;return document.body.removeChild(r),{textWidth:n,textHeight:i}},convertPath:function(t,e){return e?t.replace(/\{([\w-\.]+)\}/g,function(t,r){var n;return n=e.hasOwnProperty(r)?function(t){if(void 0==t||null==t)return"";if(t instanceof Date)return t.toJSON();if(function(t){if("string"!=typeof t&&"object"!==q(t))return!1;try{var e=t.toString();return"[object Object]"===e||"[object Array]"===e}catch(t){return!1}}(t))return JSON.stringify(t);return t.toString()}(e[r]):t,encodeURIComponent(n)}):t}},tt={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};tt.in=tt.inches,tt.degrees=tt.dd,tt.nmi=1852*tt.m;var et=.0254000508001016;$.extend(tt,{Inch:tt.inches,Meter:39.37,Foot:12,IFoot:11.999976,ClarkeFoot:11.999868327581488,SearsFoot:11.999955194477684,GoldCoastFoot:11.999964589846002,IInch:.9999979999999999,MicroInch:999998e-9,Mil:9.99998e-7,Centimeter:.3937,Kilometer:39370,Yard:36,SearsYard:35.99986558343306,IndianYard:35.99987015540864,IndianYd37:35.999740205100004,IndianYd62:35.999880755999996,IndianYd75:35.999868945,IndianFoot:11.9999567087,IndianFt37:11.9999134017,IndianFt62:11.999960252000001,IndianFt75:11.999956315,Mile:63360,IYard:35.999928,IMile:63359.87328,NautM:72913.24,"Lat-66":4367838.370169282,"Lat-83":4367954.152606599,Decimeter:3.9370000000000003,Millimeter:.03937,Dekameter:393.7,Decameter:393.7,Hectometer:3937,GermanMeter:39.370535294205006,CaGrid:39.359685060000004,ClarkeChain:791.991309620512,GunterChain:792.0000000000001,BenoitChain:791.9977268035781,SearsChain:791.9970428354235,ClarkeLink:7.91991309620512,GunterLink:7.920000000000001,BenoitLink:7.919977268035781,SearsLink:7.919970428354236,Rod:198.00000000000014,IntnlChain:791.998416,IntnlLink:7.91998416,Perch:198.00000000000014,Pole:198.00000000000014,Furlong:7919.999999999997,Rood:148.75036777426,CapeFoot:11.999868185255002,Brealey:14763.75,ModAmFt:12.000458400000001,Fathom:71.999856,"NautM-UK":72959.85408,"50kilometers":1968500,"150kilometers":5905500}),$.extend(tt,{mm:tt.Meter/1e3,cm:tt.Meter/100,dm:100*tt.Meter,km:1e3*tt.Meter,kmi:tt.nmi,fath:tt.Fathom,ch:tt.IntnlChain,link:tt.IntnlLink,"us-in":tt.inches,"us-ft":tt.Foot,"us-yd":tt.Yard,"us-ch":tt.GunterChain,"us-mi":tt.Mile,"ind-yd":tt.IndianYd37,"ind-ft":tt.IndianFt37,"ind-ch":791.9942845122}),tt.degree=tt.dd,tt.meter=tt.m,tt.foot=tt.ft,tt.inch=tt.inches,tt.mile=tt.mi,tt.kilometer=tt.km,tt.yard=tt.yd;var rt,nt,it=window.fetch,ot={limitLength:1500,queryKeys:[],queryValues:[],supermap_callbacks:{},addQueryStrings:function(t){for(var e in t){this.queryKeys.push(e),"string"!=typeof t[e]&&(t[e]=$.toJSON(t[e]));var r=encodeURIComponent(t[e]);this.queryValues.push(r)}},issue:function(t){for(var e=this,r=e.getUid(),n=t.url,i=[],o=n,a=0,s=e.queryKeys?e.queryKeys.length:0,u=0;u=e.limitLength){if(0==a)return!1;i.push(o),o=n,a=0,u--}else if(o.length+e.queryKeys[u].length+2+e.queryValues[u].length>e.limitLength)for(var l=e.queryValues[u];l.length>0;){var c=e.limitLength-o.length-e.queryKeys[u].length-2;o.indexOf("?")>-1?o+="&":o+="?";var f=l.substring(0,c);"%"===f.substring(c-1,c)?(c-=1,f=l.substring(0,c)):"%"===f.substring(c-2,c-1)&&(c-=2,f=l.substring(0,c)),o+=e.queryKeys[u]+"="+f,l=l.substring(c),f.length>0&&(i.push(o),o=n,a=0)}else a++,o.indexOf("?")>-1?o+="&":o+="?",o+=e.queryKeys[u]+"="+e.queryValues[u];return i.push(o),e.send(i,"SuperMapJSONPCallbacks_"+r,t&&t.proxy)},getUid:function(){return 1e3*(new Date).getTime()+Math.floor(1e17*Math.random())},send:function(t,e,r){var n=t.length;if(n>0)return new Promise(function(i){for(var o=(new Date).getTime(),a=0;a-1?s+="&":s+="?",s+="sectionCount="+n,s+="§ionIndex="+a,s+="&jsonpUserID="+o,r&&(s=decodeURIComponent(s),s=r+encodeURIComponent(s)),M()(s,{jsonpCallbackFunction:e,timeout:3e4}).then(function(t){i(t.json())})}})},GET:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings(t.params),this.issue(t)},POST:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},PUT:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)},DELETE:function(t){return this.queryKeys.length=0,this.queryValues.length=0,this.addQueryStrings({requestEntity:t.data}),this.issue(t)}},at=function(){return void 0!=rt?rt:window.XMLHttpRequest&&"withCredentials"in new window.XMLHttpRequest},st=function(){return nt||45e3},ut={commit:function(t,e,r,n){switch(t=t?t.toUpperCase():t){case"GET":return this.get(e,r,n);case"POST":return this.post(e,r,n);case"PUT":return this.put(e,r,n);case"DELETE":return this.delete(e,r,n);default:return this.get(e,r,n)}},supportDirectRequest:function(t,e){return!!$.isInTheSameDomain(t)||(void 0!=e.crossOrigin?e.crossOrigin:at()||e.proxy)},get:function(t,e,r){r=r||{};if(t=$.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){var n={url:t=t.replace(".json",".jsonp"),data:e};return ot.GET(n)}return this.urlIsLong(t)?this._postSimulatie("GET",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"GET")},delete:function(t,e,r){r=r||{};if(t=$.urlAppend(t,this._getParameterString(e||{})),t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=DELETE",data:e};return ot.DELETE(n)}return this.urlIsLong(t)?this._postSimulatie("DELETE",t.substring(0,t.indexOf("?")),e,r):this._fetch(t,e,r,"DELETE")},post:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:$.urlAppend(t,"_method=POST"),data:e};return ot.POST(n)}return this._fetch(t,e,r,"POST")},put:function(t,e,r){if(r=r||{},t=this._processUrl(t,r),!this.supportDirectRequest(t,r)){t=t.replace(".json",".jsonp");var n={url:t+="&_method=PUT",data:e};return ot.PUT(n)}return this._fetch(t,e,r,"PUT")},urlIsLong:function(t){for(var e=0,r=null,n=0,i=t.length;n-1?"&":"?")+"_method="+t,"string"!=typeof r&&(r=JSON.stringify(r)),this.post(e,r,n)},_processUrl:function(t,e){if(this._isMVTRequest(t))return t;if(-1===t.indexOf(".json")&&!e.withoutFormatSuffix)if(t.indexOf("?")<0)t+=".json";else{var r=t.split("?");2===r.length&&(t=r[0]+".json?"+r[1])}return e&&e.proxy&&("function"==typeof e.proxy?t=e.proxy(t):(t=decodeURIComponent(t),t=e.proxy+encodeURIComponent(t))),t},_fetch:function(t,e,r,n){return(r=r||{}).headers=r.headers||{},r.headers["Content-Type"]||FormData.prototype.isPrototypeOf(e)||(r.headers["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8"),r.timeout?this._timeout(r.timeout,it(t,{method:n,headers:r.headers,body:"PUT"===n||"POST"===n?e:void 0,credentials:this._getWithCredentials(r),mode:"cors",timeout:st()}).then(function(t){return t})):it(t,{method:n,body:"PUT"===n||"POST"===n?e:void 0,headers:r.headers,credentials:this._getWithCredentials(r),mode:"cors",timeout:st()}).then(function(t){return t})},_getWithCredentials:function(t){return!0===t.withCredentials?"include":!1===t.withCredentials?"omit":"same-origin"},_fetchJsonp:function(t,e){return e=e||{},M()(t,{method:"GET",timeout:e.timeout}).then(function(t){return t})},_timeout:function(t,e){return new Promise(function(r,n){setTimeout(function(){n(new Error("timeout"))},t),e.then(r,n)})},_getParameterString:function(t){var e=[];for(var r in t){var n,i=t[r];if(null!=i&&"function"!=typeof i)n=Array.isArray(i)||"[object Object]"===i.toString()?encodeURIComponent(JSON.stringify(i)):encodeURIComponent(i),e.push(encodeURIComponent(r)+"="+n)}return e.join("&")},_isMVTRequest:function(t){return t.indexOf(".mvt")>-1||t.indexOf(".pbf")>-1}},lt=r(7915);function ct(t,e){t&&-1===t.indexOf("BEGIN PUBLIC KEY")&&(t="-----BEGIN PUBLIC KEY-----\n".concat(t,"\n-----END PUBLIC KEY-----"));var r=lt.pki.publicKeyFromPem(t),n={md:lt.md.sha256.create(),mgf1:{md:lt.md.sha1.create()}},i=r.encrypt(e,"RSA-OAEP",n);return!!i&&window.btoa(i)}function ft(t,e,r){r=lt.util.encodeUtf8(r);var n=lt.cipher.createCipher("AES-GCM",t);if(n.start({iv:e,additionalData:"",tagLength:128}),n.update(lt.util.createBuffer(r)),n.finish()){var i=n.output,o=n.mode.tag;return window.btoa(i.data+o.data)}return!1}function ht(t){for(var e="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=t;n>0;--n)r+=e[Math.floor(Math.random()*e.length)];return r}function pt(t){"@babel/helpers - typeof";return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dt(){dt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==pt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function yt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return vt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function vt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r 1 ? 1 : y;},toY:function(y){return (0.5-y)*"+s+"+"+o+";}}"],{type:"text/javascript"}))}},{key:"getPaintProperty",value:function(t,r){var n=this.overlayLayersManager[t];return n?n.getPaintProperty?n.getPaintProperty(r):void 0:e.getPaintProperty.call(this,t,r)}},{key:"getLayoutProperty",value:function(t,r){var n=this.overlayLayersManager[t];return n?n.getLayoutProperty?n.getLayoutProperty(r):void 0:e.getLayoutProperty.call(this,t,r)}},{key:"getFilter",value:function(t,r,n){var i=this.overlayLayersManager[t];return i?i.getFilter?i.getFilter(r,n):void 0:e.getFilter.call(this,t,r,n)}},{key:"setFilter",value:function(t,r,n){var i=this.overlayLayersManager[t];return i?(i.setFilter&&i.setFilter(r,n),this):e.setFilter.call(this,t,r,n)}},{key:"on",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"on"})}},{key:"once",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"once"})}},{key:"off",value:function(t,e,r){return this._eventsModeHandler({type:t,layerId:e,listener:r,mode:"off"})}},{key:"queryRenderedFeatures",value:function(t,r){var n,i=this,o=Object.keys(this.overlayLayersManager);r&&r.layers&&(o=r.layers.filter(function(t){return i.overlayLayersManager[t]}),n=r.layers.filter(function(t){return!i.overlayLayersManager[t]}));var a=t||[[0,0],[this.transform.width,this.transform.height]],s=r||{};delete s.layers;var u=o.reduce(function(t,e){var r=i.overlayLayersManager[e];return r.query&&r.queryRenderedFeatures&&r.queryRenderedFeatures(a,s,function(e){t=t.concat(e)}),t},[]);return e.queryRenderedFeatures.call(this,t,Pt(Pt({},r),{},{layers:n})).concat(u)}},{key:"querySourceFeatures",value:function(t,r){var n=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof Ct});return n?n.query?n.querySourceFeatures(r):void 0:e.querySourceFeatures.call(this,t,r)}},{key:"getSource",value:function(t){var r=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof Ct});return r?r.getSource():e.getSource.call(this,t)}},{key:"removeSource",value:function(t){var r=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof Ct});return r?r.removeSource():e.removeSource.call(this,t)}},{key:"isSourceLoaded",value:function(t){var r=Object.values(this.overlayLayersManager).find(function(e){return e.sourceId===t&&e instanceof Ct});return r?r.isSourceLoaded():e.isSourceLoaded.call(this,t)}},{key:"_eventsModeHandler",value:function(t){var r=this,n=t.type,i=t.layerId,o=t.listener,a=t.mode,s=[];o&&(s=s.concat(i)),s.forEach(function(t){var e=r.overlayLayersManager[t]||{};e.interaction&&e[a]&&e.events.includes(n)&&e[a](n,o||i)});var u=o&&s.filter(function(t){return!r.overlayLayersManager[t]});if(u&&!u.length)return this;var l=u&&"string"!=typeof i?u:i;return e[a].call(this,n,l,o)}},{key:"_moveToHandler",value:function(e,r){var n,i=document.getElementById(e);r&&((n=document.getElementById(r))||t.Evented.prototype.fire("error",{error:new Error('Layer with id "'.concat(r,'" does not exist on this document.'))})),i&&(n?n.parentNode.insertBefore(i,n):i.parentNode.appendChild(i))}}])&&jt(i.prototype,o),a&&jt(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o,a}()}function zt(t){"@babel/helpers - typeof";return(zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gt(t,e){for(var r=0;r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Yt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}var Xt,Zt;O().VectorTileSource&&void 0===O().VectorTileSource.prototype.beforeLoadBak&&(O().VectorTileSource.prototype.beforeLoadBak=O().VectorTileSource.prototype.beforeLoad,O().VectorTileSource.prototype.beforeLoad=(Xt=qt().mark(function t(e,r){var n,i;return qt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r&&r.tiles&&r.tiles[0],!A.values.includes(e)||!n){t.next=6;break}return t.next=4,_t(n);case 4:(i=t.sent)&&(this.decryptOptions={key:i.serviceKey,algorithm:i.algorithm});case 6:this.beforeLoadBak(e,r);case 7:case"end":return t.stop()}},t,this)}),Zt=function(){var t=this,e=arguments;return new Promise(function(r,n){var i=Xt.apply(t,e);function o(t){Yt(i,r,n,o,a,"next",t)}function a(t){Yt(i,r,n,o,a,"throw",t)}o(void 0)})},function(t,e){return Zt.apply(this,arguments)})),O().Map.prototype._inherit||(O().Map=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),Vt(this,e,[t])}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wt(t,e)}(e,Ft(O())),r=e,n&&Gt(r.prototype,n),i&&Gt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(), + // 防止引入多个 iclient-mapboxgl 导致死循环 + O().Map.prototype._inherit=!0);function Kt(t){"@babel/helpers - typeof";return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jt(t,e){for(var r=0;r";return this._container.innerHTML=a?""+s+"":s,this._createStyleSheet(),this._container}},{key:"_createStyleSheet",value:function(){var t=document.createElement("style");t.type="text/css",t.innerHTML=".iclient-logo{margin:0 !important;}.iclient-logo a{border: none;display: block;height:31px;}.iclient-logo img{border: none;white-space: nowrap}",document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_extend",value:function(t){for(var e=0;et.right;)e.lon-=t.getWidth()}return e}},{key:"destroy",value:function(){this.lon=null,this.lat=null}}])&&le(e.prototype,r),n&&le(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function he(t){"@babel/helpers - typeof";return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pe(t,e){for(var r=0;rthis.right)&&(this.right=r.right),(null==this.top||r.top>this.top)&&(this.top=r.top))}}},{key:"containsLonLat",value:function(t,e){"boolean"==typeof e&&(e={inclusive:e}),e=e||{};var r=this.contains(t.lon,t.lat,e.inclusive),n=e.worldBounds;if(n&&!r){var i=n.getWidth(),o=(n.left+n.right)/2,a=Math.round((t.lon-o)/i);r=this.containsLonLat({lon:t.lon-a*i,lat:t.lat},{inclusive:e.inclusive})}return r}},{key:"containsPixel",value:function(t,e){return this.contains(t.x,t.y,e)}},{key:"contains",value:function(t,e,r){if(null==r&&(r=!0),null==t||null==e)return!1;var n=!1;return n=r?t>=this.left&&t<=this.right&&e>=this.bottom&&e<=this.top:t>this.left&&tthis.bottom&&e=r.bottom&&t.bottom<=r.top||r.bottom>=t.bottom&&r.bottom<=t.top,a=t.top>=r.bottom&&t.top<=r.top||r.top>t.bottom&&r.top=r.left&&t.left<=r.right||r.left>=t.left&&r.left<=t.right,u=t.right>=r.left&&t.right<=r.right||r.right>=t.left&&r.right<=t.right;n=(o||a)&&(s||u)}if(e.worldBounds&&!n){var l=e.worldBounds,c=l.getWidth(),f=!l.containsBounds(r),h=!l.containsBounds(t);f&&!h?(t=t.add(-c,0),n=r.intersectsBounds(t,{inclusive:e.inclusive})):h&&!f&&(r=r.add(-c,0),n=t.intersectsBounds(r,{inclusive:e.inclusive}))}return n}},{key:"containsBounds",value:function(t,e,r){null==e&&(e=!1),null==r&&(r=!0);var n=this.contains(t.left,t.bottom,r),i=this.contains(t.right,t.bottom,r),o=this.contains(t.left,t.top,r),a=this.contains(t.right,t.top,r);return e?n||i||o||a:n&&i&&o&&a}},{key:"determineQuadrant",value:function(t){var e="",r=this.getCenterLonLat();return e+=t.lat=t.right&&i.right>t.right;)i=i.add(-o,0);var a=i.left+r;at.left&&i.right-n>t.right&&(i=i.add(-o,0))}return i}},{key:"toServerJSONObject",value:function(){return{rightTop:{x:this.right,y:this.top},leftBottom:{x:this.left,y:this.bottom},left:this.left,right:this.right,top:this.top,bottom:this.bottom}}},{key:"destroy",value:function(){this.left=null,this.right=null,this.top=null,this.bottom=null,this.centerLonLat=null}}])&&pe(e.prototype,r),n&&pe(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function ve(t){"@babel/helpers - typeof";return(ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ge(t,e){for(var r=0;r-1)){if(null!=e&&e=0;--r)e=this.removeComponent(t[r])||e;return e}},{key:"removeComponent",value:function(t){return $.removeItem(this.components,t),this.clearBounds(),!0}},{key:"getArea",value:function(){for(var t=0,e=0,r=this.components.length;e=1?1:g)<=-1?-1:g,c=180*Math.acos(g)/Math.PI,a=(c=i.x==r.x?e.x>r.x&&n.x>r.x||e.xh*e.x+p&&n.y>h*n.x+p||e.yr.y?n.xr.x&&(s=!1):i.xh*n.x+p&&(s=!1):i.x>r.x?n.y>r.y&&(s=!1):n.y=0?180*Math.atan(m)/Math.PI:Math.abs(180*Math.atan(m)/Math.PI)+90,x=Math.abs(e.y);r.y==x&&x==i.y&&r.x=0?m>=0?l+=u:l=180-(l-90)+u:l=m>0?l-180+u:90-l+u:w>=0?m>=0?l-=u:l=180-(l-90)-u:l=m>=0?l-180-u:90-l-u,l=l*Math.PI/180;var S=e.x+o*Math.cos(l),E=e.y+o*Math.sin(l);f.push(new Se(S,E))}f.push(i)}return f}},{key:"createLineEPS",value:function(t){var r=[],n=t.length;if(n<2)return t;for(var i=0;i2;return r&&Ke(Je(e.prototype),"removeComponent",this).apply(this,arguments),r}},{key:"getSortedSegments",value:function(){for(var t,e,r=this.components.length-1,n=new Array(r),i=0;i3;if(r){this.components.pop(),ir(or(e.prototype),"removeComponent",this).apply(this,arguments);var n=this.components[0];ir(or(e.prototype),"addComponent",this).apply(this,[n])}return r}},{key:"getArea",value:function(){var t=0;if(this.components&&this.components.length>2){for(var e=0,r=0,n=this.components.length;r0){t+=Math.abs(this.components[0].getArea());for(var e=1,r=this.components.length;e0&&r.push(","),r.push(this.writeNewline(),this.writeIndent(),e));return this.level-=1,r.push(this.writeNewline(),this.writeIndent(),"]"),r.join("")},string:function(t){var e={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(t)?'"'+t.replace(/([\x00-\x1f\\"])/g,function(t,r){var n=e[r];return n||(n=r.charCodeAt(),"\\u00"+Math.floor(n/16).toString(16)+(n%16).toString(16))})+'"':'"'+t+'"'},number:function(t){return isFinite(t)?String(t):"null"},boolean:function(t){return String(t)},date:function(t){function e(t){return t<10?"0"+t:t}return'"'+t.getFullYear()+"-"+e(t.getMonth()+1)+"-"+e(t.getDate())+"T"+e(t.getHours())+":"+e(t.getMinutes())+":"+e(t.getSeconds())+'"'}},r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zr(t,e)}(e,jr),r=e,(n=[{key:"read",value:function(t,e){var r;if(this.nativeJSON)try{r=JSON.parse(t,e)}catch(e){return{data:t}}return this.keepData&&(this.data=r),r}},{key:"write",value:function(t,e){this.pretty=!!e;var r=null,n=Nr(t);if(this.serialize[n])try{r=!this.pretty&&this.nativeJSON?JSON.stringify(t):this.serialize[n].apply(this,[t])}catch(t){}return r}},{key:"writeIndent",value:function(){var t=[];if(this.pretty)for(var e=0;e0))return null;for(var a=0,s=0,u=[];a0){t+='"points":[';for(var r=0,n=this.components.length;rt[o]){var a=t[o];t[o]=t[i],t[i]=a;var s=e[o];if(e[o]=e[i],e[i]=s,r&&r.length>0){var u=r[o];r[o]=r[i],r[i]=u}if(n&&n.length>0){var l=n[o];n[o]=n[i],n[i]=l}}}}],(r=[{key:"destroy",value:function(){var t=this;t.id=null,t.style=null,t.parts=null,t.partTopo=null,t.points=null,t.type=null,t.prjCoordSys=null}},{key:"toGeometry",value:function(){var t=this;switch(t.type.toUpperCase()){case Cn.POINT:return t.toGeoPoint();case Cn.LINE:return t.toGeoLine();case Cn.LINEM:return t.toGeoLinem();case Cn.REGION:return t.toGeoRegion();case Cn.POINTEPS:return t.toGeoPoint();case Cn.LINEEPS:return t.toGeoLineEPS();case Cn.REGIONEPS:return t.toGeoRegionEPS();case Cn.GEOCOMPOUND:return t.transformGeoCompound()}}},{key:"toGeoPoint",value:function(){var t=this.parts||[],e=this.points||[],r=t.length;if(r>0){if(1===r)return new Se(e[0].x,e[0].y);for(var n=[],i=0;i0){if(1===r){for(var n=[],i=0;i0){if(1===s){for(t=0,r=[];t=0;b--)if(g[m]=-1,f[b].containsBounds(f[m])){h[m]=-1*h[b],h[m]<0&&(g[m]=b);break}for(var x=0;x0?o.push(c[x]):(o[g[x]].components=o[g[x]].components.concat(c[x].components),o.push(""))}else{o=new Array;for(var w=0;w0&&o.length>0&&(o[o.length-1].components=o[o.length-1].components.concat(u),u=[]),o.push(c[w])),w==i-1){var _=o.length;if(_)o[_-1].components=o[_-1].components.concat(u);else for(var S=0,E=u.length;S=0;x--)if(m[b]=-1,h[x].containsBounds(h[b])){p[b]=-1*p[x],p[b]<0&&(m[b]=x);break}for(var w=0;w0?a.push(f[w]):(a[m[w]].components=a[m[w]].components.concat(f[w].components),a.push(""))}else{a=new Array;for(var _=0;_0&&a.length>0&&(a[a.length-1].components=a[a.length-1].components.concat(l),l=[]),a.push(f[_])),_==i-1){var S=a.length;if(S)a[S-1].components=a[S-1].components.concat(l);else for(var E=0,k=l.length;E-1||(e[n]=t[n]);return e}}])&&bi(r.prototype,n),i&&bi(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Ti(t){return"string"==typeof t&&t.constructor===String}function Ci(t){return"[object Array]"===Object.prototype.toString.call(t)}function Oi(t){return"[object Object]"===Object.prototype.toString.call(t)}function Ai(t){return Ci(t)&&2===t.length&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90}var Pi=JSON.parse('[{"name":"克拉玛依市","coord":[85.01486759299489,45.406422237230046]},{"name":"昌吉回族自治州","coord":[88.7154624754753,44.26991024636568]},{"name":"石河子市","coord":[86.0208600035924,44.239045558096805]},{"name":"霍林郭勒市","coord":[114.73479243733115,44.16058374713977]},{"name":"本溪市","coord":[124.64357865201586,41.177197783134275]},{"name":"嘉峪关市","coord":[98.16891560537093,39.76279786284264]},{"name":"莱芜市","coord":[117.65723565456207,36.27916499211527]},{"name":"神农架林区","coord":[110.48296222218153,31.581260143666697]},{"name":"天门市","coord":[113.00615321481195,30.64105781887143]},{"name":"鄂州市","coord":[114.94764081970385,30.325634953844585]},{"name":"潜江市","coord":[112.70703817700621,30.349210666019893]},{"name":"仙桃市","coord":[113.34688900729822,30.315951161935402]},{"name":"萍乡市","coord":[113.88072263074415,27.47193090553213]},{"name":"台湾省","coord":[120.14338943402045,23.596002465926095]},{"name":"东莞市","coord":[113.89443658529342,22.897826158636448]},{"name":"中山市","coord":[113.37118387764659,22.501478858616522]},{"name":"珠海市","coord":[113.21799258934986,22.23782602992192]},{"name":"北海市","coord":[109.18248083043899,21.695773689750148]},{"name":"香港","coord":[114.20689279508653,22.36016760139811]},{"name":"舟山市","coord":[122.22514712841459,30.338633120695956]},{"name":"克孜勒苏柯尔克孜","coord":[74.62910472637343,39.59886016069875]},{"name":"喀什地区","coord":[77.19899922143753,37.85462871211595]},{"name":"阿克苏地区","coord":[81.43930290016381,41.067304799230456]},{"name":"和田地区","coord":[80.69780509160952,36.95287032287055]},{"name":"阿里地区","coord":[82.536487505389,32.69566569631762]},{"name":"日喀则地区","coord":[86.5996831353606,29.54861754814263]},{"name":"那曲地区","coord":[88.32523292667608,33.20600450932715]},{"name":"玉树藏族自治州","coord":[95.2107128446203,33.90320387919257]},{"name":"迪庆藏族自治州","coord":[99.42465312188943,28.052797714348895]},{"name":"怒江傈傈族自治州","coord":[98.85737910439825,26.98345757528851]},{"name":"大理白族自治州","coord":[99.93934374816013,25.684737357453045]},{"name":"德宏傣族景颇族自","coord":[98.13830877778075,24.593421919561205]},{"name":"保山市","coord":[99.19031013453166,24.979380341662]},{"name":"临沧市","coord":[99.62483778975081,24.058807858948214]},{"name":"普洱市","coord":[100.94440267992684,23.44121660743221]},{"name":"西双版纳傣族自治","coord":[100.86105801845994,21.882475641324206]},{"name":"拉萨市","coord":[91.3684790613129,30.14176592960237]},{"name":"山南地区","coord":[92.11665242621062,28.33000201578789]},{"name":"林芝地区","coord":[94.9307847458166,29.125110156601963]},{"name":"昌都地区","coord":[97.33912235873476,30.48520825551814]},{"name":"丽江市","coord":[100.65713436205135,26.96190318191959]},{"name":"攀枝花市","coord":[101.73355913301131,26.714486678752795]},{"name":"凉山彝族自治州","coord":[102.08678551422615,27.683020519860396]},{"name":"楚雄彝族自治州","coord":[101.68264761198458,25.369603845264024]},{"name":"红河哈尼族彝族自","coord":[102.95101719613119,23.624860095239875]},{"name":"文山壮族苗族自治","coord":[104.8708359910614,23.579587266862504]},{"name":"百色市","coord":[106.69546907589859,23.98220841166522]},{"name":"崇左市","coord":[107.3277087317123,22.49769755349952]},{"name":"防城港市","coord":[107.88939931155171,21.94550204069006]},{"name":"南宁市","coord":[108.67078983716917,23.12207641861882]},{"name":"钦州市","coord":[108.8532307305186,22.157690108421384]},{"name":"玉林市","coord":[110.26918466489103,22.391823643610415]},{"name":"湛江市","coord":[109.93033457863683,21.086751055633457]},{"name":"茂名市","coord":[110.80336192333934,22.069184739040775]},{"name":"阳江市","coord":[111.70471342186183,22.108751366417575]},{"name":"江门市","coord":[112.53715618649149,22.297368082806777]},{"name":"广州市","coord":[113.4949302208309,23.28359314707863]},{"name":"清远市","coord":[113.10957368131268,24.334444053233856]},{"name":"肇庆市","coord":[112.11117530204233,23.60241158796112]},{"name":"梧州市","coord":[111.01709510772797,23.518132876753846]},{"name":"贺州市","coord":[111.50423061842756,24.4095096817199]},{"name":"桂林市","coord":[110.44046163393094,25.353966673735407]},{"name":"柳州市","coord":[109.34854449214147,24.972408051485047]},{"name":"河池市","coord":[107.81191841865586,24.649291651298164]},{"name":"黔东南苗族侗族自","coord":[108.39952601614591,26.429286420465576]},{"name":"贵阳市","coord":[106.59784062851153,26.797907456479816]},{"name":"安顺市","coord":[105.76161265300635,25.988644902171018]},{"name":"黔西南布依族苗族","coord":[105.5954078788574,25.404850939549405]},{"name":"曲靖市","coord":[103.9164335632742,25.697243690315265]},{"name":"六盘水市","coord":[104.77723228072432,26.15402255629164]},{"name":"毕节地区","coord":[105.03867422931839,27.077913968069666]},{"name":"昭通市","coord":[104.29730513046874,27.62418247971078]},{"name":"宜宾市","coord":[104.76748901448207,28.553501804266475]},{"name":"乐山市","coord":[103.56027669102787,29.160754519210577]},{"name":"自贡市","coord":[104.63272827056402,29.273152614922402]},{"name":"内江市","coord":[104.82644562304716,29.61272653799929]},{"name":"遵义市","coord":[106.82413636302059,28.191847588570702]},{"name":"达州市","coord":[107.59704170009518,31.32138258839703]},{"name":"遂宁市","coord":[105.48979445433736,30.677687821242678]},{"name":"广安市","coord":[106.56708164098042,30.43500706741521]},{"name":"泸州市","coord":[105.42591761727707,28.50277238478137]},{"name":"资阳市","coord":[104.97995126874034,30.154251886139654]},{"name":"雅安市","coord":[102.69931299964517,29.892630706195035]},{"name":"眉山市","coord":[104.07052881858888,29.894202166560405]},{"name":"甘孜藏族自治州","coord":[100.50721042614238,30.975216556269658]},{"name":"果洛藏族自治州","coord":[99.30775565051923,34.03539865224808]},{"name":"海南藏族自治州","coord":[100.39969108016373,35.90048272566899]},{"name":"黄南藏族自治州","coord":[101.5360706381689,35.10286360841902]},{"name":"赣南藏族自治州","coord":[102.97083885806067,34.326752803339026]},{"name":"陇南市","coord":[105.24780098912132,33.57031117443431]},{"name":"天水市","coord":[105.53503634660417,34.62320421368087]},{"name":"定西市","coord":[104.58787768541339,35.08900966621695]},{"name":"临夏回族自治州","coord":[103.2612870434902,35.591577124455235]},{"name":"西宁市","coord":[101.57680657999033,36.84800271717157]},{"name":"海东地区","coord":[102.30909850729282,36.287400615025646]},{"name":"海北藏族自治州","coord":[100.27122484450717,37.892557516083826]},{"name":"金昌市","coord":[102.02244049169511,38.497330414886164]},{"name":"酒泉市","coord":[95.94486678270127,40.56891536586272]},{"name":"海西蒙古族藏族自","coord":[94.67143298050689,36.022725148503724]},{"name":"巴音郭楞蒙古自治","coord":[88.18116214759745,39.556478810319916]},{"name":"哈密地区","coord":[93.84302392518026,42.95015211178875]},{"name":"叶鲁番地区","coord":[89.82035217277885,42.399368632283505]},{"name":"乌鲁木齐市","coord":[88.00048109561487,43.549986370786]},{"name":"阿勒泰地区","coord":[88.11213933257655,47.05593413019629]},{"name":"博尔塔拉蒙古自治","coord":[82.26402238163408,44.671135542630864]},{"name":"伊犁哈萨克自治州","coord":[82.80778717477179,43.53783381365267]},{"name":"阿拉善盟","coord":[103.29923966842289,40.10955801781495]},{"name":"武威市","coord":[102.73362058791429,37.94211141321436]},{"name":"兰州市","coord":[103.73793563506032,36.27379827886003]},{"name":"中卫市","coord":[105.6943786030716,37.20654236148948]},{"name":"银川市","coord":[106.20022174140034,38.52103167597483]},{"name":"石嘴山市","coord":[106.41544011793628,38.84054137571417]},{"name":"乌海市","coord":[106.8984175998405,39.54616572239788]},{"name":"鄂尔多斯市","coord":[108.43285571424619,39.24036799350715]},{"name":"巴彦淖尔市","coord":[107.45840392808307,41.30159860424196]},{"name":"包头市","coord":[110.46472193224272,41.48017783644221]},{"name":"呼和浩特市","coord":[111.48365173603975,40.498363056149884]},{"name":"乌兰察布市","coord":[112.61568977597707,41.75789561273154]},{"name":"大同市","coord":[113.7107192749083,39.898956799744184]},{"name":"朔州市","coord":[112.65428748167508,39.681772914701924]},{"name":"忻州市","coord":[112.36127575589583,38.88990233614568]},{"name":"榆林市","coord":[109.68473112169593,38.19921027134876]},{"name":"延安市","coord":[109.52425222161318,36.406522726136814]},{"name":"庆阳市","coord":[107.73052193155061,36.183821532624464]},{"name":"固原市","coord":[106.20191575442442,36.11634909496382]},{"name":"白银市","coord":[104.68634478137065,36.51582865625868]},{"name":"宝鸡市","coord":[107.33534779230747,34.3387216485855]},{"name":"汉中市","coord":[107.03534754266246,33.00142998064871]},{"name":"广元市","coord":[105.92928137563939,32.21872447205537]},{"name":"巴中市","coord":[107.03422410306194,31.99874720836291]},{"name":"南充市","coord":[106.32964805032347,31.156657700184095]},{"name":"绵阳市","coord":[104.58949560201106,31.88628780630976]},{"name":"德阳市","coord":[104.41542984932845,31.110558133718676]},{"name":"成都市","coord":[103.8852290010473,30.777258040348634]},{"name":"阿坝藏族羌族自治","coord":[102.26209319552814,32.45725845387284]},{"name":"安康市","coord":[109.14236501848015,32.77467694678074]},{"name":"十堰市","coord":[110.39934083416314,32.376209039347906]},{"name":"襄阳市","coord":[111.97539147094662,31.93399822417465]},{"name":"宜昌市","coord":[111.22204852395754,30.772457669035354]},{"name":"恩施市","coord":[109.42158366502872,30.260366574390105]},{"name":"张家界市","coord":[110.59760006538717,29.330107409240718]},{"name":"吉首市","coord":[109.72176899848378,28.681903937242495]},{"name":"铜仁地区","coord":[108.54247523485463,28.11736237519646]},{"name":"重庆市","coord":[107.86007108564992,30.186253395053196]},{"name":"怀化市","coord":[109.94325166787243,27.43919084801186]},{"name":"益阳市","coord":[112.43060358108062,28.75127294553697]},{"name":"娄底市","coord":[111.41891416951897,27.696312460064604]},{"name":"常德市","coord":[111.72571610131646,29.27189463838195]},{"name":"荆州市","coord":[112.65896596965268,30.05161542755362]},{"name":"荆门市","coord":[112.6586855902184,31.01267124474617]},{"name":"岳阳市","coord":[113.2595036144316,29.106247116930163]},{"name":"长沙市","coord":[113.15415586456598,28.222934680488425]},{"name":"湘潭市","coord":[112.51092596317824,27.69881544105668]},{"name":"株州市","coord":[113.49665538546823,27.03993794610501]},{"name":"衡阳市","coord":[112.48849636578527,26.783613569970782]},{"name":"邵阳市","coord":[110.6723832117475,26.81652287086792]},{"name":"永州市","coord":[111.8565364154186,25.768488267811968]},{"name":"韶关市","coord":[113.53420325850979,24.69848878771937]},{"name":"惠州市","coord":[114.32029589634925,23.25504544231892]},{"name":"佛山市","coord":[112.95925897403649,23.10116677189257]},{"name":"云浮市","coord":[111.78042514904234,22.840400494105687]},{"name":"深圳市","coord":[114.13138648919008,22.649563063468342]},{"name":"汕尾市","coord":[115.57412892884373,23.06989642104901]},{"name":"河源市","coord":[114.89746229844398,23.97971937124767]},{"name":"揭阳市","coord":[116.04290004239446,23.304802704715357]},{"name":"汕头市","coord":[116.7008461897183,23.35898625947344]},{"name":"潮州市","coord":[116.75405548481658,23.854381508863064]},{"name":"梅州市","coord":[116.13719397345734,24.15633544812716]},{"name":"漳州市","coord":[117.38279760543345,24.41111215459575]},{"name":"厦门市","coord":[118.04275971554665,24.675908246507944]},{"name":"龙岩市","coord":[116.69341144552507,25.20284542644492]},{"name":"泉州市","coord":[118.12035864630246,25.22984144365049]},{"name":"莆田市","coord":[118.82439690138142,25.439653480972687]},{"name":"福州市","coord":[119.1608285845262,25.99117532466728]},{"name":"三明市","coord":[117.51188176216434,26.318292906961602]},{"name":"南平市","coord":[118.16153136678187,27.306303151805437]},{"name":"抚州市","coord":[116.3455359885574,27.487043655935366]},{"name":"鹰潭市","coord":[117.01082360702333,28.241253742969946]},{"name":"吉安市","coord":[114.91377151807418,26.957486660664525]},{"name":"赣州市","coord":[115.046455717572,25.81565075681663]},{"name":"郴州市","coord":[113.1544526703492,25.871927095452524]},{"name":"新余市","coord":[114.94161795877827,27.79044654578371]},{"name":"宜春市","coord":[115.04574494880995,28.306428044943356]},{"name":"南昌市","coord":[115.9963824234495,28.664803351584705]},{"name":"九江市","coord":[115.53225905704193,29.362905920276297]},{"name":"上饶市","coord":[117.8595355766598,28.765755150094634]},{"name":"景德镇市","coord":[117.25387030721845,29.33426823662448]},{"name":"黄山市","coord":[117.85476357809696,29.969632034273722]},{"name":"池州市","coord":[117.34517113140791,30.208089337922335]},{"name":"铜陵市","coord":[117.93160431300694,30.926442655001676]},{"name":"安庆市","coord":[116.54307680610799,30.524265461641296]},{"name":"黄石市","coord":[115.02354597728443,29.924060229331015]},{"name":"咸宁市","coord":[114.26967602231792,29.652174021136048]},{"name":"黄冈市","coord":[115.2859016705373,30.65856897065683]},{"name":"武汉市","coord":[114.34552076948799,30.68836237966767]},{"name":"随州市","coord":[113.3850627838818,31.87891659924412]},{"name":"信阳市","coord":[114.81374730587638,32.0309685135914]},{"name":"驻马店市","coord":[114.07756451509235,32.896720987266114]},{"name":"商洛市","coord":[109.82044421310393,33.77403373563189]},{"name":"西安市","coord":[109.11839808451401,34.225257215515896]},{"name":"渭南市","coord":[109.75732444226935,35.025913644359306]},{"name":"铜川市","coord":[108.98695328111377,35.19235092947735]},{"name":"咸阳市","coord":[108.36398776446165,34.84311348287181]},{"name":"三门峡市","coord":[110.80049688104964,34.31818709571671]},{"name":"运城市","coord":[111.1736679525165,35.19010372283576]},{"name":"洛阳市","coord":[111.87577573098216,34.33379926109848]},{"name":"平顶山市","coord":[112.80931281928427,33.759895800153096]},{"name":"漯河市","coord":[113.83505724178012,33.70034266174508]},{"name":"许昌市","coord":[113.78762484088509,34.051835688452435]},{"name":"郑州市","coord":[113.49619951867594,34.61181797865449]},{"name":"焦作市","coord":[113.13404280173008,35.134167097471625]},{"name":"晋城市","coord":[112.7495732073233,35.63186423091449]},{"name":"长治市","coord":[112.85900842873183,36.45872910742828]},{"name":"临汾市","coord":[111.49379787924448,36.22810800777857]},{"name":"太原市","coord":[112.15628804033796,37.91704444063036]},{"name":"吕梁市","coord":[111.31901105774872,37.712740463356496]},{"name":"晋中市","coord":[113.08199599739676,37.36532613794343]},{"name":"邯郸市","coord":[114.41824047234618,36.530119932543315]},{"name":"安阳市","coord":[113.88883283163116,35.7797611183252]},{"name":"鹤壁市","coord":[114.3654094911545,35.75770487428472]},{"name":"新乡市","coord":[113.9184107718167,35.348471214026716]},{"name":"开封市","coord":[114.52801677500626,34.61371216679872]},{"name":"周口市","coord":[114.88509782391864,33.69999759722657]},{"name":"阜阳市","coord":[115.44595951398213,32.98060371610532]},{"name":"淮南市","coord":[116.68941991880993,32.79972275772595]},{"name":"蚌埠市","coord":[117.38594715783302,33.106729536033896]},{"name":"淮北市","coord":[116.69651711889378,33.69527529383458]},{"name":"宿州市","coord":[117.30175405886838,33.943330421260015]},{"name":"亳州市","coord":[116.12410804185097,33.46769392946132]},{"name":"商丘市","coord":[115.59575176872548,34.28339840831147]},{"name":"菏泽市","coord":[115.53631974831816,35.197319393220624]},{"name":"濮阳市","coord":[115.3070485514902,35.775883510964334]},{"name":"聊城市","coord":[115.8870069012884,36.40529594548765]},{"name":"邢台市","coord":[114.74259008644859,37.251396750084155]},{"name":"石家庄市","coord":[114.56923838363613,38.13141710980106]},{"name":"阳泉市","coord":[113.39216149668508,38.09075470547468]},{"name":"保定市","coord":[115.261524468934,39.09118520781398]},{"name":"衡水市","coord":[115.8182936677897,37.715661598187154]},{"name":"德州市","coord":[116.4582273790399,37.19372347888644]},{"name":"沧州市","coord":[116.76192710911863,38.20240042039232]},{"name":"廊坊市","coord":[116.50410772133856,39.27896741763884]},{"name":"天津市","coord":[117.31988934444873,39.37154482470619]},{"name":"北京市","coord":[116.59734730757869,40.237112944270976]},{"name":"张家口市","coord":[115.1823606483226,40.83732566607167]},{"name":"唐山市","coord":[117.8693184261954,39.71862889477249]},{"name":"秦皇岛市","coord":[119.30467355367742,39.990574652162564]},{"name":"承德市","coord":[117.16275671911026,41.36623845548547]},{"name":"葫芦岛市","coord":[119.9342336210531,40.5628822626519]},{"name":"朝阳市","coord":[120.11853493535794,41.471852354885755]},{"name":"赤峰市","coord":[118.50943546234379,43.25452976059767]},{"name":"锦州市","coord":[121.5167549323861,41.45933087433065]},{"name":"营口市","coord":[122.58571915054674,40.42093503997384]},{"name":"丹东市","coord":[124.33549382902183,40.46369290272115]},{"name":"辽阳市","coord":[123.34064798039414,41.152331397771356]},{"name":"盘锦市","coord":[122.06718005354679,41.05573599862555]},{"name":"阜新市","coord":[121.93889757908204,42.27641773244204]},{"name":"鞍山市","coord":[122.78904432242356,40.77781183142038]},{"name":"沈阳市","coord":[122.99508899709724,42.1162195010079]},{"name":"铁岭市","coord":[124.23100515588399,42.72666083611828]},{"name":"扶顺市","coord":[124.46027188217573,41.82955407638859]},{"name":"通辽市","coord":[122.0729370657937,43.90889130864869]},{"name":"兴安盟","coord":[120.79456431092532,45.92003249442161]},{"name":"白城市","coord":[123.10619907715235,45.25475749267784]},{"name":"齐齐哈尔市","coord":[124.5462214659102,47.55395009317394]},{"name":"大兴安岭地区","coord":[124.50992855161529,52.18438447846694]},{"name":"黑河市","coord":[127.14721400335922,49.25080134026901]},{"name":"大庆市","coord":[124.40329830095243,46.401048760966745]},{"name":"绥化市","coord":[126.5214484055605,46.76992452194825]},{"name":"松原市","coord":[124.21244334807682,44.75779381338502]},{"name":"四平市","coord":[124.27839350328821,43.52139065090318]},{"name":"通化市","coord":[125.67392830706305,41.91771808663852]},{"name":"辽源市","coord":[125.33529527643432,42.758340204944986]},{"name":"吉林市","coord":[126.83350281902375,43.60730120049175]},{"name":"长春市","coord":[125.53597875970374,44.24624314701737]},{"name":"白山市","coord":[127.16780160322108,42.093893880305075]},{"name":"哈尔滨市","coord":[127.39125008786029,45.36200668820575]},{"name":"鹤岗市","coord":[130.4703811258197,47.66520688940109]},{"name":"伊春市","coord":[128.91240831703635,47.93833794565277]},{"name":"七台河市","coord":[131.2677920224311,45.945099776108584]},{"name":"鸡西市","coord":[132.38059153660274,45.722934218318535]},{"name":"双鸭山市","coord":[132.3184817002743,46.65813679030265]},{"name":"佳木斯市","coord":[132.26174446608726,47.17569713691394]},{"name":"呼伦贝尔市","coord":[122.3210739998419,50.18176996070858]},{"name":"孝感市","coord":[113.83749892135485,31.11757234692128]},{"name":"贵港市","coord":[110.07354588052804,23.380735604767374]},{"name":"黔南布依族苗族自","coord":[107.30931767543106,26.2976919432269]},{"name":"宁德市","coord":[119.52482556634342,27.013151692716413]},{"name":"温州市","coord":[120.30037042732202,27.8699145504001]},{"name":"台州市","coord":[120.88886782713843,28.670799172772313]},{"name":"丽水市","coord":[119.56796851966463,28.170268394477755]},{"name":"衢州市","coord":[118.79479802644406,28.865874397158763]},{"name":"金华市","coord":[119.99381920686633,29.093455548185744]},{"name":"绍兴市","coord":[120.46546691682343,29.69382513836818]},{"name":"宁波市","coord":[121.42142987830871,29.70001162878972]},{"name":"杭州市","coord":[119.4405685790891,29.87218307296989]},{"name":"宣城市","coord":[118.68748382914703,30.628143499626418]},{"name":"湖州市","coord":[119.98261306633574,30.7945175862809]},{"name":"嘉兴市","coord":[120.83889215988998,30.67538495499343]},{"name":"上海市","coord":[121.37534147322967,31.25628247908459]},{"name":"苏州市","coord":[120.6906182622391,31.381280695137775]},{"name":"无锡市","coord":[120.32182300914366,31.54113306724517]},{"name":"常州市","coord":[119.61953292830165,31.611878565375576]},{"name":"南京市","coord":[118.71890548838064,31.910863187910323]},{"name":"镇江市","coord":[119.42349332902813,31.97942313430778]},{"name":"合肥市","coord":[117.30651975617157,31.79407863049138]},{"name":"六安市","coord":[116.24668220575353,31.820846193819513]},{"name":"滁州市","coord":[117.88422385307969,32.51792621904418]},{"name":"泰州市","coord":[120.03124303305091,32.56503102346783]},{"name":"南通市","coord":[120.85599446760912,32.18496706099728]},{"name":"盐城市","coord":[120.01812490612667,33.54219948734023]},{"name":"淮安市","coord":[119.0749424205415,33.39203631772854]},{"name":"宿迁市","coord":[118.45404943216346,33.666258719120265]},{"name":"徐州市","coord":[117.77482249295966,34.30847766157078]},{"name":"济宁市","coord":[116.74147276546373,35.27488504351119]},{"name":"枣庄市","coord":[117.43359942491492,34.884162021736]},{"name":"连云港市","coord":[119.01553213785074,34.54316517587849]},{"name":"临沂市","coord":[118.31478835349617,35.28173079028279]},{"name":"日照市","coord":[119.14265350444272,35.54479073199592]},{"name":"青岛市","coord":[120.27779044405756,36.3464117375903]},{"name":"威海市","coord":[122.12963327195605,37.13879077904251]},{"name":"烟台市","coord":[120.7689567423966,37.19772002195597]},{"name":"潍坊市","coord":[119.02178548592039,36.49292234053931]},{"name":"淄博市","coord":[117.92936024367185,36.60871347163638]},{"name":"泰安市","coord":[116.93810893944303,36.0423330118612]},{"name":"济南市","coord":[117.34560282551296,36.769574973846304]},{"name":"东营市","coord":[118.4915054457184,37.52194690335787]},{"name":"滨州市","coord":[117.67610299757533,37.4439597758601]},{"name":"昆明市","coord":[102.93100245594789,25.481300763922075]},{"name":"玉溪市","coord":[102.23080854291823,24.156168324611663]},{"name":"塔城地区","coord":[83.60908162840168,45.3721852373893]},{"name":"张掖市","coord":[100.47710030600572,38.704239320458385]},{"name":"南阳市","coord":[112.1400670951149,33.03033276715801]},{"name":"扬州市","coord":[119.48949608990988,32.80956776339646]},{"name":"延边朝鲜族自治州","coord":[129.3577692895626,43.24968794080283]},{"name":"牡丹江市","coord":[129.87240796405672,44.7073040108322]},{"name":"澳门","coord":[113.56289691515346,22.14602596262204]},{"name":"吴忠市","coord":[106.76894508116403,37.72566765880316]},{"name":"来宾市","coord":[109.25592217010114,23.86346274681084]},{"name":"平凉市","coord":[107.0708132782897,35.30329631658711]},{"name":"马鞍山市","coord":[118.27245878467022,31.657727937739004]},{"name":"芜湖市","coord":[118.32992684415504,31.081688223101658]},{"name":"澄迈县","coord":[110.04198076060266,19.694955078668105]},{"name":"保亭黎族苗族自治","coord":[109.6055304964257,18.6101488675304]},{"name":"乐东黎族自治县","coord":[109.04051999525574,18.643137437909203]},{"name":"儋州市","coord":[109.3431358337404,19.550974957403195]},{"name":"定安县","coord":[110.38744429685676,19.47557074114284]},{"name":"屯昌县","coord":[110.00574767630334,19.367175093044388]},{"name":"白沙黎族自治县","coord":[109.36860737761768,19.214416393082217]},{"name":"琼中黎族苗族自治","coord":[109.86691465937548,19.073671135862682]},{"name":"东方市","coord":[108.86903802405428,19.017352815445214]},{"name":"昌江黎族自治县","coord":[108.9686431884767,19.182594167127824]},{"name":"海口市","coord":[110.420654296875,19.806565564640795]},{"name":"济源市","coord":[112.38051465474433,35.07958362422394]},{"name":"五指山市","coord":[109.53595187364496,18.832908264613966]},{"name":"大连市","coord":[121.96662235866603,39.444150542439914]},{"name":"文昌市三沙市","coord":[110.81828537536748,19.756501444162936]},{"name":"三亚市","coord":[109.38424600793707,18.39186315877128]},{"name":"万宁市","coord":[110.28485046979574,18.860240588635115]},{"name":"陵水黎族自治县","coord":[109.95577603229562,18.594712684620465]},{"name":"临高县","coord":[109.71915395436967,19.79420403032508]},{"name":"琼海市","coord":[110.41650700703043,19.22315873149372]}]'),Mi=JSON.parse('[{"name":"黑龙江省","coord":[127.64559817675396,48.48668098449708]},{"name":"内蒙古自治区","coord":[118.34519572208615,45.370218276977525]},{"name":"新疆维吾尔自治区","coord":[87.13479065593184,41.75497055053711]},{"name":"吉林省","coord":[126.12985278813787,43.57983207702637]},{"name":"辽宁省","coord":[124.02494773936439,41.105743408203125]},{"name":"甘肃省","coord":[102.87785725633012,37.69582366943361]},{"name":"河北省","coord":[115.66327227481898,39.33383178710938]},{"name":"北京市","coord":[116.62199343603638,40.25053787231445]},{"name":"山西省","coord":[112.45180235808988,37.666561126708984]},{"name":"天津市","coord":[117.35711842642581,39.406789779663086]},{"name":"陕西省","coord":[109.56294003056632,35.64754199981689]},{"name":"宁夏回族自治区","coord":[105.96110877640074,37.3081169128418]},{"name":"青海省","coord":[96.07301048277901,35.44417190551758]},{"name":"山东省","coord":[118.03833752951093,36.29800605773925]},{"name":"西藏自治区","coord":[87.47361520439412,31.6703872680664]},{"name":"河南省","coord":[113.07832397097275,33.87751102447509]},{"name":"江苏省","coord":[119.93926538201052,32.945452690124505]},{"name":"安徽省","coord":[117.15146765881019,32.024482727050774]},{"name":"四川省","coord":[102.28998890142759,30.182161331176758]},{"name":"湖北省","coord":[112.87798261431585,31.157071113586426]},{"name":"重庆市","coord":[107.870126637831,30.188085556030266]},{"name":"上海市","coord":[121.42561166015514,31.276043891906745]},{"name":"浙江省","coord":[119.75337092707514,29.175934791564945]},{"name":"湖南省","coord":[111.52770282777405,27.38110256195069]},{"name":"江西省","coord":[115.51091280655628,27.283511161804206]},{"name":"云南省","coord":[101.27053825991308,25.19783210754396]},{"name":"贵州省","coord":[106.49672346773299,26.92267990112305]},{"name":"福建省","coord":[117.9976766946587,25.939599990844727]},{"name":"广西壮族自治区","coord":[108.98706831086302,23.891559600830078]},{"name":"台湾省","coord":[120.82468432537434,23.602651596069336]},{"name":"香港特别行政区","coord":[114.21036850371561,22.374858856201172]},{"name":"海南省","coord":[109.62792940960824,19.163116455078125]},{"name":"广东省","coord":[113.32127888266032,22.873867034912106]},{"name":"澳门特别行政区","coord":[113.56819996291901,22.160347992976]}]');function Ii(t){"@babel/helpers - typeof";return(Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Li(t){return function(t){if(Array.isArray(t))return ji(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ji(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ji(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ji(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:"type",r=[],n=0;n0){var o=Ui(i,e);r.push.apply(r,Li(o))}}else r.push(t[n])}return r}function Vi(t,e){var r=t.type,n=t.tiles;return"raster"===r&&(r===e.type&&n&&e.tiles&&(n[0].includes(e.tiles[0])||e.tiles[0].includes(n[0])))}function Hi(t){return t.layerInfo&&t.layerInfo.id?t.layerInfo.id:t.metadata&&t.metadata.SM_Layer_Id?t.metadata.SM_Layer_Id:t.sourceLayer||t.source||t.id}var Wi={toSuperMapGeometry:function(t){if(t&&t.type)return(new ki).read(t,"FeatureCollection")[0].geometry},toSuperMapBounds:function(t){return Ci(t)?new ye(t[0],t[1],t[2],t[3]):t instanceof O().LngLatBounds?new ye(t.getWest(),t.getSouth(),t.getEast(),t.getNorth()):t},toSuperMapPoint:function(t){return Ci(t)?new Se(t[0],t[1]):t.lng&&t.lat?new Se(t.lng,t.lat):new Se(t.geometry.coordinates[0],t.geometry.coordinates[1])},toSuperMapPolygon:function(t){var e=t.getWest(),r=t.getEast(),n=t.getSouth(),i=t.getNorth();return new dr([new sr([new Se(e,n),new Se(r,n),new Se(r,i),new Se(e,i)])])},isArray:Ci,toGeoJSON:function(t){if(t)return(new ki).toGeoJSON(t)},toProcessingParam:function(t){var e={};if(t.length<1)e="";else{for(var r=[],n=0;n1e-7;a++)e=1,o+=s=Math.PI/2-2*Math.atan(i*e)-o;return new(O().LngLat)(t[0]*r/n,o*r)},transformUrl:function(t){var e=t.url,r=t.server,n=t.excludePortalProxyUrl,i=t.credentialValue,o=t.credentialKey,a=-1===e.indexOf(".json")?"".concat(e,".json"):e,s="getUrlResource.json?url=";if(n&&r.indexOf(s)>-1){var u=r.split(s);u.length>1&&(a=u[0]+s+a)}return i&&o&&(a+="?"+o+"="+i),a}};function qi(t){"@babel/helpers - typeof";return(qi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yi(t,e){for(var r=0;r1&&(r=parseFloat(r)*l),n.labelAlign&&"cm"!==n.labelAlign)switch(n.labelAlign){case"lt":u.x+=e/2,u.y+=r/2;break;case"lm":u.x+=e/2;break;case"lb":u.x+=e/2,u.y-=r/2;break;case"ct":u.y+=r/2;break;case"cb":u.y-=r/2;break;case"rt":u.x-=e/2,u.y+=r/2;break;case"rm":u.x-=e/2;break;case"rb":u.x-=e/2,u.y-=r/2}return this.bsInfo.h=r,this.bsInfo.w=e,i=u.x-parseFloat(e)/2,o=u.y+parseFloat(r)/2,s=u.x+parseFloat(e)/2,a=u.y-parseFloat(r)/2,new ye(i,o,s,a)}},{key:"getLabelPxBoundsByText",value:function(t,e){var r,n,i,o,a=this.getLabelPxSize(e),s=$.cloneObject(t);if(e.labelAlign&&"cm"!==e.labelAlign)switch(e.labelAlign){case"lt":s.x+=a.w/2,s.y+=a.h/2;break;case"lm":s.x+=a.w/2;break;case"lb":s.x+=a.w/2,s.y-=a.h/2;break;case"ct":s.y+=a.h/2;break;case"cb":s.y-=a.h/2;break;case"rt":s.x-=a.w/2,s.y+=a.h/2;break;case"rm":s.x-=a.w/2;break;case"rb":s.x-=a.w/2,s.y-=a.h/2}return this.bsInfo.h=a.h,this.bsInfo.w=a.w,r=s.x-a.w/2,n=s.y+a.h/2,o=e.fontStyle&&"italic"===e.fontStyle?s.x+a.w/2+parseInt(parseFloat(e.fontSize)/2):s.x+a.w/2,i=s.y-a.h/2,new ye(r,n,o,i)}},{key:"getLabelPxSize",value:function(t){var e,r,n,i,o=parseFloat(t.strokeWidth);e=t.label||this.text,r=t.fontSize?parseFloat(t.fontSize):parseFloat("12px");var a=e.split("\n"),s=a.length;i=s>1?r*s+s+o+.2*r:r+o+.2*r+1,n=0,this.labelWTmp&&n255?r++:n++;return e.cnC=r,e.enC=n,e.textC=t.length,e}}])&&Yi(r.prototype,n),i&&Yi(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function to(t){"@babel/helpers - typeof";return(to="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eo(t,e){for(var r=0;r1&&(t=new Se(e[0],e[1])),new Pr(t,this.attributes)}}])&&oo(t.prototype,e),r&&oo(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function uo(t){"@babel/helpers - typeof";return(uo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lo(t,e){for(var r=0;ro&&(o=t+s+100,n.width=o,r=!0),e+u>a&&(a=e+u+100,n.height=a,r=!0),t<-s&&(o+=s=100*Math.ceil(-t/100),n.width=o,r=!0),e<-u&&(a+=u=100*Math.ceil(-e/100),n.height=a,r=!0),r&&i.translate(s,u)}},{key:"getPixelOffset",value:function(){return{x:this._offsetX,y:this._offsetY}}},{key:"indexOf",value:function(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],i=n.length,o=0;o4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],i=this._handlers[t],o=i.length,a=0;a-this.EPSILON&&tthis.EPSILON||t<-this.EPSILON}},{key:"cubicAt",value:function(t,e,r,n,i){var o=1-i;return o*o*(o*t+3*i*e)+i*i*(i*n+3*o*r)}},{key:"cubicDerivativeAt",value:function(t,e,r,n,i){var o=1-i;return 3*(((e-t)*o+2*(r-e)*i)*o+(n-r)*i*i)}},{key:"cubicRootAt",value:function(t,e,r,n,i,o){var a=n+3*(e-r)-t,s=3*(r-2*e+t),u=3*(e-t),l=t-i,c=s*s-3*a*u,f=s*u-9*a*l,h=u*u-3*s*l,p=0;if(this.isAroundZero(c)&&this.isAroundZero(f))if(this.isAroundZero(s))o[0]=0;else{var d=-u/s;d>=0&&d<=1&&(o[p++]=d)}else{var y=f*f-4*c*h;if(this.isAroundZero(y)){var v=f/c,g=-s/a+v,m=-v/2;g>=0&&g<=1&&(o[p++]=g),m>=0&&m<=1&&(o[p++]=m)}else if(y>0){var b=Math.sqrt(y),x=c*s+1.5*a*(-f+b),w=c*s+1.5*a*(-f-b),_=(-s-((x=x<0?-Math.pow(-x,this.ONE_THIRD):Math.pow(x,this.ONE_THIRD))+(w=w<0?-Math.pow(-w,this.ONE_THIRD):Math.pow(w,this.ONE_THIRD))))/(3*a);_>=0&&_<=1&&(o[p++]=_)}else{var S=(2*c*s-3*a*f)/(2*Math.sqrt(c*c*c)),E=Math.acos(S)/3,k=Math.sqrt(c),T=Math.cos(E),C=(-s-2*k*T)/(3*a),O=(-s+k*(T+this.THREE_SQRT*Math.sin(E)))/(3*a),A=(-s+k*(T-this.THREE_SQRT*Math.sin(E)))/(3*a);C>=0&&C<=1&&(o[p++]=C),O>=0&&O<=1&&(o[p++]=O),A>=0&&A<=1&&(o[p++]=A)}}return p}},{key:"cubicExtrema",value:function(t,e,r,n,i){var o=6*r-12*e+6*t,a=9*e+3*n-3*t-9*r,s=3*e-3*t,u=0;if(this.isAroundZero(a)){if(this.isNotAroundZero(o)){var l=-s/o;l>=0&&l<=1&&(i[u++]=l)}}else{var c=o*o-4*a*s;if(this.isAroundZero(c))i[0]=-o/(2*a);else if(c>0){var f=Math.sqrt(c),h=(-o+f)/(2*a),p=(-o-f)/(2*a);h>=0&&h<=1&&(i[u++]=h),p>=0&&p<=1&&(i[u++]=p)}}return u}},{key:"cubicSubdivide",value:function(t,e,r,n,i,o){var a=(e-t)*i+t,s=(r-e)*i+e,u=(n-r)*i+r,l=(s-a)*i+a,c=(u-s)*i+s,f=(c-l)*i+l;o[0]=t,o[1]=a,o[2]=l,o[3]=f,o[4]=f,o[5]=c,o[6]=u,o[7]=n}},{key:"cubicProjectPoint",value:function(t,e,r,n,i,o,a,s,u,l,c){var f,h=this.vector.create(),p=this.vector.create(),d=this.vector.create(),y=.005,v=1/0;h[0]=u,h[1]=l;for(var g=0;g<1;g+=.05){p[0]=this.cubicAt(t,r,i,a,g),p[1]=this.cubicAt(e,n,o,s,g);var m=this.vector.distSquare(h,p);m=0&&_=0&&l<=1&&(i[u++]=l)}}else{var c=a*a-4*o*s;if(this.isAroundZero(c)){var f=-a/(2*o);f>=0&&f<=1&&(i[u++]=f)}else if(c>0){var h=Math.sqrt(c),p=(-a+h)/(2*o),d=(-a-h)/(2*o);p>=0&&p<=1&&(i[u++]=p),d>=0&&d<=1&&(i[u++]=d)}}return u}},{key:"quadraticExtremum",value:function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n}},{key:"quadraticProjectPoint",value:function(t,e,r,n,i,o,a,s,u){var l,c=this.vector.create(),f=this.vector.create(),h=this.vector.create(),p=.005,d=1/0;c[0]=a,c[1]=s;for(var y=0;y<1;y+=.05){f[0]=this.quadraticAt(t,r,i,y),f[1]=this.quadraticAt(e,n,o,y);var v=this.vector.distSquare(c,f);v=0&&x0){for(var m=this.isInsidePolygon(e.pointList,v,g),b=t.holePolygonPointLists,x=!1,w=0,_=b.length;w<_;w++){var S=b[w];!0===this.isInsidePolygon(S,v,g)&&(x=!0)}return!0===m&&!1===x}return this.isInsidePolygon(e.pointList,v,g);case"text":var E=e.__rect||t.getRect(e);return this.isInsideRect(E.x,E.y,E.width,E.height,r,n);case"smictext":var k=t.getTextBackground(e);return this.isInsidePolygon(k,r,n);case"rectangle":case"image":return this.isInsideRect(e.x,e.y,e.width,e.height,r,n);case"smicimage":var T=e.x,C=e.y;return t.refOriginalPosition&&(T=e.x+t.refOriginalPosition[0],C=e.y+t.refOriginalPosition[1]),this.isInsideRect(T,C,e.width,e.height,r,n)}}},{key:"_buildPathMethod",value:function(t,e,r,n,i){return e.beginPath(),t.buildPath(e,r),e.closePath(),e.isPointInPath(n,i)}},{key:"isOutside",value:function(t,e,r,n){return!this.isInside(t,e,r,n)}},{key:"isInsideLine",value:function(t,e,r,n,i,o,a){if(0===i)return!1;var s=Math.max(i,5),u=0;if(a>e+s&&a>n+s||at+s&&o>r+s||oe+f&&c>n+f&&c>o+f&&c>s+f||ct+f&&l>r+f&&l>i+f&&l>a+f||le+l&&u>n+l&&u>o+l||ut+l&&s>r+l&&s>i+l||sr||f+c=l)return!0;if(o){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=l);var p=Math.atan2(u,s);return p<0&&(p+=l),p>=n&&p<=i||p+l>=n&&p+l<=i}},{key:"isInsideBrokenLine",value:function(t,e,r,n){for(var i=Math.max(e,10),o=0,a=t.length-1;or*r}},{key:"isInsideRect",value:function(t,e,r,n,i,o){return i>=t&&i<=t+r&&o>=e&&o<=e+n}},{key:"isInsideCircle",value:function(t,e,r,n,i){return(n-t)*(n-t)+(i-e)*(i-e)e&&o>n||oi?ne&&l>n&&l>o&&l>s||l1&&this.swapExtrema(),d=c.cubicAt(e,n,o,s,h[0]),g>1&&(y=c.cubicAt(e,n,o,s,h[1]))),2==g?be&&s>n&&s>o||s=0&&f<=1){for(var h=0,p=u.quadraticAt(e,n,o,f),d=0;da||(l[d]a?0:or||s<-r)return 0;var c=Math.sqrt(r*r-s*s);if(u[0]=-c,u[1]=c,Math.abs(n-i)>=l){n=0,i=l;var f=o?1:-1;return a>=u[0]+t&&a<=u[1]+t?f:0}if(o){var h=n;n=this.normalizeRadian(i),i=this.normalizeRadian(h)}else n=this.normalizeRadian(n),i=this.normalizeRadian(i);n>i&&(i+=l);for(var p=0,d=0;d<2;d++){var y=u[d];if(y+t>a){var v=Math.atan2(s,y),g=o?1:-1;v<0&&(v=l+v),(v>=n&&v<=i||v+l>=n&&v+l<=i)&&(v>Math.PI/2&&v<1.5*Math.PI&&(g=-g),p+=g)}}return p}},{key:"isInsidePath",value:function(t,e,r,n,i){for(var o=0,a=0,s=0,u=0,l=0,c=!0,f=!0,h="stroke"===(r=r||"fill")||"both"===r,p="fill"===r||"both"===r,d=0;d0&&(p&&(o+=this.windingLine(a,s,u,l,n,i)),0!==o))return!0;u=v[v.length-2],l=v[v.length-1],c=!1,f&&"A"!==y.command&&(f=!1,a=u,s=l)}switch(y.command){case"M":a=v[0],s=v[1];break;case"L":if(h&&this.isInsideLine(a,s,v[0],v[1],e,n,i))return!0;p&&(o+=this.windingLine(a,s,v[0],v[1],n,i)),a=v[0],s=v[1];break;case"C":if(h&&this.isInsideCubicStroke(a,s,v[0],v[1],v[2],v[3],v[4],v[5],e,n,i))return!0;p&&(o+=this.windingCubic(a,s,v[0],v[1],v[2],v[3],v[4],v[5],n,i)),a=v[4],s=v[5];break;case"Q":if(h&&this.isInsideQuadraticStroke(a,s,v[0],v[1],v[2],v[3],e,n,i))return!0;p&&(o+=this.windingQuadratic(a,s,v[0],v[1],v[2],v[3],n,i)),a=v[2],s=v[3];break;case"A":var g=v[0],m=v[1],b=v[2],x=v[3],w=v[4],_=v[5],S=Math.cos(w)*b+g,E=Math.sin(w)*x+m;f?(f=!1,u=S,l=E):o+=this.windingLine(a,s,S,E);var k=(n-g)*x/b+g;if(h&&this.isInsideArcStroke(g,m,x,w,w+_,1-v[7],e,k,i))return!0;p&&(o+=this.windingArc(g,m,x,w,w+_,1-v[7],k,i)),a=Math.cos(w+_)*b+g,s=Math.sin(w+_)*x+m;break;case"z":if(h&&this.isInsideLine(a,s,u,l,e,n,i))return!0;c=!0}}return p&&(o+=this.windingLine(a,s,u,l,n,i)),0!==o}},{key:"getTextWidth",value:function(t,e){var r=t+":"+e;if(this._textWidthCache[r])return this._textWidthCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,i=0,o=(t=(t+"").split("\n")).length;ithis.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}},{key:"getTextHeight",value:function(t,e){var r=t+":"+e;if(this._textHeightCache[r])return this._textHeightCache[r];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e),t=(t+"").split("\n");var n=(this._ctx.measureText("ZH").width+2)*t.length;return this._ctx.restore(),this._textHeightCache[r]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}}])&&To(t.prototype,e),r&&To(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ao(t){"@babel/helpers - typeof";return(Ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Po(t,e){for(var r=0;r1)for(var i=0,o=n-1;i1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}}},{key:"toArray",value:function(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],r=0;return t.replace(/[\d.]+/g,function(t){r<3?t|=0:t=+t,e[r++]=t}),e}},{key:"convert",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?r=this._RGB_2_HSB(r):e.indexOf("hsl")>-1&&(r=this._RGB_2_HSL(r)),r[3]=n,this.toColor(r,e)}},{key:"toRGBA",value:function(t){return this.convert(t,"rgba")}},{key:"toRGB",value:function(t){return this.convert(t,"rgb")}},{key:"toHex",value:function(t){return this.convert(t,"hex")}},{key:"toHSVA",value:function(t){return this.convert(t,"hsva")}},{key:"toHSV",value:function(t){return this.convert(t,"hsv")}},{key:"toHSBA",value:function(t){return this.convert(t,"hsba")}},{key:"toHSB",value:function(t){return this.convert(t,"hsb")}},{key:"toHSLA",value:function(t){return this.convert(t,"hsla")}},{key:"toHSL",value:function(t){return this.convert(t,"hsl")}},{key:"toName",value:function(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}},{key:"trim",value:function(t){return String(t).replace(/\s+/g,"")}},{key:"normalize",value:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t}},{key:"lift",value:function(t,e){if(!this.isCalculableColor(t))return t;var r=e>0?1:-1;void 0===e&&(e=0),e=Math.abs(e)>1?1:Math.abs(e),t=this.toRGB(t);for(var n=this.getData(t),i=0;i<3;i++)n[i]=1===r?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return"rgb("+n.join(",")+")"}},{key:"reverse",value:function(t){if(!this.isCalculableColor(t))return t;var e=this.getData(this.toRGBA(t));return e=this.map(e,function(t){return 255-t}),this.toColor(e,"rgb")}},{key:"mix",value:function(t,e,r){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===r&&(r=.5);for(var n=2*(r=1-this.adjust(r,[0,1]))-1,i=this.getData(this.toRGBA(t)),o=this.getData(this.toRGBA(e)),a=i[3]-o[3],s=((n*a==-1?n:(n+a)/(1+n*a))+1)/2,u=1-s,l=[],c=0;c<3;c++)l[c]=i[c]*s+o[c]*u;var f=i[3]*r+o[3]*(1-r);return f=Math.max(0,Math.min(1,f)),1===i[3]&&1===o[3]?this.toColor(l,"rgb"):(l[3]=f,this.toColor(l,"rgba"))}},{key:"random",value:function(){return"#"+Math.random().toString(16).slice(2,8)}},{key:"getData",value:function(e){var r,n,i=(e=this.normalize(e)).match(this.colorRegExp);if(null===i)throw new Error("The color format error");var o,a=[];if(i[2])o=[(r=i[2].replace("#","").split(""))[0]+r[1],r[2]+r[3],r[4]+r[5]],a=this.map(o,function(e){return t.prototype.adjust.call(this,parseInt(e,16),[0,255])});else if(i[4]){var s=i[4].split(",");n=s[3],o=s.slice(0,3),a=this.map(o,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),t.prototype.adjust.call(this,e,[0,255])}),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}else if(i[5]||i[6]){var u=(i[5]||i[6]).split(","),l=parseInt(u[0],0)/360,c=u[1],f=u[2];n=u[3],(a=this.map([c,f],function(e){return t.prototype.adjust.call(this,parseFloat(e)/100,[0,1])})).unshift(l),void 0!==n&&a.push(this.adjust(parseFloat(n),[0,1]))}return a}},{key:"alpha",value:function(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var r=this.getData(this.toRGBA(t));return r[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(r,"rgba")}},{key:"map",value:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t}},{key:"isCalculableColor",value:function(t){return t instanceof Array||"string"==typeof t}},{key:"_HSV_2_RGB",value:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s=6*i;6===s&&(s=0);var u=0|s,l=a*(1-o),c=a*(1-o*(s-u)),f=a*(1-o*(1-(s-u))),h=0,p=0,d=0;0===u?(h=a,p=f,d=l):1===u?(h=c,p=a,d=l):2===u?(h=l,p=a,d=f):3===u?(h=l,p=c,d=a):4===u?(h=f,p=l,d=a):(h=a,p=l,d=c),e=255*h,r=255*p,n=255*d}return[e,r,n]}},{key:"_HSL_2_RGB",value:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+o):a+o-o*a);e=255*this._HUE_2_RGB(u,s,i+1/3),r=255*this._HUE_2_RGB(u,s,i),n=255*this._HUE_2_RGB(u,s,i-1/3)}return[e,r,n]}},{key:"_HUE_2_RGB",value:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}},{key:"_RGB_2_HSB",value:function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a,l=s;if(0===u)e=0,r=0;else{r=u/s;var c=((s-n)/6+u/2)/u,f=((s-i)/6+u/2)/u,h=((s-o)/6+u/2)/u;n===s?e=h-f:i===s?e=1/3+c-h:o===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}},{key:"_RGB_2_HSL",value:function(t){var e,r,n=t[0]/255,i=t[1]/255,o=t[2]/255,a=Math.min(n,i,o),s=Math.max(n,i,o),u=s-a,l=(s+a)/2;if(0===u)e=0,r=0;else{r=l<.5?u/(s+a):u/(2-s-a);var c=((s-n)/6+u/2)/u,f=((s-i)/6+u/2)/u,h=((s-o)/6+u/2)/u;n===s?e=h-f:i===s?e=1/3+c-h:o===s&&(e=2/3+f-c),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,r*=100,l*=100]}}])&&Po(e.prototype,r),n&&Po(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Lo(t){"@babel/helpers - typeof";return(Lo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jo(t,e){for(var r=0;ri&&(i=u[0]),u[1]a&&(a=u[1])}e[0]=n,e[1]=o,r[0]=i,r[1]=a}}},{key:"cubeBezier",value:function(t,e,r,n,i,o){var a=new Eo,s=[];a.cubicExtrema(t[0],e[0],r[0],n[0],s);for(var u=0;ui&&!o?i+=2*Math.PI:nn&&(f[0]=Math.cos(p)*r+t,f[1]=Math.sin(p)*r+e,u.min(a,f,a),u.max(s,f,s))}}])&&jo(t.prototype,e),r&&jo(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Do(t){"@babel/helpers - typeof";return(Do="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bo(t,e){for(var r=0;r=200&&i.status<300||304===i.status?e&&e(i.responseText):r&&r(),i.onreadystatechange=new Function,i=null)},i.send(null)}}])&&qo(t.prototype,e),r&&qo(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Zo(t){"@babel/helpers - typeof";return(Zo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ko(t,e){for(var r=0;r1)for(var e in arguments)console.log(arguments[e])}},(e=[{key:"destory",value:function(){return!0}}])&&ta(t.prototype,e),r&&ta(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function na(t){"@babel/helpers - typeof";return(na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ia(t,e){for(var r=0;ra-2?a-1:p+1][0]+o[0],e[p>a-2?a-1:p+1][1]+o[1]],m=[e[p>a-3?a-1:p+2][0]+o[0],e[p>a-3?a-1:p+2][1]+o[1]]);var b=d*d,x=d*b;s.push([w(y[0],v[0],g[0],m[0],d,b,x),w(y[1],v[1],g[1],m[1],d,b,x)])}return s;function w(t,e,r,n,i,o,a){var s=.5*(r-t),u=.5*(n-e);return(2*(e-r)+s+u)*a+(-3*(e-r)-2*s-u)*o+s*i+e}}},{key:"SUtil_dashedLineTo",value:function(t,e,r,n,i,o,a){var s=[5,5];if(o="number"!=typeof o?5:o,t.setLineDash)return s[0]=o,s[1]=o,a&&a instanceof Array?t.setLineDash(a):t.setLineDash(s),t.moveTo(e,r),void t.lineTo(n,i);var u=n-e,l=i-r,c=Math.floor(Math.sqrt(u*u+l*l)/o);u/=c,l/=c;for(var f=!0,h=0;h-5e-5&&t<5e-5}da.Util_vector.sub(e,t,this.position),n(e[0])&&n(e[1])||(da.Util_vector.normalize(e,e),r[2]=e[0]*this.scale[1],r[3]=e[1]*this.scale[1],r[0]=e[1]*this.scale[0],r[1]=-e[0]*this.scale[0],r[4]=this.position[0],r[5]=this.position[1],this.decomposeTransform())})},(e=[{key:"destroy",value:function(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}},{key:"updateNeedTransform",value:function(){function t(t){return t>5e-5||t<-5e-5}this.needLocalTransform=t(this.rotation[0])||t(this.position[0])||t(this.position[1])||t(this.scale[0]-1)||t(this.scale[1]-1)}},{key:"updateTransform",value:function(){if(this.updateNeedTransform(),this.parent?this.needTransform=this.needLocalTransform||this.parent.needTransform:this.needTransform=this.needLocalTransform,this.needTransform){var t=[0,0],e=this.transform||da.Util_matrix.create();if(da.Util_matrix.identity(e),this.needLocalTransform){if(i(this.scale[0])||i(this.scale[1])){t[0]=-this.scale[2]||0,t[1]=-this.scale[3]||0;var r=i(t[0])||i(t[1]);r&&da.Util_matrix.translate(e,e,t),da.Util_matrix.scale(e,e,this.scale),r&&(t[0]=-t[0],t[1]=-t[1],da.Util_matrix.translate(e,e,t))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){t[0]=-this.rotation[1]||0,t[1]=-this.rotation[2]||0;var n=i(t[0])||i(t[1]);n&&da.Util_matrix.translate(e,e,t),da.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],da.Util_matrix.translate(e,e,t))}}else 0!=+this.rotation&&da.Util_matrix.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&da.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?da.Util_matrix.mul(this.transform,this.parent.transform,this.transform):da.Util_matrix.copy(this.transform,this.parent.transform))}function i(t){return t>5e-5||t<-5e-5}}},{key:"setTransform",value:function(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}},{key:"decomposeTransform",value:function(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],r=this.position,n=this.scale,i=this.rotation;a(e-1)&&(e=Math.sqrt(e));var o=t[2]*t[2]+t[3]*t[3];a(o-1)&&(o=Math.sqrt(o)),r[0]=t[4],r[1]=t[5],n[0]=e,n[1]=o,n[2]=n[3]=0,i[0]=Math.atan2(-t[1]/o,t[0]/e),i[1]=i[2]=0}function a(t){return t>5e-5||t<-5e-5}}}])&&va(t.prototype,e),r&&va(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ba(t){"@babel/helpers - typeof";return(ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xa(t,e){for(var r=0;r0}},{key:"addRoot",value:function(t){t instanceof Ta&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}},{key:"delRoot",value:function(t){if(void 0===t){for(var e=0;e=0&&(this.delFromMap(o.id),this._roots.splice(a,1),o instanceof Ta&&o.delChildrenFromStorage(this))}}},{key:"addToMap",value:function(t){return t instanceof Ta&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}},{key:"get",value:function(t){return this._elements[t]}},{key:"delFromMap",value:function(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof Ta&&(e._storage=null)),this}},{key:"dispose",value:function(){this._elements=null,this._roots=null,this._hoverElements=null}}])&&Oa(e.prototype,r),n&&Oa(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Ma(t){"@babel/helpers - typeof";return(Ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ia(t,e){for(var r=0;r1},isLeftClick:function(t){return t.which&&1===t.which||t.button&&1===t.button},isRightClick:function(t){return t.which&&3===t.which||t.button&&2===t.button},stop:function(t,e){e||(t.preventDefault?t.preventDefault():t.returnValue=!1),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},findElement:function(t,e){for(var r=Va.element(t);r.parentNode&&(!r.tagName||r.tagName.toUpperCase()!=e.toUpperCase());)r=r.parentNode;return r},observe:function(t,e,r,n){var i=$.getElement(t);if(n=n||!1,"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.attachEvent)&&(e="keydown"),this.observers||(this.observers={}),!i._eventCacheID){var o="eventCacheID_";i.id&&(o=i.id+"_"+o),i._eventCacheID=$.createUniqueID(o)}var a=i._eventCacheID;this.observers[a]||(this.observers[a]=[]),this.observers[a].push({element:i,name:e,observer:r,useCapture:n}),i.addEventListener?"mousewheel"===e?i.addEventListener(e,r,{useCapture:n,passive:!1}):i.addEventListener(e,r,n):i.attachEvent&&i.attachEvent("on"+e,r)},stopObservingElement:function(t){var e=$.getElement(t)._eventCacheID;this._removeElementObservers(Va.observers[e])},_removeElementObservers:function(t){if(t)for(var e=t.length-1;e>=0;e--){var r=t[e],n=new Array(r.element,r.name,r.observer,r.useCapture);Va.stopObserving.apply(this,n)}},stopObserving:function(t,e,r,n){n=n||!1;var i=$.getElement(t),o=i._eventCacheID;"keypress"===e&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||i.detachEvent)&&(e="keydown");var a=!1,s=Va.observers[o];if(s)for(var u=0;!a&&u0&&(this.setCtxGlobalAlpha(t,"stroke",r),t.stroke()),this.setCtxGlobalAlpha(t,"reset",r);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",r),r.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",r);break;default:this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)}this.drawText(t,r,this.style),this.afterBrush(t)}},{key:"beforeBrush",value:function(t,e){var r=this.style;return this.brushTypeOnly&&(r.brushType=this.brushTypeOnly),e&&(r=this.getHighlightStyle(r,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(r.strokeColor=r.strokeColor||r.color),t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r}},{key:"afterBrush",value:function(t){t.restore()}},{key:"setContext",value:function(t,e){for(var r=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,i=r.length;n=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&da.Util_area.isInside(this,this.style,t,e)}},{key:"drawText",value:function(t,r,n){if(void 0!==r.text&&!1!==r.text){var i=r.textColor||r.color||r.strokeColor;t.fillStyle=i;var o,a,s,u,l=10,c=r.textPosition||this.textPosition||"top",f=[];switch(f=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],c){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var h=(n||r).__rect||this.getRect(n||r);switch(c){case"inside":s=h.x+h.width/2,u=h.y+h.height/2,o="center",a="middle","stroke"!=r.brushType&&i==r.color&&(t.fillStyle="#fff");break;case"left":s=h.x-l,u=h.y+h.height/2,o="end",a="middle";break;case"right":s=h.x+h.width+l,u=h.y+h.height/2,o="start",a="middle";break;case"top":s=h.x+h.width/2,u=h.y-l,o="center",a="bottom";break;case"bottom":s=h.x+h.width/2,u=h.y+h.height+l,o="center",a="top"}}break;case"start":case"end":var p=0,d=0,y=0,v=0;if(void 0!==r.pointList){var g=r.pointList;if(g.length<2)return;var m=g.length;switch(c){case"start":p=g[0][0]+f[0],d=g[1][0]+f[0],y=g[0][1]+f[1],v=g[1][1]+f[1];break;case"end":p=g[m-2][0]+f[0],d=g[m-1][0]+f[0],y=g[m-2][1]+f[1],v=g[m-1][1]+f[1]}}else p=r.xStart+f[0]||0,d=r.xEnd+f[0]||0,y=r.yStart+f[1]||0,v=r.yEnd+f[1]||0;switch(c){case"start":o=p0&&t>this._zlevelList[0]){for(i=0;it);i++);n=this._layers[this._zlevelList[i]]}this._zlevelList.splice(i+1,0,t),e=new Ts($.createUniqueID("_levelLayer_"+t),this);var o=n?n.dom:this._bgDom;o.nextSibling?o.parentNode.insertBefore(e.dom,o.nextSibling):o.parentNode.appendChild(e.dom),e.initContext(),this._layers[t]=e,this._layerConfig[t]&&(new fo).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}},{key:"getLayers",value:function(){return this._layers}},{key:"_updateLayerStatus",value:function(t){var e=this._layers,r={};for(var n in e)"hover"!==n&&(r[n]=e[n].elCount,e[n].elCount=0);for(var i=0;i0?1.1:1/1.1,r=this.painter.getLayers(),n=!1;for(var i in r)if("hover"!==i){var o=r[i],a=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var s=o.__zoom;s*=e,e=(s=Math.max(Math.min(o.maxZoom,s),o.minZoom))/o.__zoom,o.__zoom=s,a[0]-=(this._mouseX-a[0])*(e-1),a[1]-=(this._mouseY-a[1])*(e-1),o.scale[0]*=e,o.scale[1]*=e,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,Qo.EVENT.MOUSEWHEEL,t),this._mousemoveHandler(t)},mousemove:function(t){this._clickThreshold++,t=this._zrenderEventFixed(t),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=da.Util_event.getX(t),this._mouseY=da.Util_event.getY(t);var e=this._mouseX-this._lastX,r=this._mouseY-this._lastY;this._processDragStart(t),this._hasfound=0,this._event=t,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(t),this._processDragLeave(t)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var n="";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,e,r),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var i=this.painter.getLayers(),o=!1;for(var a in i)if("hover"!==a){var s=i[a];s.panable&&(n="move",s.position[0]+=e,s.position[1]+=r,o=!0,s.dirty=!0)}o&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?n="move":this._hasfound&&this._lastHover.clickable&&(n="pointer"),this.root.style.cursor=n,this._dispatchAgency(this._lastHover,Qo.EVENT.MOUSEMOVE,t),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()},mouseout:function(t){var e=(t=this._zrenderEventFixed(t)).toElement||t.relatedTarget;if(e!=this.root)for(;e&&9!=e.nodeType;){if(e==this.root)return void this._mousemoveHandler(t);e=e.parentNode}t.zrenderX=this._lastX,t.zrenderY=this._lastY,this.root.style.cursor="",this._isMouseDown=0,this._processOutShape(t),this._processDrop(t),this._processDragEnd(t),this.painter.refreshHover(),this.dispatch(Qo.EVENT.GLOBALOUT,t)},mousedown:function(t){if(this._clickThreshold=0,2==this._lastDownButton)return this._lastDownButton=t.button,void(this._mouseDownTarget=null);this._lastMouseDownMoment=new Date,t=this._zrenderEventFixed(t),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,Qo.EVENT.MOUSEDOWN,t),this._lastDownButton=t.button},mouseup:function(t){t=this._zrenderEventFixed(t),this.root.style.cursor="",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,Qo.EVENT.MOUSEUP,t),this._processDrop(t),this._processDragEnd(t)},touchstart:function(t){t=this._zrenderEventFixed(t,!0),this._lastTouchMoment=new Date,this._mobildFindFixed(t),this._mousedownHandler(t)},touchmove:function(t){t=this._zrenderEventFixed(t,!0),this._mousemoveHandler(t),this._isDragging&&da.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment=0;i--){var o=r[i];if(void 0!==o.zlevel&&(t=this.painter.getLayer(o.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(da.Util_matrix.invert(e,t.transform),da.Util_vector.applyTransform(n,n,e))),this._findHover(o,n[0],n[1]))break}}},{key:"_mobildFindFixed",value:function(t){var e=[{x:10},{x:-20},{x:10,y:10},{y:-20}];this._lastHover=null,this._mouseX=t.zrenderX,this._mouseY=t.zrenderY,this._event=t,this._iterateAndFindHover();for(var r=0;!this._lastHover&&r=0&&this._clips.splice(e,1)}},{key:"_update",value:function(){for(var t=(new Date).getTime(),e=t-this._time,r=this._clips,n=r.length,i=[],o=[],a=0;a=0&&!(y[x]<=a);x--);x=Math.min(x,l-2)}else{for(x=T;xa);x++);x=Math.min(x-1,l-2)}T=x,C=a;var s=y[x+1]-y[x];if(0!==s){var c,d;for(w=(a-y[x])/s,o?(S=v[x],_=v[0===x?x:x-1],E=v[x>l-2?l-1:x+1],k=v[x>l-3?l-1:x+2],f?Ks._catmullRomInterpolateArray(_,S,E,k,w,w*w,w*w*w,n(t,u),p):(c=h?Ks.rgba2String(O):Ks._catmullRomInterpolate(_,S,E,k,w,w*w,w*w*w),r(t,u,c))):f?Ks._interpolateArray(v[x],v[x+1],w,n(t,u),p):(h?(Ks._interpolateArray(v[x],v[x+1],w,O,1),d=Ks.rgba2String(O)):d=Ks._interpolateNumber(v[x],v[x+1],w),r(t,u,d)),x=0;x=0;e--)t[e].destroy()}}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,this.display(t),this.redrawThematicFeatures(this.map.getBounds()))}},{key:"display",value:function(t){this.div.style.display=t?"block":"none"}},{key:"setOpacity",value:function(t){if(t!==this.opacity){this.opacity=t;var e=this.div;$.modifyDOMElement(e,null,null,null,null,null,null,t),null!==this.map&&O().Evented.prototype.fire("changelayer",{layer:this,property:"opacity"})}}},{key:"addFeatures",value:function(t){}},{key:"removeFeatures",value:function(t){var e=this;if(t){if(t===e.features)return e.removeAllFeatures();$.isArray(t)||"function"==typeof t||(t=[t]);for(var r=[],n=0;n=r.left&&a.x<=r.right&&a.y>=r.top&&a.y<=r.bottom){n=!0;break}}return n}},{key:"clearCache",value:function(){this.cache={},this.charts=[]}},{key:"removeFeatures",value:function(t){this.clearCache(),mu(bu(e.prototype),"removeFeatures",this).call(this,t)}},{key:"removeAllFeatures",value:function(){this.clearCache(),mu(bu(e.prototype),"removeAllFeatures",this).call(this)}},{key:"redraw",value:function(){return this.clearCache(),!!this.renderer&&(this.redrawThematicFeatures(this.map.getBounds()),!0)}},{key:"clear",value:function(){this.renderer&&(this.renderer.clearAll(),this.renderer.refresh()),this.removeAllFeatures(),this.clearCache()}}])&&yu(r.prototype,n),i&&yu(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function _u(t){"@babel/helpers - typeof";return(_u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Su(t,e){for(var r=0;rn&&(n=u[0]),u[1]i&&(i=u[1]))}return t.__rect={x:e,y:r,width:n-e,height:i-r},t.__rect}},{key:"getRectNoRotation",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition,n=da.Util_area.getTextHeight("ZH",t.textFont),i=da.Util_area.getTextWidth(t.text,t.textFont),o=da.Util_area.getTextHeight(t.text,t.textFont),a=t.x+r[0];"end"==t.textAlign||"right"==t.textAlign?a-=i:"center"==t.textAlign&&(a-=i/2),e="top"==t.textBaseline?t.y+r[1]:"bottom"==t.textBaseline?t.y+r[1]-o:t.y+r[1]-o/2;var s,u=!1;if(t.maxWidth){var l=parseInt(t.maxWidth);l-1&&(i+=!0===u?n/3*(i/s):n/3));return{x:a,y:e,width:i,height:o}}},{key:"getTextBackground",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;if(!e&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),i=t.x+r[0],o=t.y+r[1],a=[];if(t.textRotation&&0!==t.textRotation){var s=t.textRotation,u=this.getRotatedLocation(n.x,n.y,i,o,s),l=this.getRotatedLocation(n.x+n.width,n.y,i,o,s),c=this.getRotatedLocation(n.x+n.width,n.y+n.height,i,o,s),f=this.getRotatedLocation(n.x,n.y+n.height,i,o,s);a.push(u),a.push(l),a.push(c),a.push(f)}else{var h=[n.x,n.y],p=[n.x+n.width,n.y],d=[n.x+n.width,n.y+n.height],y=[n.x,n.y+n.height];a.push(h),a.push(p),a.push(d),a.push(y)}return t.__textBackground=a,t.__textBackground}},{key:"getRotatedLocation",value:function(t,e,r,n,i){var o,a,s=new Array;return e=-e,n=-n,i=-i,o=(t-r)*Math.cos(i/180*Math.PI)-(e-n)*Math.sin(i/180*Math.PI)+r,a=(t-r)*Math.sin(i/180*Math.PI)+(e-n)*Math.cos(i/180*Math.PI)+n,s[0]=o,s[1]=-a,s}}])&&Wl(r.prototype,n),i&&Wl(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Ql(t){"@babel/helpers - typeof";return(Ql="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $l(t,e){for(var r=0;r0&&("stroke"==r.brushType||"both"==r.brushType)&&(n||(t.beginPath(),this.buildPath(t,r)),this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)),this.drawText(t,r,this.style);var i=$.cloneObject(r);if(i.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,a=o.length,s=0;s0&&("stroke"==i.brushType||"both"==i.brushType)?(n||(t.beginPath(),this.buildPath(t,i)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",i),t.stroke(),this.setCtxGlobalAlpha(t,"reset",i)):t.globalCompositeOperation="source-over"}t.restore()}},{key:"buildPath",value:function(t,e){e.showShadow&&(t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY),this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var i,o,a,s=da.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,r);t.moveTo(n[0][0]+r[0],n[0][1]+r[1]);for(var u=n.length,l=0;lo&&(o=u[l][0]+r[0]),u[l][1]+r[1]s&&(s=u[l][1]+r[1]);return n="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(i-n/2),y:Math.round(a-n/2),width:o-i+n,height:s-a+n},t.__rect}}])&&sc(r.prototype,n),i&&sc(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function dc(t){"@babel/helpers - typeof";return(dc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yc(t,e){for(var r=0;rc&&(r*=c/(a=r+n),n*=c/a),i+o>c&&(i*=c/(a=i+o),o*=c/a),n+i>f&&(n*=f/(a=n+i),i*=f/a),r+o>f&&(r*=f/(a=r+o),o*=f/a),t.moveTo(u+r,l),t.lineTo(u+c-n,l),0!==n&&t.quadraticCurveTo(u+c,l,u+c,l+n),t.lineTo(u+c,l+f-i),0!==i&&t.quadraticCurveTo(u+c,l+f,u+c-i,l+f),t.lineTo(u+o,l+f),0!==o&&t.quadraticCurveTo(u,l+f,u,l+f-o),t.lineTo(u,l+r),0!==r&&t.quadraticCurveTo(u,l,u+r,l)}},{key:"buildPath",value:function(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var r=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+r[0],e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]),t.lineTo(e.x+r[0]+e.width,e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1]+e.height),t.lineTo(e.x+r[0],e.y+r[1])),t.closePath()}},{key:"getRect",value:function(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,r=this.refOriginalPosition;return t.__rect?t.__rect:(e="stroke"==t.brushType||"fill"==t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(t.x+r[0]-e/2),y:Math.round(t.y+r[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}])&&Sc(r.prototype,n),i&&Sc(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Pc(t){"@babel/helpers - typeof";return(Pc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mc(t,e){for(var r=0;r1?da.Util_computeBoundingBox.arc(a,s,u,c,f,!h,r,i):(r[0]=i[0]=a,r[1]=i[1]=s),da.Util_computeBoundingBox.arc(a,s,l,c,f,!h,n,o),da.Util_vector.min(r,r,n),da.Util_vector.max(i,i,o),t.__rect={x:r[0],y:r[1],width:i[0]-r[0],height:i[1]-r[1]},t.__rect}}])&&Mc(r.prototype,n),i&&Mc(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Bc(t){"@babel/helpers - typeof";return(Bc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fc(t,e){for(var r=0;r=15){var h=parseInt(o.axis3DParameter),p=[i[0]-h,i[1]+h];o.axisUseArrow?(c.push([p[0]+1.5,p[1]-7.5]),c.push([p[0]-1,p[1]+1]),c.push([p[0]+7.5,p[1]-1.5]),f.push([p[0],p[1]])):f.push([p[0],p[1]]),f.push([i[0],i[1]])}f.push([i[2]+5,i[1]])}else{var d=Math.abs(i[1]-i[3])/l,y=i[3];f.push([i[0],y-5]);for(var v=0;v=15){var m=parseInt(o.axis3DParameter),b=[i[0]-m,i[1]+m];o.axisUseArrow?(c.push([b[0]+1.5,b[1]-7.5]),c.push([b[0]-1,b[1]+1]),c.push([b[0]+7.5,b[1]-1.5]),f.push([b[0],b[1]])):f.push([b[0],b[1]]),f.push([i[0],i[1]])}f.push([i[2]+5,i[1]])}if(o.axisUseArrow){var x=[[i[2]+5,i[1]+4],[i[2]+13,i[1]],[i[2]+5,i[1]-4]],w=[[i[0]-4,i[3]-5],[i[0],i[3]-13],[i[0]+4,i[3]-5]],_=new Zu(x);_.style={fillColor:"#008acd"},$.copyAttributesWithClip(_.style,o.axisStyle),s.push(t.createShape(_));var S=new Zu(w);if(S.style={fillColor:"#008acd"},$.copyAttributesWithClip(S.style,o.axisStyle),s.push(t.createShape(S)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var E=new Zu(c);E.style={fillColor:"#008acd"},$.copyAttributesWithClip(E.style,o.axisStyle),s.push(t.createShape(E))}}var k=new Gu(f);k.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&$.copyAttributesWithClip(k.style,o.axisStyle),k.clickable=!1,k.hoverable=!1;var T=[t.createShape(k)],C=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var O=o.axisYLabels,A=O.length,P=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(P=o.axisYLabelsOffset),1==A){var M=new bl(i[0]-5+P[0],i[3]+P[1],O[0]);M.style={labelAlign:"right"},o.axisYLabelsStyle&&$.copyAttributesWithClip(M.style,o.axisYLabelsStyle),M.clickable=!1,M.hoverable=!1,C.push(t.createShape(M))}else for(var I=i[3],L=Math.abs(i[1]-i[3])/(A-1),j=0;j0){var D=o.axisXLabels,B=D.length,F=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(F=o.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length==B)for(var z=n.xPositions,G=0;G=0&&r[i]&&$.copyAttributesWithClip(a,r[i]),n&&n.length&&void 0!==o)for(var s=n,u=s.length,l=parseFloat(o),c=0;c0){var l=o[o.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}o.push(n)}if(o.length<2)return null;var c=new Object;(c=$.copyAttributesWithClip(c,this.style,["pointList"])).pointList=o;var f=new wc({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=this.location,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}},{key:"multiPointToTF",value:function(t){for(var e=t.components,r=[],n=[],i=this.location,o=[],a=this.nodesClipPixel,s=0;s0){var l=o[o.length-1];if(Math.abs(l[0]-n[0])<=a&&Math.abs(l[1]-n[1])<=a)continue}o.push(n);var c=new Object;c.r=6,(c=$.copyAttributesWithClip(c,this.style)).x=n[0],c.y=n[1];var f=new Vl({style:c,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(f.highlightStyle=this.highlightStyle),f.refOriginalPosition=i,f.refDataID=this.data.id,f.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(f,this.shapeOptions),this.shapes.push(f)}}},{key:"multiLineStringToTF",value:function(t){for(var e=t.components,r=0;r0){var h=o[o.length-1];if(Math.abs(h[0]-n[0])<=u&&Math.abs(h[1]-n[1])<=u)continue}o.push(n)}}else{a=[];for(var p=0;p0){var d=a[a.length-1];if(Math.abs(d[0]-n[0])<=u&&Math.abs(d[1]-n[1])<=u)continue}a.push(n)}}a.length<2||s.push(a)}if(!(o.length<2)){var y={};(y=$.copyAttributesWithClip(y,this.style,["pointList"])).pointList=o;var v=new pc({style:y,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(v.highlightStyle=this.highlightStyle),v.refOriginalPosition=this.location,v.refDataID=this.data.id,v.isHoverByRefDataID=this.isMultiHover,s.length>0&&(v.holePolygonPointLists=s),this.shapeOptions&&$.copyAttributesWithClip(v,this.shapeOptions),this.shapes.push(v)}}},{key:"rectangleToTF",value:function(t){var e=this.location,r=new fe(t.x,t.y),n=this.layer.map.getResolution(),i=this.getLocalXY(r),o=new Object;o.r=6,(o=$.copyAttributesWithClip(o,this.style)).x=i[0]-e[0],o.y=i[1]-e[1]-2*t.width/n,o.width=t.width/n,o.height=t.height/n;var a=new Ac({style:o,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(a.highlightStyle=this.highlightStyle),a.refOriginalPosition=e,a.refDataID=this.data.id,a.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(a,this.shapeOptions),this.shapes.push(a)}},{key:"geoTextToTF",value:function(t){var e=this.location,r=this.getLocalXY(t),n=new Object;n.r=6,(n=$.copyAttributesWithClip(n,this.style,["x","y","text"])).x=r[0]-e[0],n.y=r[1]-e[1],n.text=t.text;var i=new Jl({style:n,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(i.highlightStyle=this.highlightStyle),i.refOriginalPosition=e,i.refDataID=this.data.id,i.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&$.copyAttributesWithClip(i,this.shapeOptions),this.shapes.push(i)}},{key:"updateAndAddShapes",value:function(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,r=0,n=this.shapes.length;rs){var h=o[0];o.splice(0,1),delete i[h]}}}if(this.renderer.render(),r&&this.isHoverAble&&this.isMultiHover){var p=this.getShapesByFeatureID(r);this.renderer.updateHoverShapes(p)}}},{key:"createThematicFeature",value:function(t){var e=$.copyAttributesWithClip(this.style);t.style&&!0===this.isAllowFeatureStyle&&(e=$.copyAttributesWithClip(t.style));var r={};r.nodesClipPixel=this.nodesClipPixel,r.isHoverAble=this.isHoverAble,r.isMultiHover=this.isMultiHover,r.isClickAble=this.isClickAble,r.highlightStyle=Gc.transformStyle(this.highlightStyle);for(var n=new Kc(t,this,Gc.transformStyle(e),r),i=0;i0&&0==this.labelFeatures.length)for(var r=this.setLabelsStyle(this.features),n=0,i=r.length;n=0&&d.x<=f.x&&d.y>=0&&d.y<=f.y){if(r.style.minZoomLevel>-1&&l<=r.style.minZoomLevel)continue;if(r.style.maxZoomLevel>-1&&l>r.style.maxZoomLevel)continue;var y=null;r.isStyleChange?(r.isStyleChange=null,y=this.calculateLabelBounds(r,d)):y=r.geometry.bsInfo.w&&r.geometry.bsInfo.h?this.calculateLabelBounds2(r,d):this.calculateLabelBounds(r,d);var v=new ye(0,f.y,f.x,0),g=y.length;if(this.isAvoid){var m=this.getAvoidInfo(v,y);if(m){if("left"===m.aspectW){r.style.labelXOffset+=m.offsetX;for(var b=0;b=i[u].start&&a=i[u].start&&as&&(s=r,u="top")}if(e.y>t.bottom){var n=Math.abs(e.y-t.bottom);n>s&&(s=n,u="bottom")}if(e.xa&&(a=i,l="left")}if(e.x>t.right){var o=Math.abs(e.x-t.right);o>a&&(a=o,l="right")}}}}},{key:"isQuadrilateralOverLap",value:function(t,e){var r=t.length,n=e.length;if(5!==r||5!==n)return null;for(var i=!1,o=0;ot-n&&r.time-1?e=1:["degrees","deg","degree","dd"].indexOf(t.toLocaleLowerCase())>-1?e=2*Math.PI*6378137/360:t===Mn.KILOMETER?e=1e3:t===Mn.INCH?e=.025399999918:t===Mn.FOOT&&(e=.3048),e},kf={SquareFoot:10.763910417,SquareKiloMeter:1e-6,SquareMeter:1,SquareMile:3.86e-7,SquareYard:1.195990046};function Tf(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[-180,180],i=n[1],o=n[0],a=i-o;return t===i&&e?t:t===o&&r?t:0===((t-o)%a+a)%a&&e?i:((t-o)%a+a)%a+o}function Cf(t){var e=parseInt(t),r=parseInt(60*(t-e)),n=parseInt(60*(60*(t-e)-r));return r=0===parseInt(r/10)?"0".concat(r):r,n=0===parseInt(n/10)?"0".concat(n):n,"".concat(e,"°").concat(r,"'").concat(n)}function Of(t,e,r){return 1/(t*e*(1/.0254)*Ef(r))}function Af(t){"@babel/helpers - typeof";return(Af="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Pf(t,e){for(var r=0;rthis.mapVOptions.maxZoom)}},{key:"_getResolution",value:function(){var t=this.map.getBounds(),e=(t.getEast()-t.getWest())/this.map.getCanvas().getBoundingClientRect().width;return Ef("DEGREE")*e}},{key:"_getCenterPixel",value:function(){return this.map.project(new(O().LngLat)(0,0))}},{key:"addData",value:function(t,e){this.renderer.addData(t,e)}},{key:"update",value:function(t){this.renderer.update(t)}},{key:"getData",value:function(){return this.renderer&&(this.dataSet=this.renderer.getData()),this.dataSet}},{key:"removeData",value:function(t){this.renderer&&this.renderer.removeData(t)}},{key:"clearData",value:function(){this.renderer.clearData()}},{key:"show",value:function(){return this.renderer&&this.renderer.show(),this}},{key:"hide",value:function(){return this.renderer&&this.renderer.hide(),this}},{key:"getTopLeft",value:function(){var t,e=this.map;e&&(t=e.getBounds().getNorthWest());return t}},{key:"bindEvent",value:function(){var t=this.map;this.mapVOptions.methods&&(this.mapVOptions.methods.click&&t.on("click",this.renderer.clickEvent),this.mapVOptions.methods.mousemove&&t.on("mousemove",this.renderer.mousemoveEvent))}},{key:"unbindEvent",value:function(){var t=this.map;this.mapvOptions.methods&&(this.mapvOptions.methods.click&&t.off("click",this.clickEvent),this.mapvOptions.methods.mousemove&&t.off("mousemove",this.mousemoveEvent))}},{key:"setVisibility",value:function(t){t!==this.visibility&&(this.visibility=t,t?this.show():this.hide())}},{key:"setZIndex",value:function(t){this.renderer.setZIndex(t)}}])&&Pf(t.prototype,e),r&&Pf(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Lf(t){"@babel/helpers - typeof";return(Lf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jf(t,e){for(var r=0;r",a="
    "+(e._createLegendElement.call(e)||"")+"
    ";this._container.innerHTML=o+a}return e._appendLegendCSSStyle(),this._container},r.prototype.onRemove=function(){this._container.parentNode.removeChild(this._container),this._map=void 0},new r}},{key:"_createLegendElement",value:function(){}},{key:"_addLayer",value:function(){var t=this.getLayerStyleOptions(),e=this.id?this.id:"theme3DLayer",r=this.sourceId=e+"Source";this.map.getSource(r)?(this.map.removeSource(r),this.map.addSource(r,{type:"geojson",data:this.data})):this.map.addSource(r,{type:"geojson",data:this.data}),this.map.addLayer({id:e,type:"fill-extrusion",source:r,paint:t}),this.map.moveLayer(e)}},{key:"_addHighLightLayer",value:function(){if(this.map){var t=this.map;t.addLayer({id:this._highlightLayerId,type:"fill-extrusion",source:this.sourceId,paint:this.getHighlightStyleOptions(),filter:["in","$id",""]}),this._selectFeatureId=null,t.on("mousemove",this.id,this._onMouseMove.bind(this)),t.on("mouseout",this.id,this._onMouseMove.bind(this))}}},{key:"_onMouseMove",value:function(t){var e=this,r=this.map,n=r.queryRenderedFeatures(t.point,{layers:[e.id]});if(e.highlight&&e.highlight.callback&&e.highlight.callback(n,t),!n||n.length<1)return e._clearHighlight.call(e),void(e._selectFeatureId=null);var i=n[0].id;e._selectFeatureId!==i&&(e._selectFeatureId=i,r.setFilter(e._highlightLayerId,["==","$id",e._selectFeatureId]))}},{key:"_clearHighlight",value:function(){this.map&&this.map.setFilter(this._highlightLayerId,["in","$id",""])}},{key:"_appendLegendCSSStyle",value:function(){var t=document.createElement("style");t.type="text/css";t.innerHTML="\n .legend {\n display: inline-block;\n border-radius: 2px;\n -moz-border-radius: 2px;\n -webkit-border-radius: 2px;\n font-size: 12px;\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n }\n .legend-light {\n color: rgba(0, 0, 0, 0.8);\n background-color: rgb(255, 255, 255);\n box-shadow: 0px 0px 6px #bbbbbb;\n -moz-box-shadow: 0px 6px 10px #bbbbbb;\n -webkit-box-shadow: 0px 0px 6px #bbbbbb;\n }\n .legend-dark {\n color: rgba(255, 255, 255, 0.8);\n background-color: rgb(64, 64, 64);\n }\n .legend .legend-title {\n min-height: 14px;\n max-width: 500px;\n padding:6px 10px;\n }\n .legend-light .legend-title {\n color: rgba(0, 0, 0, 0.8);\n }\n .legend-dark .legend-title {\n color: rgba(255, 255, 255, 0.8);\n }\n .legend-content{\n padding:6px 10px;\n }\n "+this._legendCSSStyle(),document.getElementsByTagName("head")[0].appendChild(t)}},{key:"_legendCSSStyle",value:function(){return"\n .legend ul {\n padding: 0;\n margin: 0 16px;\n height: 100%;\n display: block;\n list-style: none;\n }\n\n .legend li {\n vertical-align: middle;\n }\n\n .legend li span:first-child {\n vertical-align: middle;\n }\n\n .legend li span:last-child {\n line-height: 28px;\n max-width: 200px;\n vertical-align: middle;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n -ms-text-overflow: ellipsis;\n }\n\n .legend-vertical li {\n height: 28px;\n }\n\n .legend-vertical li span:first-child {\n display: inline-block;\n width: 60px;\n height: 100%;\n }\n\n .legend-vertical li span:last-child {\n display: inline-block;\n margin-left: 16px;\n height: 100%;\n }\n\n .legend-horizontal li {\n height: 56px;\n float: left;\n }\n\n .legend-horizontal li span:first-child {\n display: block;\n width: 100%;\n height: 50%;\n }\n\n .legend-horizontal li span:last-child {\n display: block;\n vertical-align: middle;\n width: 60px;\n height: 50%;\n text-align: center;\n }\n "}},{key:"_extend",value:function(t){for(var e=0;e";for(t=0;t "+i;else i=i+"-"+this._getWrapperText(this.colorStops[t+1][0]);r+="
  • "+i+"
  • "}return r+=""}},{key:"_getWrapperText",value:function(t){var e=t*(null==this.legendRatio?1:parseFloat(this.legendRatio)),r=parseFloat(e);return r%1e6<=1e6?r.toString():parseInt(r/1e3)+"k"}}])&&Bf(r.prototype,n),i&&Bf(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Hf(t){"@babel/helpers - typeof";return(Hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wf(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,i=r.attributes,o=this.styleGroups,a=!1,s=null;for(var u in i)if(n===u){a=!0,s=i[u];break}if(a)for(var l=0,c=o.length;l=o[l].start&&s"+n+""}return t+=""}}])&&oh(r.prototype,n),i&&oh(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function fh(t){"@babel/helpers - typeof";return(fh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hh(t,e){for(var r=0;r0&&r.attributes){var n=this.themeField,i=r.attributes,o=this.styleGroups,a=!1,s=null;for(var u in i)if(n===u){a=!0,s=i[u];break}if(a)for(var l=0,c=o.length;l0&&void 0!==arguments[0]?arguments[0]:null;if(!t||0===t.length||t===this.graphics)return this.graphics.length=0,this.layer.props.data&&(this.layer.props.data.length=0),void this.update();$.isArray(t)||(t=[t]);for(var e=t.length-1;e>=0;e--){var r=t[e],n=$.indexOf(this.graphics,r);-1!==n&&this.graphics.splice(n,1)}this.update()}},{key:"update",value:function(){if("Awaiting state"!==this.layer.lifecycle){this.layer.setChangeFlags({dataChanged:!0,propsChanged:!0,viewportChanged:!0,updateTriggersChanged:!0});var t=this.getState(),e=parseInt(this.canvas.style.width),r=parseInt(this.canvas.style.height);t.width=e,t.height=r,this.layer.setState(t)}}},{key:"clear",value:function(){this.removeGraphics(),this.deckGL.finalize()}},{key:"remove",value:function(){this.mapOptions.targetElement.removeChild(this.canvas)}},{key:"destroy",value:function(){this.remove(),this.clear()}},{key:"moveTo",value:function(t,e){var r=document.getElementById(this.id);if(e=void 0===e||e){var n=document.getElementById(t);r&&n&&n.parentNode.insertBefore(r,n)}else{var i=document.getElementById(t);if(r){if(i.nextSibling)return void i.parentNode.insertBefore(r,i.nextSibling);i.parentNode.appendChild(r)}}}},{key:"setVisibility",value:function(t){this.canvas&&t!==this.visibility&&(this.visibility=t,this.canvas.style.display=t?"block":"none")}},{key:"draw",value:function(){var t=this.getState(),e={};for(var r in t)e[r]=t[r];var n=parseInt(this.canvas.style.width),i=parseInt(this.canvas.style.height);e.width=n,e.height=i,e.layers=[this.layer],e.canvas=this.canvas,this.deckGL.setProps(e)}},{key:"_initContainer",value:function(){this.canvas=this._createCanvas(this.mapOptions.mapElement),this.mapOptions.targetElement.appendChild(this.canvas)}},{key:"_createCanvas",value:function(t){var e=document.createElement("canvas");return this.id&&(e.id=this.id),e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.cursor="",e.width=parseInt(t.style.width),e.height=parseInt(t.style.height),e.style.width=t.style.width,e.style.height=t.style.height,e}},{key:"getState",value:function(){var t=this.functions.getMapState();return function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:null;this.renderer&&this.renderer.removeGraphics(t)}},{key:"clear",value:function(){this.renderer&&this.renderer.clear()}},{key:"remove",value:function(){this.renderer&&this.renderer.remove()}},{key:"moveTo",value:function(t,e){this.renderer.moveTo(t,e)}},{key:"setVisibility",value:function(t){this.renderer.setVisibility(t)}},{key:"getState",value:function(){return this.renderer.getState()}},{key:"getMapState",value:function(){var t={},e=this.map.getCenter(),r={longitude:e.lng,latitude:e.lat,zoom:this.map.getZoom(),maxZoom:this.map.getMaxZoom(),pitch:this.map.getPitch(),bearing:this.map.getBearing()};for(var n in r)t[n]=r[n];return this.map.getCRS&&this.map.getCRS()!==O().CRS.EPSG3857&&(t.coordinateSystem=this.coordinateSystem,t.isGeographicCoordinateSystem=this.isGeographicCoordinateSystem),t}}])&&Th(t.prototype,e),r&&Th(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Ah=function(){try{return THREE}catch(t){return{}}}();function Ph(t,e,r){if(t===r||t===e)return t;var n=r-e;return((t-e)%n+n)%n+e}function Mh(t){return t*Math.PI/180}var Ih={matrix:[1,-1,0,0],projection:{R:6378137,minZoom:0,maxZoom:22,nativeMaxZoom:19,RAD:Math.PI/180,METERS_PER_DEGREE:6378137*Math.PI/180,MAX_LATITUDE:85.0511287798,project:function(t){var e=this.RAD,r=this.METERS_PER_DEGREE,n=this.MAX_LATITUDE,i=t instanceof Array?{lng:t[0],lat:t[1]}:{lng:t.lng,lat:t.lat},o=i.lng,a=Math.max(Math.min(n,i.lat),-n);return{x:o*r,y:(0===a?0:Math.log(Math.tan((90+a)*e/2))/e)*r}},unproject:function(t){var e,r=t.x,n=t.y,i=this.RAD,o=this.METERS_PER_DEGREE;return 0===n?e=0:(e=n/o,e=(2*Math.atan(Math.exp(e*i))-Math.PI/2)/i),{lng:Ph(r/o,-180,180),lat:Ph(e,-this.MAX_LATITUDE,this.MAX_LATITUDE)}},locate:function(t,e,r){if(!t)return null;if(e=e||0,r=r||0,!e&&!r)return t;var n=t.lng;if(0!==e){var i=Math.abs(e),o=Mh(t.lng);n=Ph(180*(o+=2*Math.sqrt(Math.pow(Math.sin(i/(2*this.R)),2)/Math.pow(Math.cos(o),2))*(i>0?1:-1))/Math.PI,-180,180)}var a=t.lat;if(0!==r){var s=Math.abs(r),u=Mh(t.lat);a=Ph(180*(u+=2*Math.sin(s/(2*this.R))*(s>0?1:-1))/Math.PI,-90,90)}return{lng:n,lat:a}},getResolution:function(t){if(!this.resolutions){for(var e=[],r=12756274*Math.PI,n=0;n<=this.maxZoom;n++)e[n]=r/(256*Math.pow(2,n));this.resolutions=e}var i=0|t,o=this.resolutions.length;i=i<0?0:i>o-1?o-1:i;var a=this.resolutions[i];return(0|t)!==t&&i!==o-1?a+(this.resolutions[i+1]-a)*(t-i):a}},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},lngLatToPoint:function(t,e){var r=this.project(t);return this.transform(r,this.projection.getResolution(e))},locate:function(t,e,r){return this.projection.locate(t,e,r)},transform:function(t,e){return{x:this.matrix[0]*(t.x-this.matrix[2])/e,y:this.matrix[1]*(t.y-this.matrix[3])/e}}};function Lh(t){"@babel/helpers - typeof";return(Lh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jh(t,e){for(var r=0;r=0;e--)t.children[e]instanceof Ah.Mesh&&t.remove(t.children[e]);return this}},{key:"clearAll",value:function(t){var e=this.scene;if(!e)return this;for(var r=e.children.length-1;r>=0;r--)!t&&e.children[r]instanceof Ah.Camera||e.remove(e.children[r]);return this}},{key:"setPosition",value:function(t,e){if(!t||!e)return this;var r=this.lngLatToPosition(e);return t.position.set(r.x,r.y,r.z),this}},{key:"lngLatToPosition",value:function(t){var e=Ih.projection.nativeMaxZoom,r=Ih.lngLatToPoint(t,e);return new Gh(r.x,r.y,-0)}},{key:"distanceToThreeVector3",value:function(t,e,r){var n=this.map,i=r||n.getCenter(),o=Ih.projection.nativeMaxZoom,a=Ih.locate(i,t,e),s=Ih.lngLatToPoint(i,o),u=Ih.lngLatToPoint(a,o),l=Math.abs(u.x-s.x)*Math.sign(t),c=Math.abs(u.y-s.y)*Math.sign(e);return new Gh(l,c,0)}},{key:"removeDuplicatedCoordinates",value:function(t){function e(t,e){return t[0]===e[0]&&t[1]===e[1]}for(var r=[].concat(t),n=r.length-1;n>=1;n--)e(r[n],r[n-1])&&r.splice(n,1);return e(r[0],r[r.length-1])&&r.splice(r.length-1,1),r}},{key:"getCoordinatesCenter",value:function(t){for(var e=0,r=0,n=0,i=0,o=t.length;i0?this.convertFastToPixelPoints(t):this.canvasContext.clearRect(0,0,this.maxWidth,this.maxWidth)}},{key:"convertFastToPixelPoints",value:function(t){var e,r,n,i,o,a,s,u=[],l=t.getEast()-t.getWest(),c=t.getNorth()-t.getSouth(),f=this.mapElement;i=l/f.width>c/f.height?l/f.width:c/f.height,this.useRadius=this.useGeoUnit?parseInt(this.radius/i):this.radius;for(var h=0;h0&&this.maxWidth>0))return!1;var r=this.canvasContext;r.setTransform(1,0,0,1,0,0),this.canvasContext.clearRect(0,0,this.maxWidth,this.maxHeight),this.drawCircle(this.useRadius),this.createGradient();for(var n=0;nt.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.options;(t=t||{}).strokeStyle=Object.assign({},Np,t.strokeStyle||{}),t.lngLabelStyle=Object.assign({},jp,t.lngLabelStyle||{}),t.latLabelStyle=Object.assign({},jp,t.latLabelStyle||{}),this.options=Object.assign({},Rp,t,{extent:this.getDefaultExtent(t.extent),wrapX:t.wrapX}),this.oldExtent=this.options.extent,this._calcInterval(),this.isRotate=!1,this.visible=this.options.visible,this.features=this._getGraticuleFeatures()}},{key:"_createCanvas",value:function(){if(!this.canvas){var t=this.mapElement;this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px";var e=("undefined"==typeof window?{}:window).devicePixelRatio||1;this.canvas.width=parseInt(t.style.width)*e,this.canvas.height=parseInt(t.style.height)*e,this.canvas.style.width=t.style.width,this.canvas.style.height=t.style.height,this.canvas.globalAlpha=this.options.opacity,this.targetElement.appendChild(this.canvas)}}},{key:"_drawCanvas",value:function(){this.canvas||this._createCanvas(),this.setVisibility(),this._reset()}},{key:"_resizeCallback",value:function(){this.targetElement&&this.targetElement.removeChild(this.canvas),this.canvas=null,this._drawCanvas()}},{key:"_reset",value:function(){this._updateRotate(),this._updateExtent(),this._calcInterval(),this._drawLabel()}},{key:"_updateRotate",value:function(){var t=this.getMapStateByKey("getBearing");this.isRotate=t>-180&&t<=-90||t>=90&&t<180}},{key:"_updateExtent",value:function(){if(this.options.wrapX&&!this.oldExtent){var t=this.getMapStateByKey("getBounds"),e=t._ne,r=t._sw;this.options.extent=[r.lng,r.lat,e.lng,e.lat]}}},{key:"_calcInterval",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.interval;"function"==typeof t?(t=t(this.map),this._currLngInterval=t,this._currLatInterval=t):(this._currLngInterval=t,this._currLatInterval=t)}},{key:"_formatLat",value:function(t){return this.options.latFormatTickLabel?this.options.latLabelFormatter(t):t<0?Cf(-1*t)+"S":t>0?Cf(t)+"N":""+Cf(t)}},{key:"_formatLng",value:function(t){return this.options.lngLabelFormatter?this.options.lngLabelFormatter(t):(t=Tf(t))>0&&t<=180?Cf(t)+"E":t<0&&t>=-180?Cf(-1*t)+"W":""+Cf(t)}},{key:"_parsePxToInt",value:function(t){t.length>2&&"p"===t.charAt(t.length-2)&&(t=t.substr(0,t.length-2));try{return parseInt(t,10)}catch(t){console.log(t)}return 0}},{key:"_drawLabel",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.visible,r=this.canvas,n=r.getContext("2d");if(e&&this.options.showLabel){if(this.mapElement){this._currLngInterval&&this._currLatInterval||this._calcInterval(),n.clearRect(0,0,r.width,r.height);var i=this.options,o=i.lngLabelStyle,a=i.latLabelStyle,s=this._getGridiculePoints(),u=s.lngPoints,l=s.latPonits;u.forEach(function(e){t._drawLng(n,e[0],e[1],e[2],o)}),l.forEach(function(e){t._drawLat(n,e[0],e[1],e[2],a)})}}else n.clearRect(0,0,r.width,r.height)}},{key:"_drawLat",value:function(t,e,r,n,i){t=this._setLabelStyle(t,i);var o=this.canvas.width,a=12;try{var s=t.font.split(" ")[0];a=this._parsePxToInt(s)}catch(t){console.log(t)}if(!n){var u=e;e=r,r=this.getMapStateByKey("project",[u,e])}var l=this._formatLat(e),c=t.measureText(l).width;t.strokeText(l,(n?o:r.x)-c,(n?r:r.y)+a/2),t.fillText(l,(n?o:r.x)-c,(n?r:r.y)+a/2)}},{key:"_drawLng",value:function(t,e,r,n,i){t=this._setLabelStyle(t,i);var o=this.canvas.height;if(!n){var a=r;r=this.getMapStateByKey("project",[e,a])}var s=this._formatLng(e),u=t.measureText(s).width;t.strokeText(s,(n?r:r.x)-u/2,n?o:r.y),t.fillText(s,(n?r:r.x)-u/2,n?o:r.y)}},{key:"_getLatPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-180,180],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(i){if(this.options.wrapX&&-180===e[0]&&180===e[1])return[];var o=[];return i.forEach(function(i){var a=i.geometry.coordinates[0][1];if(i.geometry.coordinates[1][1]===a){var s="number"==typeof n?n:e[1];t.isRotate&&(s="number"==typeof r?r:e[0]),t.options.wrapX&&(o=o.concat(t._getWrapPoints(s,a,[s,s]))),o.push([s,a])}}),o}}},{key:"_getLngPoints",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-90,90],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:this.features;if(i){var o="number"==typeof r?r:e[0];this.isRotate&&(o="number"==typeof n?n:e[1]);var a=[];return i.forEach(function(e){var r=e.geometry.coordinates[0][0];e.geometry.coordinates[1][0]===r&&(a.push([r,o]),t.options.wrapX&&(a=a.concat(t._getWrapPoints(r,o))))}),a}}},{key:"_getWrapPoints",value:function(t,e){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.oldExtent,n=[],i=this.getMapStateByKey("getBounds"),o=i._ne,a=i._sw,s=r.length>2?r[2]:r[1];t>=a.lng;){var u=Tf(t,180===s,-180===r[0]);(!r||u>=r[0]&&u<=s)&&n.push([t,e]),t-=360}for(;t<=o.lng;){var l=Tf(t,180===s,-180===r[0]);(!r||l>=r[0]&&l<=s)&&n.push([t,e]),t+=360}return n}},{key:"_getGridiculePoints",value:function(){var t=this._getEdgeLat(),e=this._getEdgeLng(),r=this._getRange(),n=r.latRange,i=r.lngRange,o=r.firstLat,a=r.firstLng,s=r.lastLat,u=r.lastLng;return{latPonits:this._getUniquePoint(this._getLatPoints(i,a,u),t,1),lngPoints:this._getUniquePoint(this._getLngPoints(n,o,s),e,0)}}},{key:"_getEdgeLat",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLatInterval,r=[],n=[],i=this.canvas.width,o=this.canvas.height,a=this._getRange().extent,s=this.getMapStateByKey("getBounds")._ne;if(this.options.wrapX&&Tf(s.lng)>a[2])return[];for(var u=this._countDecimals(e),l=0;l<=o;l++){var c=this.getMapStateByKey("unproject",[i,l]),f=Tf(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lat,l]),n.push(c.lat),void 0===t&&c.lat.toFixed(u)%e==0&&(t=Number(c.lat.toFixed(u))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,d=h.last,y=h.coordinates,v=h.points;t=Math.min(Math.max(p,-90),90);var g=Math.max(Math.min(Math.round(d),90),-90);return-90!==t||-90!==g?this._getClosestCoordinate(t,g,y,v,e):[]}},{key:"_getEdgeLng",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._currLngInterval,r=[],n=[],i=this.canvas.width,o=this.canvas.height,a=this.options.extent,s=this._countDecimals(e),u=this.getMapStateByKey("getBounds")._sw;if(this.options.wrapX&&Tf(u.lat)>a[3])return[];for(var l=0;l<=i;l++){var c=this.getMapStateByKey("unproject",[l,o]),f=Tf(c.lng);(this.options.wrapX?f>=a[0]&&f<=a[2]:c.lng>=a[0]&&c.lng<=a[2])&&c.lat>=a[1]&&c.lat<=a[3]&&(r.push([c.lng,l]),n.push(c.lng),void 0===t&&c.lng.toFixed(s)%e==0&&(t=Number(c.lng.toFixed(s))))}var h=this._getIntersectRange(t,n,r,e),p=h.first,d=h.last,y=h.coordinates,v=h.points;return t=p,this._getClosestCoordinate(t,d,y,v,e)}},{key:"_getIntersectRange",value:function(t,e,r,n){var i=e[e.length-1];if(t>i){i=t,e.reverse(),r.reverse();for(var o=this._countDecimals(n),a=0;a<=e.length;a++){var s=e[a];if(s.toFixed(o)%n==0){t=Number(s.toFixed(o));break}}}return{first:t,last:i,coordinates:e,points:r}}},{key:"_getClosestCoordinate",value:function(t,e,r,n,i){for(var o=[],a=t;a<=e;){var s=this._getClosestNumberIndex(a,r),u=n[s];o.push([Math.round(u[0]),u[1],!0]),a+=i,r=r.slice(s),n=n.slice(s)}return o}},{key:"_getClosestNumberIndex",value:function(t,e){for(var r=0,n=Number.MAX_VALUE,i=0;i2&&void 0!==arguments[2]?arguments[2]:0;if(this.options.wrapX)return t.concat(e);if(!e||0===e.length)return t;var n=e,i=this.canvas.width,o=this.canvas.height;for(var a in t){var s=this.getMapStateByKey("project",t[a]),u=n.findIndex(function(e){return e[0]===t[a][r]});u<=-1?n.push(t[a]):s&&s.x>=0&&s.x<=i&&s.y>=0&&s.y<=o&&(n[u]=t[a])}return n}},{key:"_countDecimals",value:function(t){return Math.floor(t)!==t&&t.toString().split(".")[1].length||0}},{key:"_getGraticuleFeatures",value:function(){var t=this._currLngInterval||10,e=this._currLatInterval||10,r=[],n=this._getRange(),i=n.latRange,o=n.lngRange,a=n.firstLat,s=n.firstLng,u=n.lastLat,l=n.lastLng;this.options.wrapX&&!this.oldExtent&&(i=[-90,90],o=[-180,180],a=s=u=l=null),"number"==typeof s&&r.unshift(this._makeLineFeature(this._makeLineCoords(s,i,a,u))),"number"==typeof l&&r.unshift(this._makeLineFeature(this._makeLineCoords(l,i,a,u)));for(var c=o[0];c<=o[1];c+=t)r.unshift(this._makeLineFeature(this._makeLineCoords(c,i,a,u)));"number"==typeof a&&r.unshift(this._makeLineFeature(this._makeLineCoords(a,o,s,l,"lat"))),"number"==typeof u&&r.unshift(this._makeLineFeature(this._makeLineCoords(u,o,s,l,"lat")));for(var f=i[0];f<=i[1];f+=e)r.unshift(this._makeLineFeature(this._makeLineCoords(f,o,s,l,"lat")));return r}},{key:"_getRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.extent&&Pp(this.options.extent);t&&0!==t.length||(t=this.getDefaultExtent());var e={};if((t=t.map(function(t){return Number(t.toFixed(6))}))[1]%this._currLatInterval!=0){e.firstLat=t[1];var r=Math.ceil(t[1]/this._currLatInterval);t[1]=r*this._currLatInterval}if(t[3]%this._currLatInterval!=0){e.lastLat=t[3];var n=Math.floor(t[3]/this._currLatInterval);t[3]=n*this._currLatInterval}if(t[0]%this._currLngInterval!=0){e.firstLng=t[0];var i=Math.ceil(t[0]/this._currLngInterval);t[0]=i*this._currLngInterval}if(t[2]%this._currLngInterval!=0){e.lastLng=t[2];var o=Math.floor(t[2]/this._currLngInterval);t[2]=o*this._currLngInterval}return Object.assign({latRange:[t[1],t[3]],lngRange:[t[0],t[2]],extent:t},e)}},{key:"_makeLineCoords",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[-90,90],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"lng";t="lng"===i?this._lngFix(t):t,r="number"==typeof r?r:e[0],n="number"==typeof n?n:e[1];for(var o=Math.abs(r-n),a=[],s=r;s<=n;s+=o)"lng"===i?a.push([t,s]):a.push([s,t]);return a}},{key:"_makeLineFeature",value:function(t){return{type:"Feature",geometry:{type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"LineString",coordinates:t}}}},{key:"_lngFix",value:function(t){return t>=180?180:t<=-180?-180:t}},{key:"_transformStrokeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.strokeStyle;if(!t||"string"==typeof t)return{paint:{"line-color":t||"rgba(0,0,0,0.2)"}};var e={visibility:this.visible?"visible":"none","line-join":t.lineJoin||"round","line-cap":t.lineCap||"round"},r={"line-color":t.lineColor||"rgba(0,0,0,0.2)","line-width":t.lineWidth||1,"line-offset":t.lineDashOffset||0,"line-translate-anchor":"viewport","line-opacity":t.lineOpacity||1};return t.lineWidth&&("function"==typeof t.lineWidth?r["line-width"]=t.lineWidth(this.map):r["line-width"]=t.lineWidth),t.lindDasharray&&("function"==typeof t.lindDasharray?r["line-dasharray"]=t.lindDasharray(this.map):r["line-dasharray"]=t.lindDasharray),{layout:e,paint:r}}},{key:"_setLabelStyle",value:function(t,e){return e.textColor&&(t.fillStyle=e.textColor),e.textSize&&(t.font=e.textSize+" "+(e.textFont||["Calibri","sans-serif"]).join(",")),e.textHaloColor&&(t.strokeStyle=e.textHaloColor,t.lineWidth=e.textHaloWidth||1),e.textAnchor&&(t.textBaseline=this._getTxetBaseline(e.textAnchor),t.textAligin=this._getTxetAlign(e.textAligin)),t}},{key:"_getTxetBaseline",value:function(t){if(!t)return"bottom";var e=t.split("-");return e.includes("bottom")?"bottom":e.includes("top")?"top":e.includes("center")?"middle":void 0}},{key:"_getTxetAlign",value:function(t){if(!t)return"center";var e=t.split("-");return e.includes("left")?"left":e.includes("right")?"right":e.includes("center")?"center":void 0}}])&&Ip(t.prototype,e),r&&Ip(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Bp(t){"@babel/helpers - typeof";return(Bp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fp(t,e){for(var r=0;r=this.options.minZoom&&e<=this.options.maxZoom,this.renderer&&(this.renderer.visible=this.visible),this.map.getLayer(this.sourceId)&&this.map.setLayoutProperty(this.sourceId,"visibility",this.visible?"visible":"none"),this.renderer&&this.renderer._drawLabel()}},{key:"setMinZoom",value:function(t){this.options.minZoom=t,this.setVisibility()}},{key:"setMaxZoom",value:function(t){this.options.maxZoom=t,this.setVisibility()}},{key:"setShowLabel",value:function(t){this.options.showLabel=t,this.renderer._drawLabel()}},{key:"setExtent",value:function(t){this.options.extent=this.getDefaultExtent(t,this.map),this.renderer.setExtent(t)}},{key:"setStrokeStyle",value:function(t){if(this.map&&this.map.getLayer(this.sourceId)){this.options.strokeStyle=t;var e=this.renderer._transformStrokeStyle(t),r=e.layout,n=e.paint;for(var i in r)this.map.setLayoutProperty(this.sourceId,i,r[i]);for(var o in n)this.map.setPaintProperty(this.sourceId,o,n[o])}}},{key:"setLngLabelStyle",value:function(t){this.options.lngLabelStyle=t,this.renderer._drawLabel()}},{key:"setLatLabelStyle",value:function(t){this.options.latLabelStyle=t,this.renderer._drawLabel()}},{key:"setIntervals",value:function(t){this.renderer&&this.renderer.setIntervals(t)}},{key:"getDefaultExtent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.map,r=(e.getCRS&&e.getCRS()||{}).lngLatExtent;if(r||(r=[-180,-85.05119,180,85.05119]),!t||0===t.length)return r;var n=O().LngLatBounds.convert(t),i=n._sw,o=n._ne;return t=[i.lng,i.lat,o.lng,o.lat],t=[Math.max(r[0],t[0]),Math.max(r[1],t[1]),Math.min(r[2],t[2]),Math.min(r[3],t[3])]}},{key:"addGraticuleLayer",value:function(){if(!this.map.getSource(this.sourceId)){var t={type:"geojson",data:{type:"FeatureCollection",features:this.renderer.features}};this.map.addSource(this.sourceId,t)}if(!this.map.getLayer(this.sourceId)){var e=Object.assign({id:this.sourceId,type:"line",source:this.sourceId},this.renderer._transformStrokeStyle());this.map.addLayer(e)}}},{key:"_getLatPoints",value:function(t,e,r,n){return this.renderer._getLatPoints(t,e,r,n)}},{key:"_bindEvent",value:function(){this.map.on("styledata",this.styleDataEevent),this.map.on("resize",this.resizeEvent),this.map.on("zoomend",this.zoomendEvent)}},{key:"_unbindEvent",value:function(){this.map.off("styledata",this.styleDataEevent),this.map.off("resize",this.resizeEvent),this.map.off("zoomend",this.zoomendEvent)}},{key:"_setLayerTop",value:function(){var t=this,e=this.map;if(e){var r=e.getStyle&&e.getStyle().layers;r&&r.length&&r.findIndex(function(e){return e.id===t.sourceId})!==r.length-1&&e.getLayer(this.sourceId)&&(e.removeLayer(this.sourceId),this.addGraticuleLayer())}}},{key:"updateGraticuleLayer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.renderer.features;if(this.map.getSource(this.sourceId)){var e={type:"FeatureCollection",features:t};this.map.getSource(this.sourceId).setData(e)}this.addGraticuleLayer()}}])&&Fp(t.prototype,e),r&&Fp(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon",t[t.MultiPoint=4]="MultiPoint",t[t.MultiLineString=5]="MultiLineString",t[t.MultiPolygon=6]="MultiPolygon",t[t.GeometryCollection=7]="GeometryCollection",t[t.CircularString=8]="CircularString",t[t.CompoundCurve=9]="CompoundCurve",t[t.CurvePolygon=10]="CurvePolygon",t[t.MultiCurve=11]="MultiCurve",t[t.MultiSurface=12]="MultiSurface",t[t.Curve=13]="Curve",t[t.Surface=14]="Surface",t[t.PolyhedralSurface=15]="PolyhedralSurface",t[t.TIN=16]="TIN",t[t.Triangle=17]="Triangle"}(Gp||(Gp={}));var qp,Yp=new Int32Array(2),Xp=new Float32Array(Yp.buffer),Zp=new Float64Array(Yp.buffer),Kp=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0];function Jp(t){"@babel/helpers - typeof";return(Jp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qp(t,e){for(var r=0;r>24}},{key:"readUint8",value:function(t){return this.bytes_[t]}},{key:"readInt16",value:function(t){return this.readUint16(t)<<16>>16}},{key:"readUint16",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8}},{key:"readInt32",value:function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24}},{key:"readUint32",value:function(t){return this.readInt32(t)>>>0}},{key:"readInt64",value:function(t){return BigInt.asIntN(64,BigInt(this.readUint32(t))+(BigInt(this.readUint32(t+4))<>8}},{key:"writeUint16",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8}},{key:"writeInt32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeUint32",value:function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24}},{key:"writeInt64",value:function(t,e){this.writeInt32(t,Number(BigInt.asIntN(32,e))),this.writeInt32(t+4,Number(BigInt.asIntN(32,e>>BigInt(32))))}},{key:"writeUint64",value:function(t,e){this.writeUint32(t,Number(BigInt.asUintN(32,e))),this.writeUint32(t+4,Number(BigInt.asUintN(32,e>>BigInt(32))))}},{key:"writeFloat32",value:function(t,e){Xp[0]=e,this.writeInt32(t,Yp[0])}},{key:"writeFloat64",value:function(t,e){Zp[0]=e,this.writeInt32(t,Yp[Kp?0:1]),this.writeInt32(t+4,Yp[Kp?1:0])}},{key:"getBufferIdentifier",value:function(){if(this.bytes_.length=0;r--)t.addInt32(e[r]);return t.endVector()}},{key:"startEndsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addXy",value:function(t,e){t.addFieldOffset(1,e,0)}},{key:"createXyVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startXyVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addZ",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createZVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startZVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addM",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"createMVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startMVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addT",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"createTVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startTVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addTm",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"createTmVector",value:function(t,e){t.startVector(8,e.length,8);for(var r=e.length-1;r>=0;r--)t.addInt64(e[r]);return t.endVector()}},{key:"startTmVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addType",value:function(t,e){t.addFieldInt8(6,e,Gp.Unknown)}},{key:"addParts",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createPartsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startPartsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endGeometry",value:function(t){return t.endObject()}},{key:"createGeometry",value:function(e,r,n,i,o,a,s,u,l){return t.startGeometry(e),t.addEnds(e,r),t.addXy(e,n),t.addZ(e,i),t.addM(e,o),t.addT(e,a),t.addTm(e,s),t.addType(e,u),t.addParts(e,l),t.endGeometry(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"ends",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0}},{key:"endsLength",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"endsArray",value:function(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"xy",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"xyLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"xyArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"z",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"zLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"zArray",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"m",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"mLength",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"mArray",value:function(){var t=this.bb.__offset(this.bb_pos,10);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"t",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"tLength",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"tArray",value:function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"tm",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):BigInt(0)}},{key:"tmLength",value:function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"type",value:function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.readUint8(this.bb_pos+t):Gp.Unknown}},{key:"parts",value:function(e,r){var n=this.bb.__offset(this.bb_pos,18);return n?(r||new t).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+4*e),this.bb):null}},{key:"partsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&rd(e.prototype,r),n&&rd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function ad(t,e){for(var r=[],n=0;n>1]),r.push(i)}return r}function sd(t,e,r){if(!r||0===r.length)return[ad(t,e)];var n,i=0,o=Array.from(r).map(function(e){return t.slice(i,i=e<<1)});return e&&(i=0,n=Array.from(r).map(function(t){return e.slice(i,i=t)})),o.map(function(t,e){return ad(t,n?n[e]:void 0)})}function ud(t,e){var r=e;if(r===Gp.Unknown&&(r=t.type()),r===Gp.GeometryCollection){for(var n=[],i=0;i=0;r--)t.addInt8(e[r]);return t.endVector()}},{key:"startPropertiesVector",value:function(t,e){t.startVector(1,e,1)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"endFeature",value:function(t){return t.endObject()}},{key:"finishFeatureBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedFeatureBuffer",value:function(t,e){t.finish(e,void 0,!0)}},{key:"createFeature",value:function(e,r,n,i){return t.startFeature(e),t.addGeometry(e,r),t.addProperties(e,n),t.addColumns(e,i),t.endFeature(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"geometry",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?(t||new od).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"properties",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0}},{key:"propertiesLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"propertiesArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,8);return r?(e||new hd).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0}}])&&dd(e.prototype,r),n&&dd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),gd=(new TextEncoder,new TextDecoder);function md(t,e){var r={};if(!e||0===e.length)return r;var n=t.propertiesArray();if(!n)return r;for(var i=new DataView(n.buffer,n.byteOffset),o=t.propertiesLength(),a=0;a0?{done:!1,value:e}:{done:!0,value:void 0}:{done:!1,value:function(t,e){if(!t.length)return e;if(!e.length)return t;var r=new Uint8Array(t.length+e.length);return r.set(t),r.set(e,t.length),r}(e,r.value)}})},wd.prototype.slice=function(t){if((t|=0)<0)throw new Error("invalid length");var e=this,r=this._array.length-this._index;if(this._index+t<=this._array.length)return Promise.resolve(this._array.subarray(this._index,this._index+=t));var n=new Uint8Array(t);return n.set(this._array.subarray(this._index)),function i(){return e._source.read().then(function(o){return o.done?(e._array=xd,e._index=0,r>0?n.subarray(0,r):null):r+o.value.length>=t?(e._array=o.value,e._index=t-r,n.set(o.value.subarray(0,t-r),r),n):(n.set(o.value,r),r+=o.value.length,i())})}()},wd.prototype.cancel=function(){return this._source.cancel()};var kd=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bb=null,this.bb_pos=0}return e=t,n=[{key:"getRootAsCrs",value:function(e,r){return(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"getSizePrefixedRootAsCrs",value:function(e,r){return e.setPosition(e.position()+4),(r||new t).__init(e.readInt32(e.position())+e.position(),e)}},{key:"startCrs",value:function(t){t.startObject(6)}},{key:"addOrg",value:function(t,e){t.addFieldOffset(0,e,0)}},{key:"addCode",value:function(t,e){t.addFieldInt32(1,e,0)}},{key:"addName",value:function(t,e){t.addFieldOffset(2,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(3,e,0)}},{key:"addWkt",value:function(t,e){t.addFieldOffset(4,e,0)}},{key:"addCodeString",value:function(t,e){t.addFieldOffset(5,e,0)}},{key:"endCrs",value:function(t){return t.endObject()}},{key:"createCrs",value:function(e,r,n,i,o,a,s){return t.startCrs(e),t.addOrg(e,r),t.addCode(e,n),t.addName(e,i),t.addDescription(e,o),t.addWkt(e,a),t.addCodeString(e,s),t.endCrs(e)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"org",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"code",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb_pos+t):0}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"wkt",value:function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"codeString",value:function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&Sd(e.prototype,r),n&&Sd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Td(t){"@babel/helpers - typeof";return(Td="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cd(t,e){for(var r=0;r=0;r--)t.addFloat64(e[r]);return t.endVector()}},{key:"startEnvelopeVector",value:function(t,e){t.startVector(8,e,8)}},{key:"addGeometryType",value:function(t,e){t.addFieldInt8(2,e,Gp.Unknown)}},{key:"addHasZ",value:function(t,e){t.addFieldInt8(3,+e,0)}},{key:"addHasM",value:function(t,e){t.addFieldInt8(4,+e,0)}},{key:"addHasT",value:function(t,e){t.addFieldInt8(5,+e,0)}},{key:"addHasTm",value:function(t,e){t.addFieldInt8(6,+e,0)}},{key:"addColumns",value:function(t,e){t.addFieldOffset(7,e,0)}},{key:"createColumnsVector",value:function(t,e){t.startVector(4,e.length,4);for(var r=e.length-1;r>=0;r--)t.addOffset(e[r]);return t.endVector()}},{key:"startColumnsVector",value:function(t,e){t.startVector(4,e,4)}},{key:"addFeaturesCount",value:function(t,e){t.addFieldInt64(8,e,BigInt("0"))}},{key:"addIndexNodeSize",value:function(t,e){t.addFieldInt16(9,e,16)}},{key:"addCrs",value:function(t,e){t.addFieldOffset(10,e,0)}},{key:"addTitle",value:function(t,e){t.addFieldOffset(11,e,0)}},{key:"addDescription",value:function(t,e){t.addFieldOffset(12,e,0)}},{key:"addMetadata",value:function(t,e){t.addFieldOffset(13,e,0)}},{key:"endHeader",value:function(t){return t.endObject()}},{key:"finishHeaderBuffer",value:function(t,e){t.finish(e)}},{key:"finishSizePrefixedHeaderBuffer",value:function(t,e){t.finish(e,void 0,!0)}}],(r=[{key:"__init",value:function(t,e){return this.bb_pos=t,this.bb=e,this}},{key:"name",value:function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"envelope",value:function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb.__vector(this.bb_pos+e)+8*t):0}},{key:"envelopeLength",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"envelopeArray",value:function(){var t=this.bb.__offset(this.bb_pos,6);return t?new Float64Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null}},{key:"geometryType",value:function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.readUint8(this.bb_pos+t):Gp.Unknown}},{key:"hasZ",value:function(){var t=this.bb.__offset(this.bb_pos,10);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasM",value:function(){var t=this.bb.__offset(this.bb_pos,12);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasT",value:function(){var t=this.bb.__offset(this.bb_pos,14);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"hasTm",value:function(){var t=this.bb.__offset(this.bb_pos,16);return!!t&&!!this.bb.readInt8(this.bb_pos+t)}},{key:"columns",value:function(t,e){var r=this.bb.__offset(this.bb_pos,18);return r?(e||new hd).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*t),this.bb):null}},{key:"columnsLength",value:function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0}},{key:"featuresCount",value:function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.readUint64(this.bb_pos+t):BigInt("0")}},{key:"indexNodeSize",value:function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.readUint16(this.bb_pos+t):16}},{key:"crs",value:function(t){var e=this.bb.__offset(this.bb_pos,24);return e?(t||new kd).__init(this.bb.__indirect(this.bb_pos+e),this.bb):null}},{key:"title",value:function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"description",value:function(t){var e=this.bb.__offset(this.bb_pos,28);return e?this.bb.__string(this.bb_pos+e,t):null}},{key:"metadata",value:function(t){var e=this.bb.__offset(this.bb_pos,30);return e?this.bb.__string(this.bb_pos+e,t):null}}])&&Cd(e.prototype,r),n&&Cd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();function Pd(t){for(var e=Ad.getRootAsHeader(t),r=e.featuresCount(),n=e.indexNodeSize(),i=[],o=0;o0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Nd(t){return this instanceof Nd?(this.v=t,this):new Nd(t)}function Rd(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(t,e||[]),o=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(t){i[t]&&(n[t]=function(e){return new Promise(function(r,n){o.push([t,e,r,n])>1||s(t,e)})})}function s(t,e){try{(r=i[t](e)).value instanceof Nd?Promise.resolve(r.value.v).then(u,l):c(o[0][2],r)}catch(t){c(o[0][3],t)}var r}function u(t){s("next",t)}function l(t){s("throw",t)}function c(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}var Dd=function(t){function e(e){var r=t.call(this,e)||this;return Object.defineProperty(r,"name",{value:"RepeaterOverflowError",enumerable:!1}),"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(r,r.constructor.prototype):r.__proto__=r.constructor.prototype,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,r.constructor),r}return function(t,e){function r(){this.constructor=t}Md(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e}(Error);(function(){function t(t){if(t<0)throw new RangeError("Capacity may not be less than 0");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return this._q.length>=this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(t){if(this.full)throw new Error("Buffer full");this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}})(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){for(;this._q.length>=this._c;)this._q.shift();this._q.push(t)},t.prototype.remove=function(){if(this.empty)throw new Error("Buffer empty");return this._q.shift()}}(),function(){function t(t){if(t<1)throw new RangeError("Capacity may not be less than 1");this._c=t,this._q=[]}Object.defineProperty(t.prototype,"empty",{get:function(){return 0===this._q.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"full",{get:function(){return!1},enumerable:!1,configurable:!0}),t.prototype.add=function(t){this._q.length=Ud;return Promise.resolve(e).then(function(e){return!r&&t.state>=Vd?qd(t).then(function(t){return{value:t,done:!0}}):{value:e,done:r}})}function Xd(t,e){var r,n;if(!(t.state>=Gd))if(t.state=Gd,t.onnext(),t.onstop(),null==t.err&&(t.err=e),0!==t.pushes.length||void 0!==t.buffer&&!t.buffer.empty)try{for(var i=jd(t.pushes),o=i.next();!o.done;o=i.next()){o.value.resolve()}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}else Zd(t)}function Zd(t){var e,r;if(!(t.state>=Ud)){t.state=Vd||(t.state=zd)){t.state=zd;var e=function(t,e){if(Bd(e),t.pushes.length>=Hd)throw new Dd("No more than "+Hd+" pending calls to push are allowed on a single repeater.");if(t.state>=Gd)return Promise.resolve(void 0);var r,n=void 0===t.pending?Promise.resolve(e):t.pending.then(function(){return e});n=n.catch(function(e){t.state=Hd)throw new Dd("No more than "+Hd+" pending calls to next are allowed on a single repeater.");if(e.state<=Fd&&Jd(e),e.onnext(t),void 0!==e.buffer&&!e.buffer.empty){var r=Yd(e,e.buffer.remove());if(e.pushes.length){var n=e.pushes.shift();e.buffer.add(n.value),e.onnext=n.resolve}return r}if(e.pushes.length){var i=e.pushes.shift();return e.onnext=i.resolve,Yd(e,i.value)}return e.state>=Gd?(Zd(e),Yd(e,qd(e))):new Promise(function(r){return e.nexts.push({resolve:r,value:t})})},t.prototype.return=function(t){Bd(t);var e=Qd.get(this);if(void 0===e)throw new Error("WeakMap error");return Zd(e),e.execution=Promise.resolve(e.execution).then(function(){return t}),Yd(e,qd(e))},t.prototype.throw=function(t){var e=Qd.get(this);if(void 0===e)throw new Error("WeakMap error");return e.state<=Fd||e.state>=Gd||void 0!==e.buffer&&!e.buffer.empty?(Zd(e),null==e.err&&(e.err=t),Yd(e,qd(e))):this.next(Promise.reject(t))},t.prototype[Symbol.asyncIterator]=function(){return this},t.race=ey,t.merge=ry,t.zip=ny,t.latest=iy,t}();function ty(t,e){var r,n,i=[],o=function(t){null!=t&&"function"==typeof t[Symbol.asyncIterator]?i.push(t[Symbol.asyncIterator]()):null!=t&&"function"==typeof t[Symbol.iterator]?i.push(t[Symbol.iterator]()):i.push(function(){return Rd(this,arguments,function(){return Ld(this,function(r){switch(r.label){case 0:return e.yieldValues?[4,Nd(t)]:[3,3];case 1:return[4,r.sent()];case 2:r.sent(),r.label=3;case 3:return e.returnValues?[4,Nd(t)]:[3,5];case 4:return[2,r.sent()];case 5:return[2]}})})}())};try{for(var a=jd(t),s=a.next();!s.done;s=a.next()){o(s.value)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function ey(t){var e=this,r=ty(t,{returnValues:!0});return new $d(function(t,n){return Id(e,void 0,void 0,function(){var e,i,o,a,s,u;return Ld(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2];i=!1,n.then(function(){e(),i=!0}),l.label=1;case 1:l.trys.push([1,,5,7]),a=void 0,s=0,u=function(){var i,u,l,c,f,h;return Ld(this,function(p){switch(p.label){case 0:i=s;try{for(f=void 0,u=jd(r),l=u.next();!l.done;l=u.next())c=l.value,Promise.resolve(c.next()).then(function(t){t.done?(n(),void 0===o&&(o=t)):s===i&&(s++,e(t))},function(t){return n(t)})}catch(t){f={error:t}}finally{try{l&&!l.done&&(h=u.return)&&h.call(u)}finally{if(f)throw f.error}}return[4,new Promise(function(t){return e=t})];case 1:return void 0===(a=p.sent())?[3,3]:[4,t(a.value)];case 2:p.sent(),p.label=3;case 3:return[2]}})},l.label=2;case 2:return i?[3,4]:[5,u()];case 3:return l.sent(),[3,2];case 4:return[2,o&&o.value];case 5:return n(),[4,Promise.race(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function ry(t){var e=this,r=ty(t,{yieldValues:!0});return new $d(function(t,n){return Id(e,void 0,void 0,function(){var e,i,o,a=this;return Ld(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2];e=[],i=!1,n.then(function(){var t,r;i=!0;try{for(var n=jd(e),o=n.next();!o.done;o=n.next()){(0,o.value)()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,Promise.all(r.map(function(r,s){return Id(a,void 0,void 0,function(){var a;return Ld(this,function(u){switch(u.label){case 0:u.trys.push([0,,6,9]),u.label=1;case 1:return i?[3,5]:(Promise.resolve(r.next()).then(function(t){return e[s](t)},function(t){return n(t)}),[4,new Promise(function(t){e[s]=t})]);case 2:return void 0===(a=u.sent())?[3,4]:a.done?(o=a,[2]):[4,t(a.value)];case 3:u.sent(),u.label=4;case 4:return[3,1];case 5:return[3,9];case 6:return r.return?[4,r.return()]:[3,8];case 7:u.sent(),u.label=8;case 8:return[7];case 9:return[2]}})})}))];case 2:return s.sent(),[2,o&&o.value];case 3:return n(),[7];case 4:return[2]}})})})}function ny(t){var e=this,r=ty(t,{returnValues:!0});return new $d(function(t,n){return Id(e,void 0,void 0,function(){var e,i,o,a;return Ld(this,function(s){switch(s.label){case 0:if(!r.length)return n(),[2,[]];i=!1,n.then(function(){e(),i=!0}),s.label=1;case 1:s.trys.push([1,,6,8]),s.label=2;case 2:return i?[3,5]:(Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})]);case 3:return void 0===(o=s.sent())?[2]:(a=o.map(function(t){return t.value}),o.some(function(t){return t.done})?[2,a]:[4,t(a)]);case 4:return s.sent(),[3,2];case 5:return[3,8];case 6:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 7:return s.sent(),[7];case 8:return[2]}})})})}function iy(t){var e=this,r=ty(t,{yieldValues:!0,returnValues:!0});return new $d(function(t,n){return Id(e,void 0,void 0,function(){var e,i,o,a,s,u=this;return Ld(this,function(l){switch(l.label){case 0:if(!r.length)return n(),[2,[]];i=[],o=!1,n.then(function(){var t,r;e();try{for(var n=jd(i),a=n.next();!a.done;a=n.next()){(0,a.value)()}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}o=!0}),l.label=1;case 1:return l.trys.push([1,,5,7]),Promise.all(r.map(function(t){return t.next()})).then(function(t){return e(t)},function(t){return n(t)}),[4,new Promise(function(t){return e=t})];case 2:return void 0===(a=l.sent())?[2]:(s=a.map(function(t){return t.value}),a.every(function(t){return t.done})?[2,s]:[4,t(s.slice())]);case 3:return l.sent(),[4,Promise.all(r.map(function(e,r){return Id(u,void 0,void 0,function(){var u;return Ld(this,function(l){switch(l.label){case 0:if(a[r].done)return[2,a[r].value];l.label=1;case 1:return o?[3,4]:(Promise.resolve(e.next()).then(function(t){return i[r](t)},function(t){return n(t)}),[4,new Promise(function(t){return i[r]=t})]);case 2:return void 0===(u=l.sent())?[2,a[r].value]:u.done?[2,u.value]:(s[r]=u.value,[4,t(s.slice())]);case 3:return l.sent(),[3,1];case 4:return[2]}})})}))];case 4:return[2,l.sent()];case 5:return n(),[4,Promise.all(r.map(function(t){return t.return&&t.return()}))];case 6:return l.sent(),[7];case 7:return[2]}})})})}function oy(t){"@babel/helpers - typeof";return(oy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ay(t,e){for(var r=0;rt)){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function my(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return by(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?by(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function by(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);rthis.nodes[1]),this.nodes[1]=t}},{key:"toString",value:function(){return"[NodeRange level: ".concat(this._level,", nodes: ").concat(this.nodes[0],"-").concat(this.nodes[1],"]")}}])&&wy(t.prototype,e),r&&wy(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),a=n.minX,s=n.minY,u=n.maxX,l=n.maxY,yy.info("tree items: ".concat(e,", nodeSize: ").concat(r)),c=Cy(e,r),f=c[0][0],void 0,y=c.length-1,h=new o([0,1],y),p=[h],yy.debug("starting stream search with queue: ".concat(p,", numItems: ").concat(e,", nodeSize: ").concat(r,", levelBounds: ").concat(c)),d=gy().mark(function t(){var n,h,d,y,v,g,m,b,x;return gy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=p.shift(),yy.debug("popped node: ".concat(n,", queueLength: ").concat(p.length)),h=n.startNodeIdx(),d=h>=f,y=function(){var t=my(c[n.level()],2)[1],e=Math.min(n.endNodeIdx()+r,t);return d&&em.getFloat64(c+16,!0))){t.next=8;break}return t.abrupt("return",0);case 8:if(!(s>m.getFloat64(c+24,!0))){t.next=10;break}return t.abrupt("return",0);case 10:if(y=m.getBigUint64(c+32,!0),!d){t.next=18;break}return v=y,g=function(){if(r ").concat(x)),_.extendEndNodeIdx(Number(x)),t.abrupt("return",0);case 25:void 0,void 0,E=n.level()-1,k=[Number(x),Number(x)+1],S=new o(k,E),void 0!==_&&_.level()==S.level()?yy.info("Same level, but too far away. Pushing new request for nodeIdx: ".concat(x," rather than merging with distant ").concat(_)):yy.info("Pushing new level for ".concat(S," onto queue with nearestNodeRange: ").concat(_," since there's not already a range for this level.")),p.push(S);case 28:case"end":return t.stop()}var E,k},t)}),x=h;case 12:if(!(x=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function jy(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||Ny(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ny(t,e){if(t){if("string"==typeof t)return Ry(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ry(t,e):void 0}}function Ry(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function By(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Fy(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){By(o,n,i,a,s,"next",t)}function s(t){By(o,n,i,a,s,"throw",t)}a(void 0)})}}function zy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gy(t,e){for(var r=0;rcy.global.extraRequestThreshold()&&(yy.info("Pushing new feature batch, since gap ".concat(b," was too large")),a.push(s),s=[]),s.push([y,g]);case 23:u=!1,r.next=9;break;case 26:r.next=32;break;case 28:r.prev=28,r.t0=r.catch(7),l=!0,c=r.t0;case 32:if(r.prev=32,r.prev=33,!u||null==f.return){r.next=37;break}return r.next=37,qy(f.return());case 37:if(r.prev=37,!l){r.next=40;break}throw c;case 40:return r.finish(37);case 41:return r.finish(32);case 42:return e.headerClient.logUsage("header+index"),s.length>0&&a.push(s),x=a.flatMap(function(t){return e.readFeatureBatch(t,e.nocache)}),r.delegateYield(Yy(Zy($d.merge(x))),"t1",46);case 46:case"end":return r.stop()}},r,null,[[7,28,32,42],[33,,37,41]])}))()}},{key:"lengthBeforeTree",value:function(){return Py.length+My+this.headerLength}},{key:"lengthBeforeFeatures",value:function(){return this.lengthBeforeTree()+this.indexLength}},{key:"buildFeatureClient",value:function(t){return new Qy(this.headerClient.httpClient,t)}},{key:"readFeatureBatch",value:function(t,e){var r=this;return Hy(Dy().mark(function n(){var i,o,a,s,u,l,c,f,h,p,d,y;return Dy().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:i=jy(t[0],1),o=i[0],a=jy(t[t.length-1],2),s=a[0],u=a[1],l=s+u-o,c=r.buildFeatureClient(e),f=l,h=Ly(t),n.prev=8,h.s();case 10:if((p=h.n()).done){n.next=19;break}return d=jy(p.value,1),y=d[0],n.next=14,qy(r.readFeature(c,y,f));case 14:return n.next=16,n.sent;case 16:f=0;case 17:n.next=10;break;case 19:n.next=24;break;case 21:n.prev=21,n.t0=n.catch(8),h.e(n.t0);case 24:return n.prev=24,h.f(),n.finish(24);case 27:c.logUsage("feature");case 28:case"end":return n.stop()}},n,null,[[8,21,24,27]])}))()}},{key:"readFeature",value:function(){var t=Fy(Dy().mark(function t(e,r,n){var i,o,a,s,u,l,c;return Dy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=r+this.lengthBeforeFeatures(),t.next=3,e.getRange(i,4,n,"feature length");case 3:return a=t.sent,o=new DataView(a).getUint32(0,!0),t.next=7,e.getRange(i+4,o,n,"feature data");case 7:return s=t.sent,u=new Uint8Array(s),(l=new Uint8Array(o+My)).set(u,My),(c=new td(l)).setPosition(My),t.abrupt("return",vd.getRootAsFeature(c));case 14:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}],[{key:"open",value:function(){var e=Fy(Dy().mark(function e(r,n){var i,o,a,s,u,l,c,f,h,p,d;return Dy().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=2024,o=new Qy(r,n),a=function(){var t,e=0;for(t=0;t<3;t++){e+=Math.pow(16,t)*ky}return e}(),s=i+a,yy.debug("fetching header. minReqLength: ".concat(s," (assumedHeaderLength: ").concat(i,", assumedIndexLength: ").concat(a,")")),e.t0=Uint8Array,e.next=8,o.getRange(0,8,s,"header");case 8:if(e.t1=e.sent,(u=new e.t0(e.t1)).subarray(0,3).every(function(t,e){return Py[e]===t})){e.next=13;break}throw yy.error("bytes: ".concat(u," != ").concat(Py)),new Error("Not a FlatGeobuf file");case 13:return yy.debug("magic bytes look good"),e.next=16,o.getRange(8,4,s,"header");case 16:if(c=e.sent,!((l=new DataView(c).getUint32(0,!0))>10485760||l<8)){e.next=21;break}throw new Error("Invalid header size");case 21:return yy.debug("headerLength: ".concat(l)),e.next=24,o.getRange(12,l,s,"header");case 24:return f=e.sent,h=new td(new Uint8Array(f)),p=Pd(h),d=Ty(p.featuresCount,p.indexNodeSize),yy.debug("completed: opening http reader"),e.abrupt("return",new t(o,p,l,d,n));case 30:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()}])}(),Qy=function(){return Uy(function t(e,r){if(zy(this,t),this.bytesEverUsed=0,this.bytesEverFetched=0,this.buffer=new ArrayBuffer(0),this.head=0,"string"==typeof e)this.httpClient=new $y(e,r);else{if(!(e instanceof $y))throw new Error("Unknown source ");this.httpClient=e}},[{key:"getRange",value:function(){var t=Fy(Dy().mark(function t(e,r,n,i){var o,a,s;return Dy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.bytesEverUsed+=r,o=e-this.head,a=o+r,!(o>=0&&a<=this.buffer.byteLength)){t.next=5;break}return t.abrupt("return",this.buffer.slice(o,a));case 5:return s=Math.max(r,n),this.bytesEverFetched+=s,yy.debug("requesting for new Range: ".concat(e,"-").concat(e+s-1)),t.next=10,this.httpClient.getRange(e,s,i);case 10:return this.buffer=t.sent,this.head=e,t.abrupt("return",this.buffer.slice(0,r));case 13:case"end":return t.stop()}},t,this)}));return function(e,r,n,i){return t.apply(this,arguments)}}()},{key:"logUsage",value:function(t){var e=t.split(" ")[0],r=this.bytesEverUsed,n=this.bytesEverFetched,i=(100*r/n).toFixed(2);yy.info("".concat(e," bytes used/requested: ").concat(r," / ").concat(n," = ").concat(i,"%"))}}])}(),$y=function(){return Uy(function t(e,r){zy(this,t),this.requestsEverMade=0,this.bytesEverRequested=0,this.url=e,this.nocache=r},[{key:"getRange",value:function(){var t=Fy(Dy().mark(function t(e,r,n){var i,o,a;return Dy().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.requestsEverMade+=1,this.bytesEverRequested+=r,i="bytes=".concat(e,"-").concat(e+r-1),yy.info("request: #".concat(this.requestsEverMade,", purpose: ").concat(n,"), bytes: (this_request: ").concat(r,", ever: ").concat(this.bytesEverRequested,"), Range: ").concat(i)),o={Range:i},this.nocache&&(o["Cache-Control"]="no-cache, no-store"),t.next=8,fetch(this.url,{headers:o});case 8:return a=t.sent,t.abrupt("return",a.arrayBuffer());case 10:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()}])}();function tv(t){"@babel/helpers - typeof";return(tv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ev(){ev=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==tv(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function rv(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function nv(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){rv(o,n,i,a,s,"next",t)}function s(t){rv(o,n,i,a,s,"throw",t)}a(void 0)})}}function iv(t){var e,r,n,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(e=t[r]))return e.call(t);if(n&&null!=(e=t[n]))return new ov(e.call(t));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function ov(t){function e(t){if(Object(t)!==t)return Promise.reject(new TypeError(t+" is not an object."));var e=t.done;return Promise.resolve(t.value).then(function(t){return{value:t,done:e}})}return(ov=function(t){this.s=t,this.n=t.next}).prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(t){var r=this.s.return;return void 0===r?Promise.resolve({value:t,done:!0}):e(r.apply(this.s,arguments))},throw:function(t){var r=this.s.return;return void 0===r?Promise.reject(t):e(r.apply(this.s,arguments))}},new ov(t)}function av(t){return new lv(t,0)}function sv(t){return function(){return new uv(t.apply(this,arguments))}}function uv(t){var e,r;function n(e,r){try{var o=t[e](r),a=o.value,s=a instanceof lv;Promise.resolve(s?a.v:a).then(function(r){if(s){var u="return"===e?"return":"next";if(!a.k||r.done)return n(u,r);r=t[u](r).value}i(o.done?"return":"normal",r)},function(t){n("throw",t)})}catch(t){i("throw",t)}}function i(t,i){switch(t){case"return":e.resolve({value:i,done:!0});break;case"throw":e.reject(i);break;default:e.resolve({value:i,done:!1})}(e=e.next)?n(e.key,e.arg):r=null}this._invoke=function(t,i){return new Promise(function(o,a){var s={key:t,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(e=r=s,n(t,i))})},"function"!=typeof t.return&&(this.return=void 0)}function lv(t,e){this.v=t,this.k=e}function cv(){return(cv=sv(ev().mark(function t(e,r,n){var i,o,a,s,u,l,c,f,h,p;return ev().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i="function"==typeof(d=e).slice?d:new wd("function"==typeof d.read?d:d.getReader()),o=function(){var t=nv(ev().mark(function t(e){return ev().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.slice(e);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}(),t.t0=Uint8Array,t.next=5,av(o(8,"magic bytes"));case 5:if(t.t1=t.sent,(a=new t.t0(t.t1)).subarray(0,3).every(function(t,e){return Py[e]===t})){t.next=9;break}throw new Error("Not a FlatGeobuf file");case 9:return t.t2=Uint8Array,t.next=12,av(o(4,"header length"));case 12:return t.t3=t.sent,a=new t.t2(t.t3),s=new td(a),u=s.readUint32(0),t.t4=Uint8Array,t.next=19,av(o(u,"header data"));case 19:if(t.t5=t.sent,a=new t.t4(t.t5),s=new td(a),l=Pd(s),n&&n(l),c=l.indexNodeSize,f=l.featuresCount,!(c>0)){t.next=29;break}return h=Ty(f,c),t.next=29,av(o(h,"entire index, w/o rect"));case 29:return t.next=31,av(hv(o,l,r));case 31:if(!(p=t.sent)){t.next=36;break}return t.next=34,p;case 34:t.next=29;break;case 36:case"end":return t.stop()}var d},t)}))).apply(this,arguments)}function fv(){return(fv=sv(function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return ev().mark(function o(){var a,s,u,l,c,f,h;return ev().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,av(Jy.open(t,i));case 2:a=o.sent,yy.debug("opened reader"),n&&n(a.header),s=!1,u=!1,o.prev=7,c=iv(a.selectBbox(e));case 9:return o.next=11,av(c.next());case 11:if(!(s=!(f=o.sent).done)){o.next=18;break}return h=f.value,o.next=15,r(h,a.header);case 15:s=!1,o.next=9;break;case 18:o.next=24;break;case 20:o.prev=20,o.t0=o.catch(7),u=!0,l=o.t0;case 24:if(o.prev=24,o.prev=25,!s||null==c.return){o.next=29;break}return o.next=29,av(c.return());case 29:if(o.prev=29,!u){o.next=32;break}throw l;case 32:return o.finish(29);case 33:return o.finish(24);case 34:case"end":return o.stop()}},o,null,[[7,20,24,34],[25,,29,33]])})()})).apply(this,arguments)}function hv(t,e,r){return pv.apply(this,arguments)}function pv(){return(pv=nv(ev().mark(function t(e,r,n){var i,o,a,s,u;return ev().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,e(4,"feature length");case 3:if(t.t1=t.sent,0!==(i=new t.t0(t.t1)).byteLength){t.next=7;break}return t.abrupt("return");case 7:return o=new td(i),a=o.readUint32(0),t.t2=Uint8Array,t.next=12,e(a,"feature data");case 12:return t.t3=t.sent,i=new t.t2(t.t3),(s=new Uint8Array(a+4)).set(i,4),(o=new td(s)).setPosition(My),u=vd.getRootAsFeature(o),t.abrupt("return",n(u,r));case 20:case"end":return t.stop()}},t)}))).apply(this,arguments)}function dv(t,e){return{type:"FeatureCollection",features:function(t,e,r){if(!t.subarray(0,3).every(function(t,e){return Py[e]===t}))throw new Error("Not a FlatGeobuf file");var n=new td(t),i=n.readUint32(Py.length);n.setPosition(Py.length+My);var o=Pd(n);r&&r(o);var a=Py.length+My+i,s=o.indexNodeSize,u=o.featuresCount;s>0&&(a+=Ty(u,s));for(var l=[];a3&&void 0!==arguments[3]&&arguments[3])}function gv(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t instanceof Uint8Array?dv(t,r):t instanceof ReadableStream?yv(t,r):vv(t,e,r,n)}uv.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},uv.prototype.next=function(t){return this._invoke("next",t)},uv.prototype.throw=function(t){return this._invoke("throw",t)},uv.prototype.return=function(t){return this._invoke("return",t)};var mv=r(833),bv=r.n(mv);function xv(t){"@babel/helpers - typeof";return(xv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wv(){wv=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==xv(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _v(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Sv(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){_v(o,n,i,a,s,"next",t)}function s(t){_v(o,n,i,a,s,"throw",t)}a(void 0)})}}function Ev(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:$.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this.sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.init()},(e=[{key:"init",value:function(){"bbox"===this.strategy&&(this.loadedExtentsRtree_=new(bv()))}},{key:"iterateFeatures",value:function(){var t=Sv(wv().mark(function t(e){var r,n,i,o,a,s,u;return wv().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r={type:"FeatureCollection",features:[]},n=!1,i=!1,t.prev=3,a=Tv(e);case 5:return t.next=7,a.next();case 7:if(!(n=!(s=t.sent).done)){t.next=15;break}u=s.value,this.options.featureLoader&&"function"==typeof this.options.featureLoader&&(u=this.options.featureLoader(u)),this.layerType||(this.layerType=Ov[u.geometry.type]),r.features.push(u);case 12:n=!1,t.next=5;break;case 15:t.next=21;break;case 17:t.prev=17,t.t0=t.catch(3),i=!0,o=t.t0;case 21:if(t.prev=21,t.prev=22,!n||null==a.return){t.next=26;break}return t.next=26,a.return();case 26:if(t.prev=26,!i){t.next=29;break}throw o;case 29:return t.finish(26);case 30:return t.finish(21);case 31:return t.abrupt("return",r);case 32:case"end":return t.stop()}},t,this,[[3,17,21,31],[22,,26,30]])}));return function(e){return t.apply(this,arguments)}}()},{key:"_loadData",value:function(){var t=Sv(wv().mark(function t(e){var r,n,i=this;return wv().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]},e.length){t.next=7;break}return t.next=4,this._getStream(this.url);case 4:r=t.sent,t.next=9;break;case 7:n.value={extent:e.slice()},this.loadedExtentsRtree_.insert(n);case 9:return t.next=11,gv(r&&r.body||this.url,n,function(t){i.layerType=Ov[t.geometryType]});case 11:return t.abrupt("return",t.sent);case 12:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"_getStream",value:function(){var t=Sv(wv().mark(function t(e){return wv().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ut.get(e,{},{withoutFormatSuffix:!0}).then(function(t){return t});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()},{key:"_containsExtent",value:function(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}},{key:"_getInExtent",value:function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.loadedExtentsRtree_.search(e).map(function(t){return t.value})}},{key:"_forEachInExtent",value:function(t,e){return this._forEach(this._getInExtent(t),e)}},{key:"_forEach",value:function(t,e){for(var r,n=0,i=t.length;n=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Iv(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function Lv(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){Iv(o,n,i,a,s,"next",t)}function s(t){Iv(o,n,i,a,s,"throw",t)}a(void 0)})}}function jv(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=e.layerID?e.layerID:$.createUniqueID("FGBLayer_"),this.layerId=this.id+"outer",this._sourceId=this.layerId,this.options=e,this.strategy=e.strategy||"bbox",this.url=e.url,this.layerType="",this.extent=e.extent,this.overlay=!0,this.type="custom",this.renderingMode="3d",this._updateFeaturesFn=this._updateFeatures.bind(this)},(e=[{key:"onAdd",value:function(t){this.map=t;var e,r,n,i=[];if("bbox"===this.strategy){var o=this.map.getBounds().toArray();i=[o[0][0],o[0][1],o[1][0],o[1][1]],this.map.on("moveend",this._updateFeaturesFn)}if(this.extent){var a=(e=this.extent,n=[],function(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}(e,r=i)&&(e[0]>r[0]?n[0]=e[0]:n[0]=r[0],e[1]>r[1]?n[1]=e[1]:n[1]=r[1],e[2]0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.url=e.url,this.layerId=e.id,this.autoplay=void 0===e.autoplay||e.autoplay,this.loop=void 0===e.loop||e.loop},(e=[{key:"_createVideoElement",value:function(){var t=document.createElement("video");t.id=this.layerId,t.className="video-js",t.style.position="fixed",t.style.left="-300%",t.setAttribute("crossorigin","anonymous"),document.body.appendChild(t)}},{key:"createVideo",value:function(){this._createVideoElement();var t=this._getVideoOptions();return this.video=Fv()(this.layerId,t,function(){}),this.video}},{key:"_getVideoOptions",value:function(){if(this.url){var t={autoplay:this.autoplay,muted:!0,loop:this.loop};return this.url.includes("mp4")?t.sources=[{src:this.url,type:"video/mp4"}]:this.url.includes("flv")?t={loop:this.loop,autoplay:this.autoplay,muted:!0,techOrder:["html5","flvjs"],flvjs:{mediaDataSource:{isLive:!0,cors:!0,withCredentials:!1}},sources:[{src:this.url,type:"video/x-flv"}]}:this.url.includes("m3u8")&&(t.sources=[{src:this.url}]),t}}},{key:"getVideoDomId",value:function(){if(this.url){var t;if(this.url.includes("flv")){var e=document.querySelector("#".concat(this.layerId));t="".concat(this.layerId,"_flvjs_api"),e.style.position="fixed",e.style.left="-200%"}else t=this.video.el_.firstChild.id;return t}}}])&&Gv(t.prototype,e),r&&Gv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Hv=function(){try{return turf}catch(t){return{}}}();function Wv(t){"@babel/helpers - typeof";return(Wv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qv(t,e){for(var r=0;r=this.text.length)return;t=this.text[this.place++]}switch(this.state){case Sg:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},Ag.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(Cg.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Ag.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=Sg)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=Sg,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},Ag.prototype.number=function(t){if(!Og.test(t)){if(Cg.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Ag.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},Ag.prototype.keyword=function(t){if(Tg.test(t))this.word+=t;else{if("["===t){var e=[];return e.push(this.word),this.level++,null===this.root?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,void(this.state=Sg)}if(!Cg.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Ag.prototype.neutral=function(t){if(kg.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(Og.test(t))return this.word=t,void(this.state=3);if(!Cg.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Ag.prototype.output=function(){for(;this.place0?90:-90)):(t.lat0=jg(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(i),i}function Rg(t){var e=this;if(2===arguments.length){var r=arguments[1];"string"==typeof r?"+"===r.charAt(0)?Rg[t]=wg(arguments[1]):Rg[t]=Ng(arguments[1]):Rg[t]=r}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?Rg.apply(e,t):Rg(t)});if("string"==typeof t){if(t in Rg)return Rg[t]}else"EPSG"in t?Rg["EPSG:"+t.EPSG]=t:"ESRI"in t?Rg["ESRI:"+t.ESRI]=t:"IAU2000"in t?Rg["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(Rg);var Dg=Rg;var Bg=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var Fg=["3857","900913","3785","102113"];var zg=function(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in Dg}(t))return Dg[t];if(function(t){return Bg.some(function(e){return t.indexOf(e)>-1})}(t)){var e=Ng(t);if(function(t){var e=xg(t,"authority");if(e){var r=xg(e,"epsg");return r&&Fg.indexOf(r)>-1}}(e))return Dg["EPSG:3857"];var r=function(t){var e=xg(t,"extension");if(e)return xg(e,"proj4")}(e);return r?wg(r):e}return function(t){return"+"===t[0]}(t)?wg(t):void 0};function Gg(t,e){var r,n;if(t=t||{},!e)return t;for(n in e)void 0!==(r=e[n])&&(t[n]=r);return t}function Ug(t,e,r){var n=t*e;return r/Math.sqrt(1-n*n)}function Vg(t){return t<0?-1:1}function Hg(t){return Math.abs(t)<=vg?t:t-Vg(t)*yg}function Wg(t,e,r){var n=t*r,i=.5*t;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(sg-e))/n}function qg(t,e){for(var r,n,i=.5*t,o=sg-2*Math.atan(e),a=0;a<=15;a++)if(r=t*Math.sin(o),o+=n=sg-2*Math.atan(e*Math.pow((1-r)/(1+r),i))-o,Math.abs(n)<=1e-10)return o;return-9999}function Yg(t){return t}var Xg=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Ug(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var e,r,n=t.x,i=t.y;if(i*pg>90&&i*pg<-90&&n*pg>180&&n*pg<-180)return null;if(Math.abs(Math.abs(i)-sg)<=fg)return null;if(this.sphere)e=this.x0+this.a*this.k0*Hg(n-this.long0),r=this.y0+this.a*this.k0*Math.log(Math.tan(dg+.5*i));else{var o=Math.sin(i),a=Wg(this.e,i,o);e=this.x0+this.a*this.k0*Hg(n-this.long0),r=this.y0-this.a*this.k0*Math.log(a)}return t.x=e,t.y=r,t},inverse:function(t){var e,r,n=t.x-this.x0,i=t.y-this.y0;if(this.sphere)r=sg-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var o=Math.exp(-i/(this.a*this.k0));if(-9999===(r=qg(this.e,o)))return null}return e=Hg(this.long0+n/(this.a*this.k0)),t.x=e,t.y=r,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:Yg,inverse:Yg,names:["longlat","identity"]}],Zg={},Kg=[];function Jg(t,e){var r=Kg.length;return t.names?(Kg[r]=t,t.names.forEach(function(t){Zg[t.toLowerCase()]=r}),this):(console.log(e),!0)}var Qg={start:function(){Xg.forEach(Jg)},add:Jg,get:function(t){if(!t)return!1;var e=t.toLowerCase();return void 0!==Zg[e]&&Kg[Zg[e]]?Kg[Zg[e]]:void 0}},$g={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},tm=$g.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};$g.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var em={};em.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},em.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},em.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},em.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},em.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},em.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},em.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},em.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},em.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},em.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},em.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},em.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},em.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},em.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},em.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},em.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},em.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},em.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var rm=function(t,e,r,n,i,o,a){var s={};return s.datum_type=void 0===t||"none"===t?rg:eg,e&&(s.datum_params=e.map(parseFloat),0===s.datum_params[0]&&0===s.datum_params[1]&&0===s.datum_params[2]||(s.datum_type=Qv),s.datum_params.length>3&&(0===s.datum_params[3]&&0===s.datum_params[4]&&0===s.datum_params[5]&&0===s.datum_params[6]||(s.datum_type=$v,s.datum_params[3]*=ag,s.datum_params[4]*=ag,s.datum_params[5]*=ag,s.datum_params[6]=s.datum_params[6]/1e6+1))),a&&(s.datum_type=tg,s.grids=a),s.a=r,s.b=n,s.es=i,s.ep2=o,s},nm={};function im(t){if(0===t.length)return null;var e="@"===t[0];return e&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:nm[t]||null,isNull:!1}}function om(t){return t/3600*Math.PI/180}function am(t,e,r){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,r)))}function sm(t){return t.map(function(t){return[om(t.longitudeShift),om(t.latitudeShift)]})}function um(t,e,r){return{name:am(t,e+8,e+16).trim(),parent:am(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,r),upperLatitude:t.getFloat64(e+88,r),lowerLongitude:t.getFloat64(e+104,r),upperLongitude:t.getFloat64(e+120,r),latitudeInterval:t.getFloat64(e+136,r),longitudeInterval:t.getFloat64(e+152,r),gridNodeCount:t.getInt32(e+168,r)}}function lm(t,e,r,n){for(var i=e+176,o=[],a=0;a-1.001*sg)u=-sg;else if(u>sg&&u<1.001*sg)u=sg;else{if(u<-sg)return{x:-1/0,y:-1/0,z:t.z};if(u>sg)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),i=Math.sin(u),a=Math.cos(u),o=i*i,{x:((n=r/Math.sqrt(1-e*o))+l)*a*Math.cos(s),y:(n+l)*a*Math.sin(s),z:(n*(1-e)+l)*i}}function pm(t,e,r,n){var i,o,a,s,u,l,c,f,h,p,d,y,v,g,m,b=t.x,x=t.y,w=t.z?t.z:0;if(i=Math.sqrt(b*b+x*x),o=Math.sqrt(b*b+x*x+w*w),i/r<1e-12){if(g=0,o/r<1e-12)return sg,m=-n,{x:t.x,y:t.y,z:t.z}}else g=Math.atan2(x,b);a=w/o,f=(s=i/o)*(1-e)*(u=1/Math.sqrt(1-e*(2-e)*s*s)),h=a*u,v=0;do{v++,l=e*(c=r/Math.sqrt(1-e*h*h))/(c+(m=i*f+w*h-c*(1-e*h*h))),y=(d=a*(u=1/Math.sqrt(1-l*(2-l)*s*s)))*f-(p=s*(1-l)*u)*h,f=p,h=d}while(y*y>1e-24&&v<30);return{x:g,y:Math.atan(d/Math.abs(p)),z:m}}function dm(t){return t===Qv||t===$v}function ym(t,e,r){if(function(t,e){return t.datum_type===e.datum_type&&!(t.a!==e.a||Math.abs(t.es-e.es)>5e-11)&&(t.datum_type===Qv?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==$v||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6])}(t,e))return r;if(t.datum_type===rg||e.datum_type===rg)return r;var n=t.a,i=t.es;if(t.datum_type===tg){if(0!==vm(t,!1,r))return;n=ng,i=og}var o=e.a,a=e.b,s=e.es;if(e.datum_type===tg&&(o=ng,a=ig,s=og),i===s&&n===o&&!dm(t.datum_type)&&!dm(e.datum_type))return r;if((r=hm(r,i,n),dm(t.datum_type)&&(r=function(t,e,r){if(e===Qv)return{x:t.x+r[0],y:t.y+r[1],z:t.z+r[2]};if(e===$v){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6];return{x:l*(t.x-u*t.y+s*t.z)+n,y:l*(u*t.x+t.y-a*t.z)+i,z:l*(-s*t.x+a*t.y+t.z)+o}}}(r,t.datum_type,t.datum_params)),dm(e.datum_type)&&(r=function(t,e,r){if(e===Qv)return{x:t.x-r[0],y:t.y-r[1],z:t.z-r[2]};if(e===$v){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],u=r[5],l=r[6],c=(t.x-n)/l,f=(t.y-i)/l,h=(t.z-o)/l;return{x:c+u*f-s*h,y:-u*c+f+a*h,z:s*c-a*f+h}}}(r,e.datum_type,e.datum_params)),r=pm(r,s,o,a),e.datum_type===tg)&&0!==vm(e,!0,r))return;return r}function vm(t,e,r){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[];t:for(var a=0;an.y||p>n.x||v1e-12&&Math.abs(a.y)>1e-12);if(u<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=Hg(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=t.x+o.x,n.y=t.y+o.y);return n}function mm(t,e){var r,n={x:t.x/e.del[0],y:t.y/e.del[1]},i=Math.floor(n.x),o=Math.floor(n.y),a=n.x-1*i,s=n.y-1*o,u={x:Number.NaN,y:Number.NaN};if(i<0||i>=e.lim[0])return u;if(o<0||o>=e.lim[1])return u;r=o*e.lim[0]+i;var l=e.cvs[r][0],c=e.cvs[r][1];r++;var f=e.cvs[r][0],h=e.cvs[r][1];r+=e.lim[0];var p=e.cvs[r][0],d=e.cvs[r][1];r--;var y=e.cvs[r][0],v=e.cvs[r][1],g=a*s,m=a*(1-s),b=(1-a)*(1-s),x=(1-a)*s;return u.x=b*l+m*f+x*y+g*p,u.y=b*c+m*h+x*v+g*d,u}function bm(t,e,r){var n,i,o,a=r.x,s=r.y,u=r.z||0,l={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==r.z)switch(0===o?(n=a,i=-1!=="ew".indexOf(t.axis[o])?"x":"y"):1===o?(n=s,i=-1!=="ns".indexOf(t.axis[o])?"y":"x"):(n=u,i="z"),t.axis[o]){case"e":l[i]=n;break;case"w":l[i]=-n;break;case"n":l[i]=n;break;case"s":l[i]=-n;break;case"u":void 0!==r[i]&&(l.z=n);break;case"d":void 0!==r[i]&&(l.z=-n);break;default:return null}return l}function xm(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function wm(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function _m(t,e,r,n){var i,o=void 0!==(r=Array.isArray(r)?xm(r):{x:r.x,y:r.y,z:r.z,m:r.m}).z;if(function(t){wm(t.x),wm(t.y)}(r),t.datum&&e.datum&&function(t,e){return(t.datum.datum_type===Qv||t.datum.datum_type===$v||t.datum.datum_type===tg)&&"WGS84"!==e.datumCode||(e.datum.datum_type===Qv||e.datum.datum_type===$v||e.datum.datum_type===tg)&&"WGS84"!==t.datumCode}(t,e)&&(r=_m(t,i=new fm("WGS84"),r,n),t=i),n&&"enu"!==t.axis&&(r=bm(t,!1,r)),"longlat"===t.projName)r={x:r.x*hg,y:r.y*hg,z:r.z||0};else if(t.to_meter&&(r={x:r.x*t.to_meter,y:r.y*t.to_meter,z:r.z||0}),!(r=t.inverse(r)))return;if(t.from_greenwich&&(r.x+=t.from_greenwich),r=ym(t.datum,e.datum,r))return e.from_greenwich&&(r={x:r.x-e.from_greenwich,y:r.y,z:r.z||0}),"longlat"===e.projName?r={x:r.x*pg,y:r.y*pg,z:r.z||0}:(r=e.forward(r),e.to_meter&&(r={x:r.x/e.to_meter,y:r.y/e.to_meter,z:r.z||0})),n&&"enu"!==e.axis?bm(e,!0,r):(r&&!o&&delete r.z,r)}var Sm=fm("WGS84");function Em(t,e,r,n){var i,o,a;return Array.isArray(r)?(i=_m(t,e,r,n)||{x:NaN,y:NaN},r.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name?"number"==typeof i.z?[i.x,i.y,i.z].concat(r.splice(3)):[i.x,i.y,r[2]].concat(r.splice(3)):[i.x,i.y].concat(r.splice(2)):[i.x,i.y]):(o=_m(t,e,r,n),2===(a=Object.keys(r)).length?o:(a.forEach(function(n){if(void 0!==t.name&&"geocent"===t.name||void 0!==e.name&&"geocent"===e.name){if("x"===n||"y"===n||"z"===n)return}else if("x"===n||"y"===n)return;o[n]=r[n]}),o))}function km(t){return t instanceof fm?t:t.oProj?t.oProj:fm(t)}var Tm=function(t,e,r){t=km(t);var n,i=!1;return void 0===e?(e=t,t=Sm,i=!0):(void 0!==e.x||Array.isArray(e))&&(r=e,e=t,t=Sm,i=!0),e=km(e),r?Em(t,e,r):(n={forward:function(r,n){return Em(t,e,r,n)},inverse:function(r,n){return Em(e,t,r,n)}},i&&(n.oProj=e),n)},Cm=6,Om="AJSAJS",Am="AFAFAF",Pm=65,Mm=73,Im=79,Lm=86,jm=90,Nm={forward:Rm,inverse:function(t){var e=zm(Um(t.toUpperCase()));if(e.lat&&e.lon)return[e.lon,e.lat,e.lon,e.lat];return[e.left,e.bottom,e.right,e.top]},toPoint:Dm};function Rm(t,e){return e=e||5,function(t,e){var r="00000"+t.easting,n="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(p=t.easting,d=t.northing,y=t.zoneNumber,v=Gm(y),g=Math.floor(p/1e5),m=Math.floor(d/1e5)%20,i=g,o=m,a=v,s=a-1,u=Om.charCodeAt(s),l=Am.charCodeAt(s),c=u+i-1,f=l+o,h=!1,c>jm&&(c=c-jm+Pm-1,h=!0),(c===Mm||uMm||(c>Mm||uIm||(c>Im||ujm&&(c=c-jm+Pm-1),f>Lm?(f=f-Lm+Pm-1,h=!0):h=!1,(f===Mm||lMm||(f>Mm||lIm||(f>Im||lLm&&(f=f-Lm+Pm-1),String.fromCharCode(c)+String.fromCharCode(f))+r.substr(r.length-5,e)+n.substr(n.length-5,e);var i,o,a,s,u,l,c,f,h;var p,d,y,v,g,m}(function(t){var e,r,n,i,o,a,s,u=t.lat,l=t.lon,c=6378137,f=Bm(u),h=Bm(l);s=Math.floor((l+180)/6)+1,180===l&&(s=60);u>=56&&u<64&&l>=3&&l<12&&(s=32);u>=72&&u<84&&(l>=0&&l<9?s=31:l>=9&&l<21?s=33:l>=21&&l<33?s=35:l>=33&&l<42&&(s=37));a=Bm(6*(s-1)-180+3),.006739496752268451,e=c/Math.sqrt(1-.00669438*Math.sin(f)*Math.sin(f)),r=Math.tan(f)*Math.tan(f),n=.006739496752268451*Math.cos(f)*Math.cos(f),i=Math.cos(f)*(h-a),o=c*(.9983242984503243*f-.002514607064228144*Math.sin(2*f)+2639046602129982e-21*Math.sin(4*f)-3.418046101696858e-9*Math.sin(6*f));var p=.9996*e*(i+(1-r+n)*i*i*i/6+(5-18*r+r*r+72*n-.39089081163157013)*i*i*i*i*i/120)+5e5,d=.9996*(o+e*Math.tan(f)*(i*i/2+(5-r+9*n+4*n*n)*i*i*i*i/24+(61-58*r+r*r+600*n-2.2240339282485886)*i*i*i*i*i*i/720));u<0&&(d+=1e7);return{northing:Math.round(d),easting:Math.round(p),zoneNumber:s,zoneLetter:function(t){var e="Z";84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C");return e}(u)}}({lat:t[1],lon:t[0]}),e)}function Dm(t){var e=zm(Um(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function Bm(t){return t*(Math.PI/180)}function Fm(t){return t/Math.PI*180}function zm(t){var e=t.northing,r=t.easting,n=t.zoneLetter,i=t.zoneNumber;if(i<0||i>60)return null;var o,a,s,u,l,c,f,h,p=6378137,d=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=r-5e5,v=e;n<"N"&&(v-=1e7),c=6*(i-1)-180+3,h=(f=v/.9996/6367449.145945056)+(3*d/2-27*d*d*d/32)*Math.sin(2*f)+(21*d*d/16-55*d*d*d*d/32)*Math.sin(4*f)+151*d*d*d/96*Math.sin(6*f),o=p/Math.sqrt(1-.00669438*Math.sin(h)*Math.sin(h)),a=Math.tan(h)*Math.tan(h),s=.006739496752268451*Math.cos(h)*Math.cos(h),u=.99330562*p/Math.pow(1-.00669438*Math.sin(h)*Math.sin(h),1.5),l=y/(.9996*o);var g=h-o*Math.tan(h)/u*(l*l/2-(5+3*a+10*s-4*s*s-.06065547077041606)*l*l*l*l/24+(61+90*a+298*s+45*a*a-1.6983531815716497-3*s*s)*l*l*l*l*l*l/720);g=Fm(g);var m,b=(l-(1+2*a+s)*l*l*l/6+(5-2*s+28*a-3*s*s+.05391597401814761+24*a*a)*l*l*l*l*l/120)/Math.cos(h);if(b=c+Fm(b),t.accuracy){var x=zm({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});m={top:x.lat,right:x.lon,bottom:g,left:b}}else m={lat:g,lon:b};return m}function Gm(t){var e=t%Cm;return 0===e&&(e=Cm),e}function Um(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var e,r=t.length,n=null,i="",o=0;!/[A-Z]/.test(e=t.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+t;i+=e,o++}var a=parseInt(i,10);if(0===o||o+3>r)throw"MGRSPoint bad conversion from: "+t;var s=t.charAt(o++);if(s<="A"||"B"===s||"Y"===s||s>="Z"||"I"===s||"O"===s)throw"MGRSPoint zone letter "+s+" not handled: "+t;n=t.substring(o,o+=2);for(var u=Gm(a),l=function(t,e){var r=Om.charCodeAt(e-1),n=1e5,i=!1;for(;r!==t.charCodeAt(0);){if(++r===Mm&&r++,r===Im&&r++,r>jm){if(i)throw"Bad character: "+t;r=Pm,i=!0}n+=1e5}return n}(n.charAt(0),u),c=function(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var r=Am.charCodeAt(e-1),n=0,i=!1;for(;r!==t.charCodeAt(0);){if(++r===Mm&&r++,r===Im&&r++,r>Lm){if(i)throw"Bad character: "+t;r=Pm,i=!0}n+=1e5}return n}(n.charAt(1),u);c0&&(h=1e5/Math.pow(10,y),p=t.substring(o,o+y),v=parseFloat(p)*h,d=t.substring(o+y),g=parseFloat(d)*h),{easting:v+l,northing:g+c,zoneLetter:s,zoneNumber:a,accuracy:h}}function Vm(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Hm(t,e,r){if(!(this instanceof Hm))return new Hm(t,e,r);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===e){var n=t.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=t,this.y=e,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Hm.fromMGRS=function(t){return new Hm(Dm(t))},Hm.prototype.toMGRS=function(t){return Rm([this.x,this.y],t)};var Wm=Hm,qm=1,Ym=.25,Xm=.046875,Zm=.01953125,Km=.01068115234375,Jm=.75,Qm=.46875,$m=.013020833333333334,tb=.007120768229166667,eb=.3645833333333333,rb=.005696614583333333,nb=.3076171875;function ib(t){var e=[];e[0]=qm-t*(Ym+t*(Xm+t*(Zm+t*Km))),e[1]=t*(Jm-t*(Xm+t*(Zm+t*Km)));var r=t*t;return e[2]=r*(Qm-t*($m+t*tb)),r*=t,e[3]=r*(eb-t*rb),e[4]=r*t*nb,e}function ob(t,e,r,n){return r*=e,e*=e,n[0]*t-r*(n[1]+e*(n[2]+e*(n[3]+e*n[4])))}var ab=20;function sb(t,e,r){for(var n=1/(1-e),i=t,o=ab;o;--o){var a=Math.sin(i),s=1-e*a*a;if(i-=s=(ob(i,a,Math.cos(i),r)-t)*(s*Math.sqrt(s))*n,Math.abs(s)fg?Math.tan(o):0,d=Math.pow(p,2),y=Math.pow(d,2);e=1-this.es*Math.pow(s,2),l/=Math.sqrt(e);var v=ob(o,s,u,this.en);r=this.a*(this.k0*l*(1+c/6*(1-d+f+c/20*(5-18*d+y+14*f-58*d*f+c/42*(61+179*y-y*d-479*d)))))+this.x0,n=this.a*(this.k0*(v-this.ml0+s*a*l/2*(1+c/12*(5-d+9*f+4*h+c/30*(61+y-58*d+270*f-330*d*f+c/56*(1385+543*y-y*d-3111*d))))))+this.y0}else{var g=u*Math.sin(a);if(Math.abs(Math.abs(g)-1)=1){if(g-1>fg)return 93;n=0}else n=Math.acos(n);o<0&&(n=-n),n=this.a*this.k0*(n-this.lat0)+this.y0}return t.x=r,t.y=n,t},inverse:function(t){var e,r,n,i,o=(t.x-this.x0)*(1/this.a),a=(t.y-this.y0)*(1/this.a);if(this.es)if(r=sb(e=this.ml0+a/this.k0,this.es,this.en),Math.abs(r)fg?Math.tan(r):0,c=this.ep2*Math.pow(u,2),f=Math.pow(c,2),h=Math.pow(l,2),p=Math.pow(h,2);e=1-this.es*Math.pow(s,2);var d=o*Math.sqrt(e)/this.k0,y=Math.pow(d,2);n=r-(e*=l)*y/(1-this.es)*.5*(1-y/12*(5+3*h-9*c*h+c-4*f-y/30*(61+90*h-252*c*h+45*p+46*c-y/56*(1385+3633*h+4095*p+1574*p*h)))),i=Hg(this.long0+d*(1-y/6*(1+2*h+c-y/20*(5+28*h+24*p+8*c*h+6*c-y/42*(61+662*h+1320*p+720*p*h))))/u)}else n=sg*Vg(a),i=0;else{var v=Math.exp(o/this.k0),g=.5*(v-1/v),m=this.lat0+a/this.k0,b=Math.cos(m);e=Math.sqrt((1-Math.pow(b,2))/(1+Math.pow(g,2))),n=Math.asin(e),a<0&&(n=-n),i=0===g&&0===b?0:Hg(Math.atan2(g,b)+this.long0)}return t.x=i,t.y=n,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function lb(t){var e=Math.exp(t);return e=(e-1/e)/2}function cb(t,e){t=Math.abs(t),e=Math.abs(e);var r=Math.max(t,e),n=Math.min(t,e)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function fb(t){var e=Math.abs(t);return e=function(t){var e=1+t,r=e-1;return 0===r?t:t*Math.log(e)/r}(e*(1+e/(cb(1,e)+1))),t<0?-e:e}function hb(t,e){for(var r,n=2*Math.cos(2*e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return e+r*Math.sin(2*e)}function pb(t,e,r){for(var n,i,o=Math.sin(e),a=Math.cos(e),s=lb(r),u=function(t){var e=Math.exp(t);return e=(e+1/e)/2}(r),l=2*a*u,c=-2*o*s,f=t.length-1,h=t[f],p=0,d=0,y=0;--f>=0;)n=d,i=p,h=l*(d=h)-n-c*(p=y)+t[f],y=c*d-i+l*p;return[(l=o*u)*h-(c=a*s)*y,l*y+c*h]}var db={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ub.init.apply(this),this.forward=ub.forward,this.inverse=ub.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),r=e;this.cgb[0]=e*(2+e*(-2/3+e*(e*(116/45+e*(26/45+e*(-2854/675)))-2))),this.cbg[0]=e*(e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))-2),r*=e,this.cgb[1]=r*(7/3+e*(e*(-227/45+e*(2704/315+e*(2323/945)))-1.6)),this.cbg[1]=r*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),r*=e,this.cgb[2]=r*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=r*(-26/15+e*(34/21+e*(1.6+e*(-12686/2835)))),r*=e,this.cgb[3]=r*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=r*(1237/630+e*(e*(-24832/14175)-2.4)),r*=e,this.cgb[4]=r*(4174/315+e*(-144838/6237)),this.cbg[4]=r*(-734/315+e*(109598/31185)),r*=e,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+r*(.25+r*(1/64+r/256))),this.utg[0]=e*(e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))-.5),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=r*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=r*(13/48+e*(e*(557/1440+e*(281/630+e*(-1983433/1935360)))-.6)),r*=e,this.utg[2]=r*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=r*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),r*=e,this.utg[3]=r*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=r*(49561/161280+e*(-179/168+e*(6601661/7257600))),r*=e,this.utg[4]=r*(-4583/161280+e*(108847/3991680)),this.gtu[4]=r*(34729/80640+e*(-3418889/1995840)),r*=e,this.utg[5]=-.03233083094085698*r,this.gtu[5]=.6650675310896665*r;var n=hb(this.cbg,this.lat0);this.Zb=-this.Qn*(n+function(t,e){for(var r,n=2*Math.cos(e),i=t.length-1,o=t[i],a=0;--i>=0;)r=n*o-a+t[i],a=o,o=r;return Math.sin(e)*r}(this.gtu,2*n))},forward:function(t){var e=Hg(t.x-this.long0),r=t.y;r=hb(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(e),a=Math.cos(e);r=Math.atan2(n,a*i),e=Math.atan2(o*i,cb(n,i*a)),e=fb(Math.tan(e));var s,u,l=pb(this.gtu,2*r,2*e);return r+=l[0],e+=l[1],Math.abs(e)<=2.623395162778?(s=this.a*(this.Qn*e)+this.x0,u=this.a*(this.Qn*r+this.Zb)+this.y0):(s=1/0,u=1/0),t.x=s,t.y=u,t},inverse:function(t){var e,r,n=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);if(i=(i-this.Zb)/this.Qn,n/=this.Qn,Math.abs(n)<=2.623395162778){var o=pb(this.utg,2*i,2*n);i+=o[0],n+=o[1],n=Math.atan(lb(n));var a=Math.sin(i),s=Math.cos(i),u=Math.sin(n),l=Math.cos(n);i=Math.atan2(a*l,cb(u,l*s)),e=Hg((n=Math.atan2(u,l*s))+this.long0),r=hb(this.cgb,i)}else e=1/0,r=1/0;return t.x=e,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]};var yb={init:function(){var t=function(t,e){if(void 0===t){if((t=Math.floor(30*(Hg(e)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*hg,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,db.init.apply(this),this.forward=db.forward,this.inverse=db.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function vb(t,e){return Math.pow((1-t)/(1+t),e)}var gb=20;var mb={init:function(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+dg)/(Math.pow(Math.tan(.5*this.lat0+dg),this.C)*vb(this.e*t,this.ratexp))},forward:function(t){var e=t.x,r=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+dg),this.C)*vb(this.e*Math.sin(r),this.ratexp))-sg,t.x=this.C*e,t},inverse:function(t){for(var e=t.x/this.C,r=t.y,n=Math.pow(Math.tan(.5*r+dg)/this.K,1/this.C),i=gb;i>0&&(r=2*Math.atan(n*vb(this.e*Math.sin(t.y),-.5*this.e))-sg,!(Math.abs(r-t.y)<1e-14));--i)t.y=r;return i?(t.x=e,t.y=r,t):null},names:["gauss"]};var bb={init:function(){mb.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var e,r,n,i;return t.x=Hg(t.x-this.long0),mb.forward.apply(this,[t]),e=Math.sin(t.y),r=Math.cos(t.y),n=Math.cos(t.x),i=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*r*n),t.x=i*r*Math.sin(t.x),t.y=i*(this.cosc0*e-this.sinc0*r*n),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var e,r,n,i,o;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,o=cb(t.x,t.y)){var a=2*Math.atan2(o,this.R2);e=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+t.y*e*this.cosc0/o),n=Math.atan2(t.x*e,o*this.cosc0*r-t.y*this.sinc0*e)}else i=this.phic0,n=0;return t.x=n,t.y=i,mb.inverse.apply(this,[t]),t.x=Hg(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var xb={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=fg&&(this.k0=.5*(1+Vg(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=fg&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=fg&&Math.abs(Math.cos(this.lat_ts))>fg&&(this.k0=.5*this.cons*Ug(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Wg(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Ug(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-sg,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var e,r,n,i,o,a,s=t.x,u=t.y,l=Math.sin(u),c=Math.cos(u),f=Hg(s-this.long0);return Math.abs(Math.abs(s-this.long0)-Math.PI)<=fg&&Math.abs(u+this.lat0)<=fg?(t.x=NaN,t.y=NaN,t):this.sphere?(e=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(f)),t.x=this.a*e*c*Math.sin(f)+this.x0,t.y=this.a*e*(this.coslat0*l-this.sinlat0*c*Math.cos(f))+this.y0,t):(r=2*Math.atan(this.ssfn_(u,l,this.e))-sg,i=Math.cos(r),n=Math.sin(r),Math.abs(this.coslat0)<=fg?(o=Wg(this.e,u*this.con,this.con*l),a=2*this.a*this.k0*o/this.cons,t.x=this.x0+a*Math.sin(s-this.long0),t.y=this.y0-this.con*a*Math.cos(s-this.long0),t):(Math.abs(this.sinlat0)0?Hg(this.long0+Math.atan2(t.x,-1*t.y)):Hg(this.long0+Math.atan2(t.x,t.y)):Hg(this.long0+Math.atan2(t.x*Math.sin(s),a*this.coslat0*Math.cos(s)-t.y*this.sinlat0*Math.sin(s))),t.x=e,t.y=r,t)}if(Math.abs(this.coslat0)<=fg){if(a<=fg)return r=this.lat0,e=this.long0,t.x=e,t.y=r,t;t.x*=this.con,t.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*qg(this.e,n),e=this.con*Hg(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,a<=fg?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/a),e=Hg(this.long0+Math.atan2(t.x*Math.sin(i),a*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*qg(this.e,Math.tan(.5*(sg+o)));return t.x=e,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],ssfn_:function(t,e,r){return e*=r,Math.tan(.5*(sg+t))*Math.pow((1-e)/(1+e),.5*r)}};var wb={init:function(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),r=this.a,n=1/this.rf,i=2*n-Math.pow(n,2),o=this.e=Math.sqrt(i);this.R=this.k0*r*Math.sqrt(1-i)/(1-i*Math.pow(e,2)),this.alpha=Math.sqrt(1+i/(1-i)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),s=Math.log(Math.tan(Math.PI/4+t/2)),u=Math.log((1+o*e)/(1-o*e));this.K=a-this.alpha*s+this.alpha*o/2*u},forward:function(t){var e=Math.log(Math.tan(Math.PI/4-t.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),n=-this.alpha*(e+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(t.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return t.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,t.x=this.R*a+this.x0,t},inverse:function(t){for(var e=t.x-this.x0,r=t.y-this.y0,n=e/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,u=0,l=o,c=-1e3,f=0;Math.abs(l-c)>1e-7;){if(++f>20)return;u=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(u))-Math.PI/2}return t.x=s,t.y=l,t},names:["somerc"]},_b=1e-7;var Sb={init:function(){var t,e,r,n,i,o,a,s,u,l,c,f,h,p=0,d=0,y=0,v=0,g=0,m=0,b=0;this.no_off=(h="object"==typeof(f=this).PROJECTION?Object.keys(f.PROJECTION)[0]:f.PROJECTION,"no_uoff"in f||"no_off"in f||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(h)),this.no_rot="no_rot"in this;var x=!1;"alpha"in this&&(x=!0);var w=!1;if("rectified_grid_angle"in this&&(w=!0),x&&(b=this.alpha),w&&(p=this.rectified_grid_angle*hg),x||w)d=this.longc;else if(y=this.long1,g=this.lat1,v=this.long2,m=this.lat2,Math.abs(g-m)<=_b||(t=Math.abs(g))<=_b||Math.abs(t-sg)<=_b||Math.abs(Math.abs(this.lat0)-sg)<=_b||Math.abs(Math.abs(m)-sg)<=_b)throw new Error;var _=1-this.es;e=Math.sqrt(_),Math.abs(this.lat0)>fg?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),t=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/_),this.A=this.B*this.k0*e/t,(i=(n=this.B*e/(r*Math.sqrt(t)))*n-1)<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(Wg(this.e,this.lat0,s),this.B)):(this.B=1/e,this.A=this.k0,this.E=n=i=1),x||w?(x?(c=Math.asin(Math.sin(b)/n),w||(p=b)):(c=p,b=Math.asin(n*Math.sin(c))),this.lam0=d-Math.asin(.5*(i-1/i)*Math.tan(c))/this.B):(o=Math.pow(Wg(this.e,g,Math.sin(g)),this.B),a=Math.pow(Wg(this.e,m,Math.sin(m)),this.B),i=this.E/o,u=(a-o)/(a+o),l=((l=this.E*this.E)-a*o)/(l+a*o),(t=y-v)<-Math.pi?v-=yg:t>Math.pi&&(v+=yg),this.lam0=Hg(.5*(y+v)-Math.atan(l*Math.tan(.5*this.B*(y-v))/u)/this.B),c=Math.atan(2*Math.sin(this.B*Hg(y-this.lam0))/(i-1/i)),p=b=Math.asin(n*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(p),this.cosrot=Math.cos(p),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A,this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(dg-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(dg+i))},forward:function(t){var e,r,n,i,o,a,s,u,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-sg)>fg){if(e=.5*((o=this.E/Math.pow(Wg(this.e,t.y,Math.sin(t.y)),this.B))-(a=1/o)),r=.5*(o+a),i=Math.sin(this.B*t.x),n=(e*this.singam-i*this.cosgam)/r,Math.abs(Math.abs(n)-1)0?this.v_pole_n:this.v_pole_s,s=this.ArB*t.y;return this.no_rot?(l.x=s,l.y=u):(s-=this.u_0,l.x=u*this.cosrot+s*this.sinrot,l.y=s*this.cosrot-u*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l},inverse:function(t){var e,r,n,i,o,a,s,u={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(r=t.y,e=t.x):(r=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),i=.5*((n=Math.exp(-this.BrA*r))-1/n),o=.5*(n+1/n),s=((a=Math.sin(this.BrA*e))*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(s)-1)fg?this.ns=Math.log(n/s)/Math.log(i/u):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var e=t.x,r=t.y;Math.abs(2*Math.abs(r)-Math.PI)<=fg&&(r=Vg(r)*(sg-2*fg));var n,i,o=Math.abs(Math.abs(r)-sg);if(o>fg)n=Wg(this.e,r,Math.sin(r)),i=this.a*this.f0*Math.pow(n,this.ns);else{if((o=r*this.ns)<=0)return null;i=0}var a=this.ns*Hg(e-this.long0);return t.x=this.k0*(i*Math.sin(a))+this.x0,t.y=this.k0*(this.rh-i*Math.cos(a))+this.y0,t},inverse:function(t){var e,r,n,i,o,a=(t.x-this.x0)/this.k0,s=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(a*a+s*s),r=1):(e=-Math.sqrt(a*a+s*s),r=-1);var u=0;if(0!==e&&(u=Math.atan2(r*a,r*s)),0!==e||this.ns>0){if(r=1/this.ns,n=Math.pow(e/(this.a*this.f0),r),-9999===(i=qg(this.e,n)))return null}else i=-sg;return o=Hg(u/this.ns+this.long0),t.x=o,t.y=i,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]};var kb={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var e,r,n,i,o,a,s,u=t.x,l=t.y,c=Hg(u-this.long0);return e=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/e)-this.s45),n=-c*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),t.y=s*Math.cos(a)/1,t.x=s*Math.sin(a)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var e,r,n,i,o,a,s,u=t.x;t.x=t.y,t.y=u,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),i=Math.atan2(t.y,t.x)/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(e)),t.x=this.long0-r/this.alfa,a=e,s=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-t.y)<1e-10&&(s=1),a=t.y,l+=1}while(0===s&&l<15);return l>=15?null:t},names:["Krovak","krovak"]};function Tb(t,e,r,n,i){return t*i-e*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function Cb(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Ob(t){return.375*t*(1+.25*t*(1+.46875*t))}function Ab(t){return.05859375*t*t*(1+.75*t)}function Pb(t){return t*t*t*(35/3072)}function Mb(t,e,r){var n=e*r;return t/Math.sqrt(1-n*n)}function Ib(t){return Math.abs(t)1e-7?(1-t*t)*(e/(1-(r=t*e)*r)-.5/t*Math.log((1-r)/(1+r))):2*e}var Rb=.3333333333333333,Db=.17222222222222222,Bb=.10257936507936508,Fb=.06388888888888888,zb=.0664021164021164,Gb=.016415012942191543;var Ub={init:function(){var t,e=Math.abs(this.lat0);if(Math.abs(e-sg)0)switch(this.qp=Nb(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var e,r=[];return r[0]=t*Rb,e=t*t,r[0]+=e*Db,r[1]=e*Fb,e*=t,r[0]+=e*Bb,r[1]+=e*zb,r[2]=e*Gb,r}(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Nb(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var e,r,n,i,o,a,s,u,l,c,f=t.x,h=t.y;if(f=Hg(f-this.long0),this.sphere){if(o=Math.sin(h),c=Math.cos(h),n=Math.cos(f),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((r=this.mode===this.EQUIT?1+c*n:1+this.sinph0*o+this.cosph0*c*n)<=fg)return null;e=(r=Math.sqrt(2/r))*c*Math.sin(f),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*c*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(h+this.lat0)=0?(e=(l=Math.sqrt(a))*i,r=n*(this.mode===this.S_POLE?l:-l)):e=r=0}}return t.x=this.a*e+this.x0,t.y=this.a*r+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var e,r,n,i,o,a,s,u,l,c,f=t.x/this.a,h=t.y/this.a;if(this.sphere){var p,d=0,y=0;if((r=.5*(p=Math.sqrt(f*f+h*h)))>1)return null;switch(r=2*Math.asin(r),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(r),d=Math.cos(r)),this.mode){case this.EQUIT:r=Math.abs(p)<=fg?0:Math.asin(h*y/p),f*=y,h=d*p;break;case this.OBLIQ:r=Math.abs(p)<=fg?this.lat0:Math.asin(d*this.sinph0+h*y*this.cosph0/p),f*=y*this.cosph0,h=(d-Math.sin(r)*this.sinph0)*p;break;case this.N_POLE:h=-h,r=sg-r;break;case this.S_POLE:r-=sg}e=0!==h||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,h):0}else{if(s=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,h*=this.dd,(a=Math.sqrt(f*f+h*h))1&&(t=t>1?1:-1),Math.asin(t)}var Hb={init:function(){Math.abs(this.lat1+this.lat2)fg?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var e=t.x,r=t.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=Nb(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*Hg(e-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),n=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),n=-1),i=0,0!==e&&(i=Math.atan2(n*t.x,n*t.y)),n=e*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),o=Hg(i/this.ns0+this.long0),t.x=o,t.y=a,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,e){var r,n,i,o,a,s=Vb(.5*e);if(t0||Math.abs(o)<=fg?(a=this.x0+1*this.a*r*Math.sin(n)/o,s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)/o):(a=this.x0+this.infinity_dist*r*Math.sin(n),s=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(e=Math.sqrt(t.x*t.x+t.y*t.y))?(i=Math.atan2(e,this.rc),r=Math.sin(i),a=Vb((n=Math.cos(i))*this.sin_p14+t.y*r*this.cos_p14/e),o=Math.atan2(t.x*r,e*this.cos_p14*n-t.y*this.sin_p14*r),o=Hg(this.long0+o)):(a=this.phic0,o=0),t.x=o,t.y=a,t},names:["gnom"]};var qb={init:function(){this.sphere||(this.k0=Ug(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var e,r,n=t.x,i=t.y,o=Hg(n-this.long0);if(this.sphere)e=this.x0+this.a*o*Math.cos(this.lat_ts),r=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var a=Nb(this.e,Math.sin(i));e=this.x0+this.a*this.k0*o,r=this.y0+this.a*a*.5/this.k0}return t.x=e,t.y=r,t},inverse:function(t){var e,r;return t.x-=this.x0,t.y-=this.y0,this.sphere?(e=Hg(this.long0+t.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(r=function(t,e){var r=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-r)<1e-6)return e<0?-1*sg:sg;for(var n,i,o,a,s=Math.asin(.5*e),u=0;u<30;u++)if(i=Math.sin(s),o=Math.cos(s),a=t*i,s+=n=Math.pow(1-a*a,2)/(2*o)*(e/(1-t*t)-i/(1-a*a)+.5/t*Math.log((1-a)/(1+a))),Math.abs(n)<=1e-10)return s;return NaN}(this.e,2*t.y*this.k0/this.a),e=Hg(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=r,t},names:["cea"]};var Yb={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var e=t.x,r=t.y,n=Hg(e-this.long0),i=Ib(r-this.lat0);return t.x=this.x0+this.a*n*this.rc,t.y=this.y0+this.a*i,t},inverse:function(t){var e=t.x,r=t.y;return t.x=Hg(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=Ib(this.lat0+(r-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Xb=20;var Zb={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Cb(this.es),this.e1=Ob(this.es),this.e2=Ab(this.es),this.e3=Pb(this.es),this.ml0=this.a*Tb(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var e,r,n,i=t.x,o=t.y,a=Hg(i-this.long0);if(n=a*Math.sin(o),this.sphere)Math.abs(o)<=fg?(e=this.a*a,r=-1*this.a*this.lat0):(e=this.a*Math.sin(n)/Math.tan(o),r=this.a*(Ib(o-this.lat0)+(1-Math.cos(n))/Math.tan(o)));else if(Math.abs(o)<=fg)e=this.a*a,r=-1*this.ml0;else{var s=Mb(this.a,this.e,Math.sin(o))/Math.tan(o);e=s*Math.sin(n),r=this.a*Tb(this.e0,this.e1,this.e2,this.e3,o)-this.ml0+s*(1-Math.cos(n))}return t.x=e+this.x0,t.y=r+this.y0,t},inverse:function(t){var e,r,n,i,o,a,s,u,l;if(n=t.x-this.x0,i=t.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=fg)e=Hg(n/this.a+this.long0),r=0;else{var c;for(a=this.lat0+i/this.a,s=n*n/this.a/this.a+a*a,u=a,o=Xb;o;--o)if(u+=l=-1*(a*(u*(c=Math.tan(u))+1)-u-.5*(u*u+s)*c)/((u-a)/c-1),Math.abs(l)<=fg){r=u;break}e=Hg(this.long0+Math.asin(n*Math.tan(u)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=fg)r=0,e=Hg(this.long0+n/this.a);else{var f,h,p,d,y;for(a=(this.ml0+i)/this.a,s=n*n/this.a/this.a+a*a,u=a,o=Xb;o;--o)if(y=this.e*Math.sin(u),f=Math.sqrt(1-y*y)*Math.tan(u),h=this.a*Tb(this.e0,this.e1,this.e2,this.e3,u),p=this.e0-2*this.e1*Math.cos(2*u)+4*this.e2*Math.cos(4*u)-6*this.e3*Math.cos(6*u),u-=l=(a*(f*(d=h/this.a)+1)-d-.5*f*(d*d+s))/(this.es*Math.sin(2*u)*(d*d+s-2*a*d)/(4*f)+(a-d)*(f*p-2/Math.sin(2*u))-p),Math.abs(l)<=fg){r=u;break}f=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),e=Hg(this.long0+Math.asin(n*f/this.a)/Math.sin(r))}return t.x=e,t.y=r,t},names:["Polyconic","poly"]};var Kb={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var e,r=t.x,n=t.y-this.lat0,i=r-this.long0,o=n/ag*1e-5,a=i,s=1,u=0;for(e=1;e<=10;e++)s*=o,u+=this.A[e]*s;var l,c=u,f=a,h=1,p=0,d=0,y=0;for(e=1;e<=6;e++)l=p*c+h*f,h=h*c-p*f,p=l,d=d+this.B_re[e]*h-this.B_im[e]*p,y=y+this.B_im[e]*h+this.B_re[e]*p;return t.x=y*this.a+this.x0,t.y=d*this.a+this.y0,t},inverse:function(t){var e,r,n=t.x,i=t.y,o=n-this.x0,a=(i-this.y0)/this.a,s=o/this.a,u=1,l=0,c=0,f=0;for(e=1;e<=6;e++)r=l*a+u*s,u=u*a-l*s,l=r,c=c+this.C_re[e]*u-this.C_im[e]*l,f=f+this.C_im[e]*u+this.C_re[e]*l;for(var h=0;h.999999999999&&(r=.999999999999),e=Math.asin(r);var n=Hg(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*e+Math.sin(2*e))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return t.x=n,t.y=i,t},names:["Mollweide","moll"]};var ex={init:function(){Math.abs(this.lat1+this.lat2)=0?(r=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(r=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var o=0;return 0!==r&&(o=Math.atan2(e*t.x,e*t.y)),this.sphere?(i=Hg(this.long0+o/this.ns),n=Ib(this.g-r/this.a),t.x=i,t.y=n,t):(n=Lb(this.g-r/this.a,this.e0,this.e1,this.e2,this.e3),i=Hg(this.long0+o/this.ns),t.x=i,t.y=n,t)},names:["Equidistant_Conic","eqdc"]};var rx={init:function(){this.R=this.a},forward:function(t){var e,r,n=t.x,i=t.y,o=Hg(n-this.long0);Math.abs(i)<=fg&&(e=this.x0+this.R*o,r=this.y0);var a=Vb(2*Math.abs(i/Math.PI));(Math.abs(o)<=fg||Math.abs(Math.abs(i)-sg)<=fg)&&(e=this.x0,r=i>=0?this.y0+Math.PI*this.R*Math.tan(.5*a):this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/o-o/Math.PI),u=s*s,l=Math.sin(a),c=Math.cos(a),f=c/(l+c-1),h=f*f,p=f*(2/l-1),d=p*p,y=Math.PI*this.R*(s*(f-d)+Math.sqrt(u*(f-d)*(f-d)-(d+u)*(h-d)))/(d+u);o<0&&(y=-y),e=this.x0+y;var v=u+f;return y=Math.PI*this.R*(p*v-s*Math.sqrt((d+u)*(u+1)-v*v))/(d+u),r=i>=0?this.y0+y:this.y0-y,t.x=e,t.y=r,t},inverse:function(t){var e,r,n,i,o,a,s,u,l,c,f,h;return t.x-=this.x0,t.y-=this.y0,f=Math.PI*this.R,o=(n=t.x/f)*n+(i=t.y/f)*i,f=3*(i*i/(u=-2*(a=-Math.abs(i)*(1+o))+1+2*i*i+o*o)+(2*(s=a-2*i*i+n*n)*s*s/u/u/u-9*a*s/u/u)/27)/(l=(a-s*s/3/u)/u)/(c=2*Math.sqrt(-l/3)),Math.abs(f)>1&&(f=f>=0?1:-1),h=Math.acos(f)/3,r=t.y>=0?(-c*Math.cos(h+Math.PI/3)-s/3/u)*Math.PI:-(-c*Math.cos(h+Math.PI/3)-s/3/u)*Math.PI,e=Math.abs(n)2*sg*this.a)return;return r=e/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(e)<=fg?a=this.lat0:(a=Vb(i*this.sin_p12+t.y*n*this.cos_p12/e),s=Math.abs(this.lat0)-sg,o=Math.abs(s)<=fg?this.lat0>=0?Hg(this.long0+Math.atan2(t.x,-t.y)):Hg(this.long0-Math.atan2(-t.x,t.y)):Hg(this.long0+Math.atan2(t.x*n,e*this.cos_p12*i-t.y*this.sin_p12*n))),t.x=o,t.y=a,t}return u=Cb(this.es),l=Ob(this.es),c=Ab(this.es),f=Pb(this.es),Math.abs(this.sin_p12-1)<=fg?(a=Lb(((h=this.a*Tb(u,l,c,f,sg))-(e=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,u,l,c,f),o=Hg(this.long0+Math.atan2(t.x,-1*t.y)),t.x=o,t.y=a,t):Math.abs(this.sin_p12+1)<=fg?(h=this.a*Tb(u,l,c,f,sg),a=Lb(((e=Math.sqrt(t.x*t.x+t.y*t.y))-h)/this.a,u,l,c,f),o=Hg(this.long0+Math.atan2(t.x,t.y)),t.x=o,t.y=a,t):(e=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),p=Mb(this.a,this.e,this.sin_p12),v=Math.cos(y),m=-(g=this.e*this.cos_p12*v)*g/(1-this.es),b=3*this.es*(1-m)*this.sin_p12*this.cos_p12*v/(1-this.es),_=1-m*(w=(x=e/p)-m*(1+m)*Math.pow(x,3)/6-b*(1+3*m)*Math.pow(x,4)/24)*w/2-x*w*w*w/6,d=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*v),o=Hg(this.long0+Math.asin(Math.sin(y)*Math.sin(w)/Math.cos(d))),S=Math.sin(d),a=Math.atan2((S-this.es*_*this.sin_p12)*Math.tan(d),S*(1-this.es)),t.x=o,t.y=a,t)},names:["Azimuthal_Equidistant","aeqd"]};var ix={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var e,r,n,i,o,a,s,u=t.x,l=t.y;return n=Hg(u-this.long0),e=Math.sin(l),r=Math.cos(l),i=Math.cos(n),((o=this.sin_p14*e+this.cos_p14*r*i)>0||Math.abs(o)<=fg)&&(a=1*this.a*r*Math.sin(n),s=this.y0+1*this.a*(this.cos_p14*e-this.sin_p14*r*i)),t.x=a,t.y=s,t},inverse:function(t){var e,r,n,i,o,a,s;return t.x-=this.x0,t.y-=this.y0,r=Vb((e=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),n=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(e)<=fg?(s=this.lat0,t.x=a,t.y=s,t):(s=Vb(i*this.sin_p14+t.y*n*this.cos_p14/e),o=Math.abs(this.lat0)-sg,Math.abs(o)<=fg?(a=this.lat0>=0?Hg(this.long0+Math.atan2(t.x,-t.y)):Hg(this.long0-Math.atan2(-t.x,t.y)),t.x=a,t.y=s,t):(a=Hg(this.long0+Math.atan2(t.x*n,e*this.cos_p14*i-t.y*this.sin_p14*n)),t.x=a,t.y=s,t))},names:["ortho"]},ox={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ax={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function sx(t,e,r,n){var i;return tdg&&i<=sg+dg?(n.value=ax.AREA_1,i-=sg):i>sg+dg||i<=-(sg+dg)?(n.value=ax.AREA_2,i=i>=0?i-vg:i+vg):(n.value=ax.AREA_3,i+=sg)),i}function ux(t,e){var r=t+e;return r<-vg?r+=yg:r>+vg&&(r-=yg),r}var lx={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=sg-dg/2?this.face=ox.TOP:this.lat0<=-(sg-dg/2)?this.face=ox.BOTTOM:Math.abs(this.long0)<=dg?this.face=ox.FRONT:Math.abs(this.long0)<=sg+dg?this.face=this.long0>0?ox.RIGHT:ox.LEFT:this.face=ox.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var e,r,n,i,o,a,s={x:0,y:0},u={value:0};if(t.x-=this.long0,e=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,r=t.x,this.face===ox.TOP)i=sg-e,r>=dg&&r<=sg+dg?(u.value=ax.AREA_0,n=r-sg):r>sg+dg||r<=-(sg+dg)?(u.value=ax.AREA_1,n=r>0?r-vg:r+vg):r>-(sg+dg)&&r<=-dg?(u.value=ax.AREA_2,n=r+sg):(u.value=ax.AREA_3,n=r);else if(this.face===ox.BOTTOM)i=sg+e,r>=dg&&r<=sg+dg?(u.value=ax.AREA_0,n=-r+sg):r=-dg?(u.value=ax.AREA_1,n=-r):r<-dg&&r>=-(sg+dg)?(u.value=ax.AREA_2,n=-r-sg):(u.value=ax.AREA_3,n=r>0?-r+vg:-r-vg);else{var l,c,f,h,p,d;this.face===ox.RIGHT?r=ux(r,+sg):this.face===ox.BACK?r=ux(r,+vg):this.face===ox.LEFT&&(r=ux(r,-sg)),h=Math.sin(e),p=Math.cos(e),d=Math.sin(r),l=p*Math.cos(r),c=p*d,f=h,this.face===ox.FRONT?n=sx(i=Math.acos(l),f,c,u):this.face===ox.RIGHT?n=sx(i=Math.acos(c),f,-l,u):this.face===ox.BACK?n=sx(i=Math.acos(-l),f,-c,u):this.face===ox.LEFT?n=sx(i=Math.acos(-c),f,l,u):(i=n=0,u.value=ax.AREA_0)}return a=Math.atan(12/vg*(n+Math.acos(Math.sin(n)*Math.cos(dg))-sg)),o=Math.sqrt((1-Math.cos(i))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(n))))),u.value===ax.AREA_1?a+=sg:u.value===ax.AREA_2?a+=vg:u.value===ax.AREA_3&&(a+=1.5*vg),s.x=o*Math.cos(a),s.y=o*Math.sin(a),s.x=s.x*this.a+this.x0,s.y=s.y*this.a+this.y0,t.x=s.x,t.y=s.y,t},inverse:function(t){var e,r,n,i,o,a,s,u,l,c,f,h,p={lam:0,phi:0},d={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,r=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),e=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?d.value=ax.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=ax.AREA_1,e-=sg):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=ax.AREA_2,e=e<0?e+vg:e-vg):(d.value=ax.AREA_3,e+=sg),l=vg/12*Math.tan(e),o=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),a=Math.atan(o),(s=1-(n=Math.cos(e))*n*(i=Math.tan(r))*i*(1-Math.cos(Math.atan(1/Math.cos(a)))))<-1?s=-1:s>1&&(s=1),this.face===ox.TOP)u=Math.acos(s),p.phi=sg-u,d.value===ax.AREA_0?p.lam=a+sg:d.value===ax.AREA_1?p.lam=a<0?a+vg:a-vg:d.value===ax.AREA_2?p.lam=a-sg:p.lam=a;else if(this.face===ox.BOTTOM)u=Math.acos(s),p.phi=u-sg,d.value===ax.AREA_0?p.lam=-a+sg:d.value===ax.AREA_1?p.lam=-a:d.value===ax.AREA_2?p.lam=-a-sg:p.lam=a<0?-a-vg:-a+vg;else{var y,v,g;l=(y=s)*y,v=(l+=(g=l>=1?0:Math.sqrt(1-l)*Math.sin(a))*g)>=1?0:Math.sqrt(1-l),d.value===ax.AREA_1?(l=v,v=-g,g=l):d.value===ax.AREA_2?(v=-v,g=-g):d.value===ax.AREA_3&&(l=v,v=g,g=-l),this.face===ox.RIGHT?(l=y,y=-v,v=l):this.face===ox.BACK?(y=-y,v=-v):this.face===ox.LEFT&&(l=y,y=v,v=-l),p.phi=Math.acos(-g)-sg,p.lam=Math.atan2(v,y),this.face===ox.RIGHT?p.lam=ux(p.lam,-sg):this.face===ox.BACK?p.lam=ux(p.lam,-vg):this.face===ox.LEFT&&(p.lam=ux(p.lam,+sg))}return 0!==this.es&&(c=p.phi<0?1:0,f=Math.tan(p.phi),h=this.b/Math.sqrt(f*f+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-h*h)/(this.one_minus_f*h)),c&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},cx=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],fx=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],hx=.8487,px=1.3523,dx=pg/5,yx=1/dx,vx=18,gx=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},mx=function(t,e){return t[1]+e*(2*t[2]+3*e*t[3])};var bx={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var e=Hg(t.x-this.long0),r=Math.abs(t.y),n=Math.floor(r*dx);n<0?n=0:n>=vx&&(n=vx-1),r=pg*(r-yx*n);var i={x:gx(cx[n],r)*e,y:gx(fx[n],r)};return t.y<0&&(i.y=-i.y),i.x=i.x*this.a*hx+this.x0,i.y=i.y*this.a*px+this.y0,i},inverse:function(t){var e={x:(t.x-this.x0)/(this.a*hx),y:Math.abs(t.y-this.y0)/(this.a*px)};if(e.y>=1)e.x/=cx[vx][0],e.y=t.y<0?-sg:sg;else{var r=Math.floor(e.y*vx);for(r<0?r=0:r>=vx&&(r=vx-1);;)if(fx[r][0]>e.y)--r;else{if(!(fx[r+1][0]<=e.y))break;++r}var n=fx[r],i=5*(e.y-n[0])/(fx[r+1][0]-n[0]);i=function(t,e,r,n){for(var i=e;n;--n){var o=t(i);if(i-=o,Math.abs(o)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var e,r,n,i,o=t.x,a=t.y;if(o-=this.long0,"ellipse"===this.shape){a=Math.atan(this.radius_p2*Math.tan(a));var s=this.radius_p/cb(this.radius_p*Math.cos(a),Math.sin(a));if(r=s*Math.cos(o)*Math.cos(a),n=s*Math.sin(o)*Math.cos(a),i=s*Math.sin(a),(this.radius_g-r)*r-n*n-i*i*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/cb(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/cb(n,e)))}else"sphere"===this.shape&&(e=Math.cos(a),r=Math.cos(o)*e,n=Math.sin(o)*e,i=Math.sin(a),e=this.radius_g-r,this.flip_axis?(t.x=this.radius_g_1*Math.atan(n/cb(i,e)),t.y=this.radius_g_1*Math.atan(i/e)):(t.x=this.radius_g_1*Math.atan(n/e),t.y=this.radius_g_1*Math.atan(i/cb(n,e))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var e,r,n,i,o=-1,a=0,s=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*cb(1,s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*cb(1,a));var u=s/this.radius_p;if(e=a*a+u*u+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),a=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(a=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+a*a)),e=a*a+s*s+o*o,(n=(r=2*this.radius_g*o)*r-4*e*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=(-r-Math.sqrt(n))/(2*e),o=this.radius_g+i*o,a*=i,s*=i,t.x=Math.atan2(a,o),t.y=Math.atan(s*Math.cos(t.x)/o)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},kx=1.340264,Tx=-.081106,Cx=893e-6,Ox=.003796,Ax=Math.sqrt(3)/2;var Px={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){var e=Hg(t.x-this.long0),r=t.y,n=Math.asin(Ax*Math.sin(r)),i=n*n,o=i*i*i;return t.x=e*Math.cos(n)/(Ax*(kx+3*Tx*i+o*(7*Cx+9*Ox*i))),t.y=n*(kx+Tx*i+o*(Cx+Ox*i)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e,r,n,i,o=t.y;for(i=0;i<12&&(o-=n=(o*(kx+Tx*(e=o*o)+(r=e*e*e)*(Cx+Ox*e))-t.y)/(kx+3*Tx*e+r*(7*Cx+9*Ox*e)),!(Math.abs(n)<1e-9));++i);return r=(e=o*o)*e*e,t.x=Ax*t.x*(kx+3*Tx*e+r*(7*Cx+9*Ox*e))/Math.cos(o),t.y=Math.asin(Math.sin(o)/Ax),t.x=Hg(t.x+this.long0),t},names:["eqearth","Equal Earth","Equal_Earth"]};Tm.defaultDatum="WGS84",Tm.Proj=fm,Tm.WGS84=new Tm.Proj("WGS84"),Tm.Point=Wm,Tm.toPoint=xm,Tm.defs=Dg,Tm.nadgrid=function(t,e){var r=new DataView(e),n=function(t){var e=t.getInt32(8,!1);return 11!==e&&(11!==(e=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(r),i=function(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:am(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}(r,n),o={header:i,subgrids:function(t,e,r){for(var n=176,i=[],o=0;ot.length)&&(e=t.length);for(var r=0,n=Array(e);r=e[0]&&t[0]<=e[2]&&t[1]>=e[1]&&t[1]<=e[3]}},{key:"moveLayer",value:function(t){this.map.moveLayer(this.layerId,t)}},{key:"setVisibility",value:function(t){var e=t?"visible":"none";this.map.setLayoutProperty(this.layerId,"visibility",e)}}])&&Nx(r.prototype,n),i&&Nx(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Gx(t){"@babel/helpers - typeof";return(Gx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ux(t,e){for(var r=0;r0?(r.totalTimes--,r.ajaxPolling(t)):r._commit(t)}},{key:"ajaxPolling",value:function(t){var e=this,r=t.url,n=/^http:\/\/([a-z]{9}|(\d+\.){3}\d+):\d{0,4}/;return e.index=parseInt(Math.random()*e.length),e.url=e.urls[e.index],r=r.replace(n,n.exec(e.url)[0]),t.url=r,t.isInTheSameDomain=$.isInTheSameDomain(r),e._commit(t)}},{key:"calculatePollingTimes",value:function(){var t=this;t.times?t.totalTimes>t.POLLING_TIMES?t.times>t.POLLING_TIMES?t.totalTimes=t.POLLING_TIMES:t.totalTimes=t.times:t.timest.POLLING_TIMES&&(t.totalTimes=t.POLLING_TIMES),t.totalTimes--}},{key:"isServiceSupportPolling",value:function(){return!("SuperMap.REST.ThemeService"===this.CLASS_NAME||"SuperMap.REST.EditFeaturesService"===this.CLASS_NAME)}},{key:"transformResult",value:function(t,e){return{result:t=$.transformResult(t),options:e}}},{key:"transformErrorResult",value:function(t,e){return{error:(t=$.transformResult(t)).error||t,options:e}}},{key:"serviceProcessCompleted",value:function(t,e){t=this.transformResult(t).result,this.events.triggerEvent("processCompleted",{result:t,options:e})}},{key:"serviceProcessFailed",value:function(t,e){var r=(t=this.transformErrorResult(t).error).error||t;this.events.triggerEvent("processFailed",{error:r,options:e})}},{key:"_returnContent",value:function(t){return t.scope.format!==kn.FGB&&!!t.scope.returnContent}},{key:"supportDataFormat",value:function(t){return this.dataFormat().includes(t)}},{key:"dataFormat",value:function(){return[kn.GEOJSON,kn.ISERVER]}},{key:"_commit",value:function(t){var e=this;if("POST"===t.method||"PUT"===t.method||"PATCH"===t.method)if(t.params&&(t.url=$.urlAppend(t.url,$.getParameterString(t.params||{}))),"object"!==ew(t.data)||t.data instanceof FormData)t.params=t.data;else try{t.params=$.toJSON(t.data)}catch(t){console.log("不是json对象")}return ut.commit(t.method,t.url,t.params,{headers:t.headers,withoutFormatSuffix:t.withoutFormatSuffix,withCredentials:t.withCredentials,crossOrigin:t.crossOrigin,timeout:t.async?0:null,proxy:t.proxy}).then(function(t){return t.text?t.text():t.json?t.json():t}).then(function(e){var r=e;return"string"==typeof e&&(r=(new Gr).read(e)),(!r||r.error||r.code>=300&&304!==r.code)&&(r=r&&r.error?{error:r.error}:{error:r}),r&&t.scope.format===kn.FGB&&(r.newResourceLocation=r.newResourceLocation.replace(".json","")+".fgb"),r}).catch(function(t){return{error:t}}).then(function(r){var n={object:e};if(r.error){var i="processFailed";if(e.events&&e.events.listeners[i]&&e.events.listeners[i].length){var o=t.failure&&(t.scope?B.bind(t.failure,t.scope):t.failure);o?o(r,t):e.serviceProcessFailed(r,t)}else(n=$x($x({},n),e.transformErrorResult(r,t))).type=i,t.failure&&t.failure(n)}else{var a="processCompleted";if(e.events&&e.events.listeners[a]&&e.events.listeners[a].length){var s=t.success&&(t.scope?B.bind(t.success,t.scope):t.success);s?s(r,t):e.serviceProcessCompleted(r,t)}else r.succeed=void 0==r.succeed||r.succeed,(n=$x($x({},n),e.transformResult(r,t))).type=a,t.success&&t.success(n)}return n})}}])&&rw(t.prototype,e),r&&rw(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ow(t){"@babel/helpers - typeof";return(ow="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aw(){aw=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==ow(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function sw(t){return function(t){if(Array.isArray(t))return uw(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return uw(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uw(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uw(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function bw(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function xw(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:"id";return Cw()(t,e)}function Rw(t){return t.hasOwnProperty("start")&&t.hasOwnProperty("end")}function Dw(t,e,r){var n=t.id,i=t.properties,o=t.lables,a=e?function(t,e){if(!e)return{};for(var r=t.id,n=t.labels,i=e.filter(function(t){return"entity"===t.type}),o=0;o0&&t(o[0])}},u=0;u0;)f.push(s.pop());o.push(f)}}return o},i_=function(t){for(var e=t.nodes,r=void 0===e?[]:e,n=t.edges,i=void 0===n?[]:n,o=[],a={},s={},u={},l=[],c=0,f=function t(e){s[e.id]=c,u[e.id]=c,c+=1,o.push(e),a[e.id]=!0;for(var n=$w(e.id,i,"target").filter(function(t){return r.map(function(t){return t.id}).indexOf(t)>-1}),f=function(i){var o=n[i];if(s[o]||0===s[o])a[o]&&(u[e.id]=Math.min(u[e.id],s[o]));else{var l=r.filter(function(t){return t.id===o});l.length>0&&t(l[0]),u[e.id]=Math.min(u[e.id],u[o])}},h=0;h0;){var d=o.pop();if(a[d.id]=!1,p.push(d),d===e)break}p.length>0&&l.push(p)}},h=0,p=r;h0;)for(var d=f.pop(),y=d.id,v=$w(y,t.edges),g=function(n){var i,a=v[n],s=t.nodes.find(function(t){return t.id===a});if(a===y)o.push(((i={})[a]=d,i));else if(a in p){if(!p[y].has(s)){for(var u=!0,l=[s,d],c=h[y];p[a].size&&!p[a].has(c)&&(l.push(c),c!==h[c.id]);)c=h[c.id];if(l.push(c),e&&r?(u=!1,l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!0)):e&&!r&&l.findIndex(function(t){return e.indexOf(t.id)>-1})>-1&&(u=!1),u){for(var g={},m=1;m-1)return f;n.push(u),i.add(u);for(var h=c[u.id],p=0;p0;){var r=e.pop();i.has(r)&&(i.delete(r),o[r.id].forEach(function(t){e.push(t)}),o[r.id].clear())}}(u);else for(p=0;p-1});v-1?d[y.id].push(u[m]):a.push(((i={})[y.id]=y,i))}}return{component:p,adjList:d,minIdx:s}},g=0;g=g}),b=i_({nodes:m,edges:t.edges}).filter(function(t){return t.length>1});if(0===b.length)break;var x=v(b),w=x.minIdx,_=x.adjList,S=x.component;if(!(S.length>1))break;S.forEach(function(t){o[t.id]=new Set});var E=s[w];if(e&&r&&-1===e.indexOf(E.id))return a;l(E,E,_),g=w+1}return a},p_=function(t,e,r,n){return void 0===n&&(n=!0),e?h_(t,r,n):f_(t,r,n)},d_=function(t){var e=null,r=t.nodes,n={},i={},o={},a={};(void 0===r?[]:r).forEach(function(t){i[t.id]=t});for(var s={enter:function(t){var r=t.current,a=t.previous;if(o[r]){e={};for(var s=r,u=a;u!==r;)e[s]=u,s=u,u=n[u];e[s]=u}else o[r]=r,delete i[r],n[r]=a},leave:function(t){var e=t.current;a[e]=e,delete o[e]},allowTraversal:function(t){var r=t.next;return!e&&!a[r]}};Object.keys(i).length;)c_(t,Object.keys(i)[0],s);return e},y_=function(t,e,r,n){var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u=[],l={},c={},f={};o.forEach(function(t,r){var n=t.id;u.push(n),c[n]=1/0,n===e&&(c[n]=0)});for(var h=o.length,p=function(t){var e=function(t,e,r){for(var n,i=1/0,o=0;oc[e.id]+s?(c[a]=c[e.id]+s,f[a]=[e.id]):c[a]===c[e.id]+s&&f[a].push(e.id)})},d=0;d0&&l.length>0;){var h=l[l.length-1];if(h.length){var p=h.shift();if(p&&(s.push(p),u[p]=!0,f=n?$w(p,a,"target"):$w(p,a),l.push(f.filter(function(t){return!u[t]}))),s[s.length-1]===r){var d=s.map(function(t){return t});c.push(d);y=s.pop();u[y]=!1,l.pop()}}else{var y=s.pop();u[y]=!1,l.pop()}}return c},x_=function(t,e){for(var r=Xw(t,e),n=[],i=r.length,o=0;on[o][s]+n[s][a]&&(n[o][a]=n[o][s]+n[s][a]);return n},w_=function(t,e,r,n){void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e3);var i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a,u={},l={};o.forEach(function(t,e){var r=e_();t.clusterId=r,u[r]={id:r,nodes:[t]},l[t.id]={node:t,idx:e}});var c=[],f={};Xw(t,e).forEach(function(t,e){var r=0,n=o[e].id;f[n]={},t.forEach(function(t,e){if(t){r+=t;var i=o[e].id;f[n][i]=t}}),c.push(r)});for(var h=0,p=function(){var t=!1;if(o.forEach(function(e){var r={};Object.keys(f[e.id]).forEach(function(t){var n=f[e.id][t],i=l[t].node.clusterId;r[i]||(r[i]=0),r[i]+=n});var n=-1/0,i=[];if(Object.keys(r).forEach(function(t){n=0&&i.splice(o,1),i&&i.length){t=!0;var a=u[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var c=Math.floor(Math.random()*i.length),h=u[i[c]];h.nodes.push(e),e.clusterId=h.id}}}),!t)return"break";h++};h0&&S>E&&S-EE&&(T=c.map(function(t){return{node:t,clusterId:t.clusterId}}),C=(0,Uw.clone)(g),E=S),O||k>100)break;k++,Object.keys(g).forEach(function(t){var e=0;h.forEach(function(n){var i=n.source,o=n.target,a=m[i].node.clusterId,s=m[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=n[r]||1)}),g[t].sumTot=e}),c.forEach(function(t,e){var n,o=g[t.clusterId],a=0,s=x[e]/(2*_),l=0,c=o.nodes;c.forEach(function(t){var r=m[t.id].idx;l+=b[e][r]||0});var f=l-o.sumTot*s,d=c.filter(function(e){return e.id!==t.id}),y=[];d.forEach(function(t,e){y[e]=p[t.originIndex]});var v=O_(d,p)*u,S=w[t.id];if(Object.keys(S).forEach(function(r){var o=m[r].node.clusterId;if(o!==t.clusterId){var l=g[o],c=l.nodes;if(c&&c.length){var h=0;c.forEach(function(t){var r=m[t.id].idx;h+=b[e][r]||0});var d=h-l.sumTot*s,y=c.concat([t]),x=[];y.forEach(function(t,e){x[e]=p[t.originIndex]});var w=O_(y,p)*u,_=d-f;i&&(_=d+w-(f+v)),_>a&&(a=_,n=l)}}}),a>0){n.nodes.push(t);var E=t.clusterId;t.clusterId=n.id;var k=o.nodes.indexOf(t);o.nodes.splice(k,1);var T=0,C=0;h.forEach(function(t){var e=t.source,i=t.target,o=m[e].node.clusterId,a=m[i].node.clusterId;(o===n.id&&a!==n.id||a===n.id&&o!==n.id)&&(T+=t[r]||1),(o===E&&a!==E||a===E&&o!==E)&&(C+=t[r]||1)}),n.sumTot=T,o.sumTot=C}})}var A={},P=0;Object.keys(C).forEach(function(t){var e=C[t];if(e.nodes&&e.nodes.length){var r=String(P+1);r!==t&&(e.id=r,e.nodes=e.nodes.map(function(t){return{id:t.id,clusterId:r}}),C[r]=e,A[t]=r,delete C[t],P++)}else delete C[t]}),T.forEach(function(t){var e=t.node,r=t.clusterId;e&&(e.clusterId=r,e.clusterId&&A[e.clusterId]&&(e.clusterId=A[e.clusterId]))});var M=[],I={};h.forEach(function(t){var e=t.source,n=t.target,i=t[r]||1,o=m[e].node.clusterId,a=m[n].node.clusterId;if(o&&a){var s="".concat(o,"---").concat(a);if(I[s])I[s].weight+=i,I[s].count++;else{var u={source:o,target:a,weight:i,count:1};I[s]=u,M.push(u)}}});var L=[];return Object.keys(C).forEach(function(t){L.push(C[t])}),{clusters:L,clusterEdges:M}},P_=function(t,e,r,n,i,o,a,s){return void 0===e&&(e=!1),void 0===r&&(r="weight"),void 0===n&&(n=1e-4),void 0===i&&(i=void 0),void 0===o&&(o=[]),void 0===a&&(a=["id"]),void 0===s&&(s=1),A_(t,e,r,n,!0,i,o,a,s)},M_=function(t,e){var r;void 0===e&&(e=1);for(var n=(0,Uw.clone)(t),i=n.nodes,o=void 0===i?[]:i,a=n.edges,s=void 0===a?[]:a,u=function(){var t=s_({nodes:o,edges:s}),n=Object.keys(t);n.sort(function(e,r){var n,i;return(null===(n=t[e])||void 0===n?void 0:n.degree)-(null===(i=t[r])||void 0===i?void 0:i.degree)});var i=n[0];if(!o.length||(null===(r=t[i])||void 0===r?void 0:r.degree)>=e)return"break";var a=o.findIndex(function(t){return t.id===i});o.splice(a,1),s=s.filter(function(t){return!(t.source===i||t.target===i)})};"break"!==u(););return{nodes:o,edges:s}},I_=function(t,e,r){var n=[];switch(t){case g_.EuclideanDistance:n=e[r];break;default:n=[]}return n},L_=function(t,e,r,n,i,o){void 0===e&&(e=3),void 0===r&&(r=void 0),void 0===n&&(n=[]),void 0===i&&(i=["id"]),void 0===o&&(o=g_.EuclideanDistance);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,l=void 0===u?[]:u,c={clusters:[{id:"0",nodes:s}],clusterEdges:[]};if(o===g_.EuclideanDistance&&!s.every(function(t){return t.hasOwnProperty(r)}))return c;var f=[],h=[];if(o===g_.EuclideanDistance&&(f=S_(s,r),h=k_(f,n,i)),!h.length)return c;for(var p=(0,Uw.uniq)(h.map(function(t){return t.join("")})),d=Math.min(e,s.length,p.length),y=0;yx&&!v.find(function(e){return(0,Uw.isEqual)(e,I_(o,h,s[t].originIndex))})&&(x=i,w=t)}},S=0;S=0;A--)m[Number(s[y].clusterId)][A].id===s[y].id&&m[Number(s[y].clusterId)].splice(A,1);s[y].clusterId=String(k),m[k].push(s[y])}}var P=!1;for(y=0;y=1e3)break}var j=[],N={};return l.forEach(function(t){var e,r,n=t.source,i=t.target,o=null===(e=s.find(function(t){return t.id===n}))||void 0===e?void 0:e.clusterId,a=null===(r=s.find(function(t){return t.id===i}))||void 0===r?void 0:r.clusterId,u="".concat(o,"---").concat(a);if(N[u])N[u].count++;else{var l={source:o,target:a,count:1};N[u]=l,j.push(l)}}),{clusters:m,clusterEdges:j}},j_=function(t,e){var r=new __(e),n=r.norm2(),i=new __(t),o=i.norm2(),a=r.dot(i),s=n*o,u=s?a/s:0;return u},N_=function(t,e,r,n,i){void 0===t&&(t=[]),void 0===r&&(r=void 0),void 0===n&&(n=[]),void 0===i&&(i=[]);var o=(0,Uw.clone)(t.filter(function(t){return t.id!==e.id})),a=t.findIndex(function(t){return t.id===e.id}),s=S_(t,r),u=k_(s,n,i),l=u[a],c=[];return o.forEach(function(t,r){if(t.id!==e.id){var n=u[r],i=j_(n,l);c.push(i),t.cosineSimilarity=i}}),o.sort(function(t,e){return e.cosineSimilarity-t.cosineSimilarity}),{allCosineSimilarity:c,similarNodes:o}},R_=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,r=t;e0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==n&&n0?r=n:null!==i&&i0&&(r=i),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},t}(),F_=function(t,e){var r=[],n=t.nodes,i=void 0===n?[]:n,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return r;var s=i[0],u=new Set;u.add(s);var l=new B_(function(t,r){return e?t.weight-r.weight:0});for(t_(s.id,a).forEach(function(t){l.insert(t)});!l.isEmpty();){var c=l.delMin(),f=c.source,h=c.target;u.has(f)&&u.has(h)||(r.push(c),u.has(f)||(u.add(f),t_(f,a).forEach(function(t){l.insert(t)})),u.has(h)||(u.add(h),t_(h,a).forEach(function(t){l.insert(t)})))}return r},z_=function(t,e){var r=[],n=t.nodes,i=void 0===n?[]:n,o=t.edges,a=void 0===o?[]:o;if(0===i.length)return r;var s=a.map(function(t){return t});e&&s.sort(function(t,e){return t.weight-e.weight});for(var u=new R_(i.map(function(t){return t.id}));s.length>0;){var l=s.shift(),c=l.source,f=l.target;u.connected(c,f)||(r.push(l),u.union(c,f))}return r},G_=function(t,e,r){return r?{prim:F_,kruskal:z_}[r](t,e):z_(t,e)},U_=function(t,e,r){"number"!=typeof e&&(e=1e-6),"number"!=typeof r&&(r=.85);for(var n,i=1,o=0,a=1e3,s=t.nodes,u=void 0===s?[]:s,l=t.edges,c=void 0===l?[]:l,f=u.length,h={},p={},d=0;d0&&i>e;){for(o=0,d=0;d0&&(n+=p[b]/x)}h[v]=r*n,o+=h[v]}}for(o=(1-o)/f,i=0,d=0;d=0;e--){var r=this.dfsEdgeList[e],n=r.fromNode,i=r.toNode;nf||n.hasNode(o[c.to])||(e.labeld&&"break"!==y(v);v--);if(h){var g=t.findMinLabel(f);o.dfsEdgeList.push(new K_(c,p,q_,g.edgeLabel,q_));var m=o.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[m]===o.dfsEdgeList[m]&&a(f[g.edgeLabel].projected)}var b={};h=!1;var x=0;s.forEach(function(e){var r=new Q_(e),o=t.findForwardPureEdges(n,r.edges[u[0]],l,r);o.length>0&&(h=!0,x=c,o.forEach(function(t){var r="".concat(t.label,"-").concat(i[t.to].label);b[r]||(b[r]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[r].projected.push({graphId:n.id,edge:t,preNode:e})}))});var w=u.length,_=function(e){if(h)return"break";var r=u[e];s.forEach(function(e){var a=new Q_(e),s=t.findForwardRmpathEdges(n,a.edges[r],l,a);s.length>0&&(h=!0,x=o.dfsEdgeList[r].fromNode,s.forEach(function(t){var r="".concat(t.label,"-").concat(i[t.to].label);b[r]||(b[r]={projected:[],edgeLabel:t.label,nodeLabel2:i[t.to].label}),b[r].projected.push({graphId:n.id,edge:t,preNode:e})}))})};for(v=0;v=0;f--){var h=e.findBackwardEdge(u,c.edges[n[f]],c.edges[n[0]],c);if(h){var p="".concat(e.dfsCode.dfsEdgeList[n[f]].fromNode,"-").concat(h.label);s[p]||(s[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[n[f]].fromNode,edgeLabel:h.label}),s[p].projected.push({graphId:t.graphId,edge:h,preNode:t})}}if(!(r>=e.maxNodeNum)){e.findForwardPureEdges(u,c.edges[n[0]],o,c).forEach(function(e){var r="".concat(i,"-").concat(e.label,"-").concat(l[e.to].label);a[r]||(a[r]={projected:[],fromNodeId:i,edgeLabel:e.label,nodeLabel2:l[e.to].label}),a[r].projected.push({graphId:t.graphId,edge:e,preNode:t})});var d=function(r){e.findForwardRmpathEdges(u,c.edges[n[r]],o,c).forEach(function(i){var o="".concat(e.dfsCode.dfsEdgeList[n[r]].fromNode,"-").concat(i.label,"-").concat(l[i.to].label);a[o]||(a[o]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[n[r]].fromNode,edgeLabel:i.label,nodeLabel2:l[i.to].label}),a[o].projected.push({graphId:t.graphId,edge:i,preNode:t})})};for(f=0;fi){var a=i;i=n,n=a}var c=t.label,f="".concat(r,"-").concat(n,"-").concat(c,"-").concat(i),h="".concat(n,"-").concat(c,"-").concat(i);if(!o[h]){var p=o[h]||0;p++,o[h]=p}s[f]={graphId:r,nodeLabel1:n,edgeLabel:c,nodeLabel2:i}})})}),Object.keys(i).forEach(function(t){if(!(i[t]e&&(s=e);var n=r[t.id].inDegree;u>n&&(u=n);var i=r[t.id].outDegree;l>i&&(l=i)}),t[e]={degree:s,inDegree:u,outDegree:l}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:l}},cS=function(t,e,r,n,i,o,a){var s;if(void 0===r&&(r=!1),void 0===o&&(o="cluster"),void 0===a&&(a="cluster"),t&&t.nodes){var u=t.nodes.length;if(u){var l=x_(t,r),c=x_(e,r),f=sS(t.nodes,l,r),h=sS(e.nodes,c,r),p=oS(t.nodes,o),d=p.nodeMap,y=p.nodeLabelMap,v=oS(e.nodes,o),g=v.nodeMap,m=v.nodeLabelMap;aS(t.edges,a,d);var b=aS(e.edges,a,g).edgeLabelMap,x=[];null===c||void 0===c||c.forEach(function(t){x=x.concat(t)}),i||(i=Math.max.apply(Math,(0,Gw.__spreadArray)((0,Gw.__spreadArray)([],x,!1),[2],!1))),n||(n=i);var w=eS(t,l,o,n),_=eS(e,c,o,n),S=function(t,e,r,n,i){var o=Math.ceil(r/e),a={},s=0;return n.forEach(function(t,n){for(var u=0,l=0,c=t.nodeIdxs,f=t.neighborNum-1;u2*e)););if(p<2*e&&(a["".concat(n,"-").concat(h)]={start:n,end:h,distance:i[n][h]},u++,++s>=r))return a;if(++l>2*e)break}uj&&(j=r.length,I=r,L=e,M=t)});var N={},R={},D={},B={},F={},z={};Object.keys(m).forEach(function(n,i){F[n]=[],r&&(z[n]=[]);var s=-1/0,u={};m[n].forEach(function(t){var e=h["".concat(M.id,"-").concat(t.id)];if(e&&F[n].push(e),sF[n][h]){c=!0;break}if(c)return I.splice(e,1),"continue";var p={};i.neighbors.forEach(function(t){var e=f["".concat(r.id,"-").concat(t.id)];p["".concat(r.id,"-").concat(t.id)]={start:d[r.id].idx,end:d[t.id].idx,distance:e}}),E=nS(p,w,t,E);var y=[];Object.keys(p).forEach(function(t){if(P[t])y.push(P[t]);else{var e=E[t];P[t]=iS(e,A,o,a),y.push(P[t])}}),y=y.sort(function(t,e){return e-t});var v=!1;for(h=0;h=0;p--)c(p)});var G=[];null===I||void 0===I||I.forEach(function(n){for(var s=d[n.id].idx,u=rS(t.nodes,l[s],s,o,i).neighbors,c=!1,h=u.length-1;h>=0;h--){if(u.length+1F[y][x])u.splice(h,1);else{if(r){var _="".concat(p.id,"-").concat(n.id),S=f[_];if(x=z[y].length-1,S>z[y][x]){u.splice(h,1);continue}}var k=P[v]?P[v]:uS(t,n,p,d,b,w,A,o,a,P,E),T="".concat(M.id,"-").concat(y);if(k=0&&"break"!==_(y);y--);if(w)return G.splice(n,1),"continue";i.edges=c;var S=y_(i,i.nodes[0].id,!1).length;if(Object.keys(S).reverse().forEach(function(t){if(t!==i.nodes[0].id&&!w){if(S[t]===1/0){var e=l[t].node[o];if(u[e]--,u[e]V[n][V[n].length-1]){if(e=l[t].node[o],u[e]--,u[e]=0;T--){var C=i.nodes[T],O=l[C.id].degree,A=l[C.id].inDegree,P=l[C.id].outDegree,I=C[o],L=lS(N,I,g,m),j=L.minPatternNodeLabelDegree,R=L.minPatternNodeLabelInDegree,D=L.minPatternNodeLabelOutDegree;if(r?O=0;B--){var F=c[B];if(!l[F.source]||!l[F.target]){c.splice(B,1);var z=F[a];if(f[z]--,l[F.source]&&(l[F.source].degree--,l[F.source].outDegree--),l[F.target]&&(l[F.target].degree--,l[F.target].inDegree--),b[z]&&f[z]=0&&"break"!==H(W);W--);var q=G.length,Y=function(t){var e={};G[t].edges.forEach(function(t){var r="".concat(t.source,"-").concat(t.target,"-").concat(t.label);e[r]?e[r]++:e[r]=1});for(var r=function(t){var r={};G[t].edges.forEach(function(t){var e="".concat(t.source,"-").concat(t.target,"-").concat(t.label);r[e]?r[e]++:r[e]=1});var n=!0;Object.keys(r).length!==Object.keys(e).length?n=!1:Object.keys(e).forEach(function(t){r[t]!==e[t]&&(n=!1)}),n&&G.splice(t,1)},n=q-1;n>t;n--)r(n);q=G.length};for(W=0;W<=q-1;W++)Y(W);return G}}},fS=function(){function t(t){void 0===t&&(t=10),this.linkedList=new Jw,this.maxStep=t}return Object.defineProperty(t.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),t.prototype.isEmpty=function(){return!this.linkedList.head},t.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},t}(),hS=d_,pS={getAdjMatrix:Xw,breadthFirstSearch:r_,connectedComponent:o_,getDegree:s_,getInDegree:u_,getOutDegree:l_,detectCycle:d_,detectDirectedCycle:hS,detectAllCycles:p_,detectAllDirectedCycle:h_,detectAllUndirectedCycle:f_,depthFirstSearch:c_,dijkstra:y_,findAllPath:b_,findShortestPath:m_,floydWarshall:x_,labelPropagation:w_,louvain:A_,iLouvain:P_,kCore:M_,kMeans:L_,cosineSimilarity:j_,nodesCosineSimilarity:N_,minimumSpanningTree:G_,pageRank:U_,getNeighbors:$w,Stack:fS,GADDI:cS},dS=r(4995),yS=r(9019),vS=r(4732),gS=Yw.pd,mS=function(t){return function(e,r){return e[t]-r[t]}},bS=function(t,e,r){return t>=e&&t<=r},xS=function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=e.x-t.x,s=e.y-t.y,u=n.x-r.x,l=n.y-r.y,c=a*l-s*u,f=1/c;if(c*c>1e-4*(a*a+s*s)*(u*u+l*l)){var h=(i*l-o*u)*f,p=(i*s-o*a)*f;return bS(h,0,1)&&bS(p,0,1)?{x:t.x+h*a,y:t.y+h*s}:null}return null},wS=function(t,e){var r=t.x,n=t.y,i=t.width,o=t.height,a=[],s={x:r+i/2,y:n+o/2};a.push({x:r,y:n}),a.push({x:r+i,y:n}),a.push({x:r+i,y:n+o}),a.push({x:r,y:n+o}),a.push({x:r,y:n});for(var u=null,l=1;le[n][o]+e[o][i]&&(e[n][i]=e[n][o]+e[o][i]);return e},PS=function(t,e){var r=t.nodes,n=t.edges,i=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(t,e){o[t.id]=e;i.push([])}),n&&n.forEach(function(t){var r=t.source,n=t.target,a=o[r],s=o[n];i[a][s]=1,e||(i[s][a]=1)}),i},MS=function(t,e){t.translate(e.x,e.y)},IS=function(t,e,r,n){void 0===n&&(n={duration:500});var i=t.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]);var o=t.getCanvasBBox(),a=e.x-o.minX,s=e.y-o.minY;if(r){var u=a*i[0],l=s*i[4],c=0,f=0,h=0,p=0;t.animate(function(t){return i=gS(i,[["t",(h=u*t)-c,(p=l*t)-f]]),c=h,f=p,{matrix:i}},n)}else{var d=gS(i,[["t",a,s]]);t.setMatrix(d)}},LS=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e;(0,Uw.isArray)(e)||(n=[e,e]),(0,Uw.isArray)(e)&&1===e.length&&(n=[e[0],e[0]]),r=gS(r,[["s",n[0],n[1]]]),t.setMatrix(r)},jS=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=gS(r,[["r",e]]),t.setMatrix(r)},NS=function(t,e,r){for(var n=[],i=0;i0!=a(l[1]-r)>0&&a(e-(r-u[1])*(u[0]-l[0])/(u[1]-l[1])-u[0])<0&&(n=!n)}return n},BS=function(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY1){var a=t[0],s=t[r-1];e.push({from:{x:s[0],y:s[1]},to:{x:a[0],y:a[1]}})}return e};if(t.length<2||e.length<2)return!1;var i=r(t),o=r(e);if(!BS(i,o))return!1;var a=!1;if((0,Uw.each)(e,function(e){if(DS(t,e[0],e[1]))return a=!0,!1}),a)return!0;if((0,Uw.each)(t,function(t){if(DS(e,t[0],t[1]))return a=!0,!1}),a)return!0;var s=n(t),u=n(e),l=!1;return(0,Uw.each)(u,function(t){if(function(t,e){var r=!1;return(0,Uw.each)(t,function(t){if(xS(t.from,t.to,e.from,e.to))return r=!0,!1}),r}(s,t))return l=!0,!1}),l},zS=function(){function t(t,e,r,n){this.x1=t,this.y1=e,this.x2=r,this.y2=n}return t.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),n=Math.max(this.y1,this.y2);return{x:t,y:e,minX:t,minY:e,maxX:r,maxY:n,width:r-t,height:n-e}},t}(),GS=function(t,e){return{top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]}[e]},US=function(t,e){var r=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),n=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),i=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(i){var o=r/i,a=n/i;if(o>=0&&o<=1&&a>=0&&a<=1)return o}return Number.POSITIVE_INFINITY},VS=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),i=0,o=[],a=0;a<4;a++){var s=GS(n,r[a]),u=s[0],l=s[1],c=s[2],f=s[3];o[a]=xS({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:u,y:l},{x:c,y:f}),o[a]&&(i+=1)}return[o,i]},HS=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),i=Number.POSITIVE_INFINITY,o=0,a=0;a<4;a++){var s=GS(n,r[a]),u=s[0],l=s[1],c=s[2],f=s[3],h=US(e,new zS(u,l,c,f));(h=Math.abs(h-.5))>=0&&h<=1&&(o+=1,i=h0){for(var n=0,i=t;ne.x+e.width,i=t.y>e.y+e.height,o=t.y":.604998779296875,"/":.5,"?":.53699951171875},aE=Math.PI,sE=Math.sin,uE=Math.cos,lE=sE(aE/8),cE=uE(aE/8),fE=function(t,e){var r=t.getBBox(),n={x:r.minX,y:r.minY},i={x:r.maxX,y:r.maxY};if(e){var o=e.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),n=ES(n,o),i=ES(i,o)}var a=n.x,s=n.y,u=i.x,l=i.y;return{x:a,y:s,minX:a,minY:s,maxX:u,maxY:l,width:u-a,height:l-s}},hE=function(t){var e=t.sourceNode||t.targetNode,r=e.get("group").getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e.getKeyShape(),i=n.getBBox(),o=t.loopCfg||{},a=o.dist||2*Math.max(i.width,i.height),s=o.position||iE.defaultLoopPosition,u=[(i.minX+i.maxX)/2+r[6],(i.minY+i.maxY)/2+r[7]],l=[t.startPoint.x,t.startPoint.y],c=[t.endPoint.x,t.endPoint.y],f=i.height/2,h=i.width/2,p=f,d=f,y=p*lE,v=p*cE,g=d*lE,m=d*cE,b=n.get("type"),x=Math.min(f/2,h/2),w=Math.min(f,h),_=(null===o||void 0===o?void 0:o.pointPadding)?Math.min(w,null===o||void 0===o?void 0:o.pointPadding):x;if(l[0]===c[0]&&l[1]===c[1]){switch(s){case"top":"circle"===b?(l=[u[0]-y,u[1]-v],c=[u[0]+g,u[1]-m]):(l=[u[0]-_,u[1]-f],c=[u[0]+_,u[1]-f]);break;case"top-right":p=f,d=h,"circle"===b?(l=[u[0]+(y=p*lE),u[1]-(v=p*cE)],c=[u[0]+(m=d*cE),u[1]-(g=d*lE)]):(l=[u[0]+h-_,u[1]-f],c=[u[0]+h,u[1]-f+_]);break;case"right":p=h,d=h,"circle"===b?(l=[u[0]+(v=p*cE),u[1]-(y=p*lE)],c=[u[0]+(m=d*cE),u[1]+(g=d*lE)]):(l=[u[0]+h,u[1]-_],c=[u[0]+h,u[1]+_]);break;case"bottom-right":p=h,d=f,"circle"===b?(l=[u[0]+(v=p*cE),u[1]+(y=p*lE)],c=[u[0]+(g=d*lE),u[1]+(m=d*cE)]):(l=[u[0]+h,u[1]+f-_],c=[u[0]+h-_,u[1]+f]);break;case"bottom":p=f,d=f,"circle"===b?(l=[u[0]+(y=p*lE),u[1]+(v=p*cE)],c=[u[0]-(g=d*lE),u[1]+(m=d*cE)]):(l=[u[0]-_,u[1]+f],c=[u[0]+_,u[1]+f]);break;case"bottom-left":p=f,d=h,"circle"===b?(l=[u[0]-(y=p*lE),u[1]+(v=p*cE)],c=[u[0]-(m=d*cE),u[1]+(g=d*lE)]):(l=[u[0]-h,u[1]+f-_],c=[u[0]-h+_,u[1]+f]);break;case"left":p=h,d=h,"circle"===b?(l=[u[0]-(v=p*cE),u[1]+(y=p*lE)],c=[u[0]-(m=d*cE),u[1]-(g=d*lE)]):(l=[u[0]-h,u[1]-_],c=[u[0]-h,u[1]+_]);break;case"top-left":p=h,d=f,"circle"===b?(l=[u[0]-(v=p*cE),u[1]-(y=p*lE)],c=[u[0]-(g=d*lE),u[1]-(m=d*cE)]):(l=[u[0]-h+_,u[1]-f],c=[u[0]-h,u[1]-f+_]);break;default:l=[u[0]-(y=(p=h)*lE),u[1]-(v=p*cE)],c=[u[0]+(g=(d=h)*lE),u[1]-(m=d*cE)]}if(!1===o.clockwise){var S=[l[0],l[1]];l=[c[0],c[1]],c=[S[0],S[1]]}}var E=[l[0]-u[0],l[1]-u[1]],k=(p+a)/p,T=(d+a)/d;!1===o.clockwise&&(k=(d+a)/d,T=(p+a)/p);var C=vS.scale([0,0],E,k),O=[u[0]+C[0],u[1]+C[1]],A=[c[0]-u[0],c[1]-u[1]],P=vS.scale([0,0],A,T),M=[u[0]+P[0],u[1]+P[1]];return t.startPoint={x:l[0],y:l[1]},t.endPoint={x:c[0],y:c[1]},t.controlPoints=[{x:O[0],y:O[1]},{x:M[0],y:M[1]}],t},pE=function(t,e,r,n,i){var o=[],a=null===t||void 0===t?void 0:t.getPoint(e);if(!a)return{x:0,y:0,angle:0};if(e<1e-4)o=t.getStartTangent().reverse();else if(e>.9999)o=t.getEndTangent();else{var s=null===t||void 0===t?void 0:t.getPoint(e+1e-4);o.push([a.x,a.y]),o.push([s.x,s.y])}var u=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(u<0&&(u+=2*aE),r&&(a.x+=uE(u)*r,a.y+=sE(u)*r),n){var l=u-aE/2;u>.5*aE&&u<1.5*aE&&(l-=aE),a.x+=uE(l)*n,a.y+=sE(l)*n}var c={x:a.x,y:a.y,angle:u};return i?(u>.5*aE&&u<1.5*aE&&(u-=aE),(0,Gw.__assign)({rotate:u},c)):c},dE=function(t,e){"function"==typeof e&&function t(e,r,n,i){if(!1===i(e,r,n))return!1;if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return!1;return!0}(t,null,-1,e)},yE=function(t,e){"function"==typeof e&&function t(e,r,n,i){if(e&&e.children)for(var o=e.children.length-1;o>=0;o--)if(!t(e.children[o],e,o,i))return;return!1!==i(e,r,n)}(t,null,-1,e)},vE=function(t,e){return e*(oE[t]||1)},gE=function(t,e){var r=0,n=new RegExp("[一-龥]+");return t.split("").forEach(function(t){n.test(t)?r+=e:r+=vE(t,e)}),[r,e]},mE=function(t,e){return"number"!=typeof e||e<=0||e>=t.length?t:t.substring(0,e)+"..."},bE=function(t,e){var r=[],n={},i={};t.forEach(function(t){i[t.id]=t}),t.forEach(function(t,e){var o=(0,Uw.clone)(t);o.itemType="combo",o.children=void 0,o.parentId===o.id?(console.warn("The parentId for combo ".concat(o.id," can not be the same as the combo's id")),delete o.parentId):o.parentId&&!i[o.parentId]&&(console.warn("The parent combo for combo ".concat(o.id," does not exist!")),delete o.parentId);var a=n[o.id];if(a){if(o.children=a.children,n[o.id]=o,!(a=o).parentId)return void r.push(a);var s=n[a.parentId];if(s)s.children?s.children.push(o):s.children=[o];else{var u={id:a.parentId,children:[a]};n[a.parentId]=u,n[o.id]=o}}else if((0,Uw.isString)(t.parentId)){var l=n[t.parentId];if(l)l.children?l.children.push(o):l.children=[o],n[o.id]=o;else{var c={id:t.parentId,children:[o]};n[c.id]=c,n[o.id]=o}}else r.push(o),n[o.id]=o});var o={};(e||[]).forEach(function(t){o[t.id]=t;var e=n[t.comboId];if(e){var r={id:t.id,comboId:t.comboId};e.children?e.children.push(r):e.children=[r],r.itemType="node",n[t.id]=r}});var a=0;return r.forEach(function(t){t.depth=a+10,dE(t,function(t){var e,r=n[t.id].itemType;e="node"===r?n[t.comboId]:n[t.parentId],t.depth=e&&"node"===r?a+1:a+10,a-1&&o.splice(l,1),s||(i={id:e,itemType:"node",comboId:r},a[e]={children:void 0}),e){var c=!1;if(r){var f=0;(t||[]).forEach(function(t){c||dE(t,function(t){return r!==t.id||(c=!0,t.children?t.children.push(i):t.children=[i],f=t.depth,"node"===i.itemType?i.depth=f+2:i.depth=f+1,!1)})})}else r&&c||"node"===i.itemType||t.push(i);var h=i.depth;dE(i,function(t){return"node"===t.itemType?h+=2:h+=1,t.depth=h,!0})}return t},wE=function(t,e,r){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!t||0===t.length){var i=(null===r||void 0===r?void 0:r.getModel())||{},o=i.x,a=i.y,s=i.fixSize,u=i.collapsed,l=i.fixCollapseSize,c=u?l:s,f=(0,Uw.isArray)(c)?c:[c,c],h=f[0],p=f[1],d=[h/2,p/2];return{minX:o-d[0],minY:a-d[1],maxX:o+d[0],maxY:a+d[1],x:o,y:a,width:h,height:p}}return t.forEach(function(t){var r=e.findById(t.id);if(r&&r.isVisible()){r.set("bboxCanvasCache",void 0);var i=r.getCanvasBBox();i.x&&n.minX>i.minX&&(n.minX=i.minX),i.y&&n.minY>i.minY&&(n.minY=i.minY),i.x&&n.maxXr&&(r=l),c>i&&(i=c)}return{x:Math.floor(e),y:Math.floor(n),width:Math.ceil(r)-Math.floor(e),height:Math.ceil(i)-Math.floor(n),minX:e,minY:n,maxX:r,maxY:i}},NE=function(t,e,r,n,i){void 0===e&&(e=15),void 0===r&&(r="quadratic"),void 0===n&&(n=void 0),void 0===i&&(i=void 0);for(var o=t.length,a=2*e,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],u={},l=[],c={},f=0;fn.get("optimizeThreshold")){var a=1/0,s=1/0,u=-1/0,l=-1/0;o.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;a>r&&(a=r),s>n&&(s=n),up&&(d=p,console.warn("fitview failed, ratio out of range, ratio: %f",a,"graph maxzoom has been used instead"));var y=(0,RE.pd)(f,[["t",-i.x,-i.y],["s",d,d],["t",i.x,i.y]]),v=EE({animateCfg:r,callback:function(){t.setMatrix(y),u.emit("viewportchange",{action:"translate",matrix:f}),u.emit("viewportchange",{action:"zoom",matrix:y})}});t.stopAnimate(),t.setMatrix(e),t.animate(function(t){return{matrix:QS(e,y,t)}},v)}else{var g=EE({animateCfg:r,callback:function(){u.emit("viewportchange",{action:"translate",matrix:f})}});t.animate(function(t){return{matrix:QS(e,f,t)}},g)}}},t.prototype.fitView=function(t,e){var r,n=this.graph,i=this.getFormatPadding(),o=n.get("width"),a=n.get("height"),s=n.get("group"),u=s.getMatrix()||[1,0,0,0,1,0,0,0,1];s.resetMatrix();var l=n.getNodes();if(l.length>n.get("optimizeThreshold")){var c=1/0,f=1/0,h=-1/0,p=-1/0;l.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;c>r&&(c=r),f>n&&(f=n),hg&&(m=g),t)this.animatedFitView(s,u,e,r,d,y,m,!0);else{var b=d.x-y.x,x=d.y-y.y;if(LE(b)||LE(x))return;n.translate(b,x),n.zoom(m,d)||console.warn("zoom failed, ratio out of range, ratio: %f",m)}}},t.prototype.fitViewByRules=function(t,e,r){var n,i=t.onlyOutOfViewPort,o=void 0!==i&&i,a=t.direction,s=void 0===a?"both":a,u=t.ratioRule,l=void 0===u?"min":u,c=this.graph,f=this.getFormatPadding(),h=c.get("width"),p=c.get("height"),d=c.get("group"),y=d.getMatrix()||[1,0,0,0,1,0,0,0,1];d.resetMatrix();var v=c.getNodes();if(v.length>c.get("optimizeThreshold")){var g=1/0,m=1/0,b=-1/0,x=-1/0;v.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y;g>r&&(g=r),m>n&&(m=n),bc.maxX&&(c.maxX=p.maxX),p.maxY>c.maxY&&(c.maxY=p.maxY)}if(c.x=c.minX,c.y=c.minY,c.width=c.maxX-c.minX,c.height=c.maxY-c.minY,0!==c.width&&0!==c.height){var d=this.getViewCenter(),y={x:c.x+c.width/2,y:c.y+c.height/2},v=(a-o[1]-o[3])/c.width,g=(s-o[0]-o[2])/c.height,m=v;v>g&&(m=g),r?this.animatedFitView(u,l,n,c,d,y,m,e):(i.translate(d.x-y.x,d.y-y.y),e&&!i.zoom(m,d)&&console.warn("zoom failed, ratio out of range, ratio: %f",m))}}},t.prototype.changeSize=function(t,e){var r=this.graph;if(!(0,Uw.isNumber)(t)||!(0,Uw.isNumber)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:t,height:e}),r.get("canvas").changeSize(t,e),r.get("plugins").forEach(function(t){t.get("gridContainer")&&t.positionInit()})},t.prototype.destroy=function(){this.graph=null,this.destroyed=!1},t}();function BE(t){"@babel/helpers - typeof";return(BE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function FE(t){if("string"!=typeof t)return t;var e=function(t){if("string"!=typeof t)return t;try{return JSON.parse(t.trim())}catch(e){return t.trim()}},r=e(t);if("string"!=typeof r)return r;for(var n=function(t){return t[t.length-1]},i=t.trim(),o=[],a=[],s=function(){for(var t=[],e=0;en.width&&(n.width=c.width+c.x),c.height+c.y>n.height&&(n.height=c.height+c.y)}}}return t.bbox=function(t,e,r){var n,i,o=t.attrs,a=void 0===o?{}:o,s={x:e.x||0,y:e.y||0,width:r.width||0,height:r.height||0};switch(t.type){case"maker":case"circle":a.r&&(i=2*a.r,n=2*a.r);break;case"text":a.text&&(i=gE(a.text,a.fontSize||12)[0],n=16,s.y+=n,s.height=n,s.width=i,t.attrs=(0,Gw.__assign)({fontSize:12,fill:"#000"},a));break;default:a.width&&(i=a.width),a.height&&(n=a.height)}return n>=0&&(s.height=n),i>=0&&(s.width=i),a.marginTop&&(s.y+=a.marginTop),a.marginLeft&&(s.x+=a.marginLeft),s}(t,e,n),t.attrs=(0,Gw.__assign)((0,Gw.__assign)({},t.attrs),t.bbox),t}function VE(t){var e={},r=function(e){var r="function"==typeof t?t(e):t,n=GE(r)(e),i=document.createElement("div");i.innerHTML=n;var o=UE(function t(e,r){var n={},i=e.getAttributeNames&&e.getAttributeNames()||[],o=e.children&&Array.from(e.children).map(function(e){return t(e,r)}),a={},s=e.tagName?e.tagName.toLowerCase():"group";return"text"===s&&(n.text=e.innerText),a.type=s,"img"===s&&(a.type="image"),Array.from(i).forEach(function(t){var r=zE(t),i=e.getAttribute(t);try{if("style"===r||"attrs"===r){var o=FE(i);n=(0,Gw.__assign)((0,Gw.__assign)({},n),o)}else a[r]=FE(i)}catch(t){if("style"===r)throw t;a[r]=i}}),a.attrs=n,r&&r.style&&a.name&&"object"===BE(r.style[a.name])&&(a.attrs=(0,Gw.__assign)((0,Gw.__assign)({},a.attrs),r.style[a.name])),r&&r.style&&a.keyshape&&(a.attrs=(0,Gw.__assign)((0,Gw.__assign)({},a.attrs),r.style)),o.length&&(a.children=o),a}(i.children[0],e));return i.remove(),o};return{draw:function(t,n){var i=r(t),o=n;return function t(e){var r=e.attrs,i=void 0===r?{}:r,a=e.bbox,s=e.type,u=e.children,l=(0,Gw.__rest)(e,["attrs","bbox","type","children"]);if("group"!==e.type){var c=n.addShape(e.type,(0,Gw.__assign)({attrs:i,origin:{bbox:a,type:s,children:u}},l));e.keyshape&&(o=c)}e.children&&e.children.forEach(function(e){return t(e)})}(i),e[t.id]=[i],o},update:function(t,n){e[t.id]||(e[t.id]=[]);var i=n.getContainer(),o=i.get("children"),a=r(t),s=function t(e){var r;"group"!==e.type&&i.addShape(e.type,{attrs:e.attrs}),(null===(r=e.children)||void 0===r?void 0:r.length)&&e.children.map(function(e){return t(e)})},u=function t(e){var r,n=o.find(function(t){return t.attrs.key===e.attrs.key});n&&i.removeChild(n),(null===(r=e.children)||void 0===r?void 0:r.length)&&e.children.map(function(e){return t(e)})};!function t(e){var r=e.key;if("group"!==e.type){var i=o.find(function(t){return t.attrs.key===r});switch(e.action){case"change":if(i){var a=e.val.keyshape?n.getOriginStyle():{};i.attr((0,Gw.__assign)((0,Gw.__assign)({},a),e.val.attrs))}break;case"add":s(e.val);break;case"delete":u(e.val);break;case"restructure":u(e.formerTarget),s(e.nowTarget)}}e.children&&e.children.forEach(function(e){return t(e)})}(function t(e,r){var n,i,o,a,s=(e||{}).type,u=((null===r||void 0===r?void 0:r.attrs)||{}).key;if(u&&e&&(e.attrs.key=u),!e&&r)return{action:"delete",val:r,type:s,key:u};if(e&&!r)return{action:"add",val:e,type:s};if(!e&&!r)return{action:"same",type:s};var l=[];if((null===(n=e.children)||void 0===n?void 0:n.length)>0||(null===(i=r.children)||void 0===i?void 0:i.length)>0)for(var c=Math.max(null===(o=e.children)||void 0===o?void 0:o.length,null===(a=r.children)||void 0===a?void 0:a.length),f=r.children||[],h=e.children||[],p=0;p-1)return;r.push(i)}else s>-1&&r.splice(s,1)}else if((0,Uw.isString)(e)){var u=r.filter(function(t){return t.includes(o)});u.length>0&&this.clearStates(u),(a=a.filter(function(t){return!t.includes(o)})).push(i),this.set("states",a)}if(n){var l=this.get("model").type;n.setState(l,t,e,this)}},t.prototype.clearStates=function(t){var e=this,r=e.getStates(),n=e.get("shapeFactory"),i=e.get("model").type;t||(t=r),(0,Uw.isString)(t)&&(t=[t]);var o=r.filter(function(e){return-1===t.indexOf(e)});e.set("states",o),t.forEach(function(t){n.setState(i,t,!1,e)})},t.prototype.setOptimize=function(t){this.optimize=t},t.prototype.getContainer=function(){return this.get("group")},t.prototype.getKeyShape=function(){return this.get("keyShape")},t.prototype.getModel=function(){return this.get("model")},t.prototype.getType=function(){return this.get("type")},t.prototype.getID=function(){return this.get("id")},t.prototype.isItem=function(){return!0},t.prototype.getStates=function(){return this.get("states")},t.prototype.hasState=function(t){return this.getStates().indexOf(t)>=0},t.prototype.refresh=function(t){var e=this.get("model");this.updatePosition(e),this.updateShape(t),this.afterUpdate(),this.clearCache()},t.prototype.getUpdateType=function(t){},t.prototype.update=function(t,e){void 0===e&&(e=void 0);var r=this.get("model");if("move"===e)this.updatePosition(t);else{var n=r.visible,i=t.visible;n!==i&&void 0!==i&&this.changeVisibility(i);var o={x:r.x,y:r.y};t.x=isNaN(+t.x)?r.x:+t.x,t.y=isNaN(+t.y)?r.y:+t.y;var a=this.get("styles");if(t.stateStyles){var s=t.stateStyles;(0,Uw.mix)(a,s),delete t.stateStyles}Object.assign(r,t),o.x===t.x&&o.y===t.y||this.updatePosition(t),this.updateShape(e)}this.afterUpdate(),this.clearCache()},t.prototype.updateShape=function(t){var e=this.get("shapeFactory"),r=this.get("model"),n=r.type;if(e.shouldUpdate(n)&&n===this.get("currentShape")){var i=this.getShapeCfg(r,t);e.baseUpdate(n,i,this,t),"move"!==t&&this.setOriginStyle()}else this.draw();this.restoreStates(e,n)},t.prototype.updatePosition=function(t){var e=this.get("model"),r=isNaN(+t.x)?+e.x:+t.x,n=isNaN(+t.y)?+e.y:+t.y,i=this.get("group");if(isNaN(r)||isNaN(n))return!1;e.x=r,e.y=n;var o=i.getMatrix();return(!o||o[6]!==r||o[7]!==n)&&(i.resetMatrix(),MS(i,{x:r,y:n}),this.clearCache(),!0)},t.prototype.getBBox=function(){var t=this.get("bboxCache");return t||(t=this.calculateBBox(),this.set("bboxCache",t)),t},t.prototype.getCanvasBBox=function(){var t=this.get("bboxCanvasCache");return t||(t=this.calculateCanvasBBox(),this.set("bboxCanvasCache",t)),t},t.prototype.toFront=function(){this.get("group").toFront()},t.prototype.toBack=function(){this.get("group").toBack()},t.prototype.show=function(){this.changeVisibility(!0)},t.prototype.hide=function(){this.changeVisibility(!1)},t.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},t.prototype.isVisible=function(){return this.get("visible")},t.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},t.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},t}(),JE={source:"start",target:"end"},QE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,e){var r=JE[t]+"Point",n=t+"Node",i=this.get(n);i&&!i.destroyed&&i.removeEdge(this),(0,Uw.isPlainObject)(e)?(this.set(r,e),this.set(n,null)):e&&(e.addEdge(this),this.set(n,e),this.set(r,null))},e.prototype.getLinkPoint=function(t,e,r){var n=JE[t]+"Point",i=t+"Node",o=this.get(n);if(!o){var a=this.get(i),s=t+"Anchor",u=this.getPrePoint(t,r),l=e[s];(0,Uw.isNil)(l)||(o=a.getLinkPointByAnchor(l)),o=o||a.getLinkPoint(u),(0,Uw.isNil)(o.index)||this.set("".concat(t,"AnchorIndex"),o.index)}return o},e.prototype.getPrePoint=function(t,e){if(e&&e.length)return e["source"===t?0:e.length-1];var r="source"===t?"target":"source";return this.getEndPoint(r)},e.prototype.getEndPoint=function(t){var e=t+"Node",r=JE[t]+"Point",n=this.get(e);return n&&!n.destroyed?n.get("model"):this.get(r)},e.prototype.getControlPointsByCenter=function(t){var e=this.getEndPoint("source"),r=this.getEndPoint("target"),n=this.get("shapeFactory"),i=t.type;return n.getControlPoints(i,{startPoint:e,endPoint:r})},e.prototype.getEndCenter=function(t){var e=t+"Node",r=JE[t]+"Point",n=this.get(e);if(n){var i=n.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(r)},e.prototype.init=function(){t.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(e,r){var n=this.get("linkCenter"),i=(null===r||void 0===r?void 0:r.includes("move"))?e:t.prototype.getShapeCfg.call(this,e);if(n)i.startPoint=this.getEndCenter("source"),i.endPoint=this.getEndCenter("target");else{var o=i.controlPoints||this.getControlPointsByCenter(i);i.startPoint=this.getLinkPoint("source",e,o),i.endPoint=this.getLinkPoint("target",e,o)}return i.sourceNode=this.get("sourceNode"),i.targetNode=this.get("targetNode"),i},e.prototype.getModel=function(){var t=this.get("model"),e=this.get("source".concat("Node")),r=this.get("target".concat("Node"));return e?delete t["source".concat("Node")]:t.source=this.get("start".concat("Point")),r?delete t["target".concat("Node")]:t.target=this.get("end".concat("Point")),(0,Uw.isString)(t.source)||(0,Uw.isPlainObject)(t.source)||(t.source=t.source.getID()),(0,Uw.isString)(t.target)||(0,Uw.isPlainObject)(t.target)||(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,e){void 0===e&&(e=void 0);var r=this.get("model"),n=r.visible,i=t.visible;n!==i&&void 0!==i&&this.changeVisibility(i);var o=this.get("source"),a=this.get("target");if(o&&!o.destroyed&&a&&!a.destroyed){var s=this.get("styles");if(t.stateStyles){var u=t.stateStyles;(0,Uw.mix)(s,u),delete t.stateStyles}Object.assign(r,t),this.updateShape(e),this.afterUpdate(),this.clearCache()}},e.prototype.destroy=function(){var e=this.get("source".concat("Node")),r=this.get("target".concat("Node"));e&&!e.destroyed&&e.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),t.prototype.destroy.call(this)},e}(KE),$E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getNearestPoint=function(t,e){for(var r=0,n=t[0],i=CS(t[0],e),o=0;o-1&&e.splice(r,1)},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("anchorPointsCache",null)},e.prototype.getUpdateType=function(t){var e,r,n,i,o;if(t){var a=!(0,Uw.isNil)(t.x),s=!(0,Uw.isNil)(t.y),u=Object.keys(t);return 1===u.length&&(a||s)||2===u.length&&a&&s?"move":(0,Uw.isNumber)(t.x)||(0,Uw.isNumber)(t.y)||t.type||t.anchorPoints||t.size||(null===t||void 0===t?void 0:t.style)&&((null===(e=null===t||void 0===t?void 0:t.style)||void 0===e?void 0:e.r)||(null===(r=null===t||void 0===t?void 0:t.style)||void 0===r?void 0:r.width)||(null===(n=null===t||void 0===t?void 0:t.style)||void 0===n?void 0:n.height)||(null===(i=null===t||void 0===t?void 0:t.style)||void 0===i?void 0:i.rx)||(null===(o=null===t||void 0===t?void 0:t.style)||void 0===o?void 0:o.ry))?"bbox|label":u.includes("label")||u.includes("labelCfg")?"style|label":"style"}},e.prototype.setState=function(e,r){var n=this;this.optimize?t.prototype.setState.call(this,e,r):this.runWithBBoxAffected(function(){return t.prototype.setState.call(n,e,r)})},e.prototype.clearStates=function(e){var r=this;this.optimize?t.prototype.clearStates.call(this,e):this.runWithBBoxAffected(function(){return t.prototype.clearStates.call(r,e)})},e.prototype.runWithBBoxAffected=function(t){var e=["r","width","height","rx","ry","lineWidth"],r=this.getKeyShape().attr(),n={};Object.keys(this.getKeyShape().attr()).forEach(function(t){e.includes(t)&&(n[t]=r[t])}),t();for(var i=this.getKeyShape().attr(),o=0;o-1&&(e.splice(r,1),!0)}},e.prototype.removeNode=function(t){if(t){var e=this.getNodes(),r=e.indexOf(t);return r>-1&&(e.splice(r,1),!0)}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){return this.set("bboxCanvasCache",null),this.calculateCanvasBBox()},e.prototype.clearCache=function(){this.set("bboxCache",null),this.set("bboxCanvasCache",null),this.set("anchorPointsCache",null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),this.set("sizeCache",null),this.set("bbox",null),e.remove(),this._cfg=null,this.destroyed=!0}},e}($E),ek=function(){function t(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,Uw.throttle)(function(t){var r=e.graph;if(r&&!r.get("destroyed")){var n=e.edgeToBeUpdateMap;if(n){var i=Object.values(n);i.length&&(i.forEach(function(t){var e=t.edge;if(e&&!e.destroyed){var r=e.getSource(),n=e.getTarget();r&&!r.destroyed&&n&&!n.destroyed&&e.refresh(t.updateType)}}),e.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=t,this.destroyed=!1}return t.prototype.addItem=function(t,e){var r=this.graph,n="vedge"===t?"edge":t,i=r.get("".concat(n,"Group"))||r.get("group"),o=(0,Uw.upperFirst)(n),a=null,s=r.get(n+(0,Uw.upperFirst)("stateStyles"))||{},u=r.get("default"+o);e.stateStyles&&(s=e.stateStyles),u&&(0,Uw.each)(u,function(t,r){(0,Uw.isObject)(t)&&!(0,Uw.isArray)(t)?e[r]=(0,Uw.deepMix)({},t,e[r]):(0,Uw.isArray)(t)?e[r]=e[r]||(0,Uw.clone)(u[r]):e[r]=e[r]||u[r]});var l=r.get(n+"Mapper");if(l){var c=l(e);c.stateStyles&&(s=c.stateStyles,delete c.stateStyles),(0,Uw.each)(c,function(t,r){(0,Uw.isObject)(t)&&!(0,Uw.isArray)(t)?e[r]=(0,Uw.deepMix)({},e[r],t):e[r]=c[r]||e[r]})}if(r.emit("beforeadditem",{type:t,model:e}),"edge"===t||"vedge"===t){var f=void 0,h=void 0;if(f=e.source,h=e.target,f&&(0,Uw.isString)(f)&&(f=r.findById(f)),h&&(0,Uw.isString)(h)&&(h=r.findById(h)),!f||!h)return void console.warn("The source or target node of edge ".concat(e.id," does not exist!"));f.getType&&"combo"===f.getType()&&(e.isComboEdge=!0),h.getType&&"combo"===h.getType()&&(e.isComboEdge=!0),a=new QE({model:e,source:f,target:h,styles:s,linkCenter:r.get("linkCenter"),group:i.addGroup()})}else if("node"===t)a=new $E({model:e,styles:s,group:i.addGroup()});else if("combo"===t){var p=e.children,d=wE(p,r),y=void 0,v=void 0;if(isNaN(d.x)?isNaN(e.x)&&(y=100*Math.random()):y=d.x,isNaN(d.y)?isNaN(e.y)&&(v=100*Math.random()):v=d.y,isNaN(e.x)||isNaN(e.y))e.x=y,e.y=v;else{var g=e.x-y,m=e.y-v;this.updateComboSucceeds(e.id,g,m,p)}var b=i.addGroup();b.setZIndex(e.depth),a=new tk({model:e,styles:s,animate:r.get("animate"),bbox:e.collapsed?wE([],r):d,group:b}),e.collapsed||"circle"!==a.getKeyShape().get("type")||(d.width=Math.hypot(d.height,d.width),d.height=d.width,a.set("bbox",d),a.refresh());var x=a.getModel();(p||[]).forEach(function(t){var e=r.findById(t.id);a.addChild(e),t.depth=x.depth+2})}if(a)return a.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(t,"s")).push(a),r.get("itemMap")[a.get("id")]=a,r.emit("afteradditem",{item:a,model:e}),a},t.prototype.updateItem=function(t,e){var r,n,i=this,o=this.graph;if((0,Uw.isString)(t)&&(t=o.findById(t)),t&&!t.destroyed){var a="";t.getType&&(a=t.getType());var s=o.get(a+"Mapper"),u=t.getModel(),l=u.x,c=u.y,f=t.getUpdateType(e);if(s){var h=s((0,Uw.deepMix)({},u,e)),p=(0,Uw.deepMix)({},u,h,e);h.stateStyles&&(t.set("styles",p.stateStyles),delete p.stateStyles),(0,Uw.each)(p,function(t,r){e[r]=t})}else(0,Uw.each)(e,function(t,r){u[r]&&(0,Uw.isObject)(t)&&!(0,Uw.isArray)(t)&&(e[r]=(0,Gw.__assign)((0,Gw.__assign)({},u[r]),e[r]))});if(o.emit("beforeupdateitem",{item:t,cfg:e}),"edge"===a){if(e.source){var d=e.source;(0,Uw.isString)(d)&&(d=o.findById(d)),t.setSource(d)}if(e.target){var y=e.target;(0,Uw.isString)(y)&&(y=o.findById(y)),t.setTarget(y)}t.update(e)}else if("node"===a){t.update(e,f);var v=t.getEdges();"move"===f?(0,Uw.each)(v,function(t){i.edgeToBeUpdateMap[t.getID()]={edge:t,updateType:f},i.throttleRefresh()}):(null===f||void 0===f?void 0:f.includes("bbox"))&&(0,Uw.each)(v,function(t){t.refresh(f)})}else if("combo"===a){if(t.update(e,f),!isNaN(e.x)||!isNaN(e.y)){var g=e.x-l||0,m=e.y-c||0;this.updateComboSucceeds(u.id,g,m)}var b=t.getEdges();if(((null===f||void 0===f?void 0:f.includes("bbox"))||"move"===f)&&"combo"===a){var x=t.get("shapeFactory"),w=u.type||"circle";(void 0===u.animate||void 0===e.animate?null===(n=null===(r=x[w])||void 0===r?void 0:r.options)||void 0===n?void 0:n.animate:u.animate||e.animate)?setTimeout(function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(0,Uw.each)(b,function(t){t&&!t.destroyed&&t.refresh()})}},201):(0,Uw.each)(b,function(t){t.refresh()})}}t.setOptimize(o.getNodes().length>o.get("optimizeThreshold")),o.emit("afterupdateitem",{item:t,cfg:e})}},t.prototype.updateCombo=function(t,e,r){var n,i,o=this,a=this.graph;if((0,Uw.isString)(t)&&(t=a.findById(t)),t&&!t.destroyed){var s=t.getModel(),u=wE(e,a,t),l=u.x,c=u.y;t.set("bbox",u);var f=l,h=c;r?(f=isNaN(s.x)?l:s.x,h=isNaN(s.y)?c:s.y):(f=isNaN(l)?s.x:l,h=isNaN(c)?s.y:c),t.update({x:f,y:h});var p=t.get("shapeFactory"),d=s.type||"circle";(void 0===s.animate?null===(i=null===(n=p[d])||void 0===n?void 0:n.options)||void 0===i?void 0:i.animate:s.animate)?setTimeout(function(){if(t&&!t.destroyed){var e=t.getKeyShape();e&&!e.destroyed&&(t.getShapeCfg(s),o.updateComboEdges(t))}},201):this.updateComboEdges(t)}},t.prototype.updateComboEdges=function(t){for(var e,r,n=t.getEdges()||[],i=0;i-1&&o.splice(a,1),"edge"===i){var s=r.get("v".concat(i,"s")),u=s.indexOf(t);u>-1&&s.splice(u,1)}var l=t.get("id");delete r.get("itemMap")[l];var c=r.get("comboTrees"),f=t.get("id");if("node"===i){var h=t.getModel().comboId;if(c&&h){var p=c,d=!1;c.forEach(function(t){d||dE(t,function(t){if(t.id===f&&p){var e=p.indexOf(t);return p.splice(e,1),d=!0,!1}return p=t.children,!0})})}for(var y=(b=t.getEdges()).length-1;y>=0;y--)r.removeItem(b[y],!1);h&&r.updateCombo(h)}else if("combo"===i){var v,g=t.getModel().parentId,m=!1;(c||[]).forEach(function(t){m||dE(t,function(t){return t.id!==f||(v=t,m=!0,!1)})}),v.removed=!0,v&&v.children&&v.children.forEach(function(t){e.removeItem(t.id)});var b;for(y=(b=t.getEdges()).length;y>=0;y--)r.removeItem(b[y],!1);g&&r.updateCombo(g)}t.destroy(),r.emit("afterremoveitem",{item:n,type:i})}},t.prototype.setItemState=function(t,e,r){var n=this.graph,i=e;(0,Uw.isString)(r)&&(i="".concat(e,":").concat(r)),t.hasState(i)===r&&r||(0,Uw.isString)(r)&&t.hasState(i)||(n.emit("beforeitemstatechange",{item:t,state:i,enabled:r}),t.setState(e,r),n.autoPaint(),n.emit("afteritemstatechange",{item:t,state:i,enabled:r}))},t.prototype.priorityState=function(t,e){var r=this.graph,n=t;(0,Uw.isString)(t)&&(n=r.findById(t)),this.setItemState(n,e,!1),this.setItemState(n,e,!0)},t.prototype.clearItemStates=function(t,e){var r=this.graph;(0,Uw.isString)(t)&&(t=r.findById(t)),r.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),r.emit("afteritemstatesclear",{item:t,states:e})},t.prototype.refreshItem=function(t){var e=this.graph;(0,Uw.isString)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},t.prototype.addCombos=function(t,e){var r=this,n=this.graph;(t||[]).forEach(function(t){yE(t,function(t){var n;return e.forEach(function(e){e.id===t.id&&(e.children=t.children,e.depth=t.depth,n=e)}),n&&r.addItem("combo",n),!0})});var i=n.get("comboGroup");i&&i.sort()},t.prototype.changeItemVisibility=function(t,e){var r=this,n=this.graph;if((0,Uw.isString)(t)&&(t=n.findById(t)),t){if(n.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&"node"===t.getType()){var i=t.getEdges();(0,Uw.each)(i,function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&r.changeItemVisibility(t,e)})}else if(t.getType&&"combo"===t.getType()){var o=n.get("comboTrees"),a=t.get("id"),s=[],u=!1;(o||[]).forEach(function(t){u||t.children&&0!==t.children.length&&dE(t,function(t){return t.id!==a||(s=t.children,u=!0,!1)})}),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach(function(t){var i=n.findById(t.id);r.changeItemVisibility(i,e)});i=t.getEdges();(0,Uw.each)(i,function(t){(!e||t.get("source").isVisible()&&t.get("target").isVisible())&&r.changeItemVisibility(t,e)})}return n.emit("afteritemvisibilitychange",{item:t,visible:e}),t}console.warn("The item to be shown or hidden does not exist!")},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),rk=function(){function t(t){this.graph=t,this.destroyed=!1}return t.prototype.updateState=function(t,e,r){var n=this.graph.get("states"),i=e;(0,Uw.isString)(r)&&(i="".concat(e,":").concat(r)),n[i]||(n[i]=[]),r?n[i].push(t):n[i]=n[i].filter(function(e){return e!==t}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:n})},t.prototype.updateStates=function(t,e,r){var n=this.graph.get("states");((0,Uw.isString)(e)?[e]:e).forEach(function(e){var i=e;n[i]||(n[i]=[]),(0,Uw.isString)(r)&&(i="".concat(e,":").concat(r)),r?n[i].push(t):n[i]=n[i].filter(function(e){return e!==t})}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:e})},t.prototype.destroy=function(){this.graph=null,this.destroyed=!0},t}(),nk=r(3823),ik=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,function(t,r){if("\\"===t.charAt(0))return t.slice(1);var n=e[r];return 0===n&&(n="0"),n||""}):t},ok=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's ".concat(t.length));for(var r=0,n=t;r0?s-1:o-1,l=vS.normalize([0,0],vS.add([0,0],a[u].v,vS.scale([0,0],a[s].v,-1)));a[s].p=vS.add([0,0],a[s].p,vS.scale([0,0],l,e))}return a.map(function(t){var e=t.p;return{x:e[0],y:e[1]}})}var yk=function(t,e){for(var r=[],n=0;n<5;n++){var i=Math.cos((18+72*n)/180*Math.PI)*t,o=Math.sin((18+72*n)/180*Math.PI)*t,a=Math.cos((54+72*n)/180*Math.PI)*e,s=Math.sin((54+72*n)/180*Math.PI)*e;0===n?r.push(["M",i,-o]):r.push(["L",i,-o]),r.push(["L",a,-s])}return r.push(["Z"]),r},vk=function(t,e,r){return(t.y-r.y)*(e.x-r.x)-(t.x-r.x)*(e.y-r.y)},gk=function(t){var e=t.map(function(t){return{x:t.getModel().x,y:t.getModel().y}});e.sort(function(t,e){return t.x===e.x?t.y-e.y:t.x-e.x});for(var r={},n=e.length-1;n>=0;n--){var i=e[n],o=i.x,a=i.y;r["".concat(o,"-").concat(a)]&&e.splice(n,1),r["".concat(o,"-").concat(a)]=!0}if(1===e.length)return e;var s=[];for(n=0;n=2&&vk(s[s.length-2],s[s.length-1],e[n])<=0;)s.pop();s.push(e[n])}var u=[];for(n=e.length-1;n>=0;n--){for(;u.length>=2&&vk(u[u.length-2],u[u.length-1],e[n])<=0;)u.pop();u.push(e[n])}return u.pop(),s.pop(),s.concat(u)},mk={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function bk(t,e,r){var n=!1,i=function(t,r){return e.cells[t+r*e.width]},o=function(t,e){var n=0;return i(t-1,e-1)>=r&&(n+=1),i(t,e-1)>r&&(n+=2),i(t-1,e)>r&&(n+=4),i(t,e)>r&&(n+=8),n},a=function(r,n){for(var i,a,s=r,u=n,l=0;l-1){if(t[0].x===s&&t[0].y===u)return!0}else t.push({x:s,y:u});var c=o(s,u);switch(c){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:s++;break;case 12:case 14:case 4:s--;break;case 6:0===i&&(-1===a?s-=1:s+=1);break;case 1:case 13:case 5:u--;break;case 9:1===i&&(0===a?u-=1:u+=1);break;case 10:case 8:case 11:u++;break;default:return console.warn("Marching squares invalid state: ".concat(c)),!0}}};this.march=function(){for(var t=0;tr&&15!==o(t,s)&&(n=a(t,s));return n}}var xk=function(t,e,r){var n=null,i=Number.POSITIVE_INFINITY;return e.forEach(function(e){var o={x:t.getModel().x,y:t.getModel().y},a={x:e.getModel().x,y:e.getModel().y},s=qS(o,a),u=new zS(o.x,o.y,a.x,a.y),l=r.reduce(function(t,e){return HS(e,u)>0?t+1:t},0);s*Math.pow(l+1,2)=0&&i=1;)h=kk(r,c/=1.5,f,s),p=u(h,o)||u(h,i),d=l(h,e);!h||p||s&&d||(o.push(new zS(t.x1,t.y1,h.x,h.y)),o.push(new zS(h.x,h.y,t.x2,t.y2)),a=!0)};h(!0),a||h(!1)}}a||i.push(t),s+=1};!a&&o.length;)c()}for(;o.length;)i.push(o.pop());return i};var Sk=function(t,e,r){var n=Object.assign(mk,r),i=WS(t.map(function(t){return{x:t.getModel().x,y:t.getModel().y}})),o=[],a=[];(t=t.sort(function(t,e){return qS({x:t.getModel().x,y:t.getModel().y},i)-qS({x:e.getModel().x,y:e.getModel().y},i)})).forEach(function(t){(function(t,e,r,n,i){var o=xk(t,r,e);if(null===o)return[];var a=new zS(t.getModel().x,t.getModel().y,o.getModel().x,o.getModel().y);return function(t){for(var r=[];t.length>0;){var n=t.pop();if(0===t.length){r.push(n);break}var i=t.pop(),o=new zS(n.x1,n.y1,i.x2,i.y2);wk(e,o)?(r.push(n),t.push(i)):t.push(o)}return r}(_k(a,e,n,i))})(t,e,o,n.maxRoutingIterations,n.morphBuffer).forEach(function(t){a.push(t)}),o.push(t)});for(var s,u,l,c,f,h=function(t,e,r){var n={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},i=[];t.forEach(function(t){i.push(t.getBBox())}),e.forEach(function(t){i.push(t.getBBox())});for(var o=0,a=i;on.maxX?s.maxX:n.maxX)+r,n.maxY=(s.maxY>n.maxY?s.maxY:n.maxY)+r}return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.x=n.minX,n.y=n.minY,n}(t,a,n.nodeR0),p=(s=h.width,u=h.height,l=n.pixelGroupSize,c=Math.ceil(s/l),f=Math.ceil(u/l),{cells:new Float32Array(Math.max(0,c*f)).fill(0),width:c,height:f}),d=[],y=[],v=0;v1)for(m=Math.floor(g.length/n.skip);m<3&&n.skip>1;)n.skip-=1,m=Math.floor(g.length/n.skip);for(var b=0,x=0;x0))break;n.nonMemberInfluenceFactor*=.8}}return y};function Ek(t,e,r,n,i,o){function a(t,e){var r=Math.floor((t-e)/o.pixelGroupSize);return r<0?0:r}function s(t,e){return t*o.pixelGroupSize+e}var u=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),l=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1),c=function(t,e){return[Math.min(a(t.minX,e+n.minX),i.width),Math.min(a(t.minY,e+n.minY),i.height),Math.min(a(t.maxX,-e+n.minX),i.width),Math.min(a(t.maxY,-e+n.minY),i.height)]},f=function(t,e){for(var r=t.getBBox(),a=c(r,o.nodeR1),u=a[0],l=a[1],f=a[2],h=a[3],p=l;pu.y?n?l.topLeft:l.bottomRight:n?l.topRight:l.bottomLeft:a.ys.x?n?l.topLeft:l.bottomRight:n?l.bottomLeft:l.topRight:o.x0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},t.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),"round-convex"!==this.type&&"smooth-convex"!==this.type&&"bubble"!==this.type&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},t.prototype.calcPath=function(t,e){var r,n,i;switch(this.type){case"round-convex":i=pk((r=gk(t)).map(function(t){return[t.x,t.y]}),this.padding),n=(0,nk.EA)(i);break;case"smooth-convex":2===(r=gk(t)).length?(i=pk(r.map(function(t){return[t.x,t.y]}),this.padding),n=(0,nk.EA)(i)):r.length>2&&(i=dk(r.map(function(t){return[t.x,t.y]}),this.padding),n=lk(i));break;case"bubble":n=(r=Sk(t,e,this.cfg.bubbleCfg)).length>=2&&lk(r)}return n},t.prototype.render=function(){this.group.addShape("path",{attrs:(0,Gw.__assign)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},t.prototype.addMember=function(t){if(t){(0,Uw.isString)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.addNonMember=function(t){if(t){(0,Uw.isString)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},t.prototype.removeMember=function(t){if(t){(0,Uw.isString)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1&&(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.removeNonMember=function(t){if(t){(0,Uw.isString)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1&&(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0)}},t.prototype.updateData=function(t,e){var r=this;this.group.findById(this.id).remove(),t&&(this.members=t.map(function(t){return(0,Uw.isString)(t)?r.graph.findById(t):t})),e&&(this.nonMembers=e.map(function(t){return(0,Uw.isString)(t)?r.graph.findById(t):t})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.updateStyle=function(t){this.group.findById(this.id).attr((0,Gw.__assign)({},t))},t.prototype.updateCfg=function(t){var e=this;this.cfg=(0,Uw.deepMix)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map(function(t){return(0,Uw.isString)(t)?e.graph.findById(t):t})),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(t){return(0,Uw.isString)(t)?e.graph.findById(t):t})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},t.prototype.contain=function(t){var e,r,n=this,i=(e=(0,Uw.isString)(t)?this.graph.findById(t):t).getKeyShape();if("path"===e.get("type"))r=uk(i.attr("path"));else{var o=i.getCanvasBBox();r=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return r=r.map(function(t){var e=n.graph.getPointByCanvas(t[0],t[1]);return[e.x,e.y]}),FS(r,uk(this.path))},t.prototype.destroy=function(){this.group.remove(),this.cfg=null},t}(),Ck=Yw.pd,Ok=function(t){function e(e){var r=t.call(this)||this;return r.sortCombos=(0,Uw.debounce)(function(){var t=r.get("comboSorted");if(r&&!r.destroyed&&!t){r.set("comboSorted",!0);var e=[],n={};(r.get("comboTrees")||[]).forEach(function(t){dE(t,function(t){return e[t.depth]?e[t.depth].push(t.id):e[t.depth]=[t.id],n[t.id]=t.depth,!0})}),(r.getEdges().concat(r.get("vedges"))||[]).forEach(function(t){var r=t.getModel(),i=n[r.source]||0,o=n[r.target]||0,a=Math.max(i,o);e[a]?e[a].push(r.id):e[a]=[r.id]}),e.forEach(function(t){if(t&&t.length)for(var e=t.length-1;e>=0;e--){var n=r.findById(t[e]);n&&n.toFront()}})}},500,!1),r.cfg=(0,Uw.deepMix)(r.getDefaultCfg(),e),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new fS(r.cfg.maxStep),r.redoStack=new fS(r.cfg.maxStep)),r}return(0,Gw.__extends)(e,t),e.prototype.init=function(){this.initCanvas();var t=new DE(this),e=new TE(this),r=new ek(this),n=new rk(this);this.set({viewController:t,modeController:e,itemController:r,stateController:n}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(t){var e=(t.get("el")||{}).id,r=void 0===e?"g6":e,n=t.addGroup({id:"".concat(r,"-root"),className:iE.rootContainerClassName});if(this.get("groupByTypes")){var i=n.addGroup({id:"".concat(r,"-edge"),className:iE.edgeContainerClassName}),o=n.addGroup({id:"".concat(r,"-node"),className:iE.nodeContainerClassName}),a=n.addGroup({id:"".concat(r,"-combo"),className:iE.comboContainerClassName});a.toBack(),this.set({nodeGroup:o,edgeGroup:i,comboGroup:a})}var s=n.addGroup({id:"".concat(r,"-delegate"),className:iE.delegateContainerClassName});this.set({delegateGroup:s}),this.set("group",n)}},e.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[],optimizeThreshold:1e3}},e.prototype.set=function(t,e){return(0,Uw.isPlainObject)(t)?this.cfg=(0,Gw.__assign)((0,Gw.__assign)({},this.cfg),t):this.cfg[t]=e,"enabledStack"!==t||!e||this.undoStack||this.redoStack||(this.undoStack=new fS(this.cfg.maxStep),this.redoStack=new fS(this.cfg.maxStep)),this},e.prototype.get=function(t){var e;return null===(e=this.cfg)||void 0===e?void 0:e[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,e){(0,Uw.isString)(t)&&(t=this.findById(t));var r=this.get("itemController");e||(e=t.get("states")),r.clearItemStates(t,e),this.get("stateController").updateStates(t,e,!1)},e.prototype.node=function(t){"function"==typeof t&&this.set("nodeMapper",t)},e.prototype.edge=function(t){"function"==typeof t&&this.set("edgeMapper",t)},e.prototype.combo=function(t){"function"==typeof t&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,e){var r,n=this.get("".concat(t,"s"));return(0,Uw.each)(n,function(t,n){if(e(t,n))return r=t}),r},e.prototype.findAll=function(t,e){var r=[];return(0,Uw.each)(this.get("".concat(t,"s")),function(t,n){e(t,n)&&r.push(t)}),r},e.prototype.findAllByState=function(t,e,r){return r?this.findAll(t,function(t){return t.hasState(e)&&r(t)}):this.findAll(t,function(t){return t.hasState(e)})},e.prototype.translate=function(t,e,r,n){var i=this,o=this.get("group"),a=(0,Uw.clone)(o.getMatrix());if(a||(a=[1,0,0,0,1,0,0,0,1]),r){var s=EE({animateCfg:n,callback:function(){return i.emit("viewportchange",{action:"translate",matrix:o.getMatrix()})}});IS(o,{x:o.getCanvasBBox().x+t,y:o.getCanvasBBox().y+e},r,s||{duration:500,easing:"easeCubic"})}else a=Ck(a,[["t",t,e]]),o.setMatrix(a),this.emit("viewportchange",{action:"translate",matrix:a}),this.autoPaint()},e.prototype.moveTo=function(t,e,r,n){var i=this.get("group");IS(i,{x:t,y:e},r,n||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},e.prototype.fitView=function(t,e,r,n){t&&this.set("fitViewPadding",t);var i=this.get("viewController");e?i.fitViewByRules(e,r,n):i.fitView(r,n),this.autoPaint()},e.prototype.fitCenter=function(t,e){this.get("viewController").fitCenter(t,e),this.autoPaint()},e.prototype.addBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!0),this},e.prototype.removeBehaviors=function(t,e){return this.get("modeController").manipulateBehaviors(t,e,!1),this},e.prototype.updateBehavior=function(t,e,r){return this.get("modeController").updateBehavior(t,e,r),this},e.prototype.zoom=function(t,e,r,n){var i=this,o=this.get("group"),a=(0,Uw.clone)(o.getMatrix())||[1,0,0,0,1,0,0,0,1],s=this.get("minZoom"),u=this.get("maxZoom"),l=this.getZoom()||1,c=l*t,f=t,h=!1;if(s&&cu&&(f=u/l,h=!0),a=Ck(a,e?[["t",-e.x,-e.y],["s",f,f],["t",e.x,e.y]]:[["s",f,f]]),r){var p=(0,Uw.clone)(o.getMatrix());p||(p=[1,0,0,0,1,0,0,0,1]);var d=p[0],y=d*f,v=EE({animateCfg:n,callback:function(){return i.emit("viewportchange",{action:"zoom",matrix:o.getMatrix()})}});o.animate(function(t){if(1===t)p=a;else{var r=JS(d,y,t)/p[0];p=Ck(p,e?[["t",-e.x,-e.y],["s",r,r],["t",e.x,e.y]]:[["s",r,r]])}return{matrix:p}},v)}else o.setMatrix(a),this.emit("viewportchange",{action:"zoom",matrix:a}),this.autoPaint();return!h},e.prototype.zoomTo=function(t,e,r,n){var i=t/this.getZoom();return this.zoom(i,e,r,n)},e.prototype.focusItem=function(t,e,r){var n=this.get("viewController"),i=!1;e?i=!0:void 0===e&&(i=this.get("animate"));var o={};r?o=r:void 0===r&&(o=this.get("animateCfg")),n.focus(t,i,o),this.autoPaint()},e.prototype.focusItems=function(t,e,r,n){this.get("viewController").focusItems(t,e,r,n)},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,e){return this.get("viewController").getPointByClient(t,e)},e.prototype.getClientByPoint=function(t,e){return this.get("viewController").getClientByPoint(t,e)},e.prototype.getPointByCanvas=function(t,e){return this.get("viewController").getPointByCanvas(t,e)},e.prototype.getCanvasByPoint=function(t,e){return this.get("viewController").getCanvasByPoint(t,e)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,e){void 0===e&&(e=!0);var r=this.get("itemController").changeItemVisibility(t,!0);if(e&&this.get("enabledStack")){var n=r.getID(),i={},o={};switch(r.getType()){case"node":i.nodes=[{id:n,visible:!1}],o.nodes=[{id:n,visible:!0}];break;case"edge":i.nodes=[{id:n,visible:!1}],o.edges=[{id:n,visible:!0}];break;case"combo":i.nodes=[{id:n,visible:!1}],o.combos=[{id:n,visible:!0}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.hideItem=function(t,e){void 0===e&&(e=!0);var r=this.get("itemController").changeItemVisibility(t,!1);if(e&&this.get("enabledStack")){var n=r.getID(),i={},o={};switch(r.getType()){case"node":i.nodes=[{id:n,visible:!0}],o.nodes=[{id:n,visible:!1}];break;case"edge":i.nodes=[{id:n,visible:!0}],o.edges=[{id:n,visible:!1}];break;case"combo":i.nodes=[{id:n,visible:!0}],o.combos=[{id:n,visible:!1}]}this.pushStack("visible",{before:i,after:o})}},e.prototype.refreshItem=function(t){this.get("itemController").refreshItem(t)},e.prototype.setAutoPaint=function(t){this.set("autoPaint",t),this.get("canvas").set("autoDraw",t)},e.prototype.remove=function(t,e){void 0===e&&(e=!0),this.removeItem(t,e)},e.prototype.removeItem=function(t,e){void 0===e&&(e=!0);var r=t;if((0,Uw.isString)(t)&&(r=this.findById(t)),!r&&(0,Uw.isString)(t))console.warn("The item ".concat(t," to be removed does not exist!"));else if(r){var n="";if(r.getType&&(n=r.getType()),e&&this.get("enabledStack")){var i=(0,Gw.__assign)((0,Gw.__assign)({},r.getModel()),{itemType:n}),o={};switch(n){case"node":o.nodes=[i],o.edges=[];for(var a=r.getEdges(),s=a.length-1;s>=0;s--)o.edges.push((0,Gw.__assign)((0,Gw.__assign)({},a[s].getModel()),{itemType:"edge"}));break;case"edge":o.edges=[i];break;case"combo":o.combos=[i]}this.pushStack("delete",{before:o,after:{}})}if("node"===n)r.getModel().comboId&&this.updateComboTree(r,void 0,!1);if(this.get("itemController").removeItem(r),"combo"===n){var u=xE(this.get("comboTrees"));this.set("comboTrees",u)}}},e.prototype.innerAddItem=function(t,e,r){if(!function(t,e){if("node"===t||"combo"===t){if(e.id&&!(0,Uw.isString)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(!("edge"!==t||e.source&&e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0}(t,e))return!1;if(!e.id||!this.findById(e.id)){var n,i=this.get("comboTrees")||[];if("combo"===t){var o=this.get("itemMap"),a=!1;if(i.forEach(function(i){a||yE(i,function(i){if(e.parentId===i.id){a=!0;var s=(0,Gw.__assign)({id:e.id,depth:i.depth+2},e);i.children?i.children.push(s):i.children=[s],e.depth=s.depth,n=r.addItem(t,e)}var u=o[i.id];return a&&u&&u.getType&&"combo"===u.getType()&&r.updateCombo(u,i.children),!0})}),!a){var s=(0,Gw.__assign)({id:e.id,depth:0},e);e.depth=s.depth,i.push(s),n=r.addItem(t,e)}this.set("comboTrees",i),e.collapsed&&(this.collapseCombo(n,!1),this.updateCombo(n))}else if("node"===t&&(0,Uw.isString)(e.comboId)&&i){var u;(u=this.findById(e.comboId))&&u.getType&&"combo"!==u.getType()&&console.warn("'".concat(e.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),n=r.addItem(t,e);var l=this.get("itemMap"),c=!1,f=!1;i.forEach(function(t){f||c||yE(t,function(t){if(t.id===e.id)return f=!0,!1;if(e.comboId===t.id&&!f){c=!0;var n=(0,Uw.clone)(e);n.itemType="node",t.children?t.children.push(n):t.children=[n],n.depth=t.depth+1}return c&&l[t.id].getType&&"combo"===l[t.id].getType()&&r.updateCombo(l[t.id],t.children),!0})})}else n=r.addItem(t,e);if("node"===t&&e.comboId||"combo"===t&&e.parentId)(u=this.findById(e.comboId||e.parentId))&&u.getType&&"combo"===u.getType()&&u.addChild(n);return n}console.warn("This item exists already. Be sure the id %c".concat(e.id,"%c is unique."),"font-size: 20px; color: red;","")},e.prototype.addItem=function(t,e,r,n){void 0===r&&(r=!0),void 0===n&&(n=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!n);var o=this.get("itemController"),a=this.innerAddItem(t,e,o);if(!1===a||!0===a)return a;var s=this.get("combos");if(s&&s.length>0&&this.sortCombos(),this.autoPaint(),r&&this.get("enabledStack")){var u=(0,Gw.__assign)((0,Gw.__assign)({},a.getModel()),{itemType:t}),l={};switch(t){case"node":l.nodes=[u];break;case"edge":l.edges=[u];break;case"combo":l.combos=[u]}this.pushStack("add",{before:{},after:l})}return a},e.prototype.addItems=function(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=!0),void 0===r&&(r=!0);var n=this.get("comboSorted");this.set("comboSorted",n&&!r);for(var i=this.get("itemController"),o=[],a=0;a0&&this.sortCombos()}if(this.autoPaint(),e&&this.get("enabledStack")){var l={nodes:[],edges:[],combos:[]};for(a=0;a=0;p--)h[p].destroyed&&h.splice(p,1);c&&(i.addCombos(c),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",l,o.edges),(0,Uw.each)(u,function(t,e){(!t.getType||"node"!==t.getType()&&"combo"!==t.getType())&&l.edges.indexOf(t)<0&&(delete u[e],i.remove(t,!1))}),(this.get("comboTrees")||[]).forEach(function(t){yE(t,function(t){return"combo"===n.findById(t.id).getType()&&t.collapsed&&n.collapseCombo(t.id,!1),!0})}),this.set({nodes:l.nodes,edges:l.edges});var d=(this.get("layout")||{}).relayoutAtChangeData,y=void 0===d||d,v=this.get("layoutController");return y&&v&&(v.changeData(function(){setTimeout(function(){var t;null===(t=i.getCombos())||void 0===t||t.forEach(function(t){t.set("animate",!0)})},0)}),i.get("animate")&&!v.getLayoutType()?(i.positionsAnimate(),null===(r=i.getCombos())||void 0===r||r.forEach(function(t){return t.set("animate",!0)})):i.autoPaint()),setTimeout(function(){a.set("localRefresh",s)},16),this.set("data",o),this.emit("afterchangedata"),this},e.prototype.addCombos=function(t){var e=this.get("comboTrees");this.get("itemController").addCombos(e,t)},e.prototype.createCombo=function(t,e,r){var n=this;void 0===r&&(r=!0);var i=this.get("itemController");this.set("comboSorted",!1);var o,a="";if(t){if((0,Uw.isString)(t))a=t,o={id:t};else{if(!(a=t.id))return void console.warn("Create combo failed. Please assign a unique string id for the adding combo.");o=t}var s=r&&this.get("enabledStack"),u={nodes:[],combos:[]};s&&e.forEach(function(t){var e=n.findById(t),r=e.getType();if("node"===r||"combo"===r){var i=e.getModel();u["".concat(r,"s")].push({id:t,parentId:"node"===r?i.comboId:i.parentId})}});var l=this.get("comboTrees"),c=new Set(e),f=new Map;l&&(l.forEach(function(t){yE(t,function(t,e,r){if(c.has(t.id)){if(e){var o=n.findById(e.id),a=n.findById(t.id);e.children.splice(r,1),o.removeChild(a),i.updateCombo(o,e.children)}"combo"===t.itemType&&f.set(t.id,t)}return!0})}),l=l.filter(function(t){return!c.has(t.id)}),this.set("comboTrees",l));var h={nodes:[],combos:[]},p=e.map(function(t){var e=n.findById(t),r=e.getModel(),i="";e.getType&&(i=e.getType());var o=f.get(t)||{id:e.getID(),itemType:i};return"combo"===i?(o.parentId=a,r.parentId=a):"node"===i&&(o.comboId=a,r.comboId=a),s&&h["".concat(i,"s")].push({id:r.id,parentId:a}),o});o.children=p,this.addItem("combo",o,!1),this.set("comboSorted",!1),l&&(l.forEach(function(t){dE(t,function(t){return t.id!==a||(t.itemType="combo",t.children=p,!1)})}),this.sortCombos()),s&&(h.combos.push(o),this.pushStack("createCombo",{before:u,after:h}));var d=this.findById(a);!d.getModel().parentId&&d.getChildren().combos.length&&this.updateComboTree(d,void 0,!1),setTimeout(function(){d.set("animate",!0)},0)}},e.prototype.uncombo=function(t,e){var r,n,i=this;void 0===e&&(e=!0);var o=t;if((0,Uw.isString)(t)&&(o=this.findById(t)),!o||o.getType&&"combo"!==o.getType())console.warn("The item is not a combo!");else{var a=o.getModel(),s=o.getModel().parentId,u=this.get("comboTrees");u||(u=[]);var l,c=this.get("itemMap"),f=o.get("id"),h=[],p=this.get("combos"),d=this.findById(s),y=e&&this.get("enabledStack"),v={};if(y&&((v=(0,Uw.clone)(a)).children=[]),u.forEach(function(t){l||yE(t,function(t){var e;if(t.id===f){l=t,o.getEdges().map(function(t){return t.getID()}).forEach(function(t){i.removeItem(t,!1)});var r=p.indexOf(o);p.splice(r,1),delete c[f];var n=(0,Uw.clone)(o.getModel());o.destroy(),i.emit("afterremoveitem",{item:n,type:"combo"})}return!s||!l||t.id!==s||(d.removeCombo(o),-1!==(r=(h=t.children).indexOf(l))&&h.splice(r,1),null===(e=l.children)||void 0===e||e.forEach(function(t){var e=i.findById(t.id),r=e.getModel();e.getType&&"combo"===e.getType()?(t.parentId=s,delete t.comboId,r.parentId=s,delete r.comboId):e.getType&&"node"===e.getType()&&(t.comboId=s,r.comboId=s),d.addChild(e),h.push(t)}),i.updateCombo(d),!1)})}),!s&&l){var g=u.indexOf(l);u.splice(g,1),null===(r=l.children)||void 0===r||r.forEach(function(t){t.parentId=void 0;var e=i.findById(t.id).getModel();delete e.parentId,delete e.comboId,"node"!==t.itemType&&u.push(t)})}if(y){var m={nodes:[],combos:[]},b={nodes:[],combos:[]};null===(n=l.children)||void 0===n||n.forEach(function(t){var e=i.findById(t.id).getType();"node"!==e&&"combo"!==e||(m["".concat(e,"s")].push({id:t.id,parentId:f}),b["".concat(e,"s")].push({id:t.id,parentId:s}))}),m.combos.push(v),this.pushStack("uncombo",{before:m,after:b})}}},e.prototype.updateCombos=function(t){var e=this;void 0===t&&(t=!1);var r=this.get("comboTrees"),n=this.get("itemController"),i=this.get("itemMap");(r||[]).forEach(function(r){yE(r,function(r){var o;if(!r)return!0;var a=i[r.id];if("combo"===(null===(o=null===a||void 0===a?void 0:a.getType)||void 0===o?void 0:o.call(a))){var s=(0,Gw.__spreadArray)([],a.getStates(),!0);(0,Uw.each)(s,function(t){return e.setItemState(a,t,!1)}),n.updateCombo(a,r.children,t),(0,Uw.each)(s,function(t){return e.setItemState(a,t,!0)})}return!0})}),this.sortCombos()},e.prototype.updateCombo=function(t){var e,r=this,n=t;if((0,Uw.isString)(t)&&(n=this.findById(t)),!n||n.getType&&"combo"!==n.getType())console.warn("The item to be updated is not a combo!");else{e=n.get("id");var i=this.get("comboTrees"),o=this.get("itemController"),a=this.get("itemMap");(i||[]).forEach(function(t){yE(t,function(t){if(!t)return!0;var n=a[t.id];if(e===t.id&&n&&n.getType&&"combo"===n.getType()){var i=(0,Gw.__spreadArray)([],n.getStates(),!0);(0,Uw.each)(i,function(t){n.getStateStyle(t)&&r.setItemState(n,t,!1)}),o.updateCombo(n,t.children),(0,Uw.each)(i,function(t){n.getStateStyle(t)&&r.setItemState(n,t,!0)}),e&&(e=t.parentId)}return!0})})}},e.prototype.updateComboTree=function(t,e,r){void 0===r&&(r=!0);var n;this.set("comboSorted",!1);var i,o=(n=(0,Uw.isString)(t)?this.findById(t):t).getModel(),a=o.comboId||o.parentId,s="";if(n.getType&&(s=n.getType()),e&&"combo"===s){var u,l=!0;if((this.get("comboTrees")||[]).forEach(function(t){u||dE(t,function(t){if(!u)return t.id===n.getID()&&(u=t),!0})}),dE(u,function(t){return t.id!==e||(l=!1,!1)}),!l)return void console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!")}if(r&&this.get("enabledStack")){var c={},f={};"combo"===s?(c.combos=[{id:o.id,parentId:o.parentId}],f.combos=[{id:o.id,parentId:e}]):"node"===s&&(c.nodes=[{id:o.id,parentId:o.comboId}],f.nodes=[{id:o.id,parentId:e}]),this.pushStack("updateComboTree",{before:c,after:f})}if(o.parentId||o.comboId){var h=this.findById(o.parentId||o.comboId);h&&h.removeChild(n)}("combo"===s?o.parentId=e:"node"===s&&(o.comboId=e),e)&&((i=this.findById(e))&&i.addChild(n));a&&((i=this.findById(a))&&i.removeChild(n));var p=xE(this.get("comboTrees"),o.id,e);this.set("comboTrees",p),this.updateCombos()},e.prototype.save=function(){var t=[],e=[],r=[];return(0,Uw.each)(this.get("nodes"),function(e){t.push(e.getModel())}),(0,Uw.each)(this.get("edges"),function(t){e.push(t.getModel())}),(0,Uw.each)(this.get("combos"),function(t){r.push(t.getModel())}),{nodes:t,edges:e,combos:r}},e.prototype.changeSize=function(t,e){return this.get("viewController").changeSize(t,e),this},e.prototype.refresh=function(){if(this.emit("beforegraphrefresh"),this.get("animate"))this.positionsAnimate();else{var t=this.get("nodes"),e=this.get("edges"),r=this.get("edges");(0,Uw.each)(t,function(t){t.refresh()}),(0,Uw.each)(e,function(t){t.refresh()}),(0,Uw.each)(r,function(t){t.refresh()})}this.emit("aftergraphrefresh"),this.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if((0,Uw.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType()))return t.getChildren();console.warn("The combo does not exist!")},e.prototype.positionsAnimate=function(t){var e=this;e.emit("beforeanimate");var r=e.get("animateCfg"),n=r.onFrame,i=t?e.getNodes().concat(e.getCombos()):e.getNodes(),o=i.map(function(t){var e=t.getModel();return{id:e.id,x:e.x,y:e.y}});e.stopAnimate();var a=e.get("canvas");e.animating=!0,setTimeout(function(){a.animate(function(r){(0,Uw.each)(o,function(t){var i=e.findById(t.id);if(i&&!i.destroyed){var o=i.get("originAttrs"),a=i.get("model"),s=i.getContainer().getMatrix();if(void 0!==o&&null!==o||(s&&(o={x:s[6],y:s[7]}),i.set("originAttrs",o||0)),n){var u=n(i,r,t,o||{x:0,y:0});i.set("model",Object.assign(a,u))}else o?(a.x=o.x+(t.x-o.x)*r,a.y=o.y+(t.y-o.y)*r):(a.x=t.x,a.y=t.y)}}),e.refreshPositions(t)},{duration:r.duration,easing:r.easing,callback:function(){(0,Uw.each)(i,function(t){t.set("originAttrs",null)}),r.callback&&r.callback(),e.emit("afteranimate"),e.animating=!1}})},0)},e.prototype.refreshPositions=function(t){this.emit("beforegraphrefreshposition");var e,r=this.get("nodes"),n=this.get("edges"),i=this.get("vedges"),o=this.get("combos"),a={},s=function(t){(0,Uw.each)(t,function(t){e=t.getModel();var r=t.get("originAttrs");if(!r||e.x!==r.x||e.y!==r.y){var n=t.updatePosition({x:e.x,y:e.y});a[e.id]=n,e.comboId&&(a[e.comboId]=a[e.comboId]||n),e.parentId&&(a[e.parentId]=a[e.parentId]||n)}})};s(o),s(r),o&&0!==o.length&&(t?(s(o),this.updateCombos()):this.updateCombos()),(0,Uw.each)(n,function(t){var e=t.getSource().getModel(),r=t.getTarget();if(!(0,Uw.isPlainObject)(r)){var n=r.getModel();(a[e.id]||a[n.id]||t.getModel().isComboEdge)&&t.refresh()}}),(0,Uw.each)(i,function(t){t.refresh()}),this.emit("aftergraphrefreshposition"),this.autoPaint()},e.prototype.stopAnimate=function(){var t=this.get("canvas").cfg.timeline;t&&t.stopAllAnimations()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){return this.get("modeController").getMode()},e.prototype.setMode=function(t){return this.get("modeController").setMode(t),this},e.prototype.clear=function(t){var e;return void 0===t&&(t=!1),null===(e=this.get("canvas"))||void 0===e||e.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,e,r,n){var i=this;void 0===t&&(t={}),void 0===n&&(n=!0);var o=this.get("layoutController");if((0,Uw.isString)(t)&&(t={type:t}),e){var a=r;a||(a="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),a=this.getPointByCanvas(a.x,a.y);var s=["force","gForce","fruchterman","force2"];s.includes(t.type)||!t.type&&s.includes(null===o||void 0===o?void 0:o.layoutType)?t.center=[a.x,a.y]:this.once("afterlayout",function(t){var r=i.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];a.x=a.x*r[0]+r[6],a.y=a.y*r[0]+r[7];var n=i.getGroup().getCanvasBBox(),o=n.minX,s=n.maxX,u=n.minY,l={x:(o+s)/2,y:(u+n.maxY)/2};"begin"===e&&(l.x=o,l.y=u),i.translate(a.x-l.x,a.y-l.y)})}var u=(0,Gw.__assign)({},this.get("layout")),l={};Object.assign(l,u,t),t.pipes&&!t.type?delete l.type:!t.pipes&&l.type&&delete l.pipes,this.set("layout",l),o&&(o.isLayoutTypeSame(l)&&l.gpuEnabled===u.gpuEnabled?o.updateLayoutCfg(l):o.changeLayout(l),n&&this.get("enabledStack")&&this.pushStack("layout",{before:u,after:l}))},e.prototype.destroyLayout=function(){var t=this.get("layoutController");null===t||void 0===t||t.destroyLayout()},e.prototype.layout=function(){var t,e=this.get("layoutController"),r=this.get("layout");r&&e&&(r.workerEnabled?e.layout():(null===(t=e.layoutMethods)||void 0===t?void 0:t.length)?e.relayout(!0):e.layout())},e.prototype.collapseCombo=function(t,e){var r=this;if(void 0===e&&(e=!0),!this.destroyed)if((0,Uw.isString)(t)&&(t=this.findById(t)),t){this.emit("beforecollapseexpandcombo",{action:"collapse",item:t});var n=t.getModel();this.get("itemController").collapseCombo(t,e),n.collapsed=!0;var i=this.getEdges().concat(this.get("vedges")),o=[],a=!1;(this.get("comboTrees")||[]).forEach(function(t){a||dE(t,function(t){if(a&&t.depth<=n.depth)return!1;if(n.id===t.id&&(a=!0),a){var e=r.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0})});var s={};i.forEach(function(t){var e=t.getModel(),i=e.isVEdge,a=e.size,u=void 0===a?1:a;if(!t.isVisible()||i){var l,c=t.getSource(),f=t.getTarget(),h=null;if(c.getModel().id===n.id||o.includes(c)&&!o.includes(f)?(h=f,l=!1):(f.getModel().id===n.id||!o.includes(c)&&o.includes(f))&&(h=c,l=!0),h){if(i)return void r.removeItem(t,!1);for(var p=h.getModel();!h.isVisible();){var d=p.parentId,y=p.comboId,v=d||y;if(!(h=r.findById(v))||!v)return;p=h.getModel()}var g=p.id,m=l?{source:g,target:n.id,size:u,isVEdge:!0}:{source:n.id,target:g,size:u,isVEdge:!0},b="".concat(m.source,"-").concat(m.target);if(s[b])return void(s[b].size+=u);s[b]=m}}}),this.addItems(Object.values(s).map(function(t){return{type:"vedge",model:t}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}else console.warn("The combo to be collapsed does not exist!")},e.prototype.expandCombo=function(t,e){var r=this;if(void 0===e&&(e=!0),(0,Uw.isString)(t)&&(t=this.findById(t)),!t||t.getType&&"combo"!==t.getType())console.warn("The combo to be collapsed does not exist!");else{this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var n=t.getModel();this.get("itemController").expandCombo(t,e),n.collapsed=!1;var i=this.getEdges().concat(this.get("vedges")),o=[],a=!1;(this.get("comboTrees")||[]).forEach(function(t){a||dE(t,function(t){if(a&&t.depth<=n.depth)return!1;if(n.id===t.id&&(a=!0),a){var e=r.findById(t.id);e&&e.getType&&"combo"===e.getType()&&(o=(o=o.concat(e.getNodes())).concat(e.getCombos()))}return!0})});var s={};i.forEach(function(t){if(!t.isVisible()||t.getModel().isVEdge){var e,i=t.getSource(),a=t.getTarget(),u=i.get("id"),l=a.get("id"),c=null;if(u===n.id||o.includes(i)&&!o.includes(a)?(c=a,e=!1):l===n.id||!o.includes(i)&&o.includes(a)?(c=i,e=!0):o.includes(i)&&o.includes(a)&&i.isVisible()&&a.isVisible()&&t.show(),c){var f=t.getModel(),h=f.isVEdge,p=f.size,d=void 0===p?1:p;if(h)return void r.removeItem(t,!1);for(var y=c.getModel();!c.isVisible();){var v=y.parentId,g=y.comboId,m=v||g;if(!(c=r.findById(m))||!m)return;y=c.getModel()}for(var b=y.id,x=e?a:i,w=x.getModel();!x.isVisible();){var _=w.parentId,S=w.comboId,E=_||S;if(!(x=r.findById(E))||!E)return;if(w.comboId===n.id||w.parentId===n.id)break;w=x.getModel()}var k=w.id;if(b){var T=e?{source:b,target:k,isVEdge:!0,size:d}:{source:k,target:b,isVEdge:!0,size:d},C="".concat(T.source,"-").concat(T.target);if(s[C])return void(s[C].size+=d);s[C]=T}}}}),this.addItems(Object.values(s).map(function(t){return{type:"vedge",model:t}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})}},e.prototype.collapseExpandCombo=function(t,e){if(void 0===e&&(e=!0),(0,Uw.isString)(t)&&(t=this.findById(t)),t&&(!t.getType||"combo"===t.getType())){for(var r=t.getModel(),n=this.findById(r.parentId);n;){var i=n.getModel();if(i.collapsed)return console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),void(n=void 0);n=this.findById(i.parentId)}r.collapsed?this.expandCombo(t,e):this.collapseCombo(t,e),this.updateCombo(t)}},e.prototype.getNeighbors=function(t,e){var r=t;return(0,Uw.isString)(t)&&(r=this.findById(t)),r.getNeighbors(e)},e.prototype.getNodeDegree=function(t,e,r){void 0===e&&(e=void 0),void 0===r&&(r=!1);var n=t;(0,Uw.isString)(t)&&(n=this.findById(t));var i=this.get("degrees");i&&!r||(i=s_(this.save()),this.set("degrees",i));var o=i[n.getID()],a=0;if(!o)return 0;switch(e){case"in":a=o.inDegree;break;case"out":a=o.outDegree;break;case"all":a=o;break;default:a=o.degree}return a},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},e.prototype.pushStack=function(t,e,r){if(void 0===t&&(t="update"),void 0===r&&(r="undo"),this.get("enabledStack")){var n=e?(0,Uw.clone)(e):{before:{},after:(0,Uw.clone)(this.save())};"redo"===r?this.redoStack.push({action:t,data:n}):this.undoStack.push({action:t,data:n}),this.emit("stackchange",{action:t,stackType:r,undoStack:this.undoStack,redoStack:this.redoStack})}else console.warn("请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !")},e.prototype.getAdjMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var r=this.get("adjMatrix");return r&&t||(r=Xw(this.save(),e),this.set("adjMatrix",r)),r},e.prototype.getShortestPathMatrix=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=this.get("directed"));var r=this.get("adjMatrix"),n=this.get("shortestPathMatrix");return r&&t||(r=Xw(this.save(),e),this.set("adjMatrix",r)),n&&t||(n=x_(this.save(),e),this.set("shortestPathMatrix",n)),n},e.prototype.on=function(e,r,n){return t.prototype.on.call(this,e,r,n)},e.prototype.destroy=function(){var t,e,r,n,i;this.emit("beforedestroy"),this.clear(),this.clearStack(),null===(t=this.get("itemController"))||void 0===t||t.destroy(),null===(e=this.get("modeController"))||void 0===e||e.destroy(),null===(r=this.get("viewController"))||void 0===r||r.destroy(),null===(n=this.get("stateController"))||void 0===n||n.destroy(),null===(i=this.get("canvas"))||void 0===i||i.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},e.prototype.createHull=function(t){if(t.members&&!(t.members.length<1)){var e=this.get("hullGroup"),r=this.get("hullMap");if(r||(r={},this.set("hullMap",r)),e&&!e.get("destroyed")||((e=this.get("group").addGroup({id:"hullGroup"})).toBack(),this.set("hullGroup",e)),r[t.id])return console.warn("Existed hull id."),r[t.id];var n=e.addGroup({id:"".concat(t.id,"-container")}),i=new Tk(this,(0,Gw.__assign)((0,Gw.__assign)({},t),{group:n}));return r[i.id]=i,i}console.warn("Create hull failed! The members is empty.")},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var e,r;r=(0,Uw.isString)(t)?this.getHullById(t):t,null===(e=this.get("hullMap"))||void 0===e||delete e[r.id],r.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();t&&Object.keys(t).length&&(Object.keys(t).forEach(function(e){t[e].destroy()}),this.set("hullMap",{}))},e}(qw.A);function Ak(t){"@babel/helpers - typeof";return(Ak="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Pk=Yw.pd,Mk=["startArrow","endArrow"],Ik={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},Lk={edge:{lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},node:Ik,combo:Ik},jk={options:{labelCfg:{style:{fontFamily:iE.windowFontFamily}},descriptionCfg:{style:{fontFamily:iE.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return"move"===e||(null===e||void 0===e?void 0:e.includes("bbox"))?t:(0,Uw.deepMix)({},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){e.shapeMap={},this.mergeStyle=this.getOptions(t);var r=this.drawShape(t,e);if(r.set("className",this.itemType+"-shape"),e.shapeMap[this.itemType+"-shape"]=r,t.label){var n=this.drawLabel(t,e);n.set("className",this.itemType+"-label"),e.shapeMap[this.itemType+"-label"]=n}return r},afterDraw:function(t,e,r){},drawShape:function(t,e){return null},drawLabel:function(t,e){var r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},n=this.getLabelStyle(t,r,e),i=n.rotate;delete n.rotate;var o=e.addShape("text",{attrs:n,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&""!==i){var a=o.getBBox(),s=[1,0,0,0,1,0,0,0,1];if(n.rotateCenter)switch(n.rotateCenter){case"center":s=Pk(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]]);break;case"lefttop":s=Pk(s,[["t",-n.x,-n.y],["r",i],["t",n.x,n.y]]);break;case"leftcenter":s=Pk(s,[["t",-n.x,-n.y-a.height/2],["r",i],["t",n.x,n.y+a.height/2]]);break;default:s=Pk(s,[["t",-a.width/2,-a.height/2],["r",i],["t",a.width/2,a.height/2]])}else s=Pk(s,[["t",-n.x,-n.y-a.height/2],["r",i],["t",n.x,n.y+a.height/2]]);o.setMatrix(s)}if(n.background){var u=this.drawLabelBg(t,e,o),l=this.itemType+"-label-bg";u.set("classname",l),e.shapeMap[l]=u,o.toFront()}return o},drawLabelBg:function(t,e,r){var n=this.options.labelCfg,i=(0,Uw.mix)({},n,t.labelCfg),o=this.getLabelBgStyleByPosition(r,i),a=e.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return e.shapeMap["text-bg-shape"]=a,a},getLabelStyleByPosition:function(t,e,r){return{text:t.label}},getLabelBgStyleByPosition:function(t,e){return{}},getLabelStyle:function(t,e,r){var n=this.getLabelStyleByPosition(t,e,r),i="".concat(this.itemType,"Label"),o=iE[i]?iE[i].style:null;return(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},o),n),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e,r){this.updateShapeStyle(t,e,r),this.updateLabel(t,e,r)},updateShapeStyle:function(t,e,r){var n,i=e.getContainer(),o=e.getKeyShape(),a=(0,Uw.mix)({},o.attr(),t.style),s=function(t){var e,r=a[t];if((0,Uw.isPlainObject)(r)){var s=(null===(n=i.shapeMap)||void 0===n?void 0:n[t])||i.find(function(e){return e.get("name")===t});null===s||void 0===s||s.attr(r)}else o.attr(((e={})[t]=r,e))};for(var u in a)s(u)},updateLabel:function(t,e,r){var n,i,o=e.getContainer(),a=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,s=void 0===a?{}:a,u=this.itemType+"-label",l=o.shapeMap[u]||o.find(function(t){return t.get("className")===u}),c=this.itemType+"-label-bg",f=o.shapeMap[c]||o.find(function(t){return t.get("className")===c});if(l&&void 0===t.label&&(o.removeChild(l),delete o.shapeMap[u],f&&(o.removeChild(f),delete o.shapeMap[c])),t.label||""===t.label)if(l){(!r||"bbox|label"===r||"edge"===this.itemType&&"style"!==r)&&(s=(0,Uw.deepMix)(s,t.labelCfg));var h=this.getLabelStyleByPosition(t,s,o),p=null===(n=t.labelCfg)||void 0===n?void 0:n.style,d=(0,Gw.__assign)((0,Gw.__assign)({},h),p),y=d.rotate;if(delete d.rotate,isNaN(y)||""===y)1!==(null===(i=l.getMatrix())||void 0===i?void 0:i[4])&&l.resetMatrix(),l.attr(d);else{var v=[1,0,0,0,1,0,0,0,1];v=Pk(v,[["t",-d.x,-d.y],["r",y],["t",d.x,d.y]]),d.matrix=v,l.attr(d)}if(f)if(d.background){var g=this.getLabelBgStyleByPosition(l,s);f.attr(g)}else o.removeChild(f);else d.background&&((f=this.drawLabelBg(t,o,l)).set("classname",c),o.shapeMap[c]=f,l.toFront())}else{var m=this.drawLabel(t,o);m.set("className",u),o.shapeMap[u]=m}},afterUpdate:function(t,e){},setState:function(t,e,r){var n,i,o,a=r.get("keyShape");if(a&&!a.destroyed){var s=r.getType(),u=(0,Uw.isBoolean)(e)?t:"".concat(t,":").concat(e),l=this.getStateStyle(u,r),c=r.getStateStyle(u);if(c||l){var f=(0,Uw.mix)({},c||l),h=r.getContainer(),p={x:1,y:1,cx:1,cy:1,matrix:1};if("combo"===s&&(p.r=1,p.width=1,p.height=1),e){var d=function(t){var e,r=f[t];if((0,Uw.isPlainObject)(r)&&!Mk.includes(t)){var n=(null===(o=h.shapeMap)||void 0===o?void 0:o[t])||h.find(function(e){return e.get("name")===t});null===n||void 0===n||n.attr(r)}else a.attr(((e={})[t]=r,e))};for(var y in f)d(y)}else{var v=SE(r.getCurrentStatesStyle()),g=r.getModel(),m=(0,Uw.mix)({},g.style,SE(r.getOriginStyle())),b=a.get("name"),x=a.attr(),w={};Object.keys(x).forEach(function(t){if("img"!==t){var e=x[t];e&&"object"===Ak(e)?w[t]=(0,Uw.clone)(e):w[t]=e}});var _={},S=function(t){var e=f[t];if((0,Uw.isPlainObject)(e)&&!Mk.includes(t)){var r=h.shapeMap[t]||h.find(function(e){return e.get("name")===t});if(r){var n=SE(r.attr());(0,Uw.each)(e,function(e,i){if(t===b&&w[i]&&!p[i]){delete w[i];var o=m[t][i]||Lk[s][i];a.attr(i,o)}else if(n[i]||0===n[i]){delete n[i];var u=m[t][i]||Lk[s][i];r.attr(i,u)}}),_[t]=n}}else if(w[t]&&!p[t]){delete w[t];var i=m[t]||(m[b]?m[b][t]:void 0)||Lk[s][t];a.attr(t,i)}};for(var E in f)S(E);for(var y in b?_[b]=w:(0,Uw.mix)(_,w),v)if(!p[y]){var k=v[y];(0,Uw.isPlainObject)(k)&&!Mk.includes(y)||(b?((0,Uw.mix)(m[b],((i={})[y]=k,i)),delete m[y]):(0,Uw.mix)(m,((n={})[y]=k,n)),delete v[y])}var T={};(0,Uw.deepMix)(T,m,_,v);var C=!1,O=function(t){var e,r,n=T[t];if((0,Uw.isPlainObject)(n)&&!Mk.includes(t)){var i=h.shapeMap[t]||h.find(function(e){return e.get("name")===t});i&&(("text"===i.get("type")||i.get("labelRelated"))&&(delete n.x,delete n.y,delete n.matrix),t===b&&("combo"===s&&(delete n.r,delete n.width,delete n.height),C=!0),i.attr(n))}else if(!C){var o=n||Lk[s][t];"combo"===s?b||a.attr(((e={})[t]=o,e)):a.attr(((r={})[t]=o,r))}};for(var A in T)O(A)}}}},getStateStyle:function(t,e){var r=e.getModel(),n=e.getType(),i=this.getOptions(r),o=i.stateStyles,a=i.style,s=void 0===a?{}:a,u=r.stateStyles?r.stateStyles[t]:o&&o[t];return"combo"===n?(0,Uw.clone)(u):(0,Uw.mix)({},s,u)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e,r;return(null===t||void 0===t?void 0:t.anchorPoints)||(null===(e=this.getCustomConfig(t))||void 0===e?void 0:e.anchorPoints)||(null===(r=this.options)||void 0===r?void 0:r.anchorPoints)}},Nk={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:iE.nodeLabel.offset,getSize:function(t){var e,r=(null===(e=this.mergeStyle)||void 0===e?void 0:e.size)||t.size||this.getOptions({}).size||iE.defaultNode.size;return(0,Uw.isArray)(r)&&1===r.length&&(r=[r[0],r[0]]),(0,Uw.isArray)(r)||(r=[r,r]),r},getLabelStyleByPosition:function(t,e){var r=e.maxLength,n=t.label;r&&(n=mE(n,r));var i=e.position||this.labelPosition;if("center"===i)return{x:0,y:0,text:n,textBaseline:"middle",textAlign:"center"};var o=e.offset;(0,Uw.isNil)(o)&&(o=this.offset);var a,s=this.getSize(t);switch(i){case"top":a={x:0,y:-s[1]/2-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":a={x:0,y:s[1]/2+o,textBaseline:"top",textAlign:"center"};break;case"left":a={x:-s[0]/2-o,y:0,textBaseline:"middle",textAlign:"right"};break;default:a={x:s[0]/2+o,y:0,textBaseline:"middle",textAlign:"left"}}return a.text=n,a},getLabelBgStyleByPosition:function(t,e){var r;if(!t)return{};var n=null===(r=e.style)||void 0===r?void 0:r.background;if(!n)return{};var i=t.getBBox(),o=PE(n.padding),a=i.width+o[1]+o[3],s=i.height+o[0]+o[2];return(0,Gw.__assign)((0,Gw.__assign)({x:i.minX-o[3],y:i.minY-o[0]},n),{width:a,height:s})},drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t),i=e.addShape(r,{attrs:n,draggable:!0,name:"node-shape"});return e.shapeMap["node-shape"]=i,i},updateLinkPoints:function(t,e){var r,n=(this.mergeStyle||this.getOptions(t)).linkPoints,i=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),o=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),a=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),s=e.shapeMap["link-point-bottom"]||e.find(function(t){return"link-point-bottom"===t.get("className")});i&&(r=i.attr()),o&&!r&&(r=o.attr()),a&&!r&&(r=a.attr()),s&&!r&&(r=s.attr()),r||(r=n);var u=(0,Uw.mix)({},r,t.linkPoints),l=u.fill,c=u.stroke,f=u.lineWidth,h=u.size/2;h||(h=u.r);var p=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},d=p.left,y=p.right,v=p.top,g=p.bottom,m=this.getSize(t),b=m[0],x=m[1],w={r:h,fill:l,stroke:c,lineWidth:f};if(i)d||void 0===d?i.attr((0,Gw.__assign)((0,Gw.__assign)({},w),{x:-b/2,y:0})):(i.remove(),delete e.shapeMap["link-point-left"]);else if(d){var _="link-point-left";e.shapeMap[_]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},w),{x:-b/2,y:0}),className:_,name:_,isAnchorPoint:!0})}if(o)y||void 0===y||(o.remove(),delete e.shapeMap["link-point-right"]),o.attr((0,Gw.__assign)((0,Gw.__assign)({},w),{x:b/2,y:0}));else if(y){var S="link-point-right";e.shapeMap[S]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},w),{x:b/2,y:0}),className:S,name:S,isAnchorPoint:!0})}if(a)v||void 0===v||(a.remove(),delete e.shapeMap["link-point-top"]),a.attr((0,Gw.__assign)((0,Gw.__assign)({},w),{x:0,y:-x/2}));else if(v){var E="link-point-top";e.shapeMap[E]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},w),{x:0,y:-x/2}),className:E,name:E,isAnchorPoint:!0})}if(s)g||void 0===g?s.attr((0,Gw.__assign)((0,Gw.__assign)({},w),{x:0,y:x/2})):(s.remove(),delete e.shapeMap["link-point-bottom"]);else if(g){var k="link-point-bottom";e.shapeMap[k]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},w),{x:0,y:x/2}),className:k,name:k,isAnchorPoint:!0})}},updateShape:function(t,e,r,n,i){e.get("keyShape").attr((0,Gw.__assign)({},r)),this.updateLabel(t,e,i),n&&this.updateIcon(t,e)},updateIcon:function(t,e){var r=this,n=e.getContainer(),i=(this.mergeStyle||this.getOptions(t)).icon,o=t.icon?t.icon:{show:void 0,text:void 0},a=o.show,s=o.text,u=n.shapeMap["".concat(this.type,"-icon")]||n.find(function(t){return t.get("name")==="".concat(r.type,"-icon")});if(u)if(a||void 0===a){var l=(0,Uw.mix)({},u.attr(),i),c=l.width,f=void 0===c?20:c,h=l.height,p=void 0===h?20:h;("iconfont"===l.fontFamily||l.hasOwnProperty("text"))&&(f=0,p=0),u.attr((0,Gw.__assign)((0,Gw.__assign)({},l),{x:-f/2,y:-p/2}))}else u.remove(),delete n.shapeMap["".concat(this.type,"-icon")];else if(a){var d="".concat(this.type,"-icon");if(s)n.shapeMap[d]=n.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:d,name:d});else{f=i.width,p=i.height;n.shapeMap[d]=n.addShape("image",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},i),{x:-f/2,y:-p/2}),className:d,name:d})}var y=n.shapeMap["node-label"]||n.find(function(t){return"node-label"===t.get("name")});y&&y.toFront()}}},Rk=(0,Gw.__assign)((0,Gw.__assign)({},jk),Nk);ZE.registerNode("single-node",Rk);var Dk={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:iE.defaultEdge.size,style:{x:0,y:0,stroke:iE.defaultEdge.style.stroke,lineAppendWidth:iE.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:iE.edgeLabel.style.fill,fontSize:iE.edgeLabel.style.fontSize,fontFamily:iE.windowFontFamily}},stateStyles:(0,Gw.__assign)({},iE.edgeStateStyles)},getPath:function(t){var e=[];return(0,Uw.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,Uw.mix)({},e,r,t.style),i=t.size||iE.defaultEdge.size,o=(t=this.getPathPoints(t)).startPoint,a=t.endPoint,s=this.getControlPoints(t),u=[o];s&&(u=u.concat(s)),u.push(a);var l=this.getPath(u);return(0,Uw.mix)({},iE.defaultEdge.style,{stroke:iE.defaultEdge.color,lineWidth:i,path:l},n)},updateShapeStyle:function(t,e,r){var n,i=e.getContainer(),o=(null===(n=e.getKeyShape)||void 0===n?void 0:n.call(e))||i.shapeMap["edge-shape"],a=t.size,s=(t=this.getPathPoints(t)).startPoint,u=t.endPoint,l=this.getControlPoints(t),c=[s];l&&(c=c.concat(l)),c.push(u);var f=o.attr(),h=t.style||{};void 0===h.stroke&&(h.stroke=t.color);var p=t.sourceNode,d=t.targetNode,y={radius:h.radius};l||(y={source:p,target:d,offset:h.offset,radius:h.radius});var v=this.getPath(c,y),g={};"move"===r?g={path:v}:(f.endArrow&&!1===h.endArrow&&(t.style.endArrow={path:""}),f.startArrow&&!1===h.startArrow&&(t.style.startArrow={path:""}),void 0===(g=(0,Gw.__assign)({},t.style)).lineWidth&&(g.lineWidth=((0,Uw.isNumber)(a)?a:null===a||void 0===a?void 0:a[0])||f.lineWidth),void 0===g.path&&(g.path=v),void 0===g.stroke&&(g.stroke=f.stroke||t.color)),o&&o.attr(g)},getLabelStyleByPosition:function(t,e,r){var n,i=e.position||this.labelPosition,o={},a=null===r||void 0===r?void 0:r.shapeMap["edge-shape"];n="start"===i?0:"end"===i?1:.5;var s,u=e.refX||this.refX,l=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return o.x=t.startPoint.x+u,o.y=t.startPoint.y+l,o.text=t.label,o;s=(0,Uw.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate;var c=pE(a,n,u,l,s);return o.x=c.x,o.y=c.y,o.rotate=c.rotate,o.textAlign=this._getTextAlign(i,c.angle),o.text=t.label,o},getLabelBgStyleByPosition:function(t,e){if(!t)return{};var r=t.getBBox(),n=e.style&&e.style.background;if(!n)return{};var i=n.padding,o=r.width+i[1]+i[3],a=r.height+i[0]+i[2],s=(0,Gw.__assign)((0,Gw.__assign)({},n),{width:o,height:a,x:r.minX-i[3],y:r.minY-i[0],matrix:[1,0,0,0,1,0,0,0,1]});return((0,Uw.isNil)(e.autoRotate)?this.labelAutoRotate:e.autoRotate)&&(s.matrix=t.attr("matrix")||[1,0,0,0,1,0,0,0,1]),s},_getTextAlign:function(t,e){var r="center";return e?(e%=2*Math.PI,"center"!==t&&(r=e>=0&&e<=Math.PI/2||e>=1.5*Math.PI&&e<2*Math.PI?t:function(t){var e=t;return"start"===t?e="end":"end"===t&&(e="start"),e}(t)),r):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},drawLabel:function(t,e){var r=this.options.labelCfg,n=(0,Uw.deepMix)({},r,t.labelCfg),i=this.getLabelStyle(t,n,e),o=i.rotate;delete i.rotate;var a=e.addShape("text",{attrs:i,name:"text-shape",labelRelated:!0,draggable:!0});if(e.shapeMap["text-shape"]=a,isNaN(o)||""===o||a.rotateAtStart(o),i.background){var s=this.drawLabelBg(t,e,a,i,o),u=this.itemType+"-label-bg";s.set("classname",u),e.shapeMap[u]=s,a.toFront()}return a},drawLabelBg:function(t,e,r,n,i){var o=this.options.labelCfg,a=(0,Uw.deepMix)({},o,t.labelCfg),s=this.getLabelBgStyleByPosition(r,a),u=e.addShape("rect",{name:"text-bg-shape",attrs:s,labelRelated:!0});return e.shapeMap["text-bg-shape"]=u,u}},Bk=(0,Gw.__assign)((0,Gw.__assign)({},jk),Dk);ZE.registerEdge("single-edge",Bk),ZE.registerEdge("line",{getControlPoints:function(){}},"single-edge"),ZE.registerEdge("spline",{getPath:function(t){return ok(t)}},"single-edge"),ZE.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e,r,n=t.startPoint,i=t.endPoint,o=(n.x+i.x)/2,a=(n.y+i.y)/2;if(void 0!==t.controlPoints){if(r=t.controlPoints[0],e=TS(n,r,i),n.x<=i.x&&n.y>i.y?this.clockwise=e.x>r.x?0:1:n.x<=i.x&&n.yr.x?1:0:n.x>i.x&&n.y<=i.y?this.clockwise=e.y=t&&i<=t+r&&o>=e&&o<=e+n}function iT(t,e){return!(e.minX>t.maxX||e.maxXt.maxY||e.maxY=0&&a<.5*Math.PI?(n={x:u.minX,y:u.minY},i={x:u.maxX,y:u.maxY}):.5*Math.PI<=a&&a1&&(r*=Math.sqrt(p),n*=Math.sqrt(p));var d=r*r*(h*h)+n*n*(f*f),y=d?Math.sqrt((r*r*(n*n)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=n?y*r*h/n:0,g=r?y*-n*f/r:0,m=(s+l)/2+Math.cos(i)*v-Math.sin(i)*g,b=(u+c)/2+Math.sin(i)*v+Math.cos(i)*g,x=[(f-v)/r,(h-g)/n],w=[(-1*f-v)/r,(-1*h-g)/n],_=dT([1,0],x),S=dT(x,w);return pT(x,w)<=-1&&(S=Math.PI),pT(x,w)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),{cx:m,cy:b,rx:oT(t,[l,c])?0:r,ry:oT(t,[l,c])?0:n,startAngle:_,endAngle:_+S,xRotation:i,arcFlag:o,sweepFlag:a}}function vT(t){"@babel/helpers - typeof";return(vT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var gT=Math.sin,mT=Math.cos,bT=Math.atan2,xT=Math.PI;function wT(t,e,r,n,i,o,a){var s=e.stroke,u=e.lineWidth,l=bT(n-o,r-i),c=new rC({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*mT(xT/6)+","+10*gT(xT/6)+" L0,0 L"+10*mT(xT/6)+",-"+10*gT(xT/6),stroke:s,lineWidth:u}});c.translate(i,o),c.rotateAtPoint(i,o,l),t.set(a?"startArrowShape":"endArrowShape",c)}function _T(t,e,r,n,i,o,a){var s=e.startArrow,u=e.endArrow,l=e.stroke,c=e.lineWidth,f=a?s:u,h=f.d,p=f.fill,d=f.stroke,y=f.lineWidth,v=(0,Gw.__rest)(f,["d","fill","stroke","lineWidth"]),g=bT(n-o,r-i);h&&(i-=mT(g)*h,o-=gT(g)*h);var m=new rC({type:"path",canvas:t.get("canvas"),isArrowShape:!0,attrs:(0,Gw.__assign)((0,Gw.__assign)({},v),{stroke:d||l,lineWidth:y||c,fill:p})});m.translate(i,o),m.rotateAtPoint(i,o,g),t.set(a?"startArrowShape":"endArrowShape",m)}function ST(t,e,r,n,i){var o=bT(n-e,r-t);return{dx:mT(o)*i,dy:gT(o)*i}}function ET(t,e,r,n,i,o){"object"===vT(e.startArrow)?_T(t,e,r,n,i,o,!0):e.startArrow?wT(t,e,r,n,i,o,!0):t.set("startArrowShape",null)}function kT(t,e,r,n,i,o){"object"===vT(e.endArrow)?_T(t,e,r,n,i,o,!1):e.endArrow?wT(t,e,r,n,i,o,!1):t.set("startArrowShape",null)}var TT={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function CT(t,e){var r=e.attr();for(var n in r){var i=r[n],o=TT[n]?TT[n]:n;"matrix"===o&&i?t.transform(i[0],i[1],i[3],i[4],i[6],i[7]):"lineDash"===o&&t.setLineDash?(0,Uw.isArray)(i)&&t.setLineDash(i):("strokeStyle"===o||"fillStyle"===o?i=fT(t,e,i):"globalAlpha"===o&&(i*=t.globalAlpha),t[o]=i)}}function OT(t,e,r){for(var n=0;nx?b:x,T=b>x?1:b/x,C=b>x?x/b:1;e.translate(g,m),e.rotate(S),e.scale(T,C),e.arc(0,0,k,w,_,1-E),e.scale(1/T,1/C),e.rotate(-S),e.translate(-g,-m)}break;case"Z":e.closePath()}if("Z"===h)s=u;else{var O=f.length;s=[f[O-2],f[O-1]]}}}}function LT(t,e){var r=t.get("canvas");r&&("remove"===e&&(t._cacheCanvasBBox=t.get("cacheCanvasBBox")),t.get("hasChanged")||(t.set("hasChanged",!0),t.cfg.parent&&t.cfg.parent.get("hasChanged")||(r.refreshElement(t,e,r),r.get("autoDraw")&&r.draw())))}function jT(t){var e,r,n;if(t.destroyed)e=t._cacheCanvasBBox;else{var i=t.get("cacheCanvasBBox"),o=i&&!(!i.width||!i.height),a=t.getCanvasBBox(),s=a&&!(!a.width||!a.height);o&&s?(n=a,e=(r=i)&&n?{minX:Math.min(r.minX,n.minX),minY:Math.min(r.minY,n.minY),maxX:Math.max(r.maxX,n.maxX),maxY:Math.max(r.maxY,n.maxY)}:r||n):o?e=i:s&&(e=a)}return e}var NT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.onCanvasChange=function(t){LT(this,t)},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,e){e&&(t.save(),CT(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],r=[];(0,Uw.each)(t,function(t){var n=t.cfg.cacheCanvasBBox;n&&t.cfg.isInView&&(e.push(n.minX,n.maxX),r.push(n.minY,n.maxY))});var n=null;if(e.length){var i=(0,Uw.min)(e),o=(0,Uw.max)(e),a=(0,Uw.min)(r),s=(0,Uw.max)(r);n={minX:i,minY:a,x:i,y:a,maxX:o,maxY:s,width:o-i,height:s-a};var u=this.cfg.canvas;if(u){var l=u.getViewRange();this.set("isInView",iT(n,l))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",n)},e.prototype.draw=function(t,e){var r=this.cfg.children,n=!e||this.cfg.refresh;r.length&&n&&(t.save(),CT(t,this),this._applyClip(t,this.getClip()),OT(t,r,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(CE.AbstractGroup),RT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return NT},e.prototype.onCanvasChange=function(t){LT(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),r=(0,CE.getBBoxMethod)(t)(this),n=e/2,i=r.x-n,o=r.y-n,a=r.x+r.width+n,s=r.y+r.height+n;return{x:i,minX:i,y:o,minY:o,width:r.width+e,height:r.height+e,maxX:a,maxY:s}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,e){e&&(t.save(),CT(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},e.prototype.draw=function(t,e){var r=this.cfg.clipShape;if(e){if(!1===this.cfg.refresh)return void this.set("hasChanged",!1);if(!iT(e,this.getCanvasBBox()))return this.set("hasChanged",!1),void(this.cfg.isInView&&this._afterDraw())}t.save(),CT(t,this),this._applyClip(t,r),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),r=iT(e,t);this.set("isInView",r),r?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var e=this.attrs,r=e.lineWidth,n=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isFill()&&((0,Uw.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=n)),this.isStroke()&&r>0&&((0,Uw.isNil)(i)||1===i||(t.globalAlpha=i),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,e){var r=this.isStroke(),n=this.isFill(),i=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,r,n,i)},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(CE.AbstractShape),DT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=o.x,s=o.y,u=o.r,l=i/2,c=rT(a,s,t,e);return n&&r?c<=u+l:n?c<=u:!!r&&(c>=u-l&&c<=u+l)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.r;t.beginPath(),t.arc(r,n,i,0,2*Math.PI,!1),t.closePath()},e}(RT);function BT(t,e,r,n){return t/(r*r)+e/(n*n)}var FT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=i/2,s=o.x,u=o.y,l=o.rx,c=o.ry,f=(t-s)*(t-s),h=(e-u)*(e-u);return n&&r?BT(f,h,l+a,c+a)<=1:n?BT(f,h,l,c)<=1:!!r&&(BT(f,h,l-a,c-a)>=1&&BT(f,h,l+a,c+a)<=1)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.rx,o=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(r,n,i,o,0,0,2*Math.PI,!1);else{var a=i>o?i:o,s=i>o?1:i/o,u=i>o?o/i:1;t.save(),t.translate(r,n),t.scale(s,u),t.arc(0,0,a,0,2*Math.PI),t.restore(),t.closePath()}},e}(RT);function zT(t){return t instanceof HTMLElement&&(0,Uw.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()}var GT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(!0===this.get("toDraw")){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var e=this,r=this.attrs;if((0,Uw.isString)(t)){var n=new Image;n.onload=function(){if(e.destroyed)return!1;e.attr("img",n),e.set("loading",!1),e._afterLoading();var t=e.get("callback");t&&t.call(e)},n.crossOrigin="Anonymous",n.src=t,this.set("loading",!0)}else t instanceof Image?(r.width||(r.width=t.width),r.height||(r.height=t.height)):zT(t)&&(r.width||(r.width=Number(t.getAttribute("width"))),r.height||(r.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),"img"===e&&this._setImage(r)},e.prototype.createPath=function(t){if(this.get("loading"))return this.set("toDraw",!0),void this.set("context",t);var e=this.attr(),r=e.x,n=e.y,i=e.width,o=e.height,a=e.sx,s=e.sy,u=e.swidth,l=e.sheight,c=e.img;(c instanceof Image||zT(c))&&((0,Uw.isNil)(a)||(0,Uw.isNil)(s)||(0,Uw.isNil)(u)||(0,Uw.isNil)(l)?t.drawImage(c,r,n,i,o):t.drawImage(c,a,s,u,l,r,n,i,o))},e}(RT),UT=r(9590);function VT(t,e,r,n,i,o,a){var s=Math.min(t,r),u=Math.max(t,r),l=Math.min(e,n),c=Math.max(e,n),f=i/2;return o>=s-f&&o<=u+f&&a>=l-f&&a<=c+f&&UT.N1.pointToLine(t,e,r,n,o,a)<=i/2}var HT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2,o=t.startArrow,a=t.endArrow;o&&ET(this,t,n,i,e,r),a&&kT(this,t,e,r,n,i)},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){if(!r||!i)return!1;var o=this.attr();return VT(o.x1,o.y1,o.x2,o.y2,i,t,e)},e.prototype.createPath=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2,a=e.startArrow,s=e.endArrow,u={dx:0,dy:0},l={dx:0,dy:0};a&&a.d&&(u=ST(r,n,i,o,e.startArrow.d)),s&&s.d&&(l=ST(r,n,i,o,e.endArrow.d)),t.beginPath(),t.moveTo(r+u.dx,n+u.dy),t.lineTo(i-l.dx,o-l.dy)},e.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),r=this.get("endArrowShape");e&&e.draw(t),r&&r.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2;return UT.N1.length(e,r,n,i)},e.prototype.getPoint=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2;return UT.N1.pointAt(r,n,i,o,t)},e}(RT),WT={circle:function(t,e,r){return[["M",t-r,e],["A",r,r,0,1,0,t+r,e],["A",r,r,0,1,0,t-r,e]]},square:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e-r],["L",t+r,e+r],["L",t-r,e+r],["Z"]]},diamond:function(t,e,r){return[["M",t-r,e],["L",t,e-r],["L",t+r,e],["L",t,e+r],["Z"]]},triangle:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e+n],["L",t,e-n],["L",t+r,e+n],["Z"]]},"triangle-down":function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e-n],["L",t+r,e-n],["L",t,e+n],["Z"]]}},qT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),-1!==["symbol","x","y","r","radius"].indexOf(e)&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return(0,Uw.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t,r,n=this.attr(),i=n.x,o=n.y,a=n.symbol||"circle",s=this._getR(n);if((0,Uw.isFunction)(a))r=(t=a)(i,o,s),r=(0,nk.$j)(r);else{if(!(t=e.Symbols[a]))return console.warn(a+" marker is not supported."),null;r=t(i,o,s)}return r},e.prototype.createPath=function(t){IT(this,t,{path:this._getPath()},this.get("paramsCache"))},e.Symbols=WT,e}(RT);function YT(t,e,r){var n=(0,CE.getOffScreenContext)();return t.createPath(n),n.isPointInPath(e,r)}var XT=1e-6;function ZT(t){return Math.abs(t)0!=ZT(s[1]-r)>0&&ZT(e-(r-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(n=!n)}return n}function QT(t,e,r,n,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI);if(ui)return!1;var l={x:t+r*Math.cos(u),y:e+r*Math.sin(u)};return rT(l.x,l.y,a,s)<=o/2}var $T=Yw.pd;var tC=(0,Gw.__assign)({hasArc:function(t){for(var e=!1,r=t.length,n=0;n0&&n.push(i),{polygons:r,polylines:n}},isPointInStroke:function(t,e,r,n,i){for(var o=!1,a=e/2,s=0;sg?v:g,S=$T(null,[["t",-d,-y],["r",-x],["s",1/(v>g?1:v/g),1/(v>g?g/v:1)]]);dS.transformMat3(w,w,S),o=QT(0,0,_,m,b,e,w[0],w[1])}if(o)break}}return o}},CE.PathUtil);function eC(t,e,r){for(var n=!1,i=0;i=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)});var o=i[r];if((0,Uw.isNil)(o)||(0,Uw.isNil)(r))return null;var a=o.length,s=i[r+1];return UT.lw.pointAt(o[a-2],o[a-1],s[1],s[2],s[3],s[4],s[5],s[6],e)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",tC.pathToCurve(t))},e.prototype._setTcache=function(){var t,e,r,n,i=0,o=0,a=[],s=this.get("curve");s&&((0,Uw.each)(s,function(t,e){r=s[e+1],n=t.length,r&&(i+=UT.lw.length(t[n-2],t[n-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)}),this.set("totalLength",i),0!==i?((0,Uw.each)(s,function(u,l){r=s[l+1],n=u.length,r&&((t=[])[0]=o/i,e=UT.lw.length(u[n-2],u[n-1],r[1],r[2],r[3],r[4],r[5],r[6]),o+=e||0,t[1]=o/i,a.push(t))}),this.set("tCache",a)):this.set("tCache",[]))},e.prototype.getStartTangent=function(){var t,e=this.getSegments();if(e.length>1){var r=e[0].currentPoint,n=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([r[0]-i[0],r[1]-i[1]]),t.push([r[0],r[1]])):(t.push([n[0],n[1]]),t.push([r[0],r[1]]))}return t},e.prototype.getEndTangent=function(){var t,e=this.getSegments(),r=e.length;if(r>1){var n=e[r-2].currentPoint,i=e[r-1].currentPoint,o=e[r-1].endTangent;t=[],o?(t.push([i[0]-o[0],i[1]-o[1]]),t.push([i[0],i[1]])):(t.push([n[0],n[1]]),t.push([i[0],i[1]]))}return t},e}(RT);function nC(t,e,r,n,i){var o=t.length;if(o<2)return!1;for(var a=0;a=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)}),UT.N1.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var r,n,i=0,o=[];(0,Uw.each)(t,function(a,s){t[s+1]&&((r=[])[0]=i/e,n=UT.N1.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=n,r[1]=i/e,o.push(r))}),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r},e}(RT);var aC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,e,r,n,i){var o=this.attr(),a=o.x,s=o.y,u=o.width,l=o.height,c=o.radius;if(c){var f=!1;return r&&(f=function(t,e,r,n,i,o,a,s){return VT(t+i,e,t+r-i,e,o,a,s)||VT(t+r,e+i,t+r,e+n-i,o,a,s)||VT(t+r-i,e+n,t+i,e+n,o,a,s)||VT(t,e+n-i,t,e+i,o,a,s)||QT(t+r-i,e+i,i,1.5*Math.PI,2*Math.PI,o,a,s)||QT(t+r-i,e+n-i,i,0,.5*Math.PI,o,a,s)||QT(t+i,e+n-i,i,.5*Math.PI,Math.PI,o,a,s)||QT(t+i,e+i,i,Math.PI,1.5*Math.PI,o,a,s)}(a,s,u,l,c,i,t,e)),!f&&n&&(f=YT(this,t,e)),f}var h=i/2;return n&&r?nT(a-h,s-h,u+h,l+h,t,e):n?nT(a,s,u,l,t,e):r?function(t,e,r,n,i,o,a){var s=i/2;return nT(t-s,e-s,r,i,o,a)||nT(t+r-s,e-s,i,n,o,a)||nT(t+s,e+n-s,r,i,o,a)||nT(t-s,e+s,i,n,o,a)}(a,s,u,l,i,t,e):void 0},e.prototype.createPath=function(t){var e=this.attr(),r=e.x,n=e.y,i=e.width,o=e.height,a=e.radius;if(t.beginPath(),0===a)t.rect(r,n,i,o);else{var s=function(t){var e=0,r=0,n=0,i=0;return(0,Uw.isArray)(t)?1===t.length?e=r=n=i=t[0]:2===t.length?(e=n=t[0],r=i=t[1]):3===t.length?(e=t[0],r=i=t[1],n=t[2]):(e=t[0],r=t[1],n=t[2],i=t[3]):e=r=n=i=t,[e,r,n,i]}(a),u=s[0],l=s[1],c=s[2],f=s[3];t.moveTo(r+u,n),t.lineTo(r+i-l,n),0!==l&&t.arc(r+i-l,n+l,l,-Math.PI/2,0),t.lineTo(r+i,n+o-c),0!==c&&t.arc(r+i-c,n+o-c,c,0,Math.PI/2),t.lineTo(r+f,n+o),0!==f&&t.arc(r+f,n+o-f,f,Math.PI/2,Math.PI),t.lineTo(r,n+u),0!==u&&t.arc(r+u,n+u,u,Math.PI,1.5*Math.PI),t.closePath()}},e}(RT),sC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=(0,CE.assembleFont)(t)},e.prototype._setText=function(t){var e=null;(0,Uw.isString)(t)&&-1!==t.indexOf("\n")&&(e=t.split("\n")),this.set("textArr",e)},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),e.startsWith("font")&&this._assembleFont(),"text"===e&&this._setText(r)},e.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,r=1*t.fontSize;return e?e-r:.14*r},e.prototype._drawTextArr=function(t,e,r){var n,i=this.attrs,o=i.textBaseline,a=i.x,s=i.y,u=1*i.fontSize,l=this._getSpaceingY(),c=(0,CE.getTextHeight)(i.text,i.fontSize,i.lineHeight);(0,Uw.each)(e,function(e,i){n=s+i*(l+u)-c+u,"middle"===o&&(n+=c-u-(c-u)/2),"top"===o&&(n+=c-u),(0,Uw.isNil)(e)||(r?t.fillText(e,a,n):t.strokeText(e,a,n))})},e.prototype._drawText=function(t,e){var r=this.attr(),n=r.x,i=r.y,o=this.get("textArr");if(o)this._drawTextArr(t,o,e);else{var a=r.text;(0,Uw.isNil)(a)||(e?t.fillText(a,n,i):t.strokeText(a,n,i))}},e.prototype.strokeAndFill=function(t){var e=this.attrs,r=e.lineWidth,n=e.opacity,i=e.strokeOpacity,o=e.fillOpacity;this.isStroke()&&r>0&&((0,Uw.isNil)(i)||1===i||(t.globalAlpha=n),this.stroke(t)),this.isFill()&&((0,Uw.isNil)(o)||1===o?this.fill(t):(t.globalAlpha=o,this.fill(t),t.globalAlpha=n)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(RT);function uC(t,e,r){var n=t.getTotalMatrix();if(n){var i=function(t,e){if(e){var r=(0,CE.invert)(e);return(0,CE.multiplyVec2)(r,t)}return t}([e,r,1],n);return[i[0],i[1]]}return[e,r]}function lC(t,e,r){if(t.isCanvas&&t.isCanvas())return!0;if(!(0,CE.isAllowCapture)(t)||!1===t.cfg.isInView)return!1;if(t.cfg.clipShape){var n=uC(t,e,r),i=n[0],o=n[1];if(t.isClipped(i,o))return!1}var a=t.cfg.cacheCanvasBBox||t.getCanvasBBox();return e>=a.minX&&e<=a.maxX&&r>=a.minY&&r<=a.maxY}var cC=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return c},e.prototype.getGroupBase=function(){return NT},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||(window?window.devicePixelRatio:1);return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,r){t.prototype.setDOMSize.call(this,e,r);var n=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*r,o>1&&n.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),r=this.get("el");e.clearRect(0,0,r.width,r.height)},e.prototype.getShape=function(e,r){return this.get("quickHit")?function t(e,r,n){if(!lC(e,r,n))return null;for(var i=null,o=e.getChildren(),a=o.length-1;a>=0;a--){var s=o[a];if(s.isGroup())i=t(s,r,n);else if(lC(s,r,n)){var u=s,l=uC(s,r,n),c=l[0],f=l[1];u.isInShape(c,f)&&(i=s)}if(i)break}return i}(this,e,r):t.prototype.getShape.call(this,e,r,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),r=this.getViewRange();e.length&&e[0]===this?t=r:(t=function(t){if(!t.length)return null;var e=[],r=[],n=[],i=[];return(0,Uw.each)(t,function(t){var o=jT(t);o&&(e.push(o.minX),r.push(o.minY),n.push(o.maxX),i.push(o.maxY))}),{minX:(0,Uw.min)(e),minY:(0,Uw.min)(r),maxX:(0,Uw.max)(n),maxY:(0,Uw.max)(i)}}(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=function(t,e){return t&&e&&iT(t,e)?{minX:Math.max(t.minX,e.minX),minY:Math.max(t.minY,e.minY),maxX:Math.min(t.maxX,e.maxX),maxY:Math.min(t.maxY,e.maxY)}:null}(t,r)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&((0,Uw.clearAnimationFrame)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),r=this.getChildren();t.clearRect(0,0,e.width,e.height),CT(t,this),OT(t,r),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),r=this.getChildren(),n=this._getRefreshRegion();n?(t.clearRect(n.minX,n.minY,n.maxX-n.minX,n.maxY-n.minY),t.save(),t.beginPath(),t.rect(n.minX,n.minY,n.maxX-n.minX,n.maxY-n.minY),t.clip(),CT(t,this),AT(this,r,n),OT(t,r,n),t.restore()):e.length&&function t(e){for(var r=0;re)r.insertBefore(t,i);else if(o0&&(e?"stroke"in r?this._setColor(t,"stroke",o):"strokeStyle"in r&&this._setColor(t,"stroke",a):this._setColor(t,"stroke",o||a),u&&c.setAttribute(pC.strokeOpacity,u),l&&c.setAttribute(pC.lineWidth,l))},e.prototype._setColor=function(t,e,r){var n=this.get("el");if(r)if(r=r.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(r))(i=t.find("gradient",r))||(i=t.addGradient(r)),n.setAttribute(pC[e],"url(#"+i+")");else if(/^[p,P]{1}[\s]*\(/.test(r)){var i;(i=t.find("pattern",r))||(i=t.addPattern(r)),n.setAttribute(pC[e],"url(#"+i+")")}else n.setAttribute(pC[e],r);else n.setAttribute(pC[e],"none")},e.prototype.shadow=function(t,e){var r=this.attr(),n=e||r,i=n.shadowOffsetX,o=n.shadowOffsetY,a=n.shadowBlur,s=n.shadowColor;(i||o||a||s)&&function(t,e){var r=t.cfg.el,n=t.attr(),i={dx:n.shadowOffsetX,dy:n.shadowOffsetY,blur:n.shadowBlur,color:n.shadowColor};if(i.dx||i.dy||i.blur||i.color){var o=e.find("filter",i);o||(o=e.addShadow(i)),r.setAttribute("filter","url(#"+o+")")}else r.removeAttribute("filter")}(this,t)},e.prototype.transform=function(t){var e=this.attr();(t||e).matrix&&gC(this)},e.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},e.prototype.isPointInPath=function(t,e){var r=this.get("el"),n=this.get("canvas").get("el").getBoundingClientRect(),i=t+n.left,o=e+n.top,a=document.elementFromPoint(i,o);return!(!a||!a.isEqualNode(r))},e.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,r=t.lineAppendWidth;return this.isStroke()?e+r:0},e}(CE.AbstractShape),SC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="circle",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,r:0})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Uw.each)(e||r,function(t,e){"x"===e||"y"===e?n.setAttribute("c"+e,t):pC[e]&&n.setAttribute(pC[e],t)})},e}(_C),EC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="dom",e.canFill=!1,e.canStroke=!1,e}return(0,Gw.__extends)(e,t),e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");if((0,Uw.each)(e||r,function(t,e){pC[e]&&n.setAttribute(pC[e],t)}),"function"==typeof r.html){var i=r.html.call(this,r);if(i instanceof Element||i instanceof HTMLDocument){for(var o=n.childNodes,a=o.length-1;a>=0;a--)n.removeChild(o[a]);n.appendChild(i)}else n.innerHTML=i}else n.innerHTML=r.html},e}(_C),kC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="ellipse",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Uw.each)(e||r,function(t,e){"x"===e||"y"===e?n.setAttribute("c"+e,t):pC[e]&&n.setAttribute(pC[e],t)})},e}(_C),TC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="image",e.canFill=!1,e.canStroke=!1,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");(0,Uw.each)(e||n,function(t,e){"img"===e?r._setImage(n.img):pC[e]&&i.setAttribute(pC[e],t)})},e.prototype.setAttr=function(t,e){this.attrs[t]=e,"img"===t&&this._setImage(e)},e.prototype._setImage=function(t){var e=this.attr(),r=this.get("el");if((0,Uw.isString)(t))r.setAttribute("href",t);else if(t instanceof window.Image)e.width||(r.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(r.setAttribute("height",t.height),this.attr("height",t.height)),r.setAttribute("href",t.src);else if(t instanceof HTMLElement&&(0,Uw.isString)(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase())r.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var n=document.createElement("canvas");n.setAttribute("width",""+t.width),n.setAttribute("height",""+t.height),n.getContext("2d").putImageData(t,0,0),e.width||(r.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(r.setAttribute("height",""+t.height),this.attr("height",t.height)),r.setAttribute("href",n.toDataURL())}},e}(_C),CC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="line",e.canFill=!1,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Uw.each)(e||r,function(e,i){if("startArrow"===i||"endArrow"===i)if(e){var o=(0,Uw.isObject)(e)?t.addArrow(r,pC[i]):t.getDefaultArrow(r,pC[i]);n.setAttribute(pC[i],"url(#"+o+")")}else n.removeAttribute(pC[i]);else pC[i]&&n.setAttribute(pC[i],e)})},e.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,r=t.y1,n=t.x2,i=t.y2;return UT.N1.length(e,r,n,i)},e.prototype.getPoint=function(t){var e=this.attr(),r=e.x1,n=e.y1,i=e.x2,o=e.y2;return UT.N1.pointAt(r,n,i,o,t)},e}(_C),OC={circle:function(t,e,r){return[["M",t,e],["m",-r,0],["a",r,r,0,1,0,2*r,0],["a",r,r,0,1,0,2*-r,0]]},square:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e-r],["L",t+r,e+r],["L",t-r,e+r],["Z"]]},diamond:function(t,e,r){return[["M",t-r,e],["L",t,e-r],["L",t+r,e],["L",t,e+r],["Z"]]},triangle:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e+n],["L",t,e-n],["L",t+r,e+n],["z"]]},triangleDown:function(t,e,r){var n=r*Math.sin(1/3*Math.PI);return[["M",t-r,e-n],["L",t+r,e-n],["L",t,e+n],["Z"]]}},AC={get:function(t){return OC[t]},register:function(t,e){OC[t]=e},remove:function(t){delete OC[t]},getAll:function(){return OC}},PC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="marker",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.createPath=function(t){this.get("el").setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return(0,Uw.isArray)(t)?t.map(function(t){return t.join(" ")}).join(""):t},e.prototype._getPath=function(){var t,e=this.attr(),r=e.x,n=e.y,i=e.r||e.radius,o=e.symbol||"circle";return(t=(0,Uw.isFunction)(o)?o:AC.get(o))?t(r,n,i):(console.warn(t+" symbol is not exist."),null)},e.symbolsFactory=AC,e}(_C),MC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="path",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");(0,Uw.each)(e||n,function(e,o){if("path"===o&&(0,Uw.isArray)(e))i.setAttribute("d",r._formatPath(e));else if("startArrow"===o||"endArrow"===o)if(e){var a=(0,Uw.isObject)(e)?t.addArrow(n,pC[o]):t.getDefaultArrow(n,pC[o]);i.setAttribute(pC[o],"url(#"+a+")")}else i.removeAttribute(pC[o]);else pC[o]&&i.setAttribute(pC[o],e)})},e.prototype._formatPath=function(t){var e=t.map(function(t){return t.join(" ")}).join("");return~e.indexOf("NaN")?"":e},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var e=this.get("el"),r=this.getTotalLength();if(0===r)return null;var n=e?e.getPointAtLength(t*r):null;return n?{x:n.x,y:n.y}:null},e}(_C),IC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polygon",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Uw.each)(e||r,function(t,e){"points"===e&&(0,Uw.isArray)(t)&&t.length>=2?n.setAttribute("points",t.map(function(t){return t[0]+","+t[1]}).join(" ")):pC[e]&&n.setAttribute(pC[e],t)})},e}(_C),LC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polyline",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(e,r,n){t.prototype.onAttrChange.call(this,e,r,n),-1!==["points"].indexOf(e)&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,e){var r=this.attr(),n=this.get("el");(0,Uw.each)(e||r,function(t,e){"points"===e&&(0,Uw.isArray)(t)&&t.length>=2?n.setAttribute("points",t.map(function(t){return t[0]+","+t[1]}).join(" ")):pC[e]&&n.setAttribute(pC[e],t)})},e.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return(0,Uw.isNil)(e)?(this.set("totalLength",UT.Ro.length(t)),this.get("totalLength")):e},e.prototype.getPoint=function(t){var e,r,n=this.attr().points,i=this.get("tCache");return i||(this._setTcache(),i=this.get("tCache")),(0,Uw.each)(i,function(n,i){t>=n[0]&&t<=n[1]&&(e=(t-n[0])/(n[1]-n[0]),r=i)}),UT.N1.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],e)},e.prototype._setTcache=function(){var t=this.attr().points;if(t&&0!==t.length){var e=this.getTotalLength();if(!(e<=0)){var r,n,i=0,o=[];(0,Uw.each)(t,function(a,s){t[s+1]&&((r=[])[0]=i/e,n=UT.N1.length(a[0],a[1],t[s+1][0],t[s+1][1]),i+=n,r[1]=i/e,o.push(r))}),this.set("tCache",o)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,r=[];return r.push([t[e-1][0],t[e-1][1]]),r.push([t[e][0],t[e][1]]),r},e}(_C);var jC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el"),o=!1,a=["x","y","width","height","radius"];(0,Uw.each)(e||n,function(t,e){-1===a.indexOf(e)||o?-1===a.indexOf(e)&&pC[e]&&i.setAttribute(pC[e],t):(i.setAttribute("d",r._assembleRect(n)),o=!0)})},e.prototype._assembleRect=function(t){var e=t.x,r=t.y,n=t.width,i=t.height,o=t.radius;if(!o)return"M "+e+","+r+" l "+n+",0 l 0,"+i+" l"+-n+" 0 z";var a=function(t){var e=0,r=0,n=0,i=0;return(0,Uw.isArray)(t)?1===t.length?e=r=n=i=t[0]:2===t.length?(e=n=t[0],r=i=t[1]):3===t.length?(e=t[0],r=i=t[1],n=t[2]):(e=t[0],r=t[1],n=t[2],i=t[3]):e=r=n=i=t,{r1:e,r2:r,r3:n,r4:i}}(o);return(0,Uw.isArray)(o)?1===o.length?a.r1=a.r2=a.r3=a.r4=o[0]:2===o.length?(a.r1=a.r3=o[0],a.r2=a.r4=o[1]):3===o.length?(a.r1=o[0],a.r2=a.r4=o[1],a.r3=o[2]):(a.r1=o[0],a.r2=o[1],a.r3=o[2],a.r4=o[3]):a.r1=a.r2=a.r3=a.r4=o,[["M "+(e+a.r1)+","+r],["l "+(n-a.r1-a.r2)+",0"],["a "+a.r2+","+a.r2+",0,0,1,"+a.r2+","+a.r2],["l 0,"+(i-a.r2-a.r3)],["a "+a.r3+","+a.r3+",0,0,1,"+-a.r3+","+a.r3],["l "+(a.r3+a.r4-n)+",0"],["a "+a.r4+","+a.r4+",0,0,1,"+-a.r4+","+-a.r4],["l 0,"+(a.r4+a.r1-i)],["a "+a.r1+","+a.r1+",0,0,1,"+a.r1+","+-a.r1],["z"]].join(" ")},e}(_C),NC=r(3950),RC={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},DC={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},BC={left:"left",start:"left",center:"middle",right:"end",end:"end"},FC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="text",e.canFill=!0,e.canStroke=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultAttrs=function(){var e=t.prototype.getDefaultAttrs.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,e){var r=this,n=this.attr(),i=this.get("el");this._setFont(),(0,Uw.each)(e||n,function(t,e){"text"===e?r._setText(""+t):"matrix"===e&&t?gC(r):pC[e]&&i.setAttribute(pC[e],t)}),i.setAttribute("paint-order","stroke"),i.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),r=e.textBaseline,n=e.textAlign,i=(0,NC.o0)();i&&"firefox"===i.name?t.setAttribute("dominant-baseline",DC[r]||"alphabetic"):t.setAttribute("alignment-baseline",RC[r]||"baseline"),t.setAttribute("text-anchor",BC[n]||"left")},e.prototype._setText=function(t){var e=this.get("el"),r=this.attr(),n=r.x,i=r.textBaseline,o=void 0===i?"bottom":i;if(t)if(~t.indexOf("\n")){var a=t.split("\n"),s=a.length-1,u="";(0,Uw.each)(a,function(t,e){0===e?"alphabetic"===o?u+=''+t+"":"top"===o?u+=''+t+"":"middle"===o?u+=''+t+"":"bottom"===o?u+=''+t+"":"hanging"===o&&(u+=''+t+""):u+=''+t+""}),e.innerHTML=u}else e.innerHTML=t;else e.innerHTML=""},e}(_C),zC=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,GC=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,UC=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function VC(t){var e=t.match(UC);if(!e)return"";var r="";return e.sort(function(t,e){return t=t.split(":"),e=e.split(":"),Number(t[0])-Number(e[0])}),(0,Uw.each)(e,function(t){t=t.split(":"),r+=''}),r}var HC,WC,qC,YC,XC=function(){function t(t){this.cfg={};var e,r,n,i,o,a,s,u=null,l=(0,Uw.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var r,n,i=zC.exec(t),o=(0,Uw.mod)((0,Uw.toRadian)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(r={x:0,y:0},n={x:1,y:1}):.5*Math.PI<=o&&o';e.innerHTML=r},t}(),QC=function(){function t(t,e){this.cfg={};var r=dC("marker"),n=(0,Uw.uniqueId)("marker_");r.setAttribute("id",n);var i=dC("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),r.appendChild(i),r.setAttribute("overflow","visible"),r.setAttribute("orient","auto-start-reverse"),this.el=r,this.child=i,this.id=n;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var r=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),r.setAttribute("refX",""+10*Math.cos(Math.PI/6)),r.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var r=this.el,n=this.cfg.path,i=this.cfg.d;(0,Uw.isArray)(n)&&(n=n.map(function(t){return t.join(" ")}).join("")),e.setAttribute("d",n),r.appendChild(e),i&&r.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),$C=function(){function t(t){this.type="clip",this.cfg={};var e=dC("clipPath");this.el=e,this.id=(0,Uw.uniqueId)("clip_"),e.id=this.id;var r=t.cfg.el;return e.appendChild(r),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),tO=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,eO=function(){function t(t){this.cfg={};var e=dC("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var r=dC("image");e.appendChild(r);var n=(0,Uw.uniqueId)("pattern_");e.id=n,this.el=e,this.id=n,this.cfg=t;var i=tO.exec(t)[2];r.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),rO=function(){function t(t){var e=dC("defs"),r=(0,Uw.uniqueId)("defs_");e.id=r,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var r=this.children,n=null,i=0;i]*>/,YC={tr:document.createElement("tbody"),tbody:HC,thead:HC,tfoot:HC,td:WC,th:WC,"*":document.createElement("div")});var e=qC.test(t)&&RegExp.$1;e&&e in YC||(e="*");var r=YC[e];t="string"==typeof t?t.replace(/(^\s*)|(\s*$)/g,""):t,r.innerHTML=""+t;var n=r.childNodes[0];return n&&r.contains(n)&&r.removeChild(n),n}var aO=r(2630),sO=r.n(aO);function uO(t){"@babel/helpers - typeof";return(uO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var lO=/^\s+/,cO=/\s+$/;function fO(t,e){if(t=t||"",e=e||{},t instanceof fO)return t;if(!(this instanceof fO))return new fO(t,e);var r=function(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,o=null,a=!1,s=!1;"string"==typeof t&&(t=function(t){t=t.replace(lO,"").replace(cO,"").toLowerCase();var e,r=!1;if(OO[t])t=OO[t],r=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};if(e=GO.rgb.exec(t))return{r:e[1],g:e[2],b:e[3]};if(e=GO.rgba.exec(t))return{r:e[1],g:e[2],b:e[3],a:e[4]};if(e=GO.hsl.exec(t))return{h:e[1],s:e[2],l:e[3]};if(e=GO.hsla.exec(t))return{h:e[1],s:e[2],l:e[3],a:e[4]};if(e=GO.hsv.exec(t))return{h:e[1],s:e[2],v:e[3]};if(e=GO.hsva.exec(t))return{h:e[1],s:e[2],v:e[3],a:e[4]};if(e=GO.hex8.exec(t))return{r:LO(e[1]),g:LO(e[2]),b:LO(e[3]),a:DO(e[4]),format:r?"name":"hex8"};if(e=GO.hex6.exec(t))return{r:LO(e[1]),g:LO(e[2]),b:LO(e[3]),format:r?"name":"hex"};if(e=GO.hex4.exec(t))return{r:LO(e[1]+""+e[1]),g:LO(e[2]+""+e[2]),b:LO(e[3]+""+e[3]),a:DO(e[4]+""+e[4]),format:r?"name":"hex8"};if(e=GO.hex3.exec(t))return{r:LO(e[1]+""+e[1]),g:LO(e[2]+""+e[2]),b:LO(e[3]+""+e[3]),format:r?"name":"hex"};return!1}(t));"object"==uO(t)&&(UO(t.r)&&UO(t.g)&&UO(t.b)?(u=t.r,l=t.g,c=t.b,e={r:255*MO(u,255),g:255*MO(l,255),b:255*MO(c,255)},a=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):UO(t.h)&&UO(t.s)&&UO(t.v)?(n=NO(t.s),i=NO(t.v),e=function(t,e,r){t=6*MO(t,360),e=MO(e,100),r=MO(r,100);var n=Math.floor(t),i=t-n,o=r*(1-e),a=r*(1-i*e),s=r*(1-(1-i)*e),u=n%6;return{r:255*[r,a,o,o,s,r][u],g:255*[s,r,r,a,o,o][u],b:255*[o,o,s,r,r,a][u]}}(t.h,n,i),a=!0,s="hsv"):UO(t.h)&&UO(t.s)&&UO(t.l)&&(n=NO(t.s),o=NO(t.l),e=function(t,e,r){var n,i,o;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(t=MO(t,360),e=MO(e,100),r=MO(r,100),0===e)n=i=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;n=a(u,s,t+1/3),i=a(u,s,t),o=a(u,s,t-1/3)}return{r:255*n,g:255*i,b:255*o}}(t.h,n,o),a=!0,s="hsl"),t.hasOwnProperty("a")&&(r=t.a));var u,l,c;return r=PO(r),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function hO(t,e,r){t=MO(t,255),e=MO(e,255),r=MO(r,255);var n,i,o=Math.max(t,e,r),a=Math.min(t,e,r),s=(o+a)/2;if(o==a)n=i=0;else{var u=o-a;switch(i=s>.5?u/(2-o-a):u/(o+a),o){case t:n=(e-r)/u+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,o.push(fO(n));return o}function CO(t,e){e=e||6;for(var r=fO(t).toHsv(),n=r.h,i=r.s,o=r.v,a=[],s=1/e;e--;)a.push(fO({h:n,s:i,v:o})),o=(o+s)%1;return a}fO.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t,e,r,n=this.toRgb();return t=n.r/255,e=n.g/255,r=n.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(t){return this._a=PO(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=pO(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=pO(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=hO(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=hO(this._r,this._g,this._b),e=Math.round(360*t.h),r=Math.round(100*t.s),n=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return dO(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return function(t,e,r,n,i){var o=[jO(Math.round(t).toString(16)),jO(Math.round(e).toString(16)),jO(Math.round(r).toString(16)),jO(RO(n))];if(i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1))return o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0);return o.join("")}(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*MO(this._r,255))+"%",g:Math.round(100*MO(this._g,255))+"%",b:Math.round(100*MO(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*MO(this._r,255))+"%, "+Math.round(100*MO(this._g,255))+"%, "+Math.round(100*MO(this._b,255))+"%)":"rgba("+Math.round(100*MO(this._r,255))+"%, "+Math.round(100*MO(this._g,255))+"%, "+Math.round(100*MO(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(AO[dO(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+yO(this._r,this._g,this._b,this._a),r=e,n=this._gradientType?"GradientType = 1, ":"";if(t){var i=fO(t);r="#"+yO(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+e+",endColorstr="+r+")"},toString:function(t){var e=!!t;t=t||this._format;var r=!1,n=this._a<1&&this._a>=0;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(r=this.toRgbString()),"prgb"===t&&(r=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(r=this.toHexString()),"hex3"===t&&(r=this.toHexString(!0)),"hex4"===t&&(r=this.toHex8String(!0)),"hex8"===t&&(r=this.toHex8String()),"name"===t&&(r=this.toName()),"hsl"===t&&(r=this.toHslString()),"hsv"===t&&(r=this.toHsvString()),r||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return fO(this.toString())},_applyModification:function(t,e){var r=t.apply(null,[this].concat([].slice.call(e)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(bO,arguments)},brighten:function(){return this._applyModification(xO,arguments)},darken:function(){return this._applyModification(wO,arguments)},desaturate:function(){return this._applyModification(vO,arguments)},saturate:function(){return this._applyModification(gO,arguments)},greyscale:function(){return this._applyModification(mO,arguments)},spin:function(){return this._applyModification(_O,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(TO,arguments)},complement:function(){return this._applyCombination(SO,arguments)},monochromatic:function(){return this._applyCombination(CO,arguments)},splitcomplement:function(){return this._applyCombination(kO,arguments)},triad:function(){return this._applyCombination(EO,[3])},tetrad:function(){return this._applyCombination(EO,[4])}},fO.fromRatio=function(t,e){if("object"==uO(t)){var r={};for(var n in t)t.hasOwnProperty(n)&&(r[n]="a"===n?t[n]:NO(t[n]));t=r}return fO(t,e)},fO.equals=function(t,e){return!(!t||!e)&&fO(t).toRgbString()==fO(e).toRgbString()},fO.random=function(){return fO.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},fO.mix=function(t,e,r){r=0===r?0:r||50;var n=fO(t).toRgb(),i=fO(e).toRgb(),o=r/100;return fO({r:(i.r-n.r)*o+n.r,g:(i.g-n.g)*o+n.g,b:(i.b-n.b)*o+n.b,a:(i.a-n.a)*o+n.a})},fO.readability=function(t,e){var r=fO(t),n=fO(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},fO.isReadable=function(t,e,r){var n,i,o=fO.readability(t,e);switch(i=!1,(n=function(t){var e,r;e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA");"small"!==r&&"large"!==r&&(r="small");return{level:e,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=o>=4.5;break;case"AAlarge":i=o>=3;break;case"AAAsmall":i=o>=7}return i},fO.mostReadable=function(t,e,r){var n,i,o,a,s=null,u=0;i=(r=r||{}).includeFallbackColors,o=r.level,a=r.size;for(var l=0;lu&&(u=n,s=fO(e[l]));return fO.isReadable(t,s,{level:o,size:a})||!i?s:(r.includeFallbackColors=!1,fO.mostReadable(t,["#fff","#000"],r))};var OO=fO.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},AO=fO.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(OO);function PO(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function MO(t,e){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(t)&&(t="100%");var r=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function IO(t){return Math.min(1,Math.max(0,t))}function LO(t){return parseInt(t,16)}function jO(t){return 1==t.length?"0"+t:""+t}function NO(t){return t<=1&&(t=100*t+"%"),t}function RO(t){return Math.round(255*parseFloat(t)).toString(16)}function DO(t){return LO(t)/255}var BO,FO,zO,GO=(FO="[\\s|\\(]+("+(BO="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+BO+")[,|\\s]+("+BO+")\\s*\\)?",zO="[\\s|\\(]+("+BO+")[,|\\s]+("+BO+")[,|\\s]+("+BO+")[,|\\s]+("+BO+")\\s*\\)?",{CSS_UNIT:new RegExp(BO),rgb:new RegExp("rgb"+FO),rgba:new RegExp("rgba"+zO),hsl:new RegExp("hsl"+FO),hsla:new RegExp("hsla"+zO),hsv:new RegExp("hsv"+FO),hsva:new RegExp("hsva"+zO),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function UO(t){return!!GO.CSS_UNIT.exec(t)}var VO=2,HO=.16,WO=.05,qO=.05,YO=.15,XO=5,ZO=4,KO=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function JO(t,e,r){var n;return(n=Math.round(t.h)>=60&&Math.round(t.h)<=240?r?Math.round(t.h)-VO*e:Math.round(t.h)+VO*e:r?Math.round(t.h)+VO*e:Math.round(t.h)-VO*e)<0?n+=360:n>=360&&(n-=360),n}function QO(t,e,r){return 0===t.h&&0===t.s?t.s:((n=r?t.s-HO*e:e===ZO?t.s+HO:t.s+WO*e)>1&&(n=1),r&&e===XO&&n>.1&&(n=.1),n<.06&&(n=.06),Number(n.toFixed(2)));var n}function $O(t,e,r){var n;return(n=r?t.v+qO*e:t.v-YO*e)>1&&(n=1),Number(n.toFixed(2))}function tA(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],n=fO(t),i=XO;i>0;i-=1){var o=n.toHsv(),a=fO({h:JO(o,i,!0),s:QO(o,i,!0),v:$O(o,i,!0)}).toHexString();r.push(a)}r.push(n.toHexString());for(var s=1;s<=ZO;s+=1){var u=n.toHsv(),l=fO({h:JO(u,s),s:QO(u,s),v:$O(u,s)}).toHexString();r.push(l)}return"dark"===e.theme?KO.map(function(t){var n=t.index,i=t.opacity;return fO.mix(e.backgroundColor||"#141414",r[n],100*i).toHexString()}):r}var eA={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},rA={},nA={};Object.keys(eA).forEach(function(t){rA[t]=tA(eA[t]),rA[t].primary=rA[t][5],nA[t]=tA(eA[t],{theme:"dark",backgroundColor:"#141414"}),nA[t].primary=nA[t][5]});rA.red,rA.volcano,rA.gold,rA.orange,rA.yellow,rA.lime,rA.green,rA.cyan,rA.blue,rA.geekblue,rA.purple,rA.magenta,rA.grey;var iA=function(t,e,r){var n=sO()(t),i=sO()(e);return sO()([(1-r)*n.red()+r*i.red(),(1-r)*n.green()+r*i.green(),(1-r)*n.blue()+r*i.blue()]).rgb()},oA=function(t,e,r,n){return void 0===e&&(e="#fff"),void 0===r&&(r="default"),void 0===n&&(n="rgb(150, 150, 150)"),"default"===r?function(t,e,r){void 0===e&&(e="#fff"),void 0===r&&(r="rgb(150, 150, 150)");var n=iA(e,t,.05).rgb().toString(),i=iA(e,t,.1).rgb().toString(),o=iA(e,t,.2).rgb().toString(),a=iA(e,t,.4).rgb().toString(),s=iA(e,r,.02).rgb().toString(),u=iA(e,r,.05).rgb().toString(),l=iA(e,r,.1).rgb().toString(),c=iA(e,r,.2).rgb().toString(),f=iA(e,r,.3).rgb().toString(),h=tA(t,{theme:"default",backgroundColor:e}),p=sO()(t).hex().toLowerCase(),d=h.indexOf(p),y=t;return-1!==d&&(y=h[d+1]),{mainStroke:t,mainFill:i,activeStroke:t,activeFill:n,inactiveStroke:a,inactiveFill:n,selectedStroke:t,selectedFill:e,highlightStroke:y,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:f,edgeActiveStroke:t,edgeInactiveStroke:c,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:l,comboMainStroke:f,comboMainFill:s,comboActiveStroke:t,comboActiveFill:n,comboInactiveStroke:f,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:y,comboHighlightFill:s,comboDisableStroke:c,comboDisableFill:u}}(t,e,"rgb(150, 150, 150)"):function(t,e,r){void 0===e&&(e="#fff"),void 0===r&&(r="#777");var n=iA(e,t,.2).rgb().toString(),i=iA(e,t,.3).rgb().toString(),o=iA(e,t,.6).rgb().toString(),a=iA(e,t,.8).rgb().toString(),s=iA(e,r,.2).rgb().toString(),u=iA(e,r,.25).rgb().toString(),l=iA(e,r,.3).rgb().toString(),c=iA(e,r,.4).rgb().toString(),f=iA(e,r,.5).rgb().toString(),h=tA(t,{theme:"dark",backgroundColor:e}),p=sO()(t).hex().toLowerCase(),d=h.indexOf(p),y=t;return-1!==d&&(y=h[d+1]),{mainStroke:a,mainFill:n,activeStroke:t,activeFill:i,inactiveStroke:a,inactiveFill:n,selectedStroke:t,selectedFill:n,highlightStroke:t,highlightFill:o,disableStroke:f,disableFill:u,edgeMainStroke:r,edgeActiveStroke:t,edgeInactiveStroke:r,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:l,comboMainStroke:c,comboMainFill:u,comboActiveStroke:t,comboActiveFill:s,comboInactiveStroke:c,comboInactiveFill:u,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:y,comboHighlightFill:u,comboDisableStroke:c,comboDisableFill:s}}(t,e,"#777")},aA=function(t,e,r,n){void 0===e&&(e="#fff"),void 0===r&&(r="default"),void 0===n&&(n="rgb(150, 150, 150)");var i=[];return t.forEach(function(t){i.push(oA(t,e,r,n))}),i},sA=oA("rgb(95, 149, 255)","rgb(255, 255, 255)"),uA={version:"0.8.23",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:sA.mainStroke,fill:sA.mainFill},size:20,color:sA.mainStroke,linkPoints:{size:8,lineWidth:1,fill:sA.activeFill,stroke:sA.activeStroke}},nodeStateStyles:{active:{fill:sA.activeFill,stroke:sA.activeStroke,lineWidth:2,shadowColor:sA.mainStroke,shadowBlur:10},selected:{fill:sA.selectedFill,stroke:sA.selectedStroke,lineWidth:4,shadowColor:sA.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:sA.highlightFill,stroke:sA.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:sA.inactiveFill,stroke:sA.inactiveStroke,lineWidth:1},disable:{fill:sA.disableFill,stroke:sA.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:"rgb(0, 0, 0)",textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:sA.edgeMainStroke,lineAppendWidth:2},color:sA.edgeMainStroke},edgeStateStyles:{active:{stroke:sA.edgeActiveStroke,lineWidth:1},selected:{stroke:sA.edgeSelectedStroke,lineWidth:2,shadowColor:sA.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:sA.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:sA.edgeInactiveStroke,lineWidth:1},disable:{stroke:sA.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:"rgb(0, 0, 0)",textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:sA.comboMainFill,lineWidth:1,stroke:sA.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:sA.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:sA.comboActiveStroke,lineWidth:1,fill:sA.comboActiveFill},selected:{stroke:sA.comboSelectedStroke,lineWidth:2,fill:sA.comboSelectedFill,shadowColor:sA.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:sA.comboHighlightStroke,lineWidth:2,fill:sA.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:sA.comboInactiveStroke,fill:sA.comboInactiveFill,lineWidth:1},disable:{stroke:sA.comboDisableStroke,fill:sA.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},lA=function t(e,r){var n;e.isGroup()&&r.isGroup()&&(null===(n=e.get("children"))||void 0===n||n.forEach(function(e,n){var i=r.get("children")[n];t(e,i)}));var i=e.get("type"),o=r.get("type");if("image"===i&&"image"===o){var a=e.get("clipShape");a&&r.setClip({type:a.get("type"),attrs:a.attr()})}};function cA(t,e,r){if(t){if("function"==typeof t.addEventListener)return t.addEventListener(e,r,!1),{remove:function(){t.removeEventListener(e,r,!1)}};if("function"==typeof t.attachEvent)return t.attachEvent("on"+e,r),{remove:function(){t.detachEvent("on"+e,r)}}}}var fA=Yk.cloneEvent,hA=Yk.isViewportChanged,pA=function(t){function e(e){var r=t.call(this,e)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=e,r.destroyed=!1,r.initEvents(),r}return(0,Gw.__extends)(e,t),e.prototype.initEvents=function(){var t=this.graph,e=this.extendEvents,r=void 0===e?[]:e,n=t.get("canvas"),i=n.get("el"),o=(0,Uw.wrapBehavior)(this,"onCanvasEvents"),a=(0,Uw.wrapBehavior)(this,"onExtendEvents"),s=(0,Uw.wrapBehavior)(this,"onWheelEvent");n.off("*").on("*",o),this.canvasHandler=o,r.push(cA(i,"wheel",s)),"undefined"!=typeof window&&(r.push(cA(window,"keydown",a)),r.push(cA(window,"keyup",a)),r.push(cA(window,"focus",a))),this.resetHandler&&t.off("afterchangedata",this.resetHandler),this.resetHandler=(0,Uw.wrapBehavior)(this,"resetStatus"),t.on("afterchangedata",this.resetHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var r=this,n=this.graph,i=n.get("canvas"),o=t.target,a=t.type;switch(a){case"drag":this.onCanvasEvents(Object.assign({},t,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},t,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"mouseup":setTimeout(function(){return r.mousedown=!1});break;case"click":if(!this.mousedown)return}t.canvasX=t.x,t.canvasY=t.y;var s={x:t.canvasX,y:t.canvasY},u=n.get("group").getMatrix();if(u||(u=[1,0,0,0,1,0,0,0,1]),hA(u)&&(s=n.getPointByClient(t.clientX,t.clientY)),t.x=s.x,t.y=s.y,t.currentTarget=n,o===i)return"mousemove"!==a&&"mouseleave"!==a||this.handleMouseMove(t,"canvas"),t.target=i,t.item=null,n.emit(a,t),void n.emit("canvas:".concat(a),t);var l=e.getItemRoot(o);if(l){var c=l.get("item");if(!c.destroyed){var f=c.getType();if(t.target=o,t.item=c,t.canvasX===t.x&&t.canvasY===t.y){var h=n.getCanvasByPoint(t.x,t.y);t.canvasX=h.x,t.canvasY=h.y}t.name&&!t.name.includes(":")?(n.emit("".concat(f,":").concat(a),t),n.emit(a,t)):t.name&&n.emit(t.name,t),"dragstart"===a&&(this.dragging=!0),"dragend"===a&&(this.dragging=!1),"mousemove"===a&&this.handleMouseMove(t,f)}}else n.emit(a,t)},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){(0,Uw.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,e){var r=this.graph,n=this.preItem,i=r.get("canvas"),o=t.target===i?null:t.item;t=fA(t),n&&n!==o&&!n.destroyed&&(t.item=n,this.emitCustomEvent(n.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(n.getType(),"dragleave",t)),o&&n!==o&&(t.item=o,this.emitCustomEvent(e,"mouseenter",t),this.dragging&&this.emitCustomEvent(e,"dragenter",t)),this.preItem=o},e.prototype.emitCustomEvent=function(t,e,r){r.type=e,this.graph.emit("".concat(t,":").concat(e),r)},e.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},e.prototype.destroy=function(){var t=this.graph,e=this.canvasHandler,r=this.extendEvents;t.get("canvas").off("*",e),(0,Uw.each)(r,function(t){t.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},e}(Zk),dA=r(9015),yA=r(6144),vA=r.n(yA),gA=Yk.traverseTree,mA=function(t,e){return t?(0,Uw.isNumber)(t)?function(e){return t}:t:function(t){return e||1}},bA=function(t,e){var r=[],n=[],i={},o=0;for(o=0;o=0&&(o="x",i="y");var a=0;gA(t,function(t){return a++,t.x>n.x&&(n.x=t.x),t.xn.y&&(n.y=t.y),t.yWebGL.
    ','Find out how to get it here.'].join("\n"):['Your browser does not seem to support WebGL.
    ','Find out how to get it here.'].join("\n")),t},addGetWebGLMessage:function(e){var r=void 0!==(e=e||{}).parent?e.parent:document.body,n=void 0!==e.id?e.id:"oldie",i=t().getWebGLErrorMessage();i.id=n,r.appendChild(i)}}},TA=function(){var t=navigator.userAgent.toLowerCase();return t.indexOf("firefox")>-1?"firefox":t.indexOf("safari")>-1?"safari":t.indexOf("opr")>-1?"opera":t.indexOf("chrome")>-1?"chrome":t.indexOf("trident")>-1?"ie 11":t.indexOf("ie")>-1?"ie":"unknown"},CA=(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},Yk),d),y),v),g),OA=CA.radialLayout,AA=function(){function t(t){this.type=t.type,this.radial=t.radial,this.config=t}return t.prototype.init=function(t){var e=this;this.data=t,this.radial?this.layoutMethod=function(t){var r=vA()[e.type](t,e.config);return OA(r),r}:this.layoutMethod=function(t){return vA()[e.type](t,e.config)}},t.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},t.prototype.layout=function(t){return this.init(t),this.execute()},t}();(0,dA.registerLayout)("grid",dA.GridLayout),(0,dA.registerLayout)("random",dA.RandomLayout),(0,dA.registerLayout)("force",dA.ForceLayout),(0,dA.registerLayout)("circular",dA.CircularLayout),(0,dA.registerLayout)("dagre",dA.DagreLayout),(0,dA.registerLayout)("dagreCompound",dA.DagreCompoundLayout),(0,dA.registerLayout)("radial",dA.RadialLayout),(0,dA.registerLayout)("concentric",dA.ConcentricLayout),(0,dA.registerLayout)("mds",dA.MDSLayout),(0,dA.registerLayout)("fruchterman",dA.FruchtermanLayout),(0,dA.registerLayout)("fruchterman-gpu",dA.FruchtermanGPULayout),(0,dA.registerLayout)("gForce",dA.GForceLayout),(0,dA.registerLayout)("force2",dA.Force2Layout),(0,dA.registerLayout)("gForce-gpu",dA.GForceGPULayout),(0,dA.registerLayout)("comboForce",dA.ComboForceLayout),(0,dA.registerLayout)("comboCombined",dA.ComboCombinedLayout),(0,dA.registerLayout)("forceAtlas2",dA.ForceAtlas2Layout);var PA=function(){return function(t,e){var r=t.toString(),n=new Blob(["importScripts('".concat(e,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(n))}}(),MA=function(t){return void 0===t&&(t="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js"),new PA(function(){var t={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout),onmessage=function(e){(function(e){var r=e.data.type;return r===t.RUN||r===t.GPURUN})(e)&&function(e){var r=this;switch(e.data.type){case t.RUN:var n,i=e.data,o=i.nodes,a=i.edges,s=i.layoutCfg,u=(p=void 0===s?{}:s).type;if(!(l=layout.getLayoutByName(u))){this.postMessage({type:t.ERROR,message:"layout ".concat(u," not found")});break}p.onLayoutEnd=function(){r.postMessage({type:t.END,nodes:o}),null===n||void 0===n||n.destroy()},(n=new l(p)).init({nodes:o,edges:a}),n.execute();break;case t.GPURUN:var l,c=e.data,f=c.nodes,h=(a=c.edges,c.layoutCfg),p=void 0===h?{}:h,d=c.canvas;if(u=p.type,!(l=layout.getLayoutByName(u))){this.postMessage({type:t.ERROR,message:"layout ".concat(u," not found")});break}if("gpu"!==u.split("-")[1]){this.postMessage({type:t.ERROR,message:"layout ".concat(u," does not support GPU")});break}var y=new l(p);y.init({nodes:f,edges:a}),y.executeWithWorker(d,this)}}(e)}},t)},IA="LAYOUT_RUN",LA="LAYOUT_END",jA="LAYOUT_ERROR",NA="LAYOUT_TICK",RA="GPU_LAYOUT_RUN",DA="GPU_LAYOUT_END";function BA(t){"@babel/helpers - typeof";return(BA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var FA=function(t){return setTimeout(t,16)},zA=function(t){return clearTimeout(t)},GA=function(t){return("undefined"!=typeof window&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||FA)(t)},UA=function(t){return("undefined"!=typeof window&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||zA)(t)},VA=["fruchterman","gForce"],HA=["force","grid","circular"],WA=function(t){function e(e){var r=t.call(this,e)||this;return r.graph=e,r.layoutCfg=e.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return(0,Gw.__extends)(e,t),e.prototype.initLayout=function(){},e.prototype.getWorker=function(){return this.worker?this.worker:("undefined"==typeof Worker?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=MA(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(UA(t.requestId),t.requestId=null),t.requestId2&&(UA(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,e){var r=this;return new Promise(function(n,i){return(0,Gw.__awaiter)(r,void 0,void 0,function(){var r,o,a,s,u,l,c,f,h;return(0,Gw.__generator)(this,function(p){switch(p.label){case 0:if(!(r=this.graph)||r.get("destroyed"))return[2];o=t.type,t.onLayoutEnd=function(){r.emit("aftersublayout",{type:o}),n()},o&&this.isGPU&&(YA(o)?o="".concat(o,"-gpu"):console.warn("The '".concat(o,"' layout does not support GPU calculation for now, it will run in CPU."))),Yk.isForce(o)?(a=t.onTick,s=t.animate,u=void 0===s&&("force"===o||"force2"===o),f=function(){a&&a(),(s||u)&&r.refreshPositions()},t.tick=f):"comboForce"!==o&&"comboCombined"!==o||(t.comboTrees=r.get("comboTrees")),!1;try{l=new dA.Layouts[o](t),this.layoutMethods[e]&&this.layoutMethods[e].destroy(),this.layoutMethods[e]=l}catch(t){console.warn("The layout method: '".concat(o,"' does not exist! Please specify it first.")),i()}return l.enableTick&&(c=t.onTick,f=function(){c&&c(),r.refreshPositions()},l.tick=f),function(t,e){var r;if(!(null===(r=null===t||void 0===t?void 0:t.nodes)||void 0===r?void 0:r.length))return;t.nodes.forEach(function(t){t.layoutOrder=e})}(h=this.filterLayoutData(this.data,t),e),l.init(h),r.emit("beforesublayout",{type:o}),[4,l.execute()];case 1:return p.sent(),l.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),[2]}})})})},e.prototype.updateLayoutMethod=function(t,e){var r=this;return new Promise(function(n,i){return(0,Gw.__awaiter)(r,void 0,void 0,function(){var r,i,o,a,s,u,l;return(0,Gw.__generator)(this,function(c){switch(c.label){case 0:return r=this.graph,i=null===e||void 0===e?void 0:e.type,e.onLayoutEnd=function(){r.emit("aftersublayout",{type:i}),n()},Yk.isForce(i)&&(o=e.onTick,a=e.animate,s=void 0===a&&("force"===i||"force2"===i),u=function(){null===o||void 0===o||o(),(a||s)&&r.refreshPositions()},e.tick=u),l=this.filterLayoutData(this.data,e),t.init(l),t.updateCfg(e),r.emit("beforesublayout",{type:i}),[4,t.execute()];case 1:return c.sent(),t.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var e,r=this,n=this.graph;if(n&&!n.get("destroyed")){this.data=this.setDataFromGraph();var i=this.data,o=i.nodes,a=i.hiddenNodes;if(!o)return!1;var s=n.get("width"),u=n.get("height"),l={};Object.assign(l,{width:s,height:u,center:[s/2,u/2]},this.layoutCfg),this.layoutCfg=l;var c=l.type,f=!1;null===(e=this.layoutMethods)||void 0===e||e.forEach(function(t){var e;return f=!!(null===(e=t.nodes)||void 0===e?void 0:e.length)||f});var h=this.destoryLayoutMethods();n.emit("beforelayout");var p=Promise.resolve();f&&c&&1===(null===h||void 0===h?void 0:h.length)&&h[0]===c?this.tweakInit():p=this.initPositions(l.center,o),this.initPositions(l.center,a).then(),this.isGPU=XA(l,c);var d=l.onLayoutEnd,y=l.layoutEndFormatted,v=l.adjust;if(y||(l.layoutEndFormatted=!0,l.onAllLayoutEnd=function(){return(0,Gw.__awaiter)(r,void 0,void 0,function(){return(0,Gw.__generator)(this,function(t){switch(t.label){case 0:return d&&d(o),this.refreshLayout(),v&&l.pipes?[4,this.adjustPipesBox(this.data,v)]:[3,2];case 1:t.sent(),this.refreshLayout(),t.label=2;case 2:return n.emit("afterlayout"),[2]}})})}),this.stopWorker(),l.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;var g=!1;return l.type?(g=!0,p=p.then(function(){return(0,Gw.__awaiter)(r,void 0,void 0,function(){return(0,Gw.__generator)(this,function(t){switch(t.label){case 0:return[4,this.execLayoutMethod(l,0)];case 1:return[2,t.sent()]}})})})):l.pipes&&(g=!0,l.pipes.forEach(function(t,e){p=p.then(function(){return(0,Gw.__awaiter)(r,void 0,void 0,function(){return(0,Gw.__generator)(this,function(r){switch(r.label){case 0:return[4,this.execLayoutMethod(t,e)];case 1:return[2,r.sent()]}})})})})),g?p.then(function(){l.onAllLayoutEnd&&l.onAllLayoutEnd(),t&&t()}).catch(function(t){console.warn("graph layout failed,",t)}):(n.refreshPositions(),null===t||void 0===t||t()),!1}},e.prototype.tweakInit=function(){var t=this.data,e=this.graph,r=t.nodes,n=t.edges;if(null===r||void 0===r?void 0:r.length){var i={};r.forEach(function(t){var e=t.x,r=t.y;isNaN(e)||isNaN(r)||(i[t.id]={x:e,y:r},t.mass=t.mass||2)}),n.forEach(function(t){var e=t.source,r=t.target,n=i[e],o=i[r];!n&&o?i[e]={x:o.x+80*(Math.random()-.5),y:o.y+80*(Math.random()-.5)}:!o&&n&&(i[r]={x:n.x+80*(Math.random()-.5),y:n.y+80*(Math.random()-.5)})});var o=e.get("width"),a=e.get("height");r.forEach(function(t){var e=i[t.id]||{x:o/2+20*(Math.random()-.5),y:a/2+20*(Math.random()-.5)};t.x=e.x,t.y=e.y})}},e.prototype.initWithPreset=function(t,e){var r=this;return new Promise(function(n,i){return(0,Gw.__awaiter)(r,void 0,void 0,function(){var r,i,o,a,s,u,l;return(0,Gw.__generator)(this,function(c){switch(c.label){case 0:return i=(r=this).layoutCfg,o=r.data,(null===(a=i.preset)||void 0===a?void 0:a.type)&&dA.Layouts[null===a||void 0===a?void 0:a.type]?(s=XA(a,a.type),u=s?"".concat(a.type,"-gpu"):a.type,l=new dA.Layouts[u](a),delete i.preset,l.init(o),[4,l.execute()]):(null===e||void 0===e||e(),n(),[2,!1]);case 1:return c.sent(),null===t||void 0===t||t(),n(),[2,!0]}})})})},e.prototype.layoutWithWorker=function(t,e){var r=this,n=this.layoutCfg,i=this.graph,o=this.getWorker(),a=this.workerData;if(!o)return!1;a.requestId=null,a.requestId2=null,a.currentTick=null,a.currentTickData=null,i.emit("beforelayout");var s=Promise.resolve(),u=!1;if(n.type)u=!0,s=s.then(function(){return r.runWebworker(o,t,n)});else if(n.pipes){u=!0;for(var l=function(e){s=s.then(function(){return r.runWebworker(o,t,e)})},c=0,f=n.pipes;c'),u=r?r.backgroundColor:void 0,l=r?r.padding:void 0;l?(0,Uw.isNumber)(l)&&(l=[l,l,l,l]):l=[0,0,0,0];var c=i+l[0]+l[2],f=o+l[1]+l[3],h={container:s,height:c,width:f,quickHit:!0},p="svg"===a?new nO(h):new cC(h),d=this.get("group").clone(),y=(0,Uw.clone)(d.getMatrix());y||(y=[1,0,0,0,1,0,0,0,1]);var v=(n.maxX+n.minX)/2,g=(n.maxY+n.minY)/2;y=ZA(y,[["t",-v,-g],["t",o/2+l[3],i/2+l[0]]]),d.resetMatrix(),d.setMatrix(y),p.add(d);var m=p.get("el"),b="";e||(e="image/png"),setTimeout(function(){if("svg"===a){var r=m.cloneNode(!0),n=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),i=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",n);i.replaceChild(r,i.documentElement);var o=(new XMLSerializer).serializeToString(i);b="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(o))}else{var s=void 0,l=m.getContext("2d"),h=void 0;if(u){var p="undefined"!=typeof window?window.devicePixelRatio:1;try{s=l.getImageData(0,0,f*p,c*p),h=l.globalCompositeOperation,l.globalCompositeOperation="destination-over",l.fillStyle=u,l.fillRect(0,0,f,c)}catch(t){console.error("Download image failed. Out of memory at ImageData creation")}}b=m.toDataURL(e),u&&(l.clearRect(0,0,f,c),l.putImageData(s,0,0),l.globalCompositeOperation=h)}t&&t(b)},16)},e.prototype.downloadFullImage=function(t,e,r){var n=this,i=this.get("group").getCanvasBBox(),o=i.height,a=i.width,s=this.get("renderer"),u=oO('
    '),l=document.querySelector(".g6-graph-watermarker"),c=r?r.backgroundColor:void 0,f=r?r.padding:void 0;f?(0,Uw.isNumber)(f)&&(f=[f,f,f,f]):f=[0,0,0,0];var h=o+f[0]+f[2],p=a+f[1]+f[3];if(l){var d=this.get("graphWaterMarker").cfg||{},y=d.width,v=d.height;h=Math.ceil(h/v)*v,p=Math.ceil(p/y)*y}var g,m,b={container:u,height:h,width:p},x="svg"===s?new nO(b):new cC(b),w=this.get("group"),_=(m=(g=w).clone(),lA(g,m),m),S=(0,Uw.clone)(_.getMatrix());S||(S=[1,0,0,0,1,0,0,0,1]);var E=(i.maxX+i.minX)/2,k=(i.maxY+i.minY)/2;S=ZA(S,[["t",-E,-k],["t",a/2+f[3],o/2+f[0]]]),_.resetMatrix(),_.setMatrix(S),x.add(_);var T=x.get("el");e||(e="image/png"),this.asyncToDataUrl(e,c,function(r){var i=document.createElement("a"),o=(t||"graph")+("svg"===s?".svg":".".concat(e.split("/")[1]));n.dataURLToImage(r,s,i,o);var a=document.createEvent("MouseEvents");a.initEvent("click",!1,!1),i.dispatchEvent(a)},p,h,T)},e.prototype.downloadImage=function(t,e,r){var n=this;this.stopAnimate();var i=this.get("canvas").getRenderer();e||(e="image/png");var o=(t||"graph")+("svg"===i?".svg":".".concat(e.split("/")[1])),a=document.createElement("a");this.asyncToDataUrl(e,r,function(t){n.dataURLToImage(t,i,a,o);var e=document.createEvent("MouseEvents");e.initEvent("click",!1,!1),a.dispatchEvent(e)})},e.prototype.dataURLToImage=function(t,e,r,n){if(t&&"data:"!==t){if("undefined"!=typeof window)if(window.Blob&&window.URL&&"svg"!==e){var i=t.split(","),o="";if(i&&i.length>0){var a=i[0].match(/:(.*?);/);a&&a.length>=2&&(o=a[1])}for(var s=atob(i[1]),u=s.length,l=new Uint8Array(u);u--;)l[u]=s.charCodeAt(u);var c=new Blob([l],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(c,n):r.addEventListener("click",function(){r.download=n,r.href=window.URL.createObjectURL(c)})}else r.addEventListener("click",function(){r.download=n,r.href=t})}else console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items")},e.prototype.addPlugin=function(t){t.destroyed||(this.get("plugins").push(t),t.initPlugin(this))},e.prototype.removePlugin=function(t){var e=this.get("plugins"),r=e.indexOf(t);r>=0&&(t.destroyPlugin(),e.splice(r,1))},e.prototype.setImageWaterMarker=function(t,e){void 0===t&&(t=uA.waterMarkerImage);var r=this.get("container");(0,Uw.isString)(r)&&(r=document.getElementById(r)),r.style.position||(r.style.position="relative");var n=this.get("graphWaterMarker"),i=(0,Uw.deepMix)({},uA.imageWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.image;if(!t){var l=s?r:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(n&&n.clear())}if(n)n.clear();else{var c={container:r,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f,window.devicePixelRatio=f),n=new cC(c),this.set("graphWaterMarker",n)}n.get("el").style.display="none";var h=n.get("context"),p=u.rotate,d=u.x,y=u.y;h.rotate(-p*Math.PI/180);var v=new Image;v.crossOrigin="anonymous",v.src=t,v.onload=function(){if(h.drawImage(v,d,y,u.width,u.height),h.rotate(p*Math.PI/180),s)r.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var t=document.querySelector(".g6-graph-watermarker");t||((t=document.createElement("div")).className="g6-graph-watermarker"),t.className="g6-graph-watermarker",n.destroyed||(t.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),r.appendChild(t))}}},e.prototype.setTextWaterMarker=function(t,e){var r=this.get("container");(0,Uw.isString)(r)&&(r=document.getElementById(r)),r.style.position||(r.style.position="relative");var n=this.get("graphWaterMarker"),i=(0,Uw.deepMix)({},uA.textWaterMarkerConfig,e),o=i.width,a=i.height,s=i.compatible,u=i.text;if(!(null===t||void 0===t?void 0:t.length)){var l=s?r:document.querySelector(".g6-graph-watermarker");return l&&(l.style.cssText=void 0),void(n&&n.clear())}if(n)n.clear();else{var c={container:r,width:o,height:a,capture:!1},f=this.get("pixelRatio");f&&(c.pixelRatio=f,window.devicePixelRatio=f),n=new cC(c),this.set("graphWaterMarker",n)}n.get("el").style.display="none";var h=n.get("context"),p=u.rotate,d=u.fill,y=u.fontFamily,v=u.fontSize,g=u.baseline,m=u.x,b=u.y,x=u.lineHeight;h.rotate(-p*Math.PI/180),h.font="".concat(v,"px ").concat(y),h.fillStyle=d,h.textBaseline=g;for(var w=(0,Uw.isString)(t)?[t]:t,_=w.length-1;_>=0;_--)h.fillText(w[_],m,b+_*x);if(h.rotate(p*Math.PI/180),s)r.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var S=document.querySelector(".g6-graph-watermarker");S||((S=document.createElement("div")).className="g6-graph-watermarker"),S.style.cssText="background-image: url(".concat(n.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),r.appendChild(S)}},e.prototype.destroy=function(){var e,r,n,i;(0,Uw.each)(this.get("plugins"),function(t){t.destroyPlugin()});var o=this.get("tooltips");if(o)for(var a=0;a0)for(var l=u.length-1;l>=0;l--){var c=u[l].getModel();-1===e.indexOfChild(t.children||[],c.id)&&(i.innerRemoveChild(c.id,{x:t.x,y:t.y},n),u.splice(l,1))}o.get("originAttrs")&&(a=o.get("originAttrs").x,s=o.get("originAttrs").y);var f=o.getModel();n&&o.set("originAttrs",{x:f.x,y:f.y}),o.set("model",Object.assign(f,t.data)),a===t.x&&s===t.y||o.updatePosition({x:t.x,y:t.y})}else i.innerAddChild(t,r,n)},e.prototype.innerRemoveChild=function(t,e,r){var n=this,i=n.findById(t);if(i)if((0,Uw.each)(i.get("children"),function(t){n.innerRemoveChild(t.getModel().id,e,r)}),r){var o=i.getModel();i.set("to",e),i.set("originAttrs",{x:o.x,y:o.y}),n.get("removeList").push(i)}else n.removeItem(i,!1)},e.prototype.changeData=function(t,e){void 0===e&&(e=!0);var r=this;this.getNodes().map(function(t){return r.clearItemStates(t)}),this.getEdges().map(function(t){return r.clearItemStates(t)}),e&&this.get("enabledStack")&&this.pushStack("changedata",{before:r.get("originData"),after:t||r.get("data")}),t?(r.data(t),r.render(!1)):r.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");this.updateLayout(t)},e.prototype.updateLayout=function(t,e,r,n){void 0===n&&(n=!0);if(t){if(n&&this.get("enabledStack")&&this.pushStack("layout",{before:this.get("layout"),after:t}),this.set("layout",t),this.set("layoutMethod",this.getLayout()),this.layout(),e){var i=r;i||(i="begin"===e?{x:0,y:0}:{x:this.getWidth()/2,y:this.getHeight()/2}),i=this.getPointByCanvas(i.x,i.y);var o=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];i.x=i.x*o[0]+o[6],i.y=i.y*o[0]+o[7];var a=this.getGroup().getCanvasBBox(),s=a.minX,u=a.maxX,l=a.minY,c={x:(s+u)/2,y:(l+a.maxY)/2};"begin"===e&&(c.x=s,c.y=l),this.translate(i.x-c.x,i.y-c.y)}}else console.warn("layout cannot be null")},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");this.layout(t)},e.prototype.layout=function(t){var e=this,r=this.get("data"),n=this.get("layoutMethod"),i=this.get("layout"),o=r;if(null===i||void 0===i?void 0:i.excludeInvisibles){r=(0,Uw.clone)(this.get("data"));var a={};tP(r,function(t){var r=t.children;if(!(null===r||void 0===r?void 0:r.length))return!0;for(var n=r.length-1;n>=0;n--){var i=e.findById(r[n].id);(i?!i.isVisible():!1===r[n].visible)&&(a[t.id]=a[t.id]||[],a[t.id].push({idx:n,child:r.splice(n,1)[0]}))}}),o=n?n(r,this.get("layout")):r,tP(o,function(t){var e=a[t.id];if(null===e||void 0===e?void 0:e.length)for(var r=e.length-1;r>=0;r--){var n=e[r],i=n.idx,o=n.child;t.children.splice(i,0,o)}})}else o=n?n(r,this.get("layout")):r;var s=this.get("animate");(this.emit("beforerefreshlayout",{data:r,layoutData:o}),this.emit("beforelayout"),this.innerUpdateChild(o,void 0,s),t)&&this.get("viewController").fitView();s?this.layoutAnimate(o):(this.refresh(),this.paint()),this.emit("afterrefreshlayout",{data:r,layoutData:o}),this.emit("afterlayout")},e.prototype.addChild=function(t,e,r){void 0===r&&(r=!0);this.emit("beforeaddchild",{model:t,parent:e}),(0,Uw.isString)(e)||(e=e.get("id"));var n=this.findDataById(e);n&&(n.children||(n.children=[]),n.children.push(t),this.findById(e).refresh(),this.changeData(void 0,r))},e.prototype.updateChildren=function(t,e,r){void 0===r&&(r=!0);var n=this.findById(e);e&&n?(this.findDataById(e).children=t,n.refresh(),this.changeData(void 0,r)):console.warn("Update children failed! There is no node with id '".concat(e,"'"))},e.prototype.updateChild=function(t,r,n){void 0===n&&(n=!0);if(r&&this.findById(r)){var i=this.findDataById(r),o=this.findById(t.id);if(i.children||(i.children=[]),o){var a=e.indexOfChild(i.children,t.id);a>-1&&(i.children[a]=t)}else i.children.push(t);var s=this.findById(r);null===s||void 0===s||s.refresh(),this.changeData(void 0,n)}else this.changeData(t,n)},e.prototype.removeChild=function(t,r){void 0===r&&(r=!0);var n,i=this.findById(t);if((n=i?null===i||void 0===i?void 0:i.get("parent"):this.getNodes().find(function(e){return!!(e.getModel().children||[]).find(function(e){return e.id===t})}))&&!n.destroyed){var o=n.get("id"),a=this.findDataById(o),s=a&&a.children||[],u=e.indexOfChild(s,t);s.splice(u,1),n.refresh()}this.changeData(void 0,r)},e.prototype.findDataById=function(t,e){var r=this;if(e||(e=r.get("data")),t===e.id)return e;var n=null;return(0,Uw.each)(e.children||[],function(e){return e.id===t?(n=e,!1):!(n=r.findDataById(t,e))&&void 0}),n},e.prototype.layoutAnimate=function(t,e){var r=this,n=this.get("animateCfg");r.emit("beforeanimate",{data:t}),r.getEdges().forEach(function(t){var e=t.get("model");e.sourceAnchor||(e.sourceAnchor=t.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(n){tP(t,function(i){var o=r.findById(i.id);if(o){var a=o.get("originAttrs"),s=o.get("model");if(a||(a={x:s.x,y:s.y},o.set("originAttrs",a)),e){var u=e(o,n,a,t);o.set("model",Object.assign(s,u))}else s.x=a.x+(i.x-a.x)*n,s.y=a.y+(i.y-a.y)*n}return!0}),(0,Uw.each)(r.get("removeList"),function(t){var e=t.getModel(),r=t.get("originAttrs"),i=t.get("to");e.x=r.x+(i.x-r.x)*n,e.y=r.y+(i.y-r.y)*n}),r.refreshPositions()},{duration:n.duration,easing:n.ease,callback:function(){(0,Uw.each)(r.getNodes(),function(t){t.set("originAttrs",null)}),(0,Uw.each)(r.get("removeList"),function(t){r.removeItem(t,!1)}),r.set("removeList",[]),n.callback&&n.callback(),r.emit("afteranimate",{data:t})},delay:n.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){void 0===t&&(t=!0);var e=this.get("data");if(!e||!(0,Uw.isObject)(e)||!Object.keys(e).length)throw new Error("data must be defined first");this.clear(),t&&this.get("enabledStack")&&this.clearStack(),this.emit("beforerender"),this.layout(this.get("fitView")),this.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(e){t.prototype.data.call(this,e),this.set("originData",QA(e))},e}(KA);function rP(t,e){if(t)for(var r in e)e.hasOwnProperty(r)&&(t.style[r]=e[r]);return t}var nP=function(){function t(t){this._cfgs=(0,Uw.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return t.prototype.getDefaultCfgs=function(){return{}},t.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var r=e.getEvents(),n={};(0,Uw.each)(r,function(r,i){var o=(0,Uw.wrapBehavior)(e,r);n[i]=o,t.on(i,o)}),this._events=n,this.init()},t.prototype.getEvents=function(){return{}},t.prototype.get=function(t){var e;return null===(e=this._cfgs)||void 0===e?void 0:e[t]},t.prototype.set=function(t,e){this._cfgs[t]=e},t.prototype.destroy=function(){},t.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,Uw.each)(e,function(e,r){t.off(r,e)}),this._events=null,this._cfgs=null,this.destroyed=!0},t}(),iP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oP="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",aP=function(t){function e(e){return t.call(this,e)||this}return iP(e,t),e.prototype.getDefaultCfgs=function(){return{img:oP,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),e=t.get("container"),r=t.get("canvas").get("el"),n=this.get("img")||oP;n.includes("url(")||(n='url("'.concat(n,'")'));var i=oO("
    "),o=oO(""));this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),e.insertBefore(i,r)},e.prototype.positionInit=function(){var t=this.get("graph"),e=t.get("minZoom"),r=t.get("width"),n=t.get("height");rP(this.get("container"),{width:"".concat(r,"px"),height:"".concat(n,"px")});var i=80*r/e,o=80*n/e;rP(this.get("gridContainer"),{width:"".concat(i,"px"),height:"".concat(o,"px"),left:"-".concat(i/2,"px"),top:"-".concat(o/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var e=this.get("gridContainer"),r=t.matrix;r||(r=[1,0,0,0,1,0,0,0,1]);var n=this.get("follow");rP(e,{transform:"matrix(".concat(r[0],", ").concat(r[1],", ").concat(r[3],", ").concat(r[4],", ").concat(n?r[6]:"0",", ").concat(n?r[7]:"0",")")})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph").get("container"),e=this.get("container");t.removeChild(e)},e}(nP),sP=r(3448),uP=r.n(sP),lP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();"undefined"!=typeof document&&uP()("\n .g6-component-contextmenu {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .g6-contextmenu-ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n");var cP=function(t){function e(e){return t.call(this,e)||this}return lP(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(t){return"\n
      \n
    • 菜单项1
    • \n
    • 菜单项2
    • \n
    \n "},shouldBegin:function(t){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),e=oO("
    "));rP(e,{top:"0px",position:"absolute",visibility:"hidden"});var r=this.get("container");r||(r=this.get("graph").get("container")),(0,Uw.isString)(r)&&(r=document.getElementById(r)),r.appendChild(e),this.set("menu",e)},e.prototype.onMenuShow=function(t){var e=this;t.preventDefault();var r=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&-1===r.indexOf(t.item.getType()))return void e.onMenuHide()}else if(-1===r.indexOf("canvas"))return void e.onMenuHide();if(this.get("shouldBegin")(t)){var n=this.get("menu"),i=this.get("getContent"),o=this.get("graph"),a=i(t,o);(0,Uw.isString)(a)?n.innerHTML=a:n.innerHTML=a.outerHTML,this.removeMenuEventListener();var s=this.get("handleMenuClick");if(s){var u=function(e){s(e.target,t.item,o)};this.set("handleMenuClickWrapper",u),n.addEventListener("click",u)}var l=o.get("width"),c=o.get("height"),f=n.getBoundingClientRect(),h=this.get("offsetX")||0,p=this.get("offsetY")||0,d=o.getContainer().offsetTop,y=o.getContainer().offsetLeft,v=t.canvasX+y+h,g=t.canvasY+d+p;v+f.width>l&&(v=t.canvasX-f.width-h+y),g+f.height>c&&(g=t.canvasY-f.height-p+d),g<0&&(g=0),rP(n,{top:"".concat(g,"px"),left:"".concat(v,"px"),visibility:"visible"});var m="click"===this.get("trigger"),b=function(t){m?m=!1:e.onMenuHide()};document.body.addEventListener("click",b),this.set("handler",b)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),e=this.get("handler");t&&(this.get("menu").removeEventListener("click",t),this.set("handleMenuClickWrapper",null));e&&document.body.removeEventListener("click",e)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&rP(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Uw.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(nP),fP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hP=function(){return(hP=Object.assign||function(t){for(var e,r=1,n=arguments.length;r-1,a=navigator.userAgent.toLowerCase().indexOf("safari")>-1,s=oO("\n ")),u=0,l=0,c=!1,f=0,h=0,p=0,d=0,y=0,v=0,g=a||o?"mousedown":"dragstart";s.addEventListener(g,function(i){var o,a;if(i.dataTransfer){var g=new Image;g.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",null===(a=(o=i.dataTransfer).setDragImage)||void 0===a||a.call(o,g,0,0);try{i.dataTransfer.setData("text/html","view-port-minimap")}catch(t){i.dataTransfer.setData("text","view-port-minimap")}}if(e.refresh=!1,i.target===s){var m=s.style;f=parseInt(m.left,10),h=parseInt(m.top,10),p=parseInt(m.width,10),d=parseInt(m.height,10),p>r[0]||d>r[1]||(v=n.getZoom(),y=t.get("ratio"),c=!0,u=i.clientX,l=i.clientY)}},!1);var m=function(t){if(c&&!(0,Uw.isNil)(t.clientX)&&!(0,Uw.isNil)(t.clientY)){var e=u-t.clientX,i=l-t.clientY;(f-e<0||f-e+p>=r[0])&&(e=0),(h-i<0||h-i+d>=r[1])&&(i=0),h-=i,rP(s,{left:"".concat(f-=e,"px"),top:"".concat(h,"px")}),n.translate(e*v/y,i*v/y),u=t.clientX,l=t.clientY}};a||o||s.addEventListener("drag",m,!1);var b=function(){c=!1,e.refresh=!0},x=a||o?"mouseup":"dragend";s.addEventListener(x,b,!1),i.addEventListener("mouseleave",b),i.addEventListener("mouseup",b),(a||o)&&i.addEventListener("mousemove",m,!1),this.set("viewport",s),i.appendChild(s)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("totaldx"),r=this.get("totaldy"),n=this.get("graph"),i=this.get("size"),o=n.get("canvas").get("el"),a=n.get("width")||o.scrollWidth||500,s=n.get("height")||o.scrollHeight||500,u=n.getPointByCanvas(0,0),l=n.getPointByCanvas(a,s),c=this.get("viewport");c||this.initViewport();var f=(l.x-u.x)*t,h=(l.y-u.y)*t,p=u.x*t+e,d=u.y*t+r,y=p+f,v=d+h;p<0&&(f+=p,p=0),y>i[0]&&(f-=y-i[0]),d<0&&(h+=d,d=0),v>i[1]&&(h-=v-i[1]),this.set("ratio",t),rP(c,{left:"".concat(p,"px"),top:"".concat(d,"px"),width:"".concat(f,"px"),height:"".concat(h,"px")})}},e.prototype.updateGraphShapes=function(){var t,e=this._cfgs.graph,r=this.get("canvas"),n=e.get("group");n.destroyed||(r.clear(),this.get("hideEdge")?(t=r.addGroup(),n.get("children").forEach(function(e){e.get("id").includes("-edge")||t.add(e.clone())})):((t=n.clone()).resetMatrix(),r.add(t)),"svg"===e.get("renderer")&&this.updateVisible(t))},e.prototype.updateVisible=function(t){var e=this;if(t.isGroup()||t.get("visible")){var r=t.get("children");if(!r||!r.length)return;r.forEach(function(t){t.get("visible")||t.hide(),e.updateVisible(t)})}else t.hide()},e.prototype.updateKeyShapes=function(){var t=this,e=this._cfgs.graph,r=this.get("canvas"),n=r.get("children")[0]||r.addGroup();this.get("hideEdge")||(0,Uw.each)(e.getEdges(),function(e){t.updateOneEdgeKeyShape(e,n)}),(0,Uw.each)(e.getNodes(),function(e){t.updateOneNodeKeyShape(e,n)});var i=e.getCombos();if(i&&i.length){var o=n.find(function(t){return"comboGroup"===t.get("name")})||n.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Uw.each)(i,function(e){t.updateOneComboKeyShape(e,o)}),null===o||void 0===o||o.sort(),null===o||void 0===o||o.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,e){if(!this.destroyed){var r=this.get("itemMap")||{},n=r[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};n?s=Object.assign(a,s):(n=o,e.add(n));var u=n.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),n.attr(s),t.isVisible()?n.show():n.hide(),n.exist=!0;var l=t.getModel().depth;isNaN(l)||n.set("zIndex",l),r[t.get("id")]=n,this.set("itemMap",r)}},e.prototype.updateOneNodeKeyShape=function(t,e){var r=this.get("itemMap")||{},n=r[t.get("id")],i=t.getBBox(),o=t.get("keyShape").clone(),a=o.attr(),s={x:i.centerX,y:i.centerY};n?(s=Object.assign(a,s),n.toFront()):(n=o,e.add(n));var u=n.get("type");"rect"!==u&&"image"!==u||(s.x=i.minX,s.y=i.minY),n.attr(s),t.isVisible()?n.show():n.hide(),n.exist=!0;var l=t.getModel().depth;isNaN(l)||n.set("zIndex",l),r[t.get("id")]=n,this.set("itemMap",r)},e.prototype.updateDelegateShapes=function(){var t=this,e=this._cfgs.graph,r=this.get("canvas"),n=r.get("children")[0]||r.addGroup();this.get("hideEdge")||(0,Uw.each)(e.getEdges(),function(e){t.updateOneEdgeKeyShape(e,n)}),(0,Uw.each)(e.getNodes(),function(e){t.updateOneNodeDelegateShape(e,n)});var i=e.getCombos();if(i&&i.length){var o=n.find(function(t){return"comboGroup"===t.get("name")})||n.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,Uw.each)(i,function(e){t.updateOneComboKeyShape(e,o)}),null===o||void 0===o||o.sort(),null===o||void 0===o||o.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},e=Object.keys(t);if(e&&0!==e.length)for(var r=e.length-1;r>=0;r--){var n=t[e[r]],i=n.exist;n.exist=!1,i||(n.remove(),delete t[e[r]])}},e.prototype.updateOneEdgeKeyShape=function(t,e){var r=this.get("itemMap")||{},n=r[t.get("id")];if(n){var i=t.get("keyShape").attr("path");n.attr("path",i)}else n=t.get("keyShape").clone(),e.add(n);t.isVisible()?n.show():n.hide(),n.exist=!0,r[t.get("id")]=n,this.set("itemMap",r)},e.prototype.updateOneNodeDelegateShape=function(t,e){var r=this.get("delegateStyle"),n=this.get("itemMap")||{},i=n[t.get("id")],o=t.getBBox();if(i){var a={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(a),i.toFront()}else i=e.addShape("rect",{attrs:hP({x:o.minX,y:o.minY,width:o.width,height:o.height},r),name:"minimap-node-shape"});t.isVisible()?i.show():i.hide(),i.exist=!0,n[t.get("id")]=i,this.set("itemMap",n)},e.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},e.prototype.initContainer=function(){var t=this.get("graph"),e=this.get("size"),r=this.get("className"),n=this.get("container"),i=oO("
    "));(0,Uw.isString)(n)&&(n=document.getElementById(n)),n?n.appendChild(i):t.get("container").appendChild(i),this.set("container",i);var o,a=oO('
    ');i.appendChild(a),a.addEventListener("dragenter",function(t){t.preventDefault()}),a.addEventListener("dragover",function(t){t.preventDefault()}),o="svg"===t.get("renderer")?new nO({container:a,width:e[0],height:e[1]}):new cC({container:a,width:e[0],height:e[1]}),this.set("canvas",o),this.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed&&this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("size"),r=this.get("canvas"),n=this.get("type"),i=this.get("padding");if(!r.destroyed){switch(n){case"default":this.updateGraphShapes();break;case"keyShape":this.updateKeyShapes();break;case"delegate":this.updateDelegateShapes()}var o=r.get("children")[0];if(o){o.resetMatrix();var a=o.getCanvasBBox(),s=t.get("canvas").getCanvasBBox(),u=t.getZoom()||1,l=s.width/u,c=s.height/u;Number.isFinite(a.width)&&(l=pP(a.width,l),c=pP(a.height,c)),l+=2*i,c+=2*i;var f=Math.min(e[0]/l,e[1]/c),h=[1,0,0,0,1,0,0,0,1],p=0,d=0;Number.isFinite(a.minX)&&(p=-a.minX),Number.isFinite(a.minY)&&(d=-a.minY);var y=(e[0]-(l-2*i)*f)/2,v=(e[1]-(c-2*i)*f)/2;h=dP(h,[["t",p,d],["s",f,f],["t",y,v]]),o.setMatrix(h),this.set("ratio",f),this.set("totaldx",y+p*f),this.set("totaldy",v+d*f),this.set("dx",y),this.set("dy",v),this.updateViewport()}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("container");(null===e||void 0===e?void 0:e.parentNode)&&e.parentNode.removeChild(e)},e}(nP),vP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function gP(t,e,r){var n=t.x-e.x,i=t.y-e.y;return!r||Math.abs(n)>r||Math.abs(i)>r?Math.sqrt(n*n+i*i):r}function mP(t,e){var r=(e.source.y-e.target.y)/(e.source.x-e.target.x),n=(r*r*e.source.x+r*(t.y-e.source.y)+t.x)/(r*r+1);return{x:n,y:r*(n-e.source.x)+e.source.y}}var bP=function(t){function e(e){return t.call(this,e)||this}return vP(e,t),e.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},e.prototype.init=function(){var t=this.get("graph"),e=this.get("onTick");this.set("tick",function(){e&&e(),t.refreshPositions()})},e.prototype.bundling=function(t){var e=this;if(e.set("data",t),!e.isTicking()){var r=t.edges||[],n={},i=!1;if((t.nodes||[]).forEach(function(t){null!==t.x&&null!==!t.y&&void 0!==t.x&&void 0!==!t.y||(i=!0),n[t.id]=t}),i)throw new Error("please layout the graph or assign x and y for nodes first");e.set("nodeIdMap",n);var o=e.get("divisions"),a=e.get("divRate"),s=e.divideEdges(o);e.set("edgePoints",s);var u=e.getEdgeBundles();e.set("edgeBundles",u);for(var l=e.get("cycles"),c=e.get("iterations"),f=e.get("iterRate"),h=e.get("lambda"),p=0;pc;){var n=c/r,a={x:i[o][e-1].x,y:i[o][e-1].y};a.x+=n*(t.x-i[o][e-1].x),a.y+=n*(t.y-i[o][e-1].y),f.push(a),r-=c,c=l}c-=r}}),f.push({x:u.x,y:u.y}),i[o]=f}}),i},e.prototype.getEdgeLength=function(t){var e=0;return t.forEach(function(r,n){0!==n&&(e+=gP(r,t[n-1]))}),e},e.prototype.getEdgeBundles=function(){var t=this,e=t.get("data").edges||[],r=t.get("bundleThreshold"),n=t.get("nodeIdMap"),i=t.get("edgeBundles");return i||(i=[]),e.forEach(function(t,e){i[e]&&void 0!==i[e]||(i[e]=[])}),e.forEach(function(o,a){var s=n[o.source],u=n[o.target];e.forEach(function(e,o){if(!(o<=a)){var l=n[e.source],c=n[e.target];t.getBundleScore({source:s,target:u},{source:l,target:c})>=r&&(i[a].push(o),i[o].push(a))}})}),i},e.prototype.getBundleScore=function(t,e){return t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,t.length=gP({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),e.length=gP({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),this.getAngleScore(t,e)*this.getScaleScore(t,e)*this.getPositionScore(t,e)*this.getVisibilityScore(t,e)},e.prototype.getAngleScore=function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}({x:t.vx,y:t.vy},{x:e.vx,y:e.vy})/(t.length*e.length)},e.prototype.getScaleScore=function(t,e){var r=(t.length+e.length)/2;return 2/(r/Math.min(t.length,e.length)+Math.max(t.length,e.length)/r)},e.prototype.getPositionScore=function(t,e){var r=(t.length+e.length)/2;return r/(r+gP({x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},{x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2}))},e.prototype.getVisibilityScore=function(t,e){var r=this.getEdgeVisibility(t,e),n=this.getEdgeVisibility(e,t);return rr||Math.abs(a.y)>r){var s=1/gP(i[n][t],i[e][t]);o.x+=a.x*s,o.y+=a.y*s}}),o},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),t.prototype.destroy.call(this)},e}(nP),xP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wP=function(){return(wP=Object.assign||function(t){for(var e,r=1,n=arguments.length;r(o||r.get("height"))&&e>1||s<(a||.05*r.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.set("delegateCenterDiff",void 0),this.magnify(t,i)}},e.prototype.scaleRByDrag=function(t){if(t){var e,r=this.get("dragPrePos"),n=this.get("graph"),i=n.getPointByClient(t.clientX,t.clientY);e=t.x-r.x<0?.95:1/.95;var o=this.get("maxR"),a=this.get("minR"),s=this.get("r");(s>(o||n.get("height"))&&e>1||s<(a||.05*n.get("height"))&&e<1)&&(e=1),s*=e,this.set("r",s),this.set("r2",s*s);var u=this.get("d");this.set("molecularParam",(u+1)*s),this.magnify(t,i),this.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){if(t||t.originalEvent){t.preventDefault&&t.preventDefault();var e=0;e=t.originalEvent.wheelDelta<0?-.1:.1;var r=this.get("d")+e,n=this.get("maxD"),i=this.get("minD");if(ri){this.set("d",r);var o=this.get("r");this.set("molecularParam",(r+1)*o);var a=this.get("delegate"),s=a?{x:a.attr("x"),y:a.attr("y")}:void 0;this.set("delegateCenterDiff",void 0),this.magnify(t,s)}}},e.prototype.scaleDByDrag=function(t){var e=this.get("dragPrePos"),r=t.x-e.x>0?.1:-.1,n=this.get("d")+r,i=this.get("maxD"),o=this.get("minD");if(no){this.set("d",n);var a=this.get("r");this.set("molecularParam",(n+1)*a),this.magnify(t)}this.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,e){this.restoreCache();var r=this.get("graph"),n=this.get("cachedMagnifiedModels"),i=this.get("cachedOriginPositions"),o=this.get("showLabel"),a=this.get("r"),s=this.get("r2"),u=this.get("d"),l=this.get("molecularParam"),c=r.getNodes(),f=c.length,h=e?{x:e.x,y:e.y}:{x:t.x,y:t.y};!this.get("dragging")||"mousemove"!==this.get("trigger")&&"click"!==this.get("trigger")||(h=this.get("cacheCenter"));var p=this.get("delegateCenterDiff");p&&(h.x+=p.x,h.y+=p.y),this.updateDelegate(h,a);for(var d=0;d\n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n
  • \n \n \n \n
  • \n \n '},zoomSensitivity:2}},e.prototype.init=function(){var t=this,e=this.get("graph"),r=this.get("getContent")(e),n=r;(0,Uw.isString)(r)&&(n=oO(r));var i=this.get("className");n.setAttribute("class",i||"g6-component-toolbar");var o=this.get("container");o||(o=this.get("graph").get("container")),(0,Uw.isString)(o)&&(o=document.getElementById(o)),o.appendChild(n),this.set("toolBar",n);var a=this.get("handleClick");n.addEventListener("click",function(r){var n=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],r=t.target;r;){if(e.push(r),"HTML"===r.tagName)return e.push(document,window),e;r=r.parentElement}return e}(r).filter(function(t){return"LI"===t.nodeName});if(0!==n.length){var i=n[0].getAttribute("code");i&&(a?a(i,e):t.handleDefaultOperator(i))}});var s=this.get("position");s&&rP(n,{top:"".concat(s.y,"px"),left:"".concat(s.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=this.get("graph"),e=document.querySelector('.g6-component-toolbar li[code="undo"]'),r=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),n=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');e&&r&&n&&i&&(e.setAttribute("style","cursor: not-allowed"),r.setAttribute("style","opacity: 0.4"),n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),t.on("stackchange",function(t){var o=t.undoStack,a=t.redoStack,s=o.length,u=a.length;0===s?(e.setAttribute("style","cursor: not-allowed"),r.setAttribute("style","opacity: 0.4")):(e.removeAttribute("style"),r.removeAttribute("style")),0===u?(n.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(n.removeAttribute("style"),i.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),e=t.getUndoStack();if(e&&0!==e.length){var r=e.pop();if(r){var n=r.action;t.pushStack(n,(0,Uw.clone)(r.data),"redo");var i=r.data.before;if("add"===n&&(i=r.data.after),!i)return;switch(n){case"visible":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);e.visible?t.showItem(r,!1):t.hideItem(r,!1)})});break;case"render":case"update":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);delete e.id,t.updateItem(r,e,!1),"combo"===r.getType()&&t.updateCombo(r)})});break;case"changedata":t.changeData(i,!1);break;case"delete":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=e.itemType;delete e.itemType,t.addItem(r,e,!1)})});break;case"add":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.removeItem(e.id,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})});break;case"createCombo":var o=r.data.after.combos,a=o[o.length-1];Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})}),t.removeItem(a.id,!1);break;case"uncombo":var s=i.combos[i.combos.length-1],u=i.nodes.concat(i.combos).map(function(t){return t.id}).filter(function(t){return t!==s.id});t.createCombo(s,u,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.redo=function(){var t=this.get("graph"),e=t.getRedoStack();if(e&&0!==e.length){var r=e.pop();if(r){var n=r.action,i=r.data.after;if(t.pushStack(n,(0,Uw.clone)(r.data)),"delete"===n&&(i=r.data.before),!i)return;switch(n){case"visible":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);e.visible?t.showItem(r,!1):t.hideItem(r,!1)})});break;case"render":case"update":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=t.findById(e.id);delete e.id,t.updateItem(r,e,!1),"combo"===r.getType()&&t.updateCombo(r)})});break;case"changedata":t.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach(function(e){t.removeItem(e.id,!1)}),i.nodes&&i.nodes.forEach(function(e){t.removeItem(e.id,!1)}),i.combos&&i.combos.forEach(function(e){t.removeItem(e.id,!1)});break;case"add":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){var r=e.itemType;delete e.itemType,t.addItem(r,e,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(e){var r=i[e];r&&r.forEach(function(e){t.updateComboTree(e.id,e.parentId,!1)})});break;case"createCombo":var o=i.combos[i.combos.length-1];t.createCombo(o,o.children.map(function(t){return t.id}),!1);break;case"uncombo":var a=r.data.before.combos,s=a[a.length-1];t.uncombo(s.id,!1);break;case"layout":t.updateLayout(i,void 0,void 0,!1)}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),e=t.getZoom(),r=1/(1-.05*this.get("zoomSensitivity"));r*e>(this.get("maxZoom")||t.get("maxZoom"))||t.zoomTo(e*r)},e.prototype.zoomIn=function(){var t=this.get("graph"),e=t.getZoom(),r=1-.05*this.get("zoomSensitivity");r*e<(this.get("minZoom")||t.get("minZoom"))||t.zoomTo(e*r)},e.prototype.realZoom=function(){this.get("graph").zoomTo(1)},e.prototype.autoZoom=function(){this.get("graph").fitView([20,20])},e.prototype.handleDefaultOperator=function(t){switch(t){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom()}},e.prototype.destroy=function(){var t=this.get("toolBar");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Uw.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}var r=this.get("handleClick");r&&t.removeEventListener("click",r)},e}(nP),TP=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();"undefined"!=typeof document&&uP()("\n .g6-component-tooltip {\n border: 1px solid #e2e2e2;\n border-radius: 4px;\n font-size: 12px;\n color: #545454;\n background-color: rgba(255, 255, 255, 0.9);\n padding: 10px 8px;\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\n }\n .tooltip-type {\n padding: 0;\n margin: 0;\n }\n .tooltip-id {\n color: #531dab;\n }\n");var CP=function(t){function e(e){return t.call(this,e)||this}return TP(e,t),e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(t){return"\n

    类型:".concat(t.item.getType(),"

    \n ID:").concat(t.item.getID(),"\n ")},shouldBegin:function(t){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.prototype.getEvents=function(){return"click"===this.get("trigger")?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},e.prototype.init=function(){var t=this,e=t.get("className")||"g6-component-tooltip",r=oO("
    ")),n=t.get("container");n||(n=t.get("graph").get("container")),(0,Uw.isString)(n)&&(n=document.getElementById(n)),rP(r,{position:"absolute",visibility:"hidden",display:"none"}),n.appendChild(r),"click"!==t.get("trigger")&&(r.addEventListener("mouseenter",function(t){rP(r,{visibility:"visible",display:"unset"})}),r.addEventListener("mouseleave",function(e){t.hideTooltip()})),t.set("tooltip",r)},e.prototype.onClick=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=t.item,n=this.get("graph");this.currentTarget===r?(this.currentTarget=null,this.hideTooltip(),n.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=r,this.showTooltip(t),n.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var e=this.get("itemTypes");if(!t.item||!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=t.item,n=this.get("graph");this.currentTarget=r,this.showTooltip(t),n.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var e=this.get("itemTypes");t.item&&t.item.getType&&-1===e.indexOf(t.item.getType())||this.currentTarget&&t.item===this.currentTarget&&this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip(),this.get("graph").emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(t.item){var e=this.get("itemTypes");if(!t.item.getType||-1!==e.indexOf(t.item.getType())){var r=this.get("tooltip"),n=this.get("getContent")(t);(0,Uw.isString)(n)?r.innerHTML=n:(this.clearContainer(),r.appendChild(n)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&rP(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var e=this.get("shouldBegin"),r=this.get("tooltip");if(e(t)){var n=this.get("graph"),i=n.get("width"),o=n.get("height"),a=this.get("offsetX")||0,s=this.get("offsetY")||0,u=n.getPointByClient(t.clientX,t.clientY),l=this.get("fixToNode"),c=t.item;if(c.getType&&"node"===c.getType()&&l&&(0,Uw.isArray)(l)&&l.length>=2){var f=c.getBBox();u={x:f.minX+f.width*l[0],y:f.minY+f.height*l[1]}}var h=n.getCanvasByPoint(u.x,u.y),p=h.x,d=h.y,y=n.getContainer(),v={x:p+y.offsetLeft+a,y:d+y.offsetTop+s};rP(r,{visibility:"visible",display:"unset"});var g=r.getBoundingClientRect();p+g.width+a>i&&(v.x-=g.width+a),d+g.height+s>o&&(v.y-=g.height+s,v.y<0&&(v.y=0)),rP(r,{left:"".concat(v.x,"px"),top:"".concat(v.y,"px")})}else rP(r,{visibility:"hidden",display:"none"})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var e=this.get("container");e||(e=this.get("graph").get("container")),(0,Uw.isString)(e)&&(e=document.getElementById(e)),e.removeChild(t)}},e}(nP),OP=function(){function t(t){var e=t.x,r=void 0===e?0:e,n=t.y,i=void 0===n?0:n,o=t.container,a=t.text,s=t.padding,u=void 0===s?[4,4,4,4]:s,l=t.className,c=void 0===l?"g6-component-timebar-tooltip":l,f=t.backgroundColor,h=void 0===f?"#000":f,p=t.textColor,d=void 0===p?"#fff":p,y=t.opacity,v=void 0===y?.8:y,g=t.fontSize,m=void 0===g?12:g;this.container=o,this.className=c,this.backgroundColor=h,this.textColor=d,this.x=r,this.y=i,this.text=a,this.padding=u,this.opacity=v,this.fontSize=m,this.render()}return t.prototype.render=function(){var t=this.className,e=(this.x,this.y,this.backgroundColor),r=this.textColor,n=this.text,i=this.padding,o=this.opacity,a=this.fontSize,s=this.container,u=oO("
    '));(0,Uw.isString)(s)&&(s=document.getElementById(s)),s.appendChild(u),this.parentHeight=s.offsetHeight,this.parentWidth=s.offsetWidth,rP(u,{visibility:"hidden",top:0,left:0});var l=oO("\n
    "));l.innerHTML=n,u.appendChild(l),this.backgroundDOM=l;var c=oO("
    "));u.appendChild(c),this.arrowDOM=c,this.container=u},t.prototype.show=function(t){var e=t.text,r=t.x;t.y,t.clientX,t.clientY;this.backgroundDOM.innerHTML=e;var n=this.backgroundDOM.offsetWidth,i=this.backgroundDOM.offsetHeight,o=this.arrowDOM.offsetWidth,a=this.arrowDOM.offsetHeight;rP(this.container,{top:"".concat(-i-a,"px"),left:"".concat(r,"px"),visibility:"visible"}),rP(this.backgroundDOM,{marginLeft:"".concat(-n/2,"px")}),rP(this.arrowDOM,{marginLeft:"".concat(-o/2,"px"),top:"".concat(i,"px")});var s=r-n/2,u=r+n/2;s<0?rP(this.backgroundDOM,{marginLeft:"".concat(-n/2-s,"px")}):u>this.parentWidth&&rP(this.backgroundDOM,{marginLeft:"".concat(-n/2-u+this.parentWidth+12,"px")})},t.prototype.hide=function(){rP(this.container,{top:0,left:0,visibility:"hidden"})},t}(),AP=function(){return(AP=Object.assign||function(t){for(var e,r=1,n=arguments.length;rr&&(o=r,i=e)})}i=e.originalEvent.deltaY>0?Math.max(0,i-1):Math.min(t.speedAxisY.length-1,i+1);var a=t.speedAxisY[i]-n;r=IP(r,[["t",0,a]]),t.speedPoint.setMatrix(r),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit("timebarConfigChanged",{speed:t.currentSpeed,type:t.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(e){var r,n,i=e.target.get("isChecked");i?(t.checkedIcon.hide(),t.checkedText.attr("text",(null===(n=t.controllerCfg)||void 0===n?void 0:n.timePointControllerText)||"单一时间"),t.currentType=FP.RANGE):(t.checkedIcon.show(),t.checkedText.attr("text",(null===(r=t.controllerCfg)||void 0===r?void 0:r.timeRangeControllerText)||"时间范围"),t.currentType=FP.SINGLE),e.target.set("isChecked",!i),t.group.emit("timebarConfigChanged",{type:t.currentType,speed:t.currentSpeed})})},t.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},t}(),GP=function(){return(GP=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=b&&n<=x?l:c,a=v.addShape("rect",{attrs:GP({x:i+n*(y+2),y:i,width:y,height:p},o),draggable:!0,name:"tick-rect-".concat(n)}),s=v.addShape("rect",{attrs:{x:i+n*y+2*(2*n-1)/2,y:i,width:0===n||n===d-1?y+1:y+2,height:p,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(n)});s.toFront();var h,_=a.getBBox(),S=(_.minX+_.maxX)/2;if(g.push({rect:a,pickRect:s,value:e.date,x:S,y:_.minY}),u?(h=u(e),!(0,Uw.isString)(h)&&h&&(h=e.date)):n%Math.round(d/10)==0&&(h=e.date),h){m.push(h);var E=_.maxY+2*i;v.addShape("line",{attrs:{stroke:"#BFBFBF",x1:S,y1:E,x2:S,y2:E+4},name:"tick-line"});var k=E+4+i,T=v.addShape("text",{attrs:GP({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:S,y:k,textAlign:"center",text:h,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},f),capture:!1,name:"tick-label"}),C=T.getBBox();if(C.maxX>r?T.attr("textAlign","right"):C.minX<0&&T.attr("textAlign","left"),(0,Uw.isNumber)(w)&&10!==m.length){var O=UP([1,0,0,0,1,0,0,0,1],[["t",-S,-k],["r",w],["t",S-5,k+2]]);T.attr({textAlign:"left",matrix:O})}1===m.length?T.attr({textAlign:"left"}):10===m.length&&T.attr({textAlign:"right"})}}),this.tickRects=g;var _=this.group;this.currentSpeed=1,this.controllerBtnGroup=new zP(GP({group:_,x:this.x,y:this.y+n+5,width:r,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},t.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",function(e){var r=e.target;if("rect"===r.get("type")&&r.get("name")){var n=parseInt(r.get("name").split("-")[2],10);if(!isNaN(n)){var i=t.tickRects,o=t.unselectedTickStyle;i.forEach(function(t){t.rect.attr(o)});var a=t.selectedTickStyle;i[n].rect.attr(a),t.startTickRectId=n,t.endTickRectId=n;var s=n/i.length;t.graph.emit("valuechange",{value:[s,s]})}}}),e.on("dragstart",function(e){var r=t.tickRects,n=t.unselectedTickStyle;r.forEach(function(t){t.rect.attr(n)});var i=e.target,o=parseInt(i.get("name").split("-")[2],10),a=t.selectedTickStyle;r[o].rect.attr(a),t.startTickRectId=o;var s=o/r.length;t.graph.emit("valuechange",{value:[s,s]}),t.dragging=!0}),e.on("dragover",function(e){if(t.dragging&&"rect"===e.target.get("type")){for(var r=parseInt(e.target.get("name").split("-")[2],10),n=t.startTickRectId,i=t.tickRects,o=t.selectedTickStyle,a=t.unselectedTickStyle,s=0;s=n&&s<=r?o:a;i[s].rect.attr(u)}var l=i.length;t.endTickRectId=r;var c=n/l,f=r/l;t.graph.emit("valuechange",{value:[c,f]})}}),e.on("drop",function(e){if(t.dragging&&(t.dragging=!1,"rect"===e.target.get("type"))){var r=t.startTickRectId,n=parseInt(e.target.get("name").split("-")[2],10);if(!(n0?this.endTickRectId++:(e[this.endTickRectId].rect.attr(n),this.endTickRectId--),o!==this.startTickRectId)this.endTickRectIdthis.max?NaN:this.values[n]},e.prototype.getText=function(e){for(var r=[],n=1;n1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(XP),KP=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,JP="[^\\s]+",QP=/\[([^]*?)\]/gm;function $P(t,e){for(var r=[],n=0,i=t.length;n-1?n:null}};function eM(t){for(var e=[],r=1;r3?0:(t-t%10!=10?1:0)*t%10]}},aM=eM({},oM),sM=function(t){return aM=eM(aM,t)},uM=function(t){return t.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},lM=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length0?"-":"+")+lM(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+lM(Math.floor(Math.abs(e)/60),2)+":"+lM(Math.abs(e)%60,2)}},fM=function(t){return+t-1},hM=[null,"\\d\\d?"],pM=[null,JP],dM=["isPm",JP,function(t,e){var r=t.toLowerCase();return r===e.amPm[0]?0:r===e.amPm[1]?1:null}],yM=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(t){var e=(t+"").match(/([+-]|\d\d)/gi);if(e){var r=60*+e[1]+parseInt(e[2],10);return"+"===e[0]?r:-r}return 0}],vM={D:["day","\\d\\d?"],DD:["day","\\d\\d"],Do:["day","\\d\\d?"+JP,function(t){return parseInt(t,10)}],M:["month","\\d\\d?",fM],MM:["month","\\d\\d",fM],YY:["year","\\d\\d",function(t){var e=+(""+(new Date).getFullYear()).substr(0,2);return+(""+(+t>68?e-1:e)+t)}],h:["hour","\\d\\d?",void 0,"isPm"],hh:["hour","\\d\\d",void 0,"isPm"],H:["hour","\\d\\d?"],HH:["hour","\\d\\d"],m:["minute","\\d\\d?"],mm:["minute","\\d\\d"],s:["second","\\d\\d?"],ss:["second","\\d\\d"],YYYY:["year","\\d{4}"],S:["millisecond","\\d",function(t){return 100*+t}],SS:["millisecond","\\d\\d",function(t){return 10*+t}],SSS:["millisecond","\\d{3}"],d:hM,dd:hM,ddd:pM,dddd:pM,MMM:["month",JP,tM("monthNamesShort")],MMMM:["month",JP,tM("monthNames")],a:dM,A:dM,ZZ:yM,Z:yM},gM={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},mM=function(t){return eM(gM,t)},bM=function(t,e,r){if(void 0===e&&(e=gM.default),void 0===r&&(r={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var n=[];e=(e=gM[e]||e).replace(QP,function(t,e){return n.push(e),"@@@"});var i=eM(eM({},aM),r);return(e=e.replace(KP,function(e){return cM[e](t,i)})).replace(/@@@/g,function(){return n.shift()})};function xM(t,e,r){if(void 0===r&&(r={}),"string"!=typeof e)throw new Error("Invalid format in fecha parse");if(e=gM[e]||e,t.length>1e3)return null;var n={year:(new Date).getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},i=[],o=[],a=e.replace(QP,function(t,e){return o.push(uM(e)),"@@@"}),s={},u={};a=uM(a).replace(KP,function(t){var e=vM[t],r=e[0],n=e[1],o=e[3];if(s[r])throw new Error("Invalid format. "+r+" specified twice in format");return s[r]=!0,o&&(u[o]=!0),i.push(e),"("+n+")"}),Object.keys(u).forEach(function(t){if(!s[t])throw new Error("Invalid format. "+t+" is required in specified format")}),a=a.replace(/@@@/g,function(){return o.shift()});var l=t.match(new RegExp(a,"i"));if(!l)return null;for(var c,f=eM(eM({},aM),r),h=1;h11||n.month<0||n.day>31||n.day<1||n.hour>23||n.hour<0||n.minute>59||n.minute<0||n.second>59||n.second<0)return null;return c}var wM={format:bM,parse:xM,defaultI18n:oM,setGlobalDateI18n:sM,setGlobalDateMasks:mM};var _M="format";function SM(t,e){return(m[_M]||wM[_M])(t,e)}function EM(t){return(0,Uw.isString)(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),(0,Uw.isDate)(t)&&(t=t.getTime()),t}var kM=1e3,TM=60*kM,CM=60*TM,OM=24*CM,AM=31*OM,PM=365*OM,MM=[["HH:mm:ss",kM],["HH:mm:ss",10*kM],["HH:mm:ss",30*kM],["HH:mm",TM],["HH:mm",10*TM],["HH:mm",30*TM],["HH",CM],["HH",6*CM],["HH",12*CM],["YYYY-MM-DD",OM],["YYYY-MM-DD",4*OM],["YYYY-WW",7*OM],["YYYY-MM",AM],["YYYY-MM",4*AM],["YYYY-MM",6*AM],["YYYY",380*OM]];function IM(t,e,r){var n,i=(n=function(t){return t[1]},function(t,e,r,i){for(var o=(0,Uw.isNil)(r)?0:r,a=(0,Uw.isNil)(i)?t.length:i;o>>1;n(t[s])>e?a=s:o=s+1}return o})(MM,(e-t)/r)-1,o=MM[i];return i<0?o=MM[0]:i>=MM.length&&(o=(0,Uw.last)(MM)),o}var LM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return(0,Gw.__extends)(e,t),e.prototype.translate=function(t){t=EM(t);var e=this.values.indexOf(t);return-1===e&&(e=(0,Uw.isNumber)(t)&&t-1){var n=this.values[r],i=this.formatter;return n=i?i(n,e):SM(n,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;(0,Uw.each)(e,function(t,r){e[r]=EM(t)}),e.sort(function(t,e){return t-e}),t.prototype.setDomain.call(this)},e}(ZP),jM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return(0,Gw.__extends)(e,t),e.prototype.scale=function(t){if((0,Uw.isNil)(t))return NaN;var e=this.rangeMin(),r=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(r-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,r=(0,Uw.head)(e),n=(0,Uw.last)(e);rthis.max&&(this.max=n),(0,Uw.isNil)(this.minLimit)||(this.min=r),(0,Uw.isNil)(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=(0,Uw.getRange)(this.values),e=t.min,r=t.max;(0,Uw.isNil)(this.min)&&(this.min=e),(0,Uw.isNil)(this.max)&&(this.max=r),this.min>this.max&&(this.min=e,this.max=r)},e.prototype.calculateTicks=function(){var e=this,r=t.prototype.calculateTicks.call(this);return this.nice||(r=(0,Uw.filter)(r,function(t){return t>=e.min&&t<=e.max})),r},e.prototype.getScalePercent=function(t){var e=this.max,r=this.min;return(t-r)/(e-r)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(XP),NM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return(0,Gw.__extends)(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(jM);function RM(t,e){var r=Math.E;return e>=0?Math.pow(r,Math.log(e)/t):-1*Math.pow(r,Math.log(-e)/t)}function DM(t,e){return 1===t?1:Math.log(e)/Math.log(t)}function BM(t,e,r){(0,Uw.isNil)(r)&&(r=Math.max.apply(null,t));var n=r;return(0,Uw.each)(t,function(t){t>0&&t1&&(n=1),n}var FM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return(0,Gw.__extends)(e,t),e.prototype.invert=function(t){var e,r=this.base,n=DM(r,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(n-(e=DM(r,a/r)))*o;if(t=0?1:-1;return Math.pow(o,r)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,r=this.min;if(e===r)return 0;var n=this.exponent;return(RM(n,t)-RM(n,r))/(RM(n,e)-RM(n,r))},e}(jM),GM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return(0,Gw.__extends)(e,t),e.prototype.getText=function(t,e){var r=this.translate(t),n=this.formatter;return n?n(r,e):SM(r,this.mask)},e.prototype.scale=function(e){var r=e;return((0,Uw.isString)(r)||(0,Uw.isDate)(r))&&(r=this.translate(r)),t.prototype.scale.call(this,r)},e.prototype.translate=function(t){return EM(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),r=this.getConfig("max");if((0,Uw.isNil)(e)&&(0,Uw.isNumber)(e)||(this.min=this.translate(this.min)),(0,Uw.isNil)(r)&&(0,Uw.isNumber)(r)||(this.max=this.translate(this.max)),t&&t.length){var n=[],i=1/0,o=i,a=0;(0,Uw.each)(t,function(t){var e=EM(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t+" in time scale!");i>e?(o=i,i=e):o>e&&(o=e),a1&&(this.minTickInterval=o-i),(0,Uw.isNil)(e)&&(this.min=i),(0,Uw.isNil)(r)&&(this.max=a)}},e}(NM),UM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return(0,Gw.__extends)(e,t),e.prototype.invert=function(t){var e=this.ticks,r=e.length,n=this.getInvertPercent(t),i=Math.floor(n*(r-1));if(i>=r-1)return(0,Uw.last)(e);if(i<0)return(0,Uw.head)(e);var o=e[i],a=i/(r-1);return o+(n-a)/((i+1)/(r-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||((0,Uw.last)(e)!==this.max&&e.push(this.max),(0,Uw.head)(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<(0,Uw.head)(e))return 0;if(t>(0,Uw.last)(e))return 1;var r=0;return(0,Uw.each)(e,function(e,n){if(!(t>=e))return!1;r=n}),r/(e.length-1)},e}(jM),VM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return(0,Gw.__extends)(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(UM),HM={};function WM(t){return HM[t]}function qM(t,e){if(WM(t))throw new Error("type '"+t+"' existed.");HM[t]=e}var YM=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return(0,Gw.__extends)(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,Uw.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return te[1]?NaN:this.values[0]},e}(XP);function XM(t){var e=t.values,r=t.tickInterval,n=t.tickCount,i=t.showLast;if((0,Uw.isNumber)(r)){var o=(0,Uw.filter)(e,function(t,e){return e%r==0}),a=(0,Uw.last)(e);return i&&(0,Uw.last)(o)!==a&&o.push(a),o}var s=e.length,u=t.min,l=t.max;if((0,Uw.isNil)(u)&&(u=0),(0,Uw.isNil)(l)&&(l=e.length-1),!(0,Uw.isNumber)(n)||n>=s)return e.slice(u,l+1);if(n<=0||l<=0)return[];for(var c=1===n?s:Math.floor(s/(n-1)),f=[],h=u,p=0;p=l);p++)h=Math.min(u+p*c,l),p===n-1&&i?f.push(e[l]):f.push(e[h]);return f}var ZM=Math.sqrt(50),KM=Math.sqrt(10),JM=Math.sqrt(2),QM=function(){function t(){this._domain=[0,1]}return t.prototype.domain=function(t){return t?(this._domain=Array.from(t,Number),this):this._domain.slice()},t.prototype.nice=function(t){var e,r;void 0===t&&(t=5);var n,i=this._domain.slice(),o=0,a=this._domain.length-1,s=this._domain[o],u=this._domain[a];return u0?n=$M(s=Math.floor(s/n)*n,u=Math.ceil(u/n)*n,t):n<0&&(n=$M(s=Math.ceil(s*n)/n,u=Math.floor(u*n)/n,t)),n>0?(i[o]=Math.floor(s/n)*n,i[a]=Math.ceil(u/n)*n,this.domain(i)):n<0&&(i[o]=Math.ceil(s*n)/n,i[a]=Math.floor(u*n)/n,this.domain(i)),this},t.prototype.ticks=function(t){return void 0===t&&(t=5),function(t,e,r){var n,i,o,a,s=-1;if(r=+r,(t=+t)==(e=+e)&&r>0)return[t];(n=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++s=0?(o>=ZM?10:o>=KM?5:o>=JM?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=ZM?10:o>=KM?5:o>=JM?2:1)}function tI(t,e,r){return("ceil"===r?Math.ceil(t/e):"floor"===r?Math.floor(t/e):Math.round(t/e))*e}function eI(t,e,r){var n=tI(t,r,"floor"),i=tI(e,r,"ceil");n=(0,Uw.fixedBase)(n,r),i=(0,Uw.fixedBase)(i,r);for(var o=[],a=Math.max((i-n)/(Math.pow(2,12)-1),r),s=n;s<=i;s+=a){var u=(0,Uw.fixedBase)(s,a);o.push(u)}return{min:n,max:i,ticks:o}}function rI(t,e,r){var n,i=t.minLimit,o=t.maxLimit,a=t.min,s=t.max,u=t.tickCount,l=void 0===u?5:u,c=(0,Uw.isNil)(i)?(0,Uw.isNil)(e)?a:e:i,f=(0,Uw.isNil)(o)?(0,Uw.isNil)(r)?s:r:o;if(c>f&&(f=(n=[c,f])[0],c=n[1]),l<=2)return[c,f];for(var h=(f-c)/(l-1),p=[],d=0;d=0&&(u=1),1-s/(a-1)-r+u}function sI(t,e,r){var n=(0,Uw.size)(e);return 1-(0,Uw.indexOf)(e,t)/(n-1)-r+1}function uI(t,e,r,n,i,o){var a=(t-1)/(o-i),s=(e-1)/(Math.max(o,n)-Math.min(r,i));return 2-Math.max(a/s,s/a)}function lI(t,e){return t>=e?2-(t-1)/(e-1):1}function cI(t,e,r,n){var i=e-t;return 1-.5*(Math.pow(e-n,2)+Math.pow(t-r,2))/Math.pow(.1*i,2)}function fI(t,e,r){var n=e-t;if(r>n){var i=(r-n)/2;return 1-Math.pow(i,2)/Math.pow(.1*n,2)}return 1}function hI(t,e,r,n,i,o){void 0===r&&(r=5),void 0===n&&(n=!0),void 0===i&&(i=iI),void 0===o&&(o=[.25,.2,.5,.05]);var a=r<0?0:Math.round(r);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return{min:0,max:0,ticks:[]};if(e-t<1e-15||1===a)return{min:t,max:e,ticks:[t]};if(e-t>1e148){var s=(e-t)/(w=r||5);return{min:t,max:e,ticks:Array(w).fill(null).map(function(e,r){return nI(t+s*r)})}}for(var u={score:-2,lmin:0,lmax:0,lstep:0},l=1;l<1/0;){for(var c=0;cu.score&&(!n||S<=t&&E>=e)&&(u.lmin=S,u.lmax=E,u.lstep=k,u.score=A)}v+=1}p+=1}}l+=1}var P=nI(u.lmax),M=nI(u.lmin),I=nI(u.lstep),L=Math.floor(function(t){return Math.round(1e12*t)/1e12}((P-M)/I))+1,j=new Array(L);j[0]=nI(M);for(c=1;c1&&(i*=Math.ceil(a)),n&&iPM)for(var u=yI(r),l=Math.ceil(o/PM),c=s;c<=u+l;c+=l)a.push(vI(c));else if(o>AM){var f=Math.ceil(o/AM),h=gI(e),p=function(t,e){var r=yI(t),n=yI(e),i=gI(t);return 12*(n-r)+(gI(e)-i)%12}(e,r);for(c=0;c<=p+f;c+=f)a.push(mI(s,c+h))}else if(o>OM){var d=(b=new Date(e)).getFullYear(),y=b.getMonth(),v=b.getDate(),g=Math.ceil(o/OM),m=function(t,e){return Math.ceil((e-t)/OM)}(e,r);for(c=0;cCM){d=(b=new Date(e)).getFullYear(),y=b.getMonth(),g=b.getDate();var b,x=b.getHours(),w=Math.ceil(o/CM),_=function(t,e){return Math.ceil((e-t)/CM)}(e,r);for(c=0;c<=_+w;c+=w)a.push(new Date(d,y,g,x+c).getTime())}else if(o>TM){var S=function(t,e){return Math.ceil((e-t)/6e4)}(e,r),E=Math.ceil(o/TM);for(c=0;c<=S+E;c+=E)a.push(e+c*TM)}else{var k=o;k=512&&console.warn("Notice: current ticks length("+a.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+o+") is too small, increase the value to solve the problem!"),a}),YP("log",function(t){var e,r=t.base,n=t.tickCount,i=t.min,o=t.max,a=t.values,s=DM(r,o);if(i>0)e=Math.floor(DM(r,i));else{var u=BM(a,r,o);e=Math.floor(DM(r,u))}for(var l=s-e,c=Math.ceil(l/n),f=[],h=e;h=0?1:-1;return Math.pow(t,e)*r})}),YP("quantile",function(t){var e=t.tickCount,r=t.values;if(!r||!r.length)return[];for(var n=r.slice().sort(function(t,e){return t-e}),i=[],o=0;op?(s.show(),l.show(),p=c.minX+c.width+10):(s.hide(),l.hide()),s}),this.controllerBtnGroup=new zP(II({group:this.group,x:this.x,y:this.y+r+25,width:e,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),o.move(this.x,this.y),this.bindEvents(),this.currentMode===FP.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},t.prototype.bindEvents=function(){var t=this,e=this.group.find(function(t){return"minHandlerShape"===t.get("name")});e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var r=this.group.find(function(t){return"maxHandlerShape"===t.get("name")});r&&(r.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),r.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat("playPauseBtn",":click"),function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()}),this.group.on("".concat("nextStepBtn",":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()}),this.group.on("".concat("preStepBtn",":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()}),this.group.on("timebarConfigChanged",function(e){var r=e.type,n=e.speed;t.currentSpeed=n,t.currentMode=r,r===FP.SINGLE?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):r===FP.RANGE&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())})},t.prototype.adjustTickIndex=function(t){for(var e=0;e1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var e=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",r-e);var n=(0,Uw.get)(this.handlerStyle,"width",2);this.setText(this.minText,this.maxText);var i=this.dodgeText([e,r]),o=i[0],a=i[1];this.minHandlerShape.setX(e-n/2),(0,Uw.each)(o,function(e,r){return t.minTextShape.attr(r,e)}),this.maxHandlerShape.setX(r-n/2),(0,Uw.each)(a,function(e,r){return t.maxTextShape.attr(r,e)}),this.currentMode===FP.RANGE?this.graph.emit("valuechange",{value:[this.start,this.end].sort()}):this.currentMode===FP.SINGLE&&this.graph.emit("valuechange",{value:[this.end,this.end]})},t.prototype.dodgeText=function(t){var e,r,n=(0,Uw.get)(this.handlerStyle,"width",2),i=this.minTextShape,o=this.maxTextShape,a=t[0],s=t[1],u=!1;a>s&&(a=(e=[s,a])[0],s=e[1],i=(r=[o,i])[0],o=r[1],u=!0);var l=i.getBBox(),c=o.getBBox(),f=null,h=null;return"trend"===this.timeBarType?(f=a-l.widththis.x+this.width?{x:s-n/2-2,textAlign:"right"}:{x:s+n/2+2,textAlign:"left"}):"simple"===this.timeBarType&&(f=i.attr("x")>l.width?{x:a,textAlign:"center"}:{x:a,textAlign:"left"},h=o.attr("x")>this.width-c.width?{x:s,textAlign:"right"}:{x:s,textAlign:"center"}),u?[h,f]:[f,h]},t.prototype.startPlay=function(){var t=this;return"undefined"!=typeof window?window.requestAnimationFrame(function(){var e=t,r=e.ticks,n=e.width,i=t.currentSpeed,o=n/r.length/(1e3*(10-i)/60),a=t.adjustOffsetRange(o/t.width);t.updateStartEnd(a),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())}):void 0},t.prototype.changePlayStatus=function(t){void 0===t&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit("timebarstartplay",null)):this.playHandler&&("undefined"!=typeof window&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit("timebarendplay",null))},t.prototype.destory=function(){this.graph.off("valuechange",function(){});var t=this.group,e=t.find(function(t){return"minHandlerShape"===t.get("name")});e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var r=t.find(function(t){return"maxHandlerShape"===t.get("name")});r&&(r.off("maxHandlerShape-handler:mousedown"),r.off("maxHandlerShape-handler:touchstart"),r.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("".concat("playPauseBtn",":click")),t.off("".concat("nextStepBtn",":click")),t.off("".concat("preStepBtn",":click")),t.off("timebarConfigChanged"),t.destroy(),this.trendComponent&&this.trendComponent.destory()},t}(),UI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),VI=function(){return(VI=Object.assign||function(t){for(var e,r=1,n=arguments.length;r")),{position:"relative"}),a)&&this.get("graph").get("container").appendChild(t);this.set("timeBarContainer",t),e="SVG"===r.get("renderer")?new nO({container:t,width:i,height:o}):new cC({container:t,width:i,height:o}),this.get("containerCSS")&&rP(t,this.get("containerCSS")),this.set("canvas",e)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas").addGroup({name:"timebar-group"});this.set("timeBarGroup",t),this.renderTrend(),this.initEvent();var e="undefined"!=typeof window&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",e)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var e=this.get("timebar");e&&(e.isPlay=!!t,e.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,e=this._cfgs,r=e.width,n=e.x,i=e.y,o=e.padding,a=e.type,s=e.trend,u=e.slider,l=e.controllerCfg,c=e.textStyle,f=e.tick,h=e.backgroundStyle,p=e.foregroundStyle,d=s.data,y=HI(s,["data"]),v=r-2*o,g="trend"===a?26:4,m=this.get("graph"),b=this.get("timeBarGroup"),x=this.get("canvas"),w=null;if("trend"===a||"simple"===a){var _=this.get("getValue");w=new GI(VI(VI({graph:m,canvas:x,group:b,type:a,x:n+o,y:"trend"===a?i+o:i+o+15,width:v,height:g,padding:o,backgroundStyle:h,foregroundStyle:p,trendCfg:VI(VI({},y),{data:d.map(function(t){return(null===_||void 0===_?void 0:_(t))||t.value})})},u),{tick:{ticks:d,tickLabelFormatter:f.tickLabelFormatter,tickLabelStyle:f.tickLabelStyle,tickLineStyle:f.tickLineStyle},handlerStyle:VI(VI({},u.handlerStyle),{height:u.height||g}),controllerCfg:l,textStyle:c}))}else"tick"===a&&(w=new WP(VI({graph:m,canvas:x,group:b,x:n+o,y:i+o,width:r,height:42,padding:2,controllerCfg:l},f)));var S=function e(){var r=t.get("timebar");r.draggingHandler=!1,r.isPlay&&(r.isPlay=!1,r.currentHandler=r.maxHandlerShape,r.changePlayStatus()),document.removeEventListener("mouseup",e)};x.on("mousedown",function(t){"maxHandlerShape-handler"!==t.target.get("name")&&"minHandlerShape-handler"!==t.target.get("name")&&t.target!==w.foregroundShape||document.addEventListener("mouseup",S)}),this.set("timebar",w)},e.prototype.filterData=function(t){var e,r=t.value;if(!r){r=[];var n=this._cfgs.type;n&&"trend"!==n&&"simple"!==n?"tick"===n&&(r[0]=this._cfgs.tick.start,r[1]=this._cfgs.tick.end):(r[0]=this._cfgs.slider.start,r[1]=this._cfgs.slider.end)}var i=null,o=this._cfgs.type;if("trend"===o||"simple"===o?i=this._cfgs.trend.data:"tick"===o&&(i=this._cfgs.tick.data),i&&0!==i.length){var a=this.get("rangeChange"),s=this.get("graph"),u=Math.round(i.length*r[0]),l=Math.round(i.length*r[1]);l=l>=i.length?i.length-1:l,u=u>=i.length?i.length-1:u;var c=null===(e=this._cfgs.tick)||void 0===e?void 0:e.tickLabelFormatter,f=c?c(i[u]):i[u].date,h=c?c(i[l]):i[l].date;if("tick"!==o)this.get("timebar").setText(f,h);if(a)a(s,f,h);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&0===this.cacheGraphData.nodes.length)&&(this.cacheGraphData=s.get("data"));var p=this.get("filterItemTypes"),d=this.get("changeData"),y=this.get("getDate"),v=this.get("shouldIgnore"),g=i[u].date,m=i[l].date;if(d||void 0===d){var b=this.cacheGraphData.nodes,x=this.cacheGraphData.edges,w={},_={};s.getNodes().forEach(function(t){return w[t.getID()]=!0}),s.getEdges().forEach(function(t){return _[t.getID()]=!0}),p.includes("node")&&(null===b||void 0===b||b.forEach(function(t){var e=+((null===y||void 0===y?void 0:y(t))||t.date),r=e>=g&&e<=m||(null===v||void 0===v?void 0:v("node",t,{min:g,max:m})),n=w[t.id];n&&!r?(s.removeItem(t.id),w[t.id]=!1):!n&&r&&(s.addItem("node",t),w[t.id]=!0)}),null===x||void 0===x||x.forEach(function(t){var e=w[t.source]&&w[t.target]||(null===v||void 0===v?void 0:v("edge",t,{min:g,max:m})),r=!!s.findById(t.id);r&&!e?(s.removeItem(t.id),_[t.id]=!1):!r&&e?(s.addItem("edge",t),_[t.id]=!0):r||(_[t.id]=!1)})),(this.get("filterEdge")||p.includes("edge"))&&(null===x||void 0===x||x.filter(function(t){var e=+((null===y||void 0===y?void 0:y(t))||t.date),r=e>=g&&e<=m||(null===v||void 0===v?void 0:v("edge",t,{min:g,max:m})),n=w[t.source]&&w[t.target],i=r&&n,o=_[t.id];o&&!i?(_[t.id]=!1,s.removeItem(t.id)):!o&&i&&(_[t.id]=!0,s.addItem("edge",t))}))}else p.includes("node")&&s.getNodes().forEach(function(t){var e=t.getModel();if(null===v||void 0===v||!v("node",e,{min:g,max:m})){var r=+((null===y||void 0===y?void 0:y(e))||e.date);rm?s.hideItem(t):s.showItem(t)}}),(this.get("filterEdge")||p.includes("edge"))&&s.getEdges().forEach(function(t){var e=t.getModel();if(null===v||void 0===v||!v("edge",e,{min:i[u].date,max:i[l].date})){var r=+((null===y||void 0===y?void 0:y(e))||e.date);if(ri[l].date)s.hideItem(t);else{var n=t.getSource().isVisible(),o=t.getTarget().isVisible();n&&o&&s.showItem(t)}}})}}else console.warn("请配置 TimeBar 组件的数据")},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on("valuechange",this.valueChangeListener)},e.prototype.destroy=function(){var e=this.get("graph");e.off("afterchangedata",this.changeData),e.off("afterrender",this.afterrenderListener),e.off("valuechange",this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),t.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var i=this.get("container");i||(i=this.get("graph").get("container")),(0,Uw.isString)(i)&&(i=document.getElementById(i)),i===n&&(i=i.parentElement),i.removeChild(n)}},e}(nP),qI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),YI=Yk.applyMatrix;var XI=function(t){function e(e){return t.call(this,e)||this}return qI(e,t),e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,e=this._cfgs,r=e.graph;if(!this.destroyed){var n=this.get("container");(0,Uw.isString)(n)&&(n=document.getElementById(n));var i=oO("
    ")),o=0,a=0,s=!1,u=0,l=0,c=0,f=0,h=0,p=0;n.addEventListener("mousedown",function(n){if(e.refresh=!1,n.target===i){var u=i.style;c=parseInt(u.width,10),f=parseInt(u.height,10);var l=t.get("width"),d=t.get("height");c>l||f>d||(p=r.getZoom(),h=t.get("ratio"),s=!0,o=n.clientX,a=n.clientY)}},!1),n.addEventListener("mousemove",function(e){if(s&&!(0,Uw.isNil)(e.clientX)&&!(0,Uw.isNil)(e.clientY)){var n=t.get("width"),d=t.get("height"),y=i.style;u=parseInt(y.left,10),l=parseInt(y.top,10),c=parseInt(y.width,10),f=parseInt(y.height,10);var v=o-e.clientX,g=a-e.clientY;u-v<0?v=u:u-v+c>=n&&(v=0),l-g<0?g=l:l-g+f>=d&&(g=0),l-=g,rP(i,{left:"".concat(u-=v,"px"),top:"".concat(l,"px")}),r.translate(v*p/h,g*p/h),o=e.clientX,a=e.clientY}},!1),n.addEventListener("mouseleave",function(){s=!1,e.refresh=!0},!1),n.addEventListener("mouseup",function(){s=!1,e.refresh=!0},!1),this.set("viewport",i),n.appendChild(i)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),e=this.get("width"),r=this.get("height"),n=this.get("graph"),i=n.get("width"),o=i/n.get("height"),a=n.getGroup(),s=a.getCanvasBBox(),u=[(s.minX+s.maxX)/2,(s.minY+s.maxY)/2],l=[s.maxX-s.minX,s.maxY-s.minY],c={centerX:u[0],centerY:u[1],width:0,height:0,minX:0,minY:0};s[0]/s[1]>o?(c.width=l[0],c.height=c.width/o):(c.height=l[1],c.width=c.height*o),c.minX=u[0]-c.width/2,c.minY=u[1]-c.height/2;var f=a.getMatrix();f||(f=[1,0,0,0,1,0,0,0,1]);var h=yS.invert([1,0,0,0,1,0,0,0,1],f),p=YI({x:c.minX,y:c.minY},h),d=n.getCanvasByPoint(p.x,p.y),y=this.get("viewport");y||this.initViewport();var v=i/c.width,g=v*e,m=v*r,b=e*-d.x/c.width,x=r*-d.y/c.height,w=b+g,_=x+m;b<0&&(g+=b,b=0),w>e&&(g-=w-e),x<0&&(m+=x,x=0),_>r&&(m-=_-r),this.set("ratio",t),rP(y,{left:"".concat(b,"px"),top:"".concat(x,"px"),width:"".concat(g,"px"),height:"".concat(m,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this.get("graph"),e=t.get("width"),r=t.get("height")/e,n=this.get("className"),i=this.get("container"),o=this.get("width"),a=this.get("height");o||a||(o=200),o?(a=r*o,this.set("height",a)):(o=1/r*a,this.set("width",o));var s=oO("
    "));(0,Uw.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(s):t.get("container").appendChild(s),this.set("container",s);var u=oO('
    ');s.appendChild(u);var l=oO('');u.appendChild(l),this.set("containerDOM",u),this.set("containerSpan",l);var c=oO(''));this.set("imgDOM",c),this.updateImgSize(),l.appendChild(c),this.updateCanvas()},e.prototype.updateImgSize=function(){var t=this.get("imgDOM"),e=this.get("width"),r=this.get("height");t.onload=function(){var n=function(t,e){var r,n;if(t.naturalWidth)r=t.naturalWidth,n=t.naturalHeight;else{var i=new Image;i.src=t.src,i.onload=function(){e&&e(i.width,i.height)}}return[r,n]}(t);n[0]>n[1]?t.width=e:t.height=r}},e.prototype.updateCanvas=function(){if(this.get("refresh")){var t=this.get("graph");if(!t.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var e=this.get("width")/t.get("canvas").getCanvasBBox().width;this.set("ratio",e),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){this.get("imgDOM").remove(),this.set("graphImg",t);var e=oO(''));this.set("imgDOM",e),e.src=t,this.updateImgSize(),this.get("containerSpan").appendChild(e),this.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(nP),ZI=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),KI=function(){return(KI=Object.assign||function(t){for(var e,r=1,n=arguments.length;r(i||r.get("height"))&&e>1||a<(o||.05*r.get("height"))&&e<1)&&(e=1),a*=e,this.set("r",a),this.filter(t)}},e.prototype.filter=function(t){var e=this.get("graph"),r=e.getNodes(),n={},i=this.get("r"),o=this.get("type"),a={x:t.x,y:t.y};this.updateDelegate(a,i);var s=this.get("shouldShow"),u=this.get("vShapes");u&&u.forEach(function(t){t.remove(),t.destroy()}),u=[],r.forEach(function(t){var e=t.getModel(),r=e.x,o=e.y;JI({x:r,y:o},a)
    ");n.appendChild(i),this.set("container",i);var o=this.render();rP(i,this.getContainerPos(o)),this.bindEvents()},e.prototype.getContainerPos=function(t){void 0===t&&(t=[0,0]);var e=this.get("graph"),r=this.get("offsetX"),n=this.get("offsetY"),i=this.get("margin"),o=this.get("position").split("-"),a={top:0,right:1,bottom:2,left:3},s={left:(e.getWidth()-t[0])/2+0,top:(e.getHeight()-t[1])/2+0};return o.forEach(function(r){var n=i[a[r]],o=r;switch(r){case"top":case"left":n+=0;break;case"bottom":n=e.getHeight()-t[1]-n+0,o="top";break;default:n=e.getWidth()-t[0]-n+0,o="left"}s[o]=n}),s.top+=n+e.getContainer().offsetTop,s.left+=r+e.getContainer().offsetLeft,Object.keys(s).forEach(function(t){s[t]="".concat(s[t],"px")}),s},e.prototype.bindEvents=function(){var t=this,e=t.get("filter");if(e&&e.enable){var r=e.trigger||"click";aL.includes(r)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),r="click");var n=t.get("legendCanvas");"mouseenter"===r?(n.on("node-container:mouseenter",function(e){return t.filterData(e)}),n.on("node-container:mouseleave",function(e){t.clearFilter(),t.clearActiveLegend()})):(n.on("node-container:click",function(e){return t.filterData(e)}),n.on("click",function(e){e.target&&e.target.isCanvas&&e.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var e=this.render();rP(this.get("container"),this.getContainerPos(e))},e.prototype.activateLegend=function(t){var e=this.get("filter");(null===e||void 0===e?void 0:e.multiple)||this.clearActiveLegend();var r=t.get("parent");r.get("active")?(r.set("active",!1),this.findLegendItemsByState("active").length&&r.set("inactive",!0)):(r.set("inactive",!1),r.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(t){t.set("inactive",!0)}):this.clearActiveLegend();var n=(null===e||void 0===e?void 0:e.legendStateStyles)||{},i=(null===n||void 0===n?void 0:n.inactive)||{opacity:.5,"text-shape":{opacity:.5}},o=i["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(t){var e=t.get("children"),r=e[0],n=e[1];r.attr(oL(oL({},r.get("oriAttrs")),i)),n.attr(oL(oL({},n.get("oriAttrs")),o))});var a=(null===n||void 0===n?void 0:n.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},s=a["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(t){var e=t.get("children"),r=e[0],n=e[1];r.attr(oL(oL({},r.get("oriAttrs")),a)),n.attr(oL(oL({},n.get("oriAttrs")),s))})},e.prototype.findLegendItemsByState=function(t,e,r){void 0===e&&(e="all"),void 0===r&&(r=!0);var n=this.get("legendCanvas").find(function(t){return"root"===t.get("name")}),i=n.find(function(t){return"node-group"===t.get("name")}),o=n.find(function(t){return"edge-group"===t.get("name")});return"node"===e?i.get("children").filter(function(e){return!!e.get(t)===r}):"edge"===e?o.get("children").filter(function(e){return!!e.get(t)===r}):i.get("children").filter(function(e){return!!e.get(t)===r}).concat(o.get("children").filter(function(e){return!!e.get(t)===r}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas").find(function(t){return"root"===t.get("name")});[t.find(function(t){return"node-group"===t.get("name")}),t.find(function(t){return"edge-group"===t.get("name")})].forEach(function(t){t.get("children").forEach(function(t){t.set("active",!1),t.set("inactive",!1);var e=t.get("children"),r=e[0],n=e[1];r.attr(r.get("oriAttrs")),n.attr(n.get("oriAttrs"))})})},e.prototype.filterData=function(t){var e=this.get("filter"),r=null===e||void 0===e?void 0:e.filterFunctions;if(e&&r){var n=this.get("legendCanvas"),i=this.get("graph"),o=e.graphActiveState||"active",a=e.graphInactiveState||"inactive",s=e.multiple;this.clearFilter(),s||this.clearActiveLegend(),this.activateLegend(t.target);var u=n.find(function(t){return"root"===t.get("name")}),l=u.find(function(t){return"node-group"===t.get("name")}),c=u.find(function(t){return"edge-group"===t.get("name")}),f=l.get("children").filter(function(t){return t.get("active")}),h=c.get("children").filter(function(t){return t.get("active")}),p=0,d=["getNodes","getEdges"];d.forEach(function(t){i[t]().forEach(function(e){var n=!1;("getNodes"===t?f:h).forEach(function(t){var i=r[t.get("id")];n=n||i(e.getModel())}),n?(i.setItemState(e,a,!1),i.setItemState(e,o,!0),p++):(i.setItemState(e,o,!1),i.setItemState(e,a,!0))})}),p||d.forEach(function(t){i[t]().forEach(function(t){i.clearItemStates(t,[a])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),e=this.get("filter");if(e){var r=e.graphActiveState||"active",n=e.graphInactiveState||"inactive";t.getNodes().forEach(function(e){t.clearItemStates(e,[r,n])}),t.getEdges().forEach(function(e){t.clearItemStates(e,[r,n])})}},e.prototype.render=function(){var t=this;this.processData();var e=this.get("legendCanvas");e?e.clear():e=new cC({container:this.get("container"),width:200,height:200});var r=e.addGroup({name:"root"}),n=r.addGroup({name:"node-group"}),i=r.addGroup({name:"edge-group"});this.set("legendCanvas",e);var o=this.get("itemsData"),a=[n,i];["nodes","edges"].forEach(function(e,r){o[e].forEach(function(n){var i,o,s=a[r].addGroup({id:n.id,name:"node-container"}),u=n.type,l=t.getShapeSize(n),c=l.width,f=l.height,h=l.r,p=t.getStyle(e.substr(0,4),n);switch(n.type){case"circle":o={r:h,x:0,y:0};break;case"rect":o={width:c,height:f,x:-c/2,y:-f/2};break;case"ellipse":o={rx:c,ry:f,x:0,y:0},u="ellipse";break;case"line":o={x1:-c/2,y1:0,x2:c/2,y2:0},u="line";break;case"quadratic":o={path:[["M",-c/2,0],["Q",0,c/2,c/2,0]]},u="path";break;case"cubic":o={path:[["M",-c/2,0],["C",-c/6,c/2,c/6,-c/2,c/2,0]]},u="path";break;case"diamond":o={path:[["M",0,-f],["L",c,0],["L",0,f],["L",-c,0],["Z"]]},u="path";break;case"triangle":o={path:[["M",-c,f],["L",0,-f],["L",c,f],["Z"]]},u="path";break;case"star":o={path:Yk.getStarPath(3*h,1.2*h)},u="path";break;default:o={r:h,x:0,y:0}}var d=s.addShape(u,{attrs:oL(oL({},o),p),name:"".concat(n.type,"-node-keyShape"),oriAttrs:oL({opacity:1},p)});if(n.label){var y=d.getBBox(),v=(null===(i=n.labelCfg)||void 0===i?void 0:i.style)||{},g=oL({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},v);s.addShape("text",{attrs:oL({x:y.maxX+4,y:0,text:n.label},g),className:"legend-label",name:"".concat(n.type,"-node-text"),oriAttrs:g})}})});var s,u=this.get("padding"),l=r.find(function(t){return"title-container"===t.get("name")}),c={height:0,maxY:0,width:0};if(this.get("title")){l||(l=r.addGroup({name:"title-container"}));var f={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:u[0]},h=this.get("titleConfig")||{},p=Object.assign(f,h.style||{});s=l.addShape("text",{attrs:oL({text:this.get("title")},p)}),c=l.getCanvasBBox(),l.setMatrix([1,0,0,0,1,0,h.offsetX,h.offsetY,1])}this.layoutItems();var d=r.getCanvasBBox(),y=n.getCanvasBBox(),v=y.minX<0?Math.abs(y.minX)+u[3]:u[3],g=c.maxYl.max&&(l.max=o[0]),p>c&&(c=p),t.setMatrix([1,0,0,0,1,0,d,y,1])});var f=l.max-l.min,h={min:0,max:-1/0},p=s.getCanvasBBox();o[0]=0,o[1]="vertical"===n?p.maxX+e:p.maxY+r,u.get("children").forEach(function(t,i){0===i&&(h.min=o[0]);var a=t.get("children")[0],s=t.getCanvasBBox(),u=a.getBBox(),l=u.width,c=u.height,f=0,p=0;"vertical"===n?(f=o[1],p=o[0],o[0]=p+s.height+r,t.setMatrix([1,0,0,0,1,0,0,p+c/2,1])):(f=o[0],p=o[1],o[0]=f+s.width+e,t.setMatrix([1,0,0,0,1,0,f+l/2,0,1])),o[0]>h.max&&(h.max=o[0])});var d=h.max-h.min;if(i&&""!==i&&"left"!==i){var y=f-d,v="center"===i?Math.abs(y)/2:Math.abs(y);(y<0?s:u).get("children").forEach(function(t){var e=t.getMatrix()||[1,0,0,0,1,0,0,0,1];"vertical"===n?e[7]+=v:e[6]+=v,t.setMatrix(e)})}},e.prototype.processData=function(){var t=this.get("data"),e={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(t,e){return t.order-e.order}),t.nodes.forEach(function(t){var r,n,i,o,a,s=t.size||[(null===(r=t.style)||void 0===r?void 0:r.width)||(null===(n=t.style)||void 0===n?void 0:n.r)||8,(null===(i=t.style)||void 0===i?void 0:i.height)||(null===(o=t.style)||void 0===o?void 0:o.r)||8],u=(null===(a=t.labelCfg)||void 0===a?void 0:a.style)||{};e.nodes.push({id:t.id||(0,Uw.uniqueId)(),type:t.type||"circle",style:oL({},t.style),order:t.order,label:t.label,itemType:"node",size:s,labelCfg:{position:"right",style:oL({fontFamily:"Arial"},u)}})})),t.edges&&(t.edges.sort(function(t,e){return t.order-e.order}),t.edges.forEach(function(t){var r,n,i=t.type||"line";"cubic-horizontal"===t.type&&(i="cubic");var o=(null===(r=t.labelCfg)||void 0===r?void 0:r.style)||{},a=t.size||[(null===(n=t.style)||void 0===n?void 0:n.width)||8,1];e.edges.push({id:t.id||(0,Uw.uniqueId)(),type:i,size:a,style:oL({lineWidth:(0,Uw.isArray)(a)?a[1]:1},t.style),order:t.order,label:t.label,itemType:"edge",labelCfg:{position:"right",style:oL({fontFamily:"Arial"},o)}})})),this.set("itemsData",e)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var e=this.get(t);if((0,Uw.isNumber)(e))this.set(t,[e,e,e,e]);else if((0,Uw.isArray)(e))switch(e.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[e[0],e[0],e[0],e[0]]);break;case 2:this.set(t,[e[0],e[1],e[0],e[1]]);break;case 3:this.set(t,[e[0],e[1],e[2],e[1]])}return this.get(t)},e.prototype.getShapeSize=function(t){var e,r,n;return t.size&&((0,Uw.isArray)(t.size)?(e=t.size[0],r=t.size[1]||t.size[0],n=t.size[0]/2):(0,Uw.isNumber)(t.size)&&(e=t.size,r=t.size,n=t.size/2)),t.style&&(t.style.width&&(e=t.style.width),t.style.height&&(r=t.style.height),t.style.r&&(n=t.style.r)),n||(n=5),e||(e=n),r||(r=n),{width:e,height:r,r:n}},e.prototype.getStyle=function(t,e){return oL(oL({},"node"===t?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1}),e.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");null===t||void 0===t||t.destroy();var e=this.get("graph").get("container"),r=this.get("container");e.removeChild(r)},e}(nP),uL=function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lL=function(){return(lL=Object.assign||function(t){for(var e,r=1,n=arguments.length;r+

    ":"

    -

    ",c=e?"":"

    ".concat(a,"

    "),f=e?"".concat(u,"px"):"".concat(u,"px ").concat(u,"px 0 0");return'
    \n \n

    ").concat(i,"

    \n ").concat(l,"\n ").concat("

    x

    ","\n
    \n ").concat(c,"\n ")}},e.prototype.init=function(){var t=this;if(!t.destroyed){var e=t.get("graph").getContainer(),r=t.get("container");this.get("containerCfg")?(r=this.createContainer(),e.appendChild(r)):r=e,this.set("container",r);var n=e.getBoundingClientRect(),i=new cC({container:e,width:n.right-n.left,height:n.bottom-n.top});rP(i.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,Uw.debounce)(function(){return t.resizeCanvas(t)},100));var o=i.addGroup({id:"annotation-link-group"});t.set("linkGroup",o),t.set("canvas",i),t.get("getTitle")||t.set("getTitle",function(t){var e,r=(null===(e=null===t||void 0===t?void 0:t.getModel)||void 0===e?void 0:e.call(t))||{},n=r.label,i=r.id;return n||i||"-"}),t.get("getContent")||t.set("getContent",function(t){var e,r;if(!t)return"-";var n=(null===(e=t.getModel)||void 0===e?void 0:e.call(t))||{},i=n.label,o=n.id,a=null===(r=t.getType)||void 0===r?void 0:r.call(t),s=a?"".concat(a,": "):"";return"".concat(s).concat(i||o||"")});var a=t.get("defaultData");a&&this.readData(a)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var e=this.get("containerCfg"),r=this.get("graph"),n=r.getContainer(),i=n.getBoundingClientRect(),o=i.left,a=i.right,s=i.top,u=i.bottom-s,l=a-o,c=e.position,f=void 0===c?"top":c,h=e.offsetX,p=void 0===h?0:h,d=e.offsetY,y=void 0===d?0:d,v=cL(e,["position","offsetX","offsetY"]),g=e.height,m=void 0===g?"fit-content":g,b=e.width,x=void 0===b?r.getWidth():b;"100%"===m&&(m=u),"100%"===x&&(x=l);var w="unset",_="unset",S={};switch(f){case"right":w="".concat(u,"px"),(S={top:0,right:0}).right+=o+p,S.top+=s+y;break;case"bottom":_="".concat(l,"px"),(S={bottom:0,left:0}).left+=o+p,S.bottom+=s+y;break;case"top":_="".concat(l,"px");case"left":w="".concat(u,"px");default:(S={top:0,left:0}).left+=o+p,S.top+=s+y}Object.keys(S).forEach(function(t){S[t]="".concat(S[t],"px")});var E=oO("
    "));return rP(E,lL(lL({position:"absolute",display:"top"===f||"bottom"===f?"inline-flex":"unset",width:(0,Uw.isNumber)(x)?"".concat(x,"px"):x,height:(0,Uw.isNumber)(m)?"".concat(m,"px"):m,maxHeight:w,maxWidth:_,overflow:"scroll"},S),v)),n.appendChild(E),E.addEventListener("scroll",function(e){t.updateLinks()}),E}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){if(t&&!t.destroyed){var e=t.get("container").getBoundingClientRect(),r=e.right-e.left,n=e.bottom-e.top;t.get("canvas").changeSize(r,n),t.updateOutsideCards(t)}},250)},e.prototype.updateOutsideCards=function(t){var e=t||this,r=e.get("cardInfoMap")||{},n=e.get("graph"),i=n.getPointByCanvas(0,0),o=n.getPointByCanvas(n.getWidth(),n.getHeight()),a=n.getClientByPoint(i.x,i.y),s=a.x,u=a.y,l=n.getClientByPoint(o.x,o.y),c=l.x,f=l.y;Object.values(r).forEach(function(t){var e=t.card;if(e){var r=e.style,n=pL(r.left),i=pL(r.top),o=e.getBoundingClientRect(),a=o.width,l=o.height,h=n,p=i;n+a>c-s&&(h=c-s-a),n<0&&(h=0),i+l>f-u&&(p=f-u-l),i<0&&(p=0),rP(e,{left:"".concat(h,"px"),top:"".concat(p,"px")})}}),e.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var e=t.item;this.toggleAnnotation(e)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var e=t.get("cardInfoMap")||{};Object.keys(e).forEach(function(e){t.hideCard(e)})}},e.prototype.toggleAnnotation=function(t,e){var r,n;void 0===e&&(e={});if(!this.destroyed){var i=this.get("cardInfoMap")||{},o=this.get("graph"),a=this.get("container"),s=this.get("containerCfg"),u=Object.assign({},this.get("cardCfg")||{},e),l=u.minHeight,c=u.minWidth,f=u.width,h=u.height,p=u.collapsed,d=void 0!==p&&p,y=u.x,v=u.y,g=u.title,m=u.content,b=u.maxTitleLength,x=u.defaultBegin,w=cL(u,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),_=this.get("linkGroup"),S=this.get("rows")||[[]],E=null===(r=t.isCanvas)||void 0===r?void 0:r.call(t),k=E?"canvas-annotation":t.getID(),T=i[k]||{},C=T.card,O=T.link,A=T.x,P=T.y,M=T.title,I=T.content,L=this.get("getTitle"),j=this.get("getContent"),N=this.get("getContentPlaceholder")||function(){return""},R=this.get("getTitlePlaceHolder")||function(){return""},D=N(t),B=R(t),F=oO(this.getDOMContent(lL({itemId:k,collapsed:d,title:(null===(n=M||g||(null===L||void 0===L?void 0:L(t)))||void 0===n?void 0:n.substr(0,b))||B,content:I||m||(null===j||void 0===j?void 0:j(t))||D},w))),z=(0,Uw.isNumber)(l)?"".concat(l,"px"):l;rP(F,{minHeight:d?"unset":z,minWidth:(0,Uw.isNumber)(c)?"".concat(c,"px"):c,height:h,width:f});var G,U=!!C;if(U?(null===O||void 0===O||O.remove(!0),a.replaceChild(F,C)):a.appendChild(F),!s){if(G=a.getBoundingClientRect()||{},void 0!==y&&void 0!==v)A=y,P=v;else if(!U&&!E){var V=G.top,H=x||{},W=H.left,q=H.right,Y=void 0===q?16:q,X=H.top,Z=void 0===X?8:X,K=H.bottom,J=Y,Q=Z;isNaN(W)||(J=a.scrollWidth-W),isNaN(K)||(Q=a.scrollHeight-K);var $=(0,Uw.isNumber)(c)?c:100;A=a.scrollWidth-F.scrollWidth-(S.length-1)*$-J;var tt=S[S.length-1],et=(tt[tt.length-1]||{}).bbox;P=(null===et||void 0===et?void 0:et.bottom)-V||Q}rP(F,{position:"absolute",left:"".concat(A,"px"),top:"".concat(P,"px"),cusor:s?"unset":"move"})}this.bindListener(F,k);var rt=F.getBoundingClientRect();if(!E){var nt=hL(t,rt,o,this.get("canvas")),it=this.get("linkStyle");O=_.addShape("path",{attrs:lL({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:nt},it)})}if(i[k]=lL(lL({},i[k]||{}),{id:k,collapsed:d,card:F,link:O,x:A,y:P,cardBBox:rt,content:I||m,title:M||g,contentPlaceholder:D,titlePlaceholder:B,isCanvas:E}),this.set("cardInfoMap",i),s)this.updateCardPositionsInConatainer(),this.updateLinks();else{var ot=!isNaN(y)&&!isNaN(v);if(!U&&!E&&!ot){var at=G.bottom,st=void 0===at?0:at;V=G.top;S[S.length-1].push({id:k,bbox:rt}),rt.top>st-V-rt.height-16&&S.push([]),this.set("rows",S)}}this.updateCardSize(k);var ut=this.get("onAnnotationChange");null===ut||void 0===ut||ut(i[k],U?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(t){var e=this.get("container"),r=this.get("containerCfg").position,n=e.getBoundingClientRect().width,i=getComputedStyle(e),o=pL(i.paddingLeft)+pL(i.paddingRight);n-=o,Object.values(t).forEach(function(t){var e=t.card,i=e.getBoundingClientRect().width;switch(r){case"right":rP(e,{marginLeft:n?"".concat(n-i,"px"):"0px"});break;case"top":case"bottom":rP(e,{marginLeft:"8px"})}})}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var e=this.get("graph"),r=this.get("cardInfoMap");if(r){var n=r[t].collapsed,i=e.findById(t);if(i)"hide"!==this.get("cardCfg").collapseType||n?this.toggleAnnotation(i,{collapsed:!n}):this.hideCard(t),r[t]=lL(lL({},r[t]),{collapsed:!n})}}},e.prototype.hideCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e&&e[t]){var r=e[t],n=r.card,i=r.link;rP(n,{display:"none"}),null===i||void 0===i||i.hide(),this.get("onAnnotationChange")(e[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var r=e[t],n=r.card,i=r.link;this.get("container").removeChild(n),null===i||void 0===i||i.remove(!0),delete e[t],this.get("onAnnotationChange")(r,"remove")}}},e.prototype.bindListener=function(t,e){var r=this;if(!this.destroyed){t.addEventListener("mousemove",function(t){var n;if("g6-annotation-collapse"===t.target.className?n="collapse":"g6-annotation-expand"===t.target.className?n="expand":"g6-annotation-close"===t.target.className&&(n="close"),n){var i=r.get("cardCfg").onMouseEnterIcon;(void 0===i?function(){}:i)(t,e,n)}}),t.addEventListener("mouseout",function(t){var n;if("g6-annotation-collapse"===t.target.className?n="collapse":"g6-annotation-expand"===t.target.className?n="expand":"g6-annotation-close"===t.target.className&&(n="close"),n){var i=r.get("cardCfg").onMouseLeaveIcon;(void 0===i?function(){}:i)(t,e,n)}}),t.addEventListener("mouseenter",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("graph"),o=i.findById(e);if(o){var a=r.get("itemHighlightState");i.setItemState(o,a,!0)}var s=n[e].link;if(s){var u=r.get("linkHighlightStyle")||{};s.attr(u)}}}),t.addEventListener("mouseleave",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("graph"),o=i.findById(e);if(o){var a=r.get("itemHighlightState");i.setItemState(o,a,!1)}var s=n[e].link;if(s){var u=r.get("linkHighlightStyle")||{};Object.keys(u).forEach(function(t){s.attr(t,void 0),s.attr(t,void 0)});var l=r.get("linkStyle");s.attr(l)}}}),t.addEventListener("click",function(t){var n=(r.get("cardCfg")||{}).onClickIcon;if("g6-annotation-collapse"===t.target.className||"g6-annotation-expand"===t.target.className)"hide"===r.get("cardCfg").collapseType?r.hideCard(e):r.handleExpandCollapseCard(e),null===n||void 0===n||n(t,e,"g6-annotation-collapse"===t.target.className?"collapse":"expand");else if("g6-annotation-close"===t.target.className){"remove"===r.get("cardCfg").closeType?r.removeCard(e):r.hideCard(e),null===n||void 0===n||n(t,e,"close")}}),this.get("editable")&&t.addEventListener("dblclick",function(t){var n=r.get("cardInfoMap"),i=(r.get("cardCfg")||{}).maxTitleLength,o=void 0===i?20:i;if(n){var a=t.target,s=a.className;if("g6-annotation-title"===s||"g6-annotation-content"===s){var u="g6-annotation-title"===s?a.getBoundingClientRect():a.parentNode.getBoundingClientRect(),l=u.width,c=u.height,f=getComputedStyle(a),h=oO("<".concat("g6-annotation-title"===s?"input":"textarea",' class="').concat(s,'-input" type="textarea" style="width:').concat(l,"px; height: ").concat(c,'px; min-width: 16px;"/>')),p=oO('
    '));p.appendChild(h),a.parentNode.replaceChild(p,a);var d=n[e],y=d.contentPlaceholder,v=d.titlePlaceholder,g=d.content,m=d.title,b=g;"g6-annotation-title"===s?(h.name="title",h.maxLength=o,b=m):h.name="content",b?(h.innerHTML=a.innerHTML,h.value=a.innerHTML):h.placeholder="g6-annotation-title"===s?v:y,h.focus(),h.addEventListener("blur",function(t){h.value&&(a.innerHTML=h.value,d[h.name||"title"]=h.value),p.parentNode.replaceChild(a,p),r.updateCardSize(e);var n=r.get("onAnnotationChange");null===n||void 0===n||n(d,"update")})}}});var n=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",function(e){var i=e.target.className;if(!n.includes(i)){var o=t.style;r.set("dragging",{card:t,x:e.clientX,y:e.clientY,left:pL(o.left),top:pL(o.top)})}}),t.addEventListener("drag",function(t){t.preventDefault();var n=r.get("cardInfoMap");if(n){var i=t.clientX,o=t.clientY,a=r.get("dragging");if(!isNaN(i)&&!isNaN(o)&&a){var s=a.x,u=a.y,l=a.left,c=a.top,f=a.card,h=i-s,p=o-u;l+=h,c+=p;var d=r.get("graph"),y=d.getPointByCanvas(0,0),v=d.getPointByCanvas(d.getWidth(),d.getHeight()),g=d.getClientByPoint(y.x,y.y),m=g.x,b=g.y,x=d.getClientByPoint(v.x,v.y),w=x.x,_=x.y,S=f.getBoundingClientRect(),E=S.right-S.left,k=S.bottom-S.top;(l>w-m-E&&h>0||l<0&&h<0)&&(l-=h),(c>_-b-k&&p>0||c<0&&p<0)&&(c-=p),rP(f,{left:"".concat(l,"px"),top:"".concat(c,"px"),visibility:"hidden"}),s=i,u=o;var T=(n[e]||{}).link;if(T){var C=d.findById(e);T.attr("path",hL(C,S,d,r.get("canvas")))}r.set("dragging",{x:s,y:u,left:l,top:c,card:f})}}});t.addEventListener("dragend",function(t){var n=r.get("cardInfoMap");if(n){var i=r.get("dragging");if(i){var o=i.left,a=i.top,s=i.card;n[e].x=o,n[e].y=a,rP(s,{visibility:"visible"}),r.set("dragging",!1);var u=r.get("rows");null===u||void 0===u||u.forEach(function(t){for(var r=t.length-1;r>=0;r--)t[r].id===e&&t.splice(r,1)});var l=r.get("onAnnotationChange");null===l||void 0===l||l(n[e],"update")}}})}},e.prototype.updateCardSize=function(t){var e=this.get("cardInfoMap");if(e){var r=e[t].card,n=r.getBoundingClientRect().width,i=r.getElementsByClassName("g6-annotation-title")[0];if(i){var o=getComputedStyle(i),a=pL(o.marginLeft),s=i.getBoundingClientRect().width;rP(i,{marginRight:"".concat(n-a-24-16-s,"px")})}}},e.prototype.updateLink=function(t){var e=t.item;if(e){var r=this.get("cardInfoMap");if(r){var n=this.get("canvas"),i=this.get("graph"),o=r[e.getID()]||{},a=o.link,s=o.card;if(a){var u=hL(e,s.getBoundingClientRect(),i,n);a.attr("path",u)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var e=this.get("cardInfoMap");if(e){var r=this.get("graph");Object.values(e).forEach(function(e){var n=e.id,i=r.findById(n);t.updateLink({item:i})})}}},e.prototype.onGraphDataChange=function(){var t=this,e=this.get("cardInfoMap");if(e){var r=this.get("graph");Object.values(e).forEach(function(e){var n=e.id,i=e.card,o=e.isCanvas;if(i&&!o&&"none"!==i.style.display){var a=r.findById(n);a&&a.isVisible()?t.toggleAnnotation(a):t.hideCard(n)}})}},e.prototype.onGraphItemVisibilityChange=function(t){var e=t.item,r=t.visible;if(e&&!e.destroyed){var n=this.get("cardInfoMap");if(n){var i=e.getID();n[i]&&(r||this.hideCard(i))}}},e.prototype.saveData=function(t){void 0===t&&(t=!1);var e=this.get("cardInfoMap");if(e){var r=this.get("graph"),n=this.get("getTitle"),i=this.get("getContent"),o=[];return Object.values(e).forEach(function(e){var a=e.title,s=e.content,u=e.x,l=e.y,c=e.id,f=e.collapsed,h=e.card;if(!h||"none"!==h.style.display||t){var p=r.findById(c)||r.get("canvas");o.push({id:c,x:u,y:l,collapsed:f,title:a||(null===n||void 0===n?void 0:n(p)),content:s||(null===i||void 0===i?void 0:i(p)),visible:h&&"none"!==h.style.display})}}),o}},e.prototype.readData=function(t){var e=this,r=this.get("graph");t.forEach(function(t){var n=t.id,i=t.x,o=t.y,a=t.title,s=t.content,u=t.collapsed,l=t.visible,c=r.findById(n);if(c||"canvas-annotation"!==n||(c=r.get("canvas")),!c){var f=e.get("cardInfoMap")||{};return f[n]=t,void e.set("cardInfoMap",f)}e.toggleAnnotation(c,{x:i,y:o,title:a,content:s,collapsed:u}),l||e.hideCard(n)})},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(t){var e=this.get("container");Object.values(t).forEach(function(t){var r=t.card,n=t.link;e.removeChild(r),null===n||void 0===n||n.remove(!0)}),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),null===(t=this.get("canvas"))||void 0===t||t.destroy();var e=this.get("graph");e&&!e.destroyed&&(this.get("containerCfg")&&e.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(nP),hL=function(t,e,r,n){var i,o;if("edge"===t.getType())o=[t.getKeyShape().getPoint(.5)];else{var a=null===(i=t.getKeyShape)||void 0===i?void 0:i.call(t).getBBox(),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,f=t.getModel(),h=f.x,p=f.y;o={left:{x:s+=h,y:((u+=p)+(c+=p))/2},right:{x:l+=h,y:(u+c)/2},top:{x:(s+l)/2,y:u},bottom:{x:(s+l)/2,y:c}}}Object.keys(o).forEach(function(t){var e=o[t],i=e.x,a=e.y,s=r.getClientByPoint(i,a);o[t]=n.getPointByClient(s.x,s.y)});var d=e.top,y=void 0===d?0:d,v=e.left,g=void 0===v?0:v,m=e.right,b=void 0===m?0:m,x=e.bottom,w=void 0===x?0:x,_={left:n.getPointByClient(g,(y+w)/2),right:n.getPointByClient(b,(y+w)/2),top:n.getPointByClient((g+b)/2,y),bottom:n.getPointByClient((g+b)/2,w)};return function(t,e){var r,n,i=1/0;Object.keys(t).forEach(function(o){var a=t[o];Object.keys(e).forEach(function(t){var o=e[t],s=a.x-o.x,u=a.y-o.y,l=s*s+u*u;i>l&&(i=l,r=a,n=o)})});var o=Yk.getControlPoint(r,n,.5,20);return[["M",r.x,r.y],["Q",o.x,o.y,n.x,n.y]]}(o,_)},pL=function(t){return Number(t.replace(/\s+|px/gi,""))||0},dL={PluginBase:nP,Menu:cP,Grid:aP,Minimap:yP,Bundling:bP,ToolBar:kP,Tooltip:CP,Fisheye:SP,TimeBar:WI,ImageMinimap:XI,EdgeFilterLens:$I,SnapLine:nL,Legend:sL,Annotation:fL};Kk("circle",{options:{size:tT.defaultNode.size,style:{x:0,y:0,stroke:tT.defaultNode.style.stroke,fill:tT.defaultNode.style.fill,lineWidth:tT.defaultNode.style.lineWidth},labelCfg:{style:{fill:tT.nodeLabel.style.fill,fontSize:tT.nodeLabel.style.fontSize,fontFamily:tT.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tT.defaultNode.linkPoints.size,lineWidth:tT.defaultNode.linkPoints.lineWidth,fill:tT.defaultNode.linkPoints.fill,stroke:tT.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gw.__assign)({},tT.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=(0,Uw.deepMix)({},n,t.icon),a="".concat(this.type,"-keyShape"),s=e.addShape("circle",{attrs:i,className:a,name:a,draggable:!0});e.shapeMap[a]=s;var u=o.width,l=o.height,c=o.show,f=o.text;if(c){var h="".concat(this.type,"-icon");e.shapeMap[h]=f?e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:h,name:h,draggable:!0}):e.addShape("image",{attrs:(0,Gw.__assign)({x:-u/2,y:-l/2},o),className:h,name:h,draggable:!0})}return this.drawLinkPoints(t,e),s},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints;if(r){var n=r||{},i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t)[0]/2;if(o){var h="link-point-left";e.shapeMap[h]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:-f,y:0,r:u/2||l||5}),className:h,name:h,isAnchorPoint:!0})}if(a){var p="link-point-right";e.shapeMap[p]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:f,y:0,r:u/2||l||5}),className:p,name:p,isAnchorPoint:!0})}if(i){var d="link-point-top";e.shapeMap[d]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:-f,r:u/2||l||5}),className:d,name:d,isAnchorPoint:!0})}if(s){var y="link-point-bottom";e.shapeMap[y]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:f,r:u/2||l||5}),className:y,name:y,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Uw.deepMix)({},e,r),i=this.getSize(t)[0]/2;return(0,Gw.__assign)({x:0,y:0,r:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getSize(t),o=(0,Gw.__assign)({},t.style);void 0===t.style.stroke&&t.color&&(o.stroke=t.color),void 0!==t.style.r||isNaN(i[0])||(o.r=i[0]/2),this.updateShape(t,e,o,!0,r),this.updateLinkPoints(t,n)}},"single-node"),Kk("rect",{options:{size:[100,30],style:{radius:0,stroke:tT.defaultNode.style.stroke,fill:tT.defaultNode.style.fill,lineWidth:tT.defaultNode.style.lineWidth},labelCfg:{style:{fill:tT.nodeLabel.style.fill,fontSize:tT.nodeLabel.style.fontSize,fontFamily:tT.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tT.defaultNode.linkPoints.size,lineWidth:tT.defaultNode.linkPoints.lineWidth,fill:tT.defaultNode.linkPoints.fill,stroke:tT.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,Gw.__assign)({},tT.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=n,this.drawLinkPoints(t,e),n},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Uw.mix)({},e,r),i=this.getSize(t),o=n.width||i[0],a=n.height||i[1];return(0,Gw.__assign)({x:-o/2,y:-a/2,width:o,height:a},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a=e.get("keyShape");t.size||(o[0]=a.attr("width")||i.width,o[1]=a.attr("height")||i.height);var s={stroke:t.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},u=(0,Uw.mix)({},i,a.attr(),s);u=(0,Uw.mix)(u,t.style),this.updateShape(t,e,u,!1,r),this.updateLinkPoints(t,n)}},"single-node"),Kk("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:tT.defaultNode.style.stroke,fill:tT.defaultNode.style.fill,lineWidth:tT.defaultNode.style.lineWidth},labelCfg:{style:{fill:tT.nodeLabel.style.fill,fontSize:tT.nodeLabel.style.fontSize,fontFamily:tT.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tT.defaultNode.linkPoints.size,lineWidth:tT.defaultNode.linkPoints.lineWidth,fill:tT.defaultNode.linkPoints.fill,stroke:tT.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gw.__assign)({},tT.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("ellipse",{attrs:i,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gw.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0]/2,p=f[1]/2;o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:-h,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:h,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:-p,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:p,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Uw.mix)({},e,r),i=this.getSize(t),o=i[0]/2,a=i[1]/2;return(0,Gw.__assign)({x:0,y:0,rx:o,ry:a},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getSize(t),a={stroke:t.color,rx:o[0]/2,ry:o[1]/2},s=e.get("keyShape"),u=(0,Uw.mix)({},i,s.attr(),a);u=(0,Uw.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)}},"single-node"),Kk("diamond",{options:{size:[80,80],style:{stroke:tT.defaultNode.style.stroke,fill:tT.defaultNode.style.fill,lineWidth:tT.defaultNode.style.lineWidth},labelCfg:{style:{fill:tT.nodeLabel.style.fill,fontSize:tT.nodeLabel.style.fontSize,fontFamily:tT.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tT.defaultNode.linkPoints.size,lineWidth:tT.defaultNode.linkPoints.lineWidth,fill:tT.defaultNode.linkPoints.fill,stroke:tT.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gw.__assign)({},tT.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gw.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),r=e[0],n=e[1];return[["M",0,-n/2],["L",r/2,0],["L",0,n/2],["L",-r/2,0],["Z"]]},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Uw.mix)({},e,r),i=this.getPath(t);return(0,Gw.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Uw.mix)({},i,s.attr(),a);u=(0,Uw.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)}},"single-node"),Kk("triangle",{options:{size:40,direction:"up",style:{stroke:tT.defaultNode.style.stroke,fill:tT.defaultNode.style.fill,lineWidth:tT.defaultNode.style.lineWidth},labelCfg:{style:{fill:tT.nodeLabel.style.fill,fontSize:tT.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tT.defaultNode.linkPoints.size,lineWidth:tT.defaultNode.linkPoints.lineWidth,fill:tT.defaultNode.linkPoints.fill,stroke:tT.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:(0,Gw.__assign)({},tT.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.icon,i=void 0===n?{}:n,o=r.direction,a=this.getShapeStyle(t),s=t.direction||o,u=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=i.width,c=i.height,f=i.show,h=i.offset,p=i.text;if(f)if(p)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var d=-l/2,y=-c/2;"up"!==s&&"down"!==s||(y+=h),"left"!==s&&"right"!==s||(d+=h),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,Gw.__assign)({x:d,y:y},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),u},drawLinkPoints:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.linkPoints,i=void 0===n?{}:n,o=r.direction,a=t.direction||o,s=i.top,u=i.left,l=i.right,c=i.bottom,f=i.size,h=i.r,p=(0,Gw.__rest)(i,["top","left","right","bottom","size","r"]),d=this.getSize(t)[0];if(u){var y=null,v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"up"===a?y=[-g,v]:"down"===a?y=[-g,-v]:"left"===a&&(y=[-g,g-v]),y&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},p),{x:y[0],y:y[1],r:f/2||h||5}),className:"link-point-left",name:"link-point-left"}))}if(l){var m=null;v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"up"===a?m=[g,v]:"down"===a?m=[g,-v]:"right"===a&&(m=[g,g-v]),m&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},p),{x:m[0],y:m[1],r:f/2||h||5}),className:"link-point-right",name:"link-point-right"}))}if(s){var b=null;v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"up"===a?b=[g-v,-v]:"left"===a?b=[g,-v]:"right"===a&&(b=[-g,-v]),b&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},p),{x:b[0],y:b[1],r:f/2||h||5}),className:"link-point-top",name:"link-point-top"}))}if(c){var x=null;v=d*Math.sin(1/3*Math.PI),g=d*Math.sin(1/3*Math.PI);"down"===a?x=[-g+v,v]:"left"===a?x=[g,v]:"right"===a&&(x=[-g,v]),x&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},p),{x:x[0],y:x[1],r:f/2||h||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,r=t.direction||e,n=this.getSize(t)[0],i=n*Math.sin(1/3*Math.PI),o=n*Math.sin(1/3*Math.PI),a=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return"down"===r?a=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:"left"===r?a=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:"right"===r&&(a=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Uw.mix)({},e,r),i=this.getPath(t);return(0,Gw.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Uw.mix)({},i,s.attr(),a);u=(0,Uw.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}),n=r.linkPoints,i=r.direction,o=t.direction||i,a=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),s=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),u=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),l=e.shapeMap["link-point-bottom"]||e.find(function(t){return"link-point-bottom"===t.get("className")}),c=n,f=a||s||u||l;f&&(c=f.attr());var h=(0,Uw.mix)({},c,t.linkPoints),p=h.fill,d=h.stroke,y=h.lineWidth,v=h.size/2;v||(v=h.r);var g=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},m=g.left,b=g.right,x=g.top,w=g.bottom,_=this.getSize(t)[0],S={r:v,fill:p,stroke:d,lineWidth:y},E=null,k=_*Math.sin(1/3*Math.PI),T=_*Math.sin(1/3*Math.PI);"up"===o?E=[-T,k]:"down"===o?E=[-T,-k]:"left"===o&&(E=[-T,T-k]),E&&(a?m||void 0===m?a.attr((0,Gw.__assign)((0,Gw.__assign)({},S),{x:E[0],y:E[1]})):(a.remove(),delete e.shapeMap["link-point-left"]):m&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},S),{x:E[0],y:E[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var C=null;"up"===o?C=[T,k]:"down"===o?C=[T,-k]:"right"===o&&(C=[T,T-k]),C&&(s?b||void 0===b?s.attr((0,Gw.__assign)((0,Gw.__assign)({},S),{x:C[0],y:C[1]})):(s.remove(),delete e.shapeMap["link-point-right"]):b&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},S),{x:C[0],y:C[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var O=null;"up"===o?O=[T-k,-k]:"left"===o?O=[T,-k]:"right"===o&&(O=[-T,-k]),O&&(u?x||void 0===x?u.attr((0,Gw.__assign)((0,Gw.__assign)({},S),{x:O[0],y:O[1]})):(u.remove(),delete e.shapeMap["link-point-top"]):x&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},S),{x:O[0],y:O[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var A=null;"down"===o?A=[-T+k,k]:"left"===o?A=[T,k]:"right"===o&&(A=[-T,k]),A&&(l?w||void 0===w?l.attr((0,Gw.__assign)((0,Gw.__assign)({},S),{x:A[0],y:A[1]})):(l.remove(),delete e.shapeMap["link-point-bottom"]):w&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},S),{x:A[0],y:A[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),Kk("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:tT.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:tT.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:tT.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).preRect,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=this.getSize(t),a=o[0],s=o[1],u=e.addShape("rect",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=u;var l=n.show,c=(0,Gw.__rest)(n,["show"]);return l&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:(0,Gw.__assign)({x:-a/2,y:-s/2,height:s},c),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),u},drawLogoIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).logoIcon,n=void 0===r?{}:r,i=this.getSize(t)[0];if(n.show){var o=n.width,a=n.height,s=n.x,u=n.y,l=n.offset,c=n.text,f=(0,Gw.__rest)(n,["width","height","x","y","offset","text"]);e.shapeMap["rect-logo-icon"]=c?e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.addShape("image",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},f),{x:s||-i/2+o+l,y:u||-a/2,width:o,height:a}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).stateIcon,n=void 0===r?{}:r,i=this.getSize(t)[0];if(n.show){var o=n.width,a=n.height,s=n.x,u=n.y,l=n.offset,c=n.text,f=(0,Gw.__rest)(n,["width","height","x","y","offset","text"]);e.shapeMap["rect-state-icon"]=c?e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},f),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.addShape("image",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},f),{x:s||i/2-o+l,y:u||-a/2,width:o,height:a}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.bottom,u=n.size,l=n.r,c=(0,Gw.__rest)(n,["top","left","right","bottom","size","r"]),f=this.getSize(t),h=f[0],p=f[1];o&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:-h/2,y:0,r:u/2||l||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:h/2,y:0,r:u/2||l||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),i&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:-p/2,r:u/2||l||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},c),{x:0,y:p/2,r:u/2||l||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var r=this.getOptions(t),n=r.labelCfg,i=void 0===n?{}:n,o=r.logoIcon,a=void 0===o?{}:o,s=r.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t)[0],c=null,f=a.show,h=a.width,p=-l/2+i.offset;f&&(p=-l/2+h+i.offset);var d=i.style,y=u.style,v=u.paddingTop;return(0,Uw.isString)(t.description)?(c=e.addShape("text",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},d),{x:p,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c,e.shapeMap["rect-description"]=e.addShape("text",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},y),{x:p,y:17+(v||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(c=e.addShape("text",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},d),{x:p,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=c),c},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Uw.mix)({},e,r),i=this.getSize(t),o=n.width||i[0],a=n.height||i[1];return(0,Gw.__assign)({x:-o/2,y:-a/2,width:o,height:a},n)},update:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.style,i=void 0===n?{}:n,o=r.labelCfg,a=void 0===o?{}:o,s=r.descriptionCfg,u=void 0===s?{}:s,l=this.getSize(t),c=l[0],f=l[1];e.get("keyShape").attr((0,Gw.__assign)((0,Gw.__assign)({},i),{x:-c/2,y:-f/2,width:c,height:f}));var h=e.getContainer(),p=h.shapeMap["rect-logo-icon"]||h.find(function(t){return"rect-logo-icon"===t.get("className")}),d=p?p.attr():{},y=(0,Uw.mix)({},d,t.logoIcon),v=y.width;void 0===v&&(v=this.options.logoIcon.width);var g=t.logoIcon?t.logoIcon.show:void 0,m=a.offset,b=-c/2+v+m;g||void 0===g||(b=-c/2+m);var x=h.shapeMap["node-label"]||h.find(function(t){return"node-label"===t.get("className")}),w=h.shapeMap["rect-description"]||h.find(function(t){return"rect-description"===t.get("className")});if(t.label)if(x){var _=t.labelCfg?t.labelCfg.style:{},S=(0,Uw.mix)({},x.attr(),_);t.label&&(S.text=t.label),S.x=b,(0,Uw.isString)(t.description)&&(S.y=-5),w&&(w.resetMatrix(),w.attr({x:b})),x.resetMatrix(),x.attr(S)}else h.shapeMap["node-label"]=h.addShape("text",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},a.style),{x:b,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});if((0,Uw.isString)(t.description)){var E=u.paddingTop;if(w){_=t.descriptionCfg?t.descriptionCfg.style:{};var k=(0,Uw.mix)({},w.attr(),_);(0,Uw.isString)(t.description)&&(k.text=t.description),k.x=b,w.resetMatrix(),w.attr((0,Gw.__assign)((0,Gw.__assign)({},k),{y:17+(E||0)}))}else h.shapeMap["rect-description"]=h.addShape("text",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},u.style),{x:b,y:17+(E||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})}var T=h.shapeMap["pre-rect"]||h.find(function(t){return"pre-rect"===t.get("className")});if(T&&!T.destroyed){var C=(0,Uw.mix)({},T.attr(),t.preRect);T.attr((0,Gw.__assign)((0,Gw.__assign)({},C),{x:-c/2,y:-f/2,height:f}))}if(p&&!p.destroyed)if(g||void 0===g){var O=y.width,A=y.height,P=y.x,M=y.y,I=y.offset,L=(0,Gw.__rest)(y,["width","height","x","y","offset"]);p.attr((0,Gw.__assign)((0,Gw.__assign)({},L),{x:P||-c/2+O+I,y:M||-A/2,width:O,height:A}))}else p.remove(),delete h.shapeMap["pre-rect"];else g&&this.drawLogoIcon(t,h);var j=h.shapeMap["rect-state-icon"]||h.find(function(t){return"rect-state-icon"===t.get("className")}),N=j?j.attr():{},R=(0,Uw.mix)({},N,t.stateIcon);if(j){R.show||void 0===R.show||(j.remove(),delete h.shapeMap["rect-state-icon"]);var D=R.width,B=(A=R.height,P=R.x,M=R.y,R.offset),F=(0,Gw.__rest)(R,["width","height","x","y","offset"]);j.attr((0,Gw.__assign)((0,Gw.__assign)({},F),{x:P||c/2-D+B,y:M||-A/2,width:D,height:A}))}else R.show&&this.drawStateIcon(t,h);this.updateLinkPoints(t,h)},getOptions:function(t,e){return"move"===e?t:(0,Uw.deepMix)({},this.options,this.getCustomConfig(t)||{},t)}},"single-node"),Kk("star",{options:{size:60,style:{stroke:tT.defaultNode.style.stroke,fill:tT.defaultNode.style.fill,lineWidth:tT.defaultNode.style.lineWidth},labelCfg:{style:{fill:tT.nodeLabel.style.fill,fontSize:tT.nodeLabel.style.fontSize,fontFamily:tT.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tT.defaultNode.linkPoints.size,lineWidth:tT.defaultNode.linkPoints.lineWidth,fill:tT.defaultNode.linkPoints.fill,stroke:tT.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gw.__assign)({},tT.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=e.addShape("path",{attrs:i,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=o;var a=n.width,s=n.height,u=n.show,l=n.text;return u&&(e.shapeMap["".concat(this.type,"-icon")]=l?e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gw.__assign)({x:-a/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),o},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=void 0===r?{}:r,i=n.top,o=n.left,a=n.right,s=n.leftBottom,u=n.rightBottom,l=n.size,c=n.r,f=(0,Gw.__rest)(n,["top","left","right","leftBottom","rightBottom","size","r"]),h=this.getSize(t)[0];if(a){var p=Math.cos(.1*Math.PI)*h,d=Math.sin(.1*Math.PI)*h;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-right",name:"link-point-right"})}if(i){p=Math.cos(.5*Math.PI)*h,d=Math.sin(.5*Math.PI)*h;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-top",name:"link-point-top"})}if(o){p=Math.cos(.9*Math.PI)*h,d=Math.sin(.9*Math.PI)*h;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-left",name:"link-point-left"})}if(s){p=Math.cos(1.3*Math.PI)*h,d=Math.sin(1.3*Math.PI)*h;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(u){p=Math.cos(1.7*Math.PI)*h,d=Math.sin(1.7*Math.PI)*h;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},f),{x:p,y:-d,r:l/2||c||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t)[0],r=3*e/8,n=t.innerR||r;return Yk.getStarPath(e,n)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,Uw.mix)({},e,r),i=this.getPath(t);return(0,Gw.__assign)({path:i},n)},update:function(t,e,r){var n=e.getContainer(),i=this.getOptions({}).style,o=this.getPath(t),a={stroke:t.color,path:o},s=e.get("keyShape"),u=(0,Uw.mix)({},i,s.attr(),a);u=(0,Uw.mix)(u,t.style),this.updateShape(t,e,u,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}).linkPoints,n=e.shapeMap["link-point-left"]||e.find(function(t){return"link-point-left"===t.get("className")}),i=e.shapeMap["link-point-right"]||e.find(function(t){return"link-point-right"===t.get("className")}),o=e.shapeMap["link-point-top"]||e.find(function(t){return"link-point-top"===t.get("className")}),a=e.shapeMap["link-point-left-bottom"]||e.find(function(t){return"link-point-left-bottom"===t.get("className")}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(t){return"link-point-right-bottom"===t.get("className")}),u=r,l=n||i||o||a||s;l&&(u=l.attr());var c=(0,Uw.mix)({},u,t.linkPoints),f=c.fill,h=c.stroke,p=c.lineWidth,d=c.size/2;d||(d=c.r);var y=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},v=y.left,g=y.right,m=y.top,b=y.leftBottom,x=y.rightBottom,w=this.getSize(t)[0],_={r:d,fill:f,stroke:h,lineWidth:p},S=Math.cos(.1*Math.PI)*w,E=Math.sin(.1*Math.PI)*w;i?g||void 0===g?i.attr((0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E})):(i.remove(),delete e.shapeMap["link-point-right"]):g&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),S=Math.cos(.5*Math.PI)*w,E=Math.sin(.5*Math.PI)*w,o?m||void 0===m?o.attr((0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E})):(o.remove(),delete e.shapeMap["link-point-top"]):m&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),S=Math.cos(.9*Math.PI)*w,E=Math.sin(.9*Math.PI)*w,n?v||void 0===v?n.attr((0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E})):(n.remove(),delete e.shapeMap["link-point-left"]):v&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),S=Math.cos(1.3*Math.PI)*w,E=Math.sin(1.3*Math.PI)*w,a?b||void 0===b?a.attr((0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E})):(a.remove(),delete e.shapeMap["link-point-left-bottom"]):b&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),S=Math.cos(1.7*Math.PI)*w,E=Math.sin(1.7*Math.PI)*w,s?x||void 0===x?s.attr((0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E})):(s.remove(),delete e.shapeMap["link-point-right-bottom"]):x&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},_),{x:S,y:-E}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var yL=Yk.defaultSubjectColors;Kk("donut",{options:{size:tT.defaultNode.size,style:{x:0,y:0,stroke:tT.defaultNode.style.stroke,fill:tT.defaultNode.style.fill,lineWidth:tT.defaultNode.style.lineWidth},labelCfg:{style:{fill:tT.nodeLabel.style.fill,fontSize:tT.nodeLabel.style.fontSize,fontFamily:tT.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:tT.defaultNode.linkPoints.size,lineWidth:tT.defaultNode.linkPoints.lineWidth,fill:tT.defaultNode.linkPoints.fill,stroke:tT.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,Gw.__assign)({},tT.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=void 0===r?{}:r,i=this.getShapeStyle(t),o=(0,Uw.deepMix)({},n,t.icon),a=e.addShape("circle",{attrs:i,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=a;var s=o.width,u=o.height,l=o.show,c=o.text;return l&&(e.shapeMap["".concat(this.type,"-icon")]=c?e.addShape("text",{attrs:(0,Gw.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.addShape("image",{attrs:(0,Gw.__assign)({x:-s/2,y:-u/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),vL(t,e,a),this.drawLinkPoints(t,e),a},updateShape:function(t,e,r,n,i){var o=e.get("keyShape");o.attr((0,Gw.__assign)({},r)),mL(t,e,o),this.updateLabel(t,e,i),n&&this.updateIcon(t,e)}},"circle");var vL=function(t,e,r){var n=t.donutAttrs,i=void 0===n?{}:n,o=t.donutColorMap,a=void 0===o?{}:o,s=Object.keys(i).length;if(i&&s>1){var u=bL(i,a),l=u.configs,c=u.totalValue;if(c){var f=xL(r),h=f.lineWidth,p=f.arcR,d=[p,0],y=0;if(1===s)return void gL(e,{arcR:p,arcBegin:d,beginAngle:y,config:l[0],fanIndex:0,lineWidth:h,totalValue:c,drawWhole:!0});for(var v=0;v.999)r=[o,1e-4],i=1;else{var g=v*Math.PI*2;n=s+g,r=[o*Math.cos(n),-o*Math.sin(n)],i=g>Math.PI?1:0}var m={path:[["M",a[0],a[1]],["A",o,o,0,i,0,r[0],r[1]]],stroke:u.color||(null===y||void 0===y?void 0:y.attr("stroke"))||yL[l%yL.length],lineWidth:c};return y?y.attr(m):t.shapeMap["".concat("fan-shape-").concat(l)]=t.addShape("path",{attrs:m,name:"".concat("fan-shape-").concat(l),draggable:!0}),{beginAngle:n,arcBegin:r,shape:t.shapeMap["".concat("fan-shape-").concat(l)],shouldEnd:p||v>.999}},mL=function(t,e,r){var n=t.donutAttrs,i=t.donutColorMap,o=void 0===i?{}:i,a={},s=e.getContainer();if(n){var u=bL(n,o),l=u.configs,c=u.totalValue;if(c)for(var f=xL(r),h=f.lineWidth,p=f.arcR,d=[p,0],y=0,v=0;v=0;n--){var i=t[n];i.id="".concat(i.x,"|||").concat(i.y),r[i.id]||(r[i.id]=i,e.push(i))}return e},SL=function(t){return _L(t)},EL=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},kL=function(t,e,r){var n=function(t,e){var r=Math.abs(t.x-e.centerX),n=Math.abs(t.y-e.centerY);return 0===r&&0===n?0:r/e.width>n/e.height}(e,t);if(0===n){var i=t.centerX,o=t.centerY;return r.ye.x?i=t.maxX:r.xt.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},TL=function(t,e){var r=Math.min(t.minX,e.minX),n=Math.min(t.minY,e.minY),i=Math.max(t.maxX,e.maxX),o=Math.max(t.maxY,e.maxY);return{centerX:(r+i)/2,centerY:(n+o)/2,minX:r,minY:n,maxX:i,maxY:o,height:o-n,width:i-r}},CL=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},OL=function(t,e){var r=t.x,n=t.y;return re.maxX||ne.maxY},AL=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},PL=function(t,e,r,n,i){return AL(t,e)+AL(t,r)+function(t,e){var r=0;return e.forEach(function(e){e&&(t.x===e.x&&(r+=-2),t.y===e.y&&(r+=-2))}),r}(t,[e,r,n,i])},ML=function t(e,r,n,i,o){void 0===o&&(o=0),e.unshift(r[i]),n[i]&&n[i]!==i&&o<=100&&t(e,r,n,n[i],o+1)},IL=function(t,e,r,n){var i=r.x-t.x,o=r.y-t.y,a=n.x-t.x,s=n.y-t.y,u=r.x-e.x,l=r.y-e.y,c=n.x-e.x,f=n.y-e.y;return(i*s-o*a)*(u*f-l*c)<=0&&(i*l-o*u)*(a*f-s*c)<=0},LL=function(t,e,r){if(r.width||r.height){var n=CL(r),i=n[0],o=n[1],a=n[2],s=n[3];return IL(t,e,i,o)||IL(t,e,i,s)||IL(t,e,o,a)||IL(t,e,a,s)}return!1},jL=function(t,e,r,n){var i=[];return t.forEach(function(t){if(t!==e&&(t.x===e.x||t.y===e.y)){if(LL(t,e,r)||LL(t,e,n))return;i.push(t)}}),_L(i)},NL=function(t,e){var r=[],n=t[0];return r.push("M".concat(n.x," ").concat(n.y)),t.forEach(function(n,i){var o=t[i+1],a=t[i+2];if(o&&a)if(function(t,e,r){return!(t.x===e.x&&e.x===r.x||t.y===e.y&&e.y===r.y)}(n,o,a)){var s=function(t,e,r,n){var i=AL(t,e),o=AL(r,e);return it.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]}(t,e.x).concat(function(t,e){return et.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]}(t,e.y))}(t,S).filter(function(t){return OL(t,y)&&OL(t,v)}))}),[{x:g.x,y:m.y},{x:m.x,y:g.y}].forEach(function(t){OL(t,y)&&OL(t,v)&&_.push(t)}),_.unshift(g),_.push(m);var E=function(t,e,r,n,i,o,a){var s,u=[],l=((s={})[e.id]=e,s),c={},f={},h={};f[e.id]=0,h[e.id]=PL(e,r,e);var p=new DL;p.add({id:e.id,value:h[e.id]});var d,y={};for(t.forEach(function(t){y[t.id]=t});Object.keys(l).length;){var v=p.minId(!1);if(!v)break;if((d=l[v])===r){var g=[];return ML(g,y,c,r.id),g}delete l[d.id],p.remove(d.id),u.push(d);var m=jL(t,d,n,i);m.forEach(function(t){if(-1===u.indexOf(t)){var n=t.id;l[n]||(l[n]=t);var i=h[d.id]+AL(d,t);f[n]&&i>=f[n]?p.add({id:n,value:h[n]}):(c[n]=d.id,f[n]=i,h[n]=f[n]+PL(t,r,e,o,a),p.add({id:n,value:h[n]}))}})}return[e,r]}(_=_L(_),g,m,o,a,t,e);return E.unshift(t),E.push(e),SL(E)},DL=function(){function t(){this.arr=[],this.map={},this.arr=[],this.map={}}return t.prototype._innerAdd=function(t,e){for(var r=[0,e-1];r[1]-r[0]>1;){var n=Math.floor((r[0]+r[1])/2);if(this.arr[n].value>t.value)r[1]=n;else{if(!(this.arr[n].value=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},t.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},t.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},t}(),BL={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},fallbackRoute:function(t,e,r,n,i){return SL(RL(t,e,r,n,i.offset))}},FL=(Math.PI,function(t,e){var r=Math.round(Math.abs(t/e));return r<0?0:(t<0?-1:1)*r}),zL=function(t,e){var r=e.x-t.x,n=e.y-t.y;return r||n?Math.atan2(n,r):0},GL=function(t,e){var r=Math.abs(t-e);return r>Math.PI?2*Math.PI-r:r},UL=function(t,e,r){for(var n=1/0,i=0,o=e.length;iu.minX&&e.xu.minY&&e.y0&&C>0;){var P=m.minId((C+1)%30==0);if(!P)break;if(w=p[P],A["".concat(w.x,"|||").concat(w.y)])return WL(w,y,l,e,t,c,s);delete p[w.id],m.remove(w.id),d[w.id]=!0;for(b=0;bo.maxAllowedDirectionChange||u[M])){p[M]||(p[M]=S);var I=a[T];E=o.distFunc(w,S)+(isNaN(I)?s:I),k=v[w.id]+E;var L=v[M];L&&k>=L||(y[M]=w,v[M]=k,g[M]=k+UL(S,h,o.distFunc),m.add({id:M,value:g[M]}))}}C-=1}return o.fallbackRoute(t,e,r,n,o)};Jk("polyline",{options:{color:tT.defaultEdge.color,size:tT.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:tT.defaultEdge.style.stroke,lineAppendWidth:tT.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:tT.edgeLabel.style.fill,fontSize:tT.edgeLabel.style.fontSize,fontFamily:tT.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:(0,Gw.__assign)({},tT.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t);0===r.radius&&delete r.radius;var n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,Uw.mix)({},e,r,t.style);t=this.getPathPoints(t),this.radius=n.radius,this.offset=n.offset;var i=t.startPoint,o=t.endPoint,a=this.getControlPoints(t),s=[i];a&&(s=s.concat(a)),s.push(o);var u=t.sourceNode,l=t.targetNode,c=n.radius,f=this.options.routeCfg,h=(0,Uw.mix)({},f,t.routeCfg);h.offset=n.offset;var p=this.getPath(s,u,l,c,h,!Boolean(a));return((0,Uw.isArray)(p)&&p.length<=1||(0,Uw.isString)(p)&&-1===p.indexOf("L"))&&(p="M0 0, L0 0"),(isNaN(i.x)||isNaN(i.y)||isNaN(o.x)||isNaN(o.y))&&(p="M0 0, L0 0"),(0,Uw.mix)({},tT.defaultEdge.style,n,{lineWidth:t.size,path:p})},updateShapeStyle:function(t,e){var r=e.getContainer();if(e.isVisible()){var n={stroke:t.color},i=r.shapeMap["edge-shape"]||r.find(function(t){return"edge-shape"===t.get("className")})||e.getKeyShape(),o=t.size,a=(t=this.getPathPoints(t)).startPoint,s=t.endPoint,u=this.getControlPoints(t),l=[a];u&&(l=l.concat(u)),l.push(s);var c=i.attr(),f=(0,Uw.mix)({},n,c,t.style),h=t.sourceNode,p=t.targetNode,d=f.radius,y=this.options.routeCfg,v=(0,Uw.mix)({},y,t.routeCfg);v.offset=f.offset;var g=this.getPath(l,h,p,d,v,!Boolean(u));((0,Uw.isArray)(g)&&g.length<=1||(0,Uw.isString)(g)&&-1===g.indexOf("L"))&&(g="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(s.x)||isNaN(s.y))&&(g="M0 0, L0 0"),c.endArrow&&!1===f.endArrow&&(t.style.endArrow={path:""}),c.startArrow&&!1===f.startArrow&&(t.style.startArrow={path:""});var m=(0,Uw.mix)(n,i.attr(),{lineWidth:o,path:g},t.style);i&&i.attr(m)}},getPath:function(t,e,r,n,i,o){var a=i.offset,s=i.obstacles,u=i.simple;if(!a||t.length>2||!1===o){if(n)return NL(t,n);var l=[];return(0,Uw.each)(t,function(t,e){0===e?l.push(["M",t.x,t.y]):l.push(["L",t.x,t.y])}),l}!1===u||(null===s||void 0===s?void 0:s.length)||(u=!0);var c=u?RL(t[t.length-1],t[0],r,e,a):qL(t[0],t[t.length-1],e,r,i);return c&&c.length?n?NL(c,n):(c=function(t){if(!(null===t||void 0===t?void 0:t.length))return t;for(var e=t[t.length-1],r={x:e.x,y:e.y},n=[e],i=[e],o=t.length-2;o>=0;o--){var a,s=t[o];s.x===r.x?n.push(s):(n=[s],r.x=s.x),s.y===r.y?i.push(s):(i=[s],r.y=s.y),n.length>2?(a=t.indexOf(n[1]))>-1&&t.splice(a,1):i.length>2&&(a=t.indexOf(i[1]))>-1&&t.splice(a,1)}return t}(c),Yk.pointsToPolygon(c)):"M0 0, L0 0"}},"single-edge");var YL=CA.cloneEvent,XL=CA.isNaN,ZL=Math.abs,KL=["shift","ctrl","alt","control"],JL={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,r=+t.clientX,n=+t.clientY;if(!XL(r)&&!XL(n)){var i=r-e.x,o=n-e.y;"x"===this.get("direction")?o=0:"y"===this.get("direction")&&(i=0),this.origin={x:r,y:n};var a=this.graph.get("width"),s=this.graph.get("height"),u=this.graph.get("canvas").getCanvasBBox(),l=this.scalableRange,c=this.scalableRange;l<1&&l>-1&&(l*=a,c*=s),(u.minX<=a+l&&u.minX+i>a+l||u.maxX+l>=0&&u.maxX+l+i<0)&&(i=0),(u.minY<=s+c&&u.minY+o>s+c||u.maxY+c>=0&&u.maxY+c+o<0)&&(o=0),this.graph.translate(i,o)}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];r&&n||(t.preventDefault(),this.mousedown=!0,this.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){this.mousedown&&(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=t.originalEvent;if((!e||"touchstart"===t.name||0===e.button)&&("touchstart"===t.name||"undefined"==typeof window||!window.event||window.event.buttons||window.event.button)&&this.shouldBegin(t,this)&&!this.keydown&&this.allowDrag(t)){if(this.origin={x:t.clientX,y:t.clientY},this.dragging=!1,this.enableOptimize){for(var r=this.graph,n=r.getEdges(),i=0,o=n.length;is)for(var h=n.getNodes(),p=0,d=h.length;p-1?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,r,n=t.target,i=n&&n.isCanvas&&n.isCanvas();if((0,Uw.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!i)return!1;if((0,Uw.isObject)(this.allowDragOnItem)){var o=this.allowDragOnItem,a=o.node,s=o.edge,u=o.combo,l=null===(r=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===r?void 0:r.call(e);if(!a&&"node"===l)return!1;if(!s&&"edge"===l)return!1;if(!u&&"combo"===l)return!1}return!0}},QL={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){return!(!this.origin||!t||t.destroyed)&&"combo"===t.getType()},onTouchStart:function(t){if(t.item){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,this.onDragStart(t)}},onTouchMove:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return void this.onDragEnd(t);t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},"undefined"==typeof window||this.windowEventBinded||(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,r;"node"===(null===(r=null===(e=t.item)||void 0===e?void 0:e.getType)||void 0===r?void 0:r.call(e))?this.mousedown&&(this.dragstart?this.onDrag((0,Gw.__assign)((0,Gw.__assign)({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t))):this.onDragEnd()},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,this.shouldBegin((0,Gw.__assign)((0,Gw.__assign)({},t),this.mousedown),this)){var r=this.mousedown,n=r.item,i=r.target;if(n&&!n.destroyed&&!n.hasLocked()){if(n.getContainer().set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n),i)if(i.get("isAnchorPoint"))return;var o=this.graph;this.targets=[],this.targetCombo=null;var a=o.findAllByState("node",this.selectedState),s=n.get("id");if(0===a.filter(function(t){var e=t.get("id");return s===e}).length?this.targets.push(n):a.length>1?a.forEach(function(t){t.hasLocked()||e.targets.push(t)}):this.targets.push(n),this.graph.get("enabledStack")&&this.enableStack){var u=[];this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,i=e.id;u.push({x:r,y:n,id:i})}),this.set("beforeDragNodes",u)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(t){t.getEdges().forEach(function(t){t.isVisible()&&(e.hidenEdge[t.getID()]=!0,t.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(this.mousedown&&this.origin&&this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(n){e.update(n,t);var i=n.getModel().comboId;i&&(r[i]=e.graph.findById(i))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e,r=this;if(this.mousedown=!1,this.dragstart=!1,"undefined"!=typeof window&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),this.origin){null===(e=this.cachedCaptureItems)||void 0===e||e.forEach(function(t){t.getContainer().set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(t){t.getEdges().forEach(function(t){r.hidenEdge[t.getID()]&&t.show(),t.refresh()})}),this.hidenEdge={};var n=this.graph;if(n.get("enabledStack")&&this.enableStack){var i={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(t){i.before.nodes.push(t)}),this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,o=e.id;i.after.nodes.push({x:r,y:n,id:o})}),n.pushStack("update",(0,Uw.clone)(i))}n.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&this.validationCombo(e)){var r=this.graph;if(this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)r.updateCombos();else{var n=e.getModel();this.targets.map(function(t){t.getModel().comboId!==n.id&&r.updateComboTree(t,n.id)}),r.updateCombo(e)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),this.targets&&0!==this.targets.length&&this.currentShouldEnd&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(t){t.getModel().comboId&&e.updateComboTree(t)}))},onDropNode:function(t){if(this.targets&&0!==this.targets.length){var e=t.item,r=this.graph,n=e.getModel().comboId,i=n?r.findById(n):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(n){var o=r.findById(n);this.comboActiveState&&r.setItemState(o,this.comboActiveState,!1),this.targets.map(function(t){var e=t.getModel();n!==e.comboId&&r.updateComboTree(t,n)}),r.updateCombo(o)}else this.targets.map(function(t){t.getModel().comboId&&r.updateComboTree(t)});r.emit("dragnodeend",{items:this.targets,targetItem:e})}}},onDragEnter:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var r=this;this.targets&&0!==this.targets.length&&(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map(function(e){return r.update(e,t)}):this.targets.map(function(n){return r.update(n,t,e)}))},update:function(t,e,r){var n=this.origin,i=t.get("model"),o=t.get("id");this.point[o]||(this.point[o]={x:i.x||0,y:i.y||0});var a=e.x-n.x+this.point[o].x,s=e.y-n.y+this.point[o].y;r&&(a+=n.x-e.x,s+=n.y-e.y);var u={x:a,y:s};this.get("updateEdge")?this.graph.updateItem(t,u,!1):t.updatePosition(u)},debounceUpdate:(0,Uw.debounce)(function(t){var e=t.targets,r=t.graph,n=t.point,i=t.origin,o=t.evt,a=t.updateEdge,s=t.onlyChangeComboSize,u=t.updateParentCombos;e.map(function(t){var e=t.get("model"),s=t.get("id");n[s]||(n[s]={x:e.x||0,y:e.y||0});var u={x:o.x-i.x+n[s].x,y:o.y-i.y+n[s].y};a?r.updateItem(t,u,!1):t.updatePosition(u)}),s&&u(r,e)},50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var r=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:r,y:n})}else{var i=e.get("group"),o=(0,Uw.deepMix)({},uA.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),s=a.x,u=a.y,l=a.width,c=a.height,f=a.minX,h=a.minY;this.originPoint={x:s,y:u,width:l,height:c,minX:f,minY:h},this.delegateRect=i.addShape("rect",{attrs:(0,Gw.__assign)({width:l,height:c,x:s,y:u},o),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;0===e.length&&e.push(t.item);for(var r=1/0,n=-1/0,i=1/0,o=-1/0,a=0;an&&(n=c),f>o&&(o=f)}return{x:Math.floor(r),y:Math.floor(i),width:Math.ceil(n)-Math.floor(r),height:Math.ceil(o)-Math.floor(i),minX:r,minY:i}},updateParentCombos:function(t,e){var r=t||this.graph,n=e||this.targets,i={};null===n||void 0===n||n.forEach(function(t){var e=t.getModel().comboId;e&&(i[e]=r.findById(e))}),Object.values(i).forEach(function(t){t&&r.updateCombo(t)})}},$L=null,tj={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldClearStatusOnSecond:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return"mouseenter"===this.get("trigger")?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.setAllItemStates(t)},clearOnTouchStart:function(t){try{var e=t.originalEvent.touches,r=e[0],n=e[1];if(r&&n)return;t.preventDefault()}catch(t){console.warn("Touch original event not exist!")}this.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this;this.shouldClearStatusOnSecond&&($L=null),this.timer=setTimeout(function(){e.throttleClearActiveState(t,e)},50)},throttleSetAllItemStates:(0,Uw.throttle)(function(t,e){var r=t.item,n=e.graph;if(n&&!n.destroyed&&(e.item=r,e.shouldUpdate(t.item,{event:t,action:"activate"},e))){var i=e.shouldClearStatusOnSecond,o=r.getModel().id;if($L===o&&i)return e.throttleClearActiveState(t,e),void($L=null);for(var a=e.activeState,s=e.inactiveState,u=n.getNodes(),l=n.getCombos(),c=n.getEdges(),f=n.get("vedges"),h=u.length,p=l.length,d=c.length,y=f.length,v=e.inactiveItems||{},g=e.activeItems||{},m=0;m-1||(this.trigger="shift",console.warn("Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,r=this.brush,n=this.selectOnCombo,i="combo"===(null===e||void 0===e?void 0:e.getType());i&&!n||!i&&e||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&this.updateBrush(t)},onMouseUp:function(t){this.graph;(this.brush||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this.graph,e=this.selectedState,r=t.findAllByState("node",e),n=t.findAllByState("edge",e),i=t.findAllByState("combo",e);r.forEach(function(r){return t.setItemState(r,e,!1)}),n.forEach(function(r){return t.setItemState(r,e,!1)}),i.forEach(function(r){return t.setItemState(r,e,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,r,n,i){var o=t.getBBox();return o.centerX>=e&&o.centerX<=r&&o.centerY>=n&&o.centerY<=i},getSelectedNodes:function(t){var e=this,r=this.graph,n=this.originPoint,i=this.shouldUpdate,o=this.isBBoxCenterInRect,a=this.selectedState,s={x:t.x,y:t.y},u=r.getPointByCanvas(n.x,n.y),l=ej(s.x,u.x),c=rj(s.x,u.x),f=ej(s.y,u.y),h=rj(s.y,u.y),p=[],d=[];r.getNodes().forEach(function(t){if(t.isVisible()&&o(t,l,c,f,h)&&i(t,"select",e)){p.push(t);var n=t.getModel();d.push(n.id),r.setItemState(t,a,!0)}});var y=[];this.includeEdges&&p.forEach(function(t){t.getOutEdges().forEach(function(t){if(t.isVisible()){var n=t.getModel(),o=n.source,a=n.target;d.includes(o)&&d.includes(a)&&i(t,"select",e)&&(y.push(t),r.setItemState(t,e.selectedState,!0))}})});var v=[];this.includeCombos&&r.getCombos().forEach(function(t){if(t.isVisible()&&o(t,l,c,f,h)&&i(t,"select",e)){v.push(t);var n=t.getModel();d.push(n.id),r.setItemState(t,a,!0)}}),this.selectedEdges=y,this.selectedNodes=p,this.selectedCombos=v,this.onSelect&&this.onSelect(p,y,v),r.emit("nodeselectchange",{selectedItems:{nodes:p,edges:y,combos:v},select:!0})},createBrush:function(){var t=this.graph.get("canvas").addShape("rect",{attrs:this.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:nj(t.canvasX-e.x),height:nj(t.canvasY-e.y),x:ej(t.canvasX,e.x),y:ej(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.keydown=n===r||"control"===n&&"ctrl"===r||"ctrl"===n&&"control"===r}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},aj=["shift","ctrl","alt","control"],sj={getDefaultCfg:function(){return{multiple:!0,trigger:"shift",selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){return aj.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),this.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,r=t.item;if(r&&!r.destroyed){var n=r.getType(),i=e.graph,o=e.keydown,a=e.multiple,s=e.shouldUpdate;if((0,e.shouldBegin)(t,e)){if(!o||!a){var u=i.findAllByState("node",e.selectedState).concat(i.findAllByState("edge",e.selectedState)).concat(i.findAllByState("combo",e.selectedState));(0,Uw.each)(u,function(t){t!==r&&i.setItemState(t,e.selectedState,!1)})}if(function(){switch(n){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}())if(r.hasState(e.selectedState)){s(t,e)&&i.setItemState(r,e.selectedState,!1);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:r,selectedItems:{nodes:l,edges:c,combos:f},select:!1})}else{s(t,e)&&i.setItemState(r,e.selectedState,!0);l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{target:r,selectedItems:{nodes:l,edges:c,combos:f},select:!0})}else{var l=i.findAllByState("node",e.selectedState),c=i.findAllByState("edge",e.selectedState),f=i.findAllByState("combo",e.selectedState);i.emit("nodeselectchange",{selectedItems:{nodes:l,edges:c,combos:f},select:!1})}}}},onCanvasClick:function(t){var e=this,r=this.graph;if((0,this.shouldBegin)(t,this)){var n=r.findAllByState("node",this.selectedState);(0,Uw.each)(n,function(t){r.setItemState(t,e.selectedState,!1)});var i=r.findAllByState("edge",this.selectedState);(0,Uw.each)(i,function(t){r.setItemState(t,e.selectedState,!1)});var o=r.findAllByState("combo",this.selectedState);(0,Uw.each)(o,function(t){r.setItemState(t,e.selectedState,!1)}),r.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()||"control"===e.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.keydown=!1}},uj=Yw.pd,lj={getDefaultCfg:function(){return this.isFireFox="firefox"===TA(),{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];t.preventDefault(),n&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:r.pageX,pageY:r.pageY},this.moveable=!0,n&&(this.endPoint={pageX:n.pageX,pageY:n.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(this.moveable){t.preventDefault();var e=t.originalEvent.touches,r=e[0],n=e[1];if(n){this.endPoint||(this.endPoint={pageX:n.pageX,pageY:n.pageY});var i=function(t,e){return Math.hypot(e.x-t.x,e.y-t.y)},o=i({x:r.pageX,y:r.pageY},{x:n.pageX,y:n.pageY})/i({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),a=this.originScale*o;this.currentScale=a;var s=this.get("minZoom")||this.graph.get("minZoom");if(!(a>(this.get("maxZoom")||this.graph.get("maxZoom"))||a0||t.wheelDelta<0?1-.05*o:1/(1-.05*o):t.wheelDelta<0?1-.05*o:1/(1-.05*o));var u=this.get("minZoom")||r.get("minZoom"),l=this.get("maxZoom")||r.get("maxZoom");if(s>l?s=l:sr/2?u-=c.width:u+=this.offset,l>n/2?l-=c.height:l+=this.offset;var f="".concat(u,"px"),h="".concat(l,"px");rP(this.container,{left:f,top:h,visibility:"visible"})}else rP(i,{visibility:"hidden"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var r=oO('
    '));return e.parentNode.appendChild(r),rP(r,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},fj=(0,Gw.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},cj),hj=(0,Gw.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},cj),pj=["click","dblclick"],dj={getDefaultCfg:function(){return{trigger:"click",onChange:function(){}}},getEvents:function(){var t,e;return pj.includes(this.trigger)?e=this.trigger:(e="click",console.warn("Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if("click"===this.trigger){if(this.timer)return clearTimeout(this.timer),void(this.timer=0);this.timer=setTimeout(function(){e.toggle(t),clearTimeout(e.timer),e.timer=0},200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(e){var r=this.graph.findDataById(e.get("id"));if(r){var n=r.children;if(n&&0!==n.length){var i=!r.collapsed;this.shouldBegin(t,i,this)&&(r.collapsed=i,e.getModel().collapsed=i,this.graph.emit("itemcollapsed",{item:t.item,collapsed:i}),this.shouldUpdate(t,i,this)&&(this.onChange(e,i,this),this.graph.layout()))}}}}},yj=CA.calculationItemsBBox,vj={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;return!(!e||e.destroyed)&&(!!this.shouldUpdate(t,this)&&"combo"===e.getType())},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,r=this.graph,n=t.item;if(this.currentShouldEnd=!0,this.validationCombo(t)){this.targets=[];var i=r.findAllByState("combo",this.selectedState),o=n.get("id");0===i.filter(function(t){var e=t.get("id");return o===e}).length?this.targets.push(n):this.targets=i;var a=[];this.targets.forEach(function(t){var e=t.getModel(),r=e.x,n=e.y,i=e.id;a.push({x:r,y:n,id:i})}),this.set("beforeDragItems",a),this.activeState&&this.targets.map(function(t){var n=t.getModel();if(n.parentId){var i=r.findById(n.parentId);i&&r.setItemState(i,e.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],function t(e,r){if(!1!==r(e)&&e){var n=e.get("combos");if(0===n.length)return!1;(0,Uw.each)(n,function(e){t(e,r)})}}(n,function(t){if(t.destroyed)return!1;var r=t.getModel();return e.currentItemChildCombos.push(r.id),!0})}},onDrag:function(t){var e=this;if(this.origin&&this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var r=this.graph,n=t.item,i=n.getModel(),o=r.getCombos(),a=n.getBBox(),s=a.centerX,u=a.centerY,l=a.width;o.filter(function(t){var r=t.getModel();return i.parentId,r.id!==i.id&&!e.currentItemChildCombos.includes(r.id)}).map(function(t){var n=t.getBBox(),i=n.centerX,o=n.centerY,a=n.width,c=s-i,f=u-o,h=2*Math.sqrt(c*c+f*f);l+a-h>.8*l?r.setItemState(t,e.activeState,!0):r.setItemState(t,e.activeState,!1)})}(0,Uw.each)(this.targets,function(r){e.updateCombo(r,t)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var r=this;(this.enableDelegate||e)&&(0,Uw.each)(this.targets,function(n){r.updateCombo(n,t,e)})},onDrop:function(t){var e=this,r=t.item;if(this.currentShouldEnd=this.shouldEnd(t,r,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd&&r&&this.targets&&!r.destroyed){var n=this.graph,i=r.getModel();this.targets.map(function(t){t.getModel().parentId!==i.id?(e.activeState&&n.setItemState(r,e.activeState,!1),e.onlyChangeComboSize?n.updateCombo(t):n.updateComboTree(t,i.id,!1)):n.updateCombo(r)}),this.end(r,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(this.targets&&0!==this.targets.length){var r=this.graph,n=t.item.getModel().comboId,i=n?r.findById(n):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),this.currentShouldEnd){var o;if(n){if(this.activeState){var a=r.findById(n);r.setItemState(a,this.activeState,!1)}this.targets.map(function(t){e.onlyChangeComboSize?r.updateCombo(t):n!==t.getID()&&(o=r.findById(n),n!==t.getModel().parentId&&r.updateComboTree(t,n,!1))})}else this.targets.map(function(t){e.onlyChangeComboSize?r.updateCombo(t):t.getModel().comboId&&r.updateComboTree(t,void 0,!1)});this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(this.origin&&this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(this.targets&&0!==this.targets.length){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var r=this.getParentCombo(e.getModel().parentId),n=this.graph;r&&this.activeState&&n.setItemState(r,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var r=this;if(this.origin){var n=this.graph;if(this.delegateShape)n.get("delegateGroup").clear(),this.delegateShape=null;if(t&&this.activeState&&n.setItemState(t,this.activeState,!1),!t){var i=n.get("enabledStack")&&this.enableStack,o={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(t){if(r.onlyChangeComboSize){n.updateCombo(t);var e=t.getModel(),a=e.x,s=e.y,u=e.id;o.after.combos.push({x:a,y:s,id:u}),n.pushStack("update",o)}else n.updateComboTree(t,void 0,i)})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,r){var n=this;if(void 0===r&&(r={}),!1!==e(t,r)&&t){var i=t.get("combos");(0,Uw.each)(i,function(t){n.traverse(t,e,r)});var o=t.get("nodes");(0,Uw.each)(o,function(t){n.traverse(t,e,r)})}},updateCombo:function(t,e,r){this.updateSingleItem(t,e,r);var n={};this.traverse(t,function(t,e){return!t.destroyed&&(t.getEdges().forEach(function(t){return e[t.getID()]=t}),!0)},n),Object.values(n).forEach(function(t){return t.refresh()})},updateSingleItem:function(t,e,r){var n=this.origin,i=this.graph,o=t.getModel(),a=t.get("id");this.point[a]||(this.point[a]={x:o.x,y:o.y});var s=e.x-n.x+this.point[a].x,u=e.y-n.y+this.point[a].y;r&&(s+=n.x-e.x,u+=n.y-e.y),i.updateItem(t,{x:s,y:u},!1)},getParentCombo:function(t){var e=this.graph;if(t){var r=e.findById(t);if(r)return r}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var r=t.x-this.origin.x+this.originPoint.minX,n=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:r,y:n})}else{var i=e.get("delegateGroup"),o=null,a=(o=this.targets.length>1?yj(this.targets):this.targets[0].getBBox()).x,s=o.y,u=o.width,l=o.height,c=o.minX,f=o.minY;this.originPoint={x:a,y:s,width:u,height:l,minX:c,minY:f};var h=(0,Gw.__assign)((0,Gw.__assign)({},uA.delegateStyle),this.delegateStyle);this.delegateShape=i.addShape("rect",{attrs:(0,Gw.__assign)({width:o.width,height:o.height,x:o.x,y:o.y},h),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this.graph,e=this.targets,r={};null===e||void 0===e||e.forEach(function(e){var n=e.getModel().parentId;n&&(r[n]=t.findById(n))}),Object.values(r).forEach(function(e){e&&t.updateCombo(e)})}},gj=["click","dblclick"],mj={getDefaultCfg:function(){return{trigger:"dblclick",relayout:!0}},getEvents:function(){var t,e;return gj.includes(this.trigger)?e=this.trigger:(e="dblclick",console.warn("Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'")),(t={})["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,r=this.graph,n=this.relayout;if(e&&!e.destroyed&&"combo"===e.getType()){var i=e.getModel().id;i&&(r.collapseExpandCombo(i),n&&r.get("layout")?r.layout():r.refreshPositions())}}},bj=CA.isPolygonsIntersect,xj=CA.pathToPoints,wj=["drag","shift","ctrl","alt","control"],_j=["click","drag"],Sj=["shift","ctrl","control","alt","meta",void 0],Ej=["shift","ctrl","alt","control"],kj=["shift","ctrl","alt","control","meta"],Tj={"drag-canvas":JL,"zoom-canvas":lj,"drag-node":QL,"activate-relations":tj,"brush-select":oj,"click-select":sj,"lasso-select":{getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:"shift",includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return wj.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="shift",console.warn("Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'")),"drag"===this.trigger?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso;t.item||("drag"===this.trigger||this.keydown)&&(this.selectedNodes&&0!==this.selectedNodes.length&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){this.dragging&&("drag"===this.trigger||this.keydown)&&(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){(this.lasso||this.dragging)&&("drag"===this.trigger||this.keydown)&&(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach(function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){void 0===t&&(t="canvas:click");var e=this.graph,r=this.selectedState,n=this.shouldDeselect,i=e.findAllByState("node",r),o=e.findAllByState("edge",r);n&&!n({action:t,nodes:i,edges:o})||(i.forEach(function(t){return e.setItemState(t,r,!1)}),o.forEach(function(t){return e.setItemState(t,r,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this.graph,r=this.shouldUpdate,n=this.points.map(function(t){return[e.getCanvasByPoint(t.x,t.y).x,e.getCanvasByPoint(t.x,t.y).y]}),i=this.selectedState,o=[],a=[];e.getNodes().forEach(function(s){if(s.isVisible()&&function(t,e){var r,n=t.getKeyShape();if("path"===t.get("type"))r=xj(n.attr("path"));else{var i=n.getCanvasBBox();r=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return bj(e,r)}(s,n)&&r(s,"select",t)){o.push(s);var u=s.getModel();a.push(u.id),e.setItemState(s,i,!0)}});var s=[];this.includeEdges&&o.forEach(function(n){n.getOutEdges().forEach(function(n){if(n.isVisible()){var i=n.getModel(),o=i.source,u=i.target;a.includes(o)&&a.includes(u)&&r(n,"select",t)&&(s.push(n),e.setItemState(n,t.selectedState,!0))}})}),this.selectedEdges=s,this.selectedNodes=o,this.onSelect&&this.onSelect(o,s),e.emit("nodeselectchange",{selectedItems:{nodes:o,edges:s},select:!0})},createLasso:function(){var t=this.graph.get("delegateGroup").addShape("path",{attrs:(0,Gw.__assign)({path:[]},this.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(t){this.lasso.attr({path:this.getLassoPath()})},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},tooltip:fj,"edge-tooltip":hj,"collapse-expand":dj,"drag-combo":vj,"collapse-expand-combo":mj,"create-edge":{getDefaultCfg:function(){return{trigger:"click",key:void 0,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t;return _j.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="click",console.warn("Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'")),this.key&&-1===Sj.indexOf(this.key.toLowerCase())&&(this.trigger=void 0,console.warn("Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined")),"drag"===this.trigger?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:"click"===this.trigger&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),this.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(t){if(!this.key||this.keydown){var e=t.item;e&&e.getID()!==this.source&&"node"===e.getType()||this.cancelCreating({item:this.edge,x:t.x,y:t.y})}},onClick:function(t){if(!this.key||this.keydown){var e=t.item,r=this.graph,n=e.getModel(),i=this.getEdgeConfig;if(this.addingEdge&&this.edge){if(!this.shouldEnd(t,this))return;var o=void 0;o=i&&(0,Uw.isFunction)(i)?i({source:this.source,target:n.id},this):this.edgeConfig;var a=(0,Gw.__assign)({target:n.id},o);if(this.source===n.id&&(a.type="loop"),r.emit("beforecreateedge",{}),r.updateItem(this.edge,a,!1),r.get("enabledStack")){var s=(0,Gw.__assign)((0,Gw.__assign)({},this.edge.getModel()),{itemType:"edge"}),u={};u.edges=[s],r.pushStack("add",{before:{},after:u})}r.emit("aftercreateedge",{edge:this.edge}),this.edge.getKeyShape().set("capture",!0),this.edge=null,this.addingEdge=!1}else{if(!this.shouldBegin(t,this))return;o=void 0;o=i&&(0,Uw.isFunction)(i)?i({source:n.id,target:n.id},this):this.edgeConfig,this.edge=r.addItem("edge",(0,Gw.__assign)({source:n.id,target:n.id},o),!1),this.source=n.id,this.addingEdge=!0,this.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){if(!this.key||this.keydown){this.edge&&this.edge.destroyed&&this.cancelCreating({item:this.edge});var e={x:t.x,y:t.y};this.graph.findById(this.source)?this.addingEdge&&this.edge&&this.graph.updateItem(this.edge,{target:e},!1):this.addingEdge=!1}},cancelCreating:function(t){var e,r;if(!this.key||this.keydown){var n=this.graph,i=t.item;return this.addingEdge&&(this.edge===i||(null===(r=null===(e=t.target)||void 0===e?void 0:e.isCanvas)||void 0===r?void 0:r.call(e)))?(this.edge&&!this.edge.destroyed&&n.removeItem(this.edge,!1),this.edge=null,void(this.addingEdge=!1)):void 0}},onKeyDown:function(t){var e=t.key;e&&(e.toLowerCase()===this.key.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.addingEdge&&this.edge&&(this.graph.removeItem(this.edge,!1),this.addingEdge=!1,this.edge=null),this.keydown=!1}},"shortcuts-call":{getDefaultCfg:function(){return{trigger:"ctrl",combinedKey:"1",functionName:"fitView",functionParams:[]}},getEvents:function(){return Ej.indexOf(this.trigger.toLowerCase())>-1||(this.trigger="ctrl",console.warn("Behavior shortcuts-fit-view 的 trigger 参数 '".concat(this.trigger,"' 不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.triggerKeydown||(this.triggerKeydown=n===r||"control"===n&&"ctrl"===r||"ctrl"===n&&"control"===r);var i=this.graph;if(!i[this.functionName])return console.warn("Behavior shortcuts-fit-view 的 functionName 参数 '".concat(this.functionName,"' 不合法,它不是 Graph 的一个函数名")),{};if(!this.triggerKeydown||this.combinedKey){var o=this.combinedKey.toLowerCase();this.triggerKeydown&&(n===o||"control"===n&&"ctrl"===o||"ctrl"===n&&"control"===o)&&(this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]())}else this.functionParams&&this.functionParams.length?i[this.functionName].apply(i,this.functionParams):i[this.functionName]()}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}},"scroll-canvas":{getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return this.zoomKey&&-1!==kj.indexOf(this.zoomKey)||(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(this.allowDrag(t)){var r=this.graph,n=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];if(n.includes("control")&&n.push("ctrl"),n.some(function(e){return t["".concat(e,"Key")]})){var i=r.get("canvas").getPointByClient(t.clientX,t.clientY),o=r.getZoom();t.wheelDelta>0?o+=.05*o:o-=.05*o,r.zoomTo(o,{x:i.x,y:i.y})}else{var a=t.deltaX||t.movementX,s=t.deltaY||t.movementY;!s&&navigator.userAgent.indexOf("Firefox")>-1&&(s=125*-t.wheelDelta/3);var u=this.graph.get("width"),l=this.graph.get("height"),c=this.graph.get("canvas").getCanvasBBox(),f=this.scalableRange,h=this.scalableRange;f<1&&f>-1&&(f*=u,h*=l);var p=c.minX,d=c.maxX,y=c.minY,v=c.maxY;a>0?d<-f?a=0:d-a<-f&&(a=d+f):a<0&&(p>u+f?a=0:p-a>u+f&&(a=p-(u+f))),s>0?v<-h?s=0:v-s<-h&&(s=v+h):s<0&&(y>l+h?s=0:y-s>l+h&&(s=y-(l+h))),"x"===this.get("direction")?s=0:"y"===this.get("direction")&&(a=0),r.translate(-a,-s)}if(t.preventDefault(),this.get("enableOptimize")){var g=this.get("optimizeZoom"),m=this.get("optimized"),b=r.getNodes(),x=r.getEdges(),w=b.length,_=x.length;if(!m){for(var S=0;St.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:this.hoverColor;return{stroke:t,shadowColor:t,shadowBlur:5,endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:t}}}},{key:"_getDefaultNodeHighlightStyle",value:function(){return{lineWidth:3,stroke:arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.hoverColor}}},{key:"_getContextMenu",value:function(){var t=this;return new Nj.Menu({shouldBegin:function(t){return!!(t.target&&t.target.isCanvas&&t.target.isCanvas())||!!t.item},getContent:function(e){var r=e.item;if(!(e.target&&e.target.isCanvas&&e.target.isCanvas())&&r){var n=r.getType(),i=r.getModel();return n&&i&&"node"===n?t.isCollpased(i.id)?"
      \n
    • 展开
    • \n
    ":"
      \n
    • 折叠
    • \n
    ":void 0}},handleMenuClick:function(e,r){switch(e.id.split("-")[0]){case"hide":t.hideItem(r);break;case"expand":t.expandNode(r);break;case"collapse":t.collapseNode(r);break;case"show":t.showItem(r)}},offsetX:26,offsetY:0,itemTypes:["node","edge","canvas"]})}},{key:"_getGraphConfig",value:function(t){var e=this,r={speed:150,maxIteration:30,tick:Dj()(this.refreshPositions.bind(this),150)},n={type:"fruchterman",gravity:5},i={},o={type:"line",style:{endArrow:{path:"M 0,0 L 4,2 L 4,-2 Z",fill:"#e0e0e0"},lineWidth:.5},labelCfg:{autoRotate:!0,style:{fontSize:4,fill:"#333"}}},a={default:["drag-canvas","zoom-canvas","drag-node"]},s=this._getContextMenu(),u=[new Nj.ToolBar,s];if(!t)return this._setToolBarStyle(),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"knowledgeGraph",s=document.querySelector("#".concat(t));return{container:t,width:s.scrollWidth,height:s.scrollHeight,plugins:u,modes:a,layout:Uj(Uj({},n),r),defaultNode:i,defaultEdge:o,nodeStateStyles:{hover:e._getDefaultNodeHighlightStyle(),actived:e._getDefaultNodeHighlightStyle()},edgeStateStyles:{hover:e._getDefaultEdgeHighlightStyle(),actived:e._getDefaultEdgeHighlightStyle()}}}();t.container=t.container||"knowledgeGraph";var l="string"==typeof t.container?document.querySelector("#".concat(t.container)):t.container;t.width=t.width||l.scrollWidth,t.height=t.height||l.scrollHeight,t.layout=Uj(Uj(Uj({},n),t.layout||{}),!1!==t.animate?r:{}),t.defaultNode=Uj(Uj({},i),t.defaultNode||{}),t.defaultEdge=Uj(Uj({},o),t.defaultEdge||{}),t.modes={default:[]},!1!==t.dragCanvas&&t.modes.default.push("drag-canvas"),!1!==t.zoomCanvas&&t.modes.default.push("zoom-canvas"),!1!==t.dragNode&&t.modes.default.push("drag-node");var c=Uj(Uj({},this._getDefaultNodeHighlightStyle()),t.nodeHighlightStyle||{}),f=Uj(Uj({},this._getDefaultEdgeHighlightStyle()),t.edgeHighlightStyle||{});return t.nodeStateStyles={hover:c,actived:c},t.edgeStateStyles={hover:f,actived:f},!1!==t.showToolBar&&(t.plugins=[new Nj.ToolBar],this._setToolBarStyle()),!1!==t.showContextMenu&&(t.plugins=[].concat(Fj(t.plugins||[]),[s]),this._setToolBarStyle()),t}},{key:"changeSize",value:function(t,e){return this.graph.changeSize(t,e)}},{key:"autoResize",value:function(){var t=this,e=this.getContainer();window.addEventListener("resize",function(){var r=e.scrollWidth,n=e.scrollHeight;t.graph.changeSize(r,n),t.graph.refresh()})}},{key:"zoom",value:function(t,e,r,n){this.graph.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graph.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graph.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graph.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graph.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graph.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graph.getZoom()}},{key:"getMinZoom",value:function(){return this.graph.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graph.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graph.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graph.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graph.getWidth()}},{key:"getHeight",value:function(){return this.graph.getHeight()}},{key:"setCenter",value:function(t){var e=this.graph.getWidth()/2,r=this.graph.getHeight()/2,n=this.graph.getCanvasByPoint(t.x,t.y);this.graph.translate(e-n.x,r-n.y)}},{key:"_setToolBarStyle",value:function(){uP()("\n .g6-component-toolbar li[code='redo'],\n .g6-component-toolbar li[code='undo'],\n .g6-component-toolbar li[code='realZoom'] {\n display: none;\n }\n .g6-component-contextmenu {\n position: absolute;\n z-index: 2;\n list-style-type: none;\n border-radius: 6px;\n font-size: 14px;\n width: fit-content;\n transition: opacity .2s;\n text-align: center;\n box-shadow: 0 5px 18px 0 rgba(0, 0, 0, 0.6);\n border: 0px;\n }\n .g6-component-contextmenu ul {\n padding-left: 0px;\n margin: 0;\n }\n .g6-component-contextmenu li {\n cursor: pointer;\n list-style-type: none;\n list-style: none;\n margin-left: 0;\n line-height: 38px;\n padding: 0px 35px;\n }\n .g6-component-contextmenu li:hover {\n color: #333;\n background: #aaaaaa45;\n }\n ")}},{key:"highlightNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("node:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("node:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"highlightEdge",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph,e=null;t.on("edge:mouseenter",function(r){var n=r.item;t.setAutoPaint(!1),e&&t.clearItemStates(e,"hover"),t.setItemState(n,"hover",!0),e=n,t.paint(),t.setAutoPaint(!0)}),t.on("edge:mouseleave",function(){t.setAutoPaint(!1),e&&(t.clearItemStates(e,"hover"),e=null),t.paint(),t.setAutoPaint(!0)})}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data?e.changeData(t):e.data(t),this.data=t}},{key:"render",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).render()}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;this.data=t,e.changeData(t)}},{key:"refresh",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refresh()}},{key:"getContainer",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getContainer()}},{key:"getCanvas",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).get("canvas")}},{key:"getNodes",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getNodes()}},{key:"getEdges",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).getEdges()}},{key:"getNeighbors",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).getNeighbors(t,e)}},{key:"findById",value:function(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).findById(t)}},{key:"find",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).find(t,e)}},{key:"findAll",value:function(t,e){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return t.getEdges()}},{key:"getInEdges",value:function(t){return t.getInEdges()}},{key:"getOutEdges",value:function(t){return t.getOutEdges()}},{key:"getSourceByEdge",value:function(t){return t.getSource()}},{key:"getTargetByEdge",value:function(t){return t.getTarget()}},{key:"expandNode",value:function(t){var e=t.getModel().id;this._expandCollapseNode(this.collpasedData[e],"show"),delete this.collpasedData[e]}},{key:"collapseNode",value:function(t){var e=t.getModel().id,r=[];this._collapseFunc(t,r),this.collpasedData[e]=r,this._expandCollapseNode(r)}},{key:"isCollpased",value:function(t){return!!this.collpasedData[t]}},{key:"_collapseFunc",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this.getNeighbors(t,"target"),n=this.getNeighbors(t,"source"),i=0;i1&&void 0!==arguments[1]?arguments[1]:"hide";t&&t.forEach(function(t){"hide"===r?e.hideItem(t.id):(e.showItem(t.id),e.isCollpased(t.id)&&delete e.collpasedData[t.id]),t.children&&e._expandCollapseNode(t.children,r)})}},{key:"showItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).showItem(t,e)}},{key:"hideItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).hideItem(t,e)}},{key:"show",value:function(t){t.show()}},{key:"hide",value:function(t){t.hide()}},{key:"changeVisibility",value:function(t,e){t.changeVisibility(e)}},{key:"isVisible",value:function(t){return t.isVisible()}},{key:"getModel",value:function(t){return t.getModel()}},{key:"addItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).addItem(t,e)}},{key:"removeItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).removeItem(t)}},{key:"updateItem",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).updateItem(t,e)}},{key:"refreshItem",value:function(t){(arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph).refreshItem(t)}},{key:"refreshPositions",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).refreshPositions()}},{key:"on",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).on(t,e)}},{key:"off",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).off(t,e)}},{key:"toDataURL",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.graph).toDataURL(t,e)}},{key:"bindNodeDefaultDragEvent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("node:dragstart",function(t){Yj(t)}),t.on("node:drag",function(t){Yj(t)}),t.on("node:dragend",function(t){t.item.get("model").fx=null,t.item.get("model").fy=null})}},{key:"stopDefaultEventPropagation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t.on("click",function(t){t.stopPropagation()}),t.on("mousedown",function(t){t.stopPropagation()}),t.on("mouseover",function(t){t.stopPropagation()}),t.on("mouseout",function(t){t.stopPropagation()})}},{key:"clear",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).clear()}},{key:"destroy",value:function(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph).destroy()}}])&&Hj(t.prototype,e),r&&Hj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Yj(t){var e=t.item.get("model");return e.fx=t.x,e.fy=t.y,e.x=t.x,e.y=t.y,e}var Xj=r(5611),Zj=r.n(Xj);function Kj(t){"@babel/helpers - typeof";return(Kj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jj(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"G6";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.graph=null,this.config=Zj()(e),this.graphRender=null,this.type=r,this.createGraphRender(this.type),this.config=this.graphRender._getGraphConfig(this.config),this.createGraph(this.config),this.CLASS_NAME="SuperMap.KnowledgeGraph"},r=[{key:"dataFromGraphMap",value:function(t,e){return jw(t,e)}},{key:"dataFromKnowledgeGraphQuery",value:function(t){return jw(t)}}],(e=[{key:"_handleNodes",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.findById(t);e(n,"node")})}},{key:"_handleEdges",value:function(t,e){var r=this;t.filter(function(t){return""!==t}).forEach(function(t){var n=r.find("edge",function(e){return e.get("model").edgeId==t});e(n,"edge")})}},{key:"highlight",value:function(t){var e=t.nodeIDs,r=void 0===e?[]:e,n=t.edgeIDs,i=void 0===n?[]:n,o=this.graph,a=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"node";if(e){var n=t[r+"StateStyles"];n&&o.updateItem(e,{style:e.style,stateStyles:{actived:n}}),o.setItemState(e,"actived",!0),o.paint(),o.setAutoPaint(!0)}};this._handleNodes(r,a),this._handleEdges(i,a)}},{key:"clearHighlight",value:function(t){var e=this.graph,r=function(t){t&&(e.clearItemStates(t,"actived"),e.paint(),e.setAutoPaint(!0))};if(e.setAutoPaint(!1),!t)return e.getNodes().forEach(function(t){r(t)}),void e.getEdges().forEach(function(t){r(t)});var n=t.nodeIDs,i=void 0===n?[]:n,o=t.edgeIDs,a=void 0===o?[]:o;this._handleNodes(i,r),this._handleEdges(a,r)}},{key:"handleNodeStatus",value:function(t){var e=t.expand,r=t.collapse,n=t.hidden;this.expandNodes(e),this.collapseNodes(r),this.hideNodes(n)}},{key:"expandNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.expandNode(t+"")})}},{key:"collapseNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.collapseNode(t+"")})}},{key:"hideNodes",value:function(t){var e=this;t&&t.forEach(function(t){e.hideItem(t+"")})}},{key:"createGraphRender",value:function(t){"G6"===t&&(this.graphRender=new qj)}},{key:"createGraph",value:function(t){var e=this.initGraph(t);return this.graph=e,this.autoResize(),e}},{key:"getGraph",value:function(){return this.graph}},{key:"autoResize",value:function(){this.config&&!1!==this.config.autoResize&&this.graphRender.autoResize()}},{key:"zoom",value:function(t,e,r,n){this.graphRender.zoom(t,e,r,n)}},{key:"zoomTo",value:function(t,e,r,n){this.graphRender.zoomTo(t,e,r,n)}},{key:"fitView",value:function(t,e,r,n){this.graphRender.fitView(t,e,r,n)}},{key:"fitCenter",value:function(t,e){this.graphRender.fitCenter(t,e)}},{key:"getGraphCenterPoint",value:function(){return this.graphRender.getGraphCenterPoint()}},{key:"getViewPortCenterPoint",value:function(){return this.graphRender.getViewPortCenterPoint()}},{key:"getZoom",value:function(){return this.graphRender.getZoom()}},{key:"getMinZoom",value:function(){return this.graphRender.getMinZoom()}},{key:"setMinZoom",value:function(t){this.graphRender.setMinZoom(t)}},{key:"getMaxZoom",value:function(){return this.graphRender.getMaxZoom()}},{key:"setMaxZoom",value:function(t){this.graphRender.setMaxZoom(t)}},{key:"getWidth",value:function(){return this.graphRender.getWidth()}},{key:"getHeight",value:function(){return this.graphRender.getHeight()}},{key:"initGraph",value:function(t){var e=this,r=this.graphRender.initGraph(t);this.graph=r;return this.graph.on("afterlayout",function(){void 0!==e.config.zoom&&e.zoom(e.config.zoom),void 0!==e.config.center&&e.graphRender.setCenter({x:e.config.center[0],y:e.config.center[1]})}),r}},{key:"setData",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;t=t||{nodes:[],edges:[]},this.config&&this.config.nodeLabelMaxWidth&&(t.nodes=this.nodeLabelOpenEllipsis(this.config.nodeLabelMaxWidth,t.nodes)),this.graphRender.setData(t,e),this.render(e),this.data=t}},{key:"render",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&this.graphRender.render(t)}},{key:"updateGraph",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.graph;e&&this.graphRender.updateGraph(t,e)}},{key:"refresh",value:function(){return this.graphRender.refresh()}},{key:"changeSize",value:function(t,e){return this.graphRender.changeSize(t,e)}},{key:"resize",value:function(t,e){this.graphRender.changeSize(t,e),this.graphRender.refresh()}},{key:"getContainer",value:function(){return this.graphRender.getContainer()}},{key:"getCanvas",value:function(){return this.graphRender.getCanvas()}},{key:"getNodes",value:function(){return this.graphRender.getNodes()}},{key:"getEdges",value:function(){return this.graphRender.getEdges()}},{key:"getNeighbors",value:function(t,e){return this.graphRender.getNeighbors(t,e)}},{key:"findById",value:function(t){return this.graphRender.findById(t)}},{key:"find",value:function(t,e){return this.graphRender.find(t,e)}},{key:"findAll",value:function(t,e){return this.graphRender.findAll(t,e)}},{key:"getEdgesByNode",value:function(t){return this.graphRender.getEdgesByNode(t)}},{key:"getInEdges",value:function(t){return this.graphRender.getInEdges(t)}},{key:"getOutEdges",value:function(t){return this.graphRender.getOutEdges(t)}},{key:"getSourceByEdge",value:function(t){return this.graphRender.getSourceByEdge(t)}},{key:"getTargetByEdge",value:function(t){return this.graphRender.getTargetByEdge(t)}},{key:"expandNode",value:function(t){var e=this.findById(t);e&&this.graphRender.expandNode(e)}},{key:"collapseNode",value:function(t){var e=this.findById(t);e&&this.graphRender.collapseNode(e)}},{key:"showItem",value:function(t,e){this.graphRender.showItem(t,e)}},{key:"hideItem",value:function(t,e){this.graphRender.hideItem(t,e)}},{key:"show",value:function(t){this.graphRender.show(t)}},{key:"hide",value:function(t){this.graphRender.hide(t)}},{key:"changeVisibility",value:function(t,e){this.graphRender.changeVisibility(t,e)}},{key:"isVisible",value:function(t){return this.graphRender.isVisible(t)}},{key:"getModel",value:function(t){return this.graphRender.getModel(t)}},{key:"addItem",value:function(t,e){return this.graphRender.addItem(t,e)}},{key:"removeItem",value:function(t){return this.graphRender.removeItem(t)}},{key:"updateItem",value:function(t,e){return this.graphRender.updateItem(t,e)}},{key:"refreshItem",value:function(t){return this.graphRender.refreshItem(t)}},{key:"refreshPositions",value:function(){return this.graphRender.refreshPositions()}},{key:"on",value:function(t,e){this.graphRender.on(t,e)}},{key:"off",value:function(t,e){this.graphRender.off(t,e)}},{key:"toDataURL",value:function(t,e){this.graphRender.toDataURL(t,e)}},{key:"nodeLabelOpenEllipsis",value:function(t,e){var r=this;return e?t?e.map(function(e){var n=e.labelCfg&&e.labelCfg.fontSize||r.defaultNode&&r.defaultNode.labelCfg&&r.defaultNode.labelCfg.fontSize||14;return e.label=function(t,e,r){var n=1*r;e*=1.6;if(function(t){for(var e=0,r=0;r0&&t.charCodeAt(r)<128?e++:e+=2;return e}(t)*n>e){var i=Math.floor((e-20)/n),o=t.substring(0,i);return(t.substring(i).length+"…".length)*n>e?o+"\n"+t.substring(i,i+i-2)+"…":0==t.substring(i).length?o:o+"\n"+t.substring(i)}return t}(e.label,t,n),e}):e:[]}},{key:"clear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.clear()}},{key:"destroy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.graph;t&&t.destroy()}}])&&Jj(t.prototype,e),r&&Jj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function tN(t){"@babel/helpers - typeof";return(tN="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eN(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function rN(t,e,r){return(e=aN(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function nN(){nN=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==tN(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function iN(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function oN(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);rh.length?i:h}if(!i.length){var p=[[0,0],[this.map.transform.width-1,this.map.transform.height-1]];this.queryRenderedFeatures(p,{layerCapture:!1},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];i=t})}return i}},{key:"setSelectedDatas",value:function(t){this.selectedDatas=t instanceof Array?t:[t]}},{key:"_formatListenType",value:function(t){switch(t){case"mouseover":return"mouseenter";case"mouseleave":return"mouseout";default:return t}}},{key:"_transformFilterValues",value:function(t){for(var e=t.fields,r=t.values,n=t.selectedDatas,i=arguments.length,o=new Array(i>1?i-1:0),a=1;at[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=0},t.prototype.getAdjustRange=function(t,e,r){var n,i,o=this.yField,a=r.indexOf(e),s=r.length;return!o&&this.isAdjust("y")?(n=0,i=1):s>1?(n=r[0===a?0:a-1],i=r[a===s-1?s-1:a+1],0!==a?n+=(e-n)/2:n-=(i-e)/2,a!==s-1?i-=(i-e)/2:i+=(e-r[s-2])/2):(n=0===e?0:e-.5,i=0===e?1:e+.5),{pre:n,next:i}},t.prototype.adjustData=function(t,e){var r=this,n=this.getDimValues(e);Uw.each(t,function(t,e){Uw.each(n,function(n,i){r.adjustDim(i,n,t,e)})})},t.prototype.groupData=function(t,e){return Uw.each(t,function(t){void 0===t[e]&&(t[e]=0)}),Uw.groupBy(t,e)},t.prototype.adjustDim=function(t,e,r,n){},t.prototype.getDimValues=function(t){var e=this.xField,r=this.yField,n=Uw.assign({},this.dimValuesMap),i=[];if(e&&this.isAdjust("x")&&i.push(e),r&&this.isAdjust("y")&&i.push(r),i.forEach(function(e){n&&n[e]||(n[e]=Uw.valuesOfKey(t,e).sort(function(t,e){return t-e}))}),!r&&this.isAdjust("y")){n.y=[0,1]}return n},t}(),tR={},eR=function(t){return tR[t.toLowerCase()]},rR=function(t,e){if(eR(t))throw new Error("Adjust type '"+t+"' existed.");tR[t.toLowerCase()]=e};var nR=function(t,e){return(nR=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function iR(t,e){function r(){this.constructor=t}nR(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var oR=function(){return(oR=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=0)n=u+this.getIntervalOnlyOffset(r,e);else if(!Uw.isNil(s)&&Uw.isNil(a)&&s>=0){n=u+this.getDodgeOnlyOffset(r,e)}else if(!Uw.isNil(a)&&!Uw.isNil(s)&&a>=0&&s>=0){n=u+this.getIntervalAndDodgeOffset(r,e)}else{var f=c*i/r,h=o*f;n=(u+l)/2+(.5*(c-r*f-(r-1)*h)+((e+1)*f+e*h)-.5*f-.5*c)}return n},e.prototype.getIntervalOnlyOffset=function(t,e){var r=this,n=r.defaultSize,i=r.intervalPadding,o=r.xDimensionLegenth,a=r.groupNum,s=r.dodgeRatio,u=r.maxColumnWidth,l=r.minColumnWidth,c=r.columnWidthRatio,f=i/o,h=(1-(a-1)*f)/a*s/(t-1),p=((1-f*(a-1))/a-h*(t-1))/t;if(p=Uw.isNil(c)?p:1/a/t*c,!Uw.isNil(u)){var d=u/o;p=Math.min(p,d)}if(!Uw.isNil(l)){var y=l/o;p=Math.max(p,y)}return((.5+e)*(p=n?n/o:p)+e*(h=((1-(a-1)*f)/a-t*p)/(t-1))+.5*f)*a-f/2},e.prototype.getDodgeOnlyOffset=function(t,e){var r=this,n=r.defaultSize,i=r.dodgePadding,o=r.xDimensionLegenth,a=r.groupNum,s=r.marginRatio,u=r.maxColumnWidth,l=r.minColumnWidth,c=r.columnWidthRatio,f=i/o,h=1*s/(a-1),p=((1-h*(a-1))/a-f*(t-1))/t;if(p=c?1/a/t*c:p,!Uw.isNil(u)){var d=u/o;p=Math.min(p,d)}if(!Uw.isNil(l)){var y=l/o;p=Math.max(p,y)}return((.5+e)*(p=n?n/o:p)+e*f+.5*(h=(1-(p*t+f*(t-1))*a)/(a-1)))*a-h/2},e.prototype.getIntervalAndDodgeOffset=function(t,e){var r=this.intervalPadding,n=this.dodgePadding,i=this.xDimensionLegenth,o=this.groupNum,a=r/i,s=n/i;return((.5+e)*(((1-a*(o-1))/o-s*(t-1))/t)+e*s+.5*a)*o-a/2},e.prototype.getDistribution=function(t){var e=this.adjustDataArray,r=this.cacheMap,n=r[t];return n||(n={},Uw.each(e,function(e,r){var i=Uw.valuesOfKey(e,t);i.length||i.push(0),Uw.each(i,function(t){n[t]||(n[t]=[]),n[t].push(r)})}),r[t]=n),n},e}($N);var sR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iR(e,t),e.prototype.process=function(t){var e=Uw.clone(t),r=Uw.flatten(e);return this.adjustData(e,r),e},e.prototype.adjustDim=function(t,e,r){var n=this,i=this.groupData(r,t);return Uw.each(i,function(r,i){return n.adjustGroup(r,t,parseFloat(i),e)})},e.prototype.getAdjustOffset=function(t){var e,r=t.pre,n=t.next,i=.05*(n-r);return(n-i-(e=r+i))*Math.random()+e},e.prototype.adjustGroup=function(t,e,r,n){var i=this,o=this.getAdjustRange(e,r,n);return Uw.each(t,function(t){t[e]=i.getAdjustOffset(o)}),t},e}($N),uR=Uw.Cache,lR=function(t){function e(e){var r=t.call(this,e)||this,n=e.adjustNames,i=void 0===n?["y"]:n,o=e.height,a=void 0===o?NaN:o,s=e.size,u=void 0===s?10:s,l=e.reverseOrder,c=void 0!==l&&l;return r.adjustNames=i,r.height=a,r.size=u,r.reverseOrder=c,r}return iR(e,t),e.prototype.process=function(t){var e=this.yField,r=this.reverseOrder,n=e?this.processStack(t):this.processOneDimStack(t);return r?this.reverse(n):n},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var e=this.xField,r=this.yField,n=this.reverseOrder?this.reverse(t):t,i=new uR,o=new uR;return n.map(function(t){return t.map(function(t){var n,a=Uw.get(t,e,0),s=Uw.get(t,[r]),u=a.toString();if(s=Uw.isArray(s)?s[1]:s,!Uw.isNil(s)){var l=s>=0?i:o;l.has(u)||l.set(u,0);var c=l.get(u),f=s+c;return l.set(u,f),oR(oR({},t),((n={})[r]=[c,f],n))}return t})})},e.prototype.processOneDimStack=function(t){var e=this,r=this.xField,n=this.height,i=this.reverseOrder?this.reverse(t):t,o=new uR;return i.map(function(t){return t.map(function(t){var i,a=e.size,s=t[r],u=2*a/n;o.has(s)||o.set(s,u/2);var l=o.get(s);return o.set(s,l+u),oR(oR({},t),((i={}).y=l,i))})})},e}($N),cR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return iR(e,t),e.prototype.process=function(t){var e=Uw.flatten(t),r=this.xField,n=this.yField,i=this.getXValuesMaxMap(e),o=Math.max.apply(Math,Object.keys(i).map(function(t){return i[t]}));return Uw.map(t,function(t){return Uw.map(t,function(t){var e,a,s=t[n],u=t[r];if(Uw.isArray(s)){var l=(o-i[u])/2;return oR(oR({},t),((e={})[n]=Uw.map(s,function(t){return l+t}),e))}var c=(o-s)/2;return oR(oR({},t),((a={})[n]=[c,s+c],a))})})},e.prototype.getXValuesMaxMap=function(t){var e=this,r=this.xField,n=this.yField,i=Uw.groupBy(t,function(t){return t[r]});return Uw.mapValues(i,function(t){return e.getDimMaxValue(t,n)})},e.prototype.getDimMaxValue=function(t,e){var r=Uw.map(t,function(t){return Uw.get(t,e,[])}),n=Uw.flatten(r);return Math.max.apply(Math,n)},e}($N);rR("Dodge",aR),rR("Jitter",sR),rR("Stack",lR),rR("Symmetric",cR);var fR=function(t,e){return(0,Uw.isString)(e)?e:t.invert(t.scale(e))},hR=function(){function t(t){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(t)}return t.prototype.mapping=function(){for(var t=this,e=[],r=0;r1?1:Number(e),n=t.length-1,i=Math.floor(n*r),o=n*r-i,a=t[i],s=i===n?a:t[i+1];return mR([gR(a,s,o,0),gR(a,s,o,1),gR(a,s,o,2)])}(r,t)}},toRGB:(0,Uw.memoize)(_R),toCSSGradient:function(t){if(/^[r,R,L,l]{1}[\s]*\(/.test(t)){var e,r=void 0;if("l"===t[0]){var n=+(i=dR.exec(t))[1]+90;r=i[2],e="linear-gradient("+n+"deg, "}else if("r"===t[0]){var i;e="radial-gradient(",r=(i=yR.exec(t))[4]}var o=r.match(vR);return(0,Uw.each)(o,function(t,r){var n=t.split(":");e+=n[1]+" "+100*n[0]+"%",r!==o.length-1&&(e+=", ")}),e+=")"}return t}},ER=function(t){function e(e){var r=t.call(this,e)||this;return r.type="color",r.names=["color"],(0,Uw.isString)(r.values)&&(r.linear=!0),r.gradient=SR.gradient(r.values),r}return(0,Gw.__extends)(e,t),e.prototype.getLinearValue=function(t){return this.gradient(t)},e}(hR),kR=function(t){function e(e){var r=t.call(this,e)||this;return r.type="opacity",r.names=["opacity"],r}return(0,Gw.__extends)(e,t),e}(hR),TR=function(t){function e(e){var r=t.call(this,e)||this;return r.names=["x","y"],r.type="position",r}return(0,Gw.__extends)(e,t),e.prototype.mapping=function(t,e){var r=this.scales,n=r[0],i=r[1];return(0,Uw.isNil)(t)||(0,Uw.isNil)(e)?[]:[(0,Uw.isArray)(t)?t.map(function(t){return n.scale(t)}):n.scale(t),(0,Uw.isArray)(e)?e.map(function(t){return i.scale(t)}):i.scale(e)]},e}(hR),CR=function(t){function e(e){var r=t.call(this,e)||this;return r.type="shape",r.names=["shape"],r}return(0,Gw.__extends)(e,t),e.prototype.getLinearValue=function(t){var e=Math.round((this.values.length-1)*t);return this.values[e]},e}(hR),OR=function(t){function e(e){var r=t.call(this,e)||this;return r.type="size",r.names=["size"],r}return(0,Gw.__extends)(e,t),e}(hR),AR={},PR=function(t){return AR[t.toLowerCase()]},MR=function(t,e){if(PR(t))throw new Error("Attribute type '".concat(t,"' existed."));AR[t.toLowerCase()]=e};MR("Color",ER),MR("Opacity",kR),MR("Position",TR),MR("Shape",CR),MR("Size",OR);var IR=function(){function t(t){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var e=t.start,r=t.end,n=t.matrix,i=void 0===n?[1,0,0,0,1,0,0,0,1]:n,o=t.isTransposed,a=void 0!==o&&o;this.start=e,this.end=r,this.matrix=i,this.originalMatrix=(0,Gw.__spreadArray)([],i),this.isTransposed=a}return t.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},t.prototype.update=function(t){(0,Uw.assign)(this,t),this.initial()},t.prototype.convertDim=function(t,e){var r,n=this[e],i=n.start,o=n.end;return this.isReflect(e)&&(i=(r=[o,i])[0],o=r[1]),i+t*(o-i)},t.prototype.invertDim=function(t,e){var r,n=this[e],i=n.start,o=n.end;return this.isReflect(e)&&(i=(r=[o,i])[0],o=r[1]),(t-i)/(o-i)},t.prototype.applyMatrix=function(t,e,r){void 0===r&&(r=0);var n=this.matrix,i=[t,e,r];return dS.transformMat3(i,i,n),i},t.prototype.invertMatrix=function(t,e,r){void 0===r&&(r=0);var n=this.matrix,i=yS.invert([0,0,0,0,0,0,0,0,0],n),o=[t,e,r];return i&&dS.transformMat3(o,o,i),o},t.prototype.convert=function(t){var e=this.convertPoint(t),r=e.x,n=e.y,i=this.applyMatrix(r,n,1);return{x:i[0],y:i[1]}},t.prototype.invert=function(t){var e=this.invertMatrix(t.x,t.y,1);return this.invertPoint({x:e[0],y:e[1]})},t.prototype.rotate=function(t){var e=this.matrix,r=this.center;return Yw.IW(e,e,[-r.x,-r.y]),Yw.XA(e,e,t),Yw.IW(e,e,[r.x,r.y]),this},t.prototype.reflect=function(t){return"x"===t?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},t.prototype.scale=function(t,e){var r=this.matrix,n=this.center;return Yw.IW(r,r,[-n.x,-n.y]),Yw.g(r,r,[t,e]),Yw.IW(r,r,[n.x,n.y]),this},t.prototype.translate=function(t,e){var r=this.matrix;return Yw.IW(r,r,[t,e]),this},t.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},t.prototype.getCenter=function(){return this.center},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRadius=function(){return this.radius},t.prototype.isReflect=function(t){return"x"===t?this.isReflectX:this.isReflectY},t.prototype.resetMatrix=function(t){this.matrix=t||(0,Gw.__spreadArray)([],this.originalMatrix)},t}(),LR=function(t){function e(e){var r=t.call(this,e)||this;return r.isRect=!0,r.type="cartesian",r.initial(),r}return(0,Gw.__extends)(e,t),e.prototype.initial=function(){t.prototype.initial.call(this);var e=this.start,r=this.end;this.x={start:e.x,end:r.x},this.y={start:e.y,end:r.y}},e.prototype.convertPoint=function(t){var e,r=t.x,n=t.y;return this.isTransposed&&(r=(e=[n,r])[0],n=e[1]),{x:this.convertDim(r,"x"),y:this.convertDim(n,"y")}},e.prototype.invertPoint=function(t){var e,r=this.invertDim(t.x,"x"),n=this.invertDim(t.y,"y");return this.isTransposed&&(r=(e=[n,r])[0],n=e[1]),{x:r,y:n}},e}(IR),jR=function(t){function e(e){var r=t.call(this,e)||this;r.isHelix=!0,r.type="helix";var n=e.startAngle,i=void 0===n?1.25*Math.PI:n,o=e.endAngle,a=void 0===o?7.25*Math.PI:o,s=e.innerRadius,u=void 0===s?0:s,l=e.radius;return r.startAngle=i,r.endAngle=a,r.innerRadius=u,r.radius=l,r.initial(),r}return(0,Gw.__extends)(e,t),e.prototype.initial=function(){t.prototype.initial.call(this);var e=(this.endAngle-this.startAngle)/(2*Math.PI)+1,r=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(r*=this.radius),this.d=Math.floor(r*(1-this.innerRadius)/e),this.a=this.d/(2*Math.PI),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*r,end:this.innerRadius*r+.99*this.d}},e.prototype.convertPoint=function(t){var e,r=t.x,n=t.y;this.isTransposed&&(r=(e=[n,r])[0],n=e[1]);var i=this.convertDim(r,"x"),o=this.a*i,a=this.convertDim(n,"y");return{x:this.center.x+Math.cos(i)*(o+a),y:this.center.y+Math.sin(i)*(o+a)}},e.prototype.invertPoint=function(t){var e,r=this.d+this.y.start,n=vS.subtract([0,0],[t.x,t.y],[this.center.x,this.center.y]),i=Yw.LL(n,[1,0],!0),o=i*this.a;vS.length(n)this.width/n?(e=this.width/n,this.circleCenter={x:this.center.x-(.5-o)*this.width,y:this.center.y-(.5-a)*e*i}):(e=this.height/i,this.circleCenter={x:this.center.x-(.5-o)*e*n,y:this.center.y-(.5-a)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=e*this.radius:(this.radius<=0||this.radius>e)&&(this.polarRadius=e):this.polarRadius=e,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},e.prototype.getRadius=function(){return this.polarRadius},e.prototype.convertPoint=function(t){var e,r=this.getCenter(),n=t.x,i=t.y;return this.isTransposed&&(n=(e=[i,n])[0],i=e[1]),n=this.convertDim(n,"x"),i=this.convertDim(i,"y"),{x:r.x+Math.cos(n)*i,y:r.y+Math.sin(n)*i}},e.prototype.invertPoint=function(t){var e,r=this.getCenter(),n=[t.x-r.x,t.y-r.y],i=this.startAngle,o=this.endAngle;this.isReflect("x")&&(i=(e=[o,i])[0],o=e[1]);var a=[1,0,0,0,1,0,0,0,1];Yw.XA(a,a,i);var s=[1,0,0];dS.transformMat3(s,s,a);var u=[s[0],s[1]],l=Yw.LL(u,n,o0?f:-f;var h=this.invertDim(c,"y"),p={x:0,y:0};return p.x=this.isTransposed?h:f,p.y=this.isTransposed?f:h,p},e.prototype.getCenter=function(){return this.circleCenter},e.prototype.getOneBox=function(){var t=this.startAngle,e=this.endAngle;if(Math.abs(e-t)>=2*Math.PI)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var r=[0,Math.cos(t),Math.cos(e)],n=[0,Math.sin(t),Math.sin(e)],i=Math.min(t,e);i=0;r--)t.removeChild(e[r])}function YR(t){var e=t.start,r=t.end,n=Math.min(e.x,r.x),i=Math.min(e.y,r.y),o=Math.max(e.x,r.x),a=Math.max(e.y,r.y);return{x:n,y:i,minX:n,minY:i,maxX:o,maxY:a,width:o-n,height:a-i}}function XR(t,e,r,n){var i=t+r,o=e+n;return{x:t,y:e,width:r,height:n,minX:t,minY:e,maxX:isNaN(i)?0:i,maxY:isNaN(o)?0:o}}function ZR(t,e,r){return(1-r)*t+e*r}function KR(t,e,r){return{x:t.x+Math.cos(r)*e,y:t.y+Math.sin(r)*e}}var JR=function(t,e,r){return void 0===r&&(r=Math.pow(Number.EPSILON,.5)),[t,e].includes(1/0)?Math.abs(t)===Math.abs(e):Math.abs(t-e)0?(0,Uw.each)(h,function(t){if(t.get("visible")){if(t.isGroup()&&0===t.get("children").length)return!0;var e=QR(t),r=t.applyToMatrix([e.minX,e.minY,1]),n=t.applyToMatrix([e.minX,e.maxY,1]),i=t.applyToMatrix([e.maxX,e.minY,1]),o=t.applyToMatrix([e.maxX,e.maxY,1]),a=Math.min(r[0],n[0],i[0],o[0]),s=Math.max(r[0],n[0],i[0],o[0]),h=Math.min(r[1],n[1],i[1],o[1]),p=Math.max(r[1],n[1],i[1],o[1]);al&&(l=s),hf&&(f=p)}}):(u=0,l=0,c=0,f=0),e=XR(u,c,l-u,f-c)}else e=t.getBBox();return s?(r=e,n=s,i=Math.max(r.minX,n.minX),o=Math.max(r.minY,n.minY),XR(i,o,Math.min(r.maxX,n.maxX)-i,Math.min(r.maxY,n.maxY)-o)):e}function $R(t){return t+"px"}function tD(t,e,r,n){var i,o,a,s,u=n/(i=t,a=(o=e).x-i.x,s=o.y-i.y,Math.sqrt(a*a+s*s)),l=0;return"start"===r?l=0-u:"end"===r&&(l=1+u),{x:ZR(t.x,e.x,l),y:ZR(t.y,e.y,l)}}var eD={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},rD=function(t){function e(e){var r=t.call(this,e)||this;return r.initCfg(),r}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},e.prototype.clear=function(){},e.prototype.update=function(t){var e=this,r=this.get("defaultCfg")||{};(0,Uw.each)(t,function(t,n){var i=t;e.get(n)!==t&&((0,Uw.isObject)(t)&&r[n]&&(i=(0,Uw.deepMix)({},r[n],t)),e.set(n,i))}),this.updateInner(t),this.afterUpdate(t)},e.prototype.updateInner=function(t){},e.prototype.afterUpdate=function(t){(0,Uw.hasKey)(t,"visible")&&(t.visible?this.show():this.hide()),(0,Uw.hasKey)(t,"capture")&&this.setCapture(t.capture)},e.prototype.getLayoutBBox=function(){return this.getBBox()},e.prototype.getLocationType=function(){return this.get("locationType")},e.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},e.prototype.setOffset=function(t,e){this.update({offsetX:t,offsetY:e})},e.prototype.setLocation=function(t){var e=(0,Gw.__assign)({},t);this.update(e)},e.prototype.getLocation=function(){var t=this,e={},r=this.get("locationType"),n=eD[r];return(0,Uw.each)(n,function(r){e[r]=t.get(r)}),e},e.prototype.isList=function(){return!1},e.prototype.isSlider=function(){return!1},e.prototype.init=function(){},e.prototype.initCfg=function(){var t=this,e=this.get("defaultCfg");(0,Uw.each)(e,function(e,r){var n=t.get(r);if((0,Uw.isObject)(n)){var i=(0,Uw.deepMix)({},e,n);t.set(r,i)}})},e}(CE.Base),nD=["visible","tip","delegateObject"],iD=["container","group","shapesMap","isRegister","isUpdating","destroyed"],oD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},e.prototype.remove=function(){this.clear(),this.get("group").remove()},e.prototype.clear=function(){this.get("group").clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},e.prototype.getChildComponentById=function(t){var e=this.getElementById(t);return e&&e.get("component")},e.prototype.getElementById=function(t){return this.get("shapesMap")[t]},e.prototype.getElementByLocalId=function(t){var e=this.getElementId(t);return this.getElementById(e)},e.prototype.getElementsByName=function(t){var e=[];return(0,Uw.each)(this.get("shapesMap"),function(r){r.get("name")===t&&e.push(r)}),e},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},e.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var e=this.get("group");this.updateElements(t,e),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},e.prototype.show=function(){this.get("group").show(),this.set("visible",!0)},e.prototype.hide=function(){this.get("group").hide(),this.set("visible",!1)},e.prototype.setCapture=function(t){this.get("group").set("capture",t),this.set("capture",t)},e.prototype.destroy=function(){this.removeEvent(),this.remove(),t.prototype.destroy.call(this)},e.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},e.prototype.getLayoutBBox=function(){var t=this.get("group"),e=this.getInnerLayoutBBox(),r=t.getTotalMatrix();return r&&(e=function(t,e){var r=UR(t,[e.minX,e.minY]),n=UR(t,[e.maxX,e.minY]),i=UR(t,[e.minX,e.maxY]),o=UR(t,[e.maxX,e.maxY]),a=Math.min(r[0],n[0],i[0],o[0]),s=Math.max(r[0],n[0],i[0],o[0]),u=Math.min(r[1],n[1],i[1],o[1]),l=Math.max(r[1],n[1],i[1],o[1]);return{x:a,y:u,minX:a,minY:u,maxX:s,maxY:l,width:s-a,height:l-u}}(r,e)),e},e.prototype.on=function(t,e,r){return this.get("group").on(t,e,r),this},e.prototype.off=function(t,e){var r=this.get("group");return r&&r.off(t,e),this},e.prototype.emit=function(t,e){this.get("group").emit(t,e)},e.prototype.init=function(){t.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},e.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},e.prototype.delegateEmit=function(t,e){var r=this.get("group");e.target=r,r.emit(t,e),BR(r,t,e)},e.prototype.createOffScreenGroup=function(){return new(this.get("group").getGroupBase())({delegateObject:this.getDelegateObject()})},e.prototype.applyOffset=function(){var t=this.get("offsetX"),e=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:e})},e.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},e.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",QR(t)),t},e.prototype.addGroup=function(t,e){this.appendDelegateObject(t,e);var r=t.addGroup(e);return this.get("isRegister")&&this.registerElement(r),r},e.prototype.addShape=function(t,e){this.appendDelegateObject(t,e);var r=t.addShape(e);return this.get("isRegister")&&this.registerElement(r),r},e.prototype.addComponent=function(t,e){var r=e.id,n=e.component,i=(0,Gw.__rest)(e,["id","component"]),o=new n((0,Gw.__assign)((0,Gw.__assign)({},i),{id:r,container:t,updateAutoRender:this.get("updateAutoRender")}));return o.init(),o.render(),this.get("isRegister")&&this.registerElement(o.get("group")),o},e.prototype.initEvent=function(){},e.prototype.removeEvent=function(){this.get("group").off()},e.prototype.getElementId=function(t){return this.get("id")+"-"+this.get("name")+"-"+t},e.prototype.registerElement=function(t){var e=t.get("id");this.get("shapesMap")[e]=t},e.prototype.unregisterElement=function(t){var e=t.get("id");delete this.get("shapesMap")[e]},e.prototype.moveElementTo=function(t,e){var r=GR(e);t.attr("matrix",r)},e.prototype.addAnimation=function(t,e,r){var n=e.attr("opacity");(0,Uw.isNil)(n)&&(n=1),e.attr("opacity",0),e.animate({opacity:n},r)},e.prototype.removeAnimation=function(t,e,r){e.animate({opacity:0},r)},e.prototype.updateAnimation=function(t,e,r,n){e.animate(r,n)},e.prototype.updateElements=function(t,e){var r,n=this,i=this.get("animate"),o=this.get("animateOption"),a=t.getChildren().slice(0);(0,Uw.each)(a,function(t){var a=t.get("id"),s=n.getElementById(a),u=t.get("name");if(s)if(t.get("isComponent")){var l=t.get("component"),c=s.get("component"),f=(0,Uw.pick)(l.cfg,(0,Uw.difference)((0,Uw.keys)(l.cfg),iD));c.update(f),s.set("update_status","update")}else{var h=n.getReplaceAttrs(s,t);i&&o.update?n.updateAnimation(u,s,h,o.update):s.attr(h),t.isGroup()&&n.updateElements(t,s),(0,Uw.each)(nD,function(e){s.set(e,t.get(e))}),function(t,e){if(t.getClip()||e.getClip()){var r=e.getClip();if(r){var n={type:r.get("type"),attrs:r.attr()};t.setClip(n)}else t.setClip(null)}}(s,t),r=s,s.set("update_status","update")}else{e.add(t);var p=e.getChildren();if(p.splice(p.length-1,1),r){var d=p.indexOf(r);p.splice(d+1,0,t)}else p.unshift(t);if(n.registerElement(t),t.set("update_status","add"),t.get("isComponent"))(l=t.get("component")).set("container",e);else t.isGroup()&&n.registerNewGroup(t);if(r=t,i){var y=n.get("isInit")?o.appear:o.enter;y&&n.addAnimation(u,t,y)}}})},e.prototype.clearUpdateStatus=function(t){var e=t.getChildren();(0,Uw.each)(e,function(t){t.set("update_status",null)})},e.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},e.prototype.getDelegateObject=function(){var t;return(t={})[this.get("name")]=this,t.component=this,t},e.prototype.appendDelegateObject=function(t,e){var r=t.get("delegateObject");e.delegateObject||(e.delegateObject={}),(0,Uw.mix)(e.delegateObject,r)},e.prototype.getReplaceAttrs=function(t,e){var r=t.attr(),n=e.attr();return(0,Uw.each)(r,function(t,e){void 0===n[e]&&(n[e]=void 0)}),n},e.prototype.registerNewGroup=function(t){var e=this,r=t.getChildren();(0,Uw.each)(r,function(t){e.registerElement(t),t.set("update_status","add"),t.isGroup()&&e.registerNewGroup(t)})},e.prototype.deleteElements=function(){var t=this,e=this.get("shapesMap"),r=[];(0,Uw.each)(e,function(t,e){!t.get("update_status")||t.destroyed?r.push([e,t]):t.set("update_status",null)});var n=this.get("animate"),i=this.get("animateOption");(0,Uw.each)(r,function(r){var o=r[0],a=r[1];if(!a.destroyed){var s=a.get("name");if(n&&i.leave){var u=(0,Uw.mix)({callback:function(){t.removeElement(a)}},i.leave);t.removeAnimation(s,a,u)}else t.removeElement(a)}delete e[o]})},e.prototype.removeElement=function(t){if(t.get("isGroup")){var e=t.get("component");e&&e.destroy()}t.remove()},e}(rD),aD="…";function sD(t,e){return t.charCodeAt(e)>0&&t.charCodeAt(e)<128?1:2}var uD="…",lD=2,cD=400;function fD(t){if(t.length>cD)return function(t){for(var e=t.map(function(t){var e=t.attr("text");return(0,Uw.isNil)(e)?"":""+e}),r=0,n=0,i=0;i=19968&&s<=40869?2:1}o>r&&(r=o,n=i)}return t[n].getBBox().width}(t);var e=0;return(0,Uw.each)(t,function(t){var r=t.getBBox().width;e=0?function(t,e,r){void 0===r&&(r="tail");var n=t.length,i="";if("tail"===r){for(var o=0,a=0;o1||n<0)&&(n=1),{x:ZR(t.x,e.x,n),y:ZR(t.y,e.y,n)}},e.prototype.renderLabel=function(t){var e=this.get("text"),r=this.get("start"),n=this.get("end"),i=e.position,o=e.content,a=e.style,s=e.offsetX,u=e.offsetY,l=e.autoRotate,c=e.maxLength,f=e.autoEllipsis,h=e.ellipsisPosition,p=e.background,d=e.isVertical,y=void 0!==d&&d,v=this.getLabelPoint(r,n,i),g=v.x+s,m=v.y+u,b={id:this.getElementId("line-text"),name:"annotation-line-text",x:g,y:m,content:o,style:a,maxLength:c,autoEllipsis:f,ellipsisPosition:h,background:p,isVertical:y};if(l){var x=[n.x-r.x,n.y-r.y];b.rotate=Math.atan2(x[1],x[0])}pD(t,b)},e}(oD),vD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:dD.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:dD.fontFamily}}})},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.renderInner=function(t){var e=this.getLocation(),r=e.x,n=e.y,i=this.get("content"),o=this.get("style");pD(t,{id:this.getElementId("text"),name:this.get("name")+"-text",x:r,y:n,content:i,style:o,maxLength:this.get("maxLength"),autoEllipsis:this.get("autoEllipsis"),isVertical:this.get("isVertical"),ellipsisPosition:this.get("ellipsisPosition"),background:this.get("background"),rotate:this.get("rotate")})},e.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var e=this.getLocation(),r=e.x,n=e.y,i=this.get("rotate");HR(t,r,n),VR(t,i,r,n)}},e}(oD),gD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2,style:{stroke:"#999",lineWidth:1}})},e.prototype.renderInner=function(t){this.renderArc(t)},e.prototype.getArcPath=function(){var t=this.getLocation(),e=t.center,r=t.radius,n=t.startAngle,i=t.endAngle,o=KR(e,r,n),a=KR(e,r,i),s=i-n>Math.PI?1:0,u=[["M",o.x,o.y]];if(i-n==2*Math.PI){var l=KR(e,r,n+Math.PI);u.push(["A",r,r,0,s,1,l.x,l.y]),u.push(["A",r,r,0,s,1,a.x,a.y])}else u.push(["A",r,r,0,s,1,a.x,a.y]);return u},e.prototype.renderArc=function(t){var e=this.getArcPath(),r=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:(0,Gw.__assign)({path:e},r)})},e}(oD),mD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:dD.regionColor,opacity:.4}}})},e.prototype.renderInner=function(t){this.renderRegion(t)},e.prototype.renderRegion=function(t){var e=this.get("start"),r=this.get("end"),n=this.get("style"),i=YR({start:e,end:r});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:(0,Gw.__assign)({x:i.x,y:i.y,width:i.width,height:i.height},n)})},e}(oD),bD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},e.prototype.renderInner=function(t){this.renderImage(t)},e.prototype.getImageAttrs=function(){var t=this.get("start"),e=this.get("end"),r=this.get("style"),n=YR({start:t,end:e}),i=this.get("src");return(0,Gw.__assign)({x:n.x,y:n.y,img:i,width:n.width,height:n.height},r)},e.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},e}(oD),xD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:dD.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:dD.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:dD.fontFamily}}}})},e.prototype.renderInner=function(t){(0,Uw.get)(this.get("line"),"display")&&this.renderLine(t),(0,Uw.get)(this.get("text"),"display")&&this.renderText(t),(0,Uw.get)(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},e.prototype.renderPoint=function(t){var e=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:e})},e.prototype.renderLine=function(t){var e=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:e})},e.prototype.renderText=function(t){var e=this.getShapeAttrs().text,r=e.x,n=e.y,i=e.text,o=(0,Gw.__rest)(e,["x","y","text"]),a=this.get("text"),s=a.background,u=a.maxLength,l=a.autoEllipsis,c=a.isVertival,f=a.ellipsisPosition;pD(t,{x:r,y:n,id:this.getElementId("text"),name:"annotation-text",content:i,style:o,background:s,maxLength:u,autoEllipsis:l,isVertival:c,ellipsisPosition:f})},e.prototype.autoAdjust=function(t){var e=this.get("direction"),r=this.get("x"),n=this.get("y"),i=(0,Uw.get)(this.get("line"),"length",0),o=this.get("coordinateBBox"),a=t.getBBox(),s=a.minX,u=a.maxX,l=a.minY,c=a.maxY,f=t.findById(this.getElementId("text-group")),h=t.findById(this.getElementId("text")),p=t.findById(this.getElementId("line"));if(o&&f){var d=f.attr("x"),y=f.attr("y"),v=h.getCanvasBBox(),g=v.width,m=v.height,b=0,x=0;if(r+s<=o.minX)if("leftward"===e)b=1;else{var w=o.minX-(r+s);d=f.attr("x")+w}else if(r+u>=o.maxX)if("rightward"===e)b=-1;else{w=r+u-o.maxX;d=f.attr("x")-w}if(b&&(p&&p.attr("path",[["M",0,0],["L",i*b,0]]),d=(i+2+g)*b),n+l<=o.minY)if("upward"===e)x=1;else{w=o.minY-(n+l);y=f.attr("y")+w}else if(n+c>=o.maxY)if("downward"===e)x=-1;else{w=n+c-o.maxY;y=f.attr("y")-w}x&&(p&&p.attr("path",[["M",0,0],["L",0,i*x]]),y=(i+2+m)*x),d===f.attr("x")&&y===f.attr("y")||HR(f,d,y)}},e.prototype.getShapeAttrs=function(){var t=(0,Uw.get)(this.get("line"),"display"),e=(0,Uw.get)(this.get("point"),"style",{}),r=(0,Uw.get)(this.get("line"),"style",{}),n=(0,Uw.get)(this.get("text"),"style",{}),i=this.get("direction"),o=t?(0,Uw.get)(this.get("line"),"length",0):0,a=0,s=0,u="top",l="start";switch(i){case"upward":s=-1,u="bottom";break;case"downward":s=1,u="top";break;case"leftward":a=-1,l="end";break;case"rightward":a=1,l="start"}return{point:(0,Gw.__assign)({x:0,y:0},e),line:(0,Gw.__assign)({path:[["M",0,0],["L",o*a,o*s]]},r),text:(0,Gw.__assign)({x:(o+2)*a,y:(o+2)*s,text:(0,Uw.get)(this.get("text"),"content",""),textBaseline:u,textAlign:l},n)}},e}(oD),wD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:dD.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:dD.textColor,fontFamily:dD.fontFamily}}}})},e.prototype.renderInner=function(t){var e=(0,Uw.get)(this.get("region"),"style",{}),r=((0,Uw.get)(this.get("text"),"style",{}),this.get("lineLength")||0),n=this.get("points");if(n.length){var i=function(t){var e=t.map(function(t){return t.x}),r=t.map(function(t){return t.y}),n=Math.min.apply(Math,e),i=Math.min.apply(Math,r),o=Math.max.apply(Math,e),a=Math.max.apply(Math,r);return{x:n,y:i,minX:n,minY:i,maxX:o,maxY:a,width:o-n,height:a-i}}(n),o=[];o.push(["M",n[0].x,i.minY-r]),n.forEach(function(t){o.push(["L",t.x,t.y])}),o.push(["L",n[n.length-1].x,n[n.length-1].y-r]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:(0,Gw.__assign)({path:o},e)}),pD(t,(0,Gw.__assign)({id:this.getElementId("text"),name:"annotation-text",x:(i.minX+i.maxX)/2,y:i.minY-r},this.get("text")))}},e}(oD),_D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},e.prototype.renderInner=function(t){var e=this,r=this.get("start"),n=this.get("end"),i=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});(0,Uw.each)(this.get("shapes"),function(t,r){var n=t.get("type"),o=(0,Uw.clone)(t.attr());e.adjustShapeAttrs(o),e.addShape(i,{id:e.getElementId("shape-"+n+"-"+r),capture:!1,type:n,attrs:o})});var o=YR({start:r,end:n});i.setClip({type:"rect",attrs:{x:o.minX,y:o.minY,width:o.width,height:o.height}})},e.prototype.adjustShapeAttrs=function(t){var e=this.get("color");t.fill&&(t.fill=t.fillStyle=e),t.stroke=t.strokeStyle=e},e}(oD),SD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"shape",draw:Uw.noop})},e.prototype.renderInner=function(t){var e=this.get("render");(0,Uw.isFunction)(e)&&e(t)},e}(oD);function ED(t,e,r){var n;try{n=window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.style[e]}catch(t){}finally{n=void 0===n?r:n}return n}function kD(t,e){var r=function(t,e){var r=ED(t,"width",e);return"auto"===r&&(r=t.offsetWidth),parseFloat(r)}(t,e),n=parseFloat(ED(t,"borderLeftWidth"))||0,i=parseFloat(ED(t,"paddingLeft"))||0,o=parseFloat(ED(t,"paddingRight"))||0,a=parseFloat(ED(t,"borderRightWidth"))||0,s=parseFloat(ED(t,"marginRight"))||0;return r+n+a+i+o+(parseFloat(ED(t,"marginLeft"))||0)+s}function TD(t,e){var r=function(t,e){var r=ED(t,"height",e);return"auto"===r&&(r=t.offsetHeight),parseFloat(r)}(t,e),n=parseFloat(ED(t,"borderTopWidth"))||0,i=parseFloat(ED(t,"paddingTop"))||0,o=parseFloat(ED(t,"paddingBottom"))||0;return r+n+(parseFloat(ED(t,"borderBottomWidth"))||0)+i+o+(parseFloat(ED(t,"marginTop"))||0)+(parseFloat(ED(t,"marginBottom"))||0)}var CD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{container:null,containerTpl:"
    ",updateAutoRender:!0,containerClassName:"",parent:null})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.show=function(){this.get("container").style.display="",this.set("visible",!0)},e.prototype.hide=function(){this.get("container").style.display="none",this.set("visible",!1)},e.prototype.setCapture=function(t){var e=this.getContainer(),r=t?"auto":"none";e.style.pointerEvents=r,this.set("capture",t)},e.prototype.getBBox=function(){var t=this.getContainer();return XR(parseFloat(t.style.left)||0,parseFloat(t.style.top)||0,t.clientWidth,t.clientHeight)},e.prototype.clear=function(){qR(this.get("container"))},e.prototype.destroy=function(){this.removeEvent(),this.removeDom(),t.prototype.destroy.call(this)},e.prototype.init=function(){t.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},e.prototype.initCapture=function(){this.setCapture(this.get("capture"))},e.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},e.prototype.initDom=function(){},e.prototype.initContainer=function(){var t=this.get("container");if((0,Uw.isNil)(t)){t=this.createDom();var e=this.get("parent");(0,Uw.isString)(e)&&(e=document.getElementById(e),this.set("parent",e)),e.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else(0,Uw.isString)(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},e.prototype.resetStyles=function(){var t=this.get("domStyles"),e=this.get("defaultStyles");t=t?(0,Uw.deepMix)({},e,t):e,this.set("domStyles",t)},e.prototype.applyStyles=function(){var t=this.get("domStyles");if(t){var e=this.getContainer();this.applyChildrenStyles(e,t);var r,n=this.get("containerClassName");if(n&&(r=n,e.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))))rP(e,t[n])}},e.prototype.applyChildrenStyles=function(t,e){(0,Uw.each)(e,function(e,r){var n=t.getElementsByClassName(r);(0,Uw.each)(n,function(t){rP(t,e)})})},e.prototype.applyStyle=function(t,e){rP(e,this.get("domStyles")[t])},e.prototype.createDom=function(){return oO(this.get("containerTpl"))},e.prototype.initEvent=function(){},e.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},e.prototype.removeEvent=function(){},e.prototype.updateInner=function(t){(0,Uw.hasKey)(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},e.prototype.resetPosition=function(){},e}(rD),OD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'
    ',alignX:"left",alignY:"top",html:"",zIndex:7})},e.prototype.render=function(){var t=this.getContainer(),e=this.get("html");qR(t);var r=(0,Uw.isFunction)(e)?e(t):e;if((0,Uw.isElement)(r))t.appendChild(r);else if((0,Uw.isString)(r)||(0,Uw.isNumber)(r)){var n=oO(""+r);n&&t.appendChild(n)}this.resetPosition()},e.prototype.resetPosition=function(){var t=this.getContainer(),e=this.getLocation(),r=e.x,n=e.y,i=this.get("alignX"),o=this.get("alignY"),a=this.get("offsetX"),s=this.get("offsetY"),u=kD(t),l=TD(t),c={x:r,y:n};"middle"===i?c.x-=Math.round(u/2):"right"===i&&(c.x-=Math.round(u)),"middle"===o?c.y-=Math.round(l/2):"bottom"===o&&(c.y-=Math.round(l)),a&&(c.x+=a),s&&(c.y+=s),rP(t,{position:"absolute",left:c.x+"px",top:c.y+"px",zIndex:this.get("zIndex")})},e}(CD);function AD(t,e,r){var n=e+"Style",i=null;return(0,Uw.each)(r,function(e,r){t[r]&&e[n]&&(i||(i={}),(0,Uw.mix)(i,e[n]))}),i}var PD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:dD.lineColor}},tickLine:{style:{lineWidth:1,stroke:dD.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:dD.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:dD.textColor,fontFamily:dD.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:dD.textColor,textBaseline:"middle",fontFamily:dD.fontFamily,textAlign:"center"},iconStyle:{fill:dD.descriptionIconFill,stroke:dD.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:dD.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},e.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},e.prototype.isList=function(){return!0},e.prototype.getItems=function(){return this.get("ticks")},e.prototype.setItems=function(t){this.update({ticks:t})},e.prototype.updateItem=function(t,e){(0,Uw.mix)(t,e),this.clear(),this.render()},e.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},e.prototype.setItemState=function(t,e,r){t[e]=r,this.updateTickStates(t)},e.prototype.hasState=function(t,e){return!!t[e]},e.prototype.getItemStates=function(t){var e=this.get("tickStates"),r=[];return(0,Uw.each)(e,function(e,n){t[n]&&r.push(n)}),r},e.prototype.clearItemsState=function(t){var e=this,r=this.getItemsByState(t);(0,Uw.each)(r,function(r){e.setItemState(r,t,!1)})},e.prototype.getItemsByState=function(t){var e=this,r=this.getItems();return(0,Uw.filter)(r,function(r){return e.hasState(r,t)})},e.prototype.getSidePoint=function(t,e){var r=this.getSideVector(e,t);return{x:t.x+r[0],y:t.y+r[1]}},e.prototype.getTextAnchor=function(t){var e;return(0,Uw.isNumberEqual)(t[0],0)?e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e},e.prototype.getTextBaseline=function(t){var e;return(0,Uw.isNumberEqual)(t[1],0)?e="middle":t[1]>0?e="top":t[1]<0&&(e="bottom"),e},e.prototype.processOverlap=function(t){},e.prototype.drawLine=function(t){var e=this.getLinePath(),r=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:(0,Uw.mix)({path:e},r.style)})},e.prototype.getTickLineItems=function(t){var e=this,r=[],n=this.get("tickLine"),i=n.alignTick,o=n.length,a=1;return t.length>=2&&(a=t[1].value-t[0].value),(0,Uw.each)(t,function(t){var n=t.point;i||(n=e.getTickPoint(t.value-a/2));var s=e.getSidePoint(n,o);r.push({startPoint:n,tickValue:t.value,endPoint:s,tickId:t.id,id:"tickline-"+t.id})}),r},e.prototype.getSubTickLineItems=function(t){var e=[],r=this.get("subTickLine"),n=r.count,i=t.length;if(i>=2)for(var o=0;o0){var r=(0,Uw.size)(e);if(r>t.threshold){var n=Math.ceil(r/t.threshold),i=e.filter(function(t,e){return e%n==0});this.set("ticks",i),this.set("originalTicks",e)}}},e.prototype.getLabelAttrs=function(t,e,r){var n=this.get("label"),i=n.offset,o=n.offsetX,a=n.offsetY,s=n.rotate,u=n.formatter,l=this.getSidePoint(t.point,i),c=this.getSideVector(i,l),f=u?u(t.name,t,e):t.name,h=n.style;h=(0,Uw.isFunction)(h)?(0,Uw.get)(this.get("theme"),["label","style"],{}):h;var p=(0,Uw.mix)({x:l.x+o,y:l.y+a,text:f,textAlign:this.getTextAnchor(c),textBaseline:this.getTextBaseline(c)},h);return s&&(p.matrix=zR(l,s)),p},e.prototype.drawLabels=function(t){var e=this,r=this.get("ticks"),n=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});(0,Uw.each)(r,function(t,i){e.addShape(n,{type:"text",name:"axis-label",id:e.getElementId("label-"+t.id),attrs:e.getLabelAttrs(t,i,r),delegateObject:{tick:t,item:t,index:i}})}),this.processOverlap(n);var i=n.getChildren(),o=(0,Uw.get)(this.get("theme"),["label","style"],{}),a=this.get("label"),s=a.style,u=a.formatter;if((0,Uw.isFunction)(s)){var l=i.map(function(t){return(0,Uw.get)(t.get("delegateObject"),"tick")});(0,Uw.each)(i,function(t,e){var r=t.get("delegateObject").tick,n=u?u(r.name,r,e):r.name,i=(0,Uw.mix)({},o,s(n,e,l));t.attr(i)})}},e.prototype.getTitleAttrs=function(){var t=this.get("title"),e=t.style,r=t.position,n=t.offset,i=t.spacing,o=void 0===i?0:i,a=t.autoRotate,s=e.fontSize,u=.5;"start"===r?u=0:"end"===r&&(u=1);var l=this.getTickPoint(u),c=this.getSidePoint(l,n||o+s/2),f=(0,Uw.mix)({x:c.x,y:c.y,text:t.text},e),h=t.rotate,p=h;if((0,Uw.isNil)(h)&&a){var d=this.getAxisVector(l);p=Yw.LL(d,[1,0],!0)}if(p){var y=zR(c,p);f.matrix=y}return f},e.prototype.drawTitle=function(t){var e,r=this.getTitleAttrs(),n=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:r});(null===(e=this.get("title"))||void 0===e?void 0:e.description)&&this.drawDescriptionIcon(t,n,r.matrix)},e.prototype.drawDescriptionIcon=function(t,e,r){var n=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),i=e.getBBox(),o=i.maxX,a=i.maxY,s=i.height,u=this.get("title").iconStyle,l=s/2,c=l/6,f=o+4,h=a-s/2,p=[f+l,h-l],d=p[0],y=p[1],v=[d+l,y+l],g=v[0],m=v[1],b=[d,m+l],x=b[0],w=b[1],_=[f,y+l],S=_[0],E=_[1],k=[f+l,h-s/4],T=k[0],C=k[1],O=[T,C+c],A=O[0],P=O[1],M=[A,P+c],I=M[0],L=M[1],j=[I,L+3*l/4],N=j[0],R=j[1];this.addShape(n,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:(0,Gw.__assign)({path:[["M",d,y],["A",l,l,0,0,1,g,m],["A",l,l,0,0,1,x,w],["A",l,l,0,0,1,S,E],["A",l,l,0,0,1,d,y],["M",T,C],["L",A,P],["M",I,L],["L",N,R]],lineWidth:c,matrix:r},u)}),this.addShape(n,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:f,y:h-s/2,width:s,height:s,stroke:"#000",fill:"#000",opacity:0,matrix:r,cursor:"pointer"}})},e.prototype.applyTickStates=function(t,e){if(this.getItemStates(t).length){var r=this.get("tickStates"),n=this.getElementId("label-"+t.id),i=e.findById(n);if(i){var o=AD(t,"label",r);o&&i.attr(o)}var a=this.getElementId("tickline-"+t.id),s=e.findById(a);if(s){var u=AD(t,"tickLine",r);u&&s.attr(u)}}},e.prototype.updateTickStates=function(t){var e=this.getItemStates(t),r=this.get("tickStates"),n=this.get("label"),i=this.getElementByLocalId("label-"+t.id),o=this.get("tickLine"),a=this.getElementByLocalId("tickline-"+t.id);if(e.length){if(i){var s=AD(t,"label",r);s&&i.attr(s)}if(a){var u=AD(t,"tickLine",r);u&&a.attr(u)}}else i&&i.attr(n.style),a&&a.attr(o.style)},e}(oD);function MD(t,e,r,n){var i=e.getChildren(),o=!1;return(0,Uw.each)(i,function(e){var i=hD(t,e,r,n);o=o||i}),o}function ID(){return jD}function LD(t,e,r){return MD(t,e,r,"head")}function jD(t,e,r){return MD(t,e,r,"tail")}function ND(t,e,r){return MD(t,e,r,"middle")}function RD(t){var e,r;return(function(t){var e=t.attr("matrix");return e&&1!==e[0]}(t)?(e=t.attr("matrix"),r=[0,0,0],dS.transformMat3(r,[1,0,0],e),Math.atan2(r[1],r[0])):0)%360}function DD(t,e,r,n){var i=!1,o=RD(e),a=t?Math.abs(r.attr("y")-e.attr("y")):Math.abs(r.attr("x")-e.attr("x")),s=(t?r.attr("y")>e.attr("y"):r.attr("x")>e.attr("x"))?e.getBBox():r.getBBox();if(t){var u=Math.abs(Math.cos(o));i=JR(u,0,Math.PI/180)?s.width+n>a:s.height/u+n>a}else{u=Math.abs(Math.sin(o));i=JR(u,0,Math.PI/180)?s.width+n>a:s.height/u+n>a}return i}function BD(t,e,r,n){var i=(null===n||void 0===n?void 0:n.minGap)||0,o=e.getChildren().slice().filter(function(t){return t.get("visible")});if(!o.length)return!1;var a=!1;r&&o.reverse();for(var s=o.length,u=o[0],l=1;l1){h=Math.ceil(h);for(var d=0;d2){var a=i[0],s=i[i.length-1];a.get("visible")||(a.show(),BD(t,e,!1,n)&&(o=!0)),s.get("visible")||(s.show(),BD(t,e,!0,n)&&(o=!0))}return o}function qD(t,e,r,n){var i=e.getChildren();if(!i.length)return!1;if(!t&&i.length<2)return!1;var o=fD(i),a=!1;t?a=!!r&&o>r:a=o>Math.abs(i[1].attr("x")-i[0].attr("x"));a&&function(t,e){(0,Uw.each)(t,function(t){var r=zR({x:t.attr("x"),y:t.attr("y")},e);t.attr("matrix",r)})}(i,n(r,o));return a}function YD(){return XD}function XD(t,e,r,n){return qD(t,e,r,function(){return(0,Uw.isNumber)(n)?n:t?dD.verticalAxisRotate:dD.horizontalAxisRotate})}function ZD(t,e,r){return qD(t,e,r,function(e,r){if(!e)return t?dD.verticalAxisRotate:dD.horizontalAxisRotate;if(t)return-Math.acos(e/r);var n=0;return e>r?n=Math.PI/4:(n=Math.asin(e/r))>Math.PI/4&&(n=Math.PI/4),n})}var KD,JD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getLinePath=function(){var t=this.get("start"),e=this.get("end"),r=[];return r.push(["M",t.x,t.y]),r.push(["L",e.x,e.y]),r},e.prototype.getInnerLayoutBBox=function(){var e=this.get("start"),r=this.get("end"),n=t.prototype.getInnerLayoutBBox.call(this),i=Math.min(e.x,r.x,n.x),o=Math.min(e.y,r.y,n.y),a=Math.max(e.x,r.x,n.maxX),s=Math.max(e.y,r.y,n.maxY);return{x:i,y:o,minX:i,minY:o,maxX:a,maxY:s,width:a-i,height:s-o}},e.prototype.isVertical=function(){var t=this.get("start"),e=this.get("end");return(0,Uw.isNumberEqual)(t.x,e.x)},e.prototype.isHorizontal=function(){var t=this.get("start"),e=this.get("end");return(0,Uw.isNumberEqual)(t.y,e.y)},e.prototype.getTickPoint=function(t){var e=this.get("start"),r=this.get("end"),n=r.x-e.x,i=r.y-e.y;return{x:e.x+n*t,y:e.y+i*t}},e.prototype.getSideVector=function(t){var e=this.getAxisVector(),r=vS.normalize([0,0],e),n=this.get("verticalFactor"),i=[r[1],-1*r[0]];return vS.scale([0,0],i,t*n)},e.prototype.getAxisVector=function(){var t=this.get("start"),e=this.get("end");return[e.x-t.x,e.y-t.y]},e.prototype.processOverlap=function(t){var e=this,r=this.isVertical(),n=this.isHorizontal();if(r||n){var i=this.get("label"),o=this.get("title"),a=this.get("verticalLimitLength"),s=i.offset,u=a,l=0,c=0;o&&(l=o.style.fontSize,c=o.spacing),u&&(u=u-s-c-l);var f=this.get("overlapOrder");if((0,Uw.each)(f,function(r){i[r]&&e.canProcessOverlap(r)&&e.autoProcessOverlap(r,i[r],t,u)}),o&&(0,Uw.isNil)(o.offset)){var h=t.getCanvasBBox(),p=r?h.width:h.height;o.offset=s+p+c+l/2}}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||(0,Uw.isNil)(e.rotate)},e.prototype.autoProcessOverlap=function(t,e,r,n){var i=this,o=this.isVertical(),a=!1,s=S[t];if(!0===e){this.get("label");a=s.getDefault()(o,r,n)}else if((0,Uw.isFunction)(e))a=e(o,r,n);else if((0,Uw.isObject)(e)){var u=e;s[u.type]&&(a=s[u.type](o,r,n,u.cfg))}else s[e]&&(a=s[e](o,r,n));if("autoRotate"===t){if(a){var l=r.getChildren(),c=this.get("verticalFactor");(0,Uw.each)(l,function(t){if("center"===t.attr("textAlign")){var e=c>0?"end":"start";t.attr("textAlign",e)}})}}else if("autoHide"===t){var f=r.getChildren().slice(0);(0,Uw.each)(f,function(t){t.get("visible")||(i.get("isRegister")&&i.unregisterElement(t),t.remove())})}},e}(PD),QD=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getLinePath=function(){var t=this.get("center"),e=t.x,r=t.y,n=this.get("radius"),i=n,o=this.get("startAngle"),a=this.get("endAngle"),s=[];if(Math.abs(a-o)===2*Math.PI)s=[["M",e,r-i],["A",n,i,0,1,1,e,r+i],["A",n,i,0,1,1,e,r-i],["Z"]];else{var u=this.getCirclePoint(o),l=this.getCirclePoint(a),c=Math.abs(a-o)>Math.PI?1:0,f=o>a?0:1;s=[["M",e,r],["L",u.x,u.y],["A",n,i,0,c,f,l.x,l.y],["L",e,r]]}return s},e.prototype.getTickPoint=function(t){var e=this.get("startAngle"),r=e+(this.get("endAngle")-e)*t;return this.getCirclePoint(r)},e.prototype.getSideVector=function(t,e){var r=this.get("center"),n=[e.x-r.x,e.y-r.y],i=this.get("verticalFactor"),o=vS.length(n);return vS.scale(n,n,i*t/o),n},e.prototype.getAxisVector=function(t){var e=this.get("center"),r=[t.x-e.x,t.y-e.y];return[r[1],-1*r[0]]},e.prototype.getCirclePoint=function(t,e){var r=this.get("center");return e=e||this.get("radius"),{x:r.x+Math.cos(t)*e,y:r.y+Math.sin(t)*e}},e.prototype.canProcessOverlap=function(t){var e=this.get("label");return"autoRotate"!==t||(0,Uw.isNil)(e.rotate)},e.prototype.processOverlap=function(t){var e=this,r=this.get("label"),n=this.get("title"),i=this.get("verticalLimitLength"),o=r.offset,a=i,s=0,u=0;n&&(s=n.style.fontSize,u=n.spacing),a&&(a=a-o-u-s);var l=this.get("overlapOrder");if((0,Uw.each)(l,function(n){r[n]&&e.canProcessOverlap(n)&&e.autoProcessOverlap(n,r[n],t,a)}),n&&(0,Uw.isNil)(n.offset)){var c=t.getCanvasBBox().height;n.offset=o+c+u+s/2}},e.prototype.autoProcessOverlap=function(t,e,r,n){var i=this,o=!1,a=S[t];if(n>0)if(!0===e)o=a.getDefault()(!1,r,n);else if((0,Uw.isFunction)(e))o=e(!1,r,n);else if((0,Uw.isObject)(e)){var s=e;a[s.type]&&(o=a[s.type](!1,r,n,s.cfg))}else a[e]&&(o=a[e](!1,r,n));if("autoRotate"===t){if(o){var u=r.getChildren(),l=this.get("verticalFactor");(0,Uw.each)(u,function(t){if("center"===t.attr("textAlign")){var e=l>0?"end":"start";t.attr("textAlign",e)}})}}else if("autoHide"===t){var c=r.getChildren().slice(0);(0,Uw.each)(c,function(t){t.get("visible")||(i.get("isRegister")&&i.unregisterElement(t),t.remove())})}},e}(PD),$D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:dD.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:dD.textColor,textAlign:"center",textBaseline:"middle",fontFamily:dD.fontFamily}},textBackground:{padding:5,style:{stroke:dD.lineColor}}}})},e.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},e.prototype.renderText=function(t){var e=this.get("text"),r=e.style,n=e.autoRotate,i=e.content;if(!(0,Uw.isNil)(i)){var o=this.getTextPoint(),a=null;if(n)a=zR(o,this.getRotateAngle());this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},o),{text:i,matrix:a}),r)})}},e.prototype.renderLine=function(t){var e=this.getLinePath(),r=this.get("line").style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:(0,Gw.__assign)({path:e},r)})},e.prototype.renderBackground=function(t){var e=this.getElementId("text"),r=t.findById(e),n=this.get("textBackground");if(n&&r){var i=r.getBBox(),o=WR(n.padding),a=n.style;this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:(0,Gw.__assign)({x:i.x-o[3],y:i.y-o[0],width:i.width+o[1]+o[3],height:i.height+o[0]+o[2],matrix:r.attr("matrix")},a)}).toBack()}},e}(oD),tB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{type:"line",locationType:"region",start:null,end:null})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text").position,i=Math.atan2(r.y-e.y,r.x-e.x);return"start"===n?i-Math.PI/2:i+Math.PI/2},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text");return tD(e,r,n.position,n.offset)},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.start,r=t.end;return[["M",e.x,e.y],["L",r.x,r.y]]},e}($D),eB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:3*Math.PI/2})},e.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.startAngle,r=t.endAngle;return"start"===this.get("text").position?e+Math.PI/2:r-Math.PI/2},e.prototype.getTextPoint=function(){var t=this.get("text"),e=t.position,r=t.offset,n=this.getLocation(),i=n.center,o=n.radius,a=n.startAngle,s=n.endAngle,u="start"===e?a:s,l=this.getRotateAngle()-Math.PI,c=KR(i,o,u),f=Math.cos(l)*r,h=Math.sin(l)*r;return{x:c.x+f,y:c.y+h}},e.prototype.getLinePath=function(){var t=this.getLocation(),e=t.center,r=t.radius,n=t.startAngle,i=t.endAngle,o=null;if(i-n==2*Math.PI){var a=e.x,s=e.y;o=[["M",a,s-r],["A",r,r,0,1,1,a,s+r],["A",r,r,0,1,1,a,s-r],["Z"]]}else{var u=KR(e,r,n),l=KR(e,r,i),c=Math.abs(i-n)>Math.PI?1:0,f=n>i?0:1;o=[["M",u.x,u.y],["A",r,r,0,c,f,l.x,l.y]]}return o},e}($D),rB=((KD={})["g2-crosshair"]={position:"relative"},KD["g2-crosshair-line"]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},KD["g2-crosshair-text"]={position:"absolute",color:dD.textColor,fontFamily:dD.fontFamily},KD),nB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'
    ',crosshairTpl:'
    ',textTpl:'{content}',domStyles:null,containerClassName:"g2-crosshair",defaultStyles:rB,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},e.prototype.render=function(){this.resetText(),this.resetPosition()},e.prototype.initCrossHair=function(){var t=this.getContainer(),e=oO(this.get("crosshairTpl"));t.appendChild(e),this.applyStyle("g2-crosshair-line",e),this.set("crosshairEl",e)},e.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,r=t.end,n=this.get("text");return tD(e,r,n.position,n.offset)},e.prototype.resetText=function(){var t=this.get("text"),e=this.get("textEl");if(t){var r=t.content;if(!e){var n=this.getContainer();e=oO((0,Uw.substitute)(this.get("textTpl"),t)),n.appendChild(e),this.applyStyle("g2-crosshair-text",e),this.set("textEl",e)}e.innerHTML=r}else e&&e.remove()},e.prototype.isVertical=function(t,e){return t.x===e.x},e.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var e=this.get("start"),r=this.get("end"),n=Math.min(e.x,r.x),i=Math.min(e.y,r.y);this.isVertical(e,r)?rP(t,{width:"1px",height:$R(Math.abs(r.y-e.y))}):rP(t,{height:"1px",width:$R(Math.abs(r.x-e.x))}),rP(t,{top:$R(i),left:$R(n)}),this.alignText()},e.prototype.alignText=function(){var t=this.get("textEl");if(t){var e=this.get("text").align,r=t.clientWidth,n=this.getTextPoint();switch(e){case"center":n.x=n.x-r/2;break;case"right":n.x=n.x-r}rP(t,{top:$R(n.y),left:$R(n.x)})}},e.prototype.updateInner=function(e){(0,Uw.hasKey)(e,"text")&&this.resetText(),t.prototype.updateInner.call(this,e)},e}(CD),iB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:dD.lineColor}}}})},e.prototype.getLineType=function(){return(this.get("line")||this.get("defaultCfg").line).type},e.prototype.renderInner=function(t){this.drawGrid(t)},e.prototype.getAlternatePath=function(t,e){var r=this.getGridPath(t),n=e.slice(0).reverse(),i=this.getGridPath(n,!0);return this.get("closed")?r=r.concat(i):(i[0][0]="L",(r=r.concat(i)).push(["Z"])),r},e.prototype.getPathStyle=function(){return this.get("line").style},e.prototype.drawGrid=function(t){var e=this,r=this.get("line"),n=this.get("items"),i=this.get("alternateColor"),o=null;(0,Uw.each)(n,function(a,s){var u=a.id||s;if(r){var l=e.getPathStyle();l=(0,Uw.isFunction)(l)?l(a,s,n):l;var c=e.getElementId("line-"+u),f=e.getGridPath(a.points);e.addShape(t,{type:"path",name:"grid-line",id:c,attrs:(0,Uw.mix)({path:f},l)})}if(i&&s>0){var h=e.getElementId("region-"+u),p=s%2==0;if((0,Uw.isString)(i))p&&e.drawAlternateRegion(h,t,o.points,a.points,i);else{var d=p?i[1]:i[0];e.drawAlternateRegion(h,t,o.points,a.points,d)}}o=a})},e.prototype.drawAlternateRegion=function(t,e,r,n,i){var o=this.getAlternatePath(r,n);this.addShape(e,{type:"path",id:t,name:"grid-region",attrs:{path:o,fill:i}})},e}(oD);var oB,aB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{type:"circle",center:null,closed:!0})},e.prototype.getGridPath=function(t,e){var r,n,i,o,a,s,u=this.getLineType(),l=this.get("closed"),c=[];if(t.length)if("circle"===u){var f=this.get("center"),h=t[0],p=(r=f.x,n=f.y,i=h.x,o=h.y,a=i-r,s=o-n,Math.sqrt(a*a+s*s)),d=e?0:1;l?(c.push(["M",f.x,f.y-p]),c.push(["A",p,p,0,0,d,f.x,f.y+p]),c.push(["A",p,p,0,0,d,f.x,f.y-p]),c.push(["Z"])):(0,Uw.each)(t,function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["A",p,p,0,0,d,t.x,t.y])})}else(0,Uw.each)(t,function(t,e){0===e?c.push(["M",t.x,t.y]):c.push(["L",t.x,t.y])}),l&&c.push(["Z"]);return c},e}(iB),sB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{type:"line"})},e.prototype.getGridPath=function(t){var e=[];return(0,Uw.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e},e}(iB),uB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},e.prototype.getLayoutBBox=function(){var e=t.prototype.getLayoutBBox.call(this),r=this.get("maxWidth"),n=this.get("maxHeight"),i=e.width,o=e.height;return r&&(i=Math.min(i,r)),n&&(o=Math.min(o,n)),XR(e.minX,e.minY,i,o)},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},e.prototype.resetLocation=function(){var t=this.get("x"),e=this.get("y"),r=this.get("offsetX"),n=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+r,y:e+n})},e.prototype.applyOffset=function(){this.resetLocation()},e.prototype.getDrawPoint=function(){return this.get("currentPoint")},e.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},e.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},e.prototype.drawBackground=function(t){var e=this.get("background"),r=t.getBBox(),n=WR(e.padding),i=(0,Gw.__assign)({x:0,y:0,width:r.width+n[1]+n[3],height:r.height+n[0]+n[2]},e.style);this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:i}).toBack()},e.prototype.drawTitle=function(t){var e=this.get("currentPoint"),r=this.get("title"),n=r.spacing,i=r.style,o=r.text,a=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:(0,Gw.__assign)({text:o,x:e.x,y:e.y},i)}).getBBox();this.set("currentPoint",{x:e.x,y:a.maxY+n})},e.prototype.resetDraw=function(){var t=this.get("background"),e={x:0,y:0};if(t){var r=WR(t.padding);e.x=r[3],e.y=r[0]}this.set("currentPoint",e)},e}(oD),lB={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},cB={fill:dD.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:dD.fontFamily,fontWeight:"normal",lineHeight:12},fB={right:90*Math.PI/180,left:270*Math.PI/180,up:0,down:180*Math.PI/180},hB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.currentPageIndex=1,e.totalPagesCnt=1,e.pageWidth=0,e.pageHeight=0,e.startX=0,e.startY=0,e.onNavigationBack=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndex>1){e.currentPageIndex-=1,e.updateNavigation();var r=e.getCurrentNavigationMatrix();e.get("animate")?t.animate({matrix:r},100):t.attr({matrix:r})}},e.onNavigationAfter=function(){var t=e.getElementByLocalId("item-group");if(e.currentPageIndexd&&(d=m),"horizontal"===f?(y&&ys}(t,y))&&(1===v&&(g=y.x+c,r.moveElementTo(p,{x:S,y:y.y+f/2-d.height/2-d.minY})),v+=1,y.x=n,y.y+=_),r.moveElementTo(t,y),t.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:i+c,height:f}}),y.x+=i+c})}else{(0,Uw.each)(a,function(t){var e=t.getBBox();e.width>m&&(m=e.width)}),b=m,m+=c,s&&(m=Math.min(s,m),b=Math.min(s,b)),this.pageWidth=m,this.pageHeight=u-Math.max(d.height,f+x);var E=Math.floor(this.pageHeight/(f+x));(0,Uw.each)(a,function(t,e){0!==e&&e%E==0&&(v+=1,y.x+=m,y.y=i),r.moveElementTo(t,y),t.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:m,height:f}}),y.y+=f+x}),this.totalPagesCnt=v,this.moveElementTo(p,{x:n+b/2-d.width/2-d.minX,y:u-d.height-d.minY})}this.pageHeight&&this.pageWidth&&e.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),"horizontal"===o&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(v/this.get("maxRow")):this.totalPagesCnt=v,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(p),e.attr("matrix",this.getCurrentNavigationMatrix())},e.prototype.drawNavigation=function(t,e,r,n){var i={x:0,y:0},o=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),a=(0,Uw.get)(n.marker,"style",{}),s=a.size,u=void 0===s?12:s,l=(0,Gw.__rest)(a,["size"]),c=this.drawArrow(o,i,"navigation-arrow-left","horizontal"===e?"up":"left",u,l);c.on("click",this.onNavigationBack);var f=c.getBBox();i.x+=f.width+2;var h=this.addShape(o,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:(0,Gw.__assign)({x:i.x,y:i.y+u/2,text:r,textBaseline:"middle"},(0,Uw.get)(n.text,"style"))}).getBBox();return i.x+=h.width+2,this.drawArrow(o,i,"navigation-arrow-right","horizontal"===e?"down":"right",u,l).on("click",this.onNavigationAfter),o},e.prototype.updateNavigation=function(t){var e=(0,Uw.deepMix)({},lB,this.get("pageNavigator")).marker.style,r=e.fill,n=e.opacity,i=e.inactiveFill,o=e.inactiveOpacity,a=this.currentPageIndex+"/"+this.totalPagesCnt,s=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),u=t?t.findById(this.getElementId("navigation-arrow-left")):this.getElementByLocalId("navigation-arrow-left"),l=t?t.findById(this.getElementId("navigation-arrow-right")):this.getElementByLocalId("navigation-arrow-right");s.attr("text",a),u.attr("opacity",1===this.currentPageIndex?o:n),u.attr("fill",1===this.currentPageIndex?i:r),u.attr("cursor",1===this.currentPageIndex?"not-allowed":"pointer"),l.attr("opacity",this.currentPageIndex===this.totalPagesCnt?o:n),l.attr("fill",this.currentPageIndex===this.totalPagesCnt?i:r),l.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var c=u.getBBox().maxX+2;s.attr("x",c),c+=s.getBBox().width+2,this.updateArrowPath(l,{x:c,y:0})},e.prototype.drawArrow=function(t,e,r,n,i,o){var a=e.x,s=e.y,u=this.addShape(t,{type:"path",id:this.getElementId(r),name:r,attrs:(0,Gw.__assign)({size:i,direction:n,path:[["M",a+i/2,s],["L",a,s+i],["L",a+i,s+i],["Z"]],cursor:"pointer"},o)});return u.attr("matrix",zR({x:a+i/2,y:s+i/2},fB[n])),u},e.prototype.updateArrowPath=function(t,e){var r=e.x,n=e.y,i=t.attr(),o=i.size,a=i.direction,s=zR({x:r+o/2,y:n+o/2},fB[a]);t.attr("path",[["M",r+o/2,n],["L",r,n+o],["L",r+o,n+o],["Z"]]),t.attr("matrix",s)},e.prototype.getCurrentNavigationMatrix=function(){var t=this.currentPageIndex,e=this.pageWidth,r=this.pageHeight;return GR("horizontal"===this.get("layout")?{x:0,y:r*(1-t)}:{x:e*(1-t),y:0})},e.prototype.applyItemStates=function(t,e){if(this.getItemStates(t).length>0){var r=e.getChildren(),n=this.get("itemStates");(0,Uw.each)(r,function(e){var r=e.get("name").split("-")[2],i=AD(t,r,n);i&&(e.attr(i),"marker"!==r||e.get("isStroke")&&e.get("isFill")||(e.get("isStroke")&&e.attr("fill",null),e.get("isFill")&&e.attr("stroke",null)))})}},e.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),e=this.get("maxItemWidth");return e?t&&(e=t<=e?t:e):t&&(e=t),e},e}(uB),pB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:dD.textColor,textBaseline:"middle",fontFamily:dD.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:dD.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},e.prototype.isSlider=function(){return!0},e.prototype.getValue=function(){return this.getCurrentValue()},e.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},e.prototype.setRange=function(t,e){this.update({min:t,max:e})},e.prototype.setValue=function(t){var e=this.getValue();this.set("value",t);var r=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(r),this.delegateEmit("valuechanged",{originValue:e,value:t})},e.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},e.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},e.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},e.prototype.bindHandlersEvent=function(t){var e=this;t.on("legend-handler-min:drag",function(t){var r=e.getValueByCanvasPoint(t.x,t.y),n=e.getCurrentValue()[1];nr&&(n=r),e.setValue([n,r])})},e.prototype.bindRailEvent=function(t){},e.prototype.bindTrackEvent=function(t){var e=this,r=null;t.on("legend-track:dragstart",function(t){r={x:t.x,y:t.y}}),t.on("legend-track:drag",function(t){if(r){var n=e.getValueByCanvasPoint(r.x,r.y),i=e.getValueByCanvasPoint(t.x,t.y),o=e.getCurrentValue(),a=o[1]-o[0],s=e.getRange(),u=i-n;u<0?o[0]+u>s.min?e.setValue([o[0]+u,o[1]+u]):e.setValue([s.min,s.min+a]):u>0&&(u>0&&o[1]+ui&&(u=i),u0&&this.changeRailLength(n,i,r[i]-l)}},e.prototype.changeRailLength=function(t,e,r){var n,i=t.getBBox();n="height"===e?this.getRailPath(i.x,i.y,i.width,r):this.getRailPath(i.x,i.y,r,i.height),t.attr("path",n)},e.prototype.changeRailPosition=function(t,e,r){var n=t.getBBox(),i=this.getRailPath(e,r,n.width,n.height);t.attr("path",i)},e.prototype.fixedHorizontal=function(t,e,r,n){var i=this.get("label"),o=i.align,a=i.spacing,s=r.getBBox(),u=t.getBBox(),l=e.getBBox(),c=s.height;this.fitRailLength(u,l,s,r),s=r.getBBox(),"rail"===o?(t.attr({x:n.x,y:n.y+c/2}),this.changeRailPosition(r,n.x+u.width+a,n.y),e.attr({x:n.x+u.width+s.width+2*a,y:n.y+c/2})):"top"===o?(t.attr({x:n.x,y:n.y}),e.attr({x:n.x+s.width,y:n.y}),this.changeRailPosition(r,n.x,n.y+u.height+a)):(this.changeRailPosition(r,n.x,n.y),t.attr({x:n.x,y:n.y+s.height+a}),e.attr({x:n.x+s.width,y:n.y+s.height+a}))},e.prototype.fixedVertail=function(t,e,r,n){var i=this.get("label"),o=i.align,a=i.spacing,s=r.getBBox(),u=t.getBBox(),l=e.getBBox();if(this.fitRailLength(u,l,s,r),s=r.getBBox(),"rail"===o)t.attr({x:n.x,y:n.y}),this.changeRailPosition(r,n.x,n.y+u.height+a),e.attr({x:n.x,y:n.y+u.height+s.height+2*a});else if("right"===o)t.attr({x:n.x+s.width+a,y:n.y}),this.changeRailPosition(r,n.x,n.y),e.attr({x:n.x+s.width+a,y:n.y+s.height});else{var c=Math.max(u.width,l.width);t.attr({x:n.x,y:n.y}),this.changeRailPosition(r,n.x+c+a,n.y),e.attr({x:n.x,y:n.y+s.height})}},e}(uB),dB="g2-tooltip",yB="g2-tooltip-title",vB="g2-tooltip-list",gB="g2-tooltip-list-item",mB="g2-tooltip-marker",bB="g2-tooltip-value",xB="g2-tooltip-name",wB="g2-tooltip-crosshair-x",_B="g2-tooltip-crosshair-y",SB=((oB={})[""+dB]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:dD.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},oB[""+yB]={marginBottom:"4px"},oB[""+vB]={margin:"0px",listStyleType:"none",padding:"0px"},oB[""+gB]={listStyleType:"none",marginBottom:"4px"},oB[""+mB]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},oB[""+bB]={display:"inline-block",float:"right",marginLeft:"30px"},oB[""+wB]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},oB[""+_B]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},oB);var EB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'
      ',itemTpl:'
    • \n \n {name}:\n {value}\n
    • ',xCrosshairTpl:'
      ',yCrosshairTpl:'
      ',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:dB,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:SB})},e.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},e.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},e.prototype.show=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!0),rP(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},e.prototype.hide=function(){var t=this.getContainer();t&&!this.destroyed&&(this.set("visible",!1),rP(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},e.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},e.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},e.prototype.setCrossHairsVisible=function(t){var e=t?"":"none",r=this.get("xCrosshairDom"),n=this.get("yCrosshairDom");r&&rP(r,{display:e}),n&&rP(n,{display:e})},e.prototype.initContainer=function(){if(t.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var e=this.getHtmlContentNode();this.get("parent").appendChild(e),this.set("container",e),this.resetStyles(),this.applyStyles()}},e.prototype.updateInner=function(e){var r,n,i;this.get("customContent")?this.renderCustomContent():(r=e,n=["title","showTitle"],i=!1,(0,Uw.each)(n,function(t){if((0,Uw.hasKey)(r,t))return i=!0,!1}),i&&this.resetTitle(),(0,Uw.hasKey)(e,"items")&&this.renderItems()),t.prototype.updateInner.call(this,e)},e.prototype.initDom=function(){this.cacheDoms()},e.prototype.removeDom=function(){t.prototype.removeDom.call(this),this.clearCrosshairs()},e.prototype.resetPosition=function(){var t,e=this.get("x"),r=this.get("y"),n=this.get("offset"),i=this.getOffset(),o=i.offsetX,a=i.offsetY,s=this.get("position"),u=this.get("region"),l=this.getContainer(),c=this.getBBox(),f=c.width,h=c.height;u&&(t=YR(u));var p=function(t,e,r,n,i,o,a){var s=function(t,e,r,n,i,o){var a=t,s=e;switch(o){case"left":a=t-n-r,s=e-i/2;break;case"right":a=t+r,s=e-i/2;break;case"top":a=t-n/2,s=e-i-r;break;case"bottom":a=t-n/2,s=e+r;break;default:a=t+r,s=e-i-r}return{x:a,y:s}}(t,e,r,n,i,o);if(a){var u=function(t,e,r,n,i){return{left:ti.x+i.width,top:ei.y+i.height}}(s.x,s.y,n,i,a);"auto"===o?(u.right&&(s.x=Math.max(0,t-n-r)),u.top&&(s.y=Math.max(0,e-i-r))):"top"===o||"bottom"===o?(u.left&&(s.x=a.x),u.right&&(s.x=a.x+a.width-n),"top"===o&&u.top&&(s.y=e+r),"bottom"===o&&u.bottom&&(s.y=e-i-r)):(u.top&&(s.y=a.y),u.bottom&&(s.y=a.y+a.height-i),"left"===o&&u.left&&(s.x=t+r),"right"===o&&u.right&&(s.x=t-n-r))}return s}(e,r,n,f,h,s,t);rP(l,{left:$R(p.x+o),top:$R(p.y+a)}),this.resetCrosshairs()},e.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),e=this.get("parent"),r=this.get("container");r&&r.parentNode===e?e.replaceChild(t,r):e.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},e.prototype.getHtmlContentNode=function(){var t,e=this.get("customContent");if(e){var r=e(this.get("title"),this.get("items"));t=(0,Uw.isElement)(r)?r:oO(r)}return t},e.prototype.cacheDoms=function(){var t=this.getContainer(),e=t.getElementsByClassName(yB)[0],r=t.getElementsByClassName(vB)[0];this.set("titleDom",e),this.set("listDom",r)},e.prototype.resetTitle=function(){var t=this.get("title");this.get("showTitle")&&t?this.setTitle(t):this.setTitle("")},e.prototype.setTitle=function(t){var e=this.get("titleDom");e&&(e.innerText=t)},e.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),e=this.get("crosshairs");if(t&&e){var r=YR(t),n=this.get("xCrosshairDom"),i=this.get("yCrosshairDom");"x"===e?(this.resetCrosshair("x",r),i&&(i.remove(),this.set("yCrosshairDom",null))):"y"===e?(this.resetCrosshair("y",r),n&&(n.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",r),this.resetCrosshair("y",r)),this.setCrossHairsVisible(this.get("visible"))}else this.clearCrosshairs()},e.prototype.resetCrosshair=function(t,e){var r=this.checkCrosshair(t),n=this.get(t);rP(r,"x"===t?{left:$R(n),top:$R(e.y),height:$R(e.height)}:{top:$R(n),left:$R(e.x),width:$R(e.width)})},e.prototype.checkCrosshair=function(t){var e=t+"CrosshairDom",r=t+"CrosshairTpl",n="CROSSHAIR_"+t.toUpperCase(),i=k[n],o=this.get(e),a=this.get("parent");return o||(o=oO(this.get(r)),this.applyStyle(i,o),a.appendChild(o),this.set(e,o)),o},e.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),e=this.get("itemTpl"),r=this.get("listDom");r&&((0,Uw.each)(t,function(t){var n=SR.toCSSGradient(t.color),i=(0,Gw.__assign)((0,Gw.__assign)({},t),{color:n}),o=oO((0,Uw.substitute)(e,i));r.appendChild(o)}),this.applyChildrenStyles(r,this.get("domStyles")))},e.prototype.clearItemDoms=function(){this.get("listDom")&&qR(this.get("listDom"))},e.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),e=this.get("yCrosshairDom");t&&t.remove(),e&&e.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},e}(CD),kB={opacity:0},TB={stroke:"#C5C5C5",strokeOpacity:.85},CB={fill:"#CACED4",opacity:.85};function OB(t){return function(t){return(0,Uw.map)(t,function(t,e){return[0===e?"M":"L",t[0],t[1]]})}(t)}function AB(t,e,r,n){void 0===n&&(n=!0);var i=new NM({values:t}),o=new ZP({values:(0,Uw.map)(t,function(t,e){return e})}),a=(0,Uw.map)(t,function(t,n){return[o.scale(n)*e,r-i.scale(t)*r]});return n?function(t){if(t.length<=2)return OB(t);var e=[];(0,Uw.each)(t,function(t){(0,Uw.isEqual)(t,e.slice(e.length-2))||e.push(t[0],t[1])});var r=(0,nk.iR)(e,!1),n=(0,Uw.head)(t),i=n[0],o=n[1];return r.unshift(["M",i,o]),r}(a):OB(a)}function PB(t,e,r,n){var i=(0,Gw.__spreadArrays)(t),o=function(t,e){var r=new NM({values:t}),n=r.max<0?r.max:Math.max(0,r.min);return e-r.scale(n)*e}(n,r);return i.push(["L",e,o]),i.push(["L",0,o]),i.push(["Z"]),i}var MB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:kB,lineStyle:TB,areaStyle:CB})},e.prototype.renderInner=function(t){var e=this.cfg,r=e.width,n=e.height,i=e.data,o=e.smooth,a=e.isArea,s=e.backgroundStyle,u=e.lineStyle,l=e.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:(0,Gw.__assign)({x:0,y:0,width:r,height:n},s)});var c=AB(i,r,n,o);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:(0,Gw.__assign)({path:c},u)}),a){var f=PB(c,r,n,i);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:(0,Gw.__assign)({path:f},l)})}},e.prototype.applyOffset=function(){var t=this.cfg,e=t.x,r=t.y;this.moveElementTo(this.get("group"),{x:e,y:r})},e}(oD),IB={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},LB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"handler",x:0,y:0,width:10,height:24,style:IB})},e.prototype.renderInner=function(t){var e=this.cfg,r=e.width,n=e.height,i=e.style,o=i.fill,a=i.stroke,s=i.radius,u=i.opacity,l=i.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:r,height:n,fill:o,stroke:a,radius:s,opacity:u,cursor:l}});var c=1/3*r,f=2/3*r,h=.25*n,p=.75*n;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:c,y1:h,x2:c,y2:p,stroke:a,cursor:l}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:f,y1:h,x2:f,y2:p,stroke:a,cursor:l}})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var e=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",e),t.draw()}),this.get("group").on("mouseleave",function(){var e=t.get("style").fill;t.getElementByLocalId("background").attr("fill",e),t.draw()})},e.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},e}(oD),jB={fill:"#416180",opacity:.05},NB={fill:"#5B8FF9",opacity:.15,cursor:"move"},RB={width:10,height:24},DB={textBaseline:"middle",fill:"#000",opacity:.45},BB="sliderchange",FB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){return function(r){e.currentTarget=t;var n=r.originalEvent;n.stopPropagation(),n.preventDefault(),e.prevX=(0,Uw.get)(n,"touches.0.pageX",n.pageX),e.prevY=(0,Uw.get)(n,"touches.0.pageY",n.pageY);var i=e.getContainerDOM();i.addEventListener("mousemove",e.onMouseMove),i.addEventListener("mouseup",e.onMouseUp),i.addEventListener("mouseleave",e.onMouseUp),i.addEventListener("touchmove",e.onMouseMove),i.addEventListener("touchend",e.onMouseUp),i.addEventListener("touchcancel",e.onMouseUp)}},e.onMouseMove=function(t){var r=e.cfg.width,n=[e.get("start"),e.get("end")];t.stopPropagation(),t.preventDefault();var i=(0,Uw.get)(t,"touches.0.pageX",t.pageX),o=(0,Uw.get)(t,"touches.0.pageY",t.pageY),a=i-e.prevX,s=e.adjustOffsetRange(a/r);e.updateStartEnd(s),e.updateUI(e.getElementByLocalId("foreground"),e.getElementByLocalId("minText"),e.getElementByLocalId("maxText")),e.prevX=i,e.prevY=o,e.draw(),e.emit(BB,[e.get("start"),e.get("end")].sort()),e.delegateEmit("valuechanged",{originValue:n,value:[e.get("start"),e.get("end")]})},e.onMouseUp=function(){e.currentTarget&&(e.currentTarget=void 0);var t=e.getContainerDOM();t&&(t.removeEventListener("mousemove",e.onMouseMove),t.removeEventListener("mouseup",e.onMouseUp),t.removeEventListener("mouseleave",e.onMouseUp),t.removeEventListener("touchmove",e.onMouseMove),t.removeEventListener("touchend",e.onMouseUp),t.removeEventListener("touchcancel",e.onMouseUp))},e}return(0,Gw.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var r=this.get("start"),n=this.get("end"),i=(0,Uw.clamp)(r,t,e),o=(0,Uw.clamp)(n,t,e);this.get("isInit")||r===i&&n===o||this.setValue([i,o])},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange();if((0,Uw.isArray)(t)&&2===t.length){var r=[this.get("start"),this.get("end")];this.update({start:(0,Uw.clamp)(t[0],e.min,e.max),end:(0,Uw.clamp)(t[1],e.min,e.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:r,value:t})}},e.prototype.getValue=function(){return[this.get("start"),this.get("end")]},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:jB,foregroundStyle:NB,handlerStyle:RB,textStyle:DB}})},e.prototype.update=function(e){var r=e.start,n=e.end,i=(0,Gw.__assign)({},e);(0,Uw.isNil)(r)||(i.start=(0,Uw.clamp)(r,0,1)),(0,Uw.isNil)(n)||(i.end=(0,Uw.clamp)(n,0,1)),t.prototype.update.call(this,i),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},e.prototype.init=function(){this.set("start",(0,Uw.clamp)(this.get("start"),0,1)),this.set("end",(0,Uw.clamp)(this.get("end"),0,1)),t.prototype.init.call(this)},e.prototype.render=function(){t.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},e.prototype.renderInner=function(t){var e=this.cfg,r=(e.start,e.end,e.width),n=e.height,i=e.trendCfg,o=void 0===i?{}:i,a=e.minText,s=e.maxText,u=e.backgroundStyle,l=void 0===u?{}:u,c=e.foregroundStyle,f=void 0===c?{}:c,h=e.textStyle,p=void 0===h?{}:h,d=(0,Uw.deepMix)({},IB,this.cfg.handlerStyle);(0,Uw.size)((0,Uw.get)(o,"data"))&&(this.trend=this.addComponent(t,(0,Gw.__assign)({component:MB,id:this.getElementId("trend"),x:0,y:0,width:r,height:n},o))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:(0,Gw.__assign)({x:0,y:0,width:r,height:n},l)});this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:(0,Gw.__assign)({y:n/2,textAlign:"right",text:a,silent:!1},p)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:(0,Gw.__assign)({y:n/2,textAlign:"left",text:s,silent:!1},p)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:(0,Gw.__assign)({y:0,height:n},f)});var y=(0,Uw.get)(d,"width",10),v=(0,Uw.get)(d,"height",24);this.minHandler=this.addComponent(t,{component:LB,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(n-v)/2,width:y,height:v,cursor:"ew-resize",style:d}),this.maxHandler=this.addComponent(t,{component:LB,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(n-v)/2,width:y,height:v,cursor:"ew-resize",style:d})},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.updateUI=function(t,e,r){var n=this.cfg,i=n.start,o=n.end,a=n.width,s=n.minText,u=n.maxText,l=n.handlerStyle,c=n.height,f=i*a,h=o*a;this.trend&&(this.trend.update({width:a,height:c}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",f),t.attr("width",h-f);var p=(0,Uw.get)(l,"width",10);e.attr("text",s),r.attr("text",u);var d=this._dodgeText([f,h],e,r),y=d[0],v=d[1];this.minHandler&&(this.minHandler.update({x:f-p/2}),this.get("updateAutoRender")||this.minHandler.render()),(0,Uw.each)(y,function(t,r){return e.attr(r,t)}),this.maxHandler&&(this.maxHandler.update({x:h-p/2}),this.get("updateAutoRender")||this.maxHandler.render()),(0,Uw.each)(v,function(t,e){return r.attr(e,t)})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var e=t.findById(this.getElementId("foreground"));e.on("mousedown",this.onMouseDown("foreground")),e.on("touchstart",this.onMouseDown("foreground"))},e.prototype.adjustOffsetRange=function(t){var e=this.cfg,r=e.start,n=e.end;switch(this.currentTarget){case"minHandler":var i=0-r,o=1-r;return Math.min(o,Math.max(i,t));case"maxHandler":i=0-n,o=1-n;return Math.min(o,Math.max(i,t));case"foreground":i=0-r,o=1-n;return Math.min(o,Math.max(i,t))}},e.prototype.updateStartEnd=function(t){var e=this.cfg,r=e.start,n=e.end;switch(this.currentTarget){case"minHandler":r+=t;break;case"maxHandler":n+=t;break;case"foreground":r+=t,n+=t}this.set("start",r),this.set("end",n)},e.prototype._dodgeText=function(t,e,r){var n,i,o=this.cfg,a=o.handlerStyle,s=o.width,u=(0,Uw.get)(a,"width",10),l=t[0],c=t[1],f=!1;l>c&&(l=(n=[c,l])[0],c=n[1],e=(i=[r,e])[0],r=i[1],f=!0);var h=e.getBBox(),p=r.getBBox(),d=h.width>l-2?{x:l+u/2+2,textAlign:"left"}:{x:l-u/2-2,textAlign:"right"},y=p.width>s-c-2?{x:c-u/2-2,textAlign:"right"}:{x:c+u/2+2,textAlign:"left"};return f?[y,d]:[d,y]},e.prototype.draw=function(){var t=this.get("container"),e=t&&t.get("canvas");e&&e.draw()},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e}(oD),zB={default:{trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},hover:{thumbColor:"rgba(0,0,0,0.2)"}},GB=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.clearEvents=Uw.noop,e.onStartEvent=function(t){return function(r){e.isMobile=t,r.originalEvent.preventDefault();var n=t?(0,Uw.get)(r.originalEvent,"touches.0.clientX"):r.clientX,i=t?(0,Uw.get)(r.originalEvent,"touches.0.clientY"):r.clientY;e.startPos=e.cfg.isHorizontal?n:i,e.bindLaterEvent()}},e.bindLaterEvent=function(){var t=e.getContainerDOM(),r=[];r=e.isMobile?[cA(t,"touchmove",e.onMouseMove),cA(t,"touchend",e.onMouseUp),cA(t,"touchcancel",e.onMouseUp)]:[cA(t,"mousemove",e.onMouseMove),cA(t,"mouseup",e.onMouseUp),cA(t,"mouseleave",e.onMouseUp)],e.clearEvents=function(){r.forEach(function(t){t.remove()})}},e.onMouseMove=function(t){var r=e.cfg,n=r.isHorizontal,i=r.thumbOffset;t.preventDefault();var o=e.isMobile?(0,Uw.get)(t,"touches.0.clientX"):t.clientX,a=e.isMobile?(0,Uw.get)(t,"touches.0.clientY"):t.clientY,s=n?o:a,u=s-e.startPos;e.startPos=s,e.updateThumbOffset(i+u)},e.onMouseUp=function(t){t.preventDefault(),e.clearEvents()},e.onTrackClick=function(t){var r=e.cfg,n=r.isHorizontal,i=r.x,o=r.y,a=r.thumbLen,s=e.getContainerDOM().getBoundingClientRect(),u=t.clientX,l=t.clientY,c=n?u-s.left-i-a/2:l-s.top-o-a/2,f=e.validateRange(c);e.updateThumbOffset(f)},e.onThumbMouseOver=function(){var t=e.cfg.theme.hover.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e.onThumbMouseOut=function(){var t=e.cfg.theme.default.thumbColor;e.getElementByLocalId("thumb").attr("stroke",t),e.draw()},e}return(0,Gw.__extends)(e,t),e.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var r=this.getValue(),n=(0,Uw.clamp)(r,t,e);r===n||this.get("isInit")||this.setValue(n)},e.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},e.prototype.setValue=function(t){var e=this.getRange(),r=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*(0,Uw.clamp)(t,e.min,e.max)}),this.delegateEmit("valuechange",{originalValue:r,value:this.getValue()})},e.prototype.getValue=function(){return(0,Uw.clamp)(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return(0,Gw.__assign)((0,Gw.__assign)({},e),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:zB})},e.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},e.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},e.prototype.initEvent=function(){this.bindEvents()},e.prototype.renderTrackShape=function(t){var e=this.cfg,r=e.trackLen,n=e.theme,i=void 0===n?{default:{}}:n,o=(0,Uw.deepMix)({},zB,i).default,a=o.lineCap,s=o.trackColor,u=o.size,l=(0,Uw.get)(this.cfg,"size",u),c=this.get("isHorizontal")?{x1:0+l/2,y1:l/2,x2:r-l/2,y2:l/2,lineWidth:l,stroke:s,lineCap:a}:{x1:l/2,y1:0+l/2,x2:l/2,y2:r-l/2,lineWidth:l,stroke:s,lineCap:a};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:c})},e.prototype.renderThumbShape=function(t){var e=this.cfg,r=e.thumbOffset,n=e.thumbLen,i=e.theme,o=(0,Uw.deepMix)({},zB,i).default,a=o.size,s=o.lineCap,u=o.thumbColor,l=(0,Uw.get)(this.cfg,"size",a),c=this.get("isHorizontal")?{x1:r+l/2,y1:l/2,x2:r+n-l/2,y2:l/2,lineWidth:l,stroke:u,lineCap:s,cursor:"default"}:{x1:l/2,y1:r+l/2,x2:l/2,y2:r+n-l/2,lineWidth:l,stroke:u,lineCap:s,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:c})},e.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp),t.findById(this.getElementId("track")).on("click",this.onTrackClick);var e=t.findById(this.getElementId("thumb"));e.on("mouseover",this.onThumbMouseOver),e.on("mouseout",this.onThumbMouseOut)},e.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},e.prototype.validateRange=function(t){var e=this.cfg,r=e.thumbLen,n=e.trackLen,i=t;return t+r>n?i=n-r:t+rt.x?t.x:e,r=rt.y?t.y:n,i=i=n&&t<=i}function iF(t,e){return"object"===rF(t)&&e.forEach(function(e){delete t[e]}),t}function oF(t,e,r){var n,i;void 0===e&&(e=[]),void 0===r&&(r=new Map);try{for(var o=(0,Gw.__values)(t),a=o.next();!a.done;a=o.next()){var s=a.value;r.has(s)||(e.push(s),r.set(s,!0))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e}var aF=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.x=t,this.y=e,this.height=n,this.width=r}return t.fromRange=function(e,r,n,i){return new t(e,r,n-e,i-r)},t.fromObject=function(e){return new t(e.minX,e.minY,e.width,e.height)},Object.defineProperty(t.prototype,"minX",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tl",{get:function(){return{x:this.x,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tr",{get:function(){return{x:this.maxX,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bl",{get:function(){return{x:this.x,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"br",{get:function(){return{x:this.maxX,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return{x:this.x+this.width/2,y:this.minY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return{x:this.maxX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return{x:this.x+this.width/2,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return{x:this.minX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),t.prototype.isEqual=function(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},t.prototype.contains=function(t){return t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.add=function(){for(var t=[],e=0;et.minX&&this.minYt.minY},t.prototype.size=function(){return this.width*this.height},t.prototype.isPointIn=function(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY},t}();function sF(t){if(t.isPolar&&!t.isTransposed)return(t.endAngle-t.startAngle)*t.getRadius();var e=t.convert({x:0,y:0}),r=t.convert({x:1,y:0});return Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2))}function uF(t,e){var r=t.getCenter();return Math.sqrt(Math.pow(e.x-r.x,2)+Math.pow(e.y-r.y,2))}function lF(t,e){var r=t.getCenter();return Math.atan2(e.y-r.y,e.x-r.x)}function cF(t,e){void 0===e&&(e=0);var r,n=t.start,i=t.end,o=t.getWidth(),a=t.getHeight();if(t.isPolar){var s=t.startAngle,u=t.endAngle,l=t.getCenter(),c=t.getRadius();return{type:"path",startState:{path:QB(l.x,l.y,c+e,s,s)},endState:function(t){var r=(u-s)*t+s;return{path:QB(l.x,l.y,c+e,s,r)}},attrs:{path:QB(l.x,l.y,c+e,s,u)}}}return r=t.isTransposed?{height:a+2*e}:{width:o+2*e},{type:"rect",startState:{x:n.x-e,y:i.y-e,width:t.isTransposed?o+2*e:0,height:t.isTransposed?0:a+2*e},endState:r,attrs:{x:n.x-e,y:i.y-e,width:o+2*e,height:a+2*e}}}var fF=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function hF(t,e,r,n){return void 0===e&&(e={}),e.type?e.type:"identity"!==t.type&&GN.includes(r)&&["interval"].includes(n)?"cat":t.isCategory?"cat":t.type}function pF(t,e,r){var n=e||[];if((0,Uw.isNumber)(t)||(0,Uw.isNil)((0,Uw.firstValue)(n,t))&&(0,Uw.isEmpty)(r))return new(WM("identity"))({field:t.toString(),values:[t]});var i=(0,Uw.valuesOfKey)(n,t);return new(WM((0,Uw.get)(r,"type",function(t){var e="linear";return fF.test(t)?e="timeCat":(0,Uw.isString)(t)&&(e="cat"),e}(i[0]))))((0,Gw.__assign)({field:t,values:i},r))}function dF(t){return t.alias||t.field}function yF(t,e,r){var n,i=t.values.length;if(1===i)n=[.5,1];else{var o=0;n=function(t){if(t.isPolar){var e=t.startAngle;return t.endAngle-e==2*Math.PI}return!1}(e)?e.isTransposed?[(o=1/i*(0,Uw.get)(r,"widthRatio.multiplePie",1/1.3))/2,1-o/2]:[0,1-1/i]:[o=1/i/2,1-o]}return n}function vF(t,e){var r={start:{x:0,y:0},end:{x:0,y:0}};t.isRect?r=function(t){var e,r;switch(t){case LN.TOP:e={x:0,y:1},r={x:1,y:1};break;case LN.RIGHT:e={x:1,y:0},r={x:1,y:1};break;case LN.BOTTOM:e={x:0,y:0},r={x:1,y:0};break;case LN.LEFT:e={x:0,y:0},r={x:0,y:1};break;default:e=r={x:0,y:0}}return{start:e,end:r}}(e):t.isPolar&&(r=function(t){var e,r;return t.isTransposed?(e={x:0,y:0},r={x:1,y:0}):(e={x:0,y:0},r={x:0,y:1}),{start:e,end:r}}(t));var n=r.start,i=r.end;return{start:t.convert(n),end:t.convert(i)}}function gF(t){var e=t.start,r=t.end;return e.x===r.x}function mF(t,e){var r=t.start,n=t.end;return gF(t)?(r.y-n.y)*(e.x-r.x)>0?1:-1:(n.x-r.x)*(r.y-e.y)>0?-1:1}function bF(t,e){var r=(0,Uw.get)(t,["components","axis"],{});return(0,Uw.deepMix)({},(0,Uw.get)(r,["common"],{}),(0,Uw.deepMix)({},(0,Uw.get)(r,[e],{})))}function xF(t,e,r){var n=(0,Uw.get)(t,["components","axis"],{});return(0,Uw.deepMix)({},(0,Uw.get)(n,["common","title"],{}),(0,Uw.deepMix)({},(0,Uw.get)(n,[e,"title"],{})),r)}function wF(t){var e=t.x,r=t.y,n=t.circleCenter,i=r.start>r.end,o=t.isTransposed?t.convert({x:i?0:1,y:0}):t.convert({x:0,y:i?0:1}),a=[o.x-n.x,o.y-n.y],s=[1,0],u=o.y>n.y?vS.angle(a,s):-1*vS.angle(a,s),l=u+(e.end-e.start);return{center:n,radius:Math.sqrt(Math.pow(o.x-n.x,2)+Math.pow(o.y-n.y,2)),startAngle:u,endAngle:l}}function _F(t,e){return(0,Uw.isBoolean)(t)?!1!==t&&{}:(0,Uw.get)(t,[e])}function SF(t,e){return(0,Uw.get)(t,"position",e)}function EF(t,e){return(0,Uw.get)(e,["title","text"],dF(t))}var kF=function(){function t(t,e){this.destroyed=!1,this.facets=[],this.view=t,this.cfg=(0,Uw.deepMix)({},this.getDefaultCfg(),e)}return t.prototype.init=function(){this.container||(this.container=this.createContainer());var t=this.view.getData();this.facets=this.generateFacets(t)},t.prototype.render=function(){this.renderViews()},t.prototype.update=function(){},t.prototype.clear=function(){this.clearFacetViews()},t.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},t.prototype.facetToView=function(t){var e=t.region,r=t.data,n=t.padding,i=void 0===n?this.cfg.padding:n,o=this.view.createView({region:e,padding:i});o.data(r||[]),t.view=o,this.beforeEachView(o,t);var a=this.cfg.eachView;return a&&a(o,t),this.afterEachView(o,t),o},t.prototype.createContainer=function(){return this.view.getLayer(IN.FORE).addGroup()},t.prototype.renderViews=function(){this.createFacetViews()},t.prototype.createFacetViews=function(){var t=this;return this.facets.map(function(e){return t.facetToView(e)})},t.prototype.clearFacetViews=function(){var t=this;(0,Uw.each)(this.facets,function(e){e.view&&(t.view.removeView(e.view),e.view=void 0)})},t.prototype.parseSpacing=function(){var t=this.view.viewBBox,e=t.width,r=t.height;return this.cfg.spacing.map(function(t,n){return(0,Uw.isNumber)(t)?t/(0===n?e:r):parseFloat(t)/100})},t.prototype.getFieldValues=function(t,e){var r=[],n={};return(0,Uw.each)(t,function(t){var i=t[e];(0,Uw.isNil)(i)||n[i]||(r.push(i),n[i]=!0)}),r},t.prototype.getRegion=function(t,e,r,n){var i=(0,Gw.__read)(this.parseSpacing(),2),o=i[0],a=i[1],s=(1+o)/(0===e?1:e)-o,u=(1+a)/(0===t?1:t)-a,l={x:(s+o)*r,y:(u+a)*n};return{start:l,end:{x:l.x+s,y:l.y+u}}},t.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},t.prototype.getDefaultTitleCfg=function(){return{style:{fontSize:14,fill:"#666",fontFamily:this.view.getTheme().fontFamily}}},t.prototype.processAxis=function(t,e){var r=t.getOptions(),n=r.coordinate,i=t.geometries;if("rect"===(0,Uw.get)(n,"type","rect")&&i.length){(0,Uw.isNil)(r.axes)&&(r.axes={});var o=r.axes,a=(0,Gw.__read)(i[0].getXYFields(),2),s=a[0],u=a[1],l=_F(o,s),c=_F(o,u);!1!==l&&(r.axes[s]=this.getXAxisOption(s,o,l,e)),!1!==c&&(r.axes[u]=this.getYAxisOption(u,o,c,e))}},t.prototype.getFacetDataFilter=function(t){return function(e){return(0,Uw.every)(t,function(t){var r=t.field,n=t.value;return!(!(0,Uw.isNil)(n)&&r)||e[r]===n})}},t}(),TF={},CF=function(t){return TF[(0,Uw.lowerCase)(t)]},OF=function(t,e){TF[(0,Uw.lowerCase)(t)]=e},AF=function(){function t(t,e){this.context=t,this.cfg=e,t.addAction(this)}return t.prototype.applyCfg=function(t){(0,Uw.assign)(this,t)},t.prototype.init=function(){this.applyCfg(this.cfg)},t.prototype.destroy=function(){this.context.removeAction(this),this.context=null},t}(),PF=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.execute=function(){this.callback&&this.callback(this.context)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.callback=null},e}(AF),MF={};function IF(t){var e=MF[t];return(0,Uw.get)(e,"ActionClass")}function LF(t,e,r){MF[t]={ActionClass:e,cfg:r}}function jF(t,e){for(var r=[t[0]],n=1,i=t.length;n=a[l]?1:0,h=c>Math.PI?1:0,p=r.convert(s),d=uF(r,p);if(d>=.5)if(c===2*Math.PI){var y={x:(s.x+a.x)/2,y:(s.y+a.y)/2},v=r.convert(y);u.push(["A",d,d,0,h,f,v.x,v.y]),u.push(["A",d,d,0,h,f,p.x,p.y])}else u.push(["A",d,d,0,h,f,p.x,p.y]);return u}(r,n,t)):o.push(jF(a,t));break;case"a":o.push(NF(a,t));break;case"z":default:o.push(a)}}),function(t){(0,Uw.each)(t,function(e,r){if("a"===e[0].toLowerCase()){var n=t[r-1],i=t[r+1];i&&"a"===i[0].toLowerCase()?n&&"l"===n[0].toLowerCase()&&(n[0]="M"):n&&"a"===n[0].toLowerCase()&&i&&"l"===i[0].toLowerCase()&&(i[0]="M")}})}(o),o}function GF(t,e){return VF(t.event.target,e)}function UF(t,e){var r=t.getCanvasBBox(),n=r.width,i=r.height;return n>0&&i>0&&(n>=e||i>=e)}function VF(t,e){var r=t.getCanvasBBox();return UF(t,e)?r:null}function HF(t,e){return t.event.maskShapes.map(function(t){return VF(t,e)}).filter(function(t){return!!t})}function WF(t,e){return UF(t,e)?t.attr("path"):null}function qF(t){var e,r=t.event.target;return r&&(e=r.get("element")),e}function YF(t){var e,r=t.event.target;return r&&(e=r.get("delegateObject")),e}function XF(t){var e=t.event.gEvent;return!(e&&e.fromShape&&e.toShape&&e.fromShape.get("element")===e.toShape.get("element"))}function ZF(t){return t&&t.component&&t.component.isList()}function KF(t){return t&&t.component&&t.component.isSlider()}function JF(t){var e=t.event.target;return e&&"mask"===(null===e||void 0===e?void 0:e.get("name"))||QF(t)}function QF(t){var e;return"multi-mask"===(null===(e=t.event.target)||void 0===e?void 0:e.get("name"))}function $F(t,e){var r=t.event.target;if(QF(t))return function(t,e){if("path"===t.event.target.get("type")){var r=function(t,e){return t.event.maskShapes.map(function(t){return WF(t,e)})}(t,e);return r.length>0?r.flatMap(function(e){return sz(t.view,e)}):null}var n=HF(t,e);if(n.length>0)return n.flatMap(function(e){return oz(t.view,e)});return null}(t,e);if("path"===r.get("type")){var n=function(t,e){return WF(t.event.target,e)}(t,e);if(!n)return;return sz(t.view,n)}var i=GF(t,e);return i?oz(t.view,i):null}function tz(t,e,r){if(QF(t))return function(t,e,r){var n=HF(t,r);if(n.length>0)return n.flatMap(function(r){return ez(r,t,e)});return null}(t,e,r);var n=GF(t,r);return n?ez(n,t,e):null}function ez(t,e,r){var n=e.view,i=hz(n,r,{x:t.x,y:t.y}),o=hz(n,r,{x:t.maxX,y:t.maxY});return oz(r,{minX:i.x,minY:i.y,maxX:o.x,maxY:o.y})}function rz(t){var e=t.geometries,r=[];return(0,Uw.each)(e,function(t){var e=t.elements;r=r.concat(e)}),t.views&&t.views.length&&(0,Uw.each)(t.views,function(t){r=r.concat(rz(t))}),r}function nz(t,e){var r=t.geometries,n=[];return(0,Uw.each)(r,function(t){var r=t.getElementsBy(function(t){return t.hasState(e)});n=n.concat(r)}),n}function iz(t,e){var r=t.getModel().data;return(0,Uw.isArray)(r)?r[0][e]:r[e]}function oz(t,e){var r=rz(t),n=[];return(0,Uw.each)(r,function(t){var r,i,o=t.shape.getCanvasBBox();r=e,(i=o).minX>r.maxX||i.maxXr.maxY||i.maxY=e.x&&t.y<=e.y&&t.maxY>e.y}function fz(t){var e=t.parent,r=null;return e&&(r=e.views.filter(function(e){return e!==t})),r}function hz(t,e,r){var n=function(t,e){return t.getCoordinate().invert(e)}(t,r);return e.getCoordinate().convert(n)}function pz(t,e,r,n){var i=!1;return(0,Uw.each)(t,function(t){if(t[r]===e[r]&&t[n]===e[n])return i=!0,!1}),i}function dz(t,e){var r=t.getScaleByField(e);return!r&&t.views&&(0,Uw.each)(t.views,function(t){if(r=dz(t,e))return!1}),r}var yz=function(){function t(t){this.actions=[],this.event=null,this.cacheMap={},this.view=t}return t.prototype.cache=function(){for(var t=[],e=0;e=0&&e.splice(r,1)},t.prototype.getCurrentPoint=function(){var t=this.event;return t?t.target instanceof HTMLElement?this.view.getCanvas().getPointByClient(t.clientX,t.clientY):{x:t.x,y:t.y}:null},t.prototype.getCurrentShape=function(){return(0,Uw.get)(this.event,["gEvent","shape"])},t.prototype.isInPlot=function(){var t=this.getCurrentPoint();return!!t&&this.view.isPointInPlot(t)},t.prototype.isInShape=function(t){var e=this.getCurrentShape();return!!e&&e.get("name")===t},t.prototype.isInComponent=function(t){var e=uz(this.view),r=this.getCurrentPoint();return!!r&&!!e.find(function(e){var n=e.getBBox();return t?e.get("name")===t&&cz(n,r):cz(n,r)})},t.prototype.destroy=function(){(0,Uw.each)(this.actions.slice(),function(t){t.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},t}(),vz=function(){function t(t,e){this.view=t,this.cfg=e}return t.prototype.init=function(){this.initEvents()},t.prototype.initEvents=function(){},t.prototype.clearEvents=function(){},t.prototype.destroy=function(){this.clearEvents()},t}();function gz(t,e,r){var n=t.split(":"),i=n[0],o=e.getAction(i)||function(t,e){var r=MF[t],n=null;return r&&((n=new(0,r.ActionClass)(e,r.cfg)).name=t,n.init()),n}(i,e);if(!o)throw new Error("There is no action named ".concat(i));return{action:o,methodName:n[1],arg:r}}function mz(t){var e=t.action,r=t.methodName,n=t.arg;if(!e[r])throw new Error("Action(".concat(e.name,") doesn't have a method called ").concat(r));e[r](n)}var bz="start",xz="showEnable",wz="end",_z="rollback",Sz="processing",Ez=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.callbackCaches={},n.emitCaches={},n.steps=r,n}return(0,Gw.__extends)(e,t),e.prototype.init=function(){this.initContext(),t.prototype.init.call(this)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},e.prototype.initEvents=function(){var t=this;(0,Uw.each)(this.steps,function(e,r){(0,Uw.each)(e,function(e){var n=t.getActionCallback(r,e);n&&t.bindEvent(e.trigger,n)})})},e.prototype.clearEvents=function(){var t=this;(0,Uw.each)(this.steps,function(e,r){(0,Uw.each)(e,function(e){var n=t.getActionCallback(r,e);n&&t.offEvent(e.trigger,n)})})},e.prototype.initContext=function(){var t=this.view,e=new yz(t);this.context=e;var r=this.steps;(0,Uw.each)(r,function(t){(0,Uw.each)(t,function(t){if((0,Uw.isFunction)(t.action))t.actionObject={action:function(t,e){var r=new PF(e);return r.callback=t,r.name="callback",r}(t.action,e),methodName:"execute"};else if((0,Uw.isString)(t.action))t.actionObject=gz(t.action,e,t.arg);else if((0,Uw.isArray)(t.action)){var r=t.action,n=(0,Uw.isArray)(t.arg)?t.arg:[t.arg];t.actionObject=[],(0,Uw.each)(r,function(r,i){t.actionObject.push(gz(r,e,n[i]))})}})})},e.prototype.isAllowStep=function(t){var e=this.currentStepName,r=this.steps;if(e===t)return!0;if(t===xz)return!0;if(t===Sz)return e===bz;if(t===bz)return e!==Sz;if(t===wz)return e===Sz||e===bz;if(t===_z){if(r[wz])return e===wz;if(e===bz)return!0}return!1},e.prototype.isAllowExecute=function(t,e){if(this.isAllowStep(t)){var r=this.getKey(t,e);return(!e.once||!this.emitCaches[r])&&(!e.isEnable||e.isEnable(this.context))}return!1},e.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},e.prototype.afterExecute=function(t,e){t!==xz&&this.currentStepName!==t&&this.enterStep(t);var r=this.getKey(t,e);this.emitCaches[r]=!0},e.prototype.getKey=function(t,e){return t+e.trigger+e.action},e.prototype.getActionCallback=function(t,e){var r=this,n=this.context,i=this.callbackCaches,o=e.actionObject;if(e.action&&o){var a=this.getKey(t,e);if(!i[a]){var s=function(i){n.event=i,r.isAllowExecute(t,e)?((0,Uw.isArray)(o)?(0,Uw.each)(o,function(t){n.event=i,mz(t)}):(n.event=i,mz(o)),r.afterExecute(t,e),e.callback&&(n.event=i,e.callback(n))):n.event=null};e.debounce?i[a]=(0,Uw.debounce)(s,e.debounce.wait,e.debounce.immediate):e.throttle?i[a]=(0,Uw.throttle)(s,e.throttle.wait,{leading:e.throttle.leading,trailing:e.throttle.trailing}):i[a]=s}return i[a]}return null},e.prototype.bindEvent=function(t,e){var r=t.split(":");"window"===r[0]?window.addEventListener(r[1],e):"document"===r[0]?document.addEventListener(r[1],e):this.view.on(t,e)},e.prototype.offEvent=function(t,e){var r=t.split(":");"window"===r[0]?window.removeEventListener(r[1],e):"document"===r[0]?document.removeEventListener(r[1],e):this.view.off(t,e)},e}(vz),kz={};function Tz(t){return kz[(0,Uw.lowerCase)(t)]}function Cz(t,e){kz[(0,Uw.lowerCase)(t)]=e}function Oz(t){var e,r={point:{default:{fill:t.pointFillColor,r:t.pointSize,stroke:t.pointBorderColor,lineWidth:t.pointBorder,fillOpacity:t.pointFillOpacity},active:{stroke:t.pointActiveBorderColor,lineWidth:t.pointActiveBorder},selected:{stroke:t.pointSelectedBorderColor,lineWidth:t.pointSelectedBorder},inactive:{fillOpacity:t.pointInactiveFillOpacity,strokeOpacity:t.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:t.hollowPointFillColor,lineWidth:t.hollowPointBorder,stroke:t.hollowPointBorderColor,strokeOpacity:t.hollowPointBorderOpacity,r:t.hollowPointSize},active:{stroke:t.hollowPointActiveBorderColor,strokeOpacity:t.hollowPointActiveBorderOpacity},selected:{lineWidth:t.hollowPointSelectedBorder,stroke:t.hollowPointSelectedBorderColor,strokeOpacity:t.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:t.hollowPointInactiveBorderOpacity}},area:{default:{fill:t.areaFillColor,fillOpacity:t.areaFillOpacity,stroke:null},active:{fillOpacity:t.areaActiveFillOpacity},selected:{fillOpacity:t.areaSelectedFillOpacity},inactive:{fillOpacity:t.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:t.hollowAreaBorderColor,lineWidth:t.hollowAreaBorder,strokeOpacity:t.hollowAreaBorderOpacity},active:{fill:null,lineWidth:t.hollowAreaActiveBorder},selected:{fill:null,lineWidth:t.hollowAreaSelectedBorder},inactive:{strokeOpacity:t.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:t.intervalFillColor,fillOpacity:t.intervalFillOpacity},active:{stroke:t.intervalActiveBorderColor,lineWidth:t.intervalActiveBorder},selected:{stroke:t.intervalSelectedBorderColor,lineWidth:t.intervalSelectedBorder},inactive:{fillOpacity:t.intervalInactiveFillOpacity,strokeOpacity:t.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:t.hollowIntervalFillColor,stroke:t.hollowIntervalBorderColor,lineWidth:t.hollowIntervalBorder,strokeOpacity:t.hollowIntervalBorderOpacity},active:{stroke:t.hollowIntervalActiveBorderColor,lineWidth:t.hollowIntervalActiveBorder,strokeOpacity:t.hollowIntervalActiveBorderOpacity},selected:{stroke:t.hollowIntervalSelectedBorderColor,lineWidth:t.hollowIntervalSelectedBorder,strokeOpacity:t.hollowIntervalSelectedBorderOpacity},inactive:{stroke:t.hollowIntervalInactiveBorderColor,lineWidth:t.hollowIntervalInactiveBorder,strokeOpacity:t.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:t.lineBorderColor,lineWidth:t.lineBorder,strokeOpacity:t.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:t.lineActiveBorder},selected:{lineWidth:t.lineSelectedBorder},inactive:{strokeOpacity:t.lineInactiveBorderOpacity}}},n=function(t){return{title:{autoRotate:!0,position:"center",spacing:t.axisTitleSpacing,style:{fill:t.axisTitleTextFillColor,fontSize:t.axisTitleTextFontSize,lineHeight:t.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily},iconStyle:{fill:t.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:t.axisLabelOffset,style:{fill:t.axisLabelFillColor,fontSize:t.axisLabelFontSize,lineHeight:t.axisLabelLineHeight,fontFamily:t.fontFamily}},line:{style:{lineWidth:t.axisLineBorder,stroke:t.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:t.axisGridBorderColor,lineWidth:t.axisGridBorder,lineDash:t.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:t.axisTickLineBorder,stroke:t.axisTickLineBorderColor},alignTick:!0,length:t.axisTickLineLength},subTickLine:null,animate:!0}}(t),i=function(t){return{title:null,marker:{symbol:"circle",spacing:t.legendMarkerSpacing,style:{r:t.legendCircleMarkerSize,fill:t.legendMarkerColor}},itemName:{spacing:5,style:{fill:t.legendItemNameFillColor,fontFamily:t.fontFamily,fontSize:t.legendItemNameFontSize,lineHeight:t.legendItemNameLineHeight,fontWeight:t.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:t.legendPageNavigatorMarkerSize,inactiveFill:t.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:t.legendPageNavigatorMarkerInactiveFillOpacity,fill:t.legendPageNavigatorMarkerFillColor,opacity:t.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:t.legendPageNavigatorTextFillColor,fontSize:t.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:t.legendItemSpacing,itemMarginBottom:t.legendItemMarginBottom,padding:t.legendPadding}}(t);return{background:t.backgroundColor,defaultColor:t.brandColor,subColor:t.subColor,semanticRed:t.paletteSemanticRed,semanticGreen:t.paletteSemanticGreen,padding:"auto",fontFamily:t.fontFamily,columnWidthRatio:.5,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:t.paletteQualitative10,colors20:t.paletteQualitative20,sequenceColors:t.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:function(t){var e=t.geometry.coordinate;if(e.isPolar&&e.isTransposed){var n=tF(t.getModel(),e),i=(n.startAngle+n.endAngle)/2,o=7.5*Math.cos(i),a=7.5*Math.sin(i);return{matrix:Yw.pd(null,[["t",o,a]])}}return r.interval.selected}}},"hollow-rect":{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},line:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},tick:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},funnel:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}},pyramid:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}}},line:{line:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},dot:{default:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:(0,Gw.__assign)((0,Gw.__assign)({},r.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vh:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hvh:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vhv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}}},polygon:{polygon:{default:{style:r.interval.default},active:{style:r.interval.active},inactive:{style:r.interval.inactive},selected:{style:r.interval.selected}}},point:{circle:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},square:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},bowtie:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},diamond:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},hexagon:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},triangle:{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},"triangle-down":{default:{style:r.point.default},active:{style:r.point.active},inactive:{style:r.point.inactive},selected:{style:r.point.selected}},"hollow-circle":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-square":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-bowtie":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-diamond":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-hexagon":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-triangle":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},"hollow-triangle-down":{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},cross:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},tick:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},plus:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},hyphen:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}},line:{default:{style:r.hollowPoint.default},active:{style:r.hollowPoint.active},inactive:{style:r.hollowPoint.inactive},selected:{style:r.hollowPoint.selected}}},area:{area:{default:{style:r.area.default},active:{style:r.area.active},inactive:{style:r.area.inactive},selected:{style:r.area.selected}},smooth:{default:{style:r.area.default},active:{style:r.area.active},inactive:{style:r.area.inactive},selected:{style:r.area.selected}},line:{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}},"smooth-line":{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}}},schema:{candle:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}},box:{default:{style:r.hollowInterval.default},active:{style:r.hollowInterval.active},inactive:{style:r.hollowInterval.inactive},selected:{style:r.hollowInterval.selected}}},edge:{line:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},vhv:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},arc:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}}},violin:{violin:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},smooth:{default:{style:r.line.default},active:{style:r.line.active},inactive:{style:r.line.inactive},selected:{style:r.line.selected}},hollow:{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}},"hollow-smooth":{default:{style:r.hollowArea.default},active:{style:r.hollowArea.active},inactive:{style:r.hollowArea.inactive},selected:{style:r.hollowArea.selected}}}},components:{axis:{common:n,top:{position:"top",grid:null,title:null,verticalLimitLength:.5},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:.5},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:(0,Uw.deepMix)({},n.grid,{line:{type:"line"}})},radius:{title:null,grid:(0,Uw.deepMix)({},n.grid,{line:{type:"circle"}})}},legend:{common:i,right:{layout:"vertical",padding:t.legendVerticalPadding},left:{layout:"vertical",padding:t.legendVerticalPadding},top:{layout:"horizontal",padding:t.legendHorizontalPadding},bottom:{layout:"horizontal",padding:t.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:t.sliderRailHeight,defaultLength:t.sliderRailWidth,style:{fill:t.sliderRailFillColor,stroke:t.sliderRailBorderColor,lineWidth:t.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:t.sliderLabelTextFillColor,fontSize:t.sliderLabelTextFontSize,lineHeight:t.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:t.fontFamily}},handler:{size:t.sliderHandlerWidth,style:{fill:t.sliderHandlerFillColor,stroke:t.sliderHandlerBorderColor}},slidable:!0,padding:i.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:t.tooltipCrosshairsBorderColor,lineWidth:t.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(e={},e["".concat(dB)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:t.tooltipContainerFillColor,opacity:t.tooltipContainerFillOpacity,boxShadow:t.tooltipContainerShadow,borderRadius:"".concat(t.tooltipContainerBorderRadius,"px"),color:t.tooltipTextFillColor,fontSize:"".concat(t.tooltipTextFontSize,"px"),fontFamily:t.fontFamily,lineHeight:"".concat(t.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},e["".concat(yB)]={marginBottom:"12px",marginTop:"12px"},e["".concat(vB)]={margin:0,listStyleType:"none",padding:0},e["".concat(gB)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},e["".concat(mB)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},e["".concat(bB)]={display:"inline-block",float:"right",marginLeft:"30px"},e)},annotation:{arc:{style:{stroke:t.annotationArcBorderColor,lineWidth:t.annotationArcBorder},animate:!0},line:{style:{stroke:t.annotationLineBorderColor,lineDash:t.annotationLineDash,lineWidth:t.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textAlign:"start",fontFamily:t.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:t.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:t.annotationRegionBorder,stroke:t.annotationRegionBorderColor,fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:t.brandColor,lineWidth:2}},line:{style:{stroke:t.annotationLineBorderColor,lineWidth:t.annotationLineBorder},length:t.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:t.annotationRegionFillColor,fillOpacity:t.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:t.annotationTextFillColor,stroke:t.annotationTextBorderColor,lineWidth:t.annotationTextBorder,fontSize:t.annotationTextFontSize,fontFamily:t.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:t.cSliderBackgroundFillColor,opacity:t.cSliderBackgroundFillOpacity},foregroundStyle:{fill:t.cSliderForegroundFillColor,opacity:t.cSliderForegroundFillOpacity},handlerStyle:{width:t.cSliderHandlerWidth,height:t.cSliderHandlerHeight,fill:t.cSliderHandlerFillColor,opacity:t.cSliderHandlerFillOpacity,stroke:t.cSliderHandlerBorderColor,lineWidth:t.cSliderHandlerBorder,radius:t.cSliderHandlerBorderRadius,highLightFill:t.cSliderHandlerHighlightFillColor},textStyle:{fill:t.cSliderTextFillColor,opacity:t.cSliderTextFillOpacity,fontSize:t.cSliderTextFontSize,lineHeight:t.cSliderTextLineHeight,fontWeight:t.cSliderTextFontWeight,stroke:t.cSliderTextBorderColor,lineWidth:t.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:t.scrollbarTrackFillColor,thumbColor:t.scrollbarThumbFillColor}},hover:{style:{thumbColor:t.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:t.labelFillColor,fontSize:t.labelFontSize,fontFamily:t.fontFamily,stroke:t.labelBorderColor,lineWidth:t.labelBorder},fillColorDark:t.labelFillColorDark,fillColorLight:t.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:t.innerLabelFillColor,fontSize:t.innerLabelFontSize,fontFamily:t.fontFamily,stroke:t.innerLabelBorderColor,lineWidth:t.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:t.overflowLabelFillColor,fontSize:t.overflowLabelFontSize,fontFamily:t.fontFamily,stroke:t.overflowLabelBorderColor,lineWidth:t.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:t.labelLineBorder}},autoRotate:!0}}}var Az="#000",Pz="#595959",Mz="#8C8C8C",Iz="#BFBFBF",Lz="#D9D9D9",jz="#F0F0F0",Nz="#FFFFFF",Rz="#D9D9D9",Dz=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],Bz=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],Fz=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],zz=function(t){void 0===t&&(t={});var e=t.paletteQualitative10,r=void 0===e?Dz:e,n=t.paletteQualitative20,i=void 0===n?Bz:n,o=t.brandColor,a=void 0===o?r[0]:o,s={backgroundColor:"transparent",brandColor:a,subColor:"rgba(0,0,0,0.05)",paletteQualitative10:r,paletteQualitative20:i,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:Fz,fontFamily:'"Segoe UI", Roboto, "Helvetica Neue", Arial,\n "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",\n "Noto Color Emoji"',axisLineBorderColor:Iz,axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:Pz,axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:Rz,axisTickLineBorderColor:Iz,axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:Lz,axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:Mz,axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:Lz,axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:Mz,legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:a,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:Pz,legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:Az,legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:Az,legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:Mz,legendPageNavigatorTextFontSize:12,sliderRailFillColor:Lz,sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:Mz,sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:jz,sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:Iz,annotationArcBorderColor:Lz,annotationArcBorder:1,annotationLineBorderColor:Iz,annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:Pz,annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:Az,annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:Iz,tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:Pz,tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:Pz,labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:Nz,innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:Pz,overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:Nz,overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:Iz,cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:a,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:Nz,pointBorderOpacity:1,pointActiveBorderColor:Az,pointSelectedBorder:2,pointSelectedBorderColor:Az,pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:a,hollowPointBorderOpacity:.95,hollowPointFillColor:Nz,hollowPointActiveBorder:1,hollowPointActiveBorderColor:Az,hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:Az,hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:a,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:a,areaFillOpacity:.25,areaActiveFillColor:a,areaActiveFillOpacity:.5,areaSelectedFillColor:a,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:a,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:Az,hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:Az,hollowAreaInactiveBorderOpacity:.3,intervalFillColor:a,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:Az,intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:Az,intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:a,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:Nz,hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:Az,hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:Az,hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return(0,Gw.__assign)((0,Gw.__assign)({},s),t)};zz();function Gz(t){var e=t.styleSheet,r=void 0===e?{}:e,n=(0,Gw.__rest)(t,["styleSheet"]),i=zz(r);return(0,Uw.deepMix)({},Oz(i),n)}var Uz={default:Gz({})};function Vz(t){return(0,Uw.get)(Uz,(0,Uw.lowerCase)(t),Uz.default)}function Hz(t,e){Uz[(0,Uw.lowerCase)(t)]=Gz(e)}function Wz(t,e,r){var n=r.translate(t),i=r.translate(e);return(0,Uw.isNumberEqual)(n,i)}function qz(t,e,r){var n=r.coordinate,i=r.getYScale(),o=i.field,a=n.invert(e),s=i.invert(a.y);return(0,Uw.find)(t,function(t){var e=t[UN];return e[o][0]<=s&&e[o][1]>=s})||t[t.length-1]}var Yz=(0,Uw.memoize)(function(t){if(t.isCategory)return 1;for(var e=t.values,r=e.length,n=t.translate(e[0]),i=n,o=0;oi&&(i=s)}return(i-n)/(r-1)});function Xz(t){var e,r,n,i=function(t){var e=(0,Uw.values)(t.attributes);return(0,Uw.filter)(e,function(t){return(0,Uw.contains)(GN,t.type)})}(t);try{for(var o=(0,Gw.__values)(i),a=o.next();!a.done;a=o.next()){var s=a.value,u=s.getScale(s.type);if(u&&u.isLinear)if("cat"!==hF(u,(0,Uw.get)(t.scaleDefs,u.field),s.type,t.type)){n=u;break}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}var l=t.getXScale(),c=t.getYScale();return n||c||l}function Zz(t,e,r){if(0===e.length)return null;var n=r.type,i=r.getXScale(),o=r.getYScale(),a=i.field,s=o.field,u=null;if("heatmap"===n||"point"===n){for(var l=r.coordinate.invert(t),c=i.invert(l.x),f=o.invert(l.y),h=1/0,p=0;p(1+o)/2&&(s=a),n.translate(n.invert(s))}(t,r),x=g[UN][a],w=g[UN][s],_=m[UN][a],S=o.isLinear&&(0,Uw.isArray)(w);if((0,Uw.isArray)(x)){for(p=0;p=b){if(!S){u=A;break}(0,Uw.isArray)(u)||(u=[]),u.push(A)}}(0,Uw.isArray)(u)&&(u=qz(u,t,r))}else{var E=void 0;if(i.isLinear||"timeCat"===i.type){if((b>i.translate(_)||bi.max||bMath.abs(i.translate(E[UN][a])-b)&&(m=E)}var P=Yz(r.getXScale());return!u&&Math.abs(i.translate(m[UN][a])-b)<=P/2&&(u=m),u}function Kz(t,e,r,n){var i,o;void 0===r&&(r=""),void 0===n&&(n=!1);var a,s=t[UN],u=function(t,e,r){var n=e.getAttribute("position").getFields(),i=e.scales,o=(0,Uw.isFunction)(r)||!r?n[0]:r,a=i[o],s=a?a.getText(t[o]):t[o]||o;return(0,Uw.isFunction)(r)?r(s,t):s}(s,e,r),l=e.tooltipOption,c=e.theme.defaultColor,f=[];function h(e,r){if(n||!(0,Uw.isNil)(r)&&""!==r){var i={title:u,data:s,mappingData:t,name:e,value:r,color:t.color||c,marker:!0};f.push(i)}}if((0,Uw.isObject)(l)){var p=l.fields,d=l.callback;if(d){var y=p.map(function(e){return t[UN][e]}),v=d.apply(void 0,(0,Gw.__spreadArray)([],(0,Gw.__read)(y),!1)),g=(0,Gw.__assign)({data:t[UN],mappingData:t,title:u,color:t.color||c,marker:!0},v);f.push(g)}else{var m=e.scales;try{for(var b=(0,Gw.__values)(p),x=b.next();!x.done;x=b.next()){var w=x.value;if(!(0,Uw.isNil)(s[w])){var _=m[w];h(dF(_),a=_.getText(s[w]))}}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}}}else{var S=Xz(e);a=function(t,e){var r=t[e.field];return(0,Uw.isArray)(r)?r.map(function(t){return e.getText(t)}).join("-"):e.getText(r)}(s,S),h(function(t,e){var r,n=e.getGroupScales();if(n.length&&(r=n[0]),r){var i=r.field;return r.getText(t[i])}return dF(Xz(e))}(s,e),a)}return f}function Jz(t,e,r,n){var i,o,a=n.showNil,s=[],u=t.dataArray;if(!(0,Uw.isEmpty)(u)){t.sort(u);try{for(var l=(0,Gw.__values)(u),c=l.next();!c.done;c=l.next()){var f=Zz(e,c.value,t);if(f){var h=t.getElementId(f),p=t.elementsMap[h];if("heatmap"===t.type||p.visible){var d=Kz(f,t,r,a);d.length&&s.push(d)}}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}return s}function Qz(t,e,r,n){var i=n.showNil,o=[],a=t.container.getShape(e.x,e.y);if(a&&a.get("visible")&&a.get("origin")){var s=Kz(a.get("origin").mappingData,t,r,i);s.length&&o.push(s)}return o}function $z(t,e,r){var n,i,o=[],a=t.geometries,s=r.shared,u=r.title,l=r.reversed;try{for(var c=(0,Gw.__values)(a),f=c.next();!f.done;f=c.next()){var h=f.value;if(h.visible&&!1!==h.tooltipOption){var p=h.type,d=void 0;(d=["point","edge","polygon"].includes(p)?Qz(h,e,u,r):["area","line","path","heatmap"].includes(p)?Jz(h,e,u,r):!1!==s?Jz(h,e,u,r):Qz(h,e,u,r)).length&&(l&&d.reverse(),o.push(d))}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return o}function tG(t){void 0===t&&(t=0);var e=(0,Uw.isArray)(t)?t:[t];switch(e.length){case 0:e=[0,0,0,0];break;case 1:e=new Array(4).fill(e[0]);break;case 2:e=(0,Gw.__spreadArray)((0,Gw.__spreadArray)([],(0,Gw.__read)(e),!1),(0,Gw.__read)(e),!1);break;case 3:e=(0,Gw.__spreadArray)((0,Gw.__spreadArray)([],(0,Gw.__read)(e),!1),[e[1]],!1);break;default:e=e.slice(0,4)}return e}var eG={};function rG(t,e){eG[t]=e}var nG=function(){function t(t){this.option=this.wrapperOption(t)}return t.prototype.update=function(t){return this.option=this.wrapperOption(t),this},t.prototype.hasAction=function(t){var e=this.option.actions;return(0,Uw.some)(e,function(e){return e[0]===t})},t.prototype.create=function(t,e){var r=this.option,n=r.type,i=r.cfg,o="theta"===n,a=(0,Gw.__assign)({start:t,end:e},i),s=function(t){return RR[t.toLowerCase()]}(o?"polar":n);return this.coordinate=new s(a),this.coordinate.type=n,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},t.prototype.adjust=function(t,e){return this.coordinate.update({start:t,end:e}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},t.prototype.rotate=function(t){return this.option.actions.push(["rotate",t]),this},t.prototype.reflect=function(t){return this.option.actions.push(["reflect",t]),this},t.prototype.scale=function(t,e){return this.option.actions.push(["scale",t,e]),this},t.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},t.prototype.getOption=function(){return this.option},t.prototype.getCoordinate=function(){return this.coordinate},t.prototype.wrapperOption=function(t){return(0,Gw.__assign)({type:"rect",actions:[],cfg:{}},t)},t.prototype.execActions=function(t){var e=this,r=this.option.actions;(0,Uw.each)(r,function(r){var n,i=(0,Gw.__read)(r),o=i[0],a=i.slice(1);(!!(0,Uw.isNil)(t)||t.includes(o))&&(n=e.coordinate)[o].apply(n,(0,Gw.__spreadArray)([],(0,Gw.__read)(a),!1))})},t}(),iG=function(){function t(t,e,r){this.view=t,this.gEvent=e,this.data=r,this.type=e.type}return t.fromData=function(e,r,n){return new t(e,new CE.Event(r,{}),n)},Object.defineProperty(t.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),t.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},t.prototype.clone=function(){return new t(this.view,this.gEvent,this.data)},t}();function oG(t){var e=t.getController("axis"),r=t.getController("legend"),n=t.getController("annotation");[e,t.getController("slider"),t.getController("scrollbar"),r,n].forEach(function(t){t&&t.layout()})}var aG=function(){function t(){this.scales=new Map,this.syncScales=new Map}return t.prototype.createScale=function(t,e,r,n){var i=r,o=this.getScaleMeta(n);if(0===e.length&&o){var a=o.scale,s={type:a.type};a.isCategory&&(s.values=a.values),i=(0,Uw.deepMix)(s,o.scaleDef,r)}var u=pF(t,e,i);return this.cacheScale(u,r,n),u},t.prototype.sync=function(t,e){var r=this;this.syncScales.forEach(function(n,i){var o=Number.MAX_SAFE_INTEGER,a=Number.MIN_SAFE_INTEGER,s=[];(0,Uw.each)(n,function(t){var e=r.getScale(t);a=(0,Uw.isNumber)(e.max)?Math.max(a,e.max):a,o=(0,Uw.isNumber)(e.min)?Math.min(o,e.min):o,(0,Uw.each)(e.values,function(t){s.includes(t)||s.push(t)})}),(0,Uw.each)(n,function(n){var i=r.getScale(n);if(i.isContinuous)i.change({min:o,max:a,values:s});else if(i.isCategory){var u=i.range,l=r.getScaleMeta(n);s&&!(0,Uw.get)(l,["scaleDef","range"])&&(u=yF((0,Uw.deepMix)({},i,{values:s}),t,e)),i.change({values:s,range:u})}})})},t.prototype.cacheScale=function(t,e,r){var n=this.getScaleMeta(r);n&&n.scale.type===t.type?(!function(t,e){if("identity"!==t.type&&"identity"!==e.type){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);t.change(r)}}(n.scale,t),n.scaleDef=e):(n={key:r,scale:t,scaleDef:e},this.scales.set(r,n));var i=this.getSyncKey(n);if(n.syncKey=i,this.removeFromSyncScales(r),i){var o=this.syncScales.get(i);o||(o=[],this.syncScales.set(i,o)),o.push(r)}},t.prototype.getScale=function(t){var e=this.getScaleMeta(t);if(!e){var r=(0,Uw.last)(t.split("-")),n=this.syncScales.get(r);n&&n.length&&(e=this.getScaleMeta(n[0]))}return e&&e.scale},t.prototype.deleteScale=function(t){var e=this.getScaleMeta(t);if(e){var r=e.syncKey,n=this.syncScales.get(r);if(n&&n.length){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}}this.scales.delete(t)},t.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},t.prototype.removeFromSyncScales=function(t){var e=this;this.syncScales.forEach(function(r,n){var i=r.indexOf(t);if(-1!==i)return r.splice(i,1),0===r.length&&e.syncScales.delete(n),!1})},t.prototype.getSyncKey=function(t){var e=t.scale,r=t.scaleDef,n=e.field,i=(0,Uw.get)(r,["sync"]);return!0===i?n:!1===i?void 0:i},t.prototype.getScaleMeta=function(t){return this.scales.get(t)},t}(),sG=function(){function t(t,e,r,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),this.top=t,this.right=e,this.bottom=r,this.left=n}return t.instance=function(e,r,n,i){return void 0===e&&(e=0),void 0===r&&(r=0),void 0===n&&(n=0),void 0===i&&(i=0),new t(e,r,n,i)},t.prototype.max=function(t){var e=(0,Gw.__read)(t,4),r=e[0],n=e[1],i=e[2],o=e[3];return this.top=Math.max(this.top,r),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,i),this.left=Math.max(this.left,o),this},t.prototype.shrink=function(t){var e=(0,Gw.__read)(t,4),r=e[0],n=e[1],i=e[2],o=e[3];return this.top+=r,this.right+=n,this.bottom+=i,this.left+=o,this},t.prototype.inc=function(t,e){var r=t.width,n=t.height;switch(e){case LN.TOP:case LN.TOP_LEFT:case LN.TOP_RIGHT:this.top+=n;break;case LN.RIGHT:case LN.RIGHT_TOP:case LN.RIGHT_BOTTOM:this.right+=r;break;case LN.BOTTOM:case LN.BOTTOM_LEFT:case LN.BOTTOM_RIGHT:this.bottom+=n;break;case LN.LEFT:case LN.LEFT_TOP:case LN.LEFT_BOTTOM:this.left+=r}return this},t.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},t.prototype.clone=function(){return new(t.bind.apply(t,(0,Gw.__spreadArray)([void 0],(0,Gw.__read)(this.getPadding()),!1)))},t}();function uG(t){var e=t.padding;if(!function(t){return!(0,Uw.isNumber)(t)&&!(0,Uw.isArray)(t)}(e))return new(sG.bind.apply(sG,(0,Gw.__spreadArray)([void 0],(0,Gw.__read)(tG(e)),!1)));var r=t.viewBBox,n=new sG,i=[],o=[],a=[];return(0,Uw.each)(t.getComponents(),function(t){var e=t.type;e===jN.AXIS?i.push(t):[jN.LEGEND,jN.SLIDER,jN.SCROLLBAR].includes(e)?o.push(t):e!==jN.GRID&&e!==jN.TOOLTIP&&a.push(t)}),(0,Uw.each)(i,function(t){var e=t.component.getLayoutBBox(),i=new aF(e.x,e.y,e.width,e.height).exceed(r);n.max(i)}),(0,Uw.each)(o,function(t){var e=t.component,r=t.direction,i=e.getLayoutBBox(),o=e.get("padding"),a=new aF(i.x,i.y,i.width,i.height).expand(o);n.inc(a,r)}),(0,Uw.each)(a,function(t){var e=t.component,r=t.direction,i=e.getLayoutBBox(),o=new aF(i.x,i.y,i.width,i.height);n.inc(o,r)}),n}function lG(t,e,r){var n=r.instance();e.forEach(function(t){t.autoPadding=n.max(t.autoPadding.getPadding())})}var cG=function(t){function e(e){var r=t.call(this,{visible:e.visible})||this;r.views=[],r.geometries=[],r.controllers=[],r.interactions={},r.limitInPlot=!1,r.options={data:[],animate:!0},r.usedControllers=Object.keys(eG),r.scalePool=new aG,r.layoutFunc=oG,r.isPreMouseInPlot=!1,r.isDataChanged=!1,r.isCoordinateChanged=!1,r.createdScaleKeys=new Map,r.onCanvasEvent=function(t){var e=t.name;if(!e.includes(":")){var n=r.createViewEvent(t);r.doPlotEvent(n),r.emit(e,n)}},r.onDelegateEvents=function(t){var e=t.name;if(e.includes(":")){var n=r.createViewEvent(t);r.emit(e,n)}};var n=e.id,i=void 0===n?(0,Uw.uniqueId)("view"):n,o=e.parent,a=e.canvas,s=e.backgroundGroup,u=e.middleGroup,l=e.foregroundGroup,c=e.region,f=void 0===c?{start:{x:0,y:0},end:{x:1,y:1}}:c,h=e.padding,p=e.appendPadding,d=e.theme,y=e.options,v=e.limitInPlot,g=e.syncViewPadding;return r.parent=o,r.canvas=a,r.backgroundGroup=s,r.middleGroup=u,r.foregroundGroup=l,r.region=f,r.padding=h,r.appendPadding=p,r.options=(0,Gw.__assign)((0,Gw.__assign)({},r.options),y),r.limitInPlot=v,r.id=i,r.syncViewPadding=g,r.themeObject=(0,Uw.isObject)(d)?(0,Uw.deepMix)({},Vz("default"),Gz(d)):Vz(d),r.init(),r}return(0,Gw.__extends)(e,t),e.prototype.setLayout=function(t){this.layoutFunc=t},e.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},e.prototype.render=function(t,e){void 0===t&&(t=!1),this.emit(RN.BEFORE_RENDER,iG.fromData(this,RN.BEFORE_RENDER,e)),this.paint(t),this.emit(RN.AFTER_RENDER,iG.fromData(this,RN.AFTER_RENDER,e)),!1===this.visible&&this.changeVisible(!1)},e.prototype.clear=function(){var t=this;this.emit(RN.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var e=this.geometries,r=0;r
      ');k.appendChild(T);var C=ZN(k,s,i,o),O=new(qN(f).Canvas)((0,Gw.__assign)({container:T,pixelRatio:h,localRefresh:d,supportCSSTransform:m},C));return(r=t.call(this,{parent:null,canvas:O,backgroundGroup:O.addGroup({zIndex:zN.BG}),middleGroup:O.addGroup({zIndex:zN.MID}),foregroundGroup:O.addGroup({zIndex:zN.FORE}),padding:u,appendPadding:l,visible:v,options:w,limitInPlot:_,theme:S,syncViewPadding:E})||this).onResize=(0,Uw.debounce)(function(){r.forceFit()},300),r.ele=k,r.canvas=O,r.width=C.width,r.height=C.height,r.autoFit=s,r.localRefresh=d,r.renderer=f,r.wrapperElement=T,r.updateCanvasStyle(),r.bindAutoFit(),r.initDefaultInteractions(x),r}return(0,Gw.__extends)(e,t),e.prototype.initDefaultInteractions=function(t){var e=this;(0,Uw.each)(t,function(t){e.interaction(t)})},e.prototype.aria=function(t){!1===t?this.ele.removeAttribute("aria-label"):this.ele.setAttribute("aria-label",t.label)},e.prototype.changeSize=function(t,e){return this.width===t&&this.height===e?this:(this.emit(RN.BEFORE_CHANGE_SIZE),this.width=t,this.height=e,this.canvas.changeSize(t,e),this.render(!0),this.emit(RN.AFTER_CHANGE_SIZE),this)},e.prototype.clear=function(){t.prototype.clear.call(this),this.aria(!1)},e.prototype.destroy=function(){var e,r;t.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),e=this.wrapperElement,(r=e.parentNode)&&r.removeChild(e),this.wrapperElement=null},e.prototype.changeVisible=function(e){return t.prototype.changeVisible.call(this,e),this.wrapperElement.style.display=e?"":"none",this},e.prototype.forceFit=function(){if(!this.destroyed){var t=ZN(this.ele,!0,this.width,this.height),e=t.width,r=t.height;this.changeSize(e,r)}},e.prototype.updateCanvasStyle=function(){rP(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},e.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},e.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},e}(hG),dG=function(){function t(t){this.visible=!0,this.components=[],this.view=t}return t.prototype.clear=function(t){(0,Uw.each)(this.components,function(t){t.component.destroy()}),this.components=[]},t.prototype.destroy=function(){this.clear()},t.prototype.getComponents=function(){return this.components},t.prototype.changeVisible=function(t){this.visible!==t&&(this.components.forEach(function(e){t?e.component.show():e.component.hide()}),this.visible=t)},t}();var yG=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isLocked=!1,e}return(0,Gw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"tooltip"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.isVisible=function(){return!1!==this.view.getOptions().tooltip},e.prototype.render=function(){},e.prototype.showTooltip=function(t){if(this.point=t,this.isVisible()){var e=this.view,r=this.getTooltipItems(t);if(r.length){var n=this.getTitle(r),i={x:r[0].x,y:r[0].y};e.emit("tooltip:show",iG.fromData(e,"tooltip:show",(0,Gw.__assign)({items:r,title:n},t)));var o=this.getTooltipCfg(),a=o.follow,s=o.showMarkers,u=o.showCrosshairs,l=o.showContent,c=o.marker,f=this.items,h=this.title;if((0,Uw.isEqual)(h,n)&&(0,Uw.isEqual)(f,r)?(this.tooltip&&a&&(this.tooltip.update(t),this.tooltip.show()),this.tooltipMarkersGroup&&this.tooltipMarkersGroup.show()):(e.emit("tooltip:change",iG.fromData(e,"tooltip:change",(0,Gw.__assign)({items:r,title:n},t))),((0,Uw.isFunction)(l)?l(r):l)&&(this.tooltip||this.renderTooltip(),this.tooltip.update((0,Uw.mix)({},o,{items:this.getItemsAfterProcess(r),title:n},a?t:{})),this.tooltip.show()),s&&this.renderTooltipMarkers(r,c)),this.items=r,this.title=n,u){var p=(0,Uw.get)(o,["crosshairs","follow"],!1);this.renderCrosshairs(p?t:i,o)}}else this.hideTooltip()}},e.prototype.hideTooltip=function(){if(this.getTooltipCfg().follow){var t=this.tooltipMarkersGroup;t&&t.hide();var e=this.xCrosshair,r=this.yCrosshair;e&&e.hide(),r&&r.hide();var n=this.tooltip;n&&n.hide(),this.view.emit("tooltip:hide",iG.fromData(this.view,"tooltip:hide",{})),this.point=null}else this.point=null},e.prototype.lockTooltip=function(){this.isLocked=!0,this.tooltip&&this.tooltip.setCapture(!0)},e.prototype.unlockTooltip=function(){this.isLocked=!1;var t=this.getTooltipCfg();this.tooltip&&this.tooltip.setCapture(t.capture)},e.prototype.isTooltipLocked=function(){return this.isLocked},e.prototype.clear=function(){var t=this.tooltip,e=this.xCrosshair,r=this.yCrosshair,n=this.tooltipMarkersGroup;t&&(t.hide(),t.clear()),e&&e.clear(),r&&r.clear(),n&&n.clear(),(null===t||void 0===t?void 0:t.get("customContent"))&&(this.tooltip.destroy(),this.tooltip=null),this.title=null,this.items=null},e.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),this.xCrosshair&&this.xCrosshair.destroy(),this.yCrosshair&&this.yCrosshair.destroy(),this.guideGroup&&this.guideGroup.remove(!0),this.reset()},e.prototype.reset=function(){this.items=null,this.title=null,this.tooltipMarkersGroup=null,this.tooltipCrosshairsGroup=null,this.xCrosshair=null,this.yCrosshair=null,this.tooltip=null,this.guideGroup=null,this.isLocked=!1,this.point=null},e.prototype.changeVisible=function(t){if(this.visible!==t){var e=this.tooltip,r=this.tooltipMarkersGroup,n=this.xCrosshair,i=this.yCrosshair;t?(e&&e.show(),r&&r.show(),n&&n.show(),i&&i.show()):(e&&e.hide(),r&&r.hide(),n&&n.hide(),i&&i.hide()),this.visible=t}},e.prototype.getTooltipItems=function(t){var e,r,n,i,o,a,s=this.findItemsFromView(this.view,t);if(s.length){s=(0,Uw.flatten)(s);try{for(var u=(0,Gw.__values)(s),l=u.next();!l.done;l=u.next()){var c=l.value;try{for(var f=(n=void 0,(0,Gw.__values)(c)),h=f.next();!h.done;h=f.next()){var p=h.value,d=p.mappingData,y=d.x,v=d.y;p.x=(0,Uw.isArray)(y)?y[y.length-1]:y,p.y=(0,Uw.isArray)(v)?v[v.length-1]:v}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(!1===this.getTooltipCfg().shared&&s.length>1){var g=s[0],m=Math.abs(t.y-g[0].y);try{for(var b=(0,Gw.__values)(s),x=b.next();!x.done;x=b.next()){var w=x.value,_=Math.abs(t.y-w[0].y);_<=m&&(g=w,m=_)}}catch(t){o={error:t}}finally{try{x&&!x.done&&(a=b.return)&&a.call(b)}finally{if(o)throw o.error}}s=[g]}return function(t){for(var e=[],r=function(r){var n=t[r];(0,Uw.find)(e,function(t){return t.color===n.color&&t.name===n.name&&t.value===n.value&&t.title===n.title})||e.push(n)},n=0;n'+n+"":n}})},e.prototype.getTitle=function(t){var e=t[0].title||t[0].name;return this.title=e,e},e.prototype.renderTooltip=function(){var t=this.view.getCanvas(),e={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},r=this.getTooltipCfg(),n=new XB((0,Gw.__assign)((0,Gw.__assign)({parent:t.get("el").parentNode,region:e},r),{visible:!1,crosshairs:null}));n.init(),this.tooltip=n},e.prototype.renderTooltipMarkers=function(t,e){var r,n,i=this.getTooltipMarkersGroup(),o=this.view.getRootView(),a=o.limitInPlot;try{for(var s=(0,Gw.__values)(t),u=s.next();!u.done;u=s.next()){var l=u.value,c=l.x,f=l.y;if(a||(null===i||void 0===i?void 0:i.getClip())){var h=cF(o.getCoordinate()),p=h.type,d=h.attrs;null===i||void 0===i||i.setClip({type:p,attrs:d})}else null===i||void 0===i||i.setClip(void 0);var y=this.view.getTheme(),v=(0,Uw.get)(y,["components","tooltip","marker"],{}),g=(0,Gw.__assign)((0,Gw.__assign)({fill:l.color,symbol:"circle",shadowColor:l.color},(0,Uw.isFunction)(e)?(0,Gw.__assign)((0,Gw.__assign)({},v),e(l)):e),{x:c,y:f});i.addShape("marker",{attrs:g})}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}},e.prototype.renderCrosshairs=function(t,e){var r=(0,Uw.get)(e,["crosshairs","type"],"x");"x"===r?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,e)):"y"===r?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,e)):"xy"===r&&(this.renderXCrosshairs(t,e),this.renderYCrosshairs(t,e))},e.prototype.renderXCrosshairs=function(t,e){var r,n,i=this.getViewWithGeometry(this.view).getCoordinate();if(i.isRect)i.isTransposed?(r={x:i.start.x,y:t.y},n={x:i.end.x,y:t.y}):(r={x:t.x,y:i.end.y},n={x:t.x,y:i.start.y});else{var o=lF(i,t),a=i.getCenter(),s=i.getRadius();n=JB(a.x,a.y,s,o),r=a}var u=(0,Uw.deepMix)({start:r,end:n,container:this.getTooltipCrosshairsGroup()},(0,Uw.get)(e,"crosshairs",{}),this.getCrosshairsText("x",t,e));delete u.type;var l=this.xCrosshair;l?l.update(u):(l=new tB(u)).init(),l.render(),l.show(),this.xCrosshair=l},e.prototype.renderYCrosshairs=function(t,e){var r,n,i=this.getViewWithGeometry(this.view).getCoordinate();if(i.isRect){var o=void 0,a=void 0;i.isTransposed?(o={x:t.x,y:i.end.y},a={x:t.x,y:i.start.y}):(o={x:i.start.x,y:t.y},a={x:i.end.x,y:t.y}),r={start:o,end:a},n="Line"}else r={center:i.getCenter(),radius:uF(i,t),startAngle:i.startAngle,endAngle:i.endAngle},n="Circle";delete(r=(0,Uw.deepMix)({container:this.getTooltipCrosshairsGroup()},r,(0,Uw.get)(e,"crosshairs",{}),this.getCrosshairsText("y",t,e))).type;var s=this.yCrosshair;s?i.isRect&&"circle"===s.get("type")||!i.isRect&&"line"===s.get("type")?(s=new E[n](r)).init():s.update(r):(s=new E[n](r)).init(),s.render(),s.show(),this.yCrosshair=s},e.prototype.getCrosshairsText=function(t,e,r){var n=(0,Uw.get)(r,["crosshairs","text"]),i=(0,Uw.get)(r,["crosshairs","follow"]),o=this.items;if(n){var a=this.getViewWithGeometry(this.view),s=o[0],u=a.getXScale(),l=a.getYScales()[0],c=void 0,f=void 0;if(i){var h=this.view.getCoordinate().invert(e);c=u.invert(h.x),f=l.invert(h.y)}else c=s.data[u.field],f=s.data[l.field];var p="x"===t?c:f;return(0,Uw.isFunction)(n)?n=n(t,p,o,e):n.content=p,{text:n}}},e.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},e.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):((t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"})).toFront(),this.tooltipMarkersGroup=t),t},e.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||((t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1})).toBack(),this.tooltipCrosshairsGroup=t),t},e.prototype.findItemsFromView=function(t,e){var r,n;if(!1===t.getOptions().tooltip)return[];var i=$z(t,e,this.getTooltipCfg());try{for(var o=(0,Gw.__values)(t.views),a=o.next();!a.done;a=o.next()){var s=a.value;i=i.concat(this.findItemsFromView(s,e))}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i},e.prototype.getViewWithGeometry=function(t){var e=this;return t.geometries.length?t:(0,Uw.find)(t.views,function(t){return e.getViewWithGeometry(t)})},e.prototype.getItemsAfterProcess=function(t){var e=this.getTooltipCfg().customItems;return(e||function(t){return t})(t)},e}(dG),vG={};function gG(t){return vG[t.toLowerCase()]}function mG(t,e){vG[t.toLowerCase()]=e}var bG={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},xG={interval:function(t){return{enter:{animation:t.isRect?t.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:t.isPolar&&t.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},wG={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(t){var e;return t.isRect?e=t.isTransposed?"grow-in-x":"grow-in-y":(e="grow-in-xy",t.isPolar&&t.isTransposed&&(e="wave-in")),{animation:e}},schema:function(t){return{animation:t.isRect?t.isTransposed?"grow-in-x":"grow-in-y":"grow-in-xy"}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function _G(t,e,r){var n=xG[t];return n&&((0,Uw.isFunction)(n)&&(n=n(e)),n=(0,Uw.deepMix)({},bG,n),r)?n[r]:n}function SG(t,e,r){var n=(0,Uw.get)(t.get("origin"),"data",UN),i=e.animation,o=function(t,e){return{delay:(0,Uw.isFunction)(t.delay)?t.delay(e):t.delay,easing:(0,Uw.isFunction)(t.easing)?t.easing(e):t.easing,duration:(0,Uw.isFunction)(t.duration)?t.duration(e):t.duration,callback:t.callback,repeat:t.repeat}}(e,n);if(i){var a=gG(i);a&&a(t,o,r)}else t.animate(r.toAttrs,o)}var EG=function(t){function e(e){var r=t.call(this,e)||this;r.labelShape=[],r.states=[];var n=e.shapeFactory,i=e.container,o=e.offscreenGroup,a=e.elementIndex,s=e.visible,u=void 0===s||s;return r.shapeFactory=n,r.container=i,r.offscreenGroup=o,r.visible=u,r.elementIndex=a,r}return(0,Gw.__extends)(e,t),e.prototype.draw=function(t,e){void 0===e&&(e=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,e),!1===this.visible&&this.changeVisible(!1)},e.prototype.update=function(t){var e=this.shapeFactory,r=this.shape;if(r){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(r,t);var n=this.getOffscreenGroup(),i=e.drawShape(this.shapeType,t,n);i.cfg.data=this.data,i.cfg.origin=t,i.cfg.element=this,this.syncShapeStyle(r,i,this.getStates(),this.getAnimateCfg("update"))}},e.prototype.destroy=function(){var e=this.shapeFactory,r=this.shape;if(r){var n=this.getAnimateCfg("leave");n?SG(r,n,{coordinate:e.coordinate,toAttrs:(0,Gw.__assign)({},r.attr())}):r.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=[],this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,t.prototype.destroy.call(this)},e.prototype.changeVisible=function(e){t.prototype.changeVisible.call(this,e),e?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(t){t.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(t){t.hide()}))},e.prototype.setState=function(t,e){var r=this,n=r.states,i=r.shapeFactory,o=r.model,a=r.shape,s=r.shapeType,u=n.indexOf(t);if(e){if(u>-1)return;n.push(t),"active"!==t&&"selected"!==t||null===a||void 0===a||a.toFront()}else{if(-1===u)return;if(n.splice(u,1),"active"===t||"selected"===t){var l=this.geometry,c=l.sortZIndex,f=l.zIndexReversed?this.geometry.elements.length-this.elementIndex:this.elementIndex;c?a.setZIndex(f):a.set("zIndex",f)}}var h=i.drawShape(s,o,this.getOffscreenGroup());n.length?this.syncShapeStyle(a,h,n,null):this.syncShapeStyle(a,h,["reset"],null),h.remove(!0);var p={state:t,stateStatus:e,element:this,target:this.container};this.container.emit("statechange",p),BR(this.shape,"statechange",p)},e.prototype.clearStates=function(){var t=this,e=this.states;(0,Uw.each)(e,function(e){t.setState(e,!1)}),this.states=[]},e.prototype.hasState=function(t){return this.states.includes(t)},e.prototype.getStates=function(){return this.states},e.prototype.getData=function(){return this.data},e.prototype.getModel=function(){return this.model},e.prototype.getBBox=function(){var t=this.shape,e=this.labelShape,r={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return t&&(r=t.getCanvasBBox()),e&&e.forEach(function(t){var e=t.getCanvasBBox();r.x=Math.min(e.x,r.x),r.y=Math.min(e.y,r.y),r.minX=Math.min(e.minX,r.minX),r.minY=Math.min(e.minY,r.minY),r.maxX=Math.max(e.maxX,r.maxX),r.maxY=Math.max(e.maxY,r.maxY)}),r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r},e.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this.shapeType,e=this.geometry,r=this.shapeFactory,n=e.stateOption,i=r.defaultShapeType,o=r.theme[t]||r.theme[i];this.statesStyle=(0,Uw.deepMix)({},o,n)}return this.statesStyle},e.prototype.getStateStyle=function(t,e){var r=this.getStatesStyle(),n=(0,Uw.get)(r,[t,"style"],{}),i=n[e]||n;return(0,Uw.isFunction)(i)?i(this):i},e.prototype.getAnimateCfg=function(t){var e=this,r=this.animate;if(r){var n=r[t];return n?(0,Gw.__assign)((0,Gw.__assign)({},n),{callback:function(){var t;(0,Uw.isFunction)(n.callback)&&n.callback(),null===(t=e.geometry)||void 0===t||t.emit(DN.AFTER_DRAW_ANIMATE)}}):n}return null},e.prototype.drawShape=function(t,e){var r;void 0===e&&(e=!1);var n=this.shapeFactory,i=this.container,o=this.shapeType;if(this.shape=n.drawShape(o,t,i),this.shape){this.setShapeInfo(this.shape,t);var a=this.shape.cfg.name;a?(0,Uw.isString)(a)&&(this.shape.cfg.name=["element",a]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var s=e?"enter":"appear",u=this.getAnimateCfg(s);u&&(null===(r=this.geometry)||void 0===r||r.emit(DN.BEFORE_DRAW_ANIMATE),SG(this.shape,u,{coordinate:n.coordinate,toAttrs:(0,Gw.__assign)({},this.shape.attr())}))}},e.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},e.prototype.setShapeInfo=function(t,e){var r=this;(t.cfg.origin=e,t.cfg.element=this,t.isGroup())&&t.get("children").forEach(function(t){r.setShapeInfo(t,e)})},e.prototype.syncShapeStyle=function(t,e,r,n,i){var o,a=this;if(void 0===r&&(r=[]),void 0===i&&(i=0),t&&e){var s=t.get("clipShape"),u=e.get("clipShape");if(this.syncShapeStyle(s,u,r,n),t.isGroup())for(var l=t.get("children"),c=e.get("children"),f=0;f=0?e:r<=0?r:0},e.prototype.createAttrOption=function(t,e,r){if((0,Uw.isNil)(e)||(0,Uw.isObject)(e))(0,Uw.isObject)(e)&&(0,Uw.isEqual)(Object.keys(e),["values"])?(0,Uw.set)(this.attributeOption,t,{fields:e.values}):(0,Uw.set)(this.attributeOption,t,e);else{var n={};(0,Uw.isNumber)(e)?n.values=[e]:n.fields=BG(e),r&&((0,Uw.isFunction)(r)?n.callback=r:n.values=r),(0,Uw.set)(this.attributeOption,t,n)}},e.prototype.initAttributes=function(){var t=this,e=this.attributes,r=this.attributeOption,n=this.theme,i=this.shapeType;this.groupScales=[];var o={},a=function(a){if(r.hasOwnProperty(a)){var s=r[a];if(!s)return{value:void 0};var u=(0,Gw.__assign)({},s),l=u.callback,c=u.values,f=u.fields,h=(void 0===f?[]:f).map(function(e){var r=t.scales[e];!o[e]&&GN.includes(a)&&("cat"===hF(r,(0,Uw.get)(t.scaleDefs,e),a,t.type)&&(t.groupScales.push(r),o[e]=!0));return r});u.scales=h,"position"!==a&&1===h.length&&"identity"===h[0].type?u.values=h[0].values:l||c||("size"===a?u.values=n.sizes:"shape"===a?u.values=n.shapes[i]||[]:"color"===a&&(h.length?u.values=h[0].values.length<=10?n.colors10:n.colors20:u.values=n.colors10));var p=PR(a);e[a]=new p(u)}};for(var s in r){var u=a(s);if("object"===zG(u))return u.value}},e.prototype.processData=function(t){var e,r;this.hasSorted=!1;for(var n=this.getAttribute("position").scales.filter(function(t){return t.isCategory}),i=this.groupData(t),o=[],a=0,s=i.length;ao&&(o=l)}var c=this.scaleDefs,f={};it.max&&!(0,Uw.get)(c,[n,"max"])&&(f.max=o),t.change(f)},e.prototype.beforeMapping=function(t){var e=t;if(this.sortable&&this.sort(e),this.generatePoints)for(var r=0,n=e.length;r1)for(var c=0;c0})}var XG=function(){function t(t){this.shapesMap={};var e=t.layout,r=t.container;this.layout=e,this.container=r}return t.prototype.render=function(t,e,r){return void 0===r&&(r=!1),(0,Gw.__awaiter)(this,void 0,void 0,function(){var n,i,o,a,s,u,l,c,f=this;return(0,Gw.__generator)(this,function(h){switch(h.label){case 0:if(n={},i=this.createOffscreenGroup(),!t.length)return[3,2];try{for(o=(0,Gw.__values)(t),a=o.next();!a.done;a=o.next())(s=a.value)&&(n[s.id]=this.renderLabel(s,i))}catch(t){l={error:t}}finally{try{a&&!a.done&&(c=o.return)&&c.call(o)}finally{if(l)throw l.error}}return[4,this.doLayout(t,e,n)];case 1:h.sent(),this.renderLabelLine(t,n),this.renderLabelBackground(t,n),this.adjustLabel(t,n),h.label=2;case 2:return u=this.shapesMap,(0,Uw.each)(n,function(t,e){if(t.destroyed)delete n[e];else{if(u[e]){var i=t.get("data"),o=t.get("origin"),a=t.get("coordinate"),s=t.get("animateCfg"),l=u[e];!function t(e,r,n){var i=n.data,o=n.origin,a=n.animateCfg,s=n.coordinate,u=(0,Uw.get)(a,"update");e.set("data",i),e.set("origin",o),e.set("animateCfg",a),e.set("coordinate",s),e.set("visible",r.get("visible")),(e.getChildren()||[]).forEach(function(l,c){var f=r.getChildByIndex(c);if(f){l.set("data",i),l.set("origin",o),l.set("animateCfg",a),l.set("coordinate",s);var h=eF(l,f);u?SG(l,u,{toAttrs:h,coordinate:s}):l.attr(h),f.isGroup()&&t(l,f,n)}else e.removeChild(l),l.remove(!0)}),(0,Uw.each)(r.getChildren(),function(t,r){(0,Uw.isArray)(e.getChildren())&&r>=e.getCount()&&(t.destroyed||e.add(t))})}(l,n[e],{data:i,origin:o,animateCfg:s,coordinate:a}),n[e]=l}else{if(f.container.destroyed)return;f.container.add(t);var c=(0,Uw.get)(t.get("animateCfg"),r?"enter":"appear");c&&SG(t,c,{toAttrs:(0,Gw.__assign)({},t.attr()),coordinate:t.get("coordinate")})}delete u[e]}}),(0,Uw.each)(u,function(t){var e=(0,Uw.get)(t.get("animateCfg"),"leave");e?SG(t,e,{toAttrs:null,coordinate:t.get("coordinate")}):t.remove(!0)}),this.shapesMap=n,i.destroy(),[2]}})})},t.prototype.clear=function(){this.container.clear(),this.shapesMap={}},t.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},t.prototype.renderLabel=function(t,e){var r,n=t.id,i=t.elementId,o=t.data,a=t.mappingData,s=t.coordinate,u=t.animate,l=t.content,c={id:n,elementId:i,capture:t.capture,data:o,origin:(0,Gw.__assign)((0,Gw.__assign)({},a),{data:a[UN]}),coordinate:s},f=e.addGroup((0,Gw.__assign)({name:"label",animateCfg:!1!==this.animate&&null!==u&&!1!==u&&(0,Uw.deepMix)({},this.animate,u)},c));if(l.isGroup&&l.isGroup()||l.isShape&&l.isShape()){var h=l.getCanvasBBox(),p=h.width,d=h.height,y=(0,Uw.get)(t,"textAlign","left"),v=t.x,g=t.y-d/2;"center"===y?v-=p/2:"right"!==y&&"end"!==y||(v-=p),VG(l,v,g),r=l,f.add(l)}else{var m=(0,Uw.get)(t,["style","fill"]);r=f.addShape("text",(0,Gw.__assign)({attrs:(0,Gw.__assign)((0,Gw.__assign)({x:t.x,y:t.y,textAlign:t.textAlign,textBaseline:(0,Uw.get)(t,"textBaseline","middle"),text:t.content},t.style),{fill:(0,Uw.isNull)(m)?t.color:m})},c))}return t.rotate&&HG(r,t.rotate),f},t.prototype.doLayout=function(t,e,r){return(0,Gw.__awaiter)(this,void 0,void 0,function(){var n,i=this;return(0,Gw.__generator)(this,function(o){switch(o.label){case 0:return this.layout?(n=(0,Uw.isArray)(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(n){var o=AG((0,Uw.get)(n,"type",""));if(o){var a=[],s=[];return(0,Uw.each)(r,function(t,r){a.push(t),s.push(e[t.get("elementId")])}),o(t,a,s,i.region,n.cfg)}}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},t.prototype.renderLabelLine=function(t,e){(0,Uw.each)(t,function(t){var r=(0,Uw.get)(t,"coordinate");if(t&&r){var n=r.getCenter(),i=r.getRadius();if(t.labelLine){var o=(0,Uw.get)(t,"labelLine",{}),a=t.id,s=o.path;if(!s){var u=JB(n.x,n.y,i,t.angle);s=[["M",u.x,u.y],["L",t.x,t.y]]}var l=e[a];l.destroyed||l.addShape("path",{capture:!1,attrs:(0,Gw.__assign)({path:s,stroke:t.color?t.color:(0,Uw.get)(t,["style","fill"],"#000"),fill:null},o.style),id:a,origin:t.mappingData,data:t.data,coordinate:t.coordinate})}}})},t.prototype.renderLabelBackground=function(t,e){(0,Uw.each)(t,function(t){var r=(0,Uw.get)(t,"coordinate"),n=(0,Uw.get)(t,"background");if(n&&r){var i=t.id,o=e[i];if(!o.destroyed){var a=o.getChildren()[0];if(a){var s=qG(o,t,n.padding),u=s.rotation,l=(0,Gw.__rest)(s,["rotation"]),c=o.addShape("rect",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},l),n.style||{}),id:i,origin:t.mappingData,data:t.data,coordinate:t.coordinate});if(c.setZIndex(-1),u){var f=a.getMatrix();c.setMatrix(f)}}}}})},t.prototype.createOffscreenGroup=function(){return new(this.container.getGroupBase())({})},t.prototype.adjustLabel=function(t,e){(0,Uw.each)(t,function(t){if(t){var r=t.id,n=e[r];if(!n.destroyed){var i=n.findAll(function(t){return"path"!==t.get("type")});(0,Uw.each)(i,function(e){e&&(t.offsetX&&e.attr("x",e.attr("x")+t.offsetX),t.offsetY&&e.attr("y",e.attr("y")+t.offsetY))})}}})},t}();function ZG(t){var e=0;return(0,Uw.each)(t,function(t){e+=t}),e/t.length}var KG=function(){function t(t){this.geometry=t}return t.prototype.getLabelItems=function(t){var e=this,r=[],n=this.getLabelCfgs(t);return(0,Uw.each)(t,function(t,i){var o=n[i];if(!o||(0,Uw.isNil)(t.x)||(0,Uw.isNil)(t.y))r.push(null);else{var a=(0,Uw.isArray)(o.content)?o.content:[o.content];o.content=a;var s=a.length;(0,Uw.each)(a,function(n,i){if((0,Uw.isNil)(n)||""===n)r.push(null);else{var a=(0,Gw.__assign)((0,Gw.__assign)({},o),e.getLabelPoint(o,t,i));a.textAlign||(a.textAlign=e.getLabelAlign(a,i,s)),a.offset<=0&&(a.labelLine=null),r.push(a)}})}}),r},t.prototype.render=function(t,e){return void 0===e&&(e=!1),(0,Gw.__awaiter)(this,void 0,void 0,function(){var r,n,i;return(0,Gw.__generator)(this,function(o){switch(o.label){case 0:return r=this.getLabelItems(t),n=this.getLabelsRenderer(),i=this.getGeometryShapes(),[4,n.render(r,i,e)];case 1:return o.sent(),[2]}})})},t.prototype.clear=function(){var t=this.labelsRenderer;t&&t.clear()},t.prototype.destroy=function(){var t=this.labelsRenderer;t&&t.destroy(),this.labelsRenderer=null},t.prototype.getCoordinate=function(){return this.geometry.coordinate},t.prototype.getDefaultLabelCfg=function(t,e){var r=this.geometry,n=r.type,i=r.theme;return"polygon"===n||"interval"===n&&"middle"===e||t<0&&!["line","point","path"].includes(n)?(0,Uw.get)(i,"innerLabels",{}):(0,Uw.get)(i,"labels",{})},t.prototype.getThemedLabelCfg=function(t){var e=this.geometry,r=this.getDefaultLabelCfg(),n=e.type,i=e.theme;return"polygon"===n||t.offset<0&&!["line","point","path"].includes(n)?(0,Uw.deepMix)({},r,i.innerLabels,t):(0,Uw.deepMix)({},r,i.labels,t)},t.prototype.setLabelPosition=function(t,e,r,n){},t.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),r=this.getOffsetVector(t);return e.isTransposed?r[0]:r[1]},t.prototype.getLabelOffsetPoint=function(t,e,r){var n=t.offset,i=this.getCoordinate().isTransposed,o=i?"x":"y",a=i?1:-1,s={x:0,y:0};return s[o]=e>0||1===r?n*a:n*a*-1,s},t.prototype.getLabelPoint=function(t,e,r){var n=this.getCoordinate(),i=t.content.length;function o(e,r,n){void 0===n&&(n=!1);var i=e;return(0,Uw.isArray)(i)&&(i=1===t.content.length?n?ZG(i):i.length<=2?i[e.length-1]:ZG(i):i[r]),i}var a={content:t.content[r],x:0,y:0,start:{x:0,y:0},color:"#fff"},s=(0,Uw.isArray)(e.shape)?e.shape[0]:e.shape,u="funnel"===s||"pyramid"===s;if("polygon"===this.geometry.type){var l=function(t,e){if((0,Uw.isNumber)(t)&&(0,Uw.isNumber)(e))return[t,e];if(e=e,ZB(t=t)||ZB(e))return[KB(t),KB(e)];for(var r,n,i=-1,o=0,a=0,s=t.length-1,u=0;++i1&&0===e&&("right"===n?n="left":"left"===n&&(n="right"))}return n},t.prototype.getLabelId=function(t){var e=this.geometry,r=e.type,n=e.getXScale(),i=e.getYScale(),o=t[UN],a=e.getElementId(t);return"line"===r||"area"===r?a+=" ".concat(o[n.field]):"path"===r&&(a+=" ".concat(o[n.field],"-").concat(o[i.field])),a},t.prototype.getLabelsRenderer=function(){var t=this.geometry,e=t.labelsContainer,r=t.labelOption,n=t.canvasRegion,i=t.animateOption,o=this.geometry.coordinate,a=this.labelsRenderer;return a||(a=new XG({container:e,layout:(0,Uw.get)(r,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=a),a.region=n,a.animate=!!i&&_G("label",o),a},t.prototype.getLabelCfgs=function(t){var e=this,r=this.geometry,n=r.labelOption,i=r.scales,o=r.coordinate,a=n,s=a.fields,u=a.callback,l=a.cfg,c=s.map(function(t){return i[t]}),f=[];return(0,Uw.each)(t,function(t,r){var n,i=t[UN],a=e.getLabelText(i,c);if(u){var h=s.map(function(t){return i[t]});if(n=u.apply(void 0,(0,Gw.__spreadArray)([],(0,Gw.__read)(h),!1)),(0,Uw.isNil)(n))return void f.push(null)}var p=(0,Gw.__assign)((0,Gw.__assign)({id:e.getLabelId(t),elementId:e.geometry.getElementId(t),data:i,mappingData:t,coordinate:o},l),n);(0,Uw.isFunction)(p.position)&&(p.position=p.position(i,t,r));var d=e.getLabelOffset(p.offset||0),y=e.getDefaultLabelCfg(d,p.position);(p=(0,Uw.deepMix)({},y,p)).offset=e.getLabelOffset(p.offset||0);var v=p.content;(0,Uw.isFunction)(v)?p.content=v(i,t,r):(0,Uw.isUndefined)(v)&&(p.content=a[0]),f.push(p)}),f},t.prototype.getLabelText=function(t,e){var r=[];return(0,Uw.each)(e,function(e){var n=t[e.field];n=(0,Uw.isArray)(n)?n.map(function(t){return e.getText(t)}):e.getText(n),(0,Uw.isNil)(n)||""===n?r.push(null):r.push(n)}),r},t.prototype.getOffsetVector=function(t){void 0===t&&(t=0);var e=this.getCoordinate(),r=0;return(0,Uw.isNumber)(t)&&(r=t),e.isTransposed?e.applyMatrix(r,0):e.applyMatrix(0,r)},t.prototype.getGeometryShapes=function(){var t=this.geometry,e={};return(0,Uw.each)(t.elementsMap,function(t,r){e[r]=t.shape}),(0,Uw.each)(t.getOffscreenGroup().getChildren(),function(r){var n=t.getElementId(r.get("origin").mappingData);e[n]=r}),e},t}();function JG(t,e,r){if(!t)return r;var n;if(t.callback&&t.callback.length>1){var i=Array(t.callback.length-1).fill("");n=t.mapping.apply(t,(0,Gw.__spreadArray)([e],(0,Gw.__read)(i),!1)).join("")}else n=t.mapping(e).join("");return n||r}var QG={hexagon:function(t,e,r){var n=r/2*Math.sqrt(3);return[["M",t,e-r],["L",t+n,e-r/2],["L",t+n,e+r/2],["L",t,e+r],["L",t-n,e+r/2],["L",t-n,e-r/2],["Z"]]},bowtie:function(t,e,r){var n=r-1.5;return[["M",t-r,e-n],["L",t+r,e+n],["L",t+r,e-n],["L",t-r,e+n],["Z"]]},cross:function(t,e,r){return[["M",t-r,e-r],["L",t+r,e+r],["M",t+r,e-r],["L",t-r,e+r]]},tick:function(t,e,r){return[["M",t-r/2,e-r],["L",t+r/2,e-r],["M",t,e-r],["L",t,e+r],["M",t-r/2,e+r],["L",t+r/2,e+r]]},plus:function(t,e,r){return[["M",t-r,e],["L",t+r,e],["M",t,e-r],["L",t,e+r]]},hyphen:function(t,e,r){return[["M",t-r,e],["L",t+r,e]]},line:function(t,e,r){return[["M",t,e-r],["L",t,e+r]]}},$G=["line","cross","tick","plus","hyphen"];function tU(t){var e=t.symbol;(0,Uw.isString)(e)&&QG[e]&&(t.symbol=QG[e])}function eU(t){return t.startsWith(LN.LEFT)||t.startsWith(LN.RIGHT)?"vertical":"horizontal"}function rU(t,e,r,n,i){var o=r.getScale(r.type);if(o.isCategory){var a=o.field,s=e.getAttribute("color"),u=e.getAttribute("shape"),l=t.getTheme().defaultColor,c=e.coordinate.isPolar;return o.getTicks().map(function(r,f){var h,p=r.text,d=r.value,y=p,v=o.invert(d),g=0===t.filterFieldData(a,[(h={},h[a]=v,h)]).length;(0,Uw.each)(t.views,function(t){var e;t.filterFieldData(a,[(e={},e[a]=v,e)]).length||(g=!0)});var m,b,x=JG(s,v,l),w=JG(u,v,"point"),_=e.getShapeMarker(w,{color:x,isInPolar:c}),S=i;return(0,Uw.isFunction)(S)&&(S=S(y,f,(0,Gw.__assign)({name:y,value:v},(0,Uw.deepMix)({},n,_)))),function(t,e){var r=t.symbol;if((0,Uw.isString)(r)&&-1!==$G.indexOf(r)){var n=(0,Uw.get)(t,"style",{}),i=(0,Uw.get)(n,"lineWidth",1),o=n.stroke||n.fill||e;t.style=(0,Uw.deepMix)({},t.style,{lineWidth:i,stroke:o,fill:null})}}(_=(0,Uw.deepMix)({},n,_,iF((0,Gw.__assign)({},S),["style"])),x),S&&S.style&&(_.style=(m=_.style,b=S.style,(0,Uw.isFunction)(b)?b(m):(0,Uw.deepMix)({},m,b))),tU(_),{id:v,name:y,value:v,marker:_,unchecked:g}})}return[]}function nU(t,e){var r=(0,Uw.get)(t,["components","legend"],{});return(0,Uw.deepMix)({},(0,Uw.get)(r,["common"],{}),(0,Uw.deepMix)({},(0,Uw.get)(r,[e],{})))}function iU(t){return!t&&(null===t||void 0===t||isNaN(t))}function oU(t){if((0,Uw.isArray)(t))return iU(t[1].y);var e=t.y;return(0,Uw.isArray)(e)?iU(e[0]):iU(e)}function aU(t,e,r){if(void 0===e&&(e=!1),void 0===r&&(r=!0),!t.length||1===t.length&&!r)return[];if(e){for(var n=[],i=0,o=t.length;i0&&(l[0][0]="L")),o=o.concat(l)}),o.push(["Z"])}return o}function LU(t,e,r,n,i){for(var o=lU(t,e,!e,"lineWidth"),a=t.connectNulls,s=t.isInCircle,u=aU(t.points,a,t.showSinglePoint),l=[],c=0,f=u.length;cn&&(n=i),i=e[0]}));var p=this.scales[f];try{for(var d=(0,Gw.__values)(t),y=d.next();!y.done;y=d.next()){var v=y.value,g=this.getDrawCfg(v),m=g.x,b=g.y,x=p.scale(v[UN][f]);this.drawGrayScaleBlurredCircle(m-s.x,b-u.y,r+n,x,h)}}catch(t){i={error:t}}finally{try{y&&!y.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}var w=h.getImageData(0,0,l,c);this.clearShadowCanvasCtx(),this.colorize(w),h.putImageData(w,0,0);var _=this.getImageShape();_.attr("x",s.x),_.attr("y",u.y),_.attr("width",l),_.attr("height",c),_.attr("img",h.canvas),_.set("origin",this.getShapeInfo(t))},e.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),e=this.coordinate;return Math.min(e.getWidth()/(4*t.scales[0].ticks.length),e.getHeight()/(4*t.scales[1].ticks.length))},e.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},e.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},e.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},e.prototype.drawGrayScaleBlurredCircle=function(t,e,r,n,i){var o=this.getGrayScaleBlurredCanvas();i.globalAlpha=n,i.drawImage(o,t-r,e-r)},e.prototype.colorize=function(t){for(var e=this.getAttribute("color"),r=t.data,n=this.paletteCache,i=3;ie&&(n=e-(r=r?e/(1+n/r):0)),i+o>e&&(o=e-(i=i?e/(1+o/i):0)),[r||0,n||0,i||0,o||0]}function GU(t,e,r){var n=[];if(r.isRect){var i=r.isTransposed?{x:r.start.x,y:e[0].y}:{x:e[0].x,y:r.start.y},o=r.isTransposed?{x:r.end.x,y:e[2].y}:{x:e[3].x,y:r.end.y},a=(0,Uw.get)(t,["background","style","radius"]);if(a){var s=r.isTransposed?Math.abs(e[0].y-e[2].y):e[2].x-e[1].x,u=r.isTransposed?r.getWidth():r.getHeight(),l=(0,Gw.__read)(zU(a,Math.min(s,u)),4),c=l[0],f=l[1],h=l[2],p=l[3],d=r.isTransposed&&r.isReflect("y"),y=d?0:1,v=function(t){return d?-t:t};n.push(["M",i.x,o.y+v(c)]),0!==c&&n.push(["A",c,c,0,0,y,i.x+c,o.y]),n.push(["L",o.x-f,o.y]),0!==f&&n.push(["A",f,f,0,0,y,o.x,o.y+v(f)]),n.push(["L",o.x,i.y-v(h)]),0!==h&&n.push(["A",h,h,0,0,y,o.x-h,i.y]),n.push(["L",i.x+p,i.y]),0!==p&&n.push(["A",p,p,0,0,y,i.x,i.y-v(p)])}else n.push(["M",i.x,i.y]),n.push(["L",o.x,i.y]),n.push(["L",o.x,o.y]),n.push(["L",i.x,o.y]),n.push(["L",i.x,i.y]);n.push(["z"])}if(r.isPolar){var g=r.getCenter(),m=tF(t,r),b=m.startAngle,x=m.endAngle;if("theta"===r.type||r.isTransposed){var w=function(t){return Math.pow(t,2)};c=Math.sqrt(w(g.x-e[0].x)+w(g.y-e[0].y)),f=Math.sqrt(w(g.x-e[2].x)+w(g.y-e[2].y));n=QB(g.x,g.y,c,r.startAngle,r.endAngle,f)}else n=QB(g.x,g.y,r.getRadius(),b,x)}return n}function UU(t,e,r){var n=[];return(0,Uw.isNil)(e)?r?n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",(t[2].x+t[3].x)/2,(t[2].y+t[3].y)/2],["Z"]):n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",t[2].x,t[2].y],["L",t[3].x,t[3].y],["Z"]):n.push(["M",t[0].x,t[0].y],["L",t[1].x,t[1].y],["L",e[1].x,e[1].y],["L",e[0].x,e[0].y],["Z"]),n}function VU(t,e){return[e,t]}jG("interval",{defaultShapeType:"rect",getDefaultPoints:function(t){return BU(t)}});NG("interval","rect",{draw:function(t,e){var r,n=lU(t,!1,!0),i=e,o=null===t||void 0===t?void 0:t.background;if(o){i=e.addGroup({name:"interval-group"});var a=cU(t),s=GU(t,this.parsePoints(t.points),this.coordinate);i.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},a),{path:s}),capture:!1,zIndex:-1,name:"element-background"})}r=n.radius&&this.coordinate.isRect?function(t,e,r){var n,i,o,a,s,u,l,c=(0,Gw.__read)((0,Gw.__spreadArray)([],(0,Gw.__read)(t),!1),4),f=c[0],h=c[1],p=c[2],d=c[3],y=(0,Gw.__read)("number"==typeof r?Array(4).fill(r):r,4),v=y[0],g=y[1],m=y[2],b=y[3];e.isTransposed&&(h=(n=(0,Gw.__read)(VU(h,d),2))[0],d=n[1]),e.isReflect("y")&&(f=(i=(0,Gw.__read)(VU(f,h),2))[0],h=i[1],p=(o=(0,Gw.__read)(VU(p,d),2))[0],d=o[1]),e.isReflect("x")&&(f=(a=(0,Gw.__read)(VU(f,d),2))[0],d=a[1],h=(s=(0,Gw.__read)(VU(h,p),2))[0],p=s[1]);var x=[],w=function(t){return Math.abs(t)};return v=(u=(0,Gw.__read)(zU([v,g,m,b],Math.min(w(d.x-f.x),w(h.y-f.y))).map(function(t){return w(t)}),4))[0],g=u[1],m=u[2],b=u[3],e.isTransposed&&(v=(l=(0,Gw.__read)([b,v,g,m],4))[0],g=l[1],m=l[2],b=l[3]),f.y1){i.sort();var y=function(t,e){var r=t.length,n=t;(0,Uw.isString)(n[0])&&(n=t.map(function(t){return e.translate(t)}));for(var i=n[1]-n[0],o=2;oa&&(i=a)}return i}(i,n);a=(n.max-n.min)/y,i.length>a&&(a=i.length)}var v=n.range,g=1/a,m=1;(r.isPolar?m=r.isTransposed&&a>1?p:d:(n.isLinear&&(g*=v[1]-v[0]),m=h),!(0,Uw.isNil)(u)&&u>=0)?g=(1-(a-1)*(u/s))/a:g*=m;if(t.getAdjust("dodge")){var b=function(t,e){if(e){var r=(0,Uw.flatten)(t);return(0,Uw.valuesOfKey)(r,e).length}return t.length}(o,t.getAdjust("dodge").dodgeBy);if(!(0,Uw.isNil)(l)&&l>=0)g=(g-l/s*(b-1))/b;else!(0,Uw.isNil)(u)&&u>=0?(g*=m,g/=b):g/=b;g=g>=0?g:0}if(!(0,Uw.isNil)(c)&&c>=0){var x=c/s;g>x&&(g=x)}if(!(0,Uw.isNil)(f)&&f>=0){var w=f/s;g0&&!(0,Uw.get)(i,[o,"min"])&&n.change({min:0}),s<=0&&!(0,Uw.get)(i,[o,"max"])&&n.change({max:0}))}},e.prototype.getDrawCfg=function(e){var r=t.prototype.getDrawCfg.call(this,e);return r.background=this.background,r},e}(GG),qU=function(t){function e(e){var r=t.call(this,e)||this;r.type="line";var n=e.sortable,i=void 0!==n&&n;return r.sortable=i,r}return(0,Gw.__extends)(e,t),e}(MU),YU=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"];function XU(t,e,r,n,i){var o,a,s=lU(e,i,!i,"r"),u=t.parsePoints(e.points),l=u[0];if(e.isStack)l=u[1];else if(u.length>1){var c=r.addGroup();try{for(var f=(0,Gw.__values)(u),h=f.next();!h.done;h=f.next()){var p=h.value;c.addShape({type:"marker",attrs:(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},s),{symbol:QG[n]||n}),p)})}}catch(t){o={error:t}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return c}return r.addShape({type:"marker",attrs:(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},s),{symbol:QG[n]||n}),l)})}jG("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(t){return fU(t)}});(0,Uw.each)(YU,function(t){NG("point","hollow-".concat(t),{draw:function(e,r){return XU(this,e,r,t,!0)},getMarker:function(e){var r=e.color;return{symbol:QG[t]||t,style:{r:4.5,stroke:r,fill:null}}}})});var ZU=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="point",e.shapeType="point",e.generatePoints=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getDrawCfg=function(e){var r=t.prototype.getDrawCfg.call(this,e);return(0,Gw.__assign)((0,Gw.__assign)({},r),{isStack:!!this.getAdjust("stack")})},e}(GG);jG("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(t){var e=[];return(0,Uw.each)(t.x,function(r,n){var i=t.y[n];e.push({x:r,y:i})}),e}});NG("polygon","polygon",{draw:function(t,e){if(!(0,Uw.isEmpty)(t.points)){var r=lU(t,!0,!0),n=this.parsePath(function(t){for(var e=t[0],r=1,n=[["M",e.x,e.y]];r2?"weight":"normal";if(t.isInCircle){var a={x:0,y:1};return"normal"===o?r=function(t,e,r){var n=tV(e,r),i=[["M",t.x,t.y]];return i.push(n),i}(i[0],i[1],a):(n.fill=n.stroke,r=function(t,e){var r=tV(t[1],e),n=tV(t[3],e),i=[["M",t[0].x,t[0].y]];return i.push(n),i.push(["L",t[3].x,t[3].y]),i.push(["L",t[2].x,t[2].y]),i.push(r),i.push(["L",t[1].x,t[1].y]),i.push(["L",t[0].x,t[0].y]),i.push(["Z"]),i}(i,a)),r=this.parsePath(r),e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},n),{path:r})})}if("normal"===o)return r=$B(((i=this.parsePoints(i))[1].x+i[0].x)/2,i[0].y,Math.abs(i[1].x-i[0].x)/2,Math.PI,2*Math.PI),e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},n),{path:r})});var s=$U(i[1],i[3]),u=$U(i[2],i[0]);return r=[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],s,["L",i[3].x,i[3].y],["L",i[2].x,i[2].y],u,["Z"]],r=this.parsePath(r),n.fill=n.stroke,e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},n),{path:r})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),NG("edge","smooth",{draw:function(t,e){var r=lU(t,!0,!1,"lineWidth"),n=t.points,i=this.parsePath(function(t,e){var r=$U(t,e),n=[["M",t.x,t.y]];return n.push(r),n}(n[0],n[1]));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}});var eV=1/3;NG("edge","vhv",{draw:function(t,e){var r=lU(t,!0,!1,"lineWidth"),n=t.points,i=this.parsePath(function(t,e){var r=[];r.push({x:t.x,y:t.y*(1-eV)+e.y*eV}),r.push({x:e.x,y:t.y*(1-eV)+e.y*eV}),r.push(e);var n=[["M",t.x,t.y]];return(0,Uw.each)(r,function(t){n.push(["L",t.x,t.y])}),n}(n[0],n[1]));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:i})})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),NG("interval","funnel",{getPoints:function(t){return t.size=2*t.size,BU(t)},draw:function(t,e){var r=lU(t,!1,!0),n=this.parsePath(UU(t.points,t.nextPoints,!1));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:n}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),NG("interval","hollow-rect",{draw:function(t,e){var r=lU(t,!0,!1),n=e,i=null===t||void 0===t?void 0:t.background;if(i){n=e.addGroup();var o=cU(t),a=GU(t,this.parsePoints(t.points),this.coordinate);n.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},o),{path:a}),capture:!1,zIndex:-1,name:"element-background"})}var s=this.parsePath(FU(t.points)),u=n.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:s}),name:"interval"});return i?n:u},getMarker:function(t){var e=t.color;return t.isInPolar?{symbol:"circle",style:{r:4.5,stroke:e,fill:null}}:{symbol:"square",style:{r:4,stroke:e,fill:null}}}}),NG("interval","line",{getPoints:function(t){return r=(e=t).x,n=e.y,i=e.y0,(0,Uw.isArray)(n)?n.map(function(t,e){return{x:(0,Uw.isArray)(r)?r[e]:r,y:t}}):[{x:r,y:i},{x:r,y:n}];var e,r,n,i},draw:function(t,e){var r=lU(t,!0,!1,"lineWidth"),n=iF((0,Gw.__assign)({},r),["fill"]),i=this.parsePath(FU(t.points,!1));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,r){return[["M",t,e-r],["L",t,e+r]]},style:{r:5,stroke:t.color}}}}),NG("interval","pyramid",{getPoints:function(t){return t.size=2*t.size,BU(t)},draw:function(t,e){var r=lU(t,!1,!0),n=this.parsePath(UU(t.points,t.nextPoints,!0));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:n}),name:"interval"})},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),NG("interval","tick",{getPoints:function(t){return function(t){var e,r,n,i=t.x,o=t.y,a=t.y0,s=t.size;(0,Uw.isArray)(o)?(r=(e=(0,Gw.__read)(o,2))[0],n=e[1]):(r=a,n=o);var u=i+s/2,l=i-s/2;return[{x:i,y:r},{x:i,y:n},{x:l,y:r},{x:u,y:r},{x:l,y:n},{x:u,y:n}]}(t)},draw:function(t,e){var r,n=lU(t,!0,!1),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y]]);return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},n),{path:i}),name:"interval"})},getMarker:function(t){return{symbol:function(t,e,r){return[["M",t-r/2,e-r],["L",t+r/2,e-r],["M",t,e-r],["L",t,e+r],["M",t-r/2,e+r],["L",t+r/2,e+r]]},style:{r:5,stroke:t.color}}}});var rV=function(t,e,r){var n,i=t.x,o=t.y,a=e.x,s=e.y;switch(r){case"hv":n=[{x:a,y:o}];break;case"vh":n=[{x:i,y:s}];break;case"hvh":var u=(a+i)/2;n=[{x:u,y:o},{x:u,y:s}];break;case"vhv":var l=(o+s)/2;n=[{x:i,y:l},{x:a,y:l}]}return n};function nV(t,e){var r=aU(t.points,t.connectNulls,t.showSinglePoint),n=[];return(0,Uw.each)(r,function(t){var r=function(t,e){var r=[];return(0,Uw.each)(t,function(n,i){var o=t[i+1];if(r.push(n),o){var a=rV(n,o,e);r=r.concat(a)}}),r}(t,e);n=n.concat(r.map(function(t,e){return 0===e?["M",t.x,t.y]:["L",t.x,t.y]}))}),(0,Gw.__assign)((0,Gw.__assign)({},lU(t,!0,!1,"lineWidth")),{path:n})}function iV(t){var e=(0,Uw.isArray)(t)?t:[t],r=e[0],n=e[e.length-1],i=e.length>1?e[1]:r;return{min:r,max:n,min1:i,max1:e.length>3?e[3]:n,median:e.length>2?e[2]:i}}function oV(t,e,r){var n,i=r/2;if((0,Uw.isArray)(e)){var o=iV(e),a=o.min,s=o.max,u=o.median,l=o.min1,c=t-i,f=t+i;n=[[c,s],[f,s],[t,s],[t,h=o.max1],[c,l],[c,h],[f,h],[f,l],[t,l],[t,a],[c,a],[f,a],[c,u],[f,u]]}else{e=(0,Uw.isNil)(e)?.5:e;var h,p=iV(t),d=(a=p.min,s=p.max,u=p.median,e-i),y=e+i;n=[[a,d],[a,y],[a,e],[l=p.min1,e],[l,d],[l,y],[h=p.max1,y],[h,d],[h,e],[s,e],[s,d],[s,y],[u,d],[u,y]]}return n.map(function(t){return{x:t[0],y:t[1]}})}function aV(t){var e=((0,Uw.isArray)(t)?t:[t]).sort(function(t,e){return e-t});return function(t,e,r){if((0,Uw.isString)(t))return t.padEnd(e,r);if((0,Uw.isArray)(t)){var n=t.length;if(n1){var s=e.addGroup();try{for(var u=(0,Gw.__values)(o),l=u.next();!l.done;l=u.next()){var c=l.value;s.addShape("image",{attrs:{x:c.x-i/2,y:c.y-i,width:i,height:i,img:t.shape[1]}})}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return s}return e.addShape("image",{attrs:{x:a.x-i/2,y:a.y-i,width:i,height:i,img:t.shape[1]}})},getMarker:function(t){return{symbol:"circle",style:{r:4.5,fill:t.color}}}}),(0,Uw.each)(YU,function(t){NG("point",t,{draw:function(e,r){return XU(this,e,r,t,!1)},getMarker:function(e){var r=e.color;return{symbol:QG[t]||t,style:{r:4.5,fill:r}}}})}),NG("schema","box",{getPoints:function(t){return oV(t.x,t.y,t.size)},draw:function(t,e){var r,n=lU(t,!0,!1),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["M",r[4].x,r[4].y],["L",r[5].x,r[5].y],["L",r[6].x,r[6].y],["L",r[7].x,r[7].y],["L",r[4].x,r[4].y],["Z"],["M",r[8].x,r[8].y],["L",r[9].x,r[9].y],["M",r[10].x,r[10].y],["L",r[11].x,r[11].y],["M",r[12].x,r[12].y],["L",r[13].x,r[13].y]]);return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},n),{path:i,name:"schema"})})},getMarker:function(t){return{symbol:function(t,e,r){var n=oV(t,[e-6,e-3,e,e+3,e+6],r);return[["M",n[0].x+1,n[0].y],["L",n[1].x-1,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["M",n[4].x,n[4].y],["L",n[5].x,n[5].y],["L",n[6].x,n[6].y],["L",n[7].x,n[7].y],["L",n[4].x,n[4].y],["Z"],["M",n[8].x,n[8].y],["L",n[9].x,n[9].y],["M",n[10].x+1,n[10].y],["L",n[11].x-1,n[11].y],["M",n[12].x,n[12].y],["L",n[13].x,n[13].y]]},style:{r:6,lineWidth:1,stroke:t.color}}}}),NG("schema","candle",{getPoints:function(t){return sV(t.x,t.y,t.size)},draw:function(t,e){var r,n=lU(t,!0,!0),i=this.parsePath([["M",(r=t.points)[0].x,r[0].y],["L",r[1].x,r[1].y],["M",r[2].x,r[2].y],["L",r[3].x,r[3].y],["L",r[4].x,r[4].y],["L",r[5].x,r[5].y],["Z"],["M",r[6].x,r[6].y],["L",r[7].x,r[7].y]]);return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},n),{path:i,name:"schema"})})},getMarker:function(t){var e=t.color;return{symbol:function(t,e,r){var n=sV(t,[e+7.5,e+3,e-3,e-7.5],r);return[["M",n[0].x,n[0].y],["L",n[1].x,n[1].y],["M",n[2].x,n[2].y],["L",n[3].x,n[3].y],["L",n[4].x,n[4].y],["L",n[5].x,n[5].y],["Z"],["M",n[6].x,n[6].y],["L",n[7].x,n[7].y]]},style:{lineWidth:1,stroke:e,fill:e,r:6}}}}),NG("polygon","square",{draw:function(t,e){if(!(0,Uw.isEmpty)(t.points)){var r=lU(t,!0,!0),n=this.parsePoints(t.points);return e.addShape("rect",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),function(t,e){var r=Math.abs(t[0].x-t[2].x),n=Math.abs(t[0].y-t[2].y),i=Math.min(r,n);return e&&(i=(0,Uw.clamp)(e,0,Math.min(r,n))),i/=2,{x:(t[0].x+t[2].x)/2-i,y:(t[0].y+t[2].y)/2-i,width:2*i,height:2*i}}(n,t.size)),name:"polygon"})}},getMarker:function(t){return{symbol:"square",style:{r:4,fill:t.color}}}}),NG("violin","smooth",{draw:function(t,e){var r=lU(t,!0,!0),n=this.parsePath(uU(t.points));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{stroke:null,r:4,fill:t.color}}}}),NG("violin","hollow",{draw:function(t,e){var r=lU(t,!0,!1),n=this.parsePath(sU(t.points));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}}),NG("violin","hollow-smooth",{draw:function(t,e){var r=lU(t,!0,!1),n=this.parsePath(uU(t.points));return e.addShape("path",{attrs:(0,Gw.__assign)((0,Gw.__assign)({},r),{path:n})})},getMarker:function(t){return{symbol:"circle",style:{r:4,fill:null,stroke:t.color}}}});var uV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getLabelValueDir=function(t){var e=t.points;return e[0].y<=e[2].y?1:-1},e.prototype.getLabelOffsetPoint=function(e,r,n,i){var o,a=t.prototype.getLabelOffsetPoint.call(this,e,r,n),s=this.getCoordinate(),u=s.isTransposed?"x":"y",l=this.getLabelValueDir(e.mappingData);return a=(0,Gw.__assign)((0,Gw.__assign)({},a),((o={})[u]=a[u]*l,o)),s.isReflect("x")&&(a=(0,Gw.__assign)((0,Gw.__assign)({},a),{x:-1*a.x})),s.isReflect("y")&&(a=(0,Gw.__assign)((0,Gw.__assign)({},a),{y:-1*a.y})),a},e.prototype.getThemedLabelCfg=function(t){var e=this.geometry,r=this.getDefaultLabelCfg(),n=e.theme;return(0,Uw.deepMix)({},r,n.labels,"middle"===t.position?{offset:0}:{},t)},e.prototype.setLabelPosition=function(t,e,r,n){var i,o,a,s,u=this.getCoordinate(),l=u.isTransposed,c=e.points,f=u.convert(c[0]),h=u.convert(c[2]),p=this.getLabelValueDir(e),d=(0,Uw.isArray)(e.shape)?e.shape[0]:e.shape;if("funnel"===d||"pyramid"===d){var y=(0,Uw.get)(e,"nextPoints"),v=(0,Uw.get)(e,"points");if(y){var g=u.convert(v[0]),m=u.convert(v[1]),b=u.convert(y[0]),x=u.convert(y[1]);l?(i=Math.min(b.y,g.y),a=Math.max(b.y,g.y),o=(m.x+x.x)/2,s=(g.x+b.x)/2):(i=Math.min((m.y+x.y)/2,(g.y+b.y)/2),a=Math.max((m.y+x.y)/2,(g.y+b.y)/2),o=x.x,s=g.x)}else i=Math.min(h.y,f.y),a=Math.max(h.y,f.y),o=h.x,s=f.x}else i=Math.min(h.y,f.y),a=Math.max(h.y,f.y),o=h.x,s=f.x;switch(n){case"right":t.x=o,t.y=(i+a)/2,t.textAlign=(0,Uw.get)(t,"textAlign",p>0?"left":"right");break;case"left":t.x=s,t.y=(i+a)/2,t.textAlign=(0,Uw.get)(t,"textAlign",p>0?"left":"right");break;case"bottom":l&&(t.x=(o+s)/2),t.y=a,t.textAlign=(0,Uw.get)(t,"textAlign","center"),t.textBaseline=(0,Uw.get)(t,"textBaseline",p>0?"bottom":"top");break;case"middle":l&&(t.x=(o+s)/2),t.y=(i+a)/2,t.textAlign=(0,Uw.get)(t,"textAlign","center"),t.textBaseline=(0,Uw.get)(t,"textBaseline","middle");break;case"top":l&&(t.x=(o+s)/2),t.y=i,t.textAlign=(0,Uw.get)(t,"textAlign","center"),t.textBaseline=(0,Uw.get)(t,"textBaseline",p>0?"bottom":"top")}},e}(KG),lV=Math.PI/2,cV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),r=0;if((0,Uw.isNumber)(t))r=t;else if((0,Uw.isString)(t)&&-1!==t.indexOf("%")){var n=e.getRadius();e.innerRadius>0&&(n*=1-e.innerRadius),r=.01*parseFloat(t)*n}return r},e.prototype.getLabelItems=function(e){var r=t.prototype.getLabelItems.call(this,e),n=this.geometry.getYScale();return(0,Uw.map)(r,function(t){if(t&&n){var e=n.scale((0,Uw.get)(t.data,n.field));return(0,Gw.__assign)((0,Gw.__assign)({},t),{percent:e})}return t})},e.prototype.getLabelAlign=function(t){var e,r=this.getCoordinate();if(t.labelEmit)e=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(r.isTransposed){var n=r.getCenter(),i=t.offset;e=Math.abs(t.x-n.x)<1?"center":t.angle>Math.PI||t.angle<=0?i>0?"left":"right":i>0?"right":"left"}else e="center";return e},e.prototype.getLabelPoint=function(t,e,r){var n,i=1,o=t.content[r];this.isToMiddle(e)?n=this.getMiddlePoint(e.points):(1===t.content.length&&0===r?r=1:0===r&&(i=-1),n=this.getArcPoint(e,r));var a=t.offset*i,s=this.getPointAngle(n),u=t.labelEmit,l=this.getCirclePoint(s,a,n,u);return 0===l.r?l.content="":(l.content=o,l.angle=s,l.color=e.color),l.rotate=t.autoRotate?this.getLabelRotate(s,a,u):t.rotate,l.start={x:n.x,y:n.y},l},e.prototype.getArcPoint=function(t,e){return void 0===e&&(e=0),(0,Uw.isArray)(t.x)||(0,Uw.isArray)(t.y)?{x:(0,Uw.isArray)(t.x)?t.x[e]:t.x,y:(0,Uw.isArray)(t.y)?t.y[e]:t.y}:{x:t.x,y:t.y}},e.prototype.getPointAngle=function(t){return lF(this.getCoordinate(),t)},e.prototype.getCirclePoint=function(t,e,r,n){var i=this.getCoordinate(),o=i.getCenter(),a=uF(i,r);if(0===a)return(0,Gw.__assign)((0,Gw.__assign)({},o),{r:a});var s=t;i.isTransposed&&a>e&&!n?s=t+2*Math.asin(e/(2*a)):a+=e;return{x:o.x+a*Math.cos(s),y:o.y+a*Math.sin(s),r:a}},e.prototype.getLabelRotate=function(t,e,r){var n=t+lV;return r&&(n-=lV),n&&(n>lV?n-=Math.PI:n<-lV&&(n+=Math.PI)),n},e.prototype.getMiddlePoint=function(t){var e=this.getCoordinate(),r=t.length,n={x:0,y:0};return(0,Uw.each)(t,function(t){n.x+=t.x,n.y+=t.y}),n.x/=r,n.y/=r,n=e.convert(n)},e.prototype.isToMiddle=function(t){return t.x.length>2},e}(KG),fV=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.defaultLayout="distribute",e}return(0,Gw.__extends)(e,t),e.prototype.getDefaultLabelCfg=function(e,r){var n=t.prototype.getDefaultLabelCfg.call(this,e,r);return(0,Uw.deepMix)({},n,(0,Uw.get)(this.geometry.theme,"pieLabels",{}))},e.prototype.getLabelOffset=function(e){return t.prototype.getLabelOffset.call(this,e)||0},e.prototype.getLabelRotate=function(t,e,r){var n;return e<0&&((n=t)>Math.PI/2&&(n-=Math.PI),n<-Math.PI/2&&(n+=Math.PI)),n},e.prototype.getLabelAlign=function(t){var e,r=this.getCoordinate().getCenter();return e=t.angle<=Math.PI/2&&t.x>=r.x?"left":"right",t.offset<=0&&(e="right"===e?"left":"right"),e},e.prototype.getArcPoint=function(t){return t},e.prototype.getPointAngle=function(t){var e,r=this.getCoordinate(),n={x:(0,Uw.isArray)(t.x)?t.x[0]:t.x,y:t.y[0]},i={x:(0,Uw.isArray)(t.x)?t.x[1]:t.x,y:t.y[1]},o=lF(r,n);if(t.points&&t.points[0].y===t.points[1].y)e=o;else{var a=lF(r,i);o>=a&&(a+=2*Math.PI),e=o+(a-o)/2}return e},e.prototype.getCirclePoint=function(t,e){var r=this.getCoordinate(),n=r.getCenter(),i=r.getRadius()+e;return(0,Gw.__assign)((0,Gw.__assign)({},JB(n.x,n.y,i,t)),{angle:t,r:i})},e}(cV),hV=4;function pV(t,e,r){var n=t.filter(function(t){return!t.invisible});n.sort(function(t,e){return t.y-e.y});var i,o=!0,a=r.minY,s=r.maxY,u=Math.abs(a-s),l=0,c=Number.MIN_VALUE,f=n.map(function(t){return t.y>l&&(l=t.y),t.yu&&(u=l-a);o;)for(f.forEach(function(t){var e=(Math.min.apply(c,t.targets)+Math.max.apply(c,t.targets))/2;t.pos=Math.min(Math.max(c,e-t.size/2),u-t.size),t.pos=Math.max(0,t.pos)}),o=!1,i=f.length;i--;)if(i>0){var h=f[i-1],p=f[i];h.pos+h.size>p.pos&&(h.size+=p.size,h.targets=h.targets.concat(p.targets),h.pos+h.size>u&&(h.pos=u-h.size),f.splice(i,1),o=!0)}i=0,f.forEach(function(t){var r=a+e/2;t.targets.forEach(function(){n[i].y=t.pos+r,r+=e,i++})})}var dV=4;var yV=4,vV=4,gV=4;var mV=100,bV=function(){function t(t){void 0===t&&(t={}),this.bitmap={};var e=t.xGap,r=void 0===e?1:e,n=t.yGap,i=void 0===n?8:n;this.xGap=r,this.yGap=i}return t.prototype.hasGap=function(t){for(var e=!0,r=this.bitmap,n=Math.round(t.minX),i=Math.round(t.maxX),o=Math.round(t.minY),a=Math.round(t.maxY),s=n;s<=i;s+=1)if(r[s]){if(s===n||s===i){for(var u=o;u<=a;u++)if(r[s][u]){e=!1;break}}else if(r[s][o]||r[s][a]){e=!1;break}}else r[s]={};return e},t.prototype.fillGap=function(t){for(var e=this.bitmap,r=Math.round(t.minX),n=Math.round(t.maxX),i=Math.round(t.minY),o=Math.round(t.maxY),a=r;a<=n;a+=1)e[a]||(e[a]={});for(a=r;a<=n;a+=this.xGap){for(var s=i;s<=o;s+=this.yGap)e[a][s]=!0;e[a][o]=!0}if(1!==this.yGap)for(a=i;a<=o;a+=1)e[r][a]=!0,e[n][a]=!0;if(1!==this.xGap)for(a=r;a<=n;a+=1)e[a][i]=!0,e[a][o]=!0},t.prototype.destroy=function(){this.bitmap={}},t}();function xV(t,e,r,n){var i=t.getCanvasBBox(),o=i.width,a=i.height,s={x:e,y:r,textAlign:"center"};switch(n){case 0:s.y-=a+1,s.x+=1,s.textAlign="left";break;case 1:s.y-=a+1,s.x-=1,s.textAlign="right";break;case 2:s.y+=a+1,s.x-=1,s.textAlign="right";break;case 3:s.y+=a+1,s.x+=1,s.textAlign="left";break;case 5:s.y-=2*a+2;break;case 6:s.y+=2*a+2;break;case 7:s.x+=o+1,s.textAlign="left";break;case 8:s.x-=o+1,s.textAlign="right"}return t.attr(s),t.getCanvasBBox()}function wV(t){if(t.length>4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function _V(t,e,r){void 0===e&&(e=0),void 0===r&&(r={x:0,y:0});var n=t.x,i=t.y;return{x:(n-r.x)*Math.cos(-e)+(i-r.y)*Math.sin(-e)+r.x,y:(r.x-n)*Math.sin(-e)+(i-r.y)*Math.cos(-e)+r.y}}function SV(t){var e=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],r=t.rotation;return r?[_V(e[0],r,e[0]),_V(e[1],r,e[0]),_V(e[2],r,e[0]),_V(e[3],r,e[0])]:e}function EV(t,e){if(t.length>4)return{min:0,max:0};var r=[];return t.forEach(function(t){var n,i;r.push((n=[t.x,t.y],i=e,(n[0]||0)*(i[0]||0)+(n[1]||0)*(i[1]||0)+(n[2]||0)*(i[2]||0)))}),{min:Math.min.apply(Math,(0,Gw.__spreadArray)([],(0,Gw.__read)(r),!1)),max:Math.max.apply(Math,(0,Gw.__spreadArray)([],(0,Gw.__read)(r),!1))}}function kV(t,e){return t.max>e.min&&t.mint.x+t.width+r||e.x+e.widtht.y+t.height+r||e.y+e.height4)return[];var e=function(t,e){return[e.x-t.x,e.y-t.y]};return[e(t[0],t[1]),e(t[1],t[2])]}function e(t,e,r){void 0===e&&(e=0),void 0===r&&(r={x:0,y:0});var n=t.x,i=t.y;return{x:(n-r.x)*Math.cos(-e)+(i-r.y)*Math.sin(-e)+r.x,y:(r.x-n)*Math.sin(-e)+(i-r.y)*Math.cos(-e)+r.y}}function r(t){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],n=t.rotation;return n?[e(r[0],n,r[0]),e(r[1],n,r[0]),e(r[2],n,r[0]),e(r[3],n,r[0])]:r}function n(t,e){if(t.length>4)return{min:0,max:0};var r=[];return t.forEach(function(t){var n,i;r.push((n=[t.x,t.y],i=e,(n[0]||0)*(i[0]||0)+(n[1]||0)*(i[1]||0)+(n[2]||0)*(i[2]||0)))}),{min:Math.min.apply(null,r),max:Math.max.apply(null,r)}}function i(t,e){return t.max>e.min&&t.mint.x+t.width+r||e.x+e.widtht.y+t.height+r||e.y+e.height=o.height:a.width>=o.width}(t,e,i)})}function DV(t,e,r){return t.some(function(t){return r(t,e)})}function BV(t,e){return DV(t,e,function(t,e){var r,n,i,o=WG(t),a=WG(e);return r=o.getCanvasBBox(),n=a.getCanvasBBox(),void 0===(i=2)&&(i=0),Math.max(0,Math.min(r.x+r.width+i,n.x+n.width+i)-Math.max(r.x-i,n.x-i))*Math.max(0,Math.min(r.y+r.height+i,n.y+n.height+i)-Math.max(r.y-i,n.y-i))>0})}function FV(t,e,r){return t.some(function(t){return r(t,e)})}function zV(t,e){return FV(t,e,function(t,e){var r,n,i,o=WG(t),a=WG(e);return r=o.getCanvasBBox(),n=a.getCanvasBBox(),void 0===(i=2)&&(i=0),Math.max(0,Math.min(r.x+r.width+i,n.x+n.width+i)-Math.max(r.x-i,n.x-i))*Math.max(0,Math.min(r.y+r.height+i,n.y+n.height+i)-Math.max(r.y-i,n.y-i))>0})}function GV(){return LV||(LV=document.createElement("canvas").getContext("2d")),LV}var UV=(0,Uw.memoize)(function(t,e){void 0===e&&(e={});var r=e.fontSize,n=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant,s=GV();return s.font=[o,a,i,"".concat(r,"px"),n].join(" "),s.measureText((0,Uw.isString)(t)?t:"").width},function(t,e){return void 0===e&&(e={}),(0,Gw.__spreadArray)([t],(0,Gw.__read)((0,Uw.values)(e)),!1).join("")}),VV=function(t,e,r){var n,i=UV("...",r);n=(0,Uw.isString)(t)?t:(0,Uw.toString)(t);var o,a,s=e,u=[];if(UV(t,r)<=e)return t;for(;o=n.substr(0,16),!((a=UV(o,r))+i>s&&a>s);)if(u.push(o),s-=a,!(n=n.substr(16)))return u.join("");for(;o=n.substr(0,1),!((a=UV(o,r))+i>s);)if(u.push(o),s-=a,!(n=n.substr(1)))return u.join("");return"".concat(u.join(""),"...")};function HV(t,e,r,n,i){var o,a,s=r.start,u=r.end,l=r.getWidth(),c=r.getHeight();"y"===i?(o=s.x+l/2,a=n.ys.x?n.x:s.x,a=s.y+c/2):"xy"===i&&(r.isPolar?(o=r.getCenter().x,a=r.getCenter().y):(o=(s.x+u.x)/2,a=(s.y+u.y)/2));var f=function(t,e,r){var n,i=(0,Gw.__read)(e,2),o=i[0],a=i[1];return t.applyToMatrix([o,a,1]),"x"===r?(t.setMatrix(Yw.pd(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]])),n=Yw.pd(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])):"y"===r?(t.setMatrix(Yw.pd(t.getMatrix(),[["t",-o,-a],["s",1,.01],["t",o,a]])),n=Yw.pd(t.getMatrix(),[["t",-o,-a],["s",1,100],["t",o,a]])):"xy"===r&&(t.setMatrix(Yw.pd(t.getMatrix(),[["t",-o,-a],["s",.01,.01],["t",o,a]])),n=Yw.pd(t.getMatrix(),[["t",-o,-a],["s",100,100],["t",o,a]])),n}(t,[o,a],i);t.animate({matrix:f},e)}function WV(t,e){var r,n=yT(t,e),i=n.startAngle,o=n.endAngle;return!(0,Uw.isNumberEqual)(i,.5*-Math.PI)&&i<.5*-Math.PI&&(i+=2*Math.PI),!(0,Uw.isNumberEqual)(o,.5*-Math.PI)&&o<.5*-Math.PI&&(o+=2*Math.PI),0===e[5]&&(i=(r=(0,Gw.__read)([o,i],2))[0],o=r[1]),(0,Uw.isNumberEqual)(i,1.5*Math.PI)&&(i=-.5*Math.PI),(0,Uw.isNumberEqual)(o,-.5*Math.PI)&&!(0,Uw.isNumberEqual)(i,o)&&(o=1.5*Math.PI),{startAngle:i,endAngle:o}}function qV(t){var e;return"M"===t[0]||"L"===t[0]?e=[t[1],t[2]]:"a"!==t[0]&&"A"!==t[0]&&"C"!==t[0]||(e=[t[t.length-2],t[t.length-1]]),e}function YV(t){var e,r,n,i=t.filter(function(t){return"A"===t[0]||"a"===t[0]});if(0===i.length)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var o=i[0],a=i.length>1?i[1]:i[0],s=t.indexOf(o),u=t.indexOf(a),l=qV(t[s-1]),c=qV(t[u-1]),f=WV(l,o),h=f.startAngle,p=f.endAngle,d=WV(c,a),y=d.startAngle,v=d.endAngle;(0,Uw.isNumberEqual)(h,y)&&(0,Uw.isNumberEqual)(p,v)?(r=h,n=p):(r=Math.min(h,y),n=Math.max(p,v));var g=o[1],m=i[i.length-1][1];return g=0;a--){var s=this.getFacetsByLevel(t,a);try{for(var u=(e=void 0,(0,Gw.__values)(s)),l=u.next();!l.done;l=u.next()){var c=l.value;this.isLeaf(c)||(c.originColIndex=c.columnIndex,c.columnIndex=this.getRegionIndex(c.children),c.columnValuesLength=i.length)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}}},e.prototype.getFacetsByLevel=function(t,e){var r=[];return t.forEach(function(t){t.rowIndex===e&&r.push(t)}),r},e.prototype.getRegionIndex=function(t){var e=t[0];return(t[t.length-1].columnIndex-e.columnIndex)/2+e.columnIndex},e.prototype.isLeaf=function(t){return!t.children||!t.children.length},e.prototype.getRows=function(){return this.cfg.fields.length+1},e.prototype.getChildFacets=function(t,e,r){var n=this,i=this.cfg.fields;if(!(i.length=r){var i=n.parsePosition([t[s],t[a.field]]);i&&f.push(i)}if(t[s]===c)return!1}),f},e.prototype.parsePercentPosition=function(t){var e=parseFloat(t[0])/100,r=parseFloat(t[1])/100,n=this.view.getCoordinate(),i=n.start,o=n.end,a=Math.min(i.x,o.x),s=Math.min(i.y,o.y);return{x:n.getWidth()*e+a,y:n.getHeight()*r+s}},e.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),e=t.start,r=t.end,n=t.getWidth(),i=t.getHeight(),o={x:Math.min(e.x,r.x),y:Math.min(e.y,r.y)};return{x:o.x,y:o.y,minX:o.x,minY:o.y,maxX:o.x+n,maxY:o.y+i,width:n,height:i}},e.prototype.getAnnotationCfg=function(t,e,r){var n=this,i=this.view.getCoordinate(),o=this.view.getCanvas(),a={};if((0,Uw.isNil)(e))return null;var s=e.start,u=e.end,l=e.position,c=this.parsePosition(s),f=this.parsePosition(u),h=this.parsePosition(l);if(!(!["arc","image","line","region","regionFilter"].includes(t)||c&&f))return null;if(["text","dataMarker","html"].includes(t)&&!h)return null;if("arc"===t){var p=e,d=(p.start,p.end,(0,Gw.__rest)(p,["start","end"])),y=lF(i,c),v=lF(i,f);y>v&&(v=2*Math.PI+v),a=(0,Gw.__assign)((0,Gw.__assign)({},d),{center:i.getCenter(),radius:uF(i,c),startAngle:y,endAngle:v})}else if("image"===t){var g=e;g.start,g.end,d=(0,Gw.__rest)(g,["start","end"]);a=(0,Gw.__assign)((0,Gw.__assign)({},d),{start:c,end:f,src:e.src})}else if("line"===t){var m=e;m.start,m.end,d=(0,Gw.__rest)(m,["start","end"]);a=(0,Gw.__assign)((0,Gw.__assign)({},d),{start:c,end:f,text:(0,Uw.get)(e,"text",null)})}else if("region"===t){var b=e;b.start,b.end,d=(0,Gw.__rest)(b,["start","end"]);a=(0,Gw.__assign)((0,Gw.__assign)({},d),{start:c,end:f})}else if("text"===t){var x=this.view.getData(),w=e,_=(w.position,w.content),S=(d=(0,Gw.__rest)(w,["position","content"]),_);(0,Uw.isFunction)(_)&&(S=_(x)),a=(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},h),d),{content:S})}else if("dataMarker"===t){var E=e,k=(E.position,E.point),T=E.line,C=E.text,O=E.autoAdjust,A=E.direction;d=(0,Gw.__rest)(E,["position","point","line","text","autoAdjust","direction"]);a=(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},d),h),{coordinateBBox:this.getCoordinateBBox(),point:k,line:T,text:C,autoAdjust:O,direction:A})}else if("dataRegion"===t){var P=e,M=P.start,I=P.end,L=P.region,j=(C=P.text,P.lineLength);d=(0,Gw.__rest)(P,["start","end","region","text","lineLength"]);a=(0,Gw.__assign)((0,Gw.__assign)({},d),{points:this.getRegionPoints(M,I),region:L,text:C,lineLength:j})}else if("regionFilter"===t){var N=e,R=(N.start,N.end,N.apply),D=N.color,B=(d=(0,Gw.__rest)(N,["start","end","apply","color"]),this.view.geometries),F=[],z=function t(e){e&&(e.isGroup()?e.getChildren().forEach(function(e){return t(e)}):F.push(e))};(0,Uw.each)(B,function(t){R?(0,Uw.contains)(R,t.type)&&(0,Uw.each)(t.elements,function(t){z(t.shape)}):(0,Uw.each)(t.elements,function(t){z(t.shape)})}),a=(0,Gw.__assign)((0,Gw.__assign)({},d),{color:D,shapes:F,start:c,end:f})}else if("shape"===t){var G=e,U=G.render,V=(0,Gw.__rest)(G,["render"]);a=(0,Gw.__assign)((0,Gw.__assign)({},V),{render:function(t){if((0,Uw.isFunction)(e.render))return U(t,n.view,{parsePosition:n.parsePosition.bind(n)})}})}else if("html"===t){var H=e,W=H.html;H.position,V=(0,Gw.__rest)(H,["html","position"]);a=(0,Gw.__assign)((0,Gw.__assign)((0,Gw.__assign)({},V),h),{parent:o.get("el").parentNode,html:function(t){return(0,Uw.isFunction)(W)?W(t,n.view):W}})}var q=(0,Uw.deepMix)({},r,(0,Gw.__assign)((0,Gw.__assign)({},a),{top:e.top,style:e.style,offsetX:e.offsetX,offsetY:e.offsetY}));return"html"!==t&&(q.container=this.getComponentContainer(q)),q.animate=this.view.getOptions().animate&&q.animate&&(0,Uw.get)(e,"animate",q.animate),q.animateOption=(0,Uw.deepMix)({},bG,q.animateOption,e.animateOption),q},e.prototype.isTop=function(t){return(0,Uw.get)(t,"top",!0)},e.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},e.prototype.getAnnotationTheme=function(t){return(0,Uw.get)(this.view.getTheme(),["components","annotation",t],{})},e.prototype.updateOrCreate=function(t){var e=this.cache.get(this.getCacheKey(t));if(e){var r=t.type,n=this.getAnnotationTheme(r),i=this.getAnnotationCfg(r,t,n);i&&iF(i,["container"]),e.component.update((0,Gw.__assign)((0,Gw.__assign)({},i||{}),{visible:!!i})),(0,Uw.includes)(oH,t.type)&&e.component.render()}else(e=this.createAnnotation(t))&&(e.component.init(),(0,Uw.includes)(oH,t.type)&&e.component.render());return e},e.prototype.syncCache=function(t){var e=this,r=new Map(this.cache);return t.forEach(function(t,e){r.set(e,t)}),r.forEach(function(t,n){(0,Uw.find)(e.option,function(t){return n===e.getCacheKey(t)})||(t.component.destroy(),r.delete(n))}),r},e.prototype.getCacheKey=function(t){return t},e}(dG);function sH(t,e){var r=(0,Uw.deepMix)({},(0,Uw.get)(t,["components","axis","common"]),(0,Uw.get)(t,["components","axis",e]));return(0,Uw.get)(r,["grid"],{})}function uH(t,e,r,n){var i=[],o=e.getTicks();return t.isPolar&&o.push({value:1,text:"",tickValue:""}),o.reduce(function(e,o,a){var s=o.value;if(n)i.push({points:[t.convert("y"===r?{x:0,y:s}:{x:s,y:0}),t.convert("y"===r?{x:1,y:s}:{x:s,y:1})]});else if(a){var u=(e.value+s)/2;i.push({points:[t.convert("y"===r?{x:0,y:u}:{x:u,y:0}),t.convert("y"===r?{x:1,y:u}:{x:u,y:1})]})}return o},o[0]),i}function lH(t,e,r,n,i){var o=e.values.length,a=[],s=r.getTicks();return s.reduce(function(e,r){var s=e?e.value:r.value,u=r.value,l=(s+u)/2;return"x"===i?a.push({points:[t.convert({x:n?u:l,y:0}),t.convert({x:n?u:l,y:1})]}):a.push({points:(0,Uw.map)(Array(o+1),function(e,r){return t.convert({x:r/o,y:n?u:l})})}),r},s[0]),a}function cH(t,e){var r=(0,Uw.get)(e,"grid");if(null===r)return!1;var n=(0,Uw.get)(t,"grid");return!(void 0===r&&null===n)}var fH=["container"],hH=(0,Gw.__assign)((0,Gw.__assign)({},bG),{appear:null}),pH=function(t){function e(e){var r=t.call(this,e)||this;return r.cache=new Map,r.gridContainer=r.view.getLayer(IN.BG).addGroup(),r.gridForeContainer=r.view.getLayer(IN.FORE).addGroup(),r.axisContainer=r.view.getLayer(IN.BG).addGroup(),r.axisForeContainer=r.view.getLayer(IN.FORE).addGroup(),r}return(0,Gw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this,e=this.view.getCoordinate();(0,Uw.each)(this.getComponents(),function(r){var n,i=r.component,o=r.direction,a=r.type,s=r.extra,u=s.dim,l=s.scale,c=s.alignTick;if(a===jN.AXIS)e.isPolar?"x"===u?n=e.isTransposed?vF(e,o):wF(e):"y"===u&&(n=e.isTransposed?wF(e):vF(e,o)):n=vF(e,o);else if(a===jN.GRID)if(e.isPolar){n={items:e.isTransposed?"x"===u?lH(e,t.view.getYScales()[0],l,c,u):uH(e,l,u,c):"x"===u?uH(e,l,u,c):lH(e,t.view.getXScale(),l,c,u),center:t.view.getCoordinate().getCenter()}}else n={items:uH(e,l,u,c)};i.update(n)})},e.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var e=new Map;this.cache.forEach(function(r,n){t.has(n)?e.set(n,r):r.component.destroy()}),this.cache=e},e.prototype.clear=function(){t.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},e.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(e){t.push(e)}),t},e.prototype.updateXAxes=function(t){var e=this.view.getXScale();if(e&&!e.isIdentity){var r=_F(this.option,e.field);if(!1!==r){var n=SF(r,LN.BOTTOM),i=IN.BG,o=this.view.getCoordinate(),a=this.getId("axis",e.field),s=this.getId("grid",e.field);if(o.isRect){if(u=this.cache.get(a))iF(c=this.getLineAxisCfg(e,r,n),fH),u.component.update(c),t.set(a,u);else u=this.createLineAxis(e,r,i,n,"x"),this.cache.set(a,u),t.set(a,u);if(l=this.cache.get(s))iF(c=this.getLineGridCfg(e,r,n,"x"),fH),l.component.update(c),t.set(s,l);else(l=this.createLineGrid(e,r,i,n,"x"))&&(this.cache.set(s,l),t.set(s,l))}else if(o.isPolar){var u,l;if(u=this.cache.get(a)){iF(c=o.isTransposed?this.getLineAxisCfg(e,r,LN.RADIUS):this.getCircleAxisCfg(e,r,n),fH),u.component.update(c),t.set(a,u)}else{if(o.isTransposed){if((0,Uw.isUndefined)(r))return;u=this.createLineAxis(e,r,i,LN.RADIUS,"x")}else u=this.createCircleAxis(e,r,i,n,"x");this.cache.set(a,u),t.set(a,u)}if(l=this.cache.get(s)){var c;iF(c=o.isTransposed?this.getCircleGridCfg(e,r,LN.RADIUS,"x"):this.getLineGridCfg(e,r,LN.CIRCLE,"x"),fH),l.component.update(c),t.set(s,l)}else{if(o.isTransposed){if((0,Uw.isUndefined)(r))return;l=this.createCircleGrid(e,r,i,LN.RADIUS,"x")}else l=this.createLineGrid(e,r,i,LN.CIRCLE,"x");l&&(this.cache.set(s,l),t.set(s,l))}}}}},e.prototype.updateYAxes=function(t){var e=this,r=this.view.getYScales();(0,Uw.each)(r,function(r,n){if(r&&!r.isIdentity){var i=r.field,o=_F(e.option,i);if(!1!==o){var a=IN.BG,s=e.getId("axis",i),u=e.getId("grid",i),l=e.view.getCoordinate();if(l.isRect){var c=SF(o,0===n?LN.LEFT:LN.RIGHT);if(f=e.cache.get(s))iF(p=e.getLineAxisCfg(r,o,c),fH),f.component.update(p),t.set(s,f);else f=e.createLineAxis(r,o,a,c,"y"),e.cache.set(s,f),t.set(s,f);if(h=e.cache.get(u))iF(p=e.getLineGridCfg(r,o,c,"y"),fH),h.component.update(p),t.set(u,h);else(h=e.createLineGrid(r,o,a,c,"y"))&&(e.cache.set(u,h),t.set(u,h))}else if(l.isPolar){var f,h;if(f=e.cache.get(s)){iF(p=l.isTransposed?e.getCircleAxisCfg(r,o,LN.CIRCLE):e.getLineAxisCfg(r,o,LN.RADIUS),fH),f.component.update(p),t.set(s,f)}else{if(l.isTransposed){if((0,Uw.isUndefined)(o))return;f=e.createCircleAxis(r,o,a,LN.CIRCLE,"y")}else f=e.createLineAxis(r,o,a,LN.RADIUS,"y");e.cache.set(s,f),t.set(s,f)}if(h=e.cache.get(u)){var p;iF(p=l.isTransposed?e.getLineGridCfg(r,o,LN.CIRCLE,"y"):e.getCircleGridCfg(r,o,LN.RADIUS,"y"),fH),h.component.update(p),t.set(u,h)}else{if(l.isTransposed){if((0,Uw.isUndefined)(o))return;h=e.createLineGrid(r,o,a,LN.CIRCLE,"y")}else h=e.createCircleGrid(r,o,a,LN.RADIUS,"y");h&&(e.cache.set(u,h),t.set(u,h))}}}}})},e.prototype.createLineAxis=function(t,e,r,n,i){var o={component:new UB(this.getLineAxisCfg(t,e,n)),layer:r,direction:n===LN.RADIUS?LN.NONE:n,type:jN.AXIS,extra:{dim:i,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createLineGrid=function(t,e,r,n,i){var o=this.getLineGridCfg(t,e,n,i);if(o){var a={component:new HB(o),layer:r,direction:LN.NONE,type:jN.GRID,extra:{dim:i,scale:t,alignTick:(0,Uw.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.createCircleAxis=function(t,e,r,n,i){var o={component:new VB(this.getCircleAxisCfg(t,e,n)),layer:r,direction:n,type:jN.AXIS,extra:{dim:i,scale:t}};return o.component.set("field",t.field),o.component.init(),o},e.prototype.createCircleGrid=function(t,e,r,n,i){var o=this.getCircleGridCfg(t,e,n,i);if(o){var a={component:new WB(o),layer:r,direction:LN.NONE,type:jN.GRID,extra:{dim:i,scale:t,alignTick:(0,Uw.get)(o,"alignTick",!0)}};return a.component.init(),a}},e.prototype.getLineAxisCfg=function(t,e,r){var n=(0,Uw.get)(e,["top"])?this.axisForeContainer:this.axisContainer,i=this.view.getCoordinate(),o=vF(i,r),a=EF(t,e),s=bF(this.view.getTheme(),r),u=(0,Uw.get)(e,["title"])?(0,Uw.deepMix)({title:{style:{text:a}}},{title:xF(this.view.getTheme(),r,e.title)},e):e,l=(0,Uw.deepMix)((0,Gw.__assign)((0,Gw.__assign)({container:n},o),{ticks:t.getTicks().map(function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}}),verticalFactor:i.isPolar?-1*mF(o,i.getCenter()):mF(o,i.getCenter()),theme:s}),s,u),c=this.getAnimateCfg(l),f=c.animate,h=c.animateOption;l.animateOption=h,l.animate=f;var p=gF(o),d=(0,Uw.get)(l,"verticalLimitLength",p?1/3:.5);if(d<=1){var y=this.view.getCanvas().get("width"),v=this.view.getCanvas().get("height");l.verticalLimitLength=d*(p?y:v)}return l},e.prototype.getLineGridCfg=function(t,e,r,n){if(cH(bF(this.view.getTheme(),r),e)){var i=sH(this.view.getTheme(),r),o=(0,Uw.deepMix)({container:(0,Uw.get)(e,["top"])?this.gridForeContainer:this.gridContainer},i,(0,Uw.get)(e,"grid"),this.getAnimateCfg(e));return o.items=uH(this.view.getCoordinate(),t,n,(0,Uw.get)(o,"alignTick",!0)),o}},e.prototype.getCircleAxisCfg=function(t,e,r){var n=(0,Uw.get)(e,["top"])?this.axisForeContainer:this.axisContainer,i=this.view.getCoordinate(),o=t.getTicks().map(function(t){return{id:"".concat(t.tickValue),name:t.text,value:t.value}});t.isCategory||Math.abs(i.endAngle-i.startAngle)!==2*Math.PI||o.length&&(o[o.length-1].name="");var a=EF(t,e),s=bF(this.view.getTheme(),LN.CIRCLE),u=(0,Uw.get)(e,["title"])?(0,Uw.deepMix)({title:{style:{text:a}}},{title:xF(this.view.getTheme(),r,e.title)},e):e,l=(0,Uw.deepMix)((0,Gw.__assign)((0,Gw.__assign)({container:n},wF(this.view.getCoordinate())),{ticks:o,verticalFactor:1,theme:s}),s,u),c=this.getAnimateCfg(l),f=c.animate,h=c.animateOption;return l.animate=f,l.animateOption=h,l},e.prototype.getCircleGridCfg=function(t,e,r,n){if(cH(bF(this.view.getTheme(),r),e)){var i=sH(this.view.getTheme(),LN.RADIUS),o=(0,Uw.deepMix)({container:(0,Uw.get)(e,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},i,(0,Uw.get)(e,"grid"),this.getAnimateCfg(e)),a=(0,Uw.get)(o,"alignTick",!0),s="x"===n?this.view.getYScales()[0]:this.view.getXScale();return o.items=lH(this.view.getCoordinate(),s,t,a,n),o}},e.prototype.getId=function(t,e){var r=this.view.getCoordinate();return"".concat(t,"-").concat(e,"-").concat(r.type)},e.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&(0,Uw.get)(t,"animate"),animateOption:t&&t.animateOption?(0,Uw.deepMix)({},hH,t.animateOption):hH}},e}(dG);function dH(t,e,r){return r===LN.TOP?[t.minX+t.width/2-e.width/2,t.minY]:r===LN.BOTTOM?[t.minX+t.width/2-e.width/2,t.maxY-e.height]:r===LN.LEFT?[t.minX,t.minY+t.height/2-e.height/2]:r===LN.RIGHT?[t.maxX-e.width,t.minY+t.height/2-e.height/2]:r===LN.TOP_LEFT||r===LN.LEFT_TOP?[t.tl.x,t.tl.y]:r===LN.TOP_RIGHT||r===LN.RIGHT_TOP?[t.tr.x-e.width,t.tr.y]:r===LN.BOTTOM_LEFT||r===LN.LEFT_BOTTOM?[t.bl.x,t.bl.y-e.height]:r===LN.BOTTOM_RIGHT||r===LN.RIGHT_BOTTOM?[t.br.x-e.width,t.br.y-e.height]:[0,0]}function yH(t,e){return(0,Uw.isBoolean)(t)?!1!==t&&{}:(0,Uw.get)(t,[e],t)}function vH(t){return(0,Uw.get)(t,"position",LN.BOTTOM)}var gH=function(t){function e(e){var r=t.call(this,e)||this;return r.container=r.view.getLayer(IN.FORE).addGroup(),r}return(0,Gw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),e.prototype.init=function(){},e.prototype.render=function(){this.update()},e.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,(0,Uw.each)(this.components,function(e){var r=e.component,n=e.direction,i=eU(n),o=r.get("maxWidthRatio"),a=r.get("maxHeightRatio"),s=t.getCategoryLegendSizeCfg(i,o,a),u=r.get("maxWidth"),l=r.get("maxHeight");r.update({maxWidth:Math.min(s.maxWidth,u||0),maxHeight:Math.min(s.maxHeight,l||0)});var c=r.get("padding"),f=r.getLayoutBBox(),h=new aF(f.x,f.y,f.width,f.height).expand(c),p=(0,Gw.__read)(dH(t.view.viewBBox,h,n),2),d=p[0],y=p[1],v=(0,Gw.__read)(dH(t.layoutBBox,h,n),2),g=v[0],m=v[1],b=0,x=0;n.startsWith("top")||n.startsWith("bottom")?(b=d,x=m):(b=g,x=y),r.setLocation({x:b+c[3],y:x+c[0]}),t.layoutBBox=t.layoutBBox.cut(h,n)})},e.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var e={};if((0,Uw.get)(this.option,"custom")){var r="global-custom",n=this.getComponentById(r);if(n){var i=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);iF(i,["container"]),n.component.update(i),e[r]=!0}else{var o=this.createCustomLegend(void 0,void 0,void 0,this.option);if(o){o.init();var a=IN.FORE,s=vH(this.option);this.components.push({id:r,component:o,layer:a,direction:s,type:jN.LEGEND,extra:void 0}),e[r]=!0}}}else this.loopLegends(function(r,n,i){var o=t.getId(i.field),a=t.getComponentById(o);if(a){var s=void 0,u=yH(t.option,i.field);!1!==u&&((0,Uw.get)(u,"custom")?s=t.getCategoryCfg(r,n,i,u,!0):i.isLinear?s=t.getContinuousCfg(r,n,i,u):i.isCategory&&(s=t.getCategoryCfg(r,n,i,u))),s&&(iF(s,["container"]),a.direction=vH(u),a.component.update(s),e[o]=!0)}else{var l=t.createFieldLegend(r,n,i);l&&(l.component.init(),t.components.push(l),e[o]=!0)}});var u=[];(0,Uw.each)(this.getComponents(),function(t){e[t.id]?u.push(t):t.component.destroy()}),this.components=u},e.prototype.clear=function(){t.prototype.clear.call(this),this.container.clear()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.container.remove(!0)},e.prototype.getGeometries=function(t){var e=this,r=t.geometries;return(0,Uw.each)(t.views,function(t){r=r.concat(e.getGeometries(t))}),r},e.prototype.loopLegends=function(t){if(this.view.getRootView()===this.view){var e=this.getGeometries(this.view),r={};(0,Uw.each)(e,function(e){var n=e.getGroupAttributes();(0,Uw.each)(n,function(n){var i=n.getScale(n.type);i&&"identity"!==i.type&&!r[i.field]&&(t(e,n,i),r[i.field]=!0)})})}},e.prototype.createFieldLegend=function(t,e,r){var n,i=yH(this.option,r.field),o=IN.FORE,a=vH(i);if(!1!==i&&((0,Uw.get)(i,"custom")?n=this.createCustomLegend(t,e,r,i):r.isLinear?n=this.createContinuousLegend(t,e,r,i):r.isCategory&&(n=this.createCategoryLegend(t,e,r,i))),n)return n.set("field",r.field),{id:this.getId(r.field),component:n,layer:o,direction:a,type:jN.LEGEND,extra:{scale:r}}},e.prototype.createCustomLegend=function(t,e,r,n){var i=this.getCategoryCfg(t,e,r,n,!0);return new qB(i)},e.prototype.createContinuousLegend=function(t,e,r,n){var i=this.getContinuousCfg(t,e,r,iF(n,["value"]));return new YB(i)},e.prototype.createCategoryLegend=function(t,e,r,n){var i=this.getCategoryCfg(t,e,r,n);return new qB(i)},e.prototype.getContinuousCfg=function(t,e,r,n){var i=r.getTicks(),o=(0,Uw.find)(i,function(t){return 0===t.value}),a=(0,Uw.find)(i,function(t){return 1===t.value}),s=i.map(function(t){var n=t.value,i=t.tickValue,o=e.mapping(r.invert(n)).join("");return{value:i,attrValue:o,color:o,scaleValue:n}});o||s.push({value:r.min,attrValue:e.mapping(r.invert(0)).join(""),color:e.mapping(r.invert(0)).join(""),scaleValue:0}),a||s.push({value:r.max,attrValue:e.mapping(r.invert(1)).join(""),color:e.mapping(r.invert(1)).join(""),scaleValue:1}),s.sort(function(t,e){return t.value-e.value});var u={min:(0,Uw.head)(s).value,max:(0,Uw.last)(s).value,colors:[],rail:{type:e.type},track:{}};"size"===e.type&&(u.track={style:{fill:"size"===e.type?this.view.getTheme().defaultColor:void 0}}),"color"===e.type&&(u.colors=s.map(function(t){return t.attrValue}));var l=this.container,c=eU(vH(n)),f=(0,Uw.get)(n,"title");return f&&(f=(0,Uw.deepMix)({text:dF(r)},f)),u.container=l,u.layout=c,u.title=f,u.animateOption=bG,this.mergeLegendCfg(u,n,"continuous")},e.prototype.getCategoryCfg=function(t,e,r,n,i){var o=this.container,a=(0,Uw.get)(n,"position",LN.BOTTOM),s=nU(this.view.getTheme(),a),u=(0,Uw.get)(s,["marker"]),l=(0,Uw.get)(n,"marker"),c=eU(a),f=(0,Uw.get)(s,["pageNavigator"]),h=(0,Uw.get)(n,"pageNavigator"),p=i?function(t,e,r){return r.map(function(r,n){var i=e;(0,Uw.isFunction)(i)&&(i=i(r.name,n,(0,Uw.deepMix)({},t,r)));var o=(0,Uw.isFunction)(r.marker)?r.marker(r.name,n,(0,Uw.deepMix)({},t,r)):r.marker,a=(0,Uw.deepMix)({},t,i,o);return tU(a),r.marker=a,r})}(u,l,n.items):rU(this.view,t,e,u,l),d=(0,Uw.get)(n,"title");d&&(d=(0,Uw.deepMix)({text:r?dF(r):""},d));var y=(0,Uw.get)(n,"maxWidthRatio"),v=(0,Uw.get)(n,"maxHeightRatio"),g=this.getCategoryLegendSizeCfg(c,y,v);g.container=o,g.layout=c,g.items=p,g.title=d,g.animateOption=bG,g.pageNavigator=(0,Uw.deepMix)({},f,h);var m=this.mergeLegendCfg(g,n,a);m.reversed&&m.items.reverse();var b=(0,Uw.get)(m,"maxItemWidth");return b&&b<=1&&(m.maxItemWidth=this.view.viewBBox.width*b),m},e.prototype.mergeLegendCfg=function(t,e,r){var n=r.split("-")[0],i=nU(this.view.getTheme(),n);return(0,Uw.deepMix)({},i,t,e)},e.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},e.prototype.getComponentById=function(t){return(0,Uw.find)(this.components,function(e){return e.id===t})},e.prototype.getCategoryLegendSizeCfg=function(t,e,r){void 0===e&&(e=.25),void 0===r&&(r=.25);var n=this.view.viewBBox,i=n.width,o=n.height;return"vertical"===t?{maxWidth:i*e,maxHeight:o}:{maxWidth:i,maxHeight:o*r}},e}(dG),mH=function(t){function e(e){var r=t.call(this,e)||this;return r.onChangeFn=Uw.noop,r.resetMeasure=function(){r.clear()},r.onValueChange=function(t){var e=(0,Gw.__read)(t,2),n=e[0],i=e[1];r.start=n,r.end=i,r.changeViewData(n,i)},r.container=r.view.getLayer(IN.FORE).addGroup(),r.onChangeFn=(0,Uw.throttle)(r.onValueChange,20,{leading:!0}),r.width=0,r.view.on(RN.BEFORE_CHANGE_DATA,r.resetMeasure),r.view.on(RN.BEFORE_CHANGE_SIZE,r.resetMeasure),r}return(0,Gw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(RN.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(RN.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),e=t.start,r=t.end;(0,Uw.isNil)(this.start)&&(this.start=e,this.end=r);var n=this.view.getOptions().data;this.option&&!(0,Uw.isEmpty)(n)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var e=this.view.coordinateBBox.width,r=this.slider.component.get("padding"),n=(0,Gw.__read)(r,4),i=n[0],o=(n[1],n[2],n[3]),a=this.slider.component.getLayoutBBox(),s=new aF(a.x,a.y,Math.min(a.width,e),a.height).expand(r),u=this.getMinMaxText(this.start,this.end),l=u.minText,c=u.maxText,f=(0,Gw.__read)(dH(this.view.viewBBox,s,LN.BOTTOM),2),h=(f[0],f[1]),p=(0,Gw.__read)(dH(this.view.coordinateBBox,s,LN.BOTTOM),2),d=p[0];p[1];this.slider.component.update((0,Gw.__assign)((0,Gw.__assign)({},this.getSliderCfg()),{x:d+o,y:h+i,width:this.width,start:this.start,end:this.end,minText:l,maxText:c})),this.view.viewBBox=this.view.viewBBox.cut(s,LN.BOTTOM)}},e.prototype.update=function(){this.render()},e.prototype.createSlider=function(){var t=this.getSliderCfg(),e=new FB((0,Gw.__assign)({container:this.container},t));return e.init(),{component:e,layer:IN.FORE,direction:LN.BOTTOM,type:jN.SLIDER}},e.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var e=this.getMinMaxText(this.start,this.end),r=e.minText,n=e.maxText;t=(0,Gw.__assign)((0,Gw.__assign)({},t),{width:this.width,start:this.start,end:this.end,minText:r,maxText:n})}return this.slider.component.update(t),this.slider},e.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},e.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if((0,Uw.isObject)(this.option)){var e=(0,Gw.__assign)({data:this.getData()},(0,Uw.get)(this.option,"trendCfg",{}));t=(0,Uw.deepMix)({},t,this.getThemeOptions(),this.option),t=(0,Gw.__assign)((0,Gw.__assign)({},t),{trendCfg:e})}return t.start=(0,Uw.clamp)(Math.min((0,Uw.isNil)(t.start)?0:t.start,(0,Uw.isNil)(t.end)?1:t.end),0,1),t.end=(0,Uw.clamp)(Math.max((0,Uw.isNil)(t.start)?0:t.start,(0,Uw.isNil)(t.end)?1:t.end),0,1),t},e.prototype.getData=function(){var t=this.view.getOptions().data,e=(0,Gw.__read)(this.view.getYScales(),1)[0],r=this.view.getGroupScales();if(r.length){var n=r[0],i=n.field,o=n.ticks;return t.reduce(function(t,r){return r[i]===o[0]&&t.push(r[e.field]),t},[])}return t.map(function(t){return t[e.field]||0})},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Uw.get)(t,["components","slider","common"],{})},e.prototype.getMinMaxText=function(t,e){var r=this.view.getOptions().data,n=this.view.getXScale(),i=(0,Uw.valuesOfKey)(r,n.field);n.isLinear&&(i=i.sort());var o=i,a=(0,Uw.size)(r);if(!n||!a)return{};var s=(0,Uw.size)(o),u=Math.round(t*(s-1)),l=Math.round(e*(s-1)),c=(0,Uw.get)(o,[u]),f=(0,Uw.get)(o,[l]),h=this.getSliderCfg().formatter;return h&&(c=h(c,r[u],u),f=h(f,r[l],l)),{minText:c,maxText:f}},e.prototype.changeViewData=function(t,e){var r=this.view.getOptions().data,n=this.view.getXScale(),i=(0,Uw.size)(r);if(n&&i){var o=(0,Uw.valuesOfKey)(r,n.field),a=this.view.getXScale().isLinear?o.sort(function(t,e){return Number(t)-Number(e)}):o,s=a,u=(0,Uw.size)(s),l=Math.round(t*(u-1)),c=Math.round(e*(u-1));this.view.filter(n.field,function(t,e){var r=s.indexOf(t);return!(r>-1)||nF(r,l,c)}),this.view.render(!0)}},e.prototype.getComponents=function(){return this.slider?[this.slider]:[]},e.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},e}(dG),bH=function(t){function e(e){var r=t.call(this,e)||this;return r.onChangeFn=Uw.noop,r.resetMeasure=function(){r.clear()},r.onValueChange=function(t){var e=t.ratio,n=r.getValidScrollbarCfg().animate;r.ratio=(0,Uw.clamp)(e,0,1);var i=r.view.getOptions().animate;n||r.view.animate(!1),r.changeViewData(r.getScrollRange(),!0),r.view.animate(i)},r.container=r.view.getLayer(IN.FORE).addGroup(),r.onChangeFn=(0,Uw.throttle)(r.onValueChange,20,{leading:!0}),r.trackLen=0,r.thumbLen=0,r.ratio=0,r.view.on(RN.BEFORE_CHANGE_DATA,r.resetMeasure),r.view.on(RN.BEFORE_CHANGE_SIZE,r.resetMeasure),r}return(0,Gw.__extends)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.view.off(RN.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(RN.BEFORE_CHANGE_SIZE,this.resetMeasure)},e.prototype.init=function(){},e.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},e.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var e=this.view.coordinateBBox.width,r=this.scrollbar.component.get("padding"),n=this.scrollbar.component.getLayoutBBox(),i=new aF(n.x,n.y,Math.min(n.width,e),n.height).expand(r),o=this.getScrollbarComponentCfg(),a=void 0,s=void 0;if(o.isHorizontal){var u=(0,Gw.__read)(dH(this.view.viewBBox,i,LN.BOTTOM),2),l=(u[0],u[1]),c=(0,Gw.__read)(dH(this.view.coordinateBBox,i,LN.BOTTOM),2),f=c[0];c[1];a=f,s=l}else{var h=(0,Gw.__read)(dH(this.view.viewBBox,i,LN.RIGHT),2),p=(h[0],l=h[1],(0,Gw.__read)(dH(this.view.viewBBox,i,LN.RIGHT),2));f=p[0],p[1];a=f,s=l}a+=r[3],s+=r[0],this.trackLen?this.scrollbar.component.update((0,Gw.__assign)((0,Gw.__assign)({},o),{x:a,y:s,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update((0,Gw.__assign)((0,Gw.__assign)({},o),{x:a,y:s})),this.view.viewBBox=this.view.viewBBox.cut(i,o.isHorizontal?LN.BOTTOM:LN.RIGHT)}},e.prototype.update=function(){this.render()},e.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},e.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},e.prototype.setValue=function(t){this.onValueChange({ratio:t})},e.prototype.getValue=function(){return this.ratio},e.prototype.getThemeOptions=function(){var t=this.view.getTheme();return(0,Uw.get)(t,["components","scrollbar","common"],{})},e.prototype.getScrollbarTheme=function(t){var e=(0,Uw.get)(this.view.getTheme(),["components","scrollbar"]),r=t||{},n=r.thumbHighlightColor,i=(0,Gw.__rest)(r,["thumbHighlightColor"]);return{default:(0,Uw.deepMix)({},(0,Uw.get)(e,["default","style"],{}),i),hover:(0,Uw.deepMix)({},(0,Uw.get)(e,["hover","style"],{}),{thumbColor:n})}},e.prototype.measureScrollbar=function(){var t=this.view.getXScale(),e=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var r=this.getScrollbarComponentCfg(),n=r.trackLen,i=r.thumbLen;this.trackLen=n,this.thumbLen=i,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=e},e.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*(0,Uw.clamp)(this.ratio,0,1));return[t,Math.min(t+this.step-1,this.cnt-1)]},e.prototype.changeViewData=function(t,e){var r=this,n=(0,Gw.__read)(t,2),i=n[0],o=n[1],a="vertical"!==this.getValidScrollbarCfg().type,s=(0,Uw.valuesOfKey)(this.data,this.xScaleCfg.field),u=this.view.getXScale().isLinear?s.sort(function(t,e){return Number(t)-Number(e)}):s,l=a?u:u.reverse();this.yScalesCfg.forEach(function(t){r.view.scale(t.field,{formatter:t.formatter,type:t.type,min:t.min,max:t.max,tickMethod:t.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(t){var e=l.indexOf(t);return!(e>-1)||nF(e,i,o)}),this.view.render(!0)},e.prototype.createScrollbar=function(){var t="vertical"!==this.getValidScrollbarCfg().type,e=new GB((0,Gw.__assign)((0,Gw.__assign)({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return e.init(),{component:e,layer:IN.FORE,direction:t?LN.BOTTOM:LN.RIGHT,type:jN.SCROLLBAR}},e.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),e=this.trackLen?(0,Gw.__assign)((0,Gw.__assign)({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):(0,Gw.__assign)({},t);return this.scrollbar.component.update(e),this.scrollbar},e.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,e=this.getValidScrollbarCfg(),r=e.type,n=e.categorySize,i="vertical"!==r;return Math.floor((i?t.width:t.height)/n)},e.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),e=this.getScrollbarData(),r=(0,Uw.valuesOfKey)(e,t.field);return(0,Uw.size)(r)},e.prototype.getScrollbarComponentCfg=function(){var t=this.view,e=t.coordinateBBox,r=t.viewBBox,n=this.getValidScrollbarCfg(),i=n.type,o=n.padding,a=n.width,s=n.height,u=n.style,l="vertical"!==i,c=(0,Gw.__read)(o,4),f=c[0],h=c[1],p=c[2],d=c[3],y=l?{x:e.minX+d,y:r.maxY-s-p}:{x:r.maxX-a-h,y:e.minY+f},v=this.getStep(),g=this.getCnt(),m=l?e.width-d-h:e.height-f-p,b=Math.max(m*(0,Uw.clamp)(v/g,0,1),20);return(0,Gw.__assign)((0,Gw.__assign)({},this.getThemeOptions()),{x:y.x,y:y.y,size:l?s:a,isHorizontal:l,trackLen:m,thumbLen:b,thumbOffset:0,theme:this.getScrollbarTheme(u)})},e.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:32,width:8,height:8,padding:[0,0,0,0],animate:!0,style:{}};return(0,Uw.isObject)(this.option)&&(t=(0,Gw.__assign)((0,Gw.__assign)({},t),this.option)),(0,Uw.isObject)(this.option)&&this.option.padding||(t.padding=(t.type,[0,0,0,0])),t},e.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),e=this.getValidScrollbarCfg(),r=this.view.getOptions().data||[];return t.isReflect("y")&&"vertical"===e.type&&(r=(0,Gw.__spreadArray)([],(0,Gw.__read)(r),!1).reverse()),r},e}(dG),xH={fill:"#CCD6EC",opacity:.3};function wH(t,e,r){var n,i,o,a,s,u,l=function(t,e,r){var n,i,o=$z(t,e,r);try{for(var a=(0,Gw.__values)(t.views),s=a.next();!s.done;s=a.next()){var u=s.value;o=o.concat($z(u,e,r))}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return o}(t,e,r);if(l.length){l=(0,Uw.flatten)(l);try{for(var c=(0,Gw.__values)(l),f=c.next();!f.done;f=c.next()){var h=f.value;try{for(var p=(o=void 0,(0,Gw.__values)(h)),d=p.next();!d.done;d=p.next()){var y=d.value,v=y.mappingData,g=v.x,m=v.y;y.x=(0,Uw.isArray)(g)?g[g.length-1]:g,y.y=(0,Uw.isArray)(m)?m[m.length-1]:m}}catch(t){o={error:t}}finally{try{d&&!d.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}if(!1===r.shared&&l.length>1){var b=l[0],x=Math.abs(e.y-b[0].y);try{for(var w=(0,Gw.__values)(l),_=w.next();!_.done;_=w.next()){var S=_.value,E=Math.abs(e.y-S[0].y);E<=x&&(b=S,x=E)}}catch(t){s={error:t}}finally{try{_&&!_.done&&(u=w.return)&&u.call(w)}finally{if(s)throw s.error}}l=[b]}return(0,Uw.uniq)((0,Uw.flatten)(l))}return[]}var _H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.show=function(t){var e=this.context.view,r=this.context.event,n=e.getController("tooltip").getTooltipCfg(),i=wH(e,{x:r.x,y:r.y},n);if(!(0,Uw.isEqual)(i,this.items)&&(this.items=i,i.length)){var o=e.getXScale().field,a=i[0].data[o],s=[],u=e.geometries;if((0,Uw.each)(u,function(t){if("interval"===t.type||"schema"===t.type){var e=t.getElementsBy(function(t){return t.getData()[o]===a});s=s.concat(e)}}),s.length){var l=e.getCoordinate(),c=s[0].shape.getCanvasBBox(),f=s[0].shape.getCanvasBBox(),h=c;(0,Uw.each)(s,function(t){var e=t.shape.getCanvasBBox();l.isTransposed?(e.minYf.maxY&&(f=e)):(e.minXf.maxX&&(f=e)),h.x=Math.min(e.minX,h.minX),h.y=Math.min(e.minY,h.minY),h.width=Math.max(e.maxX,h.maxX)-h.x,h.height=Math.max(e.maxY,h.maxY)-h.y});var p=e.backgroundGroup,d=e.coordinateBBox,y=void 0;if(l.isRect){var v=e.getXScale(),g=t||{},m=g.appendRatio,b=g.appendWidth;(0,Uw.isNil)(b)&&(m=(0,Uw.isNil)(m)?v.isLinear?0:.25:m,b=l.isTransposed?m*f.height:m*c.width);var x=void 0,w=void 0,_=void 0,S=void 0;l.isTransposed?(x=d.minX,w=Math.min(f.minY,c.minY)-b,_=d.width,S=h.height+2*b):(x=Math.min(c.minX,f.minX)-b,w=d.minY,_=h.width+2*b,S=d.height),y=[["M",x,w],["L",x+_,w],["L",x+_,w+S],["L",x,w+S],["Z"]]}else{var E=(0,Uw.head)(s),k=(0,Uw.last)(s),T=tF(E.getModel(),l).startAngle,C=tF(k.getModel(),l).endAngle,O=l.getCenter(),A=l.getRadius(),P=l.innerRadius*A;y=QB(O.x,O.y,A,T,C,P)}if(this.regionPath)this.regionPath.attr("path",y),this.regionPath.show();else{var M=(0,Uw.get)(t,"style",xH);this.regionPath=p.addShape({type:"path",name:"active-region",capture:!1,attrs:(0,Gw.__assign)((0,Gw.__assign)({},M),{path:y})})}}}},e.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},e.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),t.prototype.destroy.call(this)},e}(AF),SH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Gw.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=t.event,r=t.view;if(!r.isTooltipLocked()){var n=this.timeStamp,i=+new Date;if(i-n>(0,Uw.get)(t.view.getOptions(),"tooltip.showDelay",16)){var o=this.location,a={x:e.x,y:e.y};o&&(0,Uw.isEqual)(o,a)||this.showTooltip(r,a),this.timeStamp=i,this.location=a}}},e.prototype.hide=function(){var t=this.context.view,e=t.getController("tooltip"),r=this.context.event,n=r.clientX,i=r.clientY;e.isCursorEntered({x:n,y:i})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},e.prototype.showTooltip=function(t,e){t.showTooltip(e)},e.prototype.hideTooltip=function(t){t.hideTooltip()},e}(AF),EH=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.showTooltip=function(t,e){var r=fz(t);(0,Uw.each)(r,function(r){var n=hz(t,r,e);r.showTooltip(n)})},e.prototype.hideTooltip=function(t){var e=fz(t);(0,Uw.each)(e,function(t){t.hideTooltip()})},e}(SH),kH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Gw.__extends)(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.show=function(){var t=this.context.event,e=this.timeStamp,r=+new Date;if(r-e>16){var n=this.location,i={x:t.x,y:t.y};n&&(0,Uw.isEqual)(n,i)||this.showTooltip(i),this.timeStamp=r,this.location=i}},e.prototype.hide=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context,r=e.event.target;if(r&&r.get("tip")){if(this.tooltip){var n=e.view.canvas,i={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}};this.tooltip.set("region",i)}else this.renderTooltip();var o=r.get("tip");this.tooltip.update((0,Gw.__assign)({title:o},t)),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view,r=e.canvas,n={start:{x:0,y:0},end:{x:r.get("width"),y:r.get("height")}},i=e.getTheme(),o=(0,Uw.get)(i,["components","tooltip","domStyles"],{}),a=new XB({parent:r.get("el").parentNode,region:n,visible:!1,crosshairs:null,domStyles:(0,Gw.__assign)({},(0,Uw.deepMix)({},o,(t={},t[dB]={"max-width":"50%"},t[yB]={"word-break":"break-all"},t)))});a.init(),a.setCapture(!1),this.tooltip=a},e}(AF),TH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e}return(0,Gw.__extends)(e,t),e.prototype.hasState=function(t){return t.hasState(this.stateName)},e.prototype.setElementState=function(t,e){t.setState(this.stateName,e)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},e.prototype.clearViewState=function(t){var e=this,r=nz(t,this.stateName);(0,Uw.each)(r,function(t){e.setElementState(t,!1)})},e}(AF);function CH(t){return(0,Uw.get)(t.get("delegateObject"),"item")}var OH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ignoreListItemStates=["unchecked"],e}return(0,Gw.__extends)(e,t),e.prototype.isItemIgnore=function(t,e){return!!this.ignoreListItemStates.filter(function(r){return e.hasState(t,r)}).length},e.prototype.setStateByComponent=function(t,e,r){var n=this.context.view,i=t.get("field"),o=rz(n);this.setElementsStateByItem(o,i,e,r)},e.prototype.setStateByElement=function(t,e){this.setElementState(t,e)},e.prototype.isMathItem=function(t,e,r){var n=dz(this.context.view,e),i=iz(t,e);return!(0,Uw.isNil)(i)&&r.name===n.getText(i)},e.prototype.setElementsStateByItem=function(t,e,r,n){var i=this;(0,Uw.each)(t,function(t){i.isMathItem(t,e,r)&&t.setState(i.stateName,n)})},e.prototype.setStateEnable=function(t){var e=qF(this.context);if(e)XF(this.context)&&this.setStateByElement(e,t);else{var r=YF(this.context);if(ZF(r)){var n=r.item,i=r.component;if(n&&i&&!this.isItemIgnore(n,i)){var o=this.context.event.gEvent;if(o&&o.fromShape&&o.toShape&&CH(o.fromShape)===CH(o.toShape))return;this.setStateByComponent(i,n,t)}}}},e.prototype.toggle=function(){var t=qF(this.context);if(t){var e=t.hasState(this.stateName);this.setElementState(t,!e)}},e.prototype.reset=function(){this.setStateEnable(!1)},e}(TH),AH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Gw.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(OH),PH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.cache={},e}return(0,Gw.__extends)(e,t),e.prototype.getColorScale=function(t,e){var r=e.geometry.getAttribute("color");return r?t.getScaleByField(r.getFields()[0]):null},e.prototype.getLinkPath=function(t,e){var r=this.context.view.getCoordinate().isTransposed,n=t.shape.getCanvasBBox(),i=e.shape.getCanvasBBox();return r?[["M",n.minX,n.minY],["L",i.minX,i.maxY],["L",i.maxX,i.maxY],["L",n.maxX,n.minY],["Z"]]:[["M",n.maxX,n.minY],["L",i.minX,i.minY],["L",i.minX,i.maxY],["L",n.maxX,n.maxY],["Z"]]},e.prototype.addLinkShape=function(t,e,r,n){var i={opacity:.4,fill:e.shape.attr("fill")};t.addShape({type:"path",attrs:(0,Gw.__assign)((0,Gw.__assign)({},(0,Uw.deepMix)({},i,(0,Uw.isFunction)(n)?n(i,e):n)),{path:this.getLinkPath(e,r)})})},e.prototype.linkByElement=function(t,e){var r=this,n=this.context.view,i=this.getColorScale(n,t);if(i){var o=iz(t,i.field);if(!this.cache[o]){var a=function(t,e,r){return rz(t).filter(function(t){return iz(t,e)===r})}(n,i.field,o),s=this.linkGroup.addGroup();this.cache[o]=s;var u=a.length;(0,Uw.each)(a,function(t,n){if(n=0},e)},e}(MH),qH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Gw.__extends)(e,t),e.prototype.highlight=function(){this.setState()},e.prototype.setElementState=function(t,e){BH(rz(this.context.view),function(e){return t===e},e)},e.prototype.clear=function(){DH(this.context.view)},e}(LH),YH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(MH),XH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(OH),ZH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(LH),KH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="",e.ignoreItemStates=[],e}return(0,Gw.__extends)(e,t),e.prototype.getTriggerListInfo=function(){var t=YF(this.context),e=null;return ZF(t)&&(e={item:t.item,list:t.component}),e},e.prototype.getAllowComponents=function(){var t=this,e=uz(this.context.view),r=[];return(0,Uw.each)(e,function(e){e.isList()&&t.allowSetStateByElement(e)&&r.push(e)}),r},e.prototype.hasState=function(t,e){return t.hasState(e,this.stateName)},e.prototype.clearAllComponentsState=function(){var t=this,e=this.getAllowComponents();(0,Uw.each)(e,function(e){e.clearItemsState(t.stateName)})},e.prototype.allowSetStateByElement=function(t){var e=t.get("field");if(!e)return!1;if(this.cfg&&this.cfg.componentNames){var r=t.get("name");if(-1===this.cfg.componentNames.indexOf(r))return!1}var n=dz(this.context.view,e);return n&&n.isCategory},e.prototype.allowSetStateByItem=function(t,e){var r=this.ignoreItemStates;return!r.length||0===r.filter(function(r){return e.hasState(t,r)}).length},e.prototype.setStateByElement=function(t,e,r){var n=t.get("field"),i=dz(this.context.view,n),o=iz(e,n),a=i.getText(o);this.setItemsState(t,a,r)},e.prototype.setStateEnable=function(t){var e=this,r=qF(this.context);if(r){var n=this.getAllowComponents();(0,Uw.each)(n,function(n){e.setStateByElement(n,r,t)})}else{var i=YF(this.context);if(ZF(i)){var o=i.item,a=i.component;this.allowSetStateByElement(a)&&this.allowSetStateByItem(o,a)&&this.setItemState(a,o,t)}}},e.prototype.setItemsState=function(t,e,r){var n=this,i=t.getItems();(0,Uw.each)(i,function(i){i.name===e&&n.setItemState(t,i,r)})},e.prototype.setItemState=function(t,e,r){t.setItemState(e,this.stateName,r)},e.prototype.setState=function(){this.setStateEnable(!0)},e.prototype.reset=function(){this.setStateEnable(!1)},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,r=t.item,n=this.hasState(e,r);this.setItemState(e,r,!n)}},e.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},e}(AF),JH=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="active",e}return(0,Gw.__extends)(e,t),e.prototype.active=function(){this.setState()},e}(KH),QH="inactive",$H="active";var tW="active",eW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName=tW,e.ignoreItemStates=["unchecked"],e}return(0,Gw.__extends)(e,t),e.prototype.setItemsState=function(t,e,r){this.setHighlightBy(t,function(t){return t.name===e},r)},e.prototype.setItemState=function(t,e,r){t.getItems();this.setHighlightBy(t,function(t){return t===e},r)},e.prototype.setHighlightBy=function(t,e,r){var n=t.getItems();if(r)(0,Uw.each)(n,function(r){e(r)?(t.hasState(r,"inactive")&&t.setItemState(r,"inactive",!1),t.setItemState(r,tW,!0)):t.hasState(r,tW)||t.setItemState(r,"inactive",!0)});else{var i=t.getItemsByState(tW),o=!0;(0,Uw.each)(i,function(t){if(!e(t))return o=!1,!1}),o?this.clear():(0,Uw.each)(n,function(r){e(r)&&(t.hasState(r,tW)&&t.setItemState(r,tW,!1),t.setItemState(r,"inactive",!0))})}},e.prototype.highlight=function(){this.setState()},e.prototype.clear=function(){var t,e,r=this.getTriggerListInfo();if(r)t=r.list,e=t.getItems(),(0,Uw.each)(e,function(e){t.hasState(e,$H)&&t.setItemState(e,$H,!1),t.hasState(e,QH)&&t.setItemState(e,QH,!1)});else{var n=this.getAllowComponents();(0,Uw.each)(n,function(t){t.clearItemsState(tW),t.clearItemsState("inactive")})}},e}(KH),rW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="selected",e}return(0,Gw.__extends)(e,t),e.prototype.selected=function(){this.setState()},e}(KH),nW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName="unchecked",e}return(0,Gw.__extends)(e,t),e.prototype.unchecked=function(){this.setState()},e}(KH),iW="checked",oW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stateName=iW,e}return(0,Gw.__extends)(e,t),e.prototype.setItemState=function(t,e,r){this.setCheckedBy(t,function(t){return t===e},r)},e.prototype.setCheckedBy=function(t,e,r){var n=t.getItems();r&&(0,Uw.each)(n,function(r){e(r)?(t.hasState(r,"unchecked")&&t.setItemState(r,"unchecked",!1),t.setItemState(r,iW,!0)):t.hasState(r,iW)||t.setItemState(r,"unchecked",!0)})},e.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,r=t.item;!(0,Uw.some)(e.getItems(),function(t){return e.hasState(t,"unchecked")})||e.hasState(r,"unchecked")?this.setItemState(e,r,!0):this.reset()}},e.prototype.checked=function(){this.setState()},e.prototype.reset=function(){var t=this.getAllowComponents();(0,Uw.each)(t,function(t){t.clearItemsState(iW),t.clearItemsState("unchecked")})},e}(KH),aW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.toggle=function(){var t,e,r,n,i,o,a,s,u=this.getTriggerListInfo();if(null===u||void 0===u?void 0:u.item){var l=u.list,c=u.item,f=l.getItems(),h=f.filter(function(t){return!l.hasState(t,"unchecked")}),p=f.filter(function(t){return l.hasState(t,"unchecked")}),d=h[0];if(f.length===h.length)try{for(var y=(0,Gw.__values)(f),v=y.next();!v.done;v=y.next()){var g=v.value;l.setItemState(g,"unchecked",g.id!==c.id)}}catch(e){t={error:e}}finally{try{v&&!v.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}else if(f.length-p.length==1)if(d.id===c.id)try{for(var m=(0,Gw.__values)(f),b=m.next();!b.done;b=m.next()){g=b.value;l.setItemState(g,"unchecked",!1)}}catch(t){r={error:t}}finally{try{b&&!b.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}else try{for(var x=(0,Gw.__values)(f),w=x.next();!w.done;w=x.next()){g=w.value;l.setItemState(g,"unchecked",g.id!==c.id)}}catch(t){i={error:t}}finally{try{w&&!w.done&&(o=x.return)&&o.call(x)}finally{if(i)throw i.error}}else try{for(var _=(0,Gw.__values)(f),S=_.next();!S.done;S=_.next()){g=S.value;l.setItemState(g,"unchecked",g.id!==c.id)}}catch(t){a={error:t}}finally{try{S&&!S.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}}},e}(KH),sW="legend-radio-tip",uW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeStamp=0,e}return(0,Gw.__extends)(e,t),e.prototype.show=function(){var t=this.getTriggerListInfo();if(null===t||void 0===t?void 0:t.item){var e=t.list,r=t.item;e.setItemState(r,"showRadio",!0)}},e.prototype.hide=function(){var t=this.getTriggerListInfo();if(null===t||void 0===t?void 0:t.item){var e=t.list,r=t.item;e.setItemState(r,"showRadio",!1)}},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.showTip=function(){var t=this.context.event,e=this.timeStamp,r=+new Date,n=this.context.event.target;if(r-e>16&&"legend-item-radio"===n.get("name")){var i=this.location,o={x:t.x,y:t.y};this.timeStamp=r,this.location=o,i&&(0,Uw.isEqual)(i,o)||this.showTooltip(o)}},e.prototype.hideTip=function(){this.hideTooltip(),this.location=null},e.prototype.showTooltip=function(t){var e=this.context,r=e.event.target;if(r&&r.get("tip")){this.tooltip||this.renderTooltip();var n=e.view.getCanvas().get("el").getBoundingClientRect(),i=n.x,o=n.y;this.tooltip.update((0,Gw.__assign)((0,Gw.__assign)({title:r.get("tip")},t),{x:t.x+i,y:t.y+o})),this.tooltip.show()}},e.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=((t={})[dB]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[yB]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(sW)&&document.body.removeChild(document.getElementById(sW));var r=new XB({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:e,containerId:sW});r.init(),r.setCapture(!1),this.tooltip=r},e}(KH),lW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.maskShape=null,e.points=[],e.starting=!1,e.moving=!1,e.preMovePoint=null,e.shapeType="path",e}return(0,Gw.__extends)(e,t),e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var e="mask:".concat(t),r=this.context.view,n=this.context.event;r.emit(e,{target:this.maskShape,shape:this.maskShape,points:this.points,x:n.x,y:n.y})},e.prototype.createMask=function(){var t=this.context.view,e=this.getMaskAttrs();return t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:(0,Gw.__assign)({fill:"#C5D4EB",opacity:.3},e)})},e.prototype.getMaskPath=function(){return[]},e.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},e.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(null===t||void 0===t?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},e.prototype.move=function(){if(this.moving&&this.maskShape){var t=this.getCurrentPoint(),e=this.preMovePoint,r=t.x-e.x,n=t.y-e.y,i=this.points;(0,Uw.each)(i,function(t){t.x+=r,t.y+=n}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},e.prototype.updateMask=function(t){var e=(0,Uw.deepMix)({},this.getMaskAttrs(),t);this.maskShape.attr(e)},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},e.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},e.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},e.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,t.prototype.destroy.call(this)},e}(AF);function cW(t){var e=(0,Uw.last)(t),r=0,n=0,i=0;if(t.length){var o=t[0];r=lz(o,e)/2,n=(e.x+o.x)/2,i=(e.y+o.y)/2}return{x:n,y:i,r:r}}var fW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="circle",e}return(0,Gw.__extends)(e,t),e.prototype.getMaskAttrs=function(){return cW(this.points)},e}(lW);function hW(t){return{start:(0,Uw.head)(t),end:(0,Uw.last)(t)}}function pW(t,e){return{x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),width:Math.abs(e.x-t.x),height:Math.abs(e.y-t.y)}}var dW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="rect",e}return(0,Gw.__extends)(e,t),e.prototype.getRegion=function(){return hW(this.points)},e.prototype.getMaskAttrs=function(){var t=this.getRegion();return pW(t.start,t.end)},e}(lW);function yW(t){t.x=(0,Uw.clamp)(t.x,0,1),t.y=(0,Uw.clamp)(t.y,0,1)}function vW(t,e,r,n){var i=null,o=null,a=n.invert((0,Uw.head)(t)),s=n.invert((0,Uw.last)(t));return r&&(yW(a),yW(s)),"x"===e?(i=n.convert({x:a.x,y:0}),o=n.convert({x:s.x,y:1})):(i=n.convert({x:0,y:a.y}),o=n.convert({x:1,y:s.y})),{start:i,end:o}}var gW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dim="x",e.inPlot=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getRegion=function(){var t=this.context.view.getCoordinate();return vW(this.points,this.dim,this.inPlot,t)},e}(dW);function mW(t){var e=[];return t.length&&((0,Uw.each)(t,function(t,r){0===r?e.push(["M",t.x,t.y]):e.push(["L",t.x,t.y])}),e.push(["L",t[0].x,t[0].y])),e}function bW(t){return{path:mW(t)}}var xW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getMaskPath=function(){return mW(this.points)},e.prototype.getMaskAttrs=function(){return bW(this.points)},e.prototype.addPoint=function(){this.resize()},e}(lW);function wW(t){return function(t,e){if(t.length<=2)return BF(t,!1);var r=t[0],n=[];(0,Uw.each)(t,function(t){n.push(t.x),n.push(t.y)});var i=DF(n,e,null);return i.unshift(["M",r.x,r.y]),i}(t,!0)}function _W(t){return{path:wW(t)}}var SW,EW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.getMaskPath=function(){return wW(this.points)},e.prototype.getMaskAttrs=function(){return _W(this.points)},e}(xW),kW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.maskShapes=[],e.starting=!1,e.moving=!1,e.recordPoints=null,e.preMovePoint=null,e.shapeType="path",e.maskType="multi-mask",e}return(0,Gw.__extends)(e,t),e.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},e.prototype.emitEvent=function(t){var e="".concat(this.maskType,":").concat(t),r=this.context.view,n=this.context.event,i={type:this.shapeType,name:this.maskType,get:function(t){return i.hasOwnProperty(t)?i[t]:void 0}};r.emit(e,{target:i,maskShapes:this.maskShapes,multiPoints:this.recordPoints,x:n.x,y:n.y})},e.prototype.createMask=function(t){var e=this.context.view,r=this.recordPoints[t],n=this.getMaskAttrs(r),i=e.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:(0,Gw.__assign)({fill:"#C5D4EB",opacity:.3},n)});this.maskShapes.push(i)},e.prototype.getMaskPath=function(t){return[]},e.prototype.show=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.show()}),this.emitEvent("show"))},e.prototype.start=function(t){this.recordPointStart(),this.starting=!0,this.moving=!1;var e=this.recordPoints.length-1;this.createMask(e),this.updateShapesCapture(!1),this.updateMask(null===t||void 0===t?void 0:t.maskStyle),this.emitEvent("start")},e.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint(),this.updateShapesCapture(!1)},e.prototype.move=function(){if(this.moving&&0!==this.maskShapes.length){var t=this.getCurrentPoint(),e=this.preMovePoint,r=t.x-e.x,n=t.y-e.y,i=this.getCurMaskShapeIndex();i>-1&&(this.recordPoints[i].forEach(function(t){t.x+=r,t.y+=n}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t)}},e.prototype.updateMask=function(t){var e=this;this.recordPoints.forEach(function(r,n){var i=(0,Uw.deepMix)({},e.getMaskAttrs(r),t);e.maskShapes[n].attr(i)})},e.prototype.resize=function(){this.starting&&this.maskShapes.length>0&&(this.recordPointContinue(),this.updateMask(),this.emitEvent("change"))},e.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null,this.updateShapesCapture(!0)},e.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.updateShapesCapture(!0)},e.prototype.hide=function(){this.maskShapes.length>0&&(this.maskShapes.forEach(function(t){return t.hide()}),this.emitEvent("hide"))},e.prototype.remove=function(){var t=this.getCurMaskShapeIndex();t>-1&&(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.updateShapesCapture(!0),this.emitEvent("change"))},e.prototype.clearAll=function(){this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.preMovePoint=null},e.prototype.clear=function(){var t=this.getCurMaskShapeIndex();-1===t?(this.recordPointClear(),this.maskShapes.forEach(function(t){return t.remove()}),this.maskShapes=[],this.emitEvent("clearAll")):(this.recordPoints.splice(t,1),this.maskShapes[t].remove(),this.maskShapes.splice(t,1),this.preMovePoint=null,this.emitEvent("clearSingle")),this.preMovePoint=null},e.prototype.destroy=function(){this.clear(),t.prototype.destroy.call(this)},e.prototype.getRecordPoints=function(){var t;return(0,Gw.__spreadArray)([],(0,Gw.__read)(null!==(t=this.recordPoints)&&void 0!==t?t:[]),!1)},e.prototype.recordPointStart=function(){var t=this.getRecordPoints(),e=this.getCurrentPoint();this.recordPoints=(0,Gw.__spreadArray)((0,Gw.__spreadArray)([],(0,Gw.__read)(t),!1),[[e]],!1)},e.prototype.recordPointContinue=function(){var t=this.getRecordPoints(),e=this.getCurrentPoint(),r=t.splice(-1,1)[0]||[];r.push(e),this.recordPoints=(0,Gw.__spreadArray)((0,Gw.__spreadArray)([],(0,Gw.__read)(t),!1),[r],!1)},e.prototype.recordPointClear=function(){this.recordPoints=[]},e.prototype.updateShapesCapture=function(t){this.maskShapes.forEach(function(e){return e.set("capture",t)})},e.prototype.getCurMaskShapeIndex=function(){var t=this.getCurrentPoint();return this.maskShapes.findIndex(function(e){var r=e.attrs,n=r.width,i=r.height,o=r.r;return!(0===n||0===i||0===o)&&e.isHit(t.x,t.y)})},e}(AF),TW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="rect",e}return(0,Gw.__extends)(e,t),e.prototype.getRegion=function(t){return hW(t)},e.prototype.getMaskAttrs=function(t){var e=this.getRegion(t);return pW(e.start,e.end)},e}(kW),CW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dim="x",e.inPlot=!0,e}return(0,Gw.__extends)(e,t),e.prototype.getRegion=function(t){var e=this.context.view.getCoordinate();return vW(t,this.dim,this.inPlot,e)},e}(TW),OW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.shapeType="circle",e.getMaskAttrs=cW,e}return(0,Gw.__extends)(e,t),e}(kW),AW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getMaskPath=mW,e.getMaskAttrs=bW,e}return(0,Gw.__extends)(e,t),e.prototype.addPoint=function(){this.resize()},e}(kW),PW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getMaskPath=wW,e.getMaskAttrs=_W,e}return(0,Gw.__extends)(e,t),e}(AW),MW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.setCursor=function(t){this.context.view.getCanvas().setCursor(t)},e.prototype.default=function(){this.setCursor("default")},e.prototype.pointer=function(){this.setCursor("pointer")},e.prototype.move=function(){this.setCursor("move")},e.prototype.crosshair=function(){this.setCursor("crosshair")},e.prototype.wait=function(){this.setCursor("wait")},e.prototype.help=function(){this.setCursor("help")},e.prototype.text=function(){this.setCursor("text")},e.prototype.eResize=function(){this.setCursor("e-resize")},e.prototype.wResize=function(){this.setCursor("w-resize")},e.prototype.nResize=function(){this.setCursor("n-resize")},e.prototype.sResize=function(){this.setCursor("s-resize")},e.prototype.neResize=function(){this.setCursor("ne-resize")},e.prototype.nwResize=function(){this.setCursor("nw-resize")},e.prototype.seResize=function(){this.setCursor("se-resize")},e.prototype.swResize=function(){this.setCursor("sw-resize")},e.prototype.nsResize=function(){this.setCursor("ns-resize")},e.prototype.ewResize=function(){this.setCursor("ew-resize")},e.prototype.zoomIn=function(){this.setCursor("zoom-in")},e.prototype.zoomOut=function(){this.setCursor("zoom-out")},e}(AF),IW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.filterView=function(t,e,r){var n=this;t.getScaleByField(e)&&t.filter(e,r),t.views&&t.views.length&&(0,Uw.each)(t.views,function(t){n.filterView(t,e,r)})},e.prototype.filter=function(){var t=YF(this.context);if(t){var e=this.context.view,r=t.component,n=r.get("field");if(ZF(t)){if(n){var i=r.getItemsByState("unchecked"),o=dz(e,n),a=i.map(function(t){return t.name});a.length?this.filterView(e,n,function(t){var e=o.getText(t);return!a.includes(e)}):this.filterView(e,n,null),e.render(!0)}}else if(KF(t)){var s=r.getValue(),u=(0,Gw.__read)(s,2),l=u[0],c=u[1];this.filterView(e,n,function(t){return t>=l&&t<=c}),e.render(!0)}}},e}(AF);function LW(t,e,r,n){var i=Math.min(r[e],n[e]),o=Math.max(r[e],n[e]),a=(0,Gw.__read)(t.range,2),s=a[0],u=a[1];if(iu&&(o=u),i===u&&o===u)return null;var l=t.invert(i),c=t.invert(o);if(t.isCategory){var f=t.values.indexOf(l),h=t.values.indexOf(c),p=t.values.slice(f,h+1);return function(t){return p.includes(t)}}return function(t){return t>=l&&t<=c}}!function(t){t.FILTER="brush-filter-processing",t.RESET="brush-filter-reset",t.BEFORE_FILTER="brush-filter:beforefilter",t.AFTER_FILTER="brush-filter:afterfilter",t.BEFORE_RESET="brush-filter:beforereset",t.AFTER_RESET="brush-filter:afterreset"}(SW||(SW={}));var jW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=["x","y"],e.startPoint=null,e.isStarted=!1,e}return(0,Gw.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},e.prototype.filter=function(){var t,e;if(JF(this.context)){var r=this.context.event.target.getCanvasBBox();t={x:r.x,y:r.y},e={x:r.maxX,y:r.maxY}}else{if(!this.isStarted)return;t=this.startPoint,e=this.context.getCurrentPoint()}if(!(Math.abs(t.x-e.x)<5||Math.abs(t.x-e.y)<5)){var n=this.context,i=n.view,o={view:i,event:n.event,dims:this.dims};i.emit(SW.BEFORE_FILTER,iG.fromData(i,SW.BEFORE_FILTER,o));var a=i.getCoordinate(),s=a.invert(e),u=a.invert(t);if(this.hasDim("x")){var l=i.getXScale(),c=LW(l,"x",s,u);this.filterView(i,l.field,c)}if(this.hasDim("y")){var f=i.getYScales()[0];c=LW(f,"y",s,u);this.filterView(i,f.field,c)}this.reRender(i,{source:SW.FILTER}),i.emit(SW.AFTER_FILTER,iG.fromData(i,SW.AFTER_FILTER,o))}},e.prototype.end=function(){this.isStarted=!1},e.prototype.reset=function(){var t=this.context.view;if(t.emit(SW.BEFORE_RESET,iG.fromData(t,SW.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var e=t.getXScale();this.filterView(t,e.field,null)}if(this.hasDim("y")){var r=t.getYScales()[0];this.filterView(t,r.field,null)}this.reRender(t,{source:SW.RESET}),t.emit(SW.AFTER_RESET,iG.fromData(t,SW.AFTER_RESET,{}))},e.prototype.filterView=function(t,e,r){t.filter(e,r)},e.prototype.reRender=function(t,e){t.render(!0,e)},e}(AF),NW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.filterView=function(t,e,r){var n=fz(t);(0,Uw.each)(n,function(t){t.filter(e,r)})},e.prototype.reRender=function(t){var e=fz(t);(0,Uw.each)(e,function(t){t.render(!0)})},e}(jW),RW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.filter=function(){var t=YF(this.context),e=this.context.view,r=rz(e);if(JF(this.context)){var n=$F(this.context,10);n&&(0,Uw.each)(r,function(t){n.includes(t)?t.show():t.hide()})}else if(t){var i=t.component,o=i.get("field");if(ZF(t)){if(o){var a=i.getItemsByState("unchecked"),s=dz(e,o),u=a.map(function(t){return t.name});(0,Uw.each)(r,function(t){var e=iz(t,o),r=s.getText(e);u.indexOf(r)>=0?t.hide():t.show()})}}else if(KF(t)){var l=i.getValue(),c=(0,Gw.__read)(l,2),f=c[0],h=c[1];(0,Uw.each)(r,function(t){var e=iz(t,o);e>=f&&e<=h?t.show():t.hide()})}}},e.prototype.clear=function(){var t=rz(this.context.view);(0,Uw.each)(t,function(t){t.show()})},e.prototype.reset=function(){this.clear()},e}(AF),DW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.byRecord=!1,e}return(0,Gw.__extends)(e,t),e.prototype.filter=function(){JF(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},e.prototype.filterByRecord=function(){var t=this.context.view,e=$F(this.context,10);if(e){var r=t.getXScale().field,n=t.getYScales()[0].field,i=e.map(function(t){return t.getModel().data}),o=fz(t);(0,Uw.each)(o,function(t){var e=rz(t);(0,Uw.each)(e,function(t){var e=t.getModel().data;pz(i,e,r,n)?t.show():t.hide()})})}},e.prototype.filterByBBox=function(){var t=this,e=fz(this.context.view);(0,Uw.each)(e,function(e){var r=tz(t.context,e,10),n=rz(e);r&&(0,Uw.each)(n,function(t){r.includes(t)?t.show():t.hide()})})},e.prototype.reset=function(){var t=fz(this.context.view);(0,Uw.each)(t,function(t){var e=rz(t);(0,Uw.each)(e,function(t){t.show()})})},e}(AF),BW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.buttonGroup=null,e.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},e}return(0,Gw.__extends)(e,t),e.prototype.getButtonCfg=function(){return(0,Uw.deepMix)(this.buttonCfg,this.cfg)},e.prototype.drawButton=function(){var t=this.getButtonCfg(),e=this.context.view.foregroundGroup.addGroup({name:t.name}),r=e.addShape({type:"text",name:"button-text",attrs:(0,Gw.__assign)({text:t.text},t.textStyle)}).getBBox(),n=tG(t.padding),i=e.addShape({type:"rect",name:"button-rect",attrs:(0,Gw.__assign)({x:r.x-n[3],y:r.y-n[0],width:r.width+n[1]+n[3],height:r.height+n[0]+n[2]},t.style)});i.toBack(),e.on("mouseenter",function(){i.attr(t.activeStyle)}),e.on("mouseleave",function(){i.attr(t.style)}),this.buttonGroup=e},e.prototype.resetPosition=function(){var t=this.context.view.getCoordinate().convert({x:1,y:1}),e=this.buttonGroup,r=e.getBBox(),n=Yw.pd(null,[["t",t.x-r.width-10,t.y+r.height+5]]);e.setMatrix(n)},e.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},e.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},e.prototype.destroy=function(){var e=this.buttonGroup;e&&e.remove(),t.prototype.destroy.call(this)},e}(AF),FW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.dragStart=!1,e}return(0,Gw.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},e.prototype.drag=function(){if(this.startPoint){var t=this.context.getCurrentPoint(),e=this.context.view,r=this.context.event;this.dragStart?e.emit("drag",{target:r.target,x:r.x,y:r.y}):lz(t,this.startPoint)>4&&(e.emit("dragstart",{target:r.target,x:r.x,y:r.y}),this.dragStart=!0)}},e.prototype.end=function(){if(this.dragStart){var t=this.context.view,e=this.context.event;t.emit("dragend",{target:e.target,x:e.x,y:e.y})}this.starting=!1,this.dragStart=!1},e}(AF),zW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.starting=!1,e.isMoving=!1,e.startPoint=null,e.startMatrix=null,e}return(0,Gw.__extends)(e,t),e.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},e.prototype.move=function(){if(this.starting){var t=this.startPoint,e=this.context.getCurrentPoint();if(lz(t,e)>5&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var r=this.context.view,n=Yw.pd(this.startMatrix,[["t",e.x-t.x,e.y-t.y]]);r.backgroundGroup.setMatrix(n),r.foregroundGroup.setMatrix(n),r.middleGroup.setMatrix(n)}}},e.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},e.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},e}(AF),GW="x",UW="y",VW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.dims=[GW,UW],e.cfgFields=["dims"],e.cacheScaleDefs={},e}return(0,Gw.__extends)(e,t),e.prototype.hasDim=function(t){return this.dims.includes(t)},e.prototype.getScale=function(t){var e=this.context.view;return"x"===t?e.getXScale():e.getYScales()[0]},e.prototype.resetDim=function(t){var e=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var r=this.getScale(t);e.scale(r.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},e.prototype.reset=function(){this.resetDim(GW),this.resetDim(UW),this.context.view.render(!0)},e}(AF),HW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.startPoint=null,e.starting=!1,e.startCache={},e}return(0,Gw.__extends)(e,t),e.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var e=this.dims;(0,Uw.each)(e,function(e){var r=t.getScale(e),n=r.min,i=r.max,o=r.values;t.startCache[e]={min:n,max:i,values:o}})},e.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},e.prototype.translate=function(){var t=this;if(this.starting){var e=this.startPoint,r=this.context.view.getCoordinate(),n=this.context.getCurrentPoint(),i=r.invert(e),o=r.invert(n),a=o.x-i.x,s=o.y-i.y,u=this.context.view,l=this.dims;(0,Uw.each)(l,function(e){t.translateDim(e,{x:-1*a,y:-1*s})}),u.render(!0)}},e.prototype.translateDim=function(t,e){if(this.hasDim(t)){var r=this.getScale(t);r.isLinear&&this.translateLinear(t,r,e)}},e.prototype.translateLinear=function(t,e,r){var n=this.context.view,i=this.startCache[t],o=i.min,a=i.max,s=a-o,u=r[t]*s;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:o,max:a}),n.scale(e.field,{nice:!1,min:o+u,max:a+u})},e.prototype.reset=function(){t.prototype.reset.call(this),this.startPoint=null,this.starting=!1},e}(VW),WW=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.zoomRatio=.05,e}return(0,Gw.__extends)(e,t),e.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},e.prototype.zoom=function(t){var e=this,r=this.dims;(0,Uw.each)(r,function(r){e.zoomDim(r,t)}),this.context.view.render(!0)},e.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},e.prototype.zoomDim=function(t,e){if(this.hasDim(t)){var r=this.getScale(t);r.isLinear&&this.zoomLinear(t,r,e)}},e.prototype.zoomLinear=function(t,e,r){var n=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:e.min,max:e.max});var i=this.cacheScaleDefs[t],o=i.max-i.min,a=e.min,s=e.max,u=r*o,l=a-u,c=s+u,f=(c-l)/o;c>l&&f<100&&f>.01&&n.scale(e.field,{nice:!1,min:a-u,max:s+u})},e}(VW);var qW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.scroll=function(t){var e=this.context,r=e.view,n=e.event;if(r.getOptions().scrollbar){var i=(null===t||void 0===t?void 0:t.wheelDelta)||1,o=r.getController("scrollbar"),a=r.getXScale(),s=r.getOptions().data,u=(0,Uw.size)((0,Uw.valuesOfKey)(s,a.field)),l=(0,Uw.size)(a.values),c=o.getValue(),f=Math.floor((u-l)*c)+(function(t){return t.gEvent.originalEvent.deltaY>0}(n)?i:-i),h=i/(u-l)/1e4,p=(0,Uw.clamp)(f/(u-l)+h,0,1);o.setValue(p)}},e}(AF),YW=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Gw.__extends)(e,t),e.prototype.show=function(){var t=this.context,e=YF(t).axis.cfg.title,r=e.description,n=e.text,i=e.descriptionTooltipStyle,o=t.event,a=o.x,s=o.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:n||"",customContent:function(){return'\n
      \n
      \n 字段说明:').concat(r,"\n
      \n
      \n ")},x:a,y:s}),this.tooltip.show()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},e.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},e.prototype.renderTooltip=function(){var t,e=this.context.view.canvas,r={start:{x:0,y:0},end:{x:e.get("width"),y:e.get("height")}},n=new XB({parent:e.get("el").parentNode,region:r,visible:!1,containerId:"aixs-description-tooltip",domStyles:(0,Gw.__assign)({},(0,Uw.deepMix)({},(t={},t[dB]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[yB]={"word-break":"break-all","margin-bottom":"3px"},t)))});n.init(),n.setCapture(!1),this.tooltip=n},e}(AF);function XW(t){return t.isInPlot()}function ZW(t){return t.gEvent.preventDefault(),t.gEvent.originalEvent.deltaY>0}Hz("dark",Oz(PU)),YN("canvas",f),YN("svg",p),fG("Polygon",KU),fG("Interval",WU),fG("Schema",JU),fG("Path",MU),fG("Point",ZU),fG("Line",qU),fG("Area",NU),fG("Edge",RU),fG("Heatmap",DU),fG("Violin",QU),OG("base",KG),OG("interval",uV),OG("pie",fV),OG("polar",cV),PG("overlap",function(t,e,r,n){var i=new bV;(0,Uw.each)(e,function(t){for(var e=t.find(function(t){return"text"===t.get("type")}),r=e.attr(),n=r.x,o=r.y,a=!1,s=0;s<=8;s++){var u=xV(e,n,o,s);if(i.hasGap(u)){i.fillGap(u),a=!0;break}}a||t.remove(!0)}),i.destroy()}),PG("distribute",function(t,e,r,n){if(t.length&&e.length){var i=t[0]?t[0].offset:0,o=e[0].get("coordinate"),a=o.getRadius(),s=o.getCenter();if(i>0){var u=2*(a+i)+28,l={start:o.start,end:o.end},c=[[],[]];t.forEach(function(t){t&&("right"===t.textAlign?c[0].push(t):c[1].push(t))}),c.forEach(function(t,r){var n=u/14;t.length>n&&(t.sort(function(t,e){return e["..percent"]-t["..percent"]}),t.splice(n,t.length-n)),t.sort(function(t,e){return t.y-e.y}),function(t,e,r,n,i,o){var a,s,u,l=!0,c=n.start,f=n.end,h=Math.min(c.y,f.y),p=Math.abs(c.y-f.y),d=0,y=Number.MIN_VALUE,v=e.map(function(t){return t.y>d&&(d=t.y),t.yp&&(p=d-h);l;)for(v.forEach(function(t){var e=(Math.min.apply(y,t.targets)+Math.max.apply(y,t.targets))/2;t.pos=Math.min(Math.max(y,e-t.size/2),p-t.size)}),l=!1,u=v.length;u--;)if(u>0){var g=v[u-1],m=v[u];g.pos+g.size>m.pos&&(g.size+=m.size,g.targets=g.targets.concat(m.targets),g.pos+g.size>p&&(g.pos=p-g.size),v.splice(u,1),l=!0)}u=0,v.forEach(function(t){var n=h+r/2;t.targets.forEach(function(){e[u].y=t.pos+n,n+=r,u++})});var b={};try{for(var x=(0,Gw.__values)(t),w=x.next();!w.done;w=x.next()){var _=w.value;b[_.get("id")]=_}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=x.return)&&s.call(x)}finally{if(a)throw a.error}}e.forEach(function(t){var e=t.r*t.r,r=Math.pow(Math.abs(t.y-i.y),2);if(ei.maxX||n.maxY>i.maxY)&&t.remove(!0)})}),PG("limit-in-canvas",function(t,e,r,n){(0,Uw.each)(e,function(t){var e=n.minX,r=n.minY,i=n.maxX,o=n.maxY,a=t.getCanvasBBox(),s=a.minX,u=a.minY,l=a.maxX,c=a.maxY,f=a.x,h=a.y,p=a.width,d=a.height,y=f,v=h;(si?y=i-p:l>i&&(y-=l-i),u>o?v=o-d:c>o&&(v-=c-o),y===f&&v===h||VG(t,y-f,v-h)})}),PG("limit-in-plot",function(t,e,r,n,i){if(!(e.length<=0)){var o=(null===i||void 0===i?void 0:i.direction)||["top","right","bottom","left"],a=(null===i||void 0===i?void 0:i.action)||"translate",s=(null===i||void 0===i?void 0:i.margin)||0,u=e[0].get("coordinate");if(u){var l=function(t,e){void 0===e&&(e=0);var r=t.start,n=t.end,i=t.getWidth(),o=t.getHeight(),a=Math.min(r.x,n.x),s=Math.min(r.y,n.y);return aF.fromRange(a-e,s-e,a+i+e,s+o+e)}(u,s),c=l.minX,f=l.minY,h=l.maxX,p=l.maxY;(0,Uw.each)(e,function(t){var e=t.getCanvasBBox(),r=e.minX,n=e.minY,i=e.maxX,s=e.maxY,u=e.x,l=e.y,d=e.width,y=e.height,v=u,g=l;if(o.indexOf("left")>=0&&(r=0&&(n=0&&(r>h?v=h-d:i>h&&(v-=i-h)),o.indexOf("bottom")>=0&&(n>p?g=p-y:s>p&&(g-=s-p)),v!==u||g!==l){var m=v-u;"translate"===a?VG(t,m,g-l):"ellipsis"===a?t.findAll(function(t){return"text"===t.get("type")}).forEach(function(t){var e=(0,Uw.pick)(t.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),r=t.getCanvasBBox(),n=VV(t.attr("text"),r.width-Math.abs(m),e);t.attr("text",n)}):t.hide()}})}}}),PG("pie-outer",function(t,e,r,n){var i,o,a=(0,Uw.filter)(t,function(t){return!(0,Uw.isNil)(t)}),s=e[0]&&e[0].get("coordinate");if(s){var u=s.getCenter(),l=s.getRadius(),c={};try{for(var f=(0,Gw.__values)(e),h=f.next();!h.done;h=f.next()){var p=h.value;c[p.get("id")]=p}}catch(t){i={error:t}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(i)throw i.error}}var d=(0,Uw.get)(a[0],"labelHeight",14),y=(0,Uw.get)(a[0],"offset",0);if(!(y<=0)){var v=(0,Uw.groupBy)(a,function(t){return t.xr&&(t.sort(function(t,e){return e.percent-t.percent}),(0,Uw.each)(t,function(t,e){e+1>r&&(c[t.id].set("visible",!1),t.invisible=!0)})),pV(t,d,w)}),(0,Uw.each)(v,function(t,e){(0,Uw.each)(t,function(t){var r="right"===e,n=c[t.id].getChildByIndex(0);if(n){var i=l+y,o=t.y-u.y,a=Math.pow(i,2),f=Math.pow(o,2),h=a-f>0?a-f:0,p=Math.sqrt(h),d=Math.abs(Math.cos(t.angle)*i);t.x=r?u.x+Math.max(p,d):u.x-Math.max(p,d)}n&&(n.attr("y",t.y),n.attr("x",t.x)),function(t,e){var r=e.getCenter(),n=e.getRadius();if(t&&t.labelLine){var i=t.angle,o=t.offset,a=JB(r.x,r.y,n,i),s=t.x+(0,Uw.get)(t,"offsetX",0)*(Math.cos(i)>0?1:-1),u=t.y+(0,Uw.get)(t,"offsetY",0)*(Math.sin(i)>0?1:-1),l={x:s-Math.cos(i)*dV,y:u-Math.sin(i)*dV},c=t.labelLine.smooth,f=[],h=l.x-r.x,p=l.y-r.y,d=Math.atan(p/h);if(h<0&&(d+=Math.PI),!1===c){(0,Uw.isObject)(t.labelLine)||(t.labelLine={});var y=0;(i<0&&i>-Math.PI/2||i>1.5*Math.PI)&&l.y>a.y&&(y=1),i>=0&&ia.y&&(y=1),i>=Math.PI/2&&il.y&&(y=1),(i<-Math.PI/2||i>=Math.PI&&i<1.5*Math.PI)&&a.y>l.y&&(y=1);var v=o/2>4?4:Math.max(o/2-1,0),g=JB(r.x,r.y,n+v,i),m=JB(r.x,r.y,n+o/2,d);f.push("M ".concat(a.x," ").concat(a.y)),f.push("L ".concat(g.x," ").concat(g.y)),f.push("A ".concat(r.x," ").concat(r.y," 0 ").concat(0," ").concat(y," ").concat(m.x," ").concat(m.y)),f.push("L ".concat(l.x," ").concat(l.y))}else{g=JB(r.x,r.y,n+(o/2>4?4:Math.max(o/2-1,0)),i);var b=a.xMath.pow(Math.E,-16)&&f.push.apply(f,["C",l.x+4*b,l.y,2*g.x-a.x,2*g.y-a.y,a.x,a.y]),f.push("L ".concat(a.x," ").concat(a.y))}t.labelLine.path=f.join(" ")}}(t,s)})})}}}),PG("adjust-color",function(t,e,r){if(0!==r.length){var n=r[0].get("element").geometry.theme,i=n.labels||{},o=i.fillColorLight,a=i.fillColorDark;r.forEach(function(t,r){var i=e[r].find(function(t){return"text"===t.get("type")}),s=aF.fromObject(t.getBBox()),u=aF.fromObject(i.getCanvasBBox()),l=!s.contains(u),c=t.attr("fill"),f=NV(c);l?i.attr(n.overflowLabels.style):f?o&&i.attr("fill",o):a&&i.attr("fill",a)})}}),PG("interval-adjust-position",function(t,e,r){var n;if(0!==r.length){var i=null===(n=r[0])||void 0===n?void 0:n.get("element"),o=null===i||void 0===i?void 0:i.geometry;o&&"interval"===o.type&&RV(o,e,r)&&r.forEach(function(t,r){var n=e[r];!function(t,e,r){var n=t.coordinate,i=aF.fromObject(r.getBBox()),o=WG(e);n.isTransposed?o.attr({x:i.minX+i.width/2,textAlign:"center"}):o.attr({y:i.minY+i.height/2,textBaseline:"middle"})}(o,n,t)})}}),PG("interval-hide-overlap",function(t,e,r){var n;if(0!==r.length){var i=null===(n=r[0])||void 0===n?void 0:n.get("element"),o=null===i||void 0===i?void 0:i.geometry;if(o&&"interval"===o.type){var a,s=function(t){var e=[],r=Math.max(Math.floor(t.length/500),1);return(0,Uw.each)(t,function(t,n){n%r==0?e.push(t):t.set("visible",!1)}),e}(e),u=(0,Gw.__read)(o.getXYFields(),1)[0],l=[],c=[],f=(0,Uw.groupBy)(s,function(t){return t.get("data")[u]}),h=(0,Uw.uniq)((0,Uw.map)(s,function(t){return t.get("data")[u]}));s.forEach(function(t){t.set("visible",!0)});var p=function(t){t&&(t.length&&c.push(t.pop()),c.push.apply(c,(0,Gw.__spreadArray)([],(0,Gw.__read)(t),!1)))};for((0,Uw.size)(h)>0&&(a=h.shift(),p(f[a])),(0,Uw.size)(h)>0&&(a=h.pop(),p(f[a])),(0,Uw.each)(h.reverse(),function(t){p(f[t])});c.length>0;){var d=c.shift();d.get("visible")&&(YG(d,l)?d.set("visible",!1):l.push(d))}}}}),PG("point-adjust-position",function(t,e,r,n,i){var o,a;if(0!==r.length){var s=null===(o=r[0])||void 0===o?void 0:o.get("element"),u=null===s||void 0===s?void 0:s.geometry;if(u&&"point"===u.type){var l=(0,Gw.__read)(u.getXYFields(),2),c=l[0],f=l[1],h=(0,Uw.groupBy)(e,function(t){return t.get("data")[c]}),p=[],d=i&&i.offset||(null===(a=t[0])||void 0===a?void 0:a.offset)||12;(0,Uw.map)((0,Uw.keys)(h).reverse(),function(t){for(var e=function(t,e){var r=t.getXYFields()[1],n=[],i=e.sort(function(t,e){return t.get("data")[r]-t.get("data")[r]});return i.length>0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,(0,Gw.__spreadArray)([],(0,Gw.__read)(i),!1)),n}(u,h[t]);e.length;){var r=e.shift(),n=WG(r);if(DV(p,r,function(t,e){return t.get("data")[c]===e.get("data")[c]&&t.get("data")[f]===e.get("data")[f]}))n.set("visible",!1);else{var i=!1;BV(p,r)&&(n.attr("y",n.attr("y")+2*d),i=BV(p,r)),i?n.set("visible",!1):p.push(r)}}})}}}),PG("pie-spider",function(t,e,r,n){var i,o,a=e[0]&&e[0].get("coordinate");if(a){var s=a.getCenter(),u=a.getRadius(),l={};try{for(var c=(0,Gw.__values)(e),f=c.next();!f.done;f=c.next()){var h=f.value;l[h.get("id")]=h}}catch(t){i={error:t}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}var p=(0,Uw.get)(t[0],"labelHeight",14),d=Math.max((0,Uw.get)(t[0],"offset",0),yV);(0,Uw.each)(t,function(t){if(t&&(0,Uw.get)(l,[t.id])){var e=t.x>s.x||t.x===s.x&&t.y>s.y,r=(0,Uw.isNil)(t.offsetX)?vV:t.offsetX,n=JB(s.x,s.y,u+yV,t.angle),i=d+r;t.x=s.x+(e?1:-1)*(u+i),t.y=n.y}});var y=a.start,v=a.end,g=(0,Uw.groupBy)(t,function(t){return t.xm&&(m=Math.min(e,Math.abs(y.y-v.y)))});var b={minX:y.x,maxX:v.x,minY:s.y-m/2,maxY:s.y+m/2};(0,Uw.each)(g,function(t,e){var r=m/p;t.length>r&&(t.sort(function(t,e){return e.percent-t.percent}),(0,Uw.each)(t,function(t,e){e>r&&(l[t.id].set("visible",!1),t.invisible=!0)})),pV(t,p,b)});var x=b.minY,w=b.maxY;(0,Uw.each)(g,function(t,e){var r="right"===e;(0,Uw.each)(t,function(t){var e=(0,Uw.get)(l,t&&[t.id]);if(e)if(t.yw)e.set("visible",!1);else{var n=e.getChildByIndex(0),i=n.getCanvasBBox(),o=r?i.x:i.maxX,s=i.y+i.height/2;VG(n,t.x-o,t.y-s),t.labelLine&&function(t,e,r){var n,i=e.getCenter(),o=e.getRadius(),a={x:t.x-(r?gV:-gV),y:t.y},s=JB(i.x,i.y,o+yV,t.angle),u={x:a.x,y:a.y},l={x:s.x,y:s.y},c=JB(i.x,i.y,o,t.angle);if(a.y!==s.y){var f=r?4:-4;u.y=a.y,t.angle<0&&t.angle>=-Math.PI/2&&(u.x=Math.max(s.x,a.x-f),a.y0&&t.angles.y?l.y=u.y:(l.y=s.y,l.x=Math.max(l.x,u.x-f))),t.angle>Math.PI/2&&(u.x=Math.min(s.x,a.x-f),a.y>s.y?l.y=u.y:(l.y=s.y,l.x=Math.min(l.x,u.x-f))),t.angle<-Math.PI/2&&(u.x=Math.min(s.x,a.x-f),a.y0&&n.push(i.shift()),i.length>0&&n.push(i.pop()),n.push.apply(n,(0,Gw.__spreadArray)([],(0,Gw.__read)(i),!1)),n}(u,h[t]);e.length;){var r=e.shift(),n=WG(r);if(FV(p,r,function(t,e){return t.get("data")[c]===e.get("data")[c]&&t.get("data")[f]===e.get("data")[f]}))n.set("visible",!1);else{var i=!1;zV(p,r)&&(n.attr("y",n.attr("y")+2*d),i=zV(p,r)),i?n.set("visible",!1):p.push(r)}}})}}}),mG("fade-in",function(t,e,r){var n={fillOpacity:(0,Uw.isNil)(t.attr("fillOpacity"))?1:t.attr("fillOpacity"),strokeOpacity:(0,Uw.isNil)(t.attr("strokeOpacity"))?1:t.attr("strokeOpacity"),opacity:(0,Uw.isNil)(t.attr("opacity"))?1:t.attr("opacity")};t.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),t.animate(n,e)}),mG("fade-out",function(t,e,r){var n=e.easing,i=e.duration,o=e.delay;t.animate({fillOpacity:0,strokeOpacity:0,opacity:0},i,n,function(){t.remove(!0)},o)}),mG("grow-in-x",function(t,e,r){HV(t,e,r.coordinate,r.minYPoint,"x")}),mG("grow-in-xy",function(t,e,r){HV(t,e,r.coordinate,r.minYPoint,"xy")}),mG("grow-in-y",function(t,e,r){HV(t,e,r.coordinate,r.minYPoint,"y")}),mG("scale-in-x",function(t,e,r){var n=t.getBBox(),i=t.get("origin").mappingData.points,o=i[0].y-i[1].y>0?n.maxX:n.minX,a=(n.minY+n.maxY)/2;t.applyToMatrix([o,a,1]);var s=Yw.pd(t.getMatrix(),[["t",-o,-a],["s",.01,1],["t",o,a]]);t.setMatrix(s),t.animate({matrix:Yw.pd(t.getMatrix(),[["t",-o,-a],["s",100,1],["t",o,a]])},e)}),mG("scale-in-y",function(t,e,r){var n=t.getBBox(),i=t.get("origin").mappingData,o=(n.minX+n.maxX)/2,a=i.points,s=a[0].y-a[1].y<=0?n.maxY:n.minY;t.applyToMatrix([o,s,1]);var u=Yw.pd(t.getMatrix(),[["t",-o,-s],["s",1,.01],["t",o,s]]);t.setMatrix(u),t.animate({matrix:Yw.pd(t.getMatrix(),[["t",-o,-s],["s",1,100],["t",o,s]])},e)}),mG("wave-in",function(t,e,r){var n=cF(r.coordinate,20),i=n.type,o=n.startState,a=n.endState,s=t.setClip({type:i,attrs:o});r.toAttrs&&t.attr(r.toAttrs),s.animate(a,(0,Gw.__assign)((0,Gw.__assign)({},e),{callback:function(){t&&!t.get("destroyed")&&t.set("clipShape",null),s.remove(!0),(0,Uw.isFunction)(e.callback)&&e.callback()}}))}),mG("zoom-in",function(t,e,r){XV(t,e,"zoomIn")}),mG("zoom-out",function(t,e,r){XV(t,e,"zoomOut")}),mG("position-update",function(t,e,r){var n=r.toAttrs,i=n.x,o=n.y;delete n.x,delete n.y,t.attr(n),t.animate({x:i,y:o},e)}),mG("sector-path-update",function(t,e,r){var n=r.toAttrs,i=r.coordinate,o=n.path||[],a=o.map(function(t){return t[0]});if(!(o.length<1)){var s=YV(o),u=s.startAngle,l=s.endAngle,c=s.radius,f=s.innerRadius,h=YV(t.attr("path")),p=h.startAngle,d=h.endAngle,y=i.getCenter(),v=u-p,g=l-d;0!==v||0!==g?t.animate(function(t){var e=p+t*v,r=d+t*g;return(0,Gw.__assign)((0,Gw.__assign)({},n),{path:(0,Uw.isEqual)(a,["M","A","A","Z"])?$B(y.x,y.y,c,e,r):QB(y.x,y.y,c,e,r,f)})},(0,Gw.__assign)((0,Gw.__assign)({},e),{callback:function(){t.attr("path",o),(0,Uw.isFunction)(e.callback)&&e.callback()}})):t.attr(n)}}),mG("path-in",function(t,e,r){var n=t.getTotalLength();t.attr("lineDash",[n]),t.animate(function(t){return{lineDashOffset:(1-t)*n}},e)}),OF("rect",eH),OF("mirror",tH),OF("list",QV),OF("matrix",$V),OF("circle",JV),OF("tree",rH),rG("axis",pH),rG("legend",gH),rG("tooltip",yG),rG("annotation",aH),rG("slider",mH),rG("scrollbar",bH),LF("tooltip",SH),LF("sibling-tooltip",EH),LF("ellipsis-text",kH),LF("element-active",AH),LF("element-single-active",jH),LF("element-range-active",IH),LF("element-highlight",UH),LF("element-highlight-by-x",HH),LF("element-highlight-by-color",VH),LF("element-single-highlight",qH),LF("element-range-highlight",WH),LF("element-sibling-highlight",WH,{effectSiblings:!0,effectByRecord:!0}),LF("element-selected",XH),LF("element-single-selected",ZH),LF("element-range-selected",YH),LF("element-link-by-color",PH),LF("active-region",_H),LF("list-active",JH),LF("list-selected",rW),LF("list-highlight",eW),LF("list-unchecked",nW),LF("list-checked",oW),LF("list-focus",aW),LF("list-radio",uW),LF("legend-item-highlight",eW,{componentNames:["legend"]}),LF("axis-label-highlight",eW,{componentNames:["axis"]}),LF("axis-description",YW),LF("rect-mask",dW),LF("x-rect-mask",gW,{dim:"x"}),LF("y-rect-mask",gW,{dim:"y"}),LF("circle-mask",fW),LF("path-mask",xW),LF("smooth-path-mask",EW),LF("rect-multi-mask",TW),LF("x-rect-multi-mask",CW,{dim:"x"}),LF("y-rect-multi-mask",CW,{dim:"y"}),LF("circle-multi-mask",OW),LF("path-multi-mask",AW),LF("smooth-path-multi-mask",PW),LF("cursor",MW),LF("data-filter",IW),LF("brush",jW),LF("brush-x",jW,{dims:["x"]}),LF("brush-y",jW,{dims:["y"]}),LF("sibling-filter",NW),LF("sibling-x-filter",NW,{dims:"x"}),LF("sibling-y-filter",NW,{dims:"y"}),LF("element-filter",RW),LF("element-sibling-filter",DW),LF("element-sibling-filter-record",DW,{byRecord:!0}),LF("view-drag",FW),LF("view-move",zW),LF("scale-translate",HW),LF("scale-zoom",WW),LF("reset-button",BW,{name:"reset-button",text:"reset"}),LF("mousewheel-scroll",qW),Cz("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]}),Cz("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseout",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]}),Cz("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]}),Cz("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]}),Cz("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]}),Cz("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]}),Cz("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]}),Cz("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]}),Cz("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]}),Cz("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]}),Cz("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]}),Cz("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(t){return!t.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(t){return!t.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]}),Cz("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:XW,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:XW,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:XW,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]}),Cz("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]}),Cz("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:XW,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:XW,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:XW,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]}),Cz("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:XW,action:"path-mask:start"},{trigger:"mousedown",isEnable:XW,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]}),Cz("brush-x-multi",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"mousedown",isEnable:XW,action:["x-rect-multi-mask:start","x-rect-multi-mask:show"]},{trigger:"mask:dragstart",action:["x-rect-multi-mask:moveStart"]}],processing:[{trigger:"mousemove",isEnable:function(t){return!QF(t)},action:["x-rect-multi-mask:resize"]},{trigger:"multi-mask:change",action:"element-range-highlight:highlight"},{trigger:"mask:drag",action:["x-rect-multi-mask:move"]}],end:[{trigger:"mouseup",action:["x-rect-multi-mask:end"]},{trigger:"mask:dragend",action:["x-rect-multi-mask:moveEnd"]}],rollback:[{trigger:"dblclick",action:["x-rect-multi-mask:clear","cursor:crosshair"]},{trigger:"multi-mask:clearAll",action:["element-range-highlight:clear"]},{trigger:"multi-mask:clearSingle",action:["element-range-highlight:highlight"]}]}),Cz("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]}),Cz("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(t){return!t.isInShape("legend-item-radio")},action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]}),Cz("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]}),Cz("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]}),Cz("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","element-filter:filter"]}]}),Cz("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]}),Cz("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]}),Cz("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(t){return ZW(t.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(t){return!ZW(t.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]}),Cz("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]}),Cz("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});var KW={colorRegExp:null,_nameColors:null,initialize:function(){this.colorRegExp=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,this._nameColors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"}},toColor:function(t,e){if(e=e||"rgb",t&&(3===t.length||4===t.length)){if(t=this.map(t,function(t){return t>1?Math.ceil(t):t}),e.indexOf("hex")>-1)return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+ +t[2]).toString(16).slice(1);if(e.indexOf("hs")>-1){var r=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=r[0],t[2]=r[1]}return e.indexOf("a")>-1?(3===t.length&&t.push(1),t[3]=this.adjust(t[3],[0,1]),e+"("+t.slice(0,4).join(",")+")"):e+"("+t.slice(0,3).join(",")+")"}},convert:function(t,e){if(!this.isCalculableColor(t))return t;var r=this.getData(t),n=r[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?r=this._HSV_2_RGB(r):t.indexOf("hsl")>-1&&(r=this._HSL_2_RGB(r)),r[3]=n,this.toColor(r,e)},toRGBA:function(t){return this.convert(t,"rgba")},trim:function(t){return String(t).replace(/\s+/g,"")},normalize:function(t){if(this._nameColors[t]&&(t=this._nameColors[t]),t=(t=this.trim(t)).replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(t)){var e=(3840&(t=parseInt(t.slice(1),16)))<<8,r=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(r<<4)+r+(n<<4)+n).toString(16).slice(1)}return t},getData:function(t){var e,r,n=(t=this.normalize(t)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var i,o=[];if(n[2])i=[(e=n[2].replace("#","").split(""))[0]+e[1],e[2]+e[3],e[4]+e[5]],o=this.map(i,function(t){return KW.adjust.call(this,parseInt(t,16),[0,255])});else if(n[4]){var a=n[4].split(",");r=a[3],i=a.slice(0,3),o=this.map(i,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),KW.adjust.call(this,t,[0,255])}),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}else if(n[5]||n[6]){var s=(n[5]||n[6]).split(","),u=parseInt(s[0],0)/360,l=s[1],c=s[2];r=s[3],(o=this.map([l,c],function(t){return KW.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(u),void 0!==r&&o.push(this.adjust(parseFloat(r),[0,1]))}return o},map:function(t,e){if("function"!=typeof e)throw new TypeError;for(var r=t?t.length:0,n=0;n=e[1]&&(t=e[1]),t},isCalculableColor:function(t){return t instanceof Array||"string"==typeof t},_HSV_2_RGB:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s=6*i;6===s&&(s=0);var u=0|s,l=a*(1-o),c=a*(1-o*(s-u)),f=a*(1-o*(1-(s-u))),h=0,p=0,d=0;0===u?(h=a,p=f,d=l):1===u?(h=c,p=a,d=l):2===u?(h=l,p=a,d=f):3===u?(h=l,p=c,d=a):4===u?(h=f,p=l,d=a):(h=a,p=l,d=c),e=255*h,r=255*p,n=255*d}return[e,r,n]},_HSL_2_RGB:function(t){var e,r,n,i=t[0],o=t[1],a=t[2];if(0===o)e=255*a,r=255*a,n=255*a;else{var s,u=2*a-(s=a<.5?a*(1+o):a+o-o*a);e=255*this._HUE_2_RGB(u,s,i+1/3),r=255*this._HUE_2_RGB(u,s,i),n=255*this._HUE_2_RGB(u,s,i-1/3)}return[e,r,n]},_HUE_2_RGB:function(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}};KW.initialize();var JW=KW,QW=r(1855),$W=r.n(QW);function tq(t){"@babel/helpers - typeof";return(tq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eq(t,e){for(var r=0;r=e)if("RANGE"===r)for(i=0;i=0&&this.getSqrtInterval(t,r):"logarithm"===e?this.getMin(t)>0&&this.getGeometricProgression(t,r):void 0}},{key:"getSum",value:function(t){return this.getInstance(t).sum()}},{key:"getMax",value:function(t){return this.getInstance(t).max()}},{key:"getMin",value:function(t){return this.getInstance(t).min()}},{key:"getMean",value:function(t){return this.getInstance(t).mean()}},{key:"getMedian",value:function(t){return this.getInstance(t).median()}},{key:"getTimes",value:function(t){return t.length}},{key:"getEqInterval",value:function(t,e){return this.getInstance(t).getClassEqInterval(e)}},{key:"getJenks",value:function(t,e){return this.getInstance(t).getClassJenks(e)}},{key:"getSqrtInterval",value:function(t,e){return t=t.map(function(t){return Math.sqrt(t)}),this.getInstance(t).getClassEqInterval(e).map(function(t){return t*t})}},{key:"getGeometricProgression",value:function(t,e){return this.getInstance(t).getClassGeometricProgression(e)}}],(e=null)&&aq(t.prototype,e),r&&aq(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function lq(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t.flat()),n=window.Module._malloc(2*e*8);window.Module.HEAPF64.set(r,n/8);var i=window.Module._UGCWasm_Geometry_CreatePoint2DsFromBuffer(n,e);return window.Module._free(n),i}function cq(t){if(!t)throw new Error("No GeoJSON coords provided");if(!t||0===t.length)return null;var e=t.length,r=new Float64Array(t),n=window.Module._malloc(8*e);window.Module.HEAPF64.set(r,n/8);var i=window.Module._UGCWasm_Helper_CreateDoubleArray(n,e);return window.Module._free(n),i}function fq(t){var e=window.Module._UGCWasm_Helper_GetDoubleArrayLength(t),r=window.Module._malloc(8*e);window.Module._UGCWasm_Helper_GetBufferFromDoubleArray(t,r);for(var n=new Float64Array(window.Module.HEAPF64.buffer,r,e),i=[],o=0;o1)for(var o=1;o1)for(var l=1;l2&&void 0!==arguments[2]?arguments[2]:1e-6,n=pq(t),i=pq(e);return 1===this.module._UGCWasm_Geometrist_IsIdentical(n,i,r)}},{key:"hasIntersection",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=pq(t),i=pq(e);return 1===this.module._UGCWasm_Geometrist_HasIntersection(n,i,r)}},{key:"hasTouch",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-6,n=pq(t),i=pq(e);return 1===this.module._UGCWasm_Geometrist_HasTouch(n,i,r)}},{key:"resample",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e-6,r=pq(t);return{type:"Feature",geometry:hq(this.module._UGCWasm_Geometrist_Resample(r,e))}}},{key:"isParallel",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsParallel(t,e,r,n,i,o,a,s)}},{key:"computePerpendicularPosition",value:function(t,e,r,n,i,o){var a=this.module._UGCWasm_Helper_CreateDoubleArray(0,2);return this.module._UGCWasm_Geometrist_ComputePerpendicularPosition(t,e,r,n,i,o,a),a=fq(a)}},{key:"isPointOnLine",value:function(t,e,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return 1===this.module._UGCWasm_Geometrist_IsPointOnLine(t,e,r,n,i,o,a)}},{key:"isProjectOnLineSegment",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsProjectOnLineSegment(t,e,r,n,i,o)}},{key:"distanceToLineSegment",value:function(t,e,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:Mn.DEGREE,s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:Mn.DEGREE,u=this.module._UGCWasm_Geometrist_DistanceToLineSegment(t,e,r,n,i,o);return s!==Mn.DEGREE?u*Ef(a)/Ef(s):u}},{key:"nearestPointToVertex",value:function(t,e,r){if("LineString"!==Sq(r))throw new Error("only feature type is LineString supported");var n=this.module._UGCWasm_Helper_CreateDoubleArray(0,2),i=pq(r);return this.module._UGCWasm_Geometrist_NearestPointToVertex(t,e,i,n),n=fq(n)}},{key:"computeConcaveHullPoints",value:function(t,e,r){if(!Array.isArray(e)){var n=dq(t);r=e,t=n.xList,e=n.yList}var i=cq(t),o=cq(e);return{type:"Feature",geometry:hq(this.module._UGCWasm_Geometrist_ComputeConcaveHullPoints(i,o,t.length,r))}}},{key:"isSegmentIntersect",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsSegmentIntersect(t,e,r,n,i,o,a,s)}},{key:"isIntersectRegionWithRect",value:function(t,e,r,n,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1e-6,a=pq(t);return 0!==this.module._UGCWasm_Geometrist_isIntersectRegionWithRect(a,e,r,n,i,o)}},{key:"isOnSameSide",value:function(t,e,r,n,i,o,a,s){return 1===this.module._UGCWasm_Geometrist_IsOnSameSide(t,e,r,n,i,o,a,s)}},{key:"isRight",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsRight(t,e,r,n,i,o)}},{key:"isLeft",value:function(t,e,r,n,i,o){return 1===this.module._UGCWasm_Geometrist_IsLeft(t,e,r,n,i,o)}},{key:"computeGeodesicArea",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ri.SQUAREMETER;if(!function(t){if(t&&t.geometry&&t.geometry.type){var e=t.geometry.type;if("Point"===e)return Ai(t.geometry.coordinates);if("LineString"===e)return Ai(t.geometry.coordinates[0]);if("Polygon"===e||"MultiLineString"===e)return Ai(t.geometry.coordinates[0][0])}}(t))throw new Error("coordinates is invalid latlng");if("Polygon"!==Sq(t))throw new Error("only feature type is Polygon supported");var r=pq(t),n=this.module._UGCWasm_Geometry_NewUGPrjCoordSys(4326),i=this.module._UGCWasm_Geometrist_ComputeGeodesicArea(r,n);return e!==ri.SQUAREMETER?i*kf[e]:i}},{key:"smooth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if("LineString"!==Sq(t))throw new Error("only feature type is LineString supported");var r=pq(t);return{type:"Feature",geometry:hq(this.module._UGCWasm_Geometrist_Smooth(r,e))}}},{key:"computeGeodesicDistance",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Mn.METER;if(!Array.isArray(e)){var o=dq(t),a=o.xList,s=o.yList;i=n||Mn.METER,n=r,r=e,t=a,e=s}if(!Ai([t[0],e[0]]))throw new Error("coordinates is invalid latlng");var u=cq(t),l=cq(e),c=this.module._UGCWasm_Geometrist_ComputeGeodesicDistance(u,l,r,n);return i!==Mn.METER?c/Ef(i):c}},{key:"computeParallel",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mn.DEGREE,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Mn.DEGREE;if("LineString"!==Sq(t))throw new Error("only feature type is LineString supported");n!==Mn.DEGREE&&(e=e*Ef(n)/Ef(r));var i=pq(t);return{type:"Feature",geometry:hq(this.module._UGCWasm_Geometrist_ComputeParallel(i,e))}}},{key:"computeConvexHullPoints",value:function(t,e){if(!Array.isArray(e)){var r=dq(t);t=r.xList,e=r.yList}var n=cq(t),i=cq(e);return{type:"Feature",geometry:hq(this.module._UGCWasm_Geometrist_ComputeConvexHullPoints(n,i,t.length))}}}])&&gq(r.prototype,n),i&&gq(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Sq(t){return"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}function Eq(t,e,r){r.defs(t)||(e?r.defs(t,e):console.error("".concat(t," not define")))}function kq(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mx;if("[object Object]"!==Object.prototype.toString.call(arguments[0]))Eq(t,e,r);else{var n=arguments[0];for(var i in n)Eq(i,n[i],r)}}function Tq(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mx;if(!e.defs(t)){var r={"EPSG:3857":'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"]]',"EPSG:4326":'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],AXIS["Easting", "EAST"],AXIS["Northing", "NORTH"],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]]',"EPSG:4490":'GEOGCS["China Geodetic Coordinate System 2000", DATUM["China 2000", SPHEROID["CGCS2000", 6378137.0, 298.257222101, AUTHORITY["EPSG","1024"]], AUTHORITY["EPSG","1043"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic latitude", NORTH], AXIS["Geodetic longitude", EAST], AUTHORITY["EPSG","4490"]]'};r[t]&&kq(t,r[t])}return e.defs(t)}function Cq(t){if("string"!=typeof t)return"";if(0===t.indexOf("EPSG"))return t;var e=t.lastIndexOf("AUTHORITY")+10,r=t.indexOf("]",e)-1;return e>0&&r>0?"EPSG:".concat(t.substring(e,r).split(",")[1].substr(1)):""}function Oq(t){var e=t.coordinates,r=t.sourceProjection,n=t.destProjection,i=void 0===n?"EPSG:4326":n,o=t.proj4,a=void 0===o?Mx:o;try{return a(r,i,e)}catch(t){throw"".concat(t," is not defined")}}function Aq(t,e){var r=t.replace(/^EPSG:/,""),n=Fi(e);return ut.get("".concat(n,"epsgcodes/").concat(r,".json"),null).then(function(t){return t.json()}).then(function(t){return t.wkt}).catch(function(t){console.error(t)})}function Pq(t){"@babel/helpers - typeof";return(Pq="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mq(){Mq=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Pq(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Iq(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Gq(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Lq(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function jq(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0}function iY(t,e){if(t){var r,n=Hq(r=t)||Vq(r)||Gq(r)||zq(),i=n[0],o=n.slice(1).filter(function(t){var e=Fq(t,2)[1];return!["$type","$id"].includes(e)}),a=Array.from(new Set(function t(e){var r=[];var n,i=Iq(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o instanceof Array&&o[1]&&"string"==typeof o[1])r.push(o[1]);else if(o instanceof Array){var a=t(o);a&&a.length>0&&r.push.apply(r,Bq(a))}}}catch(t){i.e(t)}finally{i.f()}return r}(o))),s=e([i].concat(Bq(o))),u=s.filter.bind(s);return{field:a,values:function(){for(var t=arguments.length,e=new Array(t),r=0;r=0}function m(t,e){return g(t,e)?jq(jq({},e),{},{withCredentials:!0}):jq(jq({},e),{},{withCredentials:void 0})}function b(t,e){return x.apply(this,arguments)}function x(){return(x=Dq(Mq().mark(function t(e,r){var n,i,o,a,u,l,c,f,h,d,y,g,b;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.url,i=e.dataSourceName,o=e.datasetName,a=e.credential,u={datasetNames:[i+":"+o],getFeatureMode:"SQL",targetEpsgCode:"4326",queryParameter:{name:o+"@"+i}},l="".concat(n.split("featureResults")[0],"datasources/").concat(i,"/datasets/").concat(o),c=m(l,r),t.next=6,p(l,a,c);case 6:return f=t.sent,h=f.fieldNames,d=f.fieldTypes,y=s(n,a),t.next=12,ut.post(y,JSON.stringify(u),c);case 12:return g=t.sent,t.next=15,g.json();case 15:return b=t.sent,t.abrupt("return",{type:"FeatureCollection",features:v((b||{}).features||[],h,d)});case 17:case"end":return t.stop()}},t)}))).apply(this,arguments)}function w(t,e){return ut.get(t,null,e).then(function(t){return t.json()}).then(function(t){if(!1===t.succeed)throw t.error.errorMsg;return t})}function _(t,e){return S.apply(this,arguments)}function S(){return(S=Dq(Mq().mark(function t(e,r){var n,i,o,a,s;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,w(e,r);case 2:if(n=t.sent,o=(i=n||{}).features,a=i.links,!(s=(void 0===a?[]:a).find(function(t){return"next"===t.rel}))){t.next=13;break}return t.t0=o,t.next=9,_(s.href,r);case 9:return t.t1=t.sent,t.abrupt("return",t.t0.concat.call(t.t0,t.t1));case 13:return t.abrupt("return",o);case 14:case"end":return t.stop()}},t)}))).apply(this,arguments)}function E(t,e){return k.apply(this,arguments)}function k(){return(k=Dq(Mq().mark(function t(e,r){var n,i;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(r.server,"web/datas/").concat(e,"/structureddata/ogc-features/collections/all/items.json?limit=10000&offset=0"),t.next=3,_(n,r);case 3:return i=t.sent,t.abrupt("return",{type:"FeatureCollection",features:i});case 5:case"end":return t.stop()}},t)}))).apply(this,arguments)}function C(t,e,r){if(t===e)return r;if("EPSG:4214"===t&&"EPSG:4326"===e&&180===r[0]){var n=Oq({coordinates:r,sourceProjection:t,destProjection:e,proj4:a});return n[0]=180,n}return Oq({coordinates:r,sourceProjection:t,destProjection:e,proj4:a})}function O(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"EPSG:4326";if(t&&t.length&&e)return e===r?t:t.map(function(t){var n=function(t,e,r){if("MultiPolygon"===r.type){var n=r.coordinates;return{type:r.type,coordinates:n.map(function(r){return r.map(function(r){return r.map(function(r){return C(t,e,r)})})})}}if("Polygon"===r.type||"MultiLineString"===r.type){var i=r.coordinates;return{type:r.type,coordinates:i.map(function(r){return r.map(function(r){return C(t,e,r)})})}}if("MultiPoint"===r.type||"LineString"===r.type){var o=r.coordinates;return{type:r.type,coordinates:o.map(function(r){return C(t,e,r)})}}if("Point"===r.type)return{type:r.type,coordinates:C(t,e,r.coordinates)}}(e,r,t.geometry),i=jq({},t);return n&&Object.assign(i,{geometry:n}),i})}function A(t,e){return P.apply(this,arguments)}function P(){return(P=Dq(Mq().mark(function t(e,r){var n,i,o,s,u,l;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,E(e.dataId,r);case 2:return n=t.sent,t.next=5,ut.get("".concat(r.server,"web/datas/").concat(e.dataId,"/structureddata.json"),null,r);case 5:return i=t.sent,t.next=8,i.json();case 8:if(o=t.sent,"EPSG:4326"===(s="EPSG:".concat(o.epsgCode))){t.next=18;break}if(Tq(s,a)){t.next=16;break}return t.next=14,Aq(s,r.server);case 14:u=t.sent,kq(s,u,a);case 16:(l=O(n.features,s))&&(n.features=l);case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}},t)}))).apply(this,arguments)}function M(t){return{type:"json",x:t.originX,y:t.originY,x1:t.destinationX,y1:t.destinationY}}function I(t){var e=t.clusterField,r=t.clusterMethod,n=t.clusterRadius;return[{type:t.clusterType,field:e,method:r&&{avg:"mean"}[r]||r,size:n}]}function L(t,e,r){return j.apply(this,arguments)}function j(){return(j=Dq(Mq().mark(function t(e,r,n){var i,o,a,s,u,l;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.data,o=e.od,a=e.cluster,!i||"FeatureCollection"!==i.type){t.next=3;break}return t.abrupt("return",{data:i});case 3:if(s={"supermap-rest-data":b,"supermap-structured-data":A},u=o&&M(e),l=a&&I(e),t.t0=s[i.type],!t.t0){t.next=11;break}return t.next=10,s[i.type](e.data,n);case 10:t.t0=t.sent;case 11:return t.t1=t.t0,t.t2=u,t.t3=l,t.abrupt("return",{data:t.t1,parser:t.t2,transforms:t.t3});case 15:case"end":return t.stop()}},t)}))).apply(this,arguments)}function N(t,e,r){var n={data:((t||{}).tiles||[])[0],parser:{type:"mvt",extent:t.bounds,sourceLayer:e}};return g(n.data,r)&&Object.assign(n.parser,{requestParameters:{credentials:"include"}}),n}function R(t,e,r){var n=t.type,i={vector:N,geojson:L};return i[n]&&i[n](t,e,r)}function D(t){var r=t.type,n=t.id,i=t.minzoom,o=t.maxzoom,a=t.layout,s=t.paint,u=t.filter,l=t.source;return{id:n,options:{type:r,name:t.id,sourceLayer:t["source-layer"],source:l,layout:a,paint:s,filter:u,minZoom:i,maxZoom:o,visible:"none"!==a.visibility},filter:iY(u,e)}}function B(t){var e=t.value,i=t.property,o=t.multiple,a=t.map;if(!r.isExpression(e))return{values:o?e*o:e};var s={interpolate:function(t){return t.value._styleExpression.expression.input.args[0].args[0].evaluate(t.value._styleExpression._evaluator)},match:function(t){return t.value._styleExpression.expression.input.args[0].evaluate(t.value._styleExpression._evaluator)},case:function(t){var e=t.value._styleExpression.expression.branches[0][0];return e&&e.args?e.args[0].lhs.args[0].args[0].evaluate(t.value._styleExpression._evaluator):e.lhs.args[0].evaluate()}},u=n[{size:"paint_circle",color:"paint_circle",shape:"layout_symbol"}[i]][{size:"circle-radius",color:"circle-color",shape:"icon-image"}[i]],l=r.createPropertyExpression(e,u),c=s[e[0]]&&s[e[0]](l),f=l.value.evaluate.bind(l.value);return{field:c,values:function(t){var e={properties:Nq({},c,t),type:"point"},r=f({zoom:a.getZoom()},e);return"shape"===i?r.toString():o?r*o:r}}}function F(t,e){return Nq(Nq(Nq(Nq(Nq(Nq(Nq(Nq({},"".concat(t,"-dasharray"),"dashArray"),"".concat(t,"-opacity"),"opacity"),"".concat(t,"-pattern-color"),"textureColor"),"".concat(t,"-pattern-opacity"),"opacity"),"".concat(t,"-pattern-interval"),"iconStep"),"".concat(t,"-pattern-blend"),"textureBlend"),"".concat(t,"-segment"),"segmentNumber"),"".concat(t,"-pattern-rotate"),"textureRotate")[e]}function z(t,e){return Nq(Nq(Nq({},"".concat(t,"-animate-duration"),"duration"),"".concat(t,"-animate-interval"),"interval"),"".concat(t,"-animate-trailLength"),"trailLength")[e]}function G(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&!function(t){return 2===t.length&&1===t[0]&&0===t[1]}(t)?"dash":"solid"}function q(t,e,r){var n=t.paint,i=t.layout,o=n["circle-color"]||"#EE4D5A",a=n["circle-radius"]||30,s=n["circle-opacity"],u=i["circle-animate-speed"],l=i["circle-animate-rings"];return jq(jq({},D(t)),{},{type:qq.point,source:e,color:B({value:o,property:"color",map:r}),size:B({value:a,property:"size",multiple:2,map:r}),shape:{values:"circle"},style:{opacity:s},animate:{enable:!0,speed:u,rings:l}})}function Y(t,e,r){var n=t.paint,i=t.layout,o=n["radar-color"]||"#EE4D5A",a=n["radar-radius"]||30,s=n["radar-opacity"],u=i["radar-animate-speed"];return jq(jq({},D(t)),{},{type:qq.point,source:e,color:B({value:o,property:"color",map:r}),size:B({value:a,property:"size",map:r}),shape:{values:"radar"},style:{opacity:s,speed:u},animate:{enable:!0}})}function X(t,e,r){var n=t.paint,i=t.layout,o=i["line-curve-shape"]||i["line-curve-extrusion-shape"],a="arc3d"===o?"line-curve-extrusion":"line-curve",s=n["".concat(a,"-color")]||"#ff6b34",u=n["".concat(a,"-width")]||1,l=n["".concat(a,"-dasharray")],c=n["".concat(a,"-pattern")],f=jq(jq({},D(t)),{},{type:qq.line,source:{data:e.data.features.map(function(t){return t.properties}),parser:e.parser},color:B({value:s,property:"color",map:r}),size:B({value:u,property:"size",map:r}),shape:{values:o},style:{lineType:W(l)}});for(var h in n){var p=F(a,h);p&&Object.assign(f.style||{},Nq({},p,n[h]))}for(var d in i){var y=F(a,d);y&&Object.assign(f.style||{},Nq({},y,i[d]));var v=z(a,d);v&&(f.animate||(f.animate={}),Object.assign(f.animate,Nq({},v,i[d])))}return c&&(f.texture={values:c},Object.assign(f.style||{},{lineTexture:!0})),f}function Z(t,e,r){var n=t.paint,i=t.layout,o=n["point-extrusion-color"]||"#EE4D5A",a=n["point-extrusion-width"]||12,s=n["point-extrusion-length"]||12,u=n["point-extrusion-height"]||12,l=n["point-extrusion-opacity"],c=n["point-extrusion-source-color"],f=n["point-extrusion-target-color"],h=n["point-extrusion-opacity-linear-direction"],p=i["point-extrusion-shape"]||"cylinder";return jq(jq({},D(t)),{},{type:qq.point,source:e,color:B({value:o,property:"color",map:r}),size:G(r,{value:a,multiple:.5},{value:s,multiple:.5},{value:u}),shape:B({value:p,property:"shape",map:r}),style:{opacity:l,sourceColor:c,targetColor:f,opacityLinear:{enable:!!h,dir:h}}})}function K(t,e,r){var n=t.paint,i=t.layout,o=n["line-extrusion-color"]||"#ff6b34",a=n["line-extrusion-width"]||12,s=n["line-extrusion-base"]||0,u=n["line-extrusion-dasharray"],l=n["line-extrusion-pattern"],c=jq(jq({},D(t)),{},{type:qq.line,source:e,color:B({value:o,property:"color",map:r}),size:G(r,{value:a,multiple:rY},{value:s}),shape:{values:"line"},style:{lineType:W(u)}});for(var f in n){var h=Yq[f];h&&Object.assign(c.style||{},Nq({},h,n[f]))}for(var p in i){var d=Yq[p];d&&Object.assign(c.style||{},Nq({},d,i[p]));var y=Xq[p];y&&(c.animate||(c.animate={}),Object.assign(c.animate,Nq({},y,i[p])))}return l&&(c.texture={values:l},Object.assign(c.style||{},{lineTexture:!0})),c}function J(t,e){var r=t.paint,n=t.layout,i=r["chart-background-color"],o=r["chart-width"],a=r["chart-height"],s={grid:r["chart-xAxis-grid"],label:r["chart-xAxis-label"],line:r["chart-xAxis-line"]},u={grid:r["chart-yAxis-grid"],label:r["chart-yAxis-label"],line:r["chart-yAxis-line"]},l=n["chart-type"],c=n["chart-attribute-color"],f="line"===l&&c.length>0&&{values:c[0][1]};return jq(jq({},D(t)),{},{type:qq.point,id:t.id,source:e,layerType:Zq.MarkerLayer,chartType:l,fields:{values:"bar"===l?U(c):function(t){return t.map(function(t){return Fq(t,1)[0]})}(c)},width:{values:o},height:{values:a},background:{values:i},xAxis:{values:s},yAxis:{values:u},color:f})}function Q(t,e){var r=t.paint,n=t.layout,i=r["chart-radius"],o=r["chart-inner-radius"],a=n["chart-type"],s=n["chart-attribute-color"];return jq(jq({},D(t)),{},{type:qq.point,id:t.id,source:e,layerType:Zq.MarkerLayer,chartType:a,fields:{values:U(s)},radius:{values:i},innerRadius:{values:o}})}function $(t,e,r){var n=t.paint,i=t.layout,o=n["heatmap-color"]||"#EE4D5A",a=n["heatmap-opacity"],s=i["heatmap-shape"],u=i["heatmap-rotate"],l=i["heatmap-coverage"];return jq(jq({},D(t)),{},{type:qq.heatmap,id:t.id,source:e,shape:{values:s},color:B({value:o,property:"color",map:r}),style:{opacity:a,coverage:l,angle:u}})}function tt(t,e,r){var n=t.paint,i=t.layout,o=n["heatmap-extrusion-color"]||"#EE4D5A",a=n["heatmap-extrusion-opacity"],s=n["heatmap-extrusion-height"],u=i["heatmap-extrusion-shape"],l=i["heatmap-extrusion-rotate"],c=i["heatmap-extrusion-coverage"];return jq(jq({},D(t)),{},{type:qq.heatmap,id:t.id,source:e,shape:{values:u},size:B({value:s,property:"size",map:r}),color:B({value:o,property:"color",map:r}),style:{opacity:a,coverage:c,angle:l}})}function et(t,e){var i=t.paint,o=i["heatmap-extrusion-color"],a=i["heatmap-extrusion-opacity"],s=i["heatmap-extrusion-intensity"],u=i["heatmap-extrusion-radius"],l=i["heatmap-extrusion-weight"];return jq(jq({},D(t)),{},{type:qq.heatmap,id:t.id,source:e,size:{field:l,values:[0,1]},shape:{values:"heatmap3D"},style:{rampColors:function(t){var e=n.paint_heatmap["heatmap-color"],i=r.createPropertyExpression(t,e);return{positions:i.value._styleExpression.expression.labels,colors:i.value._styleExpression.expression.outputs.map(function(t){return t.value})}}(o),opacity:a,intensity:s,radius:u}})}function rt(t,e,r,n){var i=t.paint,o=t.layout,a=o["text-field"].split("{")[1].split("}")[0],s={};return Object.keys(function(t,e){var r={};for(var n in t)e.includes(n)||(r[n]=t[n]);return t}(Kq,["text-color","text-size","text-field"])).forEach(function(e){var r,n=(t[(r=e,Jq.includes(r)?"layout":"paint")]||{})[e];void 0!==n&&(s[Kq[e]]=n)}),jq(jq({},D(t)),{},{type:qq.point,id:t.id,source:e,color:B({value:i["text-color"],property:"color",map:n}),size:B({value:o["text-size"],property:"size",map:n}),shape:{field:a,values:"text"},style:s})}function nt(t){return it.apply(this,arguments)}function it(){return(it=Dq(Mq().mark(function t(e){var r,n,i,o,a,s,u,l,c,f,h,p;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=e.layers,n=e.sources,i=e.map,o=e.options,a=[],s=Iq(r),t.prev=3,s.s();case 5:if((u=s.n()).done){t.next=23;break}return l=u.value,t.prev=7,c=n[l.source],f=Nq(Nq(Nq(Nq(Nq(Nq(Nq(Nq(Nq(Nq({},Wq.animatePoint,q),Wq.radarPoint,Y),Wq.od,X),Wq.column,Z),Wq.line,K),Wq.bar,J),Wq.pie,Q),Wq.heatGrid,$),Wq.heat3DGrid,tt),Wq.heat3D,et),t.next=12,R(c,l["source-layer"],o);case 12:h=t.sent,p=V(l),a.push(f[p]&&f[p](l,h,i)||rt(l,h,(l||{}).visible,i)),t.next=21;break;case 17:t.prev=17,t.t0=t.catch(7),console.error(t.t0),o.emitterEvent("layercreatefailed",{error:t.t0,map:i,layer:l});case 21:t.next=5;break;case 23:t.next=28;break;case 25:t.prev=25,t.t1=t.catch(3),s.e(t.t1);case 28:return t.prev=28,s.f(),t.finish(28);case 31:return t.abrupt("return",a);case 32:case"end":return t.stop()}},t,null,[[3,25,28,31],[7,17]])}))).apply(this,arguments)}function ot(t){return at.apply(this,arguments)}function at(){return(at=Dq(Mq().mark(function t(e){return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t){e.getL7Scene().then(function(e){t(e)})}));case 1:case"end":return t.stop()}},t)}))).apply(this,arguments)}function st(t,e){if(e){var r=document.createElement("canvas");r.width=e.width,r.height=e.height;var n=r.getContext("2d");if(n)return n.drawImage(e,0,0),n.getImageData(t.x,t.y,t.width,t.height)}}function lt(t){var e=Fq(JW.getData(JW.toRGBA(t)),4);return{r:e[0],g:e[1],b:e[2],a:e[3]}}function ct(t,e){return ft.apply(this,arguments)}function ft(){return(ft=Dq(Mq().mark(function t(e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ht(e);case 2:if(n=t.sent,i=r.color,o=r.rotate,a=document.createElement("canvas"),s=a.getContext("2d"),a.width=n.width,a.height=n.height,s.translate(a.width/2,a.height/2),0!==o&&s.rotate(o*Math.PI/180),s.drawImage(n,-n.width/2,-n.height/2),i){for(u=s.getImageData(0,0,a.width,a.height),l=u.data,c=lt(i),f=c.r,h=c.g,p=c.b,d=c.a,y=0;y1&&!t.includes("/sprite@2x")?function(t){var e=t.split("/"),r=e.slice(-1)[0];if(!r)return t;var n=r.replace("sprite","sprite@2x");return e.splice(e.length-1,1,n),e.join("/")}(t):t}(r)+".png";return n&&(i+="?token=".concat(n)),i}function gt(t,e){return new Promise(function(r){var n=vt(t),i=new XMLHttpRequest,o=new Image;o.crossOrigin="",i.responseType="blob",i.open("get",n,!0),i.withCredentials=e.withCredentials,i.setRequestHeader("accept","image/webp,*/*"),i.onreadystatechange=function(){4===i.readyState&&200===i.status&&(o.src=URL.createObjectURL(i.response),o.onload=function(){r(o)},o.onerror=function(){r(null)})},i.send(null)})}function mt(t,e,r){return bt.apply(this,arguments)}function bt(){return(bt=Dq(Mq().mark(function t(e,r,n){var i;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,gt(e,n);case 2:if(i=t.sent){t.next=5;break}return t.abrupt("return");case 5:return t.abrupt("return",st(r,i));case 6:case"end":return t.stop()}},t)}))).apply(this,arguments)}function xt(t){return wt.apply(this,arguments)}function wt(){return(wt=Dq(Mq().mark(function t(e){var r,n,i,o,a,s,u,l,c,f,h,p,d,y,v,g;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=e.layers,n=e.sprite,i=e.spriteJson,o=e.scene,a=e.options,s=+new Date,u=0;case 3:if(!(u2&&void 0!==arguments[2]&&arguments[2],n=[],i=e.properties,o=0;return r&&t.forEach(function(t){var e=i?i[t]:0;o+=e}),t.forEach(function(t){var e=i?i[t]:0,a={x:t,y:e};r&&(a.percent=e/o),n.push(a)}),n}function Tt(t,e,r,n){if(!T){throw console.error("G2 is not define"),new Error("G2 is not define")}var i=new pG({container:t,width:e,height:r,autoFit:!0});return i.legend(!1),i.data(n),i}function Ct(t,e){return new o.Marker({element:t}).setLnglat(e)}function Ot(t,e){var r=_t.getMarkerLayer(t);r&&(e.removeMarkerLayer(r),_t.removeMarkerLayer(t))}function At(t,e){var r=t.source,n=t.id,i=t.chartType,a=r.data;t.filter&&(a=function(t,e){var r=t.features,n=e.field,i=e.values;return{type:"FeatureCollection",features:r.filter(function(t){var e=n.map(function(e){return(t.properties||{})[e]});return i.apply(void 0,Bq(e))})}}(r.data,t.filter)),Ot(n,e);var s=[];if(i===eY.bar){var u=t.fields,l=t.width,c=t.height,f=t.background,h=t.xAxis,p=t.yAxis,d={width:l.values,height:c.values,background:f.values,xAxis:h.values,yAxis:p.values};s=function(t,e,r){var n=e.width,i=e.height,o=e.background,a=e.xAxis,s=e.yAxis,u=r.features,l=Object.keys(t),c=Object.values(t),f=St(a),h=St(s),p=document.createElement("div");return p.style.backgroundColor=o,u.map(function(t){var e=p.cloneNode(),r=Et(t),o=kt(l,t),a=Tt(e,n,i,o);return a.axis("x",f),a.axis("y",h),a.interval().position("x*y").color("x",c),a.render(),Ct(e,r)})}(u.values,d,a)}if(i===eY.line){var y=t.color,v=t.fields,g=t.width,m=t.height,b=t.background,x=t.xAxis,w=t.yAxis,_={width:g.values,height:m.values,background:b.values,xAxis:x.values,yAxis:w.values,color:y.values};s=function(t,e,r){var n=e.color,i=e.width,o=e.height,a=e.background,s=e.xAxis,u=e.yAxis,l=r.features,c=St(s),f=St(u),h=document.createElement("div");return h.style.background=a,l.map(function(e){var r=h.cloneNode(),a=Et(e),s=kt(t,e),u=Tt(r,i,o,s);return u.axis("x",c),u.axis("y",f),u.line().position("x*y").color(n),u.render(),Ct(r,a)})}(v.values,_,a)}if(i===eY.pie){var S=t.fields,E=t.radius,k=t.innerRadius,T={radius:E.values,innerRadius:k.values};s=function(t,e,r){var n=r.features,i=Object.keys(t),o=Object.values(t),a=e.radius,s=e.innerRadius,u=document.createElement("div");return n.map(function(t){var e=u.cloneNode(),r=Et(t),n=kt(i,t,!0),l=Tt(e,a,a,n);return l.coord("theta",{innerRadius:s}),l.interval().adjust("stack").position("percent").color("x",o).shape("sliceShape"),l.render(),Ct(e,r)})}(S.values,T,a)}var C=function(t){var e=new o.MarkerLayer;return t.forEach(function(t){e.addMarker(t)}),e}(s);return e.addMarkerLayer(C),_t.setMarkerLayer(n,C),C}function Pt(t,e){var r=Nq(Nq(Nq(Nq({},qq.line,"LineLayer"),qq.point,"PointLayer"),qq.polygon,"PolygonLayer"),qq.heatmap,"HeatmapLayer"),n=t.source||{},o=e.promoteId;o||(o=e.tiles&&e.tiles[0].includes("/structureddata/")?"smpid":void 0);var a=new i({type:r[t.type],options:jq(jq({},t.options),{},{layerID:(t.options||{}).name,featureId:o})}),s=a.getL7Layer(),u={},l=t.shape||{};if(n.parser&&(u.parser=t.source.parser),n.transforms&&(u.transforms=t.source.transforms),s.source(n.data,u),l.field?s.shape(l.field,l.values):s.shape(l.values),t.texture&&s.texture(t.texture.values),t.size&&(t.size.field?s.size(t.size.field,t.size.values):s.size(t.size.values)),t.color&&(t.color.field?s.color(t.color.field,t.color.values):s.color(t.color.values)),t.style&&s.style(t.style),t.animate&&s.animate(t.animate),t.filter){var c=$W()(function(){a.reRender()},500);s.filter(t.filter.field,function(){var e,r=(e=t.filter).values.apply(e,arguments);return r&&c(),r})}return a}return{addL7Layers:function(t){return Dq(Mq().mark(function e(){var r,n,i,o,a,s,u,l,c,f,h,p,d;return Mq().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.map,n=t.webMapInfo,i=t.l7Layers,o=t.spriteDatas,a=t.options,s=n.layers,u=n.sources,l=n.sprite,e.next=4,nt({layers:i,sources:u,map:r,options:Object.assign({withoutFormatSuffix:!0},a)});case 4:return c=e.sent,e.next=7,ot(r);case 7:if(f=e.sent,!(Object.keys(o).length>0)){e.next=18;break}return e.prev=9,e.next=12,xt({layers:c.filter(function(t){return!!t.texture}),spriteJson:o,sprite:l,scene:f,options:a});case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(9),console.error(e.t0),a.emitterEvent("layercreatefailed",{error:e.t0,map:r});case 18:h=Iq(c),e.prev=19,d=Mq().mark(function t(){var e,n,i,o,a;return Mq().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:e=p.value,n=s.findIndex(function(t){return t.id===e.id}),i=s.slice(n+1).find(function(t){return!nY(t)}),e.layerType===Zq.MarkerLayer?(o=e,!1!==(e.options||{}).visible&&At(o,f),_t.setSceneChartLayer(e.id,o)):(a=Pt(e,u[s[n].source]),r.getLayer(a.id)||r.addLayer(a,i&&i.id));case 4:case"end":return t.stop()}},t)}),h.s();case 22:if((p=h.n()).done){e.next=26;break}return e.delegateYield(d(),"t1",24);case 24:e.next=22;break;case 26:e.next=31;break;case 28:e.prev=28,e.t2=e.catch(19),h.e(e.t2);case 31:return e.prev=31,h.f(),e.finish(31);case 34:case"end":return e.stop()}},e,null,[[9,14],[19,28,31,34]])}))()},isL7Layer:nY,getL7MarkerLayers:function(){return _t.markerLayers},removeL7MarkerLayer:Ot}}function aY(t){return function(t){if(Array.isArray(t))return SY(t)}(t)||sY(t)||_Y(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sY(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function uY(t,e){return cY(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||_Y(t,e)||lY()}function lY(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function cY(t){if(Array.isArray(t))return t}function fY(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function _Y(t,e){if(t){if("string"==typeof t)return SY(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?SY(t,e):void 0}}function SY(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r`.",required:!0},import:{id:{type:"string",doc:"Unique import name.",required:!0},url:{type:"string",doc:"The URL of the style.",required:!0},config:{type:"config",doc:"Configuration values for the imported style's options."},data:{type:"$root",doc:"The inlined style that must correspond to the contents of the specified URL."}},config:{"*":{type:"*",doc:"Value of the imported style's configuration option."}},schema:{"*":{type:"option",doc:"Specification of a configuration option."}},option:{default:{type:"*",doc:"Default configuration value for this option.","property-type":"data-constant",expression:{interpolated:!1},required:!0},type:{type:"enum",doc:"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.",values:{string:{doc:"The result will be coerced to a string."},number:{doc:"The result will be coerced to a number."},boolean:{doc:"The result will be coerced to a boolean."},color:{doc:"The result will be coerced to a color."}}},array:{type:"boolean",doc:"If true, this option is returned as an array"},minValue:{type:"number",doc:"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},maxValue:{type:"number",doc:"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},stepValue:{type:"number",doc:"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},values:{type:"array",value:"*",doc:"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."}},models:{"*":{type:"model",doc:"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{id:{type:"string",doc:"Unique light name.",required:!0},properties:{type:"properties",doc:"Properties of the light."},type:{type:"enum",doc:"Type of the light to be added",values:{ambient:{doc:"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},directional:{doc:"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},flat:{doc:"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}}},properties:["properties_light_directional","properties_light_ambient","properties_light_flat"],properties_light_directional:{direction:{type:"array",default:[210,30],minimum:[0,0],maximum:[360,90],length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).",example:[90,40],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"cast-shadows":{type:"boolean",default:!1,doc:"Enable/Disable shadow casting for this light",transition:!1,expression:{interpolated:!1},"property-type":"data-constant","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"shadow-intensity":{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},doc:"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_ambient:{color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},properties_light_flat:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_array:{experimental:!0,type:{required:!0,type:"enum",values:{"raster-array":{doc:"A raster array source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},rasterLayers:{type:"*",doc:"Contains the description of the raster data layers and the bands contained within the tiles."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},minzoom:{type:"number",default:0,doc:"Minimum zoom level at which to create vector tiles"},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the GeoJSON features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."},dynamic:{type:"boolean",default:!1,doc:"Whether to optimize this source for frequent data updates (e.g. animating features).","sdk-support":{"basic functionality":{js:"3.4.0"}}}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!1,type:"string",doc:"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_model:{type:{required:!0,type:"enum",values:{model:{doc:"A collection of 3D models"},"batched-model":{doc:"A collection of 3D models with anchor data"}},doc:"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which batched-model tiles are available"},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},"raster-particle":{experimental:!0,doc:"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}}},model:{doc:"A 3D model",experimental:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},slot:{doc:"Marks the position of a slot.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},clip:{doc:"Layer that removes 3D content from map.",experimental:!0,"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.6.0",ios:"11.6.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},slot:{type:"string",doc:"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_model:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"model-id":{type:"string",default:"",doc:"Model to render. It can be either a string referencing an element to the models root property or an internal or external URL","property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!1,requires:[{source:["geojson","vector"]}]}},layout_clip:{"clip-layer-types":{type:"array",value:"enum",values:{model:{doc:"If present the clip layer would remove all 3d model layers below it. Currently only instanced models (e.g. trees) are removed."},symbol:{doc:"If present the clip layer would remove all symbol layers below it."}},default:[],doc:"Layer types that will also be removed if fallen below this clip layer.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.6.0",ios:"11.6.0"}},expression:{interpolated:!1},"property-type":"data-constant",experimental:!0}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"},"fill-extrusion-edge-radius":{type:"number",experimental:!0,private:!0,default:0,minimum:0,maximum:1,doc:"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."},none:{doc:"Line segments are not joined together, each one creates a separate line. Useful in combination with line-pattern. Line-cap property is not respected. Can't be used with data-driven styling."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"},"`none` value":{js:"3.4.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{type:"number",experimental:!0,doc:"Vertical offset from ground, in meters. Defaults to 0. Not supported for globe projection at the moment.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"},"data-driven styling":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature","line-progress"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{type:"boolean",default:!1,doc:"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},requires:[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0",android:"10.0.0",ios:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either ['horizontal', 'vertical'] or ['vertical', 'horizontal'], the order doesn't affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},"layout_raster-particle":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"},"expressions support":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},expression:{interpolated:!1},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"},"expressions support":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!1},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},config:{doc:"Retrieves the configuration value for the given option.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0",android:"10.0.0",ios:"10.0.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},match:{doc:'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\n - a single literal value; or\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\n\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\nIf the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`'image'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`'format'`](#types-format) expression. A [`'coalesce'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `'image'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `'image'` expression.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},hsl:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},hsla:{doc:"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"2.12.1",android:"10.11.0",ios:"10.11.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},properties:{doc:'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns `null` if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0",android:"10.0.0",ios:"10.0.0"}}},"geometry-type":{doc:"Returns the feature's geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},id:{doc:"Returns the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},zoom:{doc:'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},pitch:{doc:'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"distance-from-center":{doc:'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0",android:"10.9.0",ios:"10.9.0"}}},"measure-light":{doc:"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.",group:"Lookup","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"9.2.0",ios:"5.9.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0",ios:"4.1.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0"}}},"raster-value":{doc:"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.",group:"Raster Colorization","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-particle-speed":{doc:"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.",group:"Raster Particle Animation","sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}}},random:{doc:"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.",group:"Math","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"vertical-range":{type:"array",default:[0,0],minimum:0,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"],relaxZoomRestriction:!0},doc:"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}}},camera:{"camera-projection":{doc:"Camera projection describes how 3D world geometry get projected into 2D screen",type:"enum",values:{perspective:{doc:"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},orthographic:{doc:"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"perspective","property-type":"data-constant"}},colorTheme:{data:{type:"string",doc:"Expects a base64 encoded PNG image which represents a cube strip LUT. The height of the image cannot exceed 32 pixels and the width must be equal to the height squared.",transition:!1,"property-type":"data-constant",expression:{interpolated:!1}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."},globe:{doc:"A globe projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0",ios:"10.5.0",android:"10.5.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-180,-90],maximum:[180,90],transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",minimum:[-90,-90],maximum:[90,90],transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.",requires:["source"],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant",type:"number",private:!0,default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant",type:"number",private:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.",requires:["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.7.0",ios:"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant",type:"number",experimental:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.",requires:["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant",type:"number",experimental:!0,default:3,minimum:0,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant",type:"number",experimental:!0,default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant",type:"color",experimental:!0,default:"#ffffff",doc:"The color of the flood light effect on the walls of the extruded buildings.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant",type:"number",experimental:!0,default:0,minimum:0,maximum:1,doc:"The intensity of the flood light color.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven",type:"number",experimental:!0,units:"meters",default:0,minimum:0,doc:"The extent of the flood light effect on the walls of the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven",type:"number",experimental:!0,units:"meters",default:0,doc:"The extent of the flood light effect on the ground beneath the extruded buildings in meters.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant",type:"number",experimental:!0,default:.69,minimum:0,maximum:1,doc:"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.",requires:["lights"],transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant",type:"number",experimental:!0,default:1,minimum:0,doc:"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant",type:"boolean",default:!0,experimental:!0,doc:"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.",requires:["fill-extrusion-edge-radius"],transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.10.0",ios:"10.10.0"}},expression:{interpolated:!1,parameters:["zoom"]}},"fill-extrusion-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!1,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{type:"color",doc:'A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',example:["interpolate",["linear"],["line-progress"],0,"blue",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be painted using `line-trim-color,` which is transparent by default to produce a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0"}},"property-type":"constant"},"line-trim-fade-range":{type:"array",value:"number",doc:"The fade range for the trim-start and trim-end points is defined by the `line-trim-offset` property. The first element of the array represents the fade range from the trim-start point toward the end of the line, while the second element defines the fade range from the trim-end point toward the beginning of the line. The fade result is achieved by interpolating between `line-trim-color` and the color specified by the `line-color` or the `line-gradient` property.",experimental:!0,length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:["line-trim-offset",{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["zoom","measure-light"]},"sdk-support":{"basic functionality":{js:"3.6.0",android:"11.6.0",ios:"11.6.0"}},"property-type":"data-constant"},"line-trim-color":{type:"color",doc:"The color to be used for rendering the trimmed line section that is defined by the `line-trim-offset` property.",experimental:!0,default:"transparent",transition:!0,requires:["line-trim-offset",{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"3.6.0",android:"11.6.0",ios:"11.6.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{type:"number",private:!0,doc:"The width of the line border. A value of zero means no border.",default:0,minimum:0,transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{type:"color",private:!0,doc:"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.",default:"rgba(0, 0, 0, 0)",transition:!0,"sdk-support":{"basic functionality":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"},"data-driven styling":{js:"3.0.0",android:"10.9.0",ios:"10.9.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{type:"number",default:0,minimum:0,maximum:1,experimental:!0,doc:"Opacity multiplier (multiplies line-opacity value) of the line part that is occluded by 3D objects. Value 0 hides occluded part, value 1 means the same opacity as non-occluded part. The property is not supported when `line-opacity` has data-driven styling.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},transition:!0,"property-type":"data-constant"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{doc:"The opacity at which the icon will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.",type:"number",minimum:0,maximum:1,default:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"},"data-driven styling":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{type:"number",default:1,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the icon's halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},requires:["icon-image"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},doc:"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.",transition:!0},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{type:"number",doc:"The opacity at which the text will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.",minimum:0,maximum:1,default:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"},"data-driven styling":{js:"3.5.0",android:"11.5.0",ios:"11.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!1,doc:"Increase or reduce the saturation of the symbol icon.","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}},expression:{interpolated:!1},"property-type":"data-constant"},"icon-color-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!1,doc:"Increase or reduce the contrast of the symbol icon.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1},"property-type":"data-constant"},"icon-color-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the symbols. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1},"property-type":"data-constant"},"icon-color-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the symbols. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}},expression:{interpolated:!1},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-color":{type:"color",doc:'Defines a color map by which to colorize a raster layer, parameterized by the `["raster-value"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.',transition:!1,"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{type:"array",default:[.2126,.7152,.0722,0],length:4,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.",example:[.2126,.7152,.0722,0],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-color-range":{type:"array",length:2,value:"number","property-type":"data-constant",transition:!0,requires:["raster-color"],expression:{interpolated:!0,parameters:["zoom"]},doc:"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source's stated data range is used.",example:[.5,10],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}}},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{type:"string",required:!1,experimental:!0,"property-type":"data-constant",transition:!1,requires:[{source:"raster-array"}],doc:"Displayed band of raster array source layer. Defaults to the first band if not set.",example:"band-name","sdk-support":{"basic functionality":{js:"3.1.0",android:"11.1.0",ios:"11.1.0"}}},"raster-elevation":{type:"number",doc:"Specifies an uniform elevation from the ground, in meters.",default:0,minimum:0,transition:!0,experimental:!0,"sdk-support":{"basic functionality":{js:"3.1.0",android:"11.2.0",ios:"11.2.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{type:"string",required:!1,"property-type":"data-constant",transition:!1,doc:"Displayed band of raster array source layer",example:'"1713348000"',"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}}},"raster-particle-count":{type:"number",doc:"Defines the amount of particles per tile.",default:512,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},"property-type":"data-constant"},"raster-particle-color":{type:"color",doc:'Defines a color map by which to colorize a raster particle layer, parameterized by the `["raster-particle-speed"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.',transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{type:"number",doc:"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.",default:1,minimum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},"property-type":"data-constant"},"raster-particle-speed-factor":{type:"number",doc:"Defines a coefficient for the speed of particles’ motion.",default:.2,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{type:"number",doc:"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.",default:.98,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{type:"number",doc:"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).",default:.8,minimum:0,maximum:1,transition:!1,"sdk-support":{"basic functionality":{js:"3.3.0",android:"11.4.0",ios:"11.4.0"}},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!1,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{type:"number",default:0,minimum:0,transition:!0,units:"intensity",doc:"Controls the intensity of light emitted on the source features.",requires:["lights"],"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},expression:{interpolated:!0,parameters:["zoom","measure-light"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_model:{"model-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the model layer.",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-rotation":{type:"array",value:"number",length:3,default:[0,0,0],period:360,units:"degrees","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{type:"array",value:"number",length:3,default:[1,1,1],doc:"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-translation":{type:"array",value:"number",length:3,default:[0,0,0],"property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0,doc:"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{type:"color",default:"#ffffff",doc:"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-color-mix-intensity":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:1,doc:"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model's colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-type":{type:"enum",values:{"common-3d":{doc:"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{doc:"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},default:"common-3d",doc:"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow casting for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{type:"boolean",default:!0,doc:"Enable/Disable shadow receiving for this layer",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{type:"number",default:1,minimum:0,maximum:1,doc:"Intensity of the ambient occlusion if present in the 3D model.",expression:{interpolated:!0,parameters:["zoom"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant",transition:!0},"model-emissive-strength":{type:"number","property-type":"data-driven",default:0,minimum:0,maximum:5,units:"intensity",doc:"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-roughness":{type:"number",default:1,minimum:0,maximum:1,doc:"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-height-based-emissive-strength-multiplier":{type:"array",default:[1,1,1,1,0],length:5,value:"number",doc:"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven",expression:{interpolated:!0,parameters:["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"},"data-driven styling":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},transition:!0},"model-cutoff-fade-range":{type:"number",default:0,minimum:0,maximum:1,doc:"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map's height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.",transition:!1,expression:{interpolated:!1},"sdk-support":{"basic functionality":{js:"3.0.0",android:"11.0.0",ios:"11.0.0"}},"property-type":"data-constant"},"model-front-cutoff":{type:"array",private:!0,value:"number","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]},length:3,default:[0,0,1],minimum:[0,0,0],maximum:[1,1,1],doc:"An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled.","sdk-support":{"basic functionality":{js:"3.5.0",android:"11.5.0",ios:"11.5.0"}}}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}};function TY(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:[];dY(this,t),this.parent=e,this.bindings={};var n,i=wY(r);try{for(i.s();!(n=i.n()).done;){var o=uY(n.value,2),a=o[0],s=o[1];this.bindings[a]=s}}catch(t){i.e(t)}finally{i.f()}}return hY(t,[{key:"concat",value:function(e){return new t(this,e)}},{key:"get",value:function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}},{key:"has",value:function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}])}(),AY={kind:"null"},PY={kind:"number"},MY={kind:"string"},IY={kind:"boolean"},LY={kind:"color"},jY={kind:"object"},NY={kind:"value"},RY={kind:"collator"},DY={kind:"formatted"},BY={kind:"resolvedImage"};function FY(t,e){return{kind:"array",itemType:t,N:e}}function zY(t){if("array"===t.kind){var e=zY(t.itemType);return"number"==typeof t.N?"array<".concat(e,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(e,">")}return t.kind}var GY=[AY,PY,MY,IY,LY,DY,jY,FY(NY),BY];function UY(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!UY(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,n=GY;r255?255:t}function ZY(t){return t<0?0:t>1?1:t}function KY(t){return"%"===t[t.length-1]?XY(parseFloat(t)/100*255):XY(parseInt(t))}function JY(t){return"%"===t[t.length-1]?ZY(parseFloat(t)/100):ZY(parseFloat(t))}function QY(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{qY={}.parseCSSColor=function(t){var e,r=t.replace(/ /g,"").toLowerCase();if(r in YY)return YY[r].slice();if("#"===r[0])return 4===r.length?(e=parseInt(r.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===r.length&&(e=parseInt(r.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var n=r.indexOf("("),i=r.indexOf(")");if(-1!==n&&i+1===r.length){var o=r.substr(0,n),a=r.substr(n+1,i-(n+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=JY(a.pop());case"rgb":return 3!==a.length?null:[KY(a[0]),KY(a[1]),KY(a[2]),s];case"hsla":if(4!==a.length)return null;s=JY(a.pop());case"hsl":if(3!==a.length)return null;var u=(parseFloat(a[0])%360+360)%360/360,l=JY(a[1]),c=JY(a[2]),f=c<=.5?c*(l+1):c+l-c*l,h=2*c-f;return[XY(255*QY(h,f,u+1/3)),XY(255*QY(h,f,u)),XY(255*QY(h,f,u-1/3)),s];default:return null}}return null}}catch(t){}function $Y(t,e,r){return t*(1-r)+e*r}var tX=Object.freeze({__proto__:null,array:function(t,e,r){return t.map(function(t,n){return $Y(t,e[n],r)})},color:function(t,e,r){return new eX($Y(t.r,e.r,r),$Y(t.g,e.g,r),$Y(t.b,e.b,r),$Y(t.a,e.a,r))},number:$Y}),eX=function(){function t(e,r,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;dY(this,t),this.r=e,this.g=r,this.b=n,this.a=i}return hY(t,[{key:"toString",value:function(){var t=uY(0===this.a?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a],4),e=t[0],r=t[1],n=t[2],i=t[3];return"rgba(".concat(Math.round(e),",").concat(Math.round(r),",").concat(Math.round(n),",").concat(i,")")}},{key:"toRenderColor",value:function(t){var e=this.r,r=this.g,n=this.b,i=this.a;return new rX(t,e,r,n,i)}}],[{key:"parse",value:function(e){if(e){if(e instanceof t)return e;if("string"==typeof e){var r=qY(e);if(r)return new t(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3])}}}}])}(),rX=function(){return hY(function t(e,r,n,i,o){if(dY(this,t),e){var a=e.image.height,s=a*a;r=0===o?0:r/o*(a-1),n=0===o?0:n/o*(a-1),i=0===o?0:i/o*(a-1);var u=Math.floor(r),l=Math.floor(n),c=Math.floor(i),f=Math.ceil(r),h=Math.ceil(n),p=Math.ceil(i),d=r-u,y=n-l,v=i-c,g=e.image.data,m=4*(u+l*s+c*a),b=4*(u+l*s+p*a),x=4*(u+h*s+c*a),w=4*(u+h*s+p*a),_=4*(f+l*s+c*a),S=4*(f+l*s+p*a),E=4*(f+h*s+c*a),k=4*(f+h*s+p*a);if(m<0||k>=g.length)throw new Error("out of range");this.r=$Y($Y($Y(g[m],g[b],v),$Y(g[x],g[w],v),y),$Y($Y(g[_],g[S],v),$Y(g[E],g[k],v),y),d)/255*o,this.g=$Y($Y($Y(g[m+1],g[b+1],v),$Y(g[x+1],g[w+1],v),y),$Y($Y(g[_+1],g[S+1],v),$Y(g[E+1],g[k+1],v),y),d)/255*o,this.b=$Y($Y($Y(g[m+2],g[b+2],v),$Y(g[x+2],g[w+2],v),y),$Y($Y(g[_+2],g[S+2],v),$Y(g[E+2],g[k+2],v),y),d)/255*o,this.a=o}else this.r=r,this.g=n,this.b=i,this.a=o},[{key:"toArray",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*r/n,n]}},{key:"toArray01",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[t/n,e/n,r/n,n]}},{key:"toArray01Scaled",value:function(t){var e=this.r,r=this.g,n=this.b,i=this.a;return 0===i?[0,0,0]:[e/i*t,r/i*t,n/i*t]}},{key:"toArray01PremultipliedAlpha",value:function(){return[this.r,this.g,this.b,this.a]}},{key:"toArray01Linear",value:function(){var t=this.r,e=this.g,r=this.b,n=this.a;return 0===n?[0,0,0,0]:[Math.pow(t/n,2.2),Math.pow(e/n,2.2),Math.pow(r/n,2.2),n]}}])}();eX.black=new eX(0,0,0,1),eX.white=new eX(1,1,1,1),eX.transparent=new eX(0,0,0,0),eX.red=new eX(1,0,0,1),eX.blue=new eX(0,0,1,1);var nX=function(){return hY(function t(e,r,n){dY(this,t),this.sensitivity=e?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})},[{key:"compare",value:function(t,e){return this.collator.compare(t,e)}},{key:"resolvedLocale",value:function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}])}(),iX=hY(function t(e,r,n,i,o){dY(this,t),this.text=e.normalize?e.normalize():e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o}),oX=function(){function t(e){dY(this,t),this.sections=e}return hY(t,[{key:"isEmpty",value:function(){return 0===this.sections.length||!this.sections.some(function(t){return 0!==t.text.length||t.image&&0!==t.image.namePrimary.length})}},{key:"toString",value:function(){return 0===this.sections.length?"":this.sections.map(function(t){return t.text}).join("")}},{key:"serialize",value:function(){var t,e=["format"],r=wY(this.sections);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.image)e.push(["image",n.image.namePrimary]);else{e.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toRenderColor(null).toArray())),e.push(i)}}}catch(t){r.e(t)}finally{r.f()}return e}}],[{key:"fromString",value:function(e){return new t([new iX(e,null,null,null,null)])}},{key:"factory",value:function(e){return e instanceof t?e:t.fromString(e)}}])}(),aX=function(){function t(e){dY(this,t),this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}return hY(t,[{key:"toString",value:function(){return this.nameSecondary?"[".concat(this.namePrimary,",").concat(this.nameSecondary,"]"):this.namePrimary}},{key:"serialize",value:function(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}],[{key:"fromString",value:function(e,r){return e?new t({namePrimary:e,nameSecondary:r,available:!1}):null}}])}();function sX(t,e,r,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value [".concat([t,e,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function uX(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof eX)return!0;if(t instanceof nX)return!0;if(t instanceof oX)return!0;if(t instanceof aX)return!0;if(Array.isArray(t)){var e,r=wY(t);try{for(r.s();!(e=r.n()).done;){if(!uX(e.value))return!1}}catch(t){r.e(t)}finally{r.f()}return!0}if("object"===EY(t)){for(var n in t)if(!uX(t[n]))return!1;return!0}return!1}function lX(t){if(null===t)return AY;if("string"==typeof t)return MY;if("boolean"==typeof t)return IY;if("number"==typeof t)return PY;if(t instanceof eX)return LY;if(t instanceof nX)return RY;if(t instanceof oX)return DY;if(t instanceof aX)return BY;if(Array.isArray(t)){var e,r,n=t.length,i=wY(t);try{for(i.s();!(r=i.n()).done;){var o=lX(r.value);if(e){if(e===o)continue;e=NY;break}e=o}}catch(t){i.e(t)}finally{i.f()}return FY(e||NY,n)}return jY}function cX(t){var e=EY(t);return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof eX||t instanceof oX||t instanceof aX?t.toString():JSON.stringify(t)}var fX=function(){function t(e,r){dY(this,t),this.type=e,this.value=r}return hY(t,[{key:"evaluate",value:function(){return this.value}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof eX?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof oX?this.value.serialize():this.value}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("'literal' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(!uX(e[1]))return r.error("invalid value");var n=e[1],i=lX(n),o=r.expectedType;return"array"!==i.kind||0!==i.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(i=o),new t(i,n)}}])}(),hX=function(){return hY(function t(e){dY(this,t),this.name="ExpressionEvaluationError",this.message=e},[{key:"toJSON",value:function(){return this.message}}])}(),pX={string:MY,number:PY,boolean:IY,object:jY},dX=function(){function t(e,r){dY(this,t),this.type=e,this.args=r}return hY(t,[{key:"evaluate",value:function(t){for(var e=0;e1)&&e.push(n)}}return e.concat(this.args.map(function(t){return t.serialize()}))}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected at least one argument.");var n,i=1,o=e[0];if("array"===o){var a,s;if(e.length>2){var u=e[1];if("string"!=typeof u||!(u in pX)||"object"===u)return r.error('The item type argument of "array" must be one of string, number, boolean',1);a=pX[u],i++}else a=NY;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);s=e[2],i++}n=FY(a,s)}else n=pX[o];for(var l=[];i-1,e.nameSecondary&&e.available&&t.availableImages&&(e.available=t.availableImages.indexOf(e.nameSecondary)>-1)),e}},{key:"eachChild",value:function(t){t(this.inputPrimary),this.inputSecondary&&t(this.inputSecondary)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected two or more arguments.");var n=r.parse(e[1],1,MY);if(!n)return r.error("No image name provided.");if(2===e.length)return new t(n);var i=r.parse(e[2],1,MY);return i?new t(n,i):r.error("Secondary image variant is not a string.")}}])}();function gX(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":EY(t)}var mX={"to-boolean":IY,"to-color":LY,"to-number":PY,"to-string":MY},bX=function(){function t(e,r){dY(this,t),this.type=e,this.args=r}return hY(t,[{key:"evaluate",value:function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){var e,r,n,i=wY(this.args);try{for(i.s();!(n=i.n()).done;){if(r=null,(e=n.value.evaluate(t))instanceof eX)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||e.length>4?"Invalid rbga value ".concat(JSON.stringify(e),": expected an array containing either three or four numeric values."):sX(e[0],e[1],e[2],e[3])))return new eX(e[0]/255,e[1]/255,e[2]/255,e[3])}}catch(t){i.e(t)}finally{i.f()}throw new hX(r||"Could not parse color from value '".concat("string"==typeof e?e:String(JSON.stringify(e)),"'"))}if("number"===this.type.kind){var a,s=null,u=wY(this.args);try{for(u.s();!(a=u.n()).done;){if(null===(s=a.value.evaluate(t)))return 0;var l=Number(s);if(!isNaN(l))return l}}catch(t){u.e(t)}finally{u.f()}throw new hX("Could not convert ".concat(JSON.stringify(s)," to number."))}return"formatted"===this.type.kind?oX.fromString(cX(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?aX.fromString(cX(this.args[0].evaluate(t))):"array"===this.type.kind?this.args.map(function(e){return e.evaluate(t)}):cX(this.args[0].evaluate(t))}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){if("formatted"===this.type.kind)return new yX([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new vX(this.args[0]).serialize();var t="array"===this.type.kind?[]:["to-".concat(this.type.kind)];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expected at least one argument.");var n=e[0],i=[],o=AY;if("to-array"===n){if(!Array.isArray(e[1]))return null;var a=e[1].length;if(r.expectedType){if("array"!==r.expectedType.kind)return r.error("Expected ".concat(r.expectedType.kind," but found array."));o=FY(r.expectedType.itemType,a)}else{if(!(a>0&&uX(e[1][0])))return null;o=FY(lX(e[1][0]),a)}for(var s=0;s=e[2])&&(!(t[1]<=e[1])&&!(t[3]>=e[3])))}function OX(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}function AX(t,e){for(var r,n,i,o,a,s,u,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=!1,f=0,h=e.length;f0&&f<0||c<0&&f>0}function MX(t,e,r,n){var i,o,a=[e[0]-t[0],e[1]-t[1]],s=[n[0]-r[0],n[1]-r[1]];return 0!=(i=s)[0]*(o=a)[1]-i[1]*o[0]&&!(!PX(t,e,r,n)||!PX(r,n,t,e))}var IX=8192;function LX(t,e){var r,n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),o=Math.pow(2,e.z);return[Math.round(n*o*IX),Math.round(i*o*IX)]}function jX(t,e){for(var r=0;rr[2]){var i=.5*n,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;0===o&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}TX(e,t)}function GX(t,e,r,n){var i=Math.pow(2,n.z)*IX,o=[n.x*IX,n.y*IX],a=[];if(!t)return a;var s,u=wY(t);try{for(u.s();!(s=u.n()).done;){var l,c=wY(s.value);try{for(c.s();!(l=c.n()).done;){var f=l.value,h=[f.x+o[0],f.y+o[1]];zX(h,e,r,i),a.push(h)}}catch(t){c.e(t)}finally{c.f()}}}catch(t){u.e(t)}finally{u.f()}return a}function UX(t,e,r,n){var i=Math.pow(2,n.z)*IX,o=[n.x*IX,n.y*IX],a=[];if(!t)return a;var s,u,l=wY(t);try{for(l.s();!(s=l.n()).done;){var c,f=[],h=wY(s.value);try{for(h.s();!(c=h.n()).done;){var p=c.value,d=[p.x+o[0],p.y+o[1]];TX(e,d),f.push(d)}}catch(t){h.e(t)}finally{h.f()}a.push(f)}}catch(t){l.e(t)}finally{l.f()}if(e[2]-e[0]<=i/2){(u=e)[0]=u[1]=1/0,u[2]=u[3]=-1/0;var y,v=wY(a);try{for(v.s();!(y=v.n()).done;){var g,m=wY(y.value);try{for(m.s();!(g=m.n()).done;){zX(g.value,e,r,i)}}catch(t){m.e(t)}finally{m.f()}}}catch(t){v.e(t)}finally{v.f()}}return a}var VX=function(){function t(e,r){dY(this,t),this.type=IY,this.geojson=e,this.geometries=r}return hY(t,[{key:"evaluate",value:function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=BX(e.coordinates,n,i),a=GX(t.geometry(),r,n,i);if(!CX(r,n))return!1;var s,u=wY(a);try{for(u.s();!(s=u.n()).done;)if(!AX(s.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===e.type){var l=FX(e.coordinates,n,i),c=GX(t.geometry(),r,n,i);if(!CX(r,n))return!1;var f,h=wY(c);try{for(h.s();!(f=h.n()).done;)if(!jX(f.value,l))return!1}catch(t){h.e(t)}finally{h.f()}}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(!i)return!1;if("Polygon"===e.type){var o=BX(e.coordinates,n,i),a=UX(t.geometry(),r,n,i);if(!CX(r,n))return!1;var s,u=wY(a);try{for(u.s();!(s=u.n()).done;)if(!RX(s.value,o))return!1}catch(t){u.e(t)}finally{u.f()}}if("MultiPolygon"===e.type){var l=FX(e.coordinates,n,i),c=UX(t.geometry(),r,n,i);if(!CX(r,n))return!1;var f,h=wY(c);try{for(h.s();!(f=h.n()).done;)if(!DX(f.value,l))return!1}catch(t){h.e(t)}finally{h.f()}}return!0}(t,this.geometries)}return!1}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["within",this.geojson]}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("'within' expression requires exactly one argument, but found ".concat(e.length-1," instead."));if(uX(e[1])){var n=e[1];if("FeatureCollection"===n.type)for(var i=0;ie)return JX(i,o,(e-(r-a))/a)}return t[t.length-1]}},{key:"pointToSegmentDistance",value:function(t,e,r){var n=uY(e,2),i=n[0],o=n[1],a=QX(r[0]-i)*this.kx,s=(r[1]-o)*this.ky;if(0!==a||0!==s){var u=(QX(t[0]-i)*this.kx*a+(t[1]-o)*this.ky*s)/(a*a+s*s);u>1?(i=r[0],o=r[1]):u>0&&(i+=a/this.kx*u,o+=s/this.ky*u)}return a=QX(t[0]-i)*this.kx,s=(t[1]-o)*this.ky,Math.sqrt(a*a+s*s)}},{key:"pointOnLine",value:function(t,e){for(var r=1/0,n=t[0][0],i=t[0][1],o=0,a=0,s=0;s1?(u=t[s+1][0],l=t[s+1][1]):h>0&&(u+=c/this.kx*h,l+=f/this.ky*h));var p=(c=QX(e[0]-u)*this.kx)*c+(f=(e[1]-l)*this.ky)*f;pi.index||n.index===i.index&&n.t>i.t){var o=n;n=i,i=o}var a=[n.point],s=n.index+1,u=i.index;!KX(r[s],a[0])&&s<=u&&a.push(r[s]);for(var l=s+1;l<=u;l++)a.push(r[l]);return KX(r[u],i.point)||a.push(i.point),a}},{key:"lineSliceAlong",value:function(t,e,r){for(var n=0,i=[],o=0;ot&&0===i.length&&i.push(JX(a,s,(t-(n-u))/u)),n>=e)return i.push(JX(a,s,(e-(n-u))/u)),i;n>t&&i.push(s)}return i}},{key:"bufferPoint",value:function(t,e){var r=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-r,t[0]+n,t[1]+r]}},{key:"bufferBBox",value:function(t,e){var r=e/this.ky,n=e/this.kx;return[t[0]-n,t[1]-r,t[2]+n,t[3]+r]}},{key:"insideBBox",value:function(t,e){return QX(t[0]-e[0])>=0&&QX(t[0]-e[2])<=0&&t[1]>=e[1]&&t[1]<=e[3]}}],[{key:"fromTile",value:function(e,r,n){var i=Math.PI*(1-2*(e+.5)/Math.pow(2,r));return new t(Math.atan(.5*(Math.exp(i)-Math.exp(-i)))/XX,n)}},{key:"units",get:function(){return HX}}])}();function KX(t,e){return t[0]===e[0]&&t[1]===e[1]}function JX(t,e,r){var n=QX(e[0]-t[0]),i=e[1]-t[1];return[t[0]+n*r,t[1]+i*r]}function QX(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}function $X(t,e){this.x=t,this.y=e}$X.prototype={clone:function(){return new $X(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_rotateAround:function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},$X.convert=function(t){return t instanceof $X?t:Array.isArray(t)?new $X(t[0],t[1]):t};var tZ=function(){return hY(function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(t,e){return te?1:0};if(dY(this,t),this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)},[{key:"push",value:function(t){this.data.push(t),this._up(this.length++)}},{key:"pop",value:function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}}},{key:"peek",value:function(){return this.data[0]}},{key:"_up",value:function(t){for(var e=this.data,r=this.compare,n=e[t];t>0;){var i=t-1>>1,o=e[i];if(r(n,o)>=0)break;e[t]=o,t=i}e[t]=n}},{key:"_down",value:function(t){for(var e=this.data,r=this.compare,n=this.length>>1,i=e[t];t=0)break;e[t]=e[o],t=o}e[t]=i}}])}(),eZ=8192;function rZ(t,e){return e.dist-t.dist}var nZ=100,iZ=50;function oZ(t){var e=[1/0,1/0,-1/0,-1/0];if(e.length!==t.length)return!1;for(var r=0;r=t[0]&&t[1]t[1])return[null,null];var r=aZ(t);if(e){if(2===r)return[t,null];var n=Math.floor(r/2);return[[t[0],t[0]+n],[t[0]+n,t[1]]]}if(1===r)return[t,null];var i=Math.floor(r/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function lZ(t,e){var r=[1/0,1/0,-1/0,-1/0];if(!sZ(e,t.length))return r;for(var n=e[0];n<=e[1];++n)TX(r,t[n]);return r}function cZ(t){for(var e=[1/0,1/0,-1/0,-1/0],r=0;re[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]3&&void 0!==arguments[3]?arguments[3]:1/0,i=cZ(t),o=cZ(e);if(n!==1/0&&fZ(i,o,r)>=n)return n;if(CX(i,o)){if(wZ(t,e))return 0}else if(wZ(e,t))return 0;var a,s=n,u=wY(t);try{for(u.s();!(a=u.n()).done;)for(var l=a.value,c=0,f=l.length,h=f-1;c4&&void 0!==arguments[4]?arguments[4]:1/0,o=Math.min(n.distance(t[0],r[0][0]),i);if(0===o)return o;for(var a={dist:0,range1:[0,t.length-1],range2:[0,0]},s=new tZ([a],rZ),u=e?iZ:nZ,l=cZ(r);s.length;){var c=s.pop();if(!(c.dist>=o)){var f=c.range1;if(aZ(f)<=u){if(!sZ(f,t.length))return NaN;if(e){var h=xZ(t,f,r,n);if(0===(o=Math.min(o,h)))return o}else for(var p=f[0];p<=f[1];++p){var d=bZ(t[p],r,n);if(0===(o=Math.min(o,d)))return o}}else{var y=uZ(f,e);if(null!==y[0]){var v=fZ(lZ(t,y[0]),l,n);v5&&void 0!==arguments[5]?arguments[5]:1/0,a=Math.min(o,i.distance(t[0],r[0]));if(0===a)return a;for(var s={dist:0,range1:[0,t.length-1],range2:[0,r.length-1]},u=new tZ([s],rZ),l=e?iZ:nZ,c=n?iZ:nZ;u.length;){var f=u.pop();if(!(f.dist>=a)){var h=f.range1,p=f.range2;if(aZ(h)<=l&&aZ(p)<=c){if(!sZ(h,t.length)||!sZ(p,r.length))return NaN;if(e&&n?a=Math.min(a,gZ(t,h,r,p,i)):e||n?e&&!n?a=Math.min(a,yZ(r,p,t,h,i)):!e&&n&&(a=Math.min(a,yZ(t,h,r,p,i))):a=Math.min(a,mZ(t,h,r,p,i)),0===a)return a}else{var d=uZ(h,e),y=uZ(p,n);SZ(u,a,i,t,r,d[0],y[0]),SZ(u,a,i,t,r,d[0],y[1]),SZ(u,a,i,t,r,d[1],y[0]),SZ(u,a,i,t,r,d[1],y[1])}}}return a}function TZ(t,e,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=lZ(t,[0,t.length-1]),s=wY(r);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(!(o!==1/0&&fZ(a,lZ(u,[0,u.length-1]),n)>=o)&&0===(o=Math.min(o,kZ(t,e,u,!0,n,o))))return o}}catch(t){s.e(t)}finally{s.f()}return o}function CZ(t,e,r,n){var i,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=lZ(t,[0,t.length-1]),s=wY(r);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(!(o!==1/0&&fZ(a,cZ(u),n)>=o)){var l=EZ(t,e,u,n,o);if(isNaN(l))return l;if(0===(o=Math.min(o,l)))return o}}}catch(t){s.e(t)}finally{s.f()}return o}function OZ(t,e,r){var n,i=[],o=wY(function(t,e){var r=t.length;if(r<=1)return[t];for(var n,i,o=[],a=0;ar&&(t=r),t}var LZ=function(){function t(e,r,n){dY(this,t),this.type=e,this.key=r,this.scope=n}return hY(t,[{key:"evaluate",value:function(t){var e=[this.key,this.scope,t.scope].filter(Boolean).join(""),r=t.getConfig(e);if(!r)return null;var n=r.type,i=r.value,o=r.values,a=r.minValue,s=r.maxValue,u=r.stepValue,l=r.default.evaluate(t),c=l;if(i){var f=t.scope;t.scope=(f||"").split("").slice(1).join(""),c=i.evaluate(t),t.scope=f}return n&&(c=MZ(n,c)),void 0===c||void 0===a&&void 0===s&&void 0===u||("number"==typeof c?c=IZ(c,a,s,u):Array.isArray(c)&&(c=c.map(function(t){return"number"==typeof t?IZ(t,a,s,u):t}))),void 0!==i&&void 0!==c&&o&&!o.includes(c)&&(c=l,n&&(c=MZ(n,c))),(n&&n!==this.type||void 0!==c&&lX(c)!==this.type)&&(c=MZ(this.type.kind,c)),c}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["config",this.key];return this.scope&&t.concat(this.key),t}}],[{key:"parse",value:function(e,r){var n=r.expectedType;if(null!==n&&void 0!==n||(n=NY),e.length<2||e.length>3)return r.error("Invalid number of arguments for 'config' expression.");var i=r.parse(e[1],1);if(!(i instanceof fX))return r.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){var o=r.parse(e[2],2);return o instanceof fX?new t(n,cX(i.value),cX(o.value)):r.error("Scope of 'config' expression must be a string literal.")}return new t(n,cX(i.value))}}])}();function jZ(t){if(t instanceof _X){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof VX)return!1;if(t instanceof PZ)return!1;var e=!0;return t.eachChild(function(t){e&&!jZ(t)&&(e=!1)}),e}function NZ(t){if(t instanceof _X&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild(function(t){e&&!NZ(t)&&(e=!1)}),e}function RZ(t){if(t instanceof LZ)return!1;var e=!0;return t.eachChild(function(t){e&&!RZ(t)&&(e=!1)}),e}function DZ(t,e){if(t instanceof _X&&e.indexOf(t.name)>=0)return!1;var r=!0;return t.eachChild(function(t){r&&!DZ(t,e)&&(r=!1)}),r}var BZ=function(){function t(e,r){dY(this,t),this.type=r.type,this.name=e,this.boundExpression=r}return hY(t,[{key:"evaluate",value:function(t){return this.boundExpression.evaluate(t)}},{key:"eachChild",value:function(){}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["var",this.name]}}],[{key:"parse",value:function(e,r){if(2!==e.length||"string"!=typeof e[1])return r.error("'var' expression requires exactly one string literal argument.");var n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error('Unknown variable "'.concat(n,'". Make sure "').concat(n,'" has been bound in an enclosing "let" expression before using it.'),1)}}])}(),FZ=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new OY,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6?arguments[6]:void 0;dY(this,t),this.registry=e,this.path=r,this.key=r.map(function(t){return"[".concat(t,"]")}).join(""),this.scope=i,this.errors=o,this.expectedType=n,this._scope=a,this.options=s}return hY(t,[{key:"parse",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return e||r?this.concat(e,r,n)._parse(t,i):this._parse(t,i)}},{key:"_parse",value:function(t,e){function r(t,e,r){return"assert"===r?new dX(e,[t]):"coerce"===r?new bX(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n="string"==typeof t[0]?this.registry[t[0]]:void 0;if(n){var i=n.parse(t,this);if(!i)return null;if(this.expectedType){var o=this.expectedType,a=i.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==a.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(o,a))return null}else i=r(i,o,e.typeAnnotation||"coerce");else i=r(i,o,e.typeAnnotation||"assert")}if(!(i instanceof fX)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof BZ)return t(e.boundExpression);if(e instanceof _X&&"error"===e.name)return!1;if(e instanceof EX)return!1;if(e instanceof VX)return!1;if(e instanceof PZ)return!1;if(e instanceof LZ)return!1;var r=e instanceof bX||e instanceof dX;var n=!0;e.eachChild(function(e){n=r?n&&t(e):n&&e instanceof fX});if(!n)return!1;return jZ(e)&&DZ(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}(i)){var s=new wX(this._scope,this.options);try{i=new fX(i.type,i.evaluate(s))}catch(t){return this.error(t.message),null}}return i}return bX.parse(["to-array",t],this)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"===EY(t)?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(EY(t)," instead."))}},{key:"concat",value:function(e,r,n){var i="number"==typeof e?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,i,r||null,o,this.errors,this._scope,this.options)}},{key:"error",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;ne))throw new hX("Input is not a number.");a=s-1}return 0}var GZ=function(){function t(e,r,n){dY(this,t),this.type=e,this.input=r,this.labels=[],this.outputs=[];var i,o=wY(n);try{for(o.s();!(i=o.n()).done;){var a=uY(i.value,2),s=a[0],u=a[1];this.labels.push(s),this.outputs.push(u)}}catch(t){o.e(t)}finally{o.f()}}return hY(t,[{key:"evaluate",value:function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return r[0].evaluate(t);var i=e.length;return n>=e[i-1]?r[i-1].evaluate(t):r[zZ(e,n)].evaluate(t)}},{key:"eachChild",value:function(t){t(this.input);var e,r=wY(this.outputs);try{for(r.s();!(e=r.n()).done;){t(e.value)}}catch(t){r.e(t)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){for(var t=["step",this.input.serialize()],e=0;e0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}],[{key:"parse",value:function(e,r){if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");var n=r.parse(e[1],1,PY);if(!n)return null;var i=[],o=null;r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);for(var a=1;a=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var f=r.parse(u,c,o);if(!f)return null;o=o||f.type,i.push([s,f])}return new t(o,n,i)}}])}(),UZ=VZ;function VZ(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}VZ.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)i?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var HZ=WY(UZ),WZ=.95047,qZ=1,YZ=1.08883,XZ=4/29,ZZ=6/29,KZ=3*ZZ*ZZ,JZ=ZZ*ZZ*ZZ,QZ=Math.PI/180,$Z=180/Math.PI;function tK(t){return t>JZ?Math.pow(t,1/3):t/KZ+XZ}function eK(t){return t>ZZ?t*t*t:KZ*(t-XZ)}function rK(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function nK(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function iK(t){var e=nK(t.r),r=nK(t.g),n=nK(t.b),i=tK((.4124564*e+.3575761*r+.1804375*n)/WZ),o=tK((.2126729*e+.7151522*r+.072175*n)/qZ);return{l:116*o-16,a:500*(i-o),b:200*(o-tK((.0193339*e+.119192*r+.9503041*n)/YZ)),alpha:t.a}}function oK(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=qZ*eK(e),r=WZ*eK(r),n=YZ*eK(n),new eX(rK(3.2404542*r-1.5371385*e-.4985314*n),rK(-.969266*r+1.8760108*e+.041556*n),rK(.0556434*r-.2040259*e+1.0572252*n),t.alpha)}var aK={forward:iK,reverse:oK,interpolate:function(t,e,r){return{l:$Y(t.l,e.l,r),a:$Y(t.a,e.a,r),b:$Y(t.b,e.b,r),alpha:$Y(t.alpha,e.alpha,r)}}},sK={forward:function(t){var e=iK(t),r=e.l,n=e.a,i=e.b,o=Math.atan2(i,n)*$Z;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:t.a}},reverse:function(t){var e=t.h*QZ,r=t.c;return oK({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:function(t,e,r){var n=e-t;return t+r*(n>180||n<-180?n-360*Math.round(n/360):n)}(t.h,e.h,r),c:$Y(t.c,e.c,r),l:$Y(t.l,e.l,r),alpha:$Y(t.alpha,e.alpha,r)}}},uK=Object.freeze({__proto__:null,hcl:sK,lab:aK}),lK=function(){function t(e,r,n,i,o){dY(this,t),this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];var a,s=wY(o);try{for(s.s();!(a=s.n()).done;){var u=uY(a.value,2),l=u[0],c=u[1];this.labels.push(l),this.outputs.push(c)}}catch(t){s.e(t)}finally{s.f()}}return hY(t,[{key:"evaluate",value:function(e){var r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(e);var i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);var o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);var a=zZ(r,i),s=r[a],u=r[a+1],l=t.interpolationFactor(this.interpolation,i,s,u),c=n[a].evaluate(e),f=n[a+1].evaluate(e);return"interpolate"===this.operator?tX[this.type.kind.toLowerCase()](c,f,l):"interpolate-hcl"===this.operator?sK.reverse(sK.interpolate(sK.forward(c),sK.forward(f),l)):aK.reverse(aK.interpolate(aK.forward(c),aK.forward(f),l))}},{key:"eachChild",value:function(t){t(this.input);var e,r=wY(this.outputs);try{for(r.s();!(e=r.n()).done;){t(e.value)}}catch(t){r.e(t)}finally{r.f()}}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],r=0;r1}))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:c}}if(e.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(e.length-1,"."));if((e.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(s=r.parse(s,2,PY)))return null;var f=[],h=null;"interpolate-hcl"===o||"interpolate-lab"===o?h=LY:r.expectedType&&"value"!==r.expectedType.kind&&(h=r.expectedType);for(var p=0;p=d)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',v);var m=r.parse(y,g,h);if(!m)return null;h=h||m.type,f.push([d,m])}return"number"===h.kind||"color"===h.kind||"array"===h.kind&&"number"===h.itemType.kind&&"number"==typeof h.N?new t(h,o,a,s,f):r.error("Type ".concat(zY(h)," is not interpolatable."))}}])}();function cK(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}var fK=function(){function t(e,r){dY(this,t),this.type=e,this.args=r}return hY(t,[{key:"evaluate",value:function(t){var e,r,n=null,i=0,o=wY(this.args);try{for(o.s();!(r=o.n()).done;){if(i++,(n=r.value.evaluate(t))&&n instanceof aX&&!n.available&&(e||(e=n),n=null,i===this.args.length))return e;if(null!==n)break}}catch(t){o.e(t)}finally{o.f()}return n}},{key:"eachChild",value:function(t){this.args.forEach(t)}},{key:"outputDefined",value:function(){return this.args.every(function(t){return t.outputDefined()})}},{key:"serialize",value:function(){var t=["coalesce"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<2)return r.error("Expectected at least one argument.");var n=null,i=r.expectedType;i&&"value"!==i.kind&&(n=i);var o,a=[],s=wY(e.slice(1));try{for(s.s();!(o=s.n()).done;){var u=o.value,l=r.parse(u,1+a.length,n,void 0,{typeAnnotation:"omit"});if(!l)return null;n=n||l.type,a.push(l)}}catch(t){s.e(t)}finally{s.f()}return new t(i&&a.some(function(t){return UY(i,t.type)})?NY:n,a)}}])}(),hK=function(){function t(e,r){dY(this,t),this.type=r.type,this.bindings=[].concat(e),this.result=r}return hY(t,[{key:"evaluate",value:function(t){return this.result.evaluate(t)}},{key:"eachChild",value:function(t){var e,r=wY(this.bindings);try{for(r.s();!(e=r.n()).done;){t(e.value[1])}}catch(t){r.e(t)}finally{r.f()}t(this.result)}},{key:"outputDefined",value:function(){return this.result.outputDefined()}},{key:"serialize",value:function(){var t,e=["let"],r=wY(this.bindings);try{for(r.s();!(t=r.n()).done;){var n=uY(t.value,2),i=n[0],o=n[1];e.push(i,o.serialize())}}catch(t){r.e(t)}finally{r.f()}return e.push(this.result.serialize()),e}}],[{key:"parse",value:function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found ".concat(e.length-1," instead."));for(var n=[],i=1;i=r.length)throw new hX("Array index out of bounds: ".concat(e," > ").concat(r.length-1,"."));if(e!==Math.floor(e))throw new hX("Array index must be an integer, but found ".concat(e," instead."));return r[e]}},{key:"eachChild",value:function(t){t(this.index),t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){return["at",this.index.serialize(),this.input.serialize()]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,PY),i=r.parse(e[2],2,FY(r.expectedType||NY));return n&&i?new t(i.type.itemType,n,i):null}}])}(),dK=function(){function t(e,r){dY(this,t),this.type=IY,this.needle=e,this.haystack=r}return hY(t,[{key:"evaluate",value:function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(null==r)return!1;if(!HY(e,["boolean","string","number","null"]))throw new hX("Expected first argument to be of type boolean, string, number or null, but found ".concat(zY(lX(e))," instead."));if(!HY(r,["string","array"]))throw new hX("Expected second argument to be of type array or string, but found ".concat(zY(lX(r))," instead."));return r.indexOf(e)>=0}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){return["in",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected 2 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,NY),i=r.parse(e[2],2,NY);return n&&i?VY(n.type,[IY,MY,PY,AY,NY])?new t(n,i):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(zY(n.type)," instead")):null}}])}(),yK=function(){function t(e,r,n){dY(this,t),this.type=PY,this.needle=e,this.haystack=r,this.fromIndex=n}return hY(t,[{key:"evaluate",value:function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!HY(e,["boolean","string","number","null"]))throw new hX("Expected first argument to be of type boolean, string, number or null, but found ".concat(zY(lX(e))," instead."));if(!HY(r,["string","array"]))throw new hX("Expected second argument to be of type array or string, but found ".concat(zY(lX(r))," instead."));if(this.fromIndex){var n=this.fromIndex.evaluate(t);return r.indexOf(e,n)}return r.indexOf(e)}},{key:"eachChild",value:function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}],[{key:"parse",value:function(e,r){if(e.length<=2||e.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,NY),i=r.parse(e[2],2,NY);if(!n||!i)return null;if(!VY(n.type,[IY,MY,PY,AY,NY]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(zY(n.type)," instead"));if(4===e.length){var o=r.parse(e[3],3,PY);return o?new t(n,i,o):null}return new t(n,i)}}])}(),vK=function(){function t(e,r,n,i,o,a){dY(this,t),this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}return hY(t,[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);return(lX(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}},{key:"eachChild",value:function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}},{key:"outputDefined",value:function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t,e=this,r=["match",this.input.serialize()],n=[],i={},o=wY(Object.keys(this.cases).sort());try{for(o.s();!(t=o.n()).done;){var a=t.value,s=i[this.cases[a]];void 0===s?(i[this.cases[a]]=n.length,n.push([this.cases[a],[a]])):n[s][1].push(a)}}catch(t){o.e(t)}finally{o.f()}for(var u=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,c=n;lNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,lX(p)))return null}else n=lX(p);if(void 0!==o[String(p)])return c.error("Branch labels must be unique.");o[String(p)]=a.length}}catch(t){h.e(t)}finally{h.f()}var d=r.parse(l,s,i);if(!d)return null;i=i||d.type,a.push(d)}var y=r.parse(e[1],1,NY);if(!y)return null;var v=r.parse(e[e.length-1],e.length-1,i);return v?"value"!==y.type.kind&&r.concat(1).checkSubtype(n,y.type)?null:new t(n,i,y,o,a,v):null}}])}(),gK=function(){function t(e,r,n){dY(this,t),this.type=e,this.branches=r,this.otherwise=n}return hY(t,[{key:"evaluate",value:function(t){var e,r=wY(this.branches);try{for(r.s();!(e=r.n()).done;){var n=uY(e.value,2),i=n[0],o=n[1];if(i.evaluate(t))return o.evaluate(t)}}catch(t){r.e(t)}finally{r.f()}return this.otherwise.evaluate(t)}},{key:"eachChild",value:function(t){var e,r=wY(this.branches);try{for(r.s();!(e=r.n()).done;){var n=uY(e.value,2),i=n[0],o=n[1];t(i),t(o)}}catch(t){r.e(t)}finally{r.f()}t(this.otherwise)}},{key:"outputDefined",value:function(){return this.branches.every(function(t){var e=uY(t,2);e[0];return e[1].outputDefined()})&&this.otherwise.outputDefined()}},{key:"serialize",value:function(){var t=["case"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(e.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(e.length-1,"."));if(e.length%2!=0)return r.error("Expected an odd number of arguments.");var n;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);for(var i=[],o=1;o=5)return r.error("Expected 3 or 4 arguments, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1,NY),i=r.parse(e[2],2,PY);if(!n||!i)return null;if(!VY(n.type,[FY(NY),MY,NY]))return r.error("Expected first argument to be of type array or string, but found ".concat(zY(n.type)," instead"));if(4===e.length){var o=r.parse(e[3],3,PY);return o?new t(n.type,n,i,o):null}return new t(n.type,n,i)}}])}();function bK(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function xK(t,e,r,n){return 0===n.compare(e,r)}function wK(t,e,r){var n="=="!==t&&"!="!==t;return function(){function i(t,e,r){dY(this,i),this.type=IY,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return hY(i,[{key:"evaluate",value:function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=lX(o),u=lX(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new hX('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(s.kind,", ").concat(u.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){var l=lX(o),c=lX(a);if("string"!==l.kind||"string"!==c.kind)return e(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):e(i,o,a)}},{key:"eachChild",value:function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}},{key:"outputDefined",value:function(){return!0}},{key:"serialize",value:function(){var e=[t];return this.eachChild(function(t){e.push(t.serialize())}),e}}],[{key:"parse",value:function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,NY);if(!o)return null;if(!bK(r,o.type))return e.concat(1).error('"'.concat(r,"\" comparisons are not supported for type '").concat(zY(o.type),"'."));var a=e.parse(t[2],2,NY);if(!a)return null;if(!bK(r,a.type))return e.concat(2).error('"'.concat(r,"\" comparisons are not supported for type '").concat(zY(a.type),"'."));if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '".concat(zY(o.type),"' and '").concat(zY(a.type),"'."));n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new dX(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new dX(o.type,[a])));var s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(s=e.parse(t[3],3,RY)))return null}return new i(o,a,s)}}])}()}var _K=wK("==",function(t,e,r){return e===r},xK),SK=wK("!=",function(t,e,r){return e!==r},function(t,e,r,n){return!xK(0,e,r,n)}),EK=wK("<",function(t,e,r){return e",function(t,e,r){return e>r},function(t,e,r,n){return n.compare(e,r)>0}),TK=wK("<=",function(t,e,r){return e<=r},function(t,e,r,n){return n.compare(e,r)<=0}),CK=wK(">=",function(t,e,r){return e>=r},function(t,e,r,n){return n.compare(e,r)>=0}),OK=function(){function t(e,r,n,i,o,a){dY(this,t),this.type=MY,this.number=e,this.locale=r,this.currency=n,this.unit=i,this.minFractionDigits=o,this.maxFractionDigits=a}return hY(t,[{key:"evaluate",value:function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}},{key:"eachChild",value:function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.unit&&(t.unit=this.unit.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}],[{key:"parse",value:function(e,r){if(3!==e.length)return r.error("Expected two arguments.");var n=r.parse(e[1],1,PY);if(!n)return null;var i=e[2];if("object"!==EY(i)||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");var o=null;if(i.locale&&!(o=r.parse(i.locale,1,MY)))return null;var a=null;if(i.currency&&!(a=r.parse(i.currency,1,MY)))return null;var s=null;if(i.unit&&!(s=r.parse(i.unit,1,MY)))return null;var u=null;if(i["min-fraction-digits"]&&!(u=r.parse(i["min-fraction-digits"],1,PY)))return null;var l=null;return i["max-fraction-digits"]&&!(l=r.parse(i["max-fraction-digits"],1,PY))?null:new t(n,o,a,s,u,l)}}])}();var AK={"==":_K,"!=":SK,">":kK,"<":EK,">=":CK,"<=":TK,array:dX,at:pK,boolean:dX,case:gK,coalesce:fK,collator:EX,format:yX,image:vX,in:dK,"index-of":yK,interpolate:lK,"interpolate-hcl":lK,"interpolate-lab":lK,length:function(){function t(e){dY(this,t),this.type=PY,this.input=e}return hY(t,[{key:"evaluate",value:function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new hX("Expected value to be of type string or array, but found ".concat(zY(lX(e))," instead."))}},{key:"eachChild",value:function(t){t(this.input)}},{key:"outputDefined",value:function(){return!1}},{key:"serialize",value:function(){var t=["length"];return this.eachChild(function(e){t.push(e.serialize())}),t}}],[{key:"parse",value:function(e,r){if(2!==e.length)return r.error("Expected 1 argument, but found ".concat(e.length-1," instead."));var n=r.parse(e[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?r.error("Expected argument of type string or array, but found ".concat(zY(n.type)," instead.")):new t(n):null}}])}(),let:hK,literal:fX,match:vK,number:dX,"number-format":OK,object:dX,slice:mK,step:GZ,string:dX,"to-boolean":bX,"to-color":bX,"to-number":bX,"to-string":bX,var:BZ,within:VX,distance:PZ,config:LZ};function PK(t,e){var r=uY(e,4),n=r[0],i=r[1],o=r[2],a=r[3];n=n.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var s=a?a.evaluate(t):1,u=sX(n,i,o,s);if(u)throw new hX(u);return new eX(n/255*s,i/255*s,o/255*s,s)}function MK(t,e){var r=uY(e,4),n=r[0],i=r[1],o=r[2],a=r[3];n=n.evaluate(t),i=i.evaluate(t),o=o.evaluate(t);var s=a?a.evaluate(t):1,u=function(t,e,r,n){return"number"==typeof t&&t>=0&&t<=360?"number"==typeof e&&e>=0&&e<=100&&"number"==typeof r&&r>=0&&r<=100?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid hsla value [".concat([t,e,r,n].join(", "),"]: 'a' must be between 0 and 1."):"Invalid hsla value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 's', and 'l' must be between 0 and 100."):"Invalid hsla value [".concat(("number"==typeof n?[t,e,r,n]:[t,e,r]).join(", "),"]: 'h' must be between 0 and 360.")}(n,i,o,s);if(u)throw new hX(u);var l="hsla(".concat(n,", ").concat(i,"%, ").concat(o,"%, ").concat(s,")"),c=eX.parse(l);if(!c)throw new hX("Failed to parse HSLA color: ".concat(l));return c}function IK(t,e){return t in e}function LK(t,e){var r=e[t];return void 0===r?null:r}function jK(t){return{type:t}}function NK(t){return{result:"success",value:t}}function RK(t){return{result:"error",value:t}}function DK(t,e){return!!t&&!!t.parameters&&t.parameters.indexOf(e)>-1}function BK(t){return"data-driven"===t["property-type"]}function FK(t){return DK(t.expression,"measure-light")}function zK(t){return DK(t.expression,"zoom")}function GK(t){return!!t.expression&&t.expression.interpolated}function UK(t){return"object"===EY(t)&&null!==t&&!Array.isArray(t)}function VK(t){return t}function HK(t,e){var r,n,i,o="color"===e.type,a=t.stops&&"object"===EY(t.stops[0][0]),s=a||void 0!==t.property,u=a||!s,l=t.type||(GK(e)?"exponential":"interval");if(o&&((t=TY({},t)).stops&&(t.stops=t.stops.map(function(t){return[t[0],eX.parse(t[1])]})),t.default?t.default=eX.parse(t.default):t.default=eX.parse(e.default)),t.colorSpace&&"rgb"!==t.colorSpace&&!uK[t.colorSpace])throw new Error("Unknown color space: ".concat(t.colorSpace));if("exponential"===l)r=XK;else if("interval"===l)r=YK;else if("categorical"===l){r=qK,n=Object.create(null);var c,f=wY(t.stops);try{for(f.s();!(c=f.n()).done;){var h=c.value;n[h[0]]=h[1]}}catch(t){f.e(t)}finally{f.f()}i=EY(t.stops[0][0])}else{if("identity"!==l)throw new Error('Unknown function type "'.concat(l,'"'));r=ZK}if(a){for(var p={},d=[],y=0;y=t.stops[n-1][0])return t.stops[n-1][1];var i=zZ(t.stops.map(function(t){return t[0]}),r);return t.stops[i][1]}function XK(t,e,r){var n=void 0!==t.base?t.base:1;if("number"!==gX(r))return WK(t.default,e.default);var i=t.stops.length;if(1===i)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];var o=zZ(t.stops.map(function(t){return t[0]}),r),a=function(t,e,r,n){var i=n-r,o=t-r;return 0===i?0:1===e?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],l=tX[e.type]||VK;if(t.colorSpace&&"rgb"!==t.colorSpace){var c=uK[t.colorSpace];l=function(t,e){return c.reverse(c.interpolate(c.forward(t),c.forward(e),a))}}return"function"==typeof s.evaluate?{evaluate:function(){for(var t=arguments.length,e=new Array(t),r=0;r":[IY,[MY,NY],function(t,e){var r=uY(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return EY(o)===EY(a)&&o>a}],"filter-id->":[IY,[NY],function(t,e){var r=uY(e,1)[0],n=t.id(),i=r.value;return EY(n)===EY(i)&&n>i}],"filter-<=":[IY,[MY,NY],function(t,e){var r=uY(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return EY(o)===EY(a)&&o<=a}],"filter-id-<=":[IY,[NY],function(t,e){var r=uY(e,1)[0],n=t.id(),i=r.value;return EY(n)===EY(i)&&n<=i}],"filter->=":[IY,[MY,NY],function(t,e){var r=uY(e,2),n=r[0],i=r[1],o=t.properties()[n.value],a=i.value;return EY(o)===EY(a)&&o>=a}],"filter-id->=":[IY,[NY],function(t,e){var r=uY(e,1)[0],n=t.id(),i=r.value;return EY(n)===EY(i)&&n>=i}],"filter-has":[IY,[NY],function(t,e){return uY(e,1)[0].value in t.properties()}],"filter-has-id":[IY,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[IY,[FY(MY)],function(t,e){return uY(e,1)[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[IY,[FY(NY)],function(t,e){return uY(e,1)[0].value.indexOf(t.id())>=0}],"filter-in-small":[IY,[MY,FY(NY)],function(t,e){var r=uY(e,2),n=r[0];return r[1].value.indexOf(t.properties()[n.value])>=0}],"filter-in-large":[IY,[MY,FY(NY)],function(t,e){var r=uY(e,2),n=r[0],i=r[1];return function(t,e,r,n){for(;r<=n;){var i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}(t.properties()[n.value],i.value,0,i.value.length-1)}],all:{type:IY,overloads:[[[IY,IY],function(t,e){var r=uY(e,2),n=r[0],i=r[1];return n.evaluate(t)&&i.evaluate(t)}],[jK(IY),function(t,e){var r,n=wY(e);try{for(n.s();!(r=n.n()).done;){if(!r.value.evaluate(t))return!1}}catch(t){n.e(t)}finally{n.f()}return!0}]]},any:{type:IY,overloads:[[[IY,IY],function(t,e){var r=uY(e,2),n=r[0],i=r[1];return n.evaluate(t)||i.evaluate(t)}],[jK(IY),function(t,e){var r,n=wY(e);try{for(n.s();!(r=n.n()).done;){if(r.value.evaluate(t))return!0}}catch(t){n.e(t)}finally{n.f()}return!1}]]},"!":[IY,[IY],function(t,e){return!uY(e,1)[0].evaluate(t)}],"is-supported-script":[IY,[MY],function(t,e){var r=uY(e,1)[0],n=t.globals&&t.globals.isSupportedScript;return!n||n(r.evaluate(t))}],upcase:[MY,[MY],function(t,e){return uY(e,1)[0].evaluate(t).toUpperCase()}],downcase:[MY,[MY],function(t,e){return uY(e,1)[0].evaluate(t).toLowerCase()}],concat:[MY,jK(NY),function(t,e){return e.map(function(e){return cX(e.evaluate(t))}).join("")}],"resolved-locale":[MY,[RY],function(t,e){return uY(e,1)[0].evaluate(t).resolvedLocale()}],random:[PY,[PY,PY,NY],function(t,e){var r,n,i=uY(e.map(function(e){return e.evaluate(t)}),3),o=i[0],a=i[1],s=i[2];if(o>a)return o;if(o===a)return o;if("string"==typeof s)r=function(t){var e=0;if(0===t.length)return e;for(var r=0;r>>15,1|n);return(((t=t+Math.imul(t^t>>>7,61|t)^t)^t>>>14)>>>0)/4294967296})()*(a-o)}]});var KK=function(){return hY(function t(e,r,n,i){var o;dY(this,t),this.expression=e,this._warningHistory={},this._evaluator=new wX(n,i),this._defaultValue=r?"color"===(o=r).type&&(UK(o.default)||Array.isArray(o.default))?new eX(0,0,0,0):"color"===o.type?eX.parse(o.default)||null:void 0===o.default?null:o.default:null,this._enumValues=r&&"enum"===r.type?r.values:null},[{key:"evaluateWithoutErrorHandling",value:function(t,e,r,n,i,o,a,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}},{key:"evaluate",value:function(t,e,r,n,i,o,a,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n||null,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{var u=this.expression.evaluate(this._evaluator);if(null===u||void 0===u||"number"==typeof u&&u!=u)return this._defaultValue;if(this._enumValues&&!(u in this._enumValues))throw new hX("Expected value to be one of ".concat(Object.keys(this._enumValues).map(function(t){return JSON.stringify(t)}).join(", "),", but found ").concat(JSON.stringify(u)," instead."));return u}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}])}();function JK(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in AK}function QK(t,e,r,n){var i=new FZ(AK,[],e?function(t){var e={color:LY,string:MY,number:PY,enum:MY,boolean:IY,formatted:DY,resolvedImage:BY};if("array"===t.type)return FY(e[t.value]||NY,t.length);return e[t.type]}(e):void 0,void 0,void 0,r,n),o=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return o?NK(new KK(o,e,r,n)):RK(i.errors)}var $K=function(){return hY(function t(e,r,n){dY(this,t),this.kind=e,this._styleExpression=r,this.isLightConstant=n,this.isStateDependent="constant"!==e&&!NZ(r.expression),this.isConfigDependent=!RZ(r.expression)},[{key:"evaluateWithoutErrorHandling",value:function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)}},{key:"evaluate",value:function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)}}])}(),tJ=function(){return hY(function t(e,r,n,i,o){dY(this,t),this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent="camera"!==e&&!NZ(r.expression),this.isLightConstant=o,this.isConfigDependent=!RZ(r.expression),this.interpolationType=i},[{key:"evaluateWithoutErrorHandling",value:function(t,e,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,n,i,o)}},{key:"evaluate",value:function(t,e,r,n,i,o){return this._styleExpression.evaluate(t,e,r,n,i,o)}},{key:"interpolationFactor",value:function(t,e,r){return this.interpolationType?lK.interpolationFactor(this.interpolationType,t,e,r):0}}])}();function eJ(t,e,r,n){if("error"===(t=QK(t,e,r,n)).result)return t;var i=t.value.expression,o=jZ(i);if(!o&&!BK(e))return RK([new CY("","data expressions not supported")]);var a=DZ(i,["zoom","pitch","distance-from-center"]);if(!a&&!zK(e))return RK([new CY("","zoom expressions not supported")]);var s=DZ(i,["measure-light"]);if(!s&&!FK(e))return RK([new CY("","measure-light expression not supported")]);var u=e.expression&&e.expression.relaxZoomRestriction,l=function t(e){var r=null;if(e instanceof hK)r=t(e.result);else if(e instanceof fK){var n,i=wY(e.args);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(r=t(o))break}}catch(t){i.e(t)}finally{i.f()}}else(e instanceof GZ||e instanceof lK)&&e.input instanceof _X&&"zoom"===e.input.name&&(r=e);if(r instanceof CY)return r;e.eachChild(function(e){var n=t(e);n instanceof CY?r=n:r&&n&&r!==n&&(r=new CY("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))});return r}(i);if(!(l||a||u))return RK([new CY("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')]);if(l instanceof CY)return RK([l]);if(l instanceof lK&&!GK(e))return RK([new CY("",'"interpolate" expressions cannot be used with this property')]);if(!l)return NK(new $K(o?"constant":"source",t.value,s));var c=l instanceof lK?l.interpolation:void 0;return NK(new tJ(o?"camera":"composite",t.value,l.labels,c,s))}var rJ=function(){function t(e,r){dY(this,t),this._parameters=e,this._specification=r,TY(this,HK(this._parameters,this._specification))}return hY(t,null,[{key:"deserialize",value:function(e){return new t(e._parameters,e._specification)}},{key:"serialize",value:function(t){return{_parameters:t._parameters,_specification:t._specification}}}])}();function nJ(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function iJ(t){if(Array.isArray(t))return t.map(iJ);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var r in t)e[r]=iJ(t[r]);return e}return nJ(t)}function oJ(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":var e,r=wY(t.slice(1));try{for(r.s();!(e=r.n()).done;){var n=e.value;if(!oJ(n)&&"boolean"!=typeof n)return!1}}catch(t){r.e(t)}finally{r.f()}return!0;default:return!0}}function aJ(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill";if(null===t||void 0===t)return{filter:function(){return!0},needGeometry:!1,needFeature:!1};oJ(t)||(t=cJ(t));var r=t,n=!0;try{n=function(t){if(!sJ(t))return t;var e=iJ(t);return function t(e){var r=!1,n=[];if("case"===e[0]){for(var i=1;i",">=","<","<=","to-boolean"]);function lJ(t,e){return te?1:0}function cJ(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?fJ(t[1],t[2],"=="):"!="===r?dJ(fJ(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?fJ(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(cJ))):"all"===r?["all"].concat(t.slice(1).map(cJ)):"none"===r?["all"].concat(t.slice(1).map(cJ).map(dJ)):"in"===r?hJ(t[1],t.slice(2)):"!in"===r?dJ(hJ(t[1],t.slice(2))):"has"===r?pJ(t[1]):"!has"!==r||dJ(pJ(t[1]))}function fJ(t,e,r){switch(t){case"$type":return["filter-type-".concat(r),e];case"$id":return["filter-id-".concat(r),e];default:return["filter-".concat(r),t,e]}}function hJ(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(function(t){return EY(t)!==EY(e[0])})?["filter-in-large",t,["literal",e.sort(lJ)]]:["filter-in-small",t,["literal",e]]}}function pJ(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function dJ(t){return["!",t]}var yJ={};!function(t){var e=function(){var t=function(t,e,r,n){for(r=r||{},n=t.length;n--;r[t[n]]=e);return r},e=[1,12],r=[1,13],n=[1,9],i=[1,10],o=[1,11],a=[1,14],s=[1,15],u=[14,18,22,24],l=[18,22],c=[22,24],f={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,r,n,i,o,a){var s=o.length-1;switch(i){case 1:this.$=new String(t.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(t),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[s-2],o[s]];break;case 16:this.$={},this.$[o[s][0]]=o[s][1];break;case 17:this.$=o[s-2],o[s-2][o[s][0]]=o[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[s]];break;case 21:this.$=o[s-2],o[s-2].push(o[s])}},table:[{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},t(u,[2,7]),t(u,[2,8]),t(u,[2,9]),t(u,[2,10]),t(u,[2,11]),t(u,[2,12]),t(u,[2,3]),t(u,[2,4]),t(u,[2,5]),t([14,18,21,22,24],[2,1]),t(u,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},t(u,[2,13]),{18:[1,24],22:[1,25]},t(l,[2,16]),{21:[1,26]},t(u,[2,18]),{22:[1,28],24:[1,27]},t(c,[2,20]),t(u,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:30,15:7,16:8,17:a,23:s},t(u,[2,19]),{3:5,4:e,5:6,6:r,7:3,8:n,9:4,10:i,11:o,13:31,15:7,16:8,17:a,23:s},t(l,[2,17]),t(l,[2,15]),t(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],o=this.table,a="",s=0,u=0,l=1,c=i.slice.call(arguments,1),f=Object.create(this.lexer),h={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(h.yy[p]=this.yy[p]);f.setInput(t,h.yy),h.yy.lexer=f,h.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var d=f.yylloc;i.push(d);var y=f.options&&f.options.ranges;"function"==typeof h.yy.parseError?this.parseError=h.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,g,m,b,x,w,_,S,E,k={};;){if(g=r[r.length-1],this.defaultActions[g]?m=this.defaultActions[g]:(null!==v&&void 0!==v||(E=void 0,"number"!=typeof(E=f.lex()||l)&&(E=e.symbols_[E]||E),v=E),m=o[g]&&o[g][v]),void 0===m||!m.length||!m[0]){var T="";for(x in S=[],o[g])this.terminals_[x]&&x>2&&S.push("'"+this.terminals_[x]+"'");T=f.showPosition?"Parse error on line "+(s+1)+":\n"+f.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(s+1)+": Unexpected "+(v==l?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(T,{text:f.match,token:this.terminals_[v]||v,line:f.yylineno,loc:d,expected:S})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+v);switch(m[0]){case 1:r.push(v),n.push(f.yytext),i.push(f.yylloc),r.push(m[1]),v=null,u=f.yyleng,a=f.yytext,s=f.yylineno,d=f.yylloc;break;case 2:if(w=this.productions_[m[1]][1],k.$=n[n.length-w],k._$={first_line:i[i.length-(w||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(w||1)].first_column,last_column:i[i.length-1].last_column},y&&(k._$.range=[i[i.length-(w||1)].range[0],i[i.length-1].range[1]]),void 0!==(b=this.performAction.apply(k,[a,u,s,h.yy,m[1],n,i].concat(c))))return b;w&&(r=r.slice(0,-1*w*2),n=n.slice(0,-1*w),i=i.slice(0,-1*w)),r.push(this.productions_[m[1]][0]),n.push(k.$),i.push(k._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0}},h={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var o in i)this[o]=i[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,r,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),o=0;oe[0].length)){if(e=r,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,i[o])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,i[n]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};function p(){this.yy={}}return f.lexer=h,p.prototype=f,f.Parser=p,new p}();t.parser=e,t.Parser=e.Parser,t.parse=function(){return e.parse.apply(e,arguments)}}(yJ);var vJ={StyleExpression:KK,isExpression:JK,isExpressionFilter:oJ,createExpression:QK,createPropertyExpression:eJ,normalizePropertyExpression:function(t,e,r,n){if(UK(t))return new rJ(t,e);if(JK(t)||Array.isArray(t)&&t.length>0){var i=eJ(t,e,r,n);if("error"===i.result)throw new Error(i.value.map(function(t){return"".concat(t.key,": ").concat(t.message)}).join(", "));return i.value}var o=t;return"string"==typeof t&&"color"===e.type&&(o=eX.parse(t)),{kind:"constant",isConfigDependent:!1,evaluate:function(){return o}}},ZoomConstantExpression:$K,ZoomDependentExpression:tJ,StylePropertyFunction:rJ};function gJ(t){"@babel/helpers - typeof";return(gJ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mJ(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return bJ(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bJ(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function bJ(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r0}function sQ(t){var e=function(t){var e,r,n=t.paint,i=void 0===n?{}:n,o=t.layout,a=void 0===o?{}:o,s=Object.keys(i).concat(Object.keys(a)),u=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=eQ(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(oQ);try{var l=function(){var t=r.value,n=s.some(function(e){return e.startsWith(t.prefix)});if(n)return e=t.type,1};for(u.s();!(r=u.n()).done&&!l(););}catch(t){u.e(t)}finally{u.f()}return e||iQ.symbol}(t);return nQ(nQ(nQ({},iQ.symbol,{type:"layout",name:"icon-image"}),iQ.line,{type:"paint",name:"line-pattern"}),iQ.fill,{type:"paint",name:"fill-pattern"})[e]}var uQ=["array","boolean","collator","format","literal","number","object","string","to-boolean","to-color","to-number","to-string","typeof","feature-state","geometry-type","id","line-progress","properties","at","get","has","length","!","!=","<","<=","==",">",">=","all","any","case","match","coalesce","interpolate","interpolate-hcl","interpolate-lab","step","let","var","concat","downcase","is-supported-script","resolved-locale","upcase","rgb","rgba","-","*","/","%","^","+","abs","acos","asin","atan","ceil","cos","e","floor","ln","ln2","log10","log2","max","min","pi","round","sin","sqrt","tan","zoom","heatmap-density"];function lQ(t){if(t&&t.length>0){var e=tQ(t,1)[0];return"string"==typeof e&&uQ.includes(e)}return!1}function cQ(t){return Object.keys(t).every(function(e){return!lQ(t[e])})}function fQ(t){return(aQ(t)?t:[t]).every(function(t){return cQ(t.paint||{})&&cQ(t.layout||{})})}var hQ=function(t){return["background-color","background-color-transition","background-pattern","background-pattern-transition","background-opacity","background-opacity-transition","fill-antialias","fill-opacity","fill-opacity-transition","fill-color","fill-color-transition","fill-outline-color","fill-outline-color-transition","fill-translate","fill-translate-transition","fill-translate-anchor","fill-pattern","fill-pattern-transition","fill-extrusion-opacity","fill-extrusion-opacity-transition","fill-extrusion-color","fill-extrusion-color-transition","fill-extrusion-translate","fill-extrusion-translate-transition","fill-extrusion-translate-anchor","fill-extrusion-pattern","fill-extrusion-pattern-transition","fill-extrusion-height","fill-extrusion-height-transition","fill-extrusion-base","fill-extrusion-base-transition","fill-extrusion-vertical-gradient","line-opacity","line-opacity-transition","line-color","line-color-transition","line-translate","line-translate-transition","line-translate-anchor","line-width","line-width-transition","line-gap-width","line-gap-width-transition","line-offset","line-offset-transition","line-blur","line-blur-transition","line-dasharray","line-dasharray-transition","line-pattern","line-pattern-transition","line-gradient","icon-opacity","icon-opacity-transition","icon-color","icon-color-transition","icon-halo-color","icon-halo-color-transition","icon-halo-width","icon-halo-width-transition","icon-halo-blur","icon-halo-blur-transition","icon-translate","icon-translate-transition","icon-translate-anchor","text-opacity","text-opacity-transition","text-color","text-color-transition","text-halo-color","text-halo-color-transition","text-halo-width","text-halo-width-transition","text-halo-blur","text-halo-blur-transition","text-translate","text-translate-transition","text-translate-anchor","raster-opacity","raster-opacity-transition","raster-hue-rotate","raster-hue-rotate-transition","raster-brightness-min","raster-brightness-min-transition","raster-brightness-max","raster-brightness-max-transition","raster-saturation","raster-saturation-transition","raster-contrast","raster-contrast-transition","raster-fade-duration","raster-resampling","circle-sort-key","circle-radius","circle-radius-transition","circle-color","circle-color-transition","circle-blur","circle-blur-transition","circle-opacity","circle-opacity-transition","circle-translate","circle-translate-transition","circle-translate-anchor","circle-pitch-scale","circle-pitch-alignment","circle-stroke-width","circle-stroke-width-transition","circle-stroke-color","circle-stroke-color-transition","circle-stroke-opacity","circle-stroke-opacity-transition","heatmap-radius","heatmap-radius-transition","heatmap-weight","heatmap-intensity","heatmap-intensity-transition","heatmap-color","heatmap-opacity","heatmap-opacity-transition","hillshade-illumination-direction","hillshade-illumination-anchor","hillshade-exaggeration","hillshade-exaggeration-transition","hillshade-shadow-color","hillshade-shadow-color-transition","hillshade-highlight-color","hillshade-highlight-color-transition","hillshade-accent-color","hillshade-accent-color-transition"].includes(t)};function pQ(t){"@babel/helpers - typeof";return(pQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function dQ(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function yQ(t){for(var e=1;e0}},{key:"removeSymbol",value:function(t){this.symbolManager.removeSymbol(t)}},{key:"getSymbol",value:function(t){return this.symbolManager.getSymbol(t)}},{key:"getLayerIds",value:function(t){return this.compositeSymbolRender.getLayerIds(t)||[]}},{key:"getLayerId",value:function(t){return this.compositeSymbolRender.getLayerId(t)}},{key:"removeLayerId",value:function(t){return this.compositeSymbolRender.removeLayerId(t)}},{key:"getLayer",value:function(t){var e=this.map.getLayerBySymbolBak(t),r=this.getLayerSymbol(t);if(e)return r?yQ(yQ({},e),{},{symbol:r}):e;var n=this.getLayerIds(t);if(n[0]){var i=this.map.getLayerBySymbolBak(n[0]);return i&&yQ(yQ({},i),{},{symbol:r,id:t})}}},{key:"removeLayer",value:function(t){var e=this,r=this.getLayerIds(t);r.length>0?(r.forEach(function(t){return e.map.style.removeLayer(t)}),this.removeLayerId(t)):this.map.style.removeLayer(t)}},{key:"getStyle",value:function(){var t=this,e=this.map.style.serialize();return this.hasSymbol()&&(e.layers=e.layers.reduce(function(e,r){var n=t.getLayerId(r.id);return n?!e.find(function(t){return t.id===n})&&e.push(yQ(yQ({},r),{},{symbol:t.getLayerSymbol(n),id:n})):t.getLayerSymbol(r.id)?e.push(yQ(yQ({},r),{},{symbol:t.getLayerSymbol(r.id)})):e.push(r),e},[])),e}},{key:"getFirstLayerId",value:function(t){return this.getLayerIds(t)[0]}},{key:"moveLayer",value:function(t,e){var r=this,n=this.getLayerIds(t),i=e&&this.map.style.getLayer(e),o=i&&i.id||e&&this.getFirstLayerId(e);n.length>0?n.forEach(function(t){return r.map.style.moveLayer(t,o)}):this.map.style.moveLayer(t,o)}},{key:"setFilter",value:function(t,e,r){var n=this;if(lQ(this.getLayerSymbol(t))){var i=this.getFirstLayerId(t);this.map.style.setFilter(i,e,r);var o=this.getLayerSymbol(t);this.setSymbol(t,o)}else{var a=this.getLayerIds(t);a.length>0?a.forEach(function(t){return n.map.style.setFilter(t,e,r)}):this.map.style.setFilter(t,e,r)}}},{key:"getFilter",value:function(t){var e=this.getFirstLayerId(t);if(this.map.style.getLayer(e))return this.map.style.getFilter(e)}},{key:"setLayerZoomRange",value:function(t,e,r){var n=this,i=this.getLayerIds(t);i.length>0?i.forEach(function(t){return n.map.style.setLayerZoomRange(t,e,r)}):this.map.style.setLayerZoomRange(t,e,r)}},{key:"setPaintProperty",value:function(t,e,r,n){var i=this,o=this.getLayerIds(t);o.length>0?o.forEach(function(t){return i.map.style.setPaintProperty(t,e,r,n)}):this.map.style.setPaintProperty(t,e,r,n)}},{key:"getPaintProperty",value:function(t,e){var r=this.getFirstLayerId(t);return this.map.style.getPaintProperty(r,e)}},{key:"setLayoutProperty",value:function(t,e,r,n){var i=this,o=this.getLayerIds(t);o.length>0?o.forEach(function(t){return i.map.style.setLayoutProperty(t,e,r,n)}):this.map.style.setLayoutProperty(t,e,r,n)}},{key:"getLayoutProperty",value:function(t,e){var r=this.getFirstLayerId(t);return this.map.style.getLayoutProperty(r,e)}},{key:"updateLayerSymbol",value:function(t){var e=this;Object.keys(this._layerSymbols).forEach(function(r){var n=e._layerSymbols[r];n.includes(t)&&e.setSymbol(r,n)})}},{key:"updateSymbol",value:function(t,e){return this.getSymbol(t)?fQ(e)?(this.symbolManager.addSymbol(t,e),void this.updateLayerSymbol(t)):this.map.fire("error",{error:new Error("Symbol is not supported expressions.")}):this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}},{key:"setSymbolProperty",value:function(t,e,r,n){var i=this.getSymbol(t);if(!i)return this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))});if(lQ(n))return this.map.fire("error",{error:new Error("Symbol value is not supported expressions.")});var o=hQ(r)?"paint":"layout";if(i.length>0){var a=i[e];if(!a)return this.map.fire("error",{error:new Error("symbol[".concat(e,"] does not exist."))});a[o]||(a[o]={}),Object.assign(a[o],vQ({},r,n))}else i[o]||(i[o]={}),Object.assign(i[o],vQ({},r,n));this.symbolManager.addSymbol(t,i),this.updateLayerSymbol(t)}},{key:"getSymbolProperty",value:function(t,e,r){var n=this.getSymbol(t);if(n){var i=hQ(r)?"paint":"layout";return n.length>0?n[e]&&n[e][i]&&n[e][i][r]:n[i]&&n[i][r]}this.map.fire("error",{error:new Error('Symbol "'.concat(t,'" could not be loaded. Please make sure you have added the symbol with map.addSymbol().'))})}}])&&gQ(t.prototype,e),r&&gQ(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function xQ(t){"@babel/helpers - typeof";return(xQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wQ(){wQ=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==xQ(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function _Q(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function SQ(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){_Q(o,n,i,a,s,"next",t)}function s(t){_Q(o,n,i,a,s,"throw",t)}a(void 0)})}}var EQ=function(){var t=function(t){return O().Map.prototype.symbolHandler||(O().Map.prototype.symbolHandler=new bQ(t)),O().Map.prototype.symbolHandler._update(t)};function e(){return(e=SQ(wQ().mark(function t(e,r){var n,i,o,a,s,u;return wQ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n="".concat(r.basePath,"/").concat(e,"/").concat(e),t.next=4,ut.get("".concat(n,".json")).then(function(t){return t.ok?t.json():null}).catch(function(){return null});case 4:if(i=t.sent){t.next=7;break}return t.abrupt("return",null);case 7:if(o=i.paint||{},a=i.layout||{},s=o["fill-pattern"]||o["line-pattern"]||a["icon-image"],t.t0=s,!t.t0){t.next=15;break}return t.next=14,new Promise(function(t){var e=new Image;e.src="".concat(n,".png"),e.onload=function(r){t(r?e:null)},e.onerror=function(){t(null)}});case 14:t.t0=t.sent;case 15:return u=t.t0,t.abrupt("return",{value:i,image:u});case 17:case"end":return t.stop()}},t)}))).apply(this,arguments)}function r(r,n){return function(t,r){return e.apply(this,arguments)}(r,n).then(function(e){if(!e)return null;var r=e.value,i=e.image;return i&&t(n).addSymbolImageToMap(r,i),r})}void 0===O().Map.prototype.addLayerBySymbolBak&&(O().Map.prototype.addLayerBySymbolBak=O().Map.prototype.addLayer,O().Map.prototype.addLayer=function(e,r){var n=t(this);if(!(n.getLayerIds(e.id).length>0))return e.symbol?(n.addLayer(e,r),this):(this.addLayerBySymbolBak(e,r),this);this.fire("error",{error:new Error("A layer with this id already exists.")})}),void 0===O().Map.prototype.getLayerBySymbolBak&&(O().Map.prototype.getLayerBySymbolBak=O().Map.prototype.getLayer,O().Map.prototype.getLayer=function(e){return t(this).getLayer(e)}),void 0===O().Map.prototype.moveLayerBySymbolBak&&(O().Map.prototype.moveLayerBySymbolBak=O().Map.prototype.moveLayer,O().Map.prototype.moveLayer=function(e,r){return!this.style.getLayer(e)||r&&!this.style.getLayer(r)?(t(this).moveLayer(e,r),this._update(!0)):this.moveLayerBySymbolBak(e,r)}),void 0===O().Map.prototype.removeLayerBySymbolBak&&(O().Map.prototype.removeLayerBySymbolBak=O().Map.prototype.removeLayer,O().Map.prototype.removeLayer=function(e){return this.style.getLayer(e)?this.removeLayerBySymbolBak(e):t(this).removeLayer(e)}),void 0===O().Map.prototype.setLayoutPropertyBySymbolBak&&(O().Map.prototype.setLayoutPropertyBySymbolBak=O().Map.prototype.setLayoutProperty,O().Map.prototype.setLayoutProperty=function(e,r,n,i){return this.overlayLayersManager[e]||this.style.getLayer(e)?this.setLayoutPropertyBySymbolBak(e,r,n,i):(t(this).setLayoutProperty(e,r,n,i),this._update(!0))}),O().Map.prototype.setSymbol=function(e,r){t(this).setSymbol(e,r)},O().Map.prototype.setStyleBak||(O().Map.prototype.setStyleBak=O().Map.prototype.setStyle,O().Map.prototype.setStyle=function(t,e){var r=this;return this.setStyleBak(t,e),this.style&&this.style.once("style.load",function(){t.layers.filter(function(t){return t.symbol}).forEach(function(t){r.setSymbol(t.id,t.symbol)})}),this}),O().Map.prototype.loadSymbol=(n=SQ(wQ().mark(function t(e,n){var i,o,a,s,u,l,c=this;return wQ().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if("string"!=typeof e){t.next=9;break}return t.next=3,r(e,this);case 3:i=t.sent,o=null,i||(o="Symbol ".concat(e," is not exists")),n(o,i),t.next=21;break;case 9:if(!$.isArray(e)){t.next=20;break}return a=e.map(function(t){return r(t,c)}),t.next=13,Promise.all(a);case 13:s=t.sent,u=null,(l=e.filter(function(t,e){return!s[e]})).length>0&&(u="Symbol ".concat(l.join(",")," is not exists")),n(u,s),t.next=21;break;case 20:n({message:"Symbol id must be a string or string[]."});case 21:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)}),O().Map.prototype.addSymbol=function(e,r){t(this).addSymbol(e,r)},O().Map.prototype.getSymbol=function(e){return t(this).getSymbol(e)},O().Map.prototype.hasSymbol=function(t){return t?!!this.getSymbol(t):(this.fire("error",{error:new Error("Missing required symbol id")}),!1)},O().Map.prototype.removeSymbol=function(e){t(this).removeSymbol(e)},O().Map.prototype.updateSymbol=function(e,r){t(this).updateSymbol(e,r)},O().Map.prototype.setSymbolProperty=function(e,r,n,i){t(this).setSymbolProperty(e,r,n,i)},O().Map.prototype.getSymbolProperty=function(e,r,n){return t(this).getSymbolProperty(e,r,n)},O().Map.prototype.getStyle=function(){if(this.style)return t(this).getStyle()},O().Map.prototype.setFilter=function(e,r,n){return this.style.getLayer(e)?(this.style.setFilter(e,r,n),this._update(!0)):(t(this).setFilter(e,r,n),this._update(!0))},O().Map.prototype.getFilter=function(e){return this.style.getLayer(e)?this.style.getFilter(e):t(this).getFilter(e)},O().Map.prototype.setLayerZoomRange=function(e,r,n){return this.style.getLayer(e)?(this.style.setLayerZoomRange(e,r,n),this._update(!0)):(t(this).setLayerZoomRange(e,r,n),this._update(!0))},O().Map.prototype.setPaintProperty=function(e,r,n,i){return this.style.getLayer(e)?(this.style.setPaintProperty(e,r,n,i),this._update(!0)):(t(this).setPaintProperty(e,r,n,i),this._update(!0))},O().Map.prototype.getPaintProperty=function(e,r){return this.style.getLayer(e)?this.style.getPaintProperty(e,r):t(this).getPaintProperty(e,r)},O().Map.prototype.getLayoutProperty=function(e,r){return this.style.getLayer(e)?this.style.getLayoutProperty(e,r):t(this).getLayoutProperty(e,r)},void 0===O().Map.prototype.onBak&&(O().Map.prototype.onBak=O().Map.prototype.on,O().Map.prototype.on=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.onBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.onBak(e,t,n)}),this)}),void 0===O().Map.prototype.onceBak&&(O().Map.prototype.onceBak=O().Map.prototype.once,O().Map.prototype.once=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.onceBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.onceBak(e,t,n)}),this)}),void 0===O().Map.prototype.offBak&&(O().Map.prototype.offBak=O().Map.prototype.off,O().Map.prototype.off=function(e,r,n){var i=this;return void 0===n||this.style.getLayer(r)?this.offBak(e,r,n):(t(this).getLayerIds(r).forEach(function(t){return i.offBak(e,t,n)}),this)});var n};function kQ(t){"@babel/helpers - typeof";return(kQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function TQ(t,e){for(var r=0;r=0){var e=JSON.parse(t.data);return t.filterParam=e,t.eventType="setFilterParamSucceeded",void this.events.triggerEvent("setFilterParamSucceeded",t)}var r=JSON.parse(t.data);t.featureResult=r,t.eventType="messageSucceeded",this.events.triggerEvent("messageSucceeded",t)}},{key:"_connect",value:function(t){return t=Jx.appendCredential(t),"WebSocket"in window?new WebSocket(t):"MozWebSocket"in window?new(0,window.MozWebSocket)(t):(console.log("no WebSocket"),null)}}])&&Y$(r.prototype,n),i&&Y$(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function $$(t){"@babel/helpers - typeof";return($$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t0(t,e){for(var r=0;r=0&&n.toIndex>=0&&!i&&(n.url=$.urlAppend(n.url,"fromIndex=".concat(n.fromIndex,"&toIndex=").concat(n.toIndex))),n.returnContent&&(t.returnCountOnly||t.returnDatasetInfoOnly||t.returnFeaturesOnly||console.warn("recommend set returnFeaturesOnly config to true to imporve performance. if need get Total amount and Dataset information. FeatureService provide getFeaturesCount and getFeaturesDatasetInfo method"),t.returnCountOnly&&(n.url=$.urlAppend(n.url,"returnCountOnly="+t.returnCountOnly)),t.returnDatasetInfoOnly&&(n.url=$.urlAppend(n.url,"returnDatasetInfoOnly="+t.returnDatasetInfoOnly)),t.returnFeaturesOnly&&(n.url=$.urlAppend(n.url,"returnFeaturesOnly="+t.returnFeaturesOnly))),r=n.getJsonParameters(t),n.request({method:"POST",data:r,scope:n,success:e,failure:e})}}},{key:"transformResult",value:function(t,e){t=$.transformResult(t);var r=new ki;(this.format===kn.GEOJSON&&t.features&&(t.features=r.toGeoJSON(t.features)),this.returnFeaturesOnly&&Array.isArray(t))&&(t={succeed:t.succeed,features:r.toGeoJSON(t)});return{result:t,options:e}}},{key:"dataFormat",value:function(){return[kn.GEOJSON,kn.ISERVER,kn.FGB]}}])&&u1(r.prototype,n),i&&u1(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function y1(t){"@babel/helpers - typeof";return(y1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function v1(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}}}])&&E1(r.prototype,n),i&&E1(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function M1(t){"@babel/helpers - typeof";return(M1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function I1(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null}}])&&r2(r.prototype,n),i&&r2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function l2(t){"@babel/helpers - typeof";return(l2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c2(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.geometry&&(t.geometry.destroy(),t.geometry=null)}}])&&m2(r.prototype,n),i&&m2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function k2(t){"@babel/helpers - typeof";return(k2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function T2(t,e){for(var r=0;r0;)t.fields.pop();t.fields=null}t.attributeFilter=null,t.spatialQueryMode=null,t.getFeatureMode=null,t.orderBy=null}}])&&j2(r.prototype,n),i&&j2(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function G2(t){"@babel/helpers - typeof";return(G2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function U2(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultStyle&&(t.defaultStyle.destroy(),t.defaultStyle=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=$.copyAttributes(t,this)).defaultStyle&&t.defaultStyle.toServerJSONObject&&(t.defaultStyle=t.defaultStyle.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.rangeExpression=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&B6(r.prototype,n),i&&B6(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function W6(t){"@babel/helpers - typeof";return(W6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q6(t,e){for(var r=0;r0?t[0].subLayers.layers:null)?r.length:0,this.handleLayers(n,r),{result:t[0],options:e}}},{key:"handleLayers",value:function(t,e){var r;if(t)for(var n=0;n0)this.handleLayers(e[n].subLayers.layers.length,e[n].subLayers.layers);else switch(e[n].ugcLayerType){case"THEME":(r=new T8).fromJson(e[n]),e[n]=r;break;case"GRID":(r=new B8).fromJson(e[n]),e[n]=r;break;case"IMAGE":(r=new q8).fromJson(e[n]),e[n]=r;break;case"VECTOR":(r=new t7).fromJson(e[n]),e[n]=r}}}}])&&r7(r.prototype,n),i&&r7(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function l7(t){"@babel/helpers - typeof";return(l7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c7(t,e){for(var r=0;r0&&(n+='"subLayers":'+t.toJSON()),n+=',"visible":true,',n+='"name":"'+this.getMapName(this.mapUrl)+'"',n+="}]",r.request({method:"PUT",data:n,scope:r,success:e,failure:e})}}},{key:"createTempLayerComplete",value:function(t,e){return e=e.result?e.result:e,(e=$.transformResult(e)).succeed&&(this.lastparams.resourceID=e.newResourceID),this.processAsync(this.lastparams,t)}},{key:"getMapName",value:function(t){var e=t;"/"===e.charAt(e.length-1)&&(e=e.substr(0,e.length-1));var r=e.lastIndexOf("/");return e.substring(r+1,e.length)}},{key:"transformResult",value:function(t,e){return null!=(t=$.transformResult(t))&&null!=this.lastparams&&null!=this.lastparams.resourceID&&(t.newResourceID=this.lastparams.resourceID),{result:t,options:e}}}])&&B7(r.prototype,n),i&&B7(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function W7(t){"@babel/helpers - typeof";return(W7="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q7(t,e){for(var r=0;r=200&&t.code<300||0==t.code||304===t.code,n=t.code&&r;return!t.code||n?{result:t,options:e}:{error:t,options:e}}}])&&n9(r.prototype,n),i&&n9(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function c9(t){"@babel/helpers - typeof";return(c9="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f9(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}}])&&Stt(r.prototype,n),i&&Stt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Ptt(t){"@babel/helpers - typeof";return(Ptt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mtt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.facilityPathList)return t;var e=new ki;return t.facilityPathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&met(r.prototype,n),i&&met(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Tet(t){"@babel/helpers - typeof";return(Tet="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cet(t,e){for(var r=0;r0&&(e+=","),e+=$.toJSON(t[n]);return e+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t)return null;var e=new ki;return t.demandResults&&(t.demandResults=e.toGeoJSON(t.demandResults)),t.supplyResults&&(t.supplyResults=e.toGeoJSON(t.supplyResults)),t}}])&&Met(r.prototype,n),i&&Met(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Bet(t){"@babel/helpers - typeof";return(Bet="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Fet(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList)return null;var e=new ki;return t.pathList.map(function(t){return t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t}),t}}])&&Vet(r.prototype,n),i&&Vet(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Ket(t){"@babel/helpers - typeof";return(Ket="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jet(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.pathList||t.pathList.length<1)return null;var e=new ki;return t.pathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&ert(r.prototype,n),i&&ert(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function urt(t){"@babel/helpers - typeof";return(urt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lrt(t,e){for(var r=0;r0&&(r+=","),r+='{"x":'+e[i].x+',"y":'+e[i].y+"}";else if(!0===t)for(var o=0;o0&&(r+=","),r+=e[o];return r+="]"}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.serviceAreaList)return t;var e=new ki;return t.serviceAreaList.map(function(t){return t.serviceRegion&&(t.serviceRegion=e.toGeoJSON(t.serviceRegion)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures)),t.routes&&(t.routes=e.toGeoJSON(t.routes)),t}),t}}])&&prt(r.prototype,n),i&&prt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function xrt(t){"@babel/helpers - typeof";return(xrt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wrt(t,e){for(var r=0;r0&&(e+=","),e+='{"x":'+i[r].x+',"y":'+i[r].y+"}";o+=e+="]"}else if(!0===t.isAnalyzeById){for(var a="[",s=t.nodes,u=s.length,l=0;l0&&(a+=","),a+=s[l];o+=a+="]"}return o}},{key:"toGeoJSONResult",value:function(t){if(!t||!t.tspPathList)return null;var e=new ki;return t.tspPathList.forEach(function(t){t.route&&(t.route=e.toGeoJSON(t.route)),t.pathGuideItems&&(t.pathGuideItems=e.toGeoJSON(t.pathGuideItems)),t.edgeFeatures&&(t.edgeFeatures=e.toGeoJSON(t.edgeFeatures)),t.nodeFeatures&&(t.nodeFeatures=e.toGeoJSON(t.nodeFeatures))}),t}}])&&krt(r.prototype,n),i&&krt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Irt(t){"@babel/helpers - typeof";return(Irt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lrt(t,e){for(var r=0;r0)for(var e in t.items)t.items[e].destroy(),t.items[e]=null;t.items=null}t.numericPrecision=null,t.rangeMode=null,t.rangeCount=null,t.colorGradientType=null}}])&&vot(t.prototype,e),r&&vot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function bot(t){"@babel/helpers - typeof";return(bot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xot(t,e){for(var r=0;r=0;t--)this.points[t].destroy();this.points=null}}}])&&Ldt(r.prototype,n),i&&Ldt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function zdt(t){"@babel/helpers - typeof";return(zdt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gdt(t,e){for(var r=0;r0&&(1===i.length?r+="'displayFilter':\""+i[0]+'",':r+="'displayFilter':\""+i[a]+'",'),(o=t.displayOrderBy)&&o.length>0&&(1===o.length?r+="'displayOrderBy':'"+o[0]+"',":r+="'displayOrderBy':'"+o[a]+"',"),(e=t.fieldValuesDisplayFilter)&&(r+="'fieldValuesDisplayFilter':"+$.toJSON(e)+","),t.joinItems&&t.joinItems.length>0&&t.joinItems[a]&&(r+="'joinItems':["+$.toJSON(t.joinItems[a])+"],"),t.datasetNames&&t.dataSourceNames){var u=t.datasetNames[a]?a:t.datasetNames.length-1,l=t.dataSourceNames[a]?a:t.dataSourceNames.length-1;r+="'datasetInfo': {'name': '"+t.datasetNames[u]+"','dataSourceName': '"+t.dataSourceNames[l]+"'}},"}else r+="},"}t.themes&&t.themes.length>0&&(r=r.substring(0,r.length-1)),r+="]},";var c=this.url.split("/");return r+="'name': '"+c[c.length-2]+"'}]"}}])&&tvt(r.prototype,n),i&&tvt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function svt(t){"@babel/helpers - typeof";return(svt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uvt(t,e){for(var r=0;r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function lgt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function cgt(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){lgt(o,n,i,a,s,"next",t)}function s(t){lgt(o,n,i,a,s,"throw",t)}a(void 0)})}}function fgt(t,e){for(var r=0;r0&&i.push(","),r=e[o].geometry,i.push(this.extractGeometry(r));return n&&i.push(")"),i.join("")}},{key:"extractGeometry",value:function(t){var e=t.CLASS_NAME.split(".")[2].toLowerCase();return this.extract[e]?("collection"===e?"GEOMETRYCOLLECTION":e.toUpperCase())+"("+this.extract[e].apply(this,[t])+")":null}}])&&amt(r.prototype,n),i&&amt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function hmt(t){"@babel/helpers - typeof";return(hmt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pmt(t,e){for(var r=0;r=0?e.speed:1,this.frequency=e.speed&&e.frequency>=0?e.frequency:1e3,this.startTime=e.startTime&&null!=e.startTime?e.startTime:0,this.endTime=e.endTime&&null!=e.endTime&&e.endTime>=r.startTime?e.endTime:+new Date,this.repeat=void 0===e.repeat||e.repeat,this.reverse=void 0!==e.reverse&&e.reverse,this.currentTime=null,this.oldTime=null,this.running=!1,this.EVENT_TYPES=["start","pause","stop"],r.events=new Ya(this,null,this.EVENT_TYPES),r.speed=Number(r.speed),r.frequency=Number(r.frequency),r.startTime=Number(r.startTime),r.endTime=Number(r.endTime),r.startTime=Date.parse(new Date(r.startTime)),r.endTime=Date.parse(new Date(r.endTime)),r.currentTime=r.startTime,this.CLASS_NAME="SuperMap.TimeControlBase"},(e=[{key:"updateOptions",value:function(t){var e=this;(t=t||{}).speed&&t.speed>=0&&(e.speed=t.speed,e.speed=Number(e.speed)),t.speed&&t.frequency>=0&&(e.frequency=t.frequency,e.frequency=Number(e.frequency)),t.startTime&&null!=t.startTime&&(e.startTime=t.startTime,e.startTime=Date.parse(new Date(e.startTime))),t.endTime&&null!=t.endTime&&t.endTime>=e.startTime&&(e.endTime=t.endTime,e.endTime=Date.parse(new Date(e.endTime))),null!=t.repeat&&(e.repeat=t.repeat),null!=t.reverse&&(e.reverse=t.reverse)}},{key:"start",value:function(){var t=this;t.running||(t.running=!0,t.tick(),t.events.triggerEvent("start",t.currentTime))}},{key:"pause",value:function(){this.running=!1,this.events.triggerEvent("pause",this.currentTime)}},{key:"stop",value:function(){var t=this;t.currentTime=t.startTime,t.running&&(t.running=!1),t.events.triggerEvent("stop",t.currentTime)}},{key:"toggle",value:function(){this.running?this.pause():this.start()}},{key:"setSpeed",value:function(t){return t>=0&&(this.speed=t,!0)}},{key:"getSpeed",value:function(){return this.speed}},{key:"setFrequency",value:function(t){return t>=0&&(this.frequency=t,!0)}},{key:"getFrequency",value:function(){return this.frequency}},{key:"setStartTime",value:function(t){var e=this;return!((t=Date.parse(new Date(t)))>e.endTime)&&(e.startTime=t,e.currentTime=e.endTime&&(e.currentTime=e.startTime,e.tick()),!0)}},{key:"getEndTime",value:function(){return this.endTime}},{key:"setCurrentTime",value:function(t){var e=this;return e.currentTime=Date.parse(new Date(e.currentTime)),t>=e.startTime&&t<=e.endTime&&(e.currentTime=t,e.startTime=e.currentTime,e.tick(),!0)}},{key:"getCurrentTime",value:function(){return this.currentTime}},{key:"setRepeat",value:function(t){this.repeat=t}},{key:"getRepeat",value:function(){return this.repeat}},{key:"setReverse",value:function(t){this.reverse=t}},{key:"getReverse",value:function(){return this.reverse}},{key:"getRunning",value:function(){return this.running}},{key:"destroy",value:function(){var t=this;t.speed=null,t.frequency=null,t.startTime=null,t.endTime=null,t.currentTime=null,t.repeat=null,t.running=!1,t.reverse=null}},{key:"tick",value:function(){}}])&&pmt(t.prototype,e),r&&pmt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function vmt(t){"@babel/helpers - typeof";return(vmt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gmt(t,e){for(var r=0;r=t.endTime&&(t.currentTime=t.endTime)}}}])&&gmt(r.prototype,n),i&&gmt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Emt(t){"@babel/helpers - typeof";return(Emt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kmt(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{headers:this.headers,crossOrigin:this.crossOrigin,withCredentials:this.withCredentials};return e=Jx.appendCredential(e),ut.commit(t,e,r,n).then(function(t){return t.json()})}}])&&zmt(t.prototype,e),r&&zmt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Vmt(t){"@babel/helpers - typeof";return(Vmt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Hmt(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.reverseColor=null,t.rangeMode=null,t.rangeParameter=null,t.colorGradientType=null}}])&&Ywt(r.prototype,n),i&&Ywt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function t_t(t){"@babel/helpers - typeof";return(t_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e_t(t,e){for(var r=0;r0)for(var r in t.items)t.items[r].destroy(),t.items[r]=null;t.items=null}t.defaultcolor&&(t.defaultcolor.destroy(),t.defaultcolor=null)}},{key:"toServerJSONObject",value:function(){var t={};if((t=$.copyAttributes(t,this)).defaultcolor&&t.defaultcolor.toServerJSONObject&&(t.defaultcolor=t.defaultcolor.toServerJSONObject()),t.items){for(var e=[],r=t.items.length,n=0;n0&&(t=t.substring(0,t.length-1)),"{"+t+"}"}return null}}])&&g_t(t.prototype,e),r&&g_t(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function x_t(t){"@babel/helpers - typeof";return(x_t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function w_t(t,e){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:{};return e=Jx.appendCredential(e),n.crossOrigin=this.options.crossOrigin,n.headers=this.options.headers,ut.commit(t,e,r,n).then(function(t){return t.json()})}}])&&wEt(t.prototype,e),r&&wEt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function EEt(t){"@babel/helpers - typeof";return(EEt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kEt(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=Array(e);re.geoFence.radius&&(e.outOfGeoFence&&e.outOfGeoFence(t),e.events.triggerEvent("outOfGeoFence",{data:t})),r})}},{key:"_distance",value:function(t,e,r,n){return Math.sqrt((t-r)*(t-r)+(e-n)*(e-n))}},{key:"_getMeterPerMapUnit",value:function(t){var e;return"meter"===t?e=1:"degree"===t&&(e=2*Math.PI*6378137/360),e}}])&&tkt(t.prototype,e),r&&tkt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),nkt=r(8518),ikt=r.n(nkt);function okt(t){"@babel/helpers - typeof";return(okt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function akt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function skt(t,e){for(var r=0;rl&&(u[i]=u[i].slice(n-l),l=n)}function y(t){var e,o,a,s;if(t instanceof Function)return t.call(c.parsers);if("string"==typeof t)e=r.charAt(n)===t?t:null,o=1,d();else{if(d(),!(e=t.exec(u[i])))return null;o=e[0].length}if(e){var f=n+=o;for(s=n+u[i].length-o;n=0&&"\n"!==n.charAt(a);a--)t.column++;return new Error([t.filename,t.line,t.column,t.message].join(";"))}return this.env=e=e||{},this.env.filename=this.env.filename||null,this.env.inputs=this.env.inputs||{},c={parse:function(o){var a,c=null;if(n=i=l=s=0,u=[],r=o.replace(/\r\n/g,"\n"),e.filename&&(f.env.inputs[e.filename]=r),u=function(t){for(var e,n,i,o,a=0,s=/(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,u=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,l=/"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,f=0,h=t[0],p=0;p0?"missing closing `}`":"missing opening `{`"}),t.map(function(t){return t.join("")})}([[]]),c)throw v(c);var h=function(t,e){var r=t.specificity,n=e.specificity;return r[0]!=n[0]?n[0]-r[0]:r[1]!=n[1]?n[1]-r[1]:r[2]!=n[2]?n[2]-r[2]:n[3]-r[3]};return(a=new t.Tree.Ruleset([],y(this.parsers.primary))).root=!0,a.toList=function(t){t.error=function(e){t.errors||(t.errors=new Error("")),t.errors.message?t.errors.message+="\n"+v(e).message:t.errors.message=v(e).message},t.frames=t.frames||[];var e=this.flatten([],[],t);return e.sort(h),e},a},parsers:{primary:function(){for(var t,e=[];(t=y(this.rule)||y(this.ruleset)||y(this.comment))||y(/^[\s\n]+/)||(t=y(this.invalid));)t&&e.push(t);return e},invalid:function(){var e=y(/^[^;\n]*[;\n]/);if(e)return new t.Tree.Invalid(e,a)},comment:function(){var e;if("/"===r.charAt(n))return"/"===r.charAt(n+1)?new t.Tree.Comment(y(/^\/\/.*/),!0):(e=y(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))?new t.Tree.Comment(e):void 0},entities:{quoted:function(){if('"'===r.charAt(n)||"'"===r.charAt(n)){var e=y(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/);return e?new t.Tree.Quoted(e[1]||e[2]):void 0}},field:function(){if(y("[")){var e=y(/(^[^\]]+)/);if(y("]"))return e?new t.Tree.Field(e[1]):void 0}},comparison:function(){var t=y(/^=~|=|!=|<=|>=|<|>/);if(t)return t},keyword:function(){var e=y(/^[A-Za-z\u4e00-\u9fa5-]+[A-Za-z-0-9\u4e00-\u9fa5_]*/);if(e)return new t.Tree.Keyword(e)},call:function(){var e,r;if(e=/^([\w\-]+|%)\(/.exec(u[i])){if("url"===(e=e[1]))return null;n+=e.length;if(y("("),r=y(this.entities.arguments),y(")"))return e?new t.Tree.Call(e,r,n):void 0}},arguments:function(){for(var t,e=[];t=y(this.expression);){e.push(t);if(!y(","))break}return e},literal:function(){return y(this.entities.dimension)||y(this.entities.keywordcolor)||y(this.entities.hexcolor)||y(this.entities.quoted)},url:function(){var e;if("u"===r.charAt(n)&&y(/^url\(/)){e=y(this.entities.quoted)||y(this.entities.variable)||y(/^[\-\w%@_match\/.&=:;#+?~]+/)||"";return y(")")?new t.Tree.URL(void 0!==e.value||e instanceof t.Tree.Variable?e:new t.Tree.Quoted(e)):new t.Tree.Invalid(e,a,"Missing closing ) in URL.")}},variable:function(){var i,o=n;if("@"===r.charAt(n)&&(i=y(/^@[\w-]+/)))return new t.Tree.Variable(i,o,e.filename)},hexcolor:function(){var e;if("#"===r.charAt(n)&&(e=y(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new t.Tree.Color(e[1])},keywordcolor:function(){var e=u[i].match(/^[a-z]+/);if(e&&e[0]in t.Tree.Reference.data.colors)return new t.Tree.Color(t.Tree.Reference.data.colors[y(/^[a-z]+/)])},dimension:function(){var e=r.charCodeAt(n);if(!(e>57||e<45||47===e)){var i=y(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/);return i?new t.Tree.Dimension(i[1],i[2],a):void 0}}},variable:function(){var t;if("@"===r.charAt(n)&&(t=y(/^(@[\w-]+)\s*:/)))return t[1]},entity:function(){var t=y(this.entities.call)||y(this.entities.literal),e=y(this.entities.field)||y(this.entities.variable),r=y(this.entities.url)||y(this.entities.keyword);return t||e||r},end:function(){var t;return y(";")||("string"==typeof(t="}")?r.charAt(n)===t:!!t.test(u[i]))},element:function(){var e=y(/^(?:[.#][\w\u4e00-\u9fa5\-]+|\*|Map)/);if(e)return new t.Tree.Element(e)},attachment:function(){var t=y(/^::([\w\-]+(?:\/[\w\-]+)*)/);if(t)return t[1]},selector:function(){for(var e,i,o,s,u,l=[],c=new t.Tree.Filterset,f=[],h=0,p=0;(o=y(this.element))||(u=y(this.zoom))||(s=y(this.filter))||(e=y(this.attachment));){if(h++,o)l.push(o);else if(u)f.push(u),p++;else if(s){var d=c.add(s);if(d)throw v({message:d,index:n-1});p++}else{if(i)throw v({message:"Encountered second attachment name.",index:n-1});i=e}var g=r.charAt(n);if("{"===g||"}"===g||";"===g||","===g)break}if(h)return new t.Tree.Selector(c,f,l,i,p,a)},filter:function(){h();var r,n,i;if(y("[")&&(r=y(/^[a-zA-Z0-9\-_]+/)||y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.keyword)||y(this.entities.field))&&(r instanceof t.Tree.Quoted&&(r=new t.Tree.Field(r.toString())),(n=y(this.entities.comparison))&&(i=y(this.entities.quoted)||y(this.entities.variable)||y(this.entities.dimension)||y(this.entities.keyword)||y(this.entities.field)))){if(!y("]"))throw v({message:"Missing closing ] of filter.",index:a-1});return r.is||(r=new t.Tree.Field(r)),new t.Tree.Filter(r,n,i,a,e.filename)}},zoom:function(){h();var e,r;if(y(/^\[\s*zoom/g)&&(e=y(this.entities.comparison))&&(r=y(this.entities.variable)||y(this.entities.dimension))&&y("]"))return new t.Tree.Zoom(e,r,a);p()},block:function(){var t;if(y("{")&&(t=y(this.primary))&&y("}"))return t},ruleset:function(){var e,r,n=[];for(h();e=y(this.selector);){for(n.push(e);y(this.comment););if(!y(","))break;for(;y(this.comment););}if(e)for(;y(this.comment););if(n.length>0&&(r=y(this.block))){if(1===n.length&&n[0].elements.length&&"Map"===n[0].elements[0].value){var i=new t.Tree.Ruleset(n,r);return i.isMap=!0,i}return new t.Tree.Ruleset(n,r)}p()},rule:function(){var i,o,u=r.charAt(n);if(h(),"."!==u&&"#"!==u&&(i=y(this.variable)||y(this.property))){if((o=y(this.value))&&y(this.end))return new t.Tree.Rule(i,o,a,e.filename);s=n,p()}},font:function(){for(var e,r=[],n=[];e=y(this.entity);)n.push(e);if(r.push(new t.Tree.Expression(n)),y(","))for(;(e=y(this.expression))&&(r.push(e),y(",")););return new t.Tree.Value(r)},value:function(){for(var e,r=[];(e=y(this.expression))&&(r.push(e),y(",")););return r.length>1?new t.Tree.Value(r.map(function(t){return t.value[0]})):1===r.length?new t.Tree.Value(r):void 0},sub:function(){var t;if(y("(")&&(t=y(this.expression))&&y(")"))return t},multiplication:function(){var e,r,n,i;if(e=y(this.operand)){for(;(n=y("/")||y("*")||y("%"))&&(r=y(this.operand));)i=new t.Tree.Operation(n,[i||e,r],a);return i||e}},addition:function(){var e,i,o,s;if(e=y(this.multiplication)){for(;(o=y(/^[-+]\s+/)||" "!=r.charAt(n-1)&&(y("+")||y("-")))&&(i=y(this.multiplication));)s=new t.Tree.Operation(o,[s||e,i],a);return s||e}},operand:function(){return y(this.sub)||y(this.entity)},expression:function(){for(var e,r=[];e=y(this.addition)||y(this.entity);)r.push(e);if(r.length>0)return new t.Tree.Expression(r)},property:function(){var t=y(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(t)return t[1]}}}}},{key:"parse",value:function(t){var e=this.parser;return this.ruleSet=e.parse(t)}},{key:"toShaders",value:function(){if(this.ruleSet){var t=this.ruleSet;if(t){var e=t.toList(this.env);e.reverse();var r={},n=[];this._toShaders(r,n,e);for(var i=[],o={},a=0,s=e.length;a=0){if(!e.featureFilter){var o=i+n.length,a=r.indexOf(")",o+1),s="featureId&&(featureId"+r.substring(o,a)+")";Object.defineProperty(e,"featureFilter",{configurable:!0,enumerable:!1,value:function(t){return!!s}})}return{property:p,getValue:Function("attributes","zoom","seftFilter","var _value = null; var isExcute=typeof seftFilter=='function'?sefgFilter():seftFilter;if(isExcute){"+r+";} return _value; ")}}return{property:p,getValue:Function("attributes","zoom","var _value = null;"+r+"; return _value; ")}}(c[p],f);Object.defineProperty(f,"attachment",{configurable:!0,enumerable:!1,value:l}),Object.defineProperty(f,"elements",{configurable:!0,enumerable:!1,value:u.elements}),i.push(f),o[n[a]]=!0}Object.defineProperty(f,"zoom",{configurable:!0,enumerable:!1,value:u.zoom})}return i}}return null}},{key:"_toShaders",value:function(e,r,n){for(var i=0,o=n.length;i= minzoom - 1e-6 and scale < maxzoom + 1e-6"},maxzoom:{"default-value":"1.79769e+308",type:"float","default-meaning":"The layer will be visible at the maximum possible scale",doc:"The maximum scale denominator that this layer will be visible at. The default is the numeric limit of the C++ double type, which may vary slightly by system, but is likely a massive number like 1.79769e+308 and ensures that this layer will always be visible unless the value is reduced. A layer's visibility is determined by whether its status is true and if the Map scale >= minzoom - 1e-6 and scale < maxzoom + 1e-6"},queryable:{"default-value":!1,type:"boolean","default-meaning":"The layer will not be available for the direct querying of data values",doc:"This property was added for GetFeatureInfo/WMS compatibility and is rarely used. It is off by default meaning that in a WMS context the layer will not be able to be queried unless the property is explicitly set to true"},"clear-label-cache":{"default-value":!1,type:"boolean","default-meaning":"The renderer's collision detector cache (used for avoiding duplicate labels and overlapping markers) will not be cleared immediately before processing this layer",doc:"This property, by default off, can be enabled to allow a user to clear the collision detector cache before a given layer is processed. This may be desirable to ensure that a given layers data shows up on the map even if it normally would not because of collisions with previously rendered labels or markers"},"group-by":{"default-value":"",type:"string","default-meaning":"No special layer grouping will be used during rendering",doc:"https://github.com/mapnik/mapnik/wiki/Grouped-rendering"},"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"maximum-extent":{"default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query this specific layer data during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Layer."}},symbolizers:{"*":{"image-filters":{css:"image-filters","default-value":"none","default-meaning":"no filters",type:"functions",functions:[["agg-stack-blur",2],["emboss",0],["blur",0],["gray",0],["sobel",0],["edge-detect",0],["x-gradient",0],["y-gradient",0],["invert",0],["sharpen",0]],doc:"A list of image filters."},"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]},opacity:{css:"opacity",type:"float",doc:"An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer)","default-value":1,"default-meaning":"no separate buffer will be used and no alpha will be applied to the style after rendering"}},map:{"background-color":{css:"background-color","default-value":"none","default-meaning":"transparent",type:"color",doc:"Map Background color"},"background-image":{css:"background-image",type:"uri","default-value":"","default-meaning":"transparent",doc:"An image that is repeated below all features on a map as a background.",description:"Map Background image"},srs:{css:"srs",type:"string","default-value":"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs","default-meaning":"The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space",doc:"Map spatial reference (proj4 string)"},"buffer-size":{css:"buffer-size","default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:'Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges".'},"maximum-extent":{css:"","default-value":"none",type:"bbox","default-meaning":"No clipping extent will be used",doc:"An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map."},base:{css:"base","default-value":"","default-meaning":"This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.",type:"string",doc:"Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet."},"paths-from-xml":{css:"","default-value":!0,"default-meaning":"Paths read from XML will be interpreted from the location of the XML",type:"boolean",doc:"value to control whether paths in the XML will be interpreted from the location of the XML or from the working directory of the program that calls load_map()"},"minimum-version":{css:"","default-value":"none","default-meaning":"Mapnik version will not be detected and no error will be thrown about compatibility",type:"string",doc:"The minumum Mapnik version (e.g. 0.7.2) needed to use certain functionality in the stylesheet"},"font-directory":{css:"font-directory",type:"uri","default-value":"none","default-meaning":"No map-specific fonts will be registered",doc:"Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered)."}},polygon:{fill:{css:"polygon-fill",type:"color","default-value":"rgba(128,128,128,1)","default-meaning":"gray and fully opaque (alpha = 1), same as rgb(128,128,128)",doc:"Fill color to assign to a polygon"},"fill-opacity":{css:"polygon-opacity",type:"float",doc:"The opacity of the polygon","default-value":1,"default-meaning":"opaque"},gamma:{css:"polygon-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon edges"},"gamma-method":{css:"polygon-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},clip:{css:"polygon-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},line:{stroke:{css:"line-color","default-value":"rgba(0,0,0,1)",type:"color","default-meaning":"black and fully opaque (alpha = 1), same as rgb(0,0,0)",doc:"The color of a drawn line"},"stroke-width":{css:"line-width","default-value":1,type:"float",doc:"The width of a line in pixels"},"stroke-opacity":{css:"line-opacity","default-value":1,type:"float","default-meaning":"opaque",doc:"The opacity of a line"},"stroke-linejoin":{css:"line-join","default-value":"miter",type:["miter","round","bevel"],doc:"The behavior of lines when joining"},"stroke-linecap":{css:"line-cap","default-value":"butt",type:["butt","round","square"],doc:"The display of line endings"},"stroke-gamma":{css:"line-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of stroke line"},"stroke-gamma-method":{css:"line-gamma-method",type:["power","linear","none","threshold","multiply"],"default-value":"power","default-meaning":"pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA",doc:"An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h"},"stroke-dasharray":{css:"line-dasharray",type:"numbers",doc:"A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns.","default-value":"none","default-meaning":"solid line"},"stroke-dashoffset":{css:"line-dash-offset",type:"numbers",doc:"valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled)","default-value":"none","default-meaning":"solid line"},"stroke-miterlimit":{css:"line-miterlimit",type:"float",doc:"The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts.","default-value":4,"default-meaning":"Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'"},clip:{css:"line-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},offset:{css:"line-offset",type:"float","default-value":0,"default-meaning":"no offset",doc:"Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line)."},rasterizer:{css:"line-rasterizer",type:["full","fast"],"default-value":"full",doc:"Exposes an alternate AGG rendering method that sacrifices some accuracy for speed."},"geometry-transform":{css:"line-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},markers:{file:{css:"marker-file",doc:"An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse.","default-value":"","default-meaning":"An ellipse or circle, if width equals height",type:"uri"},opacity:{css:"marker-opacity",doc:"The overall opacity of the marker, if set, overrides both the opacity of both the fill and stroke","default-value":1,"default-meaning":"The stroke-opacity and fill-opacity will be used",type:"float"},"fill-opacity":{css:"marker-fill-opacity",doc:"The fill opacity of the marker","default-value":1,"default-meaning":"opaque",type:"float"},stroke:{css:"marker-line-color",doc:"The color of the stroke around a marker shape.","default-value":"black",type:"color"},"stroke-width":{css:"marker-line-width",doc:"The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself.",type:"float"},"stroke-opacity":{css:"marker-line-opacity","default-value":1,"default-meaning":"opaque",doc:"The opacity of a line",type:"float"},placement:{css:"marker-placement",type:["point","line","interior"],"default-value":"point","default-meaning":"Place markers at the center point (centroid) of the geometry",doc:"Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior"},"multi-policy":{css:"marker-multi-policy",type:["each","whole","largest"],"default-value":"each","default-meaning":"If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each",doc:"A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default)."},"marker-type":{css:"marker-type",type:["arrow","ellipse"],"default-value":"ellipse",doc:"The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width)"},width:{css:"marker-width","default-value":10,doc:"The width of the marker, if using one of the default types.",type:"expression"},height:{css:"marker-height","default-value":10,doc:"The height of the marker, if using one of the default types.",type:"expression"},fill:{css:"marker-fill","default-value":"blue",doc:"The color of the area of the marker.",type:"color"},"allow-overlap":{css:"marker-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping markers are shown or hidden.","default-meaning":"Do not allow makers to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"marker-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},spacing:{css:"marker-spacing",doc:"Space between repeated labels","default-value":100,type:"float"},"max-error":{css:"marker-max-error",type:"float","default-value":.2,doc:"The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers."},transform:{css:"marker-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},clip:{css:"marker-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"marker-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"marker-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"marker-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},shield:{name:{css:"shield-name",type:"expression",serialization:"content",doc:'Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]'},file:{css:"shield-file",required:!0,type:"uri","default-value":"none",doc:"Image file to render behind the shield text"},"face-name":{css:"shield-face-name",type:"string",validate:"font",doc:"Font name and style to use for the shield text","default-value":"",required:!0},"unlock-image":{css:"shield-unlock-image",type:"boolean",doc:"This parameter should be set to true if you are trying to position text beside rather than on top of the shield image","default-value":!1,"default-meaning":"text alignment relative to the shield image uses the center of the image as the anchor for text positioning."},size:{css:"shield-size",type:"float",doc:"The size of the shield text in pixels"},fill:{css:"shield-fill",type:"color",doc:"The color of the shield text"},placement:{css:"shield-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons."},"avoid-edges":{css:"shield-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.",type:"boolean","default-value":!1},"allow-overlap":{css:"shield-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"line-pattern":{file:{css:"line-pattern-file",type:"uri","default-value":"none",required:!0,doc:"An image file to be repeated and warped along a line"},clip:{css:"line-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"line-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"line-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"line-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},"polygon-pattern":{file:{css:"polygon-pattern-file",type:"uri","default-value":"none",required:!0,doc:"Image to use as a repeated pattern fill within a polygon"},alignment:{css:"polygon-pattern-alignment",type:["local","global"],"default-value":"local",doc:"Specify whether to align pattern fills to the layer or to the map."},gamma:{css:"polygon-pattern-gamma",type:"float","default-value":1,"default-meaning":"fully antialiased",range:"0-1",doc:"Level of antialiasing of polygon pattern edges"},opacity:{css:"polygon-pattern-opacity",type:"float",doc:"(Default 1.0) - Apply an opacity level to the image used for the pattern","default-value":1,"default-meaning":"The image is rendered without modifications"},clip:{css:"polygon-pattern-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},smooth:{css:"polygon-pattern-smooth",type:"float","default-value":0,"default-meaning":"no smoothing",range:"0-1",doc:"Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries."},"geometry-transform":{css:"polygon-pattern-geometry-transform",type:"functions","default-value":"none","default-meaning":"geometry will not be transformed",doc:"Allows transformation functions to be applied to the geometry.",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]]},"comp-op":{css:"polygon-pattern-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},raster:{opacity:{css:"raster-opacity","default-value":1,"default-meaning":"opaque",type:"float",doc:"The opacity of the raster symbolizer on top of other symbolizers."},"filter-factor":{css:"raster-filter-factor","default-value":-1,"default-meaning":"Allow the datasource to choose appropriate downscaling.",type:"float",doc:"This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed."},scaling:{css:"raster-scaling",type:["near","fast","bilinear","bilinear8","bicubic","spline16","spline36","hanning","hamming","hermite","kaiser","quadric","catrom","gaussian","bessel","mitchell","sinc","lanczos","blackman"],"default-value":"near",doc:"The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality."},"mesh-size":{css:"raster-mesh-size","default-value":16,"default-meaning":"Reprojection mesh will be 1/16 of the resolution of the source image",type:"unsigned",doc:"A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion."},"comp-op":{css:"raster-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},point:{file:{css:"point-file",type:"uri",required:!1,"default-value":"none",doc:"Image file to represent a point"},"allow-overlap":{css:"point-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping points are shown or hidden.","default-meaning":"Do not allow points to overlap with each other - overlapping markers will not be shown."},"ignore-placement":{css:"point-ignore-placement",type:"boolean","default-value":!1,"default-meaning":"do not store the bbox of this geometry in the collision detector cache",doc:"value to control whether the placement of the feature will prevent the placement of other features"},opacity:{css:"point-opacity",type:"float","default-value":1,"default-meaning":"Fully opaque",doc:"A value from 0 to 1 to control the opacity of the point"},placement:{css:"point-placement",type:["centroid","interior"],doc:"How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon.","default-value":"centroid"},transform:{css:"point-transform",type:"functions",functions:[["matrix",6],["translate",2],["scale",2],["rotate",3],["skewX",1],["skewY",1]],"default-value":"","default-meaning":"No transformation",doc:"SVG transformation definition"},"comp-op":{css:"point-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},text:{name:{css:"text-name",type:"expression",required:!0,"default-value":"",serialization:"content",doc:"Value to use for a text label. Data columns are specified using brackets like [column_name]"},"face-name":{css:"text-face-name",type:"string",validate:"font",doc:"Font name and style to render a label in",required:!0},size:{css:"text-size",type:"float","default-value":10,doc:"Text size in pixels"},"text-ratio":{css:"text-ratio",doc:"Define the amount of text (of the total) present on successive lines when wrapping occurs","default-value":0,type:"unsigned"},"wrap-width":{css:"text-wrap-width",doc:"Length of a chunk of text in characters before wrapping text","default-value":0,type:"unsigned"},"wrap-before":{css:"text-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"text-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long text."},spacing:{css:"text-spacing",type:"unsigned",doc:"Distance between repeated text labels on a line (aka. label-spacing)"},"character-spacing":{css:"text-character-spacing",type:"float","default-value":0,doc:"Horizontal spacing adjustment between characters in pixels"},"line-spacing":{css:"text-line-spacing","default-value":0,type:"unsigned",doc:"Vertical spacing adjustment between lines in pixels"},"label-position-tolerance":{css:"text-label-position-tolerance","default-value":0,type:"unsigned",doc:"Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line)"},"max-char-angle-delta":{css:"text-max-char-angle-delta",type:"float","default-value":"22.5",doc:"The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners."},fill:{css:"text-fill",doc:"Specifies the color for the text","default-value":"#000000",type:"color"},opacity:{css:"text-opacity",doc:"A number from 0 to 1 specifying the opacity for the text","default-value":1,"default-meaning":"Fully opaque",type:"float"},"halo-fill":{css:"text-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"text-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},dx:{css:"text-dx",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"text-dy",type:"float",doc:"Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"vertical-alignment":{css:"text-vertical-alignment",type:["top","middle","bottom","auto"],doc:"Position of label relative to point position.","default-value":"auto","default-meaning":'Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.'},"avoid-edges":{css:"text-avoid-edges",doc:"Tell positioning algorithm to avoid labeling near intersection edges.","default-value":!1,type:"boolean"},"minimum-distance":{css:"text-min-distance",doc:"Minimum permitted distance to the next text symbolizer.",type:"float"},"minimum-padding":{css:"text-min-padding",doc:"Determines the minimum amount of padding that a text symbolizer gets relative to other text",type:"float"},"minimum-path-length":{css:"text-min-path-length",type:"float","default-value":0,"default-meaning":"place labels on all paths",doc:"Place labels only on paths longer than this value."},"allow-overlap":{css:"text-allow-overlap",type:"boolean","default-value":!1,doc:"Control whether overlapping text is shown or hidden.","default-meaning":"Do not allow text to overlap with other text - overlapping markers will not be shown."},orientation:{css:"text-orientation",type:"expression",doc:"Rotate the text."},placement:{css:"text-placement",type:["point","line","vertex","interior"],"default-value":"point",doc:"Control the style of placement of a point versus the geometry it is attached to."},"placement-type":{css:"text-placement-type",doc:'Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off.',type:["dummy","simple"],"default-value":"dummy"},placements:{css:"text-placements",type:"string","default-value":"",doc:'If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is `text-placements: "E,NE,SE,W,NW,SW";` '},"text-transform":{css:"text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"horizontal-alignment":{css:"text-horizontal-alignment",type:["left","middle","right","auto"],doc:"The text's horizontal alignment from its centerpoint","default-value":"auto"},"justify-alignment":{css:"text-align",type:["left","right","center","auto"],doc:"Define how text is justified","default-value":"auto","default-meaning":"Auto alignment means that text will be centered by default except when using the `placement-type` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the `text-placements` directives"},clip:{css:"text-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"text-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus","minus","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","contrast","invert","invert-rgb","grain-merge","grain-extract","hue","saturation","color","value"]}},building:{fill:{css:"building-fill","default-value":"#FFFFFF",doc:"The color of the buildings walls.",type:"color"},"fill-opacity":{css:"building-fill-opacity",type:"float",doc:"The opacity of the building as a whole, including all walls.","default-value":1},height:{css:"building-height",doc:"The height of the building in pixels.",type:"expression","default-value":"0"}}},colors:{aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50],transparent:[0,0,0,0]},filter:{value:["true","false","null","point","linestring","polygon","collection"]}};function hkt(t){"@babel/helpers - typeof";return(hkt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pkt(t,e){for(var r=0;r1&&(e=arguments[1]),arguments.length>2&&(r=arguments[2]),{is:"tag",val:t,color:e,mode:r,toString:function(n){return'\n\t"}}},hsl:function(t,e,r){return this.hsla(t,e,r,1)},hsla:function(t,e,r,n){if([t=this.number(t)%360/360,e=this.number(e),r=this.number(r),n=this.number(n)].some(isNaN))return null;var i=r<=.5?r*(e+1):r+e-r*e,o=2*r-i;return this.rgba(255*a(t+1/3),255*a(t),255*a(t-1/3),n);function a(t){return 6*(t=t<0?t+1:t>1?t-1:t)<1?o+(i-o)*t*6:2*t<1?i:3*t<2?o+(i-o)*(2/3-t)*6:o}},hue:function(t){return"toHSL"in t?new ckt.Tree.Dimension(Math.round(t.toHSL().h)):null},saturation:function(t){return"toHSL"in t?new ckt.Tree.Dimension(Math.round(100*t.toHSL().s),"%"):null},lightness:function(t){return"toHSL"in t?new ckt.Tree.Dimension(Math.round(100*t.toHSL().l),"%"):null},alpha:function(t){return"toHSL"in t?new ckt.Tree.Dimension(t.toHSL().a):null},saturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s+=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},desaturate:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.s-=e.value/100,r.s=this.clamp(r.s),this.hsla_simple(r)},lighten:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l+=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},darken:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.l-=e.value/100,r.l=this.clamp(r.l),this.hsla_simple(r)},fadein:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a+=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},fadeout:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL();return r.a-=e.value/100,r.a=this.clamp(r.a),this.hsla_simple(r)},spin:function(t,e){if(!("toHSL"in t))return null;var r=t.toHSL(),n=(r.h+e.value)%360;return r.h=n<0?360+n:n,this.hsla_simple(r)},replace:function(t,e,r){return"field"===t.is?t.toString+".replace("+e.toString()+", "+r.toString()+")":t.replace(e,r)},mix:function(t,e,r){var n=r.value/100,i=2*n-1,o=t.toHSL().a-e.toHSL().a,a=((i*o==-1?i:(i+o)/(1+i*o))+1)/2,s=1-a,u=[t.rgb[0]*a+e.rgb[0]*s,t.rgb[1]*a+e.rgb[1]*s,t.rgb[2]*a+e.rgb[2]*s],l=t.alpha*n+e.alpha*(1-n);return new ckt.Tree.Color(u,l)},greyscale:function(t){return this.desaturate(t,new ckt.Tree.Dimension(100))},"%":function(t){for(var e=Array.prototype.slice.call(arguments,1),r=t.value,n=0;n.5?l/(2-a-s):l/(a+s),a){case r:t=(n-i)/l+(n=0){if(!t.ppi)return t.error({message:"ppi is not set, so metric units can't be used",index:this.index}),{is:"undefined",value:"undefined"};this.value=this.value/this.densities[this.unit]*t.ppi,this.unit="px"}return this}},{key:"toColor",value:function(){return new ckt.Tree.Color([this.value,this.value,this.value])}},{key:"round",value:function(){return this.value=Math.round(this.value),this}},{key:"toString",value:function(){return this.value.toString()}},{key:"operate",value:function(t,e,r){return"%"===this.unit&&"%"!==r.unit?(t.error({message:"If two operands differ, the first must not be %",index:this.index}),{is:"undefined",value:"undefined"}):"%"!==this.unit&&"%"===r.unit?"*"===e||"/"===e||"%"===e?(t.error({message:"Percent values can only be added or subtracted from other values",index:this.index}),{is:"undefined",value:"undefined"}):new ckt.Tree.Dimension(ckt.Tree.operate(e,this.value,this.value*r.value*.01),this.unit):new ckt.Tree.Dimension(ckt.Tree.operate(e,this.value,r.value),this.unit||r.unit)}}])}(),ckt.Tree.Element=function(){return ukt(function t(e){akt(this,t),this.value=e.trim(),"#"===this.value[0]&&(this.type="id",this.clean=this.value.replace(/^#/,"")),"."===this.value[0]&&(this.type="class",this.clean=this.value.replace(/^\./,"")),-1!==this.value.indexOf("*")&&(this.type="wildcard")},[{key:"specificity",value:function(){return["id"===this.type?1:0,"class"===this.type?1:0]}},{key:"toString",value:function(){return this.value}}])}(),ckt.Tree.Expression=function(){return ukt(function t(e){akt(this,t),this.is="expression",this.value=e},[{key:"ev",value:function(t){return this.value.length>1?new ckt.Tree.Expression(this.value.map(function(e){return e.ev(t)})):this.value[0].ev(t)}},{key:"toString",value:function(t){return this.value.map(function(e){return e.toString(t)}).join(" ")}}])}(),ckt.Tree.Field=function(){return ukt(function t(e){akt(this,t),this.is="field",this.value=e||""},[{key:"toString",value:function(){return'["'+this.value.toUpperCase()+'"]'}},{key:"ev",value:function(){return this}}])}(),ckt.Tree.Filter=function(){return ukt(function t(e,r,n,i,o){akt(this,t),this.ops={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]},this.key=e,this.op=r,this.val=n,this.index=i,this.filename=o,this.id=this.key+this.op+this.val},[{key:"ev",value:function(t){return this.key=this.key.ev(t),this.val=this.val.ev(t),this}},{key:"toString",value:function(){return"["+this.id+"]"}}])}(),ckt.Tree.Filterset=function(){return ukt(function t(){akt(this,t),this.filters={}},[{key:"toJS",value:function(t){function e(t){var e=t.op;"="===e&&(e="==");var r=t.val;void 0!==t._val&&(r=t._val.toString(!0)),t.key&&"scale"===t.key.value?r=+r:"string"!=typeof r&&"object"!==okt(r)||(r="'"+r+"'");var n="attributes";return n+"&&"+n+t.key+"&&"+n+t.key+" "+e+r}var r=[];for(var n in this.filters)r.push(e(this.filters[n]));return r.join(" && ")}},{key:"toString",value:function(){var t=[];for(var e in this.filters)t.push(this.filters[e].id);return t.sort().join("\t")}},{key:"ev",value:function(t){for(var e in this.filters)this.filters[e].ev(t);return this}},{key:"clone",value:function(){var t=new ckt.Tree.Filterset;for(var e in this.filters)t.filters[e]=this.filters[e];return t}},{key:"cloneWith",value:function(t){var e=[];for(var r in t.filters){var n=this.addable(t.filters[r]);if(!1===n)return!1;!0===n&&e.push(t.filters[r])}if(!e.length)return null;var i=new ckt.Tree.Filterset;for(r in this.filters)i.filters[r]=this.filters[r];for(;r=e.shift();)i.add(r);return i}},{key:"addable",value:function(t){var e=t.key.toString(),r=t.val.toString();switch(r.match(/^[0-9]+(\.[0-9]*)?_match/)&&(r=parseFloat(r)),t.op){case"=":return void 0!==this.filters[e+"="]?this.filters[e+"="].val.toString()==r&&null:void 0===this.filters[e+"!="+r]&&(!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val"]&&this.filters[e+">"].val>=r?null:void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val":return e+"="in this.filters?!(this.filters[e+"="].val<=r)&&null:!(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r)&&(!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)&&(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)||null));case">=":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val"]&&this.filters[e+">"].val>=r?null:!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)||null));case"<":return void 0!==this.filters[e+"="]?!(this.filters[e+"="].val>=r)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>=r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].valr)&&null:!(void 0!==this.filters[e+">"]&&this.filters[e+">"].val>=r)&&(!(void 0!==this.filters[e+">="]&&this.filters[e+">="].val>r)&&(void 0!==this.filters[e+"<"]&&this.filters[e+"<"].val<=r?null:!(void 0!==this.filters[e+"<="]&&this.filters[e+"<="].val<=r)||null))}}},{key:"conflict",value:function(t){var e=t.key.toString(),r=t.val.toString();return isNaN(parseFloat(r))||(r=parseFloat(r)),("="===t.op&&void 0!==this.filters[e+"="]&&r!=this.filters[e+"="].val.toString()||"!="===t.op&&void 0!==this.filters[e+"="]&&r==this.filters[e+"="].val.toString()||"="===t.op&&void 0!==this.filters[e+"!="]&&r===this.filters[e+"!="].val.toString())&&t.toString()+" added to "+this.toString()+" produces an invalid filter"}},{key:"add",value:function(t,e){var r,n=t.key.toString(),i=t.op,o=this.conflict(t);if(o)return o;if("="===i){for(var a in this.filters)this.filters[a].key===n&&delete this.filters[a];this.filters[n+"="]=t}else if("!="===i)this.filters[n+"!="+t.val]=t;else if("=~"===i)this.filters[n+"=~"+t.val]=t;else if(">"===i){for(var s in this.filters)this.filters[s].key===n&&this.filters[s].val<=t.val&&delete this.filters[s];this.filters[n+">"]=t}else if(">="===i){for(var u in this.filters)r=+this.filters[u].val.toString(),this.filters[u].key===n&&r",this.filters[n+">"]=t):this.filters[n+">="]=t}else if("<"===i){for(var l in this.filters)r=+this.filters[l].val.toString(),this.filters[l].key===n&&r>=t.val&&delete this.filters[l];this.filters[n+"<"]=t}else if("<="===i){for(var c in this.filters)r=+this.filters[c].val.toString(),this.filters[c].key===n&&r>t.val&&delete this.filters[c];void 0!==this.filters[n+"!="+t.val]?(delete this.filters[n+"!="+t.val],t.op="<",this.filters[n+"<"]=t):this.filters[n+"<="]=t}}}])}(),ckt.Tree.Fontset=ukt(function t(e,r){akt(this,t),this.fonts=r,this.name="fontset-"+e.effects.length}),ckt.Tree.Invalid=function(){return ukt(function t(e,r,n){akt(this,t),this.is="invalid",this.chunk=e,this.index=r,this.type="syntax",this.message=n||"Invalid code: "+this.chunk},[{key:"ev",value:function(t){return t.error({chunk:this.chunk,index:this.index,type:"syntax",message:this.message||"Invalid code: "+this.chunk}),{is:"undefined"}}}])}(),ckt.Tree.Keyword=function(){return ukt(function t(e){akt(this,t),this.value=e;var r={transparent:"color",true:"boolean",false:"boolean"};this.is=r[e]?r[e]:"keyword"},[{key:"ev",value:function(){return this}},{key:"toString",value:function(){return this.value}}])}(),ckt.Tree.Literal=function(){return ukt(function t(e){akt(this,t),this.value=e||"",this.is="field"},[{key:"toString",value:function(){return this.value}},{key:"ev",value:function(){return this}}])}(),ckt.Tree.Operation=function(){return ukt(function t(e,r,n){akt(this,t),this.is="operation",this.op=e.trim(),this.operands=r,this.index=n},[{key:"ev",value:function(t){var e,r=this.operands[0].ev(t),n=this.operands[1].ev(t);return"undefined"===r.is||"undefined"===n.is?{is:"undefined",value:"undefined"}:(r instanceof ckt.Tree.Dimension&&n instanceof ckt.Tree.Color&&("*"===this.op||"+"===this.op?(e=n,n=r,r=e):t.error({name:"OperationError",message:"Can't substract or divide a color from a number",index:this.index})),r instanceof ckt.Tree.Quoted&&n instanceof ckt.Tree.Quoted&&"+"!==this.op?(t.error({message:"Can't subtract, divide, or multiply strings.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r instanceof ckt.Tree.Field||n instanceof ckt.Tree.Field||r instanceof ckt.Tree.Literal||n instanceof ckt.Tree.Literal?"color"===r.is||"color"===n.is?(t.error({message:"Can't subtract, divide, or multiply colors in expressions.",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):new ckt.Tree.Literal(r.ev(t).toString(!0)+this.op+n.ev(t).toString(!0)):void 0===r.operate?(t.error({message:"Cannot do math with type "+r.is+".",index:this.index,type:"runtime",filename:this.filename}),{is:"undefined",value:"undefined"}):r.operate(t,this.op,n))}}])}(),ckt.Tree.Quoted=function(){return ukt(function t(e){akt(this,t),this.is="string",this.value=e||""},[{key:"toString",value:function(t){var e=this.value.replace(/&/g,"&"),r=e.replace(/\'/g,"\\'").replace(/\"/g,""").replace(//g,">");return!0===t?"'"+r+"'":e}},{key:"ev",value:function(){return this}},{key:"operate",value:function(t,e,r){return new ckt.Tree.Quoted(ckt.Tree.operate(e,this.toString(),r.toString(this.contains_field)))}}])}(),ckt.Tree.Reference={_validateValue:{font:function(t,e){return!t.validation_data||!t.validation_data.fonts||-1!=t.validation_data.fonts.indexOf(e)}},setData:function(t){this.data=t,this.selector_cache=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])t.symbolizers[r][n].hasOwnProperty("css")&&(e[t.symbolizers[r][n].css]=[t.symbolizers[r][n],r,n]);return e}(t),this.mapnikFunctions=function(t){var e={};for(var r in t.symbolizers)for(var n in t.symbolizers[r])if("functions"===t.symbolizers[r][n].type)for(var i=0;i1?Array.prototype.push.apply(r,n.find(new ckt.Tree.Selector(null,null,t.elements.slice(1)),e)):r.push(n);break}}),this._lookups[n]=r)}},{key:"evZooms",value:function(t){for(var e=0;eckt.Tree.Zoom.maxZoom||e<0)&&t.error({message:"Only zoom levels between 0 and "+ckt.Tree.Zoom.maxZoom+" supported.",index:this.index}),this.op){case"=":return this.zoom="zoom && zoom === "+e,this;case">":this.zoom="zoom && zoom > "+e;break;case">=":this.zoom="zoom && zoom >= "+e;break;case"<":this.zoom="zoom && zoom < "+e;break;case"<=":this.zoom="zoom && zoom <= "+e}return this}},{key:"toString",value:function(){for(var t="",e=0;e<=ckt.Tree.Zoom.maxZoom;e++)t+=this.zoom&1<=l[2]||l[1]<=l[3])&&(this.DVBOrigonPoint=[l[0],l[3]],this.DVBWidth=Math.abs(l[2]-l[0]),this.DVBHeight=Math.abs(l[1]-l[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-a[0],this.DVBOrigonPoint[1]-a[1]],!0)}},{key:"resetLocation",value:function(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var r=this.width,n=this.height,i=this.location;return this.chartBounds=new ye(i[0]-r/2,i[1]+n/2,i[0]+r/2,i[1]-n/2),this.resetLinearGradient(),i}},{key:"resetLinearGradient",value:function(){}},{key:"shapesConvertToRelativeCoordinate",value:function(){for(var t=this.shapes,e=this.location,r=0,n=t.length;r=0?n.push(parseFloat(i[a].toString()).toFixed(r)):n.push(parseFloat(i[a].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};var Mkt=function(t){function e(t,r,n,i,o){var a;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(a=Ckt(this,e,[t,r,n,i,o])).CLASS_NAME="SuperMap.Feature.Theme.Bar",a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pkt(t,e)}(e,Skt),r=e,(n=[{key:"destroy",value:function(){Okt(Akt(e.prototype),"destroy",this).call(this)}},{key:"assembleShapes",value:function(){var t={showShadow:!0,shadowBlur:8,shadowColor:"rgba(100,100,100,0.8)",shadowOffsetX:2,shadowOffsetY:2},e=this.setting;if(e.barLinearGradient||(e.barLinearGradient=[["#00FF00","#00CD00"],["#00CCFF","#5E87A2"],["#00FF66","#669985"],["#CCFF00","#94A25E"],["#FF9900","#A2945E"]]),e.dataViewBoxParameter||(void 0===e.useAxis||e.useAxis?e.dataViewBoxParameter=[45,15,15,15]:e.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var r=this.DVBCodomain;this.DVBUnitValue=(r[1]-r[0])/this.DVBHeight;var n=this.dataViewBox,i=this.dataValues;if(!(i.length<1)){for(var o=0,a=i.length;or[1])return;var s=this.calculateXShapeInfo();if(s){var u=s.xPositions,l=s.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(Gc.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(Gc.GraphAxis(this.shapeFactory,n,e,s)));for(var c=0;c=e.length&&(r%=e.length);var u=e[r][0],l=e[r][1],c=(new Io).getLinearGradient(a,0,s,0,[[0,u],[1,l]]);i.style.color=c}}}}])&&kkt(r.prototype,n),i&&kkt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Ikt(t){"@babel/helpers - typeof";return(Ikt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lkt(t,e){for(var r=0;re[1])return;var a=this.calculateXShapeInfo();if(a){var s=a.xPositions,u=a.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Gc.Background(this.shapeFactory,this.chartBox,t)),(!t.axis3DParameter||isNaN(t.axis3DParameter)||t.axis3DParameter<15)&&(t.axis3DParameter=20),(void 0===t.useAxis||t.useAxis)&&(this.shapes=this.shapes.concat(Gc.GraphAxis(this.shapeFactory,r,t,a)));for(var l=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10,c=0;c=s[2]||s[1]<=s[3])&&(this.DVBOrigonPoint=[s[0],s[3]],this.DVBWidth=Math.abs(s[2]-s[0]),this.DVBHeight=Math.abs(s[1]-s[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-i[0],this.DVBOrigonPoint[1]-i[1]],!0)}}])&&Gkt(r.prototype,n),i&&Gkt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function Xkt(t){"@babel/helpers - typeof";return(Xkt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Zkt(t,e){for(var r=0;r0?this.DVBUnitValue=t.maxR/(i[1]-i[0]):this.DVBUnitValue=t.maxR;var o=this.DVBUnitValue,a=n[0]*o+t.minR;if(this.width=2*a,this.height=2*a,this.initBaseParameter()&&(!i||!(n[0]i[1]))){var s=this.DVBCenterPoint,u=new Nl(s[0],s[1],a);u.style=Gc.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?u.style.fillColor=t.fillColor:u.style.fillColor="#ff9277",u.highlightStyle=Gc.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(u.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(u.clickable=t.circleClickAble),u.refDataID=this.data.id,u.dataInfo={field:this.fields[0],r:a,value:n[0]},this.shapes.push(this.shapeFactory.createShape(u)),this.shapesConvertToRelativeCoordinate()}}}])&&Zkt(r.prototype,n),i&&Zkt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function rTt(t){"@babel/helpers - typeof";return(rTt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nTt(t,e){for(var r=0;rr[1])return null;a=u[f],s=e[1]-(i[f]-r[0])/n;var p=new Lu(a,s);p.style=Gc.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,f,i[f]),p.highlightStyle=Gc.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(p.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(p.clickable=t.pointClickAble),p.refDataID=this.data.id,p.dataInfo={field:this.fields[f],value:i[f]},c.push(this.shapeFactory.createShape(p));var d=[a,s];l.push(d)}var y=new Gu(l);y.style=Gc.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),y.clickable=!1,y.hoverable=!1;var v=this.shapeFactory.createShape(y);this.shapes.push(v),this.shapes=this.shapes.concat(c),this.shapesConvertToRelativeCoordinate()}}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],o=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=o-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=o/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var o=0,a=0;a=360&&(c=359.9999999);var y=new fl(u[0],u[1],h,l,c);if(void 0===t.sectorStyleByFields){var v=p%e.length;y.style=Gc.ShapeStyleTool(null,t.sectorStyle,e,null,v)}else y.style=Gc.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,p,r[p]);y.highlightStyle=Gc.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(y.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(y.clickable=t.sectorClickAble),y.refDataID=this.data.id,y.dataInfo={field:this.fields[p],value:r[p]},this.shapes.push(this.shapeFactory.createShape(y)),l=c}this.shapesConvertToRelativeCoordinate()}}}}])&&fTt(r.prototype,n),i&&fTt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function mTt(t){"@babel/helpers - typeof";return(mTt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bTt(t,e){for(var r=0;rr[1])return null;a=u[l],s=e[1]-(i[l]-r[0])/n;var f=new Lu(a,s);f.style=Gc.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,l,i[l]),f.highlightStyle=Gc.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(f.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(f.clickable=t.pointClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[l],value:i[l]},this.shapes.push(this.shapeFactory.createShape(f))}this.shapesConvertToRelativeCoordinate()}}}},{key:"calculateXShapeInfo",value:function(){var t,e=this.dataViewBox,r=this.setting,n=this.dataValues.length;if(n<1)return null;var i=[],o=this.DVBWidth,a=0;if(r.xShapeBlank&&r.xShapeBlank.length&&2==r.xShapeBlank.length){var s=o-((t=r.xShapeBlank)[0]+t[1]);if(s<=n)return null;a=s/(n-1)}else t=[a=o/(n+1),a,a];for(var u=0,l=0;ln[1])return;for(var o=0,a=0;a=0&&e.innerRingRadius1&&void 0!==arguments[1]?arguments[1]:"warring";"success"===e?(this.icon.setAttribute("class","supermapol-icons-message-success"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-green")):"failure"===e?(this.icon.setAttribute("class","supermapol-icons-message-failure"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-red")):"warring"===e&&(this.icon.setAttribute("class","supermapol-icons-message-warning"),this.messageBoxContainer.setAttribute("class","component-messageboxcontainer component-border-bottom-orange")),this.messageBox.innerHTML=t,this.messageBoxContainer.hidden=!1}}])&&FTt(t.prototype,e),r&&FTt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),UTt=function(){try{return echarts}catch(t){return{}}}(),VTt={"en-US":{title_dataFlowService:"Data Flow Service",title_distributedAnalysis:"Distributed Analysis",title_clientComputing:"Client Computing",title_dataServiceQuery:"Data Service Query",title_searchCity:"Search city",title_searchLayer:" Search layer",text_input_value_inputDataFlowUrl:"Please enter the data stream service address such as: ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"Display feature information",text_subscribe:"subscribe",text_cancelSubscribe:"unsubscribe",text_densityAnalysis:"Density Analysis",text_CalculateTheValuePerUnitArea:"Calculate the value per unit area within the neighborhood shape",text_option_selectDataset:"Please select a dataset",text_label_dataset:"Dataset",text_option_simplePointDensityAnalysis:"Simple point density analysis",text_option_nuclearDensityAnalysis:"Nuclear density analysis",text_label_analyticalMethod:"Analytical method",text_option_quadrilateral:"Quadrilateral",text_option_hexagon:"hexagon",text_label_meshType:"Mesh type",text_option_notSet:"Not set",text_label_weightField:"Weight field",text_label_gridSizeInMeters:"Grid size",text_label_searchRadius:"Search radius",text_label_queryRange:"Scope of analysis",text_label_areaUnit:"Area unit",text_option_equidistantSegmentation:"Equidistant segmentation",text_option_logarithm:"Logarithm",text_option_equalCountingSegment:"Equal counting segment",text_option_squareRootSegmentation:"Square root segmentation",text_label_thematicMapSegmentationMode:"Thematic map segmentation mode",text_label_thematicMapSegmentationParameters:"Thematic map segmentation parameters",text_option_greenOrangePurpleGradient:"Green orange purple gradient",text_option_greenOrangeRedGradient:"Green orange red gradient",text_option_rainbowGradient:"Rainbow gradient",text_option_spectralGradient:"Spectral gradient",text_option_terrainGradient:"Terrain gradient",text_label_thematicMapColorGradientMode:"Thematic map color gradient mode",text_label_resultLayerName:"Result layer name",text_chooseFile:"Open File",text_isoline:"Isoline",text_extractDiscreteValue:"Extract discrete value generation curve",text_buffer:"Buffer",text_specifyTheDistance:"Specify the distance to create the surrounding area",text_label_analysisLayer:"Analysis layer",text_label_extractField:"Extract field",text_label_extractedValue:"Extracted value",text_label_distanceAttenuation:"Distance attenuation",text_label_gridSize:"gridSize",text_label_bufferRadius:"Buffer radius",text_label_defaultkilometers:"Default 10 kilometers",text_label_kilometer:"kilometer",text_label_unit:"unit",text_retainOriginal:"Retain original object field",text_mergeBuffer:"Merge buffer",text_label_color:"Color",text_label_buffer:"[Buffer]",text_label_isolines:"[Isolines]",text_label_queryRangeTips:"The default is the full range of input data. Example: -74.050, 40.650, -73.850, 40.850",text_label_queryModel:"Query mode",text_label_IDArrayOfFeatures:"ID array of features",text_label_maxFeatures:"The maximum number of features that can be returned",text_label_bufferDistance:"Buffer distance",text_label_queryRange1:"Query range",text_label_spatialQueryMode:"Spatial query mode",text_label_featureFilter:"Feature filter",text_label_geometricObject:"Geometric object",text_label_queryMode:"Query mode",text_label_searchTips:"Search for city locations or layer features",text_label_chooseSearchLayers:"Select a query layer",text_loadSearchCriteria:"Load search criteria",text_saveSearchCriteria:"Save search criteria",btn_analyze:"Analyze",btn_analyzing:"Analyzing",btn_emptyTheAnalysisLayer:"Empty the analysis layer",btn_cancelAnalysis:"Cancel",btn_query:"Query",btn_querying:"Querying",btn_emptyTheRresultLayer:"Clear all result layers","msg_dataReturnedIsEmpty.":"The request is successful and the data returned by the query is empty.",msg_dataFlowServiceHasBeenSubscribed:"The data stream service has been subscribed to.",msg_inputDataFlowUrlFirst:"Please enter the data stream service address first.",msg_datasetOrMethodUnsupport:"This dataset does not support this analysis type. Please reselect the dataset.",msg_selectDataset:"Please select a data set!",msg_setTheWeightField:"Please set the weight field!",msg_theFieldNotSupportAnalysis:"The field you currently select does not support analysis!",msg_resultIsEmpty:"The result of the analysis is empty!",msg_openFileFail:"Failed to open file!",msg_fileTypeUnsupported:"File format is not supported!",msg_fileSizeExceeded:"File size exceeded! The file size should not exceed 10M!",msg_dataInWrongGeoJSONFormat:"Wrong data format! Non standard GEOJSON format data!",msg_dataInWrongFormat:"Wrong data format! Non standard EXCEL, CSV or GEOJSON format data!",msg_searchKeywords:"Search keywords cannot be empty. Please enter your search criteria.",msg_searchGeocodeField:"Did not match the address matching service data!",msg_cityGeocodeField:"The address matching service of the current city is not configured.",msg_getFeatureField:"No related vector features found!",msg_dataflowservicesubscribed:"The data stream service has been subscribed to.",msg_subscribesucceeded:"The data stream service subscription was successful.",msg_crsunsupport:"Does not support the coordinate system of the current map",msg_tilematrixsetunsupport:"Incoming TileMatrixSet is not supported",msg_jsonResolveFiled:"JSON format parsing failure!",msg_requestContentFiled:"Failed to request data through iportal!",msg_getdatafailed:"Failed to get data!"},"zh-CN":{title_dataFlowService:"数据流服务",title_distributedAnalysis:"分布式分析",title_clientComputing:"客户端计算",title_dataServiceQuery:"数据服务查询",title_searchCity:"搜索城市",title_searchLayer:"搜索图层",text_input_value_inputDataFlowUrl:"请输入数据流服务地址如:ws://{serviceRoot}/{dataFlowName}/dataflow/subscribe",text_displayFeaturesInfo:"显示要素信息",text_subscribe:"订阅",text_cancelSubscribe:"取消订阅",text_densityAnalysis:"密度分析",text_CalculateTheValuePerUnitArea:"计算点指定邻域形状内的每单位面积量值",text_option_selectDataset:"请选择数据集",text_label_dataset:"数据集",text_option_simplePointDensityAnalysis:"简单点密度分析",text_option_nuclearDensityAnalysis:"核密度分析",text_label_analyticalMethod:"分析方法",text_option_quadrilateral:"四边形",text_option_hexagon:"六边形",text_label_meshType:"网格面类型",text_option_notSet:"未设置",text_label_weightField:"权重字段",text_label_gridSizeInMeters:"网格大小",text_label_searchRadius:"搜索半径",text_label_queryRange:"分析范围",text_label_areaUnit:"面积单位",text_option_equidistantSegmentation:"等距离分段",text_option_logarithm:"对数",text_option_equalCountingSegment:"等计数分段",text_option_squareRootSegmentation:"平方根分段",text_label_thematicMapSegmentationMode:"专题图分段模式",text_label_thematicMapSegmentationParameters:"专题图分段参数",text_option_greenOrangePurpleGradient:"绿橙紫渐变",text_option_greenOrangeRedGradient:"绿橙红渐变",text_option_rainbowGradient:"彩虹渐变",text_option_spectralGradient:"光谱渐变",text_option_terrainGradient:"地形渐变",text_label_thematicMapColorGradientMode:"专题图颜色渐变模式",text_label_resultLayerName:"结果图层名称",text_chooseFile:"选择文件",text_isoline:"等值线",text_extractDiscreteValue:"提取离散值生成曲线",text_buffer:"缓冲区",text_specifyTheDistance:"指定距离创建周边区域",text_label_analysisLayer:"分析图层",text_label_extractField:"提取字段",text_label_extractedValue:"提取值",text_label_distanceAttenuation:"距离衰减",text_label_gridSize:"栅格大小",text_label_bufferRadius:"缓冲半径",text_label_defaultkilometers:"默认10千米",text_option_kilometer:"千米",text_label_unit:"单位",text_retainOriginal:"保留原对象字段属性",text_mergeBuffer:"合并缓冲区",text_label_color:"颜色",text_label_buffer:"[缓冲区]",text_label_isolines:"[等值线]",text_label_queryRangeTips:"默认为输入数据的全幅范围。范例:-74.050,40.650,-73.850,40.850",text_label_IDArrayOfFeatures:"要素 ID 数组",text_label_maxFeatures:"最多可返回的要素数量",text_label_bufferDistance:"缓冲区距离",text_label_queryRange1:"查询范围",text_label_spatialQueryMode:"空间查询模式",text_label_featureFilter:"要素过滤器",text_label_geometricObject:"几何对象",text_label_queryMode:"查询模式",text_label_searchTips:"搜索城市地点或图层要素",text_label_chooseSearchLayers:"选择查询图层",text_loadSearchCriteria:"加载搜索条件",text_saveSearchCriteria:"保存搜索条件",btn_analyze:"分析",btn_analyzing:"分析中",btn_emptyTheAnalysisLayer:"清空分析图层",btn_cancelAnalysis:"取消",btn_query:"查询",btn_querying:"查询中",btn_emptyTheRresultLayer:"清除所有结果图层",msg_dataFlowServiceHasBeenSubscribed:"已订阅该数据流服务。",msg_inputDataFlowUrlFirst:"请先输入数据流服务地址。",msg_datasetOrMethodUnsupport:"该数据集不支持本分析类型,请重新选择数据集",msg_selectDataset:"请选择数据集!",msg_setTheWeightField:"请设置权重字段!",msg_theFieldNotSupportAnalysis:"您当前选择的字段不支持分析!",msg_resultIsEmpty:"分析的结果为空!",msg_dataReturnedIsEmpty:"请求成功,查询返回的数据为空。",msg_openFileFail:"打开文件失败!",msg_fileTypeUnsupported:"不支持该文件格式!",msg_fileSizeExceeded:"文件大小超限!文件大小不得超过 10M!",msg_dataInWrongGeoJSONFormat:"数据格式错误!非标准的 GEOJSON 格式数据!",msg_dataInWrongFormat:"数据格式错误!非标准的 EXCEL, CSV 或 GEOJSON 格式数据!",msg_searchKeywords:"搜索关键字不能为空,请输入搜索条件。",msg_searchGeocodeField:"未匹配到地址匹配服务数据!",msg_cityGeocodeField:"未配置当前城市的地址匹配服务。",msg_getFeatureField:"未查找到相关矢量要素!",msg_dataflowservicesubscribed:"已订阅该数据流服务。",msg_subscribesucceeded:"数据流服务订阅成功。",msg_crsunsupport:"不支持当前地图的坐标系",msg_tilematrixsetunsupport:"不支持传入的TileMatrixSet",msg_jsonResolveFiled:"json格式解析失败!",msg_requestContentFiled:"通过iportal请求数据失败!",msg_getdatafailed:"获取数据失败!"},code:null,defaultCode:"en-US",getCode:function(){return VTt.code||VTt.setCode(),VTt.code},setCode:function(){var t=this.getLanguageFromCookie();t||(t=VTt.defaultCode,t="Netscape"===navigator.appName?navigator.language:navigator.browserLanguage),0===t.indexOf("zh")&&(t="zh-CN"),0===t.indexOf("en")&&(t="en-US"),VTt.code=t},getLanguageFromCookie:function(){for(var t=document.cookie.split(";"),e=0;e0){var a=o.SheetNames[0],s=HTt.utils.sheet_to_csv(o.Sheets[a]);e&&e.call(n,s)}}catch(t){r&&r.call(n,t)}},i.onerror=function(t){r&&r.call(n,t)},this.rABF&&i.readAsArrayBuffer(t.file)},processDataToGeoJson:function(t,e,r,n,i){var o=null;if("EXCEL"===t||"CSV"===t)o=this.processExcelDataToGeoJson(e),r&&r.call(i,o);else if("JSON"===t||"GEOJSON"===t){var a=e;"string"==typeof a&&(a=JSON.parse(a)),"ISERVER"===a.type?o=a.data.recordsets[0].features:"FeatureCollection"===a.type?o=a:n&&n.call(i,VTt.i18n("msg_dataInWrongGeoJSONFormat")),r&&r.call(i,o)}else n&&n.call(i,VTt.i18n("msg_dataInWrongFormat"))},processExcelDataToGeoJson:function(t){for(var e=this.string2Csv(t),r=e.colTitles,n=-1,i=-1,o=0,a=r.length;o0?(n.dataItemServices.forEach(function(n){if("RESTDATA"===n.serviceType&&"PUBLISHED"===n.serviceStatus)i=n;else{if("RESTMAP"!==n.serviceType||"PUBLISHED"!==n.serviceStatus)return void r.getDatafromContent(t,e);i=n}}),i&&r.getDatafromRest(i.serviceType,i.address,e)):r.getDatafromContent(t,e):r._fireFailedEvent(n)}).catch(function(t){console.log(t),r._fireFailedEvent(t)})}},{key:"getDatafromContent",value:function(t,e){var r=this,n={result:{}},i=this;t+="/content.json?pageSize=9999999¤tPage=1",ut.get(t,null,{withCredentials:this.datasets.withCredentials}).then(function(t){return t.json()}).then(function(t){if(!1!==t.succeed){if(t.type){if("JSON"===t.type||"GEOJSON"===t.type){if(t.content=JSON.parse(t.content.trim()),!t.content.features)return void console.log(VTt.i18n("msg_jsonResolveFiled"));var o=r._formatGeoJSON(t.content);n.result.features={type:t.content.type,features:o}}else if("EXCEL"===t.type||"CSV"===t.type){var a=r._excelData2Feature(t.content);n.result.features={type:"FeatureCollection",features:a}}e(n,"content")}}else i._fireFailedEvent(t)},this).catch(function(t){console.log(t),i._fireFailedEvent(t)})}},{key:"getDatafromRest",value:function(t,e,r){var n=this,i=this.datasets.withCredentials;if("RESTDATA"===t){var o,a,s="".concat(e,"/data/datasources");ut.get(s,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){o=t.datasourceNames[0],s="".concat(e,"/data/datasources/").concat(o,"/datasets"),ut.get(s,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){return a=t.datasetNames[0],n.getDatafromRestData("".concat(e,"/data"),[o+":"+a],r),[o+":"+a]}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}else{var u,l,c,f="".concat(e,"/maps");ut.get(f,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){u=t[0].name,c=t[0].path,f=f="".concat(e,"/maps/").concat(u,"/layers"),ut.get(f,null,{withCredentials:i}).then(function(t){return t.json()}).then(function(t){return l=t[0].subLayers.layers[0].caption,n.getDatafromRestMap(l,c,r),l}).catch(function(t){n._fireFailedEvent(t)})}).catch(function(t){n._fireFailedEvent(t)})}}},{key:"getDatafromRestData",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"SmID>0",this._getFeatureBySQL(t,e,this.datasets.queryInfo,function(t){r(t,"RESTDATA")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"getDatafromRestMap",value:function(t,e,r){var n=this;this.datasets.queryInfo.attributeFilter=this.datasets.queryInfo.attributeFilter||"smid=1",this._queryFeatureBySQL(e,t,this.datasets.queryInfo,null,null,function(t){r(t,"RESTMAP")},function(t){console.log(t),n._fireFailedEvent(t)})}},{key:"_getFeatureBySQL",value:function(t,e,r,n,i){var o,a,s={name:e.join().replace(":","@")};Object.assign(s,r),o=new m1(s),a=new q1({queryParameter:o,datasetNames:e,fromIndex:0,toIndex:1e5,returnContent:!0}),new t2(t).processAsync(a,function(t){"processCompleted"===t.type?n&&n(t):i&&i(t)})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,i,o,a,s,u,l){var c,f,h={name:e};Object.assign(h,r),c=new m1(h),n&&(c.fields=n);var p={queryParams:[c]};l&&(p.queryOption=On.ATTRIBUTE),s&&(p.startRecord=s),u&&(p.expectCount=u),i&&(p.prjCoordSys={epsgCode:i}),f=new Eut(p),this._queryBySQL(t,f,function(t){"processCompleted"===t.type?o(t):a(t)})}},{key:"_queryBySQL",value:function(t,e,r,n){new Iut(t,{format:this._processFormat(n)}).processAsync(e,r)}},{key:"_processFormat",value:function(t){return t||kn.GEOJSON}},{key:"_formatGeoJSON",value:function(t){var e=t.features;return e.forEach(function(t,e){t.properties.index=e}),e}},{key:"_excelData2Feature",value:function(t){for(var e=t.colTitles,r=-1,n=-1,i=0,o=e.length;i=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function QTt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&t.forEach(function(t){t.xAxis&&e.xField.push({field:t.xAxis.field,name:t.xAxis.name}),t.yAxis&&e.yField.push({field:t.yAxis.field,name:t.yAxis.name})})}},{key:"getDatasetInfo",value:function(t){var e=this;this.createChart=t,this.datasets&&this._checkUrl(this.datasets.url)&&(this.chartModel=new ZTt(this.datasets),"iServer"===this.datasets.type?this.chartModel.getDatasetInfo(this._getDatasetInfoSuccess.bind(this)):"iPortal"===this.datasets.type&&this.chartModel.getDataInfoByIptl(this._getDataInfoSuccess.bind(this)),this.chartModel.events.on({getdatafailed:function(t){e.events.triggerEvent("getdatafailed",t)}}))}},{key:"_getDatasetInfoSuccess",value:function(t){var e=this.datasets.url,r=e.indexOf("rest");if(r>0){var n=e.indexOf("/",r+5),i=e.substring(r+5,n),o=e.substring(0,r+4)+"/data";if("maps"===i){var a=e.indexOf("/",n+1),s=e.substring(n+1,a);o=e.substring(0,r+4)+"/maps/"+s,t.result.dataUrl=o,this._getLayerFeatures(t)}else"data"===i&&(t.result.dataUrl=o,this._getDataFeatures(t))}}},{key:"_getDataInfoSuccess",value:function(t,e){"RESTMAP"===e?this._getChartDatasFromLayer(t):this._getChartDatas(t)}},{key:"_getDataFeatures",value:function(t){this.chartModel.getDataFeatures(t,this._getChartDatas.bind(this))}},{key:"_getLayerFeatures",value:function(t){this.chartModel.getLayerFeatures(t,this._getChartDatasFromLayer.bind(this))}},{key:"_getChartDatas",value:function(t){if(t){this.features=t.result.features;var e=this.features.features,r={};if(e.length){var n=e[0],i=[],o=[];for(var a in n.properties)i.push(a),o.push(this._getDataType(n.properties[a]));for(var s in r={features:e,fieldCaptions:i,fieldTypes:o,fieldValues:[]},o){var u=[];for(var l in e){var c=e[l],f=r.fieldCaptions[s],h=c.properties[f];u.push(h)}r.fieldValues.push(u)}this.createChart(r)}}}},{key:"_getChartDatasFromLayer",value:function(t){if(t.result.recordsets){var e=t.result.recordsets[0],r=e.features.features;this.features=e.features;var n={};if(r.length){for(var i in(n={features:e.features,fieldCaptions:e.fieldCaptions,fieldTypes:e.fieldTypes,fieldValues:[]}).fieldCaptions){var o=[];for(var a in r){var s=r[a],u=n.fieldCaptions[i],l=s.properties[u];o.push(l)}n.fieldValues.push(o)}this.createChart(n)}}}},{key:"_createChartOptions",value:function(t){return this.calculatedData=this._createChartDatas(t),this.updateChartOptions(this.chartType)}},{key:"changeType",value:function(t){if(t!==this.chartType)return this.chartType=t,this.updateChartOptions(this.chartType)}},{key:"updateData",value:function(t,e,r){this.updateChart=r,this.xField=[],this.yField=[],this._initXYField(e),t.type=t.type||"iServer",t.withCredentials=t.withCredentials||!1,this.datasets=t,this.getDatasetInfo(this._updateDataSuccess.bind(this))}},{key:"_updateDataSuccess",value:function(t){var e=this._createChartOptions(t);this.updateChart(e)}},{key:"updateChartOptions",value:function(t,e){if(this.calculatedData){var r=this.grid,n=this._createChartSeries(this.calculatedData,t),i=[];for(var o in this.calculatedData.XData)i.push({value:this.calculatedData.XData[o].fieldsData});var a={type:"category",name:this.xField[0].name||"X",data:i,nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},s={type:"value",name:this.yFieldName||"Y",data:{},nameTextStyle:{color:"#fff",fontSize:14},splitLine:{show:!1},axisLine:{lineStyle:{color:"#eee"}}},u={formatter:"{b0}: {c0}"},l="#404a59";return e&&(e.grid&&(r=e.grid),e.tooltip&&(u=e.tooltip),e.backgroundColor&&(l=e.backgroundColor)),{backgroundColor:l,grid:r,series:n,xAxis:a,yAxis:s,tooltip:u}}}},{key:"_createChartDatas",value:function(t){var e=0,r=[],n=t.fieldCaptions,i=this;n.forEach(function(t,r){i.xField[0]&&t===i.xField[0].field&&(e=r)}),this.yFieldName="",this.yField.forEach(function(t,e){0!==e&&(i.yFieldName=i.yFieldName+","),i.yFieldName=i.yFieldName+t.name,n.forEach(function(e,n){e===t.field&&r.push(n)})});var o=this._getAttrData(t,e),a=[];if(r.length>0)r.forEach(function(e){var r=[];for(var n in t.fieldValues[e])r.push({value:t.fieldValues[e][n]});a.push(r)});else{for(var s=[],u=[],l=o.length,c=0;c0;t--)this.header.removeChild(this.header.children[t]),this.content.removeChild(this.content.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r0;e--)this.content.removeChild(this.content.children[e-1]);var r=this.config[t];for(var n in r)this._createCityItem(n,r[n])}},{key:"_createCityItem",value:function(t,e){var r=document.createElement("div"),n=document.createElement("div");n.setAttribute("class","component-citytabpag__py-key"),n.innerHTML=t,r.appendChild(n);var i=document.createElement("div");i.setAttribute("class","component-citytabpag__content");for(var o=0;o0&&this.appendTabs(t),this.rootContainer=e}},{key:"setTabs",value:function(t){this.removeAllTabs(),this.appendTabs(t)}},{key:"appendTabs",value:function(t){for(var e=0;e0;t--)this.navTabsTitle.removeChild(this.navTabsTitle.children[t]),this.navTabsContent.removeChild(this.navTabsContent.children[t])}},{key:"_changeTabsPage",value:function(t){for(var e=t.target.index,r=0;r=0;t--)this.content.removeChild(this.content.children[t])}},{key:"setPageLink",value:function(t){this.pageNumberLis=[],this.currentPageNumberLis=[],this.clearPageLink(),this._createPageLi(t),this._appendPageLink()}},{key:"_createPageLi",value:function(t){for(var e=0;e1;t--)this.link.removeChild(this.link.children[t])}},{key:"_createLink",value:function(t){for(var e=0;e<4;e++){var r=document.createElement("li");r.setAttribute("class","disable");var n=document.createElement("span");r.appendChild(n),0===e?(n.id="first",n.setAttribute("class","supermapol-icons-first")):1===e?(n.id="prev",n.setAttribute("class","supermapol-icons-prev")):2===e?(n.id="next",n.setAttribute("class","supermapol-icons-next")):3===e&&(n.id="last",n.setAttribute("class","supermapol-icons-last")),t.appendChild(r)}}},{key:"_changePageEvent",value:function(t){var e=t.target;if("disable"!==e.parentElement.classList[0]){var r;if(e.id)r=e.id;else{if(!Number(e.innerHTML))return;r=Number(e.innerHTML)}this._prePageNum(r),this.clearPageLink(),this._appendPageLink()}}},{key:"_changeDisableState",value:function(){this.link.children[0].setAttribute("class",""),this.link.children[1].setAttribute("class",""),this.link.children[this.link.children.length-1].setAttribute("class",""),this.link.children[this.link.children.length-2].setAttribute("class",""),1===this.currentPage&&(this.link.children[0].setAttribute("class","disable"),this.link.children[1].setAttribute("class","disable")),this.currentPage===this.pageNumberLis.length&&(this.link.children[this.link.children.length-1].setAttribute("class","disable"),this.link.children[this.link.children.length-2].setAttribute("class","disable"))}},{key:"_prePageNum",value:function(t){var e=[];if(this.currentPage="first"===t?1:"last"===t?this.pageNumberLis.length:"prev"===t?this.currentPage-1:"next"===t?this.currentPage+1:t,this.pageNumberLis.length<=5)for(var r=0;r=this.pageNumberLis.length-3)for(var i=this.pageNumberLis.length-5;i0&&(this.currentPageNumberLis=e)}}])&&pOt(r.prototype,n),i&&pOt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(),bOt=function(){try{return canvg}catch(t){return{}}}(),xOt=r.n(bOt),wOt=r(311),_Ot=r.n(wOt),SOt=r(304);function EOt(t){return function(t){if(Array.isArray(t))return kOt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return kOt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kOt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kOt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function COt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function OOt(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){COt(o,n,i,a,s,"next",t)}function s(t){COt(o,n,i,a,s,"throw",t)}a(void 0)})}}function AOt(t){"@babel/helpers - typeof";return(AOt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function POt(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"string"==typeof e||"number"==typeof e?this.mapId=e:null!==e&&"object"===AOt(e)&&(this.mapInfo=e),this.serverUrl=r.serverUrl||"https://www.supermapol.com",this.credentialKey=r.credentialKey,this.credentialValue=r.credentialValue,this.tiandituKey=r.tiandituKey||"",this.withCredentials=r.withCredentials||!1,this.excludePortalProxyUrl=r.excludePortalProxyUrl,this.iportalServiceProxyUrl=r.iportalServiceProxyUrlPrefix,this.proxy=r.proxy,this.proxyOptions={data:"apps/viewer/getUrlResource.json?url=",image:"apps/viewer/getUrlResource.png?url="}},(e=[{key:"setMapId",value:function(t){"string"==typeof t||"number"==typeof t?(this.mapId=t,this.mapInfo=null):null!==t&&"object"===AOt(t)&&(this.mapInfo=t,this.mapId="")}},{key:"setServerUrl",value:function(t){this.serverUrl=t}},{key:"setWithCredentials",value:function(t){this.withCredentials=t}},{key:"setProxy",value:function(t){this.proxy=t}},{key:"handleServerUrl",value:function(t){var e=Fi(t);return this.serverUrl=e,e}},{key:"getMapInfo",value:function(){var t=OOt(TOt().mark(function t(){var e,r=this;return TOt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.mapId||!this.mapInfo){t.next=2;break}return t.abrupt("return",new Promise(function(t){t(r.mapInfo)}));case 2:return e=this._handleMapUrl(),t.prev=3,t.next=6,this.getiPortalServiceProxy();case 6:return t.abrupt("return",new Promise(function(t,n){ut.get(e,null,{withCredentials:r.withCredentials}).then(function(t){return t.json()}).then(function(e){if(e&&!1===e.succeed){var r={message:e&&e.error&&e.error.errorMsg};n(r)}else e.mapParams={title:e.title,description:e.description},t(e)}).catch(function(t){n(t)})}));case 9:return t.prev=9,t.t0=t.catch(3),t.abrupt("return",Promise.reject(t.t0));case 12:case"end":return t.stop()}},t,this,[[3,9]])}));return function(){return t.apply(this,arguments)}}()},{key:"getiPortalServiceProxy",value:function(){var t=this;return new Promise(function(e,r){ut.get("".concat(t.serverUrl,"web/config/portal.json"),{scope:["serviceProxy"]}).then(function(t){return t.json()}).then(function(n){if(n&&n.serviceProxy){var i=n.serviceProxy;i.enable&&(i.proxyServerRootUrl?t.iportalServiceProxyUrl=i.proxyServerRootUrl:i.port&&i.rootUrlPostfix&&(t.iportalServiceProxyUrl="".concat(i.port,"/").concat(i.rootUrlPostfix)),t.serverUrl.indexOf(t.iportalServiceProxyUrl)>-1&&(t.iportalServiceProxyUrl="")),e(i)}else r("serviceProxyFailed")}).catch(function(t){r(t)})})}},{key:"getLayerFeatures",value:function(t,e,r){var n;switch(t){case"hosted":n=this._getFeaturesFromHosted(e,r);break;case"rest_data":n=this._getFeaturesFromRestData(e,r);break;case"rest_map":n=this._getFeaturesFromRestMap(e);break;case"dataflow":n=this._getFeaturesFromDataflow(e);break;case"user_data":n=this._getFeaturesFromUserData(e)}return n}},{key:"getWmsInfo",value:function(t){var e=this;return new Promise(function(r){var n=e.handleProxy(),i=$.urlAppend(t.url,"REQUEST=GetCapabilities&SERVICE=WMS");ut.get(i,null,{withCredentials:e.handleWithCredentials(n,t.url,!1),withoutFormatSuffix:!0,proxy:n}).then(function(t){return t.text()}).then(function(t){var e=new SOt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"@_"}).parse(t),n=e.WMT_MS_Capabilities||e.WMS_Capabilities;r({version:n["@_version"]})})})}},{key:"getMapBoxStyle",value:function(t){return new Promise(function(e,r){ut.get(t).then(function(t){return t.json()}).then(function(t){e(t)}).catch(function(t){r(t)})})}},{key:"getWmtsInfo",value:function(t,e){var r=this;return new Promise(function(n,i){var o,a=!1,s=22,u=0,l="",c="",f="",h=r.handleProxy(),p=$.urlAppend(t.url,"REQUEST=GetCapabilities&SERVICE=WMTS&VERSION=1.0.0");p=r.handleParentRes(p),ut.get(p,null,{withCredentials:r.handleWithCredentials(h,t.url,!1),withoutFormatSuffix:!0,proxy:h}).then(function(t){return t.text()}).then(function(i){var h=["Layer","TileMatrixSet","ows:Operation","ows:Get","ResourceURL","Style"],p=new SOt.XMLParser({ignoreAttributes:!1,attributeNamePrefix:"@_",isArray:function(t){if(-1!==h.indexOf(t))return!0}}).parse(i).Capabilities,d=p.Contents,y=p["ows:OperationsMetadata"];if(y){var v=y["ows:Operation"];Array.isArray(v)||(v=[v]);var g=v.find(function(t){return"GetTile"===t["@_name"]});if(g){var m=g["ows:DCP"]["ows:HTTP"]["ows:Get"];Array.isArray(m)||(m=[m]);var b=m.find(function(t){return"KVP"===t["ows:Constraint"]["ows:AllowedValues"]["ows:Value"]});b&&(f=b["@_xlink:href"])}}for(var x=d.TileMatrixSet,w=0;w0)break}var M=Object.keys(_).map(function(t){return+t});if(s=M.length>0?Math.max.apply(Math,EOt(M)):void 0,u=M.length>0?Math.min.apply(Math,EOt(M)):void 0,0===M.length)throw Error("TileMatrixSetNotSuppport");a=!0}break}var I=d.Layer&&d.Layer.find(function(e){return e["ows:Identifier"]===t.layer});if(I){var L=I.Style;if(l=Array.isArray(I.Style)?L[0]["ows:Identifier"]?L[0]["ows:Identifier"]:"":L["ows:Identifier"]?L["ows:Identifier"]:"",I["ows:WGS84BoundingBox"]){var j=I["ows:WGS84BoundingBox"]["ows:LowerCorner"].split(" "),N=I["ows:WGS84BoundingBox"]["ows:UpperCorner"].split(" ");o=[parseFloat(j[0]),parseFloat(j[1]),parseFloat(N[0]),parseFloat(N[1])]}var R=I.ResourceURL;Array.isArray(R)||(R=[R]);var D=R.find(function(t){return"tile"===t["@_resourceType"]});D&&(c=D["@_template"])}n({isMatched:a,matchMaxZoom:s,matchMinZoom:u,style:l,bounds:o,restResourceURL:c,kvpResourceUrl:f})}).catch(function(t){i(t)})})}},{key:"_getFeaturesFromHosted",value:function(t,e){var r=t.dataSource,n=t.layerType,i=r?r.serverId:t.serverId;return i?"MARKER"===n||r&&(!r.accessType||"DIRECT"===r.accessType)?this._getDataFromIportal(i,t):this._getDataFromHosted({layer:t,serverId:i,baseProjection:e}):new Promise(function(t){t({type:"noServerId"})})}},{key:"_getFeaturesFromRestData",value:function(t,e){var r,n=this,i=t.dataSource;return new Promise(function(o,a){n._getFeatureBySQL(i.url,[decodeURIComponent(i.dataSourceName)||t.name],function(t){t.result.features?(r=n.parseGeoJsonData2Feature({allDatas:{features:t.result.features.features}}),o({type:"feature",features:r})):a("features must be valid")},function(t){a(t)},e)})}},{key:"_getFeaturesFromRestMap",value:function(t){var e=this;return new Promise(function(r,n){e._queryFeatureBySQL(t.dataSource.url,t.dataSource.layerName,function(i){var o=i&&i.result.recordsets,a=o&&o[0],s=a.fields;if(a&&s){var u=[];for(var l in s){var c=s[l];0===c.indexOf("Sm")&&"SmID"!==c||u.push(c)}e._getFeatures(u,t,function(t){r({type:"feature",features:t})},function(t){n(t)})}},function(t){n(t)},"smid=1")})}},{key:"_getFeaturesFromUserData",value:function(t){var e=this,r=t.dataSource;return new Promise(function(t,n){var i=e.handleProxy(),o=e.handleParentRes(r.url);ut.get(o,null,{withCredentials:e.handleWithCredentials(i,o,e.withCredentials),proxy:i,withoutFormatSuffix:!0}).then(function(t){return t.json()}).then(function(r){var n;n=r&&r instanceof Object&&"FeatureCollection"===r.type?r.features:r,n=e.parseGeoJsonData2Feature({allDatas:{features:n}}),t({type:"feature",features:n})}).catch(function(t){n(t)})})}},{key:"_queryFeatureBySQL",value:function(t,e,r,n,i,o,a,s,u,l){var c=this._getQueryFeaturesParam(e,i,o,a,s,u,l),f=this.handleProxy(),h=this.handleParentRes(t);new Iut(h,{proxy:f,withCredentials:this.handleWithCredentials(f,t,!1),eventListeners:{processCompleted:function(t){r&&r(t)},processFailed:function(t){n&&n(t)}}}).processAsync(c)}},{key:"_getFeatures",value:function(t,e,r,n){var i=this,o=e.dataSource;this._queryFeatureBySQL(o.url,o.layerName,function(t){var e=t.result.recordsets[0].features.features,n=i.parseGeoJsonData2Feature({allDatas:{features:e}});r(n)},function(t){n(t)},null,t)}},{key:"_getQueryFeaturesParam",value:function(t,e,r,n,i,o,a){var s=new m1({name:t,attributeFilter:e});r&&(s.fields=r);var u={queryParams:[s]};return a&&(u.queryOption=On.ATTRIBUTE),i&&(u.startRecord=i),o&&(u.expectCount=o),n&&(u.prjCoordSys={epsgCode:n}),new Eut(u)}},{key:"_getFeaturesFromDataflow",value:function(t){var e=this;return new Promise(function(r,n){e._getDataflowInfo(t,function(){r({type:"dataflow"})},function(t){n(t)})})}},{key:"_getDataflowInfo",value:function(t,e,r){var n,i=t.url,o="".concat(i,".json");t.credential&&t.credential.token&&(n=t.credential.token,o+="?token=".concat(n));var a=this.handleProxy();o=this.handleParentRes(o),ut.get(o,null,{proxy:a,withCredentials:this.handleWithCredentials(a,o,!1)}).then(function(t){return t.json()}).then(function(n){n?(n.featureMetaData&&(t.featureType=n.featureMetaData.featureType.toUpperCase(),t.dataSource={dataTypes:{}},n.featureMetaData.fieldInfos&&n.featureMetaData.fieldInfos.length>0&&n.featureMetaData.fieldInfos.forEach(function(e){var r=e.name.trim();"TEXT"===e.type?t.dataSource.dataTypes[r]="STRING":["DOUBLE","INT","FLOAT","LONG","SHORT"].includes(e.type)?t.dataSource.dataTypes[r]="NUMBER":t.dataSource.dataTypes[r]="UNKNOWN"})),t.wsUrl=n.urls[0].url,t.name=n.urls[0].url.split("iserver/services/")[1].split("/dataflow")[0],e()):r()}).catch(function(){r()})}},{key:"getDatasourceType",value:function(t){var e,r=t.dataSource,n=t.layerType;return r&&"SAMPLE_DATA"===r.type?r.type:(r&&r.serverId||"MARKER"===n||"HOSTED_TILE"===n?e="hosted":"SUPERMAP_REST"===n||"TILE"===n||"WMS"===n||"WMTS"===n||"MAPBOXSTYLE"===n?e="tile":r&&"REST_DATA"===r.type?e="rest_data":r&&"REST_MAP"===r.type&&r.url?e="rest_map":"DATAFLOW_POINT_TRACK"===n||"DATAFLOW_HEAT"===n?e="dataflow":r&&"USER_DATA"===r.type&&(e="user_data"),e)}},{key:"getFeatureProperties",value:function(t){var e=[];return t&&t.length&&t.forEach(function(t){var r=t.properties;r&&e.push(r)}),e}},{key:"parseGeoJsonData2Feature",value:function(t){for(var e=t.allDatas.features,r=[],n=0,i=e.length;n0){var u=s[0].name,l=s[0].type.toUpperCase();e._getDataService(n,u).then(function(n){var s=n.dataItemServices;0===s.length&&a("noDataServices");var c={layer:r,dataItemServices:s,datasetName:u,featureType:l,resolve:t,reject:a,baseProjection:i};if(o){var f=s.filter(function(t){return t&&"RESTDATA"===t.serviceType})[0];e._isMvt(f.address,u,i).then(function(t){e._getServiceInfoFromLayer(c,t)}).catch(function(){e._getServiceInfoFromLayer(c)})}else e._getServiceInfoFromLayer(c)})}else a("resultIsEmpty")}).catch(function(t){a(t)})})}},{key:"_isMvt",value:function(t,e,r){return this._getDatasetsInfo(t,e).then(function(t){return t.epsgCode==r.split("EPSG:")[1]?ut.get("".concat(t.url,"/tilefeature.mvt")).then(function(t){return t.json()}).then(function(e){return t.isMvt=e.error&&400===e.error.code,t}).catch(function(){return t}):t})}},{key:"_getServiceInfoFromLayer",value:function(t,e){var r=this,n=t.layer,i=t.dataItemServices,o=t.datasetName,a=t.featureType,s=t.resolve,u=t.reject,l=t.baseProjection,c=e?!e.isMvt:"HOSTED_TILE"===n.layerType,f=!1;i.forEach(function(t){f||(t&&c&&"RESTMAP"===t.serviceType?(f=!0,r._getTileLayerInfo(t.address,l).then(function(t){s({type:"restMap",restMaps:t})})):t&&!c&&"RESTDATA"===t.serviceType&&(e&&e.isMvt?s({type:"mvt",info:e,featureType:a}):(f=!0,r._getDatasources(t.address).then(function(e){n.dataSource.dataSourceName=e+":"+o,n.dataSource.url="".concat(t.address,"/data"),r._getFeatureBySQL(n.dataSource.url,[n.dataSource.dataSourceName||n.name],function(t){var e=r.parseGeoJsonData2Feature({allDatas:{features:t.result.features.features}});s({type:"feature",features:e})},function(t){u(t)})},function(t){u(t)}))))},this),f||u("noService")}},{key:"_getDatasetsInfo",value:function(t,e){var r=this;return this._getDatasources(t).then(function(n){var i="".concat(t,"/data/datasources/").concat(n,"/datasets/").concat(e),o=r.handleProxy();return i=r.handleParentRes(i),ut.get(i,null,{withCredentials:r.handleWithCredentials(o,i,!1),proxy:o}).then(function(t){return t.json()}).then(function(t){return{epsgCode:t.datasetInfo.prjCoordSys.epsgCode,bounds:t.datasetInfo.bounds,datasourceName:n,datasetName:e,url:i}})})}},{key:"_getDatasources",value:function(t){var e=this.handleProxy(),r="".concat(t,"/data/datasources.json");return r=this.handleParentRes(r),ut.get(r,null,{withCredentials:this.handleWithCredentials(e,r,!1),proxy:e}).then(function(t){return t.json()}).then(function(t){if(401===t.code)throw Error(t.errorMsg);return t.datasourceNames[0]})}},{key:"_getDataService",value:function(t,e){var r=this.handleProxy(),n="".concat(this.serverUrl,"web/datas/").concat(t,".json");return n=this.handleParentRes(n),ut.get(n,null,{withCredentials:this.handleWithCredentials(r,n,this.withCredentials),proxy:r}).then(function(t){return t.json()}).then(function(r){return r.fileId=t,r.datasetName=e,r})}},{key:"_checkUploadToRelationship",value:function(t){var e=this.handleProxy(),r="".concat(this.serverUrl,"web/datas/").concat(t,"/datasets.json");return r=this.handleParentRes(r),ut.get(r,null,{withCredentials:this.handleWithCredentials(e,r,this.withCredentials),proxy:e}).then(function(t){return t.json()}).then(function(t){return t})}},{key:"_handleMapUrl",value:function(){var t=this.serverUrl+"web/maps/"+this.mapId+"/map";this.credentialValue&&this.credentialKey&&(t+="?"+this.credentialKey+"="+this.credentialValue);var e="getUrlResource.json?url=";if(this.excludePortalProxyUrl&&this.serverUrl.indexOf(e)>-1){var r=this.serverUrl.split(e);r.length>1&&(t=r[0]+e+this.serverUrl+"web/maps/"+this.mapId+"/map.json")}return t=-1===t.indexOf(".json")?"".concat(t,".json"):t}},{key:"handleProxy",value:function(t){if(!this.proxy)return null;var e=this.proxyOptions[t||"data"],r=this.serverUrl+e;return"string"==typeof this.proxy&&(r=this.proxy),r}},{key:"handleWithCredentials",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.withCredentials;return e&&e.includes("https://www.supermapol.com")?"":!(!t||!t.startsWith(this.serverUrl)||e&&!e.startsWith(t))||(!!(e&&this.iportalServiceProxyUrl&&e.indexOf(this.iportalServiceProxyUrl)>=0)||r)}},{key:"isIportalResourceUrl",value:function(t){return t.startsWith(this.serverUrl)||this.iportalServiceProxyUrl&&t.indexOf(this.iportalServiceProxyUrl)>=0}},{key:"handleParentRes",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.mapId,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"MAP";return this.isIportalResourceUrl(t)?$.urlAppend(t,"parentResType=".concat(r,"&parentResId=").concat(e)):t}},{key:"_formatGeoJSON",value:function(t){var e=t.features;return e.forEach(function(t,e){t.properties.index=e}),e}},{key:"_excelData2Feature",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.colTitles,n=r.indexOf(e.xField),i=r.indexOf(e.yField);if(i<0||n<0)for(var o=0,a=r.length;o2&&void 0!==arguments[2]?arguments[2]:1e-5;return Math.abs(+t-+e)<=r}}])&&POt(t.prototype,e),r&&POt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ROt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function DOt(t,e,r){return(e=UOt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function BOt(){BOt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==zOt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function FOt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function zOt(t){"@babel/helpers - typeof";return(zOt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function GOt(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:Ya,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"triggerEvent";return function(r){function n(t,e,r){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),(i=VOt(this,n)).serverUrl=e.serverUrl||"https://www.supermapol.com",i.credentialValue=e.credentialValue,i.credentialKey=e.credentialKey,i.tiandituKey=e.tiandituKey||"",i.googleMapsAPIKey=e.googleMapsAPIKey||"",i.bingMapsKey=e.bingMapsKey||"",i.googleMapsLanguage=e.googleMapsLanguage||"zh-CN",i.withCredentials=e.withCredentials||!1,i.proxy=e.proxy,i.target=e.target||"map",i.excluortalProxyUrl=e.excludePortalProxyUrl,i.isSuperMapOnline=e.isSuperMapOnline,i.ignoreBaseProjection=e.ignoreBaseProjection,i.specifiedProj4=e.proj4,i.echartslayer=[],i.canvgsV=[],i.webMapService=new NOt(t,e),i.mapOptions=r,i.eventTypes=["mapcreatefailed","layercreatefailed"],i.mapId=t,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&WOt(t,e)}(n,t),i=n,(o=[{key:"_initWebMap",value:function(){throw new Error("_initWebMap is not implemented")}},{key:"_getMapInfo",value:function(){throw new Error("_getMapInfo is not implemented")}},{key:"_createMap",value:function(){throw new Error("_createMap is not implemented")}},{key:"_initBaseLayer",value:function(){throw new Error("_initBaseLayer is not implemented")}},{key:"_initOverlayLayer",value:function(){throw new Error("_initOverlayLayer is not implemented")}},{key:"_addLayerSucceeded",value:function(){throw new Error("_addLayerSucceeded is not implemented")}},{key:"_unproject",value:function(){throw new Error("_unproject is not implemented")}},{key:"clean",value:function(){throw new Error("clean is not implemented")}},{key:"echartsLayerResize",value:function(){this.echartslayer.forEach(function(t){t.chart.resize()})}},{key:"setMapId",value:function(t){var e=this;"string"==typeof t||"number"==typeof t?(this.mapId=t,this.webMapInfo=null):null!==t&&"object"===zOt(t)&&(this.webMapInfo=t,this.mapId=""),this.webMapService.setMapId(t),t&&setTimeout(function(){e._initWebMap()},0)}},{key:"setServerUrl",value:function(t){this.serverUrl=t,this.webMapService.setServerUrl(t)}},{key:"setWithCredentials",value:function(t){this.withCredentials=t,this.webMapService.setWithCredentials(t)}},{key:"setProxy",value:function(t){this.proxy=t,this.webMapService.setProxy(t)}},{key:"setZoom",value:function(t){this.map&&(this.mapOptions.zoom=t,t!==+this.map.getZoom().toFixed(2)&&(t||0===t)&&this.map.setZoom(t,{from:"setZoom"}))}},{key:"setMaxBounds",value:function(t){this.map&&(this.mapOptions.maxBounds=t,t&&this.map.setMaxBounds(t))}},{key:"setMinZoom",value:function(t){this.map&&(this.mapOptions.minZoom=t,(t||0===t)&&this.map.setMinZoom(t))}},{key:"setMaxZoom",value:function(t){this.map&&(this.mapOptions.maxZoom=t,(t||0===t)&&this.map.setMaxZoom(t))}},{key:"initWebMap",value:function(){if(this.clean(),this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapInfo){var t=this.webMapInfo;return t.mapParams={title:this.webMapInfo.title,description:this.webMapInfo.description},this.mapParams=t.mapParams,void this._getMapInfo(t)}this.mapId&&this.serverUrl?(this._taskID=new Date,this.getMapInfo(this._taskID)):this._createMap()}},{key:"getMapInfo",value:function(t){var e=this;this.serverUrl=this.serverUrl&&this.webMapService.handleServerUrl(this.serverUrl),this.webMapService.getMapInfo().then(function(r){e._taskID===t&&(e.mapParams=r.mapParams,e._getMapInfo(r,t))},function(t){throw t}).catch(function(t){e._fire("mapcreatefailed",{error:t}),console.log(t)})}},{key:"getBaseLayerType",value:function(t){var e=t.layerType;switch((e.indexOf("TIANDITU_VEC")>-1||e.indexOf("TIANDITU_IMG")>-1||e.indexOf("TIANDITU_TER")>-1)&&(e="TIANDITU"),e){case"TILE":case"SUPERMAP_REST":return"TILE";case"CLOUD":case"CLOUD_BLACK":return"CLOUD";case"OSM":case"JAPAN_ORT":case"JAPAN_RELIEF":case"JAPAN_PALE":case"JAPAN_STD":case"GOOGLE_CN":case"GOOGLE":return"XYZ";default:return e}}},{key:"getMapurls",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{CLOUD:t.CLOUD||"http://t2.dituhui.com/FileService/image?map=quanguo&type=web&x={x}&y={y}&z={z}",CLOUD_BLACK:t.CLOUD_BLACK||"http://t3.dituhui.com/MapService/getGdp?x={x}&y={y}&z={z}",OSM:t.OSM||"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png",GOOGLE:"https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{z}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i540264686!3m12!2s{googleMapsLanguage}!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!4e0&key={googleMapsAPIKey}",GOOGLE_CN:"https://mt{0-3}.google.com/vt/lyrs=m&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}",JAPAN_STD:"https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",JAPAN_PALE:"https://cyberjapandata.gsi.go.jp/xyz/pale/{z}/{x}/{y}.png",JAPAN_RELIEF:"https://cyberjapandata.gsi.go.jp/xyz/relief/{z}/{x}/{y}.png",JAPAN_ORT:"https://cyberjapandata.gsi.go.jp/xyz/ort/{z}/{x}/{y}.jpg"}}},{key:"getLayerFeatures",value:function(t,e,r){var n=this,i=this.webMapService.getLayerFeatures(r,t,this.baseProjection);i&&i.then(function(){var r,i=(r=BOt().mark(function r(i){var o;return BOt().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!n.mapId||n._taskID===e){r.next=2;break}return r.abrupt("return");case 2:if(!i||!t.projection){r.next=8;break}if(Tq(t.projection,n.specifiedProj4)){r.next=8;break}return r.next=6,Aq(t.projection.split(":")[1],n.serverUrl);case 6:(o=r.sent)&&kq(t.projection,o,n.specifiedProj4);case 8:n._getLayerFeaturesSucceeded(i,t);case 9:case"end":return r.stop()}},r)}),function(){var t=this,e=arguments;return new Promise(function(n,i){var o=r.apply(t,e);function a(t){FOt(o,n,i,a,s,"next",t)}function s(t){FOt(o,n,i,a,s,"throw",t)}a(void 0)})});return function(t){return i.apply(this,arguments)}}(),function(t){throw new Error(t)}).catch(function(e){n._addLayerSucceeded(),n._fire("layercreatefailed",{error:e,layer:t,map:n.map}),console.log(e)})}},{key:"setFeatureInfo",value:function(t){var e,r=t.dv_v5_markerInfo;if(!r||!r.dataViz_title)return r;e=r;var n=t.properties;for(var i in e)n[i]&&(e[i]=n[i],delete n[i]);return e}},{key:"getRankStyleGroup",value:function(t,e,r){var n=[],i=[],o=r.style,a=r.themeSetting,s=a.segmentMethod,u=a.segmentCount,l=a.customSettings,c=r.themeSetting.minRadius,f=r.themeSetting.maxRadius,h=a.colors,p=o.fillColor;e.forEach(function(e){var r=e.properties[t];null==r||""===r||isNaN(+r)||n.push(Number(r))});try{i=uq.getArraySegments(n,s,u)}catch(t){console.log(t)}for(var d=0;d0&&(S=l[k]&&l[k].color?l[k].color:E[k]||p,o.fillColor=S),g.push({radius:_,color:S,start:m,end:b,style:o});return g}return!1}},{key:"createRankStyleSource",value:function(t,e){var r=t.themeSetting.themeField,n=this.getRankStyleGroup(r,e,t);return!!n&&{parameters:t,styleGroups:n}}},{key:"getRestMapLayerInfo",value:function(t,e){var r=t.bounds,n=t.coordUnit,i=t.visibleScales,o=t.url;return e.layerType="TILE",e.orginEpsgCode=this.baseProjection,e.units=n&&n.toLowerCase(),e.extent=[r.left,r.bottom,r.right,r.top],e.visibleScales=i,e.url=o,e.sourceType="TILE",e}},{key:"handleLayerFeatures",value:function(t,e){var r=e.layerType,n=e.style,i=e.themeSetting,o=e.filterCondition;return(n||i)&&o&&"RANGE"!==r&&"UNIQUE"!==r&&"RANK_SYMBOL"!==r&&(t=this.getFilterFeatures(o,t)),t}},{key:"getFilterFeatures",value:function(t,e){if(!t)return e;for(var r=this.replaceFilterCharacter(t),n=[],i=0;i0&&n.push(o)}return n}},{key:"replaceFilterCharacter",value:function(t){return t=t.replace(/=/g,"==").replace(/AND|and/g,"&&").replace(/or|OR/g,"||").replace(/<==/g,"<=").replace(/>==/g,">=")}},{key:"getParseSpecialCharacter",value:function(){var t={};return["(",")","(",")",",",","].forEach(function(e,r){t[e]="$".concat(r)}),t}},{key:"parseSpecialCharacter",value:function(t){var e=this.getParseSpecialCharacter();for(var r in e)for(var n=e[r],i=new RegExp("\\".concat(r),"g");i.test(t);)t=t.replace(i,n);return t}},{key:"parseCondition",value:function(t,e){var r=this,n=t;return t.replace(/&|\||>|<|=|!/g," ").split(" ").filter(function(t){return t}).forEach(function(t){var i=e.find(function(e){return e===t});if(r.startsWithNumber(t)&&i&&(n=n.replace(i,"$"+i)),i){var o=r.parseSpecialCharacter(i);n=n.replace(i,o)}}),n}},{key:"parseConditionFeature",value:function(t){var e={};for(var r in t){var n=r;this.startsWithNumber(r)&&(n="$"+r),e[n=this.parseSpecialCharacter(n)]=t[r]}return e}},{key:"startsWithNumber",value:function(t){return/^\d/.test(t)}},{key:"getEchartsLayerOptions",value:function(t,e,r){var n=this.webMapService.getFeatureProperties(e),i=function(t,e){var r=[];if(e&&e.length){var n,i,o=t.from,a=t.to;if("XY_FIELD"===o.type&&o.xField&&o.yField&&a.xField&&a.yField)e.forEach(function(t){var e=t[o.xField],s=t[o.yField],u=t[a.xField],l=t[a.yField];e&&s&&u&&l&&(n=[t[o.xField],t[o.yField]],i=[t[a.xField],t[a.yField]],r.push({coords:[n,i]}))});else if("PLACE_FIELD"===o.type&&o.field&&a.field){var s=Mi.concat(Pi);e.forEach(function(t){var e=t[o.field],u=t[a.field];n=s.find(function(t){return Bi(t.name,e)}),i=s.find(function(t){return Bi(t.name,u)}),n&&i&&r.push({coords:[n.coord,i.coord]})})}}return r}(t,n),o=this._createPointsData(i,t,n);return this._createOptions(t,i,o,r)}},{key:"getDashStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"array";if(!t)return"array"===r?[]:"";var n,i=e;switch(t){case"solid":n=[];break;case"dot":n=[1,4*i];break;case"dash":n=[4*i,4*i];break;case"dashrailway":n=[8*i,12*i];break;case"dashdot":n=[4*i,4*i,1*i,4*i];break;case"longdash":n=[8*i,4*i];break;case"longdashdot":n=[8*i,4*i,1,4*i];break;default:n=$.isArray(t)?t:(t=R.trim(t).replace(/\s+/g,",")).replace(/\[|\]/gi,"").split(",")}return n="array"===r?n:n.join(",")}},{key:"getCanvasFromSVG",value:function(t,e,r){var n=this,i=document.createElement("canvas");if(i.id="dataviz-canvas-".concat((new Date).getTime()),i.style.display="none",e.appendChild(i),t){var o=(window.canvg||{}).default?window.canvg.default:xOt(),a=i.getContext("2d");o.from(a,t,{ignoreMouse:!0,ignoreAnimation:!0,forceRedraw:function(){return!1}}).then(function(t){t.start(),n.canvgsV.push(t),i.width>300||i.height>300||r(i)})}else r(i)}},{key:"stopCanvg",value:function(){this.canvgsV.forEach(function(t){return t.stop()}),this.canvgsV=[]}},{key:"getRangeStyleGroup",value:function(t,e){var r,n=t.featureType,i=t.style,o=t.themeSetting,a=o.customSettings,s=o.themeField,u=o.segmentCount,l=o.segmentMethod,c=o.colors,f=[];e.forEach(function(t){if(r=t.properties){var e=r[s];(e||0===e)&&!isNaN(+e)&&f.push(parseFloat(e))}},this);var h=f&&f.length&&uq.getArraySegments(f,l,u);if(h){var p=u;r&&h[0]===h[r.length-1]&&(p=1,h.length=2);for(var d=0;dl&&i>0||"\n"===t[i]?(e=t[i],f++,n=!0):(e=o,c=a)}n?h.push(l):h.push(c)},this);for(var p=0;p=l){c=l;break}d>c&&(c=d)}return c+=a,e=f*o+a-6,s.width=c,s.height=e,r.fillStyle=u,r.fillRect(0,0,c,e),r.lineWidth=n.borderWidth,r.strokeStyle=n.borderColor,r.strokeRect(0,0,c,e),{width:c,height:e}}},{key:"_drawTextWithCanvas",value:function(t){var e=t.context,r=t.canvas,n=t.style,i=Number(n.font.replace(/[^0-9]/gi,""))+3,o=n.text.split("\r\n");e.font=n.font;var a=this._drawTextRectAndGetSize({context:e,style:n,textArray:o,lineHeight:i,doublePadding:16,canvas:r}),s=8;o.forEach(function(t,r){0!==r&&(s+=i),e.font=n.font;var o,u=n.textAlign,l=a.width-16;switch(u){case"center":o=l/2;break;case"right":o=l;break;default:o=8}for(var c=t.split(""),f="",h=n.fillColor,p=n.maxWidth-16,d=0;dp&&d>0||"\n"===c[d]?(e.fillStyle=h,e.textAlign=u,e.textBaseline="top",e.fillText(f,o,s),f=c[d],s+=i):f=y}e.fillStyle=h,e.textAlign=u,e.textBaseline="top",e.fillText(f,o,s)},this)}},{key:"handleSvgColor",value:function(t,e){var r=t.fillColor,n=t.fillOpacity,i=t.strokeColor,o=t.strokeOpacity,a=t.strokeWidth,s=e.getContext("2d");t.text?this._drawTextWithCanvas({context:s,canvas:e,style:t}):(r&&(s.fillStyle=iq.getColorWithOpacity(r,n),s.fill()),(i||a)&&(s.strokeStyle=iq.getColorWithOpacity(i,o),s.lineWidth=a,s.stroke()))}},{key:"_createPointsData",value:function(t,e,r){var n=[],i=e.labelSetting;if(!i.show||!t.length)return n;var o=[],a=[];return t.forEach(function(t,e){var n=t.coords,s=n[0],u=n[1],l=r[e][i.from],c=r[e][i.to];!o.find(function(t){return t.value[0]===s[0]&&t.value[1]===s[1]})&&o.push({name:l,value:s}),!a.find(function(t){return t.value[0]===u[0]&&t.value[1]===u[1]})&&a.push({name:c,value:u})}),n=o.concat(a)}},{key:"_createOptions",value:function(t,e,r,n){var i,o=this._createLineSeries(t,e,n);if(r&&r.length){var a=this._createPointSeries(t,r,n);i=o.concat(a)}else i=o.slice();return{series:i,animation:!1}}},{key:"_createPointSeries",value:function(t,e,r){var n=t.lineSetting,i=t.animationSetting,o=t.labelSetting,a=[{name:"point-series",coordinateSystem:r,zlevel:2,label:{normal:{show:o.show,position:"right",formatter:"{b}",color:o.color,fontFamily:o.fontFamily}},itemStyle:{normal:{color:n.color||o.color}},data:e}];return i.show?(a[0].type="effectScatter",a[0].rippleEffect={brushType:"stroke"}):a[0].type="scatter",a}},{key:"_createLineSeries",value:function(t,e,r){var n=t.lineSetting,i=t.animationSetting,o=[{name:"line-series",coordinateSystem:r,type:"lines",zlevel:1,effect:{show:i.show,constantSpeed:i.constantSpeed,trailLength:0,symbol:i.symbol,symbolSize:i.symbolSize},lineStyle:{normal:{color:n.color,type:n.type,width:n.width,opacity:n.opacity,curveness:n.curveness}},data:e}];return e.length>=qOt&&(o[0].large=!0,o[0].largeThreshold=100,o[0].blendMode="lighter"),o}},{key:"_getLayerFeaturesSucceeded",value:function(t,e){switch(t.type){case"feature":this._initOverlayLayer(e,t.features);break;case"restMap":e.layerType="restMap",this._initOverlayLayer(e,t.restMaps);break;case"mvt":e.layerType="mvt",this._initOverlayLayer(e,t);break;case"dataflow":case"noServerId":this._initOverlayLayer(e)}}},{key:"_fire",value:function(t,r){this[e]&&this[e](t,r)}}])&&GOt(i.prototype,o),a&&GOt(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o,a}()}function XOt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function ZOt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{layerFilter:function(){return!0}},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{style:{version:8,sources:{},layers:[]}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),e=tAt(this,n),"string"==typeof t||"number"==typeof t?e.mapId=t:null!==t&&"object"===JOt(t)&&(e.webMapInfo=t),e.mapId||i.center||i.zoom||(i.center=[0,0],i.zoom=0),r.map&&(e.map=r.map),e.options=Object.assign({},r),delete e.options.map,e._setServer(r.server||"https://www.supermapol.com"),e.options.target=r.target||"map",e.options.withCredentials=r.withCredentials||!1,e.mapOptions=i,e.webMapService=new NOt(t,e.options),e.eventTypes=["mapinitialized","mapcreatesucceeded","addlayerssucceeded","mapcreatefailed","getmapfailed","layercreatefailed","getlayersfailed","baidumapnotsupport","dataflowfeatureupdated","projectionnotmatch","layeraddchanged","layerupdatechanged","mapbeforeremove"],e._cacheCleanLayers=[],e._mapInitializedHandler=e._mapInitializedHandler.bind(e),e._mapCreateSucceededHandler=e._mapCreateSucceededHandler.bind(e),e._addLayerChangedHandler=e._addLayerChangedHandler.bind(e),e._initWebMap(!e.map),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rAt(t,e)}(n,t),i=n,(o=[{key:"resize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.map&&this.map.resize(),this._handler&&this._handler.echartsLayerResize();var e=window.getComputedStyle(document.getElementById(this.options.target)),r=this.mapOptions.bounds;if(t&&this.map&&r&&e){var n=this._getResizedZoom(r,e);n!==this.map.getZoom()&&this.map&&this.map.setZoom(n)}}},{key:"setCRS",value:function(t){if(this.map&&(this.mapOptions.crs=t,this.mapOptions.crs)){if(this.map.getCRS("string"==typeof t?t:t.epsgCode))return;t.epsgCode?(this.mapOptions.crs=new r.CRS(this.mapOptions.crs.epsgCode,this.mapOptions.crs.WKT,this.mapOptions.crs.extent,this.mapOptions.crs.unit),this.map.setCRS(this.mapOptions.crs)):this.map.setCRS(r.CRS.get(t))}}},{key:"setCenter",value:function(t){if(this.map&&this._centerValid(t)){this.mapOptions.center=t;var e=this.map.getCenter(),r=e.lng,n=e.lat;t[0]===+r.toFixed(4)&&t[1]===+n.toFixed(4)||this.map.setCenter(t,{from:"setCenter"})}}},{key:"setRenderWorldCopies",value:function(t){this.map&&(this.mapOptions.renderWorldCopies=t,this.map.setRenderWorldCopies(t))}},{key:"setBearing",value:function(t){this.map&&(this.mapOptions.bearing=t,t!==+this.map.getBearing().toFixed(2)&&(t||0===t)&&this.map.setBearing(t))}},{key:"setPitch",value:function(t){this.map&&(this.mapOptions.pitch=t,t!==+this.map.getPitch().toFixed(2)&&(t||0===t)&&this.map.setPitch(t))}},{key:"setStyle",value:function(t){this.map&&(this.mapOptions.style=t,this._initWebMap())}},{key:"setRasterTileSize",value:function(t){var e=this;if(this.map&&!(t<=0)){var r=this.map.getStyle().sources;Object.keys(r).forEach(function(n){"raster"===r[n].type&&"iserver"===r[n].rasterSource&&e._updateRasterSource(n,{tileSize:t})})}}},{key:"setMaxBounds",value:function(t){this.map&&(this.mapOptions.maxBounds=t,t&&this.map.setMaxBounds(t))}},{key:"setMinZoom",value:function(t){this.map&&(this.mapOptions.minZoom=t,(t||0===t)&&this.map.setMinZoom(t))}},{key:"setMaxZoom",value:function(t){this.map&&(this.mapOptions.maxZoom=t,(t||0===t)&&this.map.setMaxZoom(t))}},{key:"setWebMapOptions",value:function(t){this.setServerUrl(t.server),this._createWebMap()}},{key:"setMapOptions",value:function(t){var e=t.center,r=t.zoom,n=t.maxBounds,i=t.minZoom,o=t.maxZoom,a=t.isWorldCopy,s=t.bearing,u=t.pitch;e&&e.length&&this.setCenter(e),r&&this.setZoom(r),n&&this.setMaxBounds(n),i&&this.setMinZoom(i),o&&this.setMaxZoom(o),a&&this.setRenderWorldCopies(a),s&&this.setBearing(s),u&&this.setPitch(u)}},{key:"getLayers",value:function(){return this._handler&&this._handler.getLayers()||[]}},{key:"getLegends",value:function(){return this._handler&&this._handler.getLegends()||[]}},{key:"getLayerCatalog",value:function(){return this._handler&&this._handler.getLayerCatalog()||[]}},{key:"setLayersVisible",value:function(){var t;this._handler&&(t=this._handler).setLayersVisible.apply(t,arguments)}},{key:"toggleLayerVisible",value:function(){var t;this._handler&&(t=this._handler).toggleLayerVisible.apply(t,arguments)}},{key:"getWebMapType",value:function(){return this.type}},{key:"rectifyLayersOrder",value:function(){var t;this._handler&&(t=this._handler).rectifyLayersOrder.apply(t,arguments)}},{key:"updateOverlayLayer",value:function(){var t;this._handler&&(t=this._handler).updateOverlayLayer.apply(t,arguments)}},{key:"copyLayer",value:function(){var t;return this._handler&&(t=this._handler).copyLayer.apply(t,arguments)}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(t&&this._fire("mapbeforeremove",{map:this.map}),this._handler&&(this._handler.clean(t),this._handler=null),this.map=null,this.mapOptions&&(this.mapId||this.webMapInfo)&&(this.mapOptions.center=null,this.mapOptions.zoom=null))}},{key:"cleanLayers",value:function(){if(this.map){var t=this._cacheCleanLayers.filter(function(t){return!t.reused});this._handler&&this._handler.cleanLayers(t),this._cacheCleanLayers=[],this.clean(!1)}}},{key:"_initWebMap",value:function(){var t=this;if((!(arguments.length>0&&void 0!==arguments[0])||arguments[0])&&this.clean(),this.webMapInfo){var e=this.webMapInfo;return e.mapParams={title:this.webMapInfo.title,description:this.webMapInfo.description},this.mapParams=e.mapParams,void Promise.resolve().then(function(){t._getMapInfo(e)}).catch(function(e){t._fire("mapcreatefailed",{error:e})})}this.mapId&&this.options.serverUrl?(this._taskID=new Date,this.getMapInfo(this._taskID)):Promise.resolve().then(function(){t._createMap("MapStyle")}).catch(function(e){t._fire("mapcreatefailed",{error:e})})}},{key:"setZoom",value:function(t){this.map&&(this.mapOptions.zoom=t,t!==+this.map.getZoom().toFixed(2)&&(t||0===t)&&this.map.setZoom(t,{from:"setZoom"}))}},{key:"setServerUrl",value:function(t){this._setServer(t),this.webMapService.setServerUrl(this.options.serverUrl)}},{key:"setWithCredentials",value:function(t){this.options.withCredentials=t,this.webMapService.setWithCredentials(t)}},{key:"setProxy",value:function(t){this.options.proxy=t,this.webMapService.setProxy(t)}},{key:"setMapId",value:function(t){var e=this;"string"==typeof t||"number"==typeof t?(this.mapId=t,this.webMapInfo=null):null!==t&&"object"===JOt(t)&&(this.webMapInfo=t,this.mapId=""),this.webMapService.setMapId(t),t&&setTimeout(function(){e._initWebMap()},0)}},{key:"getMapInfo",value:function(t){var e=this;this.webMapService.getMapInfo().then(function(r){e._taskID===t&&(e.mapParams=r.mapParams,e._getMapInfo(r))},function(t){throw t}).catch(function(t){e._fire("mapcreatefailed",{error:t}),console.log(t)})}},{key:"_createWebMapFactory",value:function(){throw new Error("_createWebMapFactory is not implemented")}},{key:"_mapInitializedHandler",value:function(t){var e=t.map;this.map=e,this._fire("mapinitialized",{map:this.map})}},{key:"_mapCreateSucceededHandler",value:function(t){this.mapParams=t.mapparams,this._cacheCleanLayers=t.layers,this._fire("mapcreatesucceeded",t)}},{key:"_addLayerChangedHandler",value:function(t){this._cacheCleanLayers=t.layers,this.fire("layeraddchanged",t)}},{key:"_getMapInfo",value:function(t){var e=+t.version.split(".")[0]>=3?"WebMap3":"WebMap2";this._createMap(e,t)}},{key:"_createMap",value:function(t,e){var r=this,n=ZOt(ZOt({},this.options),{},{iportalServiceProxyUrlPrefix:this.webMapService.iportalServiceProxyUrl}),i=ZOt(ZOt({},this.eventTypes.reduce(function(t,e){return t[e]=function(t){r._fire(e,t)},t},{})),{},{mapinitialized:this._mapInitializedHandler,mapcreatesucceeded:this._mapCreateSucceededHandler,layeraddchanged:this._addLayerChangedHandler}),o=Zj()(this.mapOptions),a=this._createWebMapFactory(t),s=this.mapId||this.webMapInfo;for(var u in this._handler=new a(s,n,o),i)this._handler.on(u,i[u]);var l={},c=this.options.layerFilter;e&&(l=ZOt(ZOt({},e),{},{layers:"function"==typeof c?e.layers.filter(c):e.layers})),this.type=t,this._handler.initializeMap(l,this.map)}},{key:"_updateRasterSource",value:function(t,e){if(t){var r=this.map.getSource(t);Object.assign(r,e),this.map.style.sourceCaches[t].clearTiles(),this.map.style.sourceCaches[t].update(this.map.transform),this.map.triggerRepaint()}}},{key:"_getResizedZoom",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:nAt,i=e.width,o=e.height,a=Math.abs(t.getEast()-t.getWest()),s=Math.abs(this._getBoundsRadian(t.getSouth())-this._getBoundsRadian(t.getNorth())),u=+Math.log2(n/(a/parseInt(i)*r)).toFixed(2),l=+Math.log2(n/(s/parseInt(o)*r)).toFixed(2);return u<=l?u:l}},{key:"_getBoundsRadian",value:function(t){return 180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360))}},{key:"_centerValid",value:function(t){return!(!t||!(t.length>0||JOt(t)===r.LngLat||t.lng))}},{key:"_getWebMapInstance",value:function(){return this._handler}},{key:"_setServer",value:function(t){this.options.server=Fi(t),this.options.serverUrl=this.options.server}},{key:"_fire",value:function(t,e){var r=this;([["mapcreatesucceeded","addlayerssucceeded"],["mapcreatefailed","getmapfailed"],["layercreatefailed","getlayersfailed"]].find(function(e){return e.includes(t)})||[t]).forEach(function(t){r.fire(t,e)})}}])&&QOt(i.prototype,o),a&&QOt(i,a),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,o,a}()}function oAt(t){"@babel/helpers - typeof";return(oAt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aAt(t){return function(t){if(Array.isArray(t))return sAt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return sAt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sAt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function sAt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function hAt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=bAt(this,e)).map=r.map,t.layers=r.layers||[],t.appendLayers=r.appendLayers||!1,t.unexpectedSourceNames=["tdt-search-","tdt-route-","smmeasure","mapbox-gl-draw","maplibre-gl-draw",/tracklayer-\d+-line/],t.uniqueId=+new Date,t.layersVisibleMap=new Map,t.eventTypes=["layerupdatechanged"],t._styleDataUpdatedHandler=t._styleDataUpdatedHandler.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&wAt(t,e)}(e,Ya),r=e,(n=[{key:"setLayers",value:function(t){this.layers=t}},{key:"createLayerCatalogs",value:function(){throw new Error("createLayerCatalogs is not implemented")}},{key:"getSelfLayerIds",value:function(){throw new Error("getSelfLayerIds is not implemented")}},{key:"initLayers",value:function(){throw new Error("initLayers is not implemented")}},{key:"createAppreciableLayers",value:function(){var t=this.initLayers();return this._initAppreciableLayers(t)}},{key:"getLayerCatalog",value:function(){var t=this.createLayerCatalogs();return this._updateLayerCatalogsVisible(t),this._updateImmutableOrderLayers(t)}},{key:"getLayers",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.createAppreciableLayers();return t&&this.removeLayerExtralFields(e),this._updateImmutableOrderLayers(e,!0)}},{key:"getSelfLayers",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getLayers(),e=this.getSelfLayerIds();return t.filter(function(t){return t.renderLayers.some(function(t){return e.some(function(e){return e===t})})})}},{key:"toggleLayerVisible",value:function(t,e){var r=e?"visible":"none";if("group"===t.type){var n=this._getLayerVisibleId(t);this.layersVisibleMap.set(n,e);var i=Ui(t.children);i.length?this.setLayersVisible(i,r):this.map.style.fire("data",{dataType:"style"})}else this.setLayersVisible([t],r)}},{key:"setLayersVisible",value:function(t,e){var r=this;t.forEach(function(t){var n=r._getLayerVisibleId(t);if(r.layersVisibleMap.set(n,"visible"===e),t.CLASS_INSTANCE&&t.CLASS_INSTANCE.show&&t.CLASS_INSTANCE.hide)return"visible"===e?t.CLASS_INSTANCE.show():t.CLASS_INSTANCE.hide(),void r.map.style.fire("data",{dataType:"style"});t.renderLayers.forEach(function(n){("L7Layer"!==t.CLASS_NAME||r.map.getLayer(n))&&r.map.setLayoutProperty(n,"visibility",e)})})}},{key:"concatExpectLayers",value:function(t,e,r){var n=r.filter(function(t){return!e.some(function(e){return e===t.id})});return this._filterExpectedLayers(t.concat(n))}},{key:"destroy",value:function(){this.map.off("styledata",this._styleDataUpdatedHandler)}},{key:"initDatas",value:function(){this.map&&(this._styleDataUpdatedHandler(),this._registerMapEvent())}},{key:"removeLayerExtralFields",value:function(t){t.forEach(function(t){delete t.metadata})}},{key:"_initAppreciableLayers",value:function(t){var e=this;return t.reduce(function(t,r){var n=Hi(r),i=t.find(function(t){return t.id===n});i||(i=e._createCommonFields(r,n),t.push(i));var o=i.renderLayers.concat(r.layerInfo?r.layerInfo.renderLayers:r.id);return i.renderLayers=Array.from(new Set(o)),t},[])}},{key:"_initSourceList",value:function(t){var e=this;return t.slice().reverse().reduce(function(t,r){var n=r.renderSource.sourceLayer?"".concat(r.renderSource.id,"_").concat(e.uniqueId):r.id,i=r.metadata.SM_Layer_Title||(r.renderSource.sourceLayer?r.renderSource.id:r.title),o=t.find(function(t){return t.id===n});if(!o){var a=new cAt(yAt(yAt({},r),{},{id:n,title:i}));t.push(a),o=a}return o.addLayer(r),t},[])}},{key:"_filterExpectedLayers",value:function(t){var e=this;return t.filter(function(t){return e._excludeLayer(t)})}},{key:"_excludeSource",value:function(t){for(var e=0;e0){var o=this._findLayerCatalog(i.children,e);if(o)return o}}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"_getLayerVisibleId",value:function(t){return"".concat(t.type,"-").concat(t.id)}},{key:"_getLayerVisible",value:function(t){var e=this._getLayerVisibleId(t);return this.layersVisibleMap.has(e)?this.layersVisibleMap.get(e):t.visible}},{key:"_updateLayerCatalogsVisible",value:function(t){var e,r=fAt(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;n.visible=this._getLayerVisible(n),"group"===n.type&&this._updateLayerCatalogsVisible(n.children)}}catch(t){r.e(t)}finally{r.f()}}},{key:"_registerMapEvent",value:function(){this.map.on("styledata",this._styleDataUpdatedHandler)}},{key:"_styleDataUpdatedHandler",value:function(){var t=this.getLayers();this.triggerEvent("layerupdatechanged",{layers:t,relevantLayers:this.getSelfLayers(t),layerCatalog:this.getLayerCatalog()})}},{key:"_updateImmutableOrderLayers",value:function(t,e){var r=t.filter(function(t){return t.layerOrder&&"top"===t.layerOrder.toLowerCase()}),n=r.filter(function(t){return"MIGRATION"===t.type}),i=r.filter(function(t){return"MIGRATION"!==t.type});r=n.concat(i);var o=t.filter(function(t){return t.layerOrder&&"bottom"===t.layerOrder.toLowerCase()}),a=t.filter(function(t){return!t.layerOrder||"auto"===t.layerOrder.toLowerCase()});return e?o.concat(a,r):r.concat(a,o)}}])&&gAt(r.prototype,n),i&&gAt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function SAt(t){"@babel/helpers - typeof";return(SAt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function EAt(t){return function(t){if(Array.isArray(t))return kAt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return kAt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kAt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kAt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=MAt(this,e,[r])).initDatas(),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&LAt(t,e)}(e,_At),r=e,(n=[{key:"createLayerCatalogs",value:function(){var t=this.getLayers(!1);return this._initSourceList(t)}},{key:"getSelfLayerIds",value:function(){return this.layers.reduce(function(t,e){return t.concat(e.renderLayers)},[])}},{key:"initLayers",value:function(){var t=this,e=this._getAllLayersOnMap(),r=e;this.appendLayers&&(r=e.filter(function(e){return t.layers.some(function(r){return t._isBelongToMapJSON(r,e)})}));var n=[],i=[];return this.layers.forEach(function(e){var o=r.filter(function(r){return t._isBelongToMapJSON(e,r)}),a=o.find(function(t){return t.id===e.id});if(o.length>0){if(a)n.push(CAt(CAt({},a),{},{layerInfo:CAt(CAt({},e),{},{dataSource:e.dataSource||e.serverId&&{serverId:e.serverId}})}));else{var s=o.map(function(t){var r=Object.assign({},t);return r.metadata=Object.assign({},r.metadata,{SM_Layer_Title:e.name}),r});n.push.apply(n,EAt(s))}i.push.apply(i,EAt(e.renderLayers))}}),this.concatExpectLayers(n,i,r)}},{key:"_isBelongToMapJSON",value:function(t,e){return t.renderLayers&&t.renderLayers.some(function(t){return t===e.id})}}])&&AAt(r.prototype,n),i&&AAt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function NAt(t){"@babel/helpers - typeof";return(NAt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function RAt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function DAt(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function HAt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function WAt(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(t){HAt(o,n,i,a,s,"next",t)}function s(t){HAt(o,n,i,a,s,"throw",t)}a(void 0)})}}function qAt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function YAt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{layerFilter:function(){return!0}},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{style:{version:8,sources:{},layers:[]}};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),e=JAt(this,i,[t,r,n]),"string"!=typeof t&&"number"!=typeof t||(e.mapId=t),e._centerValid(n.center)&&(e.center=n.center),e.zoom=n.zoom,e.renderWorldCopies=n.renderWorldCopies,e.bounds=n.bounds,e.bearing=n.bearing,e.pitch=n.pitch,e.rasterTileSize=n.rasterTileSize||256,e.layerFilter=r.layerFilter,e.checkSameLayer=r.checkSameLayer,e._taskID=new Date,e._cacheLayerId=new Map,e._layerTimerList=[],e._appendLayers=!1,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&tPt(t,e)}(i,t),o=i,(a=[{key:"initializeMap",value:function(t,e){e&&(this._appendLayers=!0,this.map=e),this._getMapInfo(t,this._taskID)}},{key:"cleanLayers",value:function(t){QAt($At(i.prototype),"cleanLayers",this).call(this,t),this.echartslayer.forEach(function(t){t.remove()})}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),this.stopCanvg(),t&&this.map.remove(),this.map=null,this._legendList=[],this.center=null,this.zoom=null,this._dataflowService&&(this._dataflowService.off("messageSucceeded",this._handleDataflowFeaturesCallback),this._dataflowService.off("subscribesucceeded",this._initDataflowLayerCallback)),this._unprojectProjection=null,this._cacheLayerId=new Map),this._layerTimerList.length&&(this._layerTimerList.forEach(function(t){clearInterval(t)}),this._layerTimerList=[])}},{key:"_initWebMap",value:function(){}},{key:"_loadLayers",value:function(t,e){var r=this;if(this.map){if(this.map.getCRS().epsgCode!==this.baseProjection&&!this.ignoreBaseProjection)return void this.fire("projectionnotmatch",{});this._handleLayerInfo(t,e)}else setTimeout(function(){r._createMap(t),r.map.on("load",function(){r._handleLayerInfo(t,e)})},0)}},{key:"_setCRS",value:function(t,e,r){if(!n.CRS.get(t)){var i=new n.CRS(t,e,r,r[2]>180?"meter":"degree");n.CRS.set(i)}}},{key:"_getMapInfo",value:function(t,e){var r=this;this._mapInfo=t;var i,o,a=t.projection;this.baseProjection=Cq(a);var s=Tq(this.baseProjection,this.specifiedProj4);if(s&&(o=s),n.CRS.get(this.baseProjection))this._defineProj4(a),i=[t.extent.leftBottom.x,t.extent.leftBottom.y,t.extent.rightTop.x,t.extent.rightTop.y],this._setCRS(this.baseProjection,o,i),this._loadLayers(t,e);else if(t.baseLayer&&"MAPBOXSTYLE"===t.baseLayer.layerType){var u=t.baseLayer.dataSource.url;u.indexOf("/restjsr/")>-1&&!/\/style\.json$/.test(u)&&(u+="/style.json"),this.webMapService.getMapBoxStyle(u).then(function(n){i=n&&n.metadata&&n.metadata.indexbounds?n.metadata.indexbounds:[t.extent.leftBottom.x,t.extent.leftBottom.y,t.extent.rightTop.x,t.extent.rightTop.y],r._defineProj4(a),r._setCRS(r.baseProjection,o,i),r._loadLayers(t,e)})}else if(t.baseLayer&&"TILE"===t.baseLayer.layerType)this.getEpsgCodeWKT("".concat(t.baseLayer.url,"/prjCoordSys.wkt"),{withoutFormatSuffix:!0,withCredentials:this.webMapService.handleWithCredentials("",t.baseLayer.url,!1)}).then(function(n){o||(o=n),r.getBounds("".concat(t.baseLayer.url,".json"),{withoutFormatSuffix:!0,withCredentials:r.webMapService.handleWithCredentials("",t.baseLayer.url,!1)}).then(function(n){i=n&&n.bounds?[n.bounds.leftBottom.x,n.bounds.leftBottom.y,n.bounds.rightTop.x,n.bounds.rightTop.y]:[t.extent.leftBottom.x,t.extent.leftBottom.y,t.extent.rightTop.x,t.extent.rightTop.y],r._defineProj4(o,a),r._setCRS(r.baseProjection,o,i),r._loadLayers(t,e)})});else{var l=new Error("Unsupported coordinate system!");console.log(l),this.fire("mapcreatefailed",{error:l})}}},{key:"_handleLayerInfo",value:function(t,e){var r=this;t=this._setLayerID(t),this._mapInfo=t,this.layerAdded=0,this.expectLayerLen=0;var n=t,i=n.layers,o=n.grid;if(this._setExpectLayerLen(t),0===this.expectLayerLen&&this._sendMapToUser(0,0),this._shouldLoadBaseLayer(t,this.layerFilter)&&this._initBaseLayer(t,function(){r._addLayerSucceeded()}),i&&0!==i.length){var a=i;"function"==typeof this.layerFilter&&(a=i.filter(this.layerFilter)),this._initOverlayLayers(a,e)}o&&o.graticule&&this._initGraticuleLayer(o.graticule)}},{key:"_setExpectLayerLen",value:function(t){this._shouldLoadBaseLayer(t,this.layerFilter)&&this.expectLayerLen++;var e=t.layers;e&&e.length>0&&("function"==typeof this.layerFilter&&(e=e.filter(this.layerFilter)),this.expectLayerLen+=e.length),t.grid&&t.grid.graticule&&this.expectLayerLen++}},{key:"_shouldLoadBaseLayer",value:function(t,e){var r=t.baseLayer;return!!r&&("function"!=typeof e||e(r))}},{key:"_createMap",value:function(t){var e=this,i=this._getLabelFontFamily(t),o=this._getMapCenter(t),a=t.level||0,s=this.mapOptions,u=s.bounds,l=s.minZoom,c=s.maxZoom,f=this.mapOptions.interactive;if(isNaN(l)&&(l=t.minScale?this._transformScaleToZoom(t.minScale,n.CRS.get(this.baseProjection)):0),isNaN(c)&&(c=t.maxScale?this._transformScaleToZoom(t.maxScale,n.CRS.get(this.baseProjection)):22),t.visibleExtent&&4===t.visibleExtent.length&&!u&&(u=[this._unproject([t.visibleExtent[0],t.visibleExtent[1]]),this._unproject([t.visibleExtent[2],t.visibleExtent[3]])]),l>c){var h=[c,l];l=h[0],c=h[1]}u||(a+=t.minScale&&t.maxScale?Math.min(this._transformScaleToZoom(t.minScale,n.CRS.get(this.baseProjection)),this._transformScaleToZoom(t.maxScale,n.CRS.get(this.baseProjection))):+Math.log2(this._getResolution(n.CRS.get(this.baseProjection).getExtent())/this._getResolution(t.extent)).toFixed(2)),this.map=new r(YAt(YAt({},this.mapOptions),{},{container:this.target,center:this.center||o,zoom:this.zoom||a,minZoom:l,maxZoom:c,bearing:this.bearing||0,pitch:this.pitch||0,bounds:u,interactive:void 0===f||f,style:{version:8,sources:{},layers:[]},crs:this.baseProjection,localIdeographFontFamily:i||"",renderWorldCopies:this.renderWorldCopies||!1,transformRequest:function(t,r){if("Tile"===r){e.isSuperMapOnline&&0===t.indexOf("http://")&&(t="https://www.supermapol.com/apps/viewer/getUrlResource.png?url=".concat(encodeURIComponent(t))),e.webMapService.isIportalResourceUrl(t)&&(t=e.webMapService.handleParentRes(t));var n=e.webMapService.handleProxy("image");return{url:t,credentials:e.webMapService.handleWithCredentials(n,t,!1)?"include":void 0}}return{url:t}},fadeDuration:0})),this.fire("mapinitialized",{map:this.map})}},{key:"_createMVTBaseLayer",value:function(t,e){var r=this,n=t.dataSource.url;n.indexOf("/restjsr/")>-1&&!/\/style\.json$/.test(n)&&(n+="/style.json"),this.webMapService.getMapBoxStyle(n).then(function(n){if(Object.keys(n.sources).some(function(t){return r.map.getSource(t)}))e&&e();else{n.layers.forEach(function(e){e.layout&&(e.layout.visibility=r._getVisibility(t.visible))}),r.map.addStyle(n);var i=[];n.layers.forEach(function(t){"background"!==t.type&&i.push(t.id)}),r._setCacheLayer({parentLayerId:t.layerID||t.name,subRenderLayers:i.map(function(t){return{layerId:t}})}),e&&e()}},function(t){throw e&&e(),new Error(t)}).catch(function(e){r.fire("layercreatefailed",{error:e,layer:t,map:r.map})})}},{key:"_initBaseLayer",value:function(t,e){var r,n=t.baseLayer||t,i=this.getBaseLayerType(n),o=this.getMapurls();switch(this.baseLayerProxy=this.webMapService.handleProxy("image"),i){case"TIANDITU":this.baseLayerProxy=null,this._createTiandituLayer(t,e);break;case"BING":this.baseLayerProxy=null,this._createBingLayer(n.layerID||n.name,n,e);break;case"WMS":this._createWMSLayer(n,e);break;case"WMTS":this._createWMTSLayer(n,e);break;case"TILE":this._createDynamicTiledLayer(n,e);break;case"CLOUD":case"XYZ":r=o[n.layerType].replace("{googleMapsLanguage}",this.googleMapsLanguage).replace("{googleMapsAPIKey}",this.googleMapsAPIKey),this._createXYZLayer(n,r,e);break;case"BAIDU":this.fire("baidumapnotsupport",{}),e&&e();break;case"MAPBOXSTYLE":this._createMVTBaseLayer(n,e)}}},{key:"_initOverlayLayers",value:function(t,e){var r=this;this.expectLayerLen>0&&t.forEach(function(t){var n=r.webMapService.getDatasourceType(t);if("SAMPLE_DATA"===n)return r._addLayerSucceeded(),void r.fire("layercreatefailed",{error:"SAMPLE DATA is not supported",layer:t,map:r.map});if(t.visibleScale){var i=t.visibleScale,o=i.minScale,a=i.maxScale,s=r.map.getCRS();t.minzoom=Math.max(r._transformScaleToZoom(o,s),0),t.maxzoom=Math.min(24,r._transformScaleToZoom(a,s)+1e-7)}"tile"===n?(t.autoUpdateTime&&r._layerTimerList.push(setInterval(function(){r._initBaseLayer(t)},t.autoUpdateTime)),r._initBaseLayer(t,function(){r._addLayerSucceeded()})):(r.getLayerFeatures(t,e,n),t.autoUpdateTime&&r._layerTimerList.push(setInterval(function(){r.getLayerFeatures(t,e,n)},t.autoUpdateTime)))},this)}},{key:"_initOverlayLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=t.layerID,i=t.layerType,o=t.visible,a=t.style,s=t.featureType,u=t.projection;t.visible=o?"visible":"none",e=Gi({sourceId:n,features:e,mergeByField:r,map:this.map}),"restMap"!==i?"mvt"!==i?(e&&e[0]&&e[0].geometry&&"Polygon"===e[0].geometry.type&&(e=this._handleMultyPolygon(e)),e&&u&&"EPSG:4326"!==u&&t.dataSource&&"REST_DATA"!==t.dataSource.type&&(this._unprojectProjection=this._defineProj4(u),e=this.transformFeatures(e)),e=this.handleLayerFeatures(e,t),"VECTOR"===i?"POINT"===s?"SYMBOL_POINT"===a.type?this._createSymbolLayer(t,e):this._createGraphicLayer(t,e):(this._createVectorLayer(t,e),this._addLayerSucceeded({layerInfo:t,features:e})):"UNIQUE"===i?this._createUniqueLayer(t,e):"RANGE"===i?this._createRangeLayer(t,e):"HEAT"===i?this._createHeatLayer(t,e):"MARKER"===i?this._createMarkerLayer(t,e):"MIGRATION"===i?this._createMigrationLayer(t,e):"RANK_SYMBOL"===i?this._createRankSymbolLayer(t,e):this._isDataflowLayer(i)&&this._createDataflowLayer(t)):this._createMvtLayer(e.info,t,e.featureType):this._createRestMapLayer(e,t)}},{key:"_initGraticuleLayer",value:function(t){var e=this._createGraticuleOptions(t),r=new n.supermap.GraticuleLayer(e);this._setGraticuleDash(e.strokeStyle,r),this._graticuleLayer=r,this.map.addLayer(r),this._setCacheLayer({parentLayerId:r.id,subRenderLayers:[{layerId:r.id},{layerId:r.sourceId}],metadata:{SM_Layer_Order:"Top"}}),this._addLayerSucceeded()}},{key:"_createGraticuleOptions",value:function(t){var e=t.extent,r=t.lonLabelStyle,n=t.latLabelStyle,i=t.strokeColor,o=t.lineDash,a=t.strokeWidth,s=t.interval,u={lineColor:i,lindDasharray:o,lineWidth:a};return r={textFont:r.fontFamily.split(","),textSize:r.fontSize,textAnchor:n.textBaseline,textColor:r.fill,textHaloColor:r.outlineColor,textHaloWidth:r.outlineWidth},n={textFont:n.fontFamily.split(","),textSize:n.fontSize,textAnchor:n.textBaseline,textColor:n.fill,textHaloColor:n.outlineColor,textHaloWidth:n.outlineWidth},e=e||this.map.getCRS().extent,{minZoom:1,strokeStyle:u,extent:e=[this._unproject([e[0],e[1]]),this._unproject([e[2],e[3]])],interval:s&&s[0],lngLabelStyle:r,latLabelStyle:n,layerID:"graticuleLayer_".concat(+new Date)}}},{key:"_setGraticuleDash",value:function(t,e){var r=this;this.map.on("zoomend",function(){r.map.getZoom()<3?e.setStrokeStyle(YAt(YAt({},t),{},{lineOpacity:.5,lineWidth:t.lineWidth/2,lindDasharray:[.1,3]})):e.setStrokeStyle(t)})}},{key:"_createTiandituLayer",value:function(t,e){var r=this._getTiandituUrl(t),n=t.baseLayer,i=n.labelLayerVisible,o=n.name,a=n.visible,s=Boolean(i),u=r.labelUrl,l=r.tiandituUrl;this._addBaselayer({url:l,layerID:o,visibility:a}),s&&this._addBaselayer({url:u,layerID:this._getTdtLabelLayerName(o),parentLayerId:o,visibility:a}),e&&e()}},{key:"_createWMTSLayer",value:function(t,e){var r=this;this.webMapService.getWmtsInfo(t,this.map.getCRS().epsgCode).then(function(n){var i=t.layerID||t.name;if(n.isMatched){var o=r._getWMTSUrl(Object.assign({},t,n));r._addBaselayer({url:[o],layerID:i,visibility:t.visible,minzoom:n.matchMinZoom,maxzoom:n.matchMaxZoom,isIserver:!1,bounds:n.bounds}),e&&e()}},function(t){throw e&&e(),new Error(t)}).catch(function(e){r.fire("layercreatefailed",{error:e,layer:t,map:r.map})})}},{key:"_createBingLayer",value:function(){var t=WAt(VAt().mark(function t(e,r,n){var i,o,a,s;return VAt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/RoadOnDemand?uriScheme=https&include=ImageryProviders&key=".concat(this.bingMapsKey,"&c=zh-cn"),t.next=3,this._fetchRequest(i,"json",{withoutFormatSuffix:!0});case 3:if(200===(o=t.sent).statusCode&&1===o.resourceSets.length&&1===o.resourceSets[0].resources.length){t.next=6;break}return t.abrupt("return");case 6:a=o.resourceSets[0].resources[0],s=a.imageUrlSubdomains.map(function(t){return a.imageUrl.replace("{subdomain}",t)}),this._addBaselayer({url:s,layerID:e,visibility:r.visible}),n&&n();case 10:case"end":return t.stop()}},t,this)}));return function(e,r,n){return t.apply(this,arguments)}}()},{key:"_createXYZLayer",value:function(t,e,r){var n=[];if("OSM"===t.layerType){for(var i=e.match(/\w\-\w/g)[0],o=i[0],a=i[2],s="",u=97;u<123;u++)s+=String.fromCharCode(u);for(var l=s.split(""),c=l.indexOf(o),f=l.indexOf(a),h=l.slice(c,f+1),p=0;p1&&void 0!==arguments[1]?arguments[1]:"1.1.1",r=t.url,n={service:"WMS",request:"GetMap",layers:null!==t.layers&&"object"===UAt(t.layers)?t.layers.join(","):t.layers||"0",styles:"",format:"image/png",transparent:"true",version:e,width:256,height:256};return"1.3.0"===e?(n.bbox="EPSG:4326"===this.baseProjection?"{bbox-wms-1.3.0}":"{bbox-epsg-3857}",n.crs=this.baseProjection):(n.bbox="{bbox-epsg-3857}",n.srs=this.baseProjection),$.urlAppend(r,this._getParamString(n,r))}},{key:"_setLayerID",value:function(t){var e=this,r={},n=t.baseLayer,i=t.layers,o=void 0===i?[]:i;if(!this.checkSameLayer){var a=this._generateUniqueLayerId({layerId:n.name,repeatIndex:0});n.title=n.name,n.name=a.newId}var s=o.map(function(t){return t.name}),u=o.map(function(t,i){t.name in r||(r[t.name]=n.name===t.name?1:0);var o=s.indexOf(t.name),a=s.lastIndexOf(t.name);i>o&&i<=a&&(r[t.name]=r[t.name]+1);var u=r[t.name]?"".concat(t.name,"-").concat(r[t.name]):t.name;if(!e.checkSameLayer||"raster"!==t.layerType){var l=e._generateUniqueLayerId({layerId:u,repeatIndex:r[t.name],layerType:t.layerType}),c=l.newId,f=l.newIndex;r[t.name]=f,u=c}return Object.assign(t,{layerID:u})});return t.layers=u,t.baseLayer=n,t}},{key:"_generateUniqueLayerId",value:function(t){var e=t.layerId,r=t.repeatIndex,n=t.layerType;return this.map.getLayer(e)?(r++,e=e.match(/-\d+&/gi)?e.replace(/\d+$/gi,r):"".concat(e,"-").concat(r),this._generateUniqueLayerId(YAt(YAt({},t),{},{layerId:e,repeatIndex:r}))):this._isDataflowLayer(n)?{newId:"".concat(e,"_").concat(+new Date),newIndex:r+1}:{newId:e,newIndex:r}}},{key:"_createRestMapLayer",value:function(t,e){var r=this;t.forEach(function(t){e=r.getRestMapLayerInfo(t,e),r._initBaseLayer(e)}),this._addLayerSucceeded()}},{key:"_addLayerSucceeded",value:function(t){(((t||{}).layerInfo||{}).labelStyle||{}).labelField&&"DATAFLOW_POINT_TRACK"!==t.layerInfo.layerType&&this._addLabelLayer(t.layerInfo,t.features,!1),this.layerAdded++,this._sendMapToUser(this.layerAdded,this.expectLayerLen)}},{key:"_createDataflowLayer",value:function(t){var e=new n.supermap.DataFlowService(t.wsUrl).initSubscribe();this._handleDataflowFeaturesCallback=this._handleDataflowFeatures.bind(this,t),this._initDataflowLayerCallback=this._initDataflowLayer.bind(this,t),e.on("subscribesucceeded",this._initDataflowLayerCallback),e.on("messageSucceeded",this._handleDataflowFeaturesCallback),this._dataflowService=e}},{key:"_initDataflowLayer",value:function(){this._addLayerSucceeded()}},{key:"_handleDataflowFeatures",value:function(t,e){var r=[JSON.parse(e.data)];if(this.fire("dataflowfeatureupdated",{features:r,identifyField:t.identifyField,layerID:t.layerID}),"EPSG:4326"!==t.projection&&(r=this.transformFeatures(r)),t.filterCondition){var n=this.replaceFilterCharacter(t.filterCondition),i=r[0].properties||{};n=this.parseCondition(n,Object.keys(i));var o=this.parseConditionFeature(i),a="select * from json where ("+n+")",s=window.jsonsql.query(a,{attributes:o});s&&s.length>0&&this._addDataflowLayer(t,r[0])}else this._addDataflowLayer(t,r[0])}},{key:"_getDataFlowRotateStyle",value:function(t,e,r){var n=["match",["get",r]];return t.forEach(function(t){var i;if((i=void 0!==e&&"未设置"!==e&&"None"!==e?t.properties[e]:0)>360||i<0)return null;n.push(t.properties[r],parseInt(i))}),n.push(0),n}},{key:"_addDataflowLayer",value:function(){var t=WAt(VAt().mark(function t(e,r){var n,i,o,a,s,u;return VAt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.layerID,"DATAFLOW_HEAT"!==e.layerType){t.next=5;break}this.map.getSource(n)?this._updateDataFlowFeature(n,r,e):this._createHeatLayer(e,[r],!1),t.next=20;break;case 5:if(i=e.pointStyle,e.style=i,this.map.getSource(n)){t.next=17;break}if(o=this._getDataFlowRotateStyle([r],e.directionField,e.identifyField),!["BASIC_POINT","SVG_POINT","IMAGE_POINT"].includes(i.type)){t.next=14;break}return t.next=12,this._createGraphicLayer(e,[r],null,o,!1);case 12:t.next=15;break;case 14:this._createSymbolLayer(e,[r],null,o,!1);case 15:t.next=18;break;case 17:this._updateDataFlowFeature(n,r,e,"point");case 18:e.labelStyle&&e.visible&&(a=this._getSymbolLabelLayerName(n),this.map.getSource(a)?this._updateDataFlowFeature(a,r,e):this._addLabelLayer(e,[r],!0)),e.lineStyle&&e.visible&&(this.map.getSource(n+"-line")?this._updateDataFlowFeature(n+"-line",r,e,"line"):(s=r.geometry.coordinates,u={type:"Feature",properties:r.properties,geometry:{type:"LineString",coordinates:[s]}},this._createVectorLayer({style:e.lineStyle,featureType:"LINE",visible:"visible",layerID:n+"-line",parentLayerId:n},[u])));case 20:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"_updateDataFlowFeature",value:function(t,e,r,n){var i=r.identifyField,o=r.maxPointCount,a=r.directionField,s=Zj()(this.map.getSource(t)._data.features),u=!1;if(s.forEach(function(t,r){if(t.properties[i]===e.properties[i])if(u=!0,"line"===n){var a=t.geometry.coordinates;a.push(e.geometry.coordinates),o&&a.length>o&&a.splice(0,a.length-o),s[r].geometry.coordinates=a}else s[r]=e}),u||("line"===n?s.push({type:"Feature",properties:e.properties,geometry:{type:"LineString",coordinates:[e.geometry.coordinates]}}):s.push(e)),this.map.getSource(t).setData({type:"FeatureCollection",features:s}),"point"===n){var l=r.pointStyle.type,c=this._getDataFlowRotateStyle(s,a,i);["SVG_POINT","IMAGE_POINT"].includes(l)?this.map.setLayoutProperty(t,"icon-rotate",c):"SYMBOL_POINT"===l&&this.map.setLayoutProperty(t,"text-rotate",c)}}},{key:"_createMigrationLayer",value:function(t,e){var r=t.layerID,n=t.layerType,i=this.getEchartsLayerOptions(t,e,"GLMap");i.GLMap={roam:!0};var o=new window.EchartsLayer(this.map);o.chart.setOption(i),this.echartslayer.push(o),this._addLayer({id:r,type:n,setLayoutProperty:function(t,e){"visibility"===t&&(o.chart._dom.style.display="visible"===e?"block":"none")},metadata:{SM_Layer_Order:"top"}}),this._addLayerSucceeded({layerInfo:t,features:e})}},{key:"_createRankSymbolLayer",value:function(t,e){var r=t.minzoom,n=t.maxzoom,i=t.themeSetting.themeField,o=t.themeSetting.colors,a=t.style,s=t.featureType,u=this.createRankStyleSource(t,e).styleGroups;e=this.getFilterFeatures(t.filterCondition,e);for(var l=["match",["get","index"]],c=["match",["get","index"]],f=0;f0&&(a.fillColor=c),"SYMBOL_POINT"===a.type)this._createSymbolLayer(t,e,l);else if(["SVG_POINT","IMAGE_POINT"].includes(a.type))this._createGraphicLayer(t,e,l);else{var v={type:"geojson",data:{type:"FeatureCollection",features:e}},g={layout:{visibility:t.visible},style:this._transformStyleToMapBoxGl(t.style,s,l,"circle-radius")},m=t.layerID;this._addOverlayToMap({type:s,source:v,layerID:m,layerStyle:g,minzoom:r,maxzoom:n}),this._addLayerSucceeded({layerInfo:t,features:e})}}},{key:"_addTextBackgroundImage",value:function(t){if(!t[3])return"";for(var e=new Uint8Array(1600),r=0;r<20;r++)for(var n=0;n<20;n++){var i=4*(20*n+r);e[i+0]=t[0],e[i+1]=t[1],e[i+2]=t[2],e[i+3]=255*t[3]}var o="text-background-".concat(t.join("-"));return this.map.hasImage(o)||this.map.addImage(o,{width:20,height:20,data:e},{stretchX:[[0,20]],stretchY:[[0,20]],content:[0,0,20,20]}),o}},{key:"_addLabelLayer",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this._getSymbolLabelLayerName(t.layerID);if(!this.map.getLayer(n)){var i=t.labelStyle,o=e[0]&&e[0].properties,a=i.labelField.replace(/{(.+)}/g,"$1");if(o&&o[a]){var s=i.backgroundFill,u=void 0===s?[255,255,255,0]:s,l=i.fontFamily,c=t.minzoom,f=t.maxzoom,h=parseFloat(i.fontSize||14),p="";"line"!==i.placement&&(p=this._addTextBackgroundImage(u)),u="rgba(".concat(u.join(","),")");var d="rgba(255,255,255,0)";i.outlineColor&&i.outlineWidth>0&&(d=i.outlineColor);var y=(i.outlineWidth||0)/2,v=i.textAlign||"center";i.textBaseline&&"middle"!==i.textBaseline&&(v="".concat(i.textBaseline).concat("center"===v?"":"-".concat(v)));var g="POINT"===t.featureType?[i.offsetX/h||0,i.offsetY/h||0]:[0,0],m={"text-field":"{".concat(i.labelField,"}"),"text-size":h,"text-offset":g,"text-font":l?[l]:["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line"===i.placement?"POLYGON"===t.featureType?"line":"line-center":"point","text-max-angle":"POLYGON"===t.featureType?40:30,"symbol-spacing":"POLYGON"===t.featureType?200:50,"text-anchor":v,"text-line-height":1.2,visibility:t.visible};p&&Object.assign(m,{"icon-image":p,"icon-allow-overlap":!0,"icon-text-fit":"both","icon-text-fit-padding":[2,4,2,4]}),this._addLayer({id:n,type:"symbol",source:this.map.getSource(t.layerID)&&!r?t.layerID:{type:"geojson",data:{type:"FeatureCollection",features:e}},paint:{"text-color":i.fill,"text-halo-color":d,"text-halo-width":y},layout:m,minzoom:c||0,maxzoom:f||22},t.layerID)}}}},{key:"_createSymbolLayer",value:function(t,e,r,n){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=arguments.length>5?arguments[5]:void 0;document.getElementById("".concat(this.target)).classList.add("supermapol-icons-map");var a=t.layerID,s=t.minzoom,u=t.maxzoom,l=t.style,c=l.unicode,f=String.fromCharCode(parseInt(c.replace(/^&#x/,""),16)),h=r||(Array.isArray(l.fontSize)?l.fontSize:l.fontSize&&parseFloat(l.fontSize)||12),p=Array.isArray(l.rotation)?l.rotation:180*(l.rotation||0)/Math.PI;this.map.getSource(a)||this.map.addSource(a,{type:"geojson",data:{type:"FeatureCollection",features:[]}});var d={id:a,type:"symbol",source:a,paint:{"text-color":Array.isArray(l.fillColor)?l.fillColor:iq.getColorWithOpacity(l.fillColor,l.fillOpacity),"text-halo-color":Array.isArray(l.strokeColor)?l.strokeColor:iq.getColorWithOpacity(l.strokeColor||"rgba(0,0,0,0)",l.strokeOpacity),"text-halo-width":l.strokeWidth||0},layout:{"text-field":f,"text-size":h,"text-font":["supermapol-icons"],"text-rotate":n||p||0,"text-offset":Array.isArray(l.offsetX)?l.offsetX:[l.offsetX/2||0,l.offsetY/2||0],"text-allow-overlap":!0,visibility:t.visible},minzoom:s||0,maxzoom:u||22};o&&(d.filter=o),this._addLayer(d),this.map.getSource(a).setData({type:"FeatureCollection",features:e}),i&&this._addLayerSucceeded({layerInfo:t,features:e})}},{key:"_createGraphicLayer",value:function(){var t=WAt(VAt().mark(function t(e,r,n,i){var o,a,s=this,u=arguments;return VAt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=!(u.length>4&&void 0!==u[4])||u[4],a=u.length>5?u[5]:void 0,t.abrupt("return",new Promise(function(t){var u=e.layerID,l=e.minzoom,c=e.maxzoom,f=e.style,h={type:"geojson",data:{type:"FeatureCollection",features:r}};s.map.getSource(u)?s.map.getSource(u).setData(h.data):s.map.addSource(u,h);var p="imageIcon-".concat(u);if("IMAGE_POINT"===f.type){var d=f.imageInfo;s.map.loadImage(d.url,function(h,d){if(h)console.error(h);else{var y=2*Number.parseFloat((f.radius/d.width).toFixed(2));!s.map.hasImage(p)&&s.map.addImage(p,d);var v={id:u,type:"symbol",source:u,layout:{"icon-image":p,"icon-anchor":"bottom-right","icon-size":n||y,"icon-allow-overlap":!0,visibility:e.visible,"icon-offset":[f.offsetX*d.width||0,f.offsetY*d.height||0],"icon-rotate":i||180*(e.style.rotation||0)/Math.PI},minzoom:l||0,maxzoom:c||22};a&&(v.filter=a),s._addLayer(v),o&&s._addLayerSucceeded({layerInfo:e,features:r}),t()}})}else if("SVG_POINT"===f.type){var y=f.url;s._svgDiv||(s._svgDiv=document.createElement("div"),document.body.appendChild(s._svgDiv)),s.getCanvasFromSVG(y,s._svgDiv,function(h){var p=h.toDataURL("img/png");p&&s.map.loadImage(p,function(p,d){p&&console.log(p);var v=2*Number.parseFloat((f.radius/h.width).toFixed(2));n&&Array.isArray(n)&&(n=n.map(function(t,e){return"number"==typeof t&&e%2==1?t/h.width*2:t})),!s.map.hasImage(y)&&s.map.addImage(y,d,{sdf:!0});var g={id:u,type:"symbol",source:u,layout:{"icon-image":y,"icon-size":n||v,"icon-anchor":"bottom-right",visibility:e.visible,"icon-offset":[f.offsetX*h.width||0,f.offsetY*h.height||0],"icon-allow-overlap":!0,"icon-rotate":i||180*(e.style.rotation||0)/Math.PI},paint:{"icon-color":f.fillColor},minzoom:l||0,maxzoom:c||22};a&&(g.filter=a),s._addLayer(g),o&&s._addLayerSucceeded({layerInfo:e,features:r}),t()})})}else{var v={style:s._transformStyleToMapBoxGl(f,e.featureType),layout:{visibility:e.visible}};s._addOverlayToMap({type:"POINT",source:u,layerID:u,layerStyle:v,minzoom:l,maxzoom:c}),o&&s._addLayerSucceeded({layerInfo:e,features:r}),t()}}));case 3:case"end":return t.stop()}},t)}));return function(e,r,n,i){return t.apply(this,arguments)}}()},{key:"_createUniqueLayer",value:function(){var t=WAt(VAt().mark(function t(e,r){var n,i,o,a,s,u,l,c,f,h,p,d,y,v,g,m,b,x,w,_,S,E,k,T,C,O,A,P,M,I,L,j,N,R,D,B,F,z,G,U,V,H,W,q,Y,X,Z,K,J,Q,$,tt,et,rt,nt=this;return VAt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:n={unicode:function(t){var e=t.unicode;return String.fromCharCode(parseInt(e.replace(/^&#x/,""),16))},fontSize:function(t){var e=t.fontSize;return e?parseFloat(e):12},rotation:function(t){return 180*(t.rotation||0)/Math.PI},fillColor:function(t){var e=t.fillColor,r=t.fillOpacity;return iq.getColorWithOpacity(e,r)},strokeColor:function(t){var e=t.strokeColor,r=t.strokeOpacity;return iq.getColorWithOpacity(e||"rgba(0,0,0,0)",r)},strokeWidth:function(t){return t.strokeWidth||0},offsetX:function(t){var e=t.offsetX,r=t.offsetY;return[e/2||0,r/2||0]}},i={unicode:"",fontSize:12,rotation:0,strokeColor:"rgba(0,0,0,0)",fillColor:"rgba(0,0,0,0)",strokeWidth:0,offsetX:[0,0]},o=this.getUniqueStyleGroup(e,r),r=this.getFilterFeatures(e.filterCondition,r),a=e.layerID,s=e.minzoom,u=e.maxzoom,l=e.style,c=o[0].themeField,f=e.featureType,h=e.style,p={},d={},o.forEach(function(t){d[t.value]=t}),r.forEach(function(t){var e=t.properties,r=d[e[c]];if(r){var i=r.style;for(var o in i)if(Object.prototype.hasOwnProperty.call(i,o)){var a=i[o];a!==h[o]&&(p[o]||(p[o]=["match",["get","index"]]),p[o].push(e.index,n[o]?n[o](i):a))}}}),t.t0=VAt().keys(p);case 13:if((t.t1=t.t0()).done){t.next=27;break}if(y=t.t1.value,!Object.prototype.hasOwnProperty.call(p,y)){t.next=25;break}if(v=p[y],Array.isArray(v)){t.next=19;break}return t.abrupt("continue",13);case 19:g=h[y]||i[y],m=XAt({},y,g),"fillColor"===y&&(p.fillOpacity=1,m.fillOpacity=isNaN(h.fillOpacity)?1:h.fillOpacity),"strokeColor"===y&&(p.strokeOpacity=1,m.strokeOpacity=isNaN(h.strokeOpacity)?1:h.strokeOpacity),b=n[y],v.push(void 0===g?null:b&&b(m)||g);case 25:t.next=13;break;case 27:if(this._initLegendConfigInfo(e,o),x={type:"geojson",data:{type:"FeatureCollection",features:r}},w=a,this.map.getSource(w)?this.map.getSource(w).setData(x.data):this.map.addSource(w,x),_=e.visible,S=function(t){var e=t.type,r=t.sourceID,n=t.layerID,i=t.parentLayerId,o=t.beforeId,a=t.style,s=t.minzoom,u=t.maxzoom,l=t.filter,c={style:nt._transformStyleToMapBoxGl(YAt({},a),e),layout:{visibility:_}};nt._addOverlayToMap({type:e,source:r,layerID:n,parentLayerId:i,beforeId:o,layerStyle:c,minzoom:s,maxzoom:u,filter:l})},!["POLYGON","LINE"].includes(f)){t.next=43;break}if(E=p.lineDash,k=["all"],T=!1,C="",E&&E.length>1){for(delete p.lineDash,O=E[1],A="POLYGON"===f?a+"-strokeLine":a,P=2;P1&&S({type:"LINE",sourceID:w,layerID:A,parentLayerId:a,style:YAt(YAt(YAt({},l),p),{},{lineDash:E[E.length]}),minzoom:s,maxzoom:u,filter:k}),T=!0}"LINE"!==f||T||S({type:"LINE",sourceID:w,layerID:a,style:YAt(YAt({},l),p),minzoom:s,maxzoom:u,filter:k}),"POLYGON"===f&&(S({type:"POLYGON",sourceID:w,layerID:a,beforeId:C,style:YAt(YAt({},l),p),minzoom:s,maxzoom:u}),C&&this.map.moveLayer(a,C),T||S({type:"LINE",sourceID:w,layerID:a+"-strokeLine",parentLayerId:a,style:YAt(YAt({},l),p),minzoom:s,maxzoom:u,filter:k})),t.next=80;break;case 43:if(L=["all"],j=p.unicode){for(N=p.className||[],delete p.unicode,delete p.classname,R="".concat(a,"-additional-symbol"),D=["any"],B=2;B1&&(z.filter=D),this._addLayer(z,a)}if(G=p.imageInfo||[],U=p.url||[],!(G.length>0||U.length>0)){t.next=66;break}for(delete p.imageInfo,delete p.url,V=[],H=G.length>0?[G[0],G[1]]:[],W=U.length>0?[U[0],U[1]]:[],q=["any"],Y=["any"],X=2;X1){for(var l=["match",["get","index"]],c=2;c1){for(var y=["match",["get","index"]],v=2;v1?L:void 0),t.next=80;break;case 72:if("IMAGE_POINT"!==l.type&&"SVG_POINT"!==l.type){t.next=79;break}return(rt=YAt({},e)).style=YAt(YAt(YAt({},l),p),{},{type:l.type}),t.next=77,this._createGraphicLayer(rt,r,"","",!1,L.length>1?L:void 0);case 77:t.next=80;break;case 79:S({type:"POINT",sourceID:w,layerID:a,style:YAt(YAt({},l),p),minzoom:s,maxzoom:u,filter:L.length>1?L:void 0});case 80:this._addLayerSucceeded({layerInfo:e,features:r});case 81:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}()},{key:"_getWMTSUrl",value:function(t){if("REST"===t.requestEncoding&&t.restResourceURL)return t.restResourceURL.replace("{Style}",t.style||"").replace("{TileMatrixSet}",t.tileMatrixSet).replace("{TileRow}","{y}").replace("{TileCol}","{x}").replace("{TileMatrix}","{z}");var e={service:"WMTS",request:"GetTile",version:"1.0.0",style:t.style||"",layer:t.layer,tilematrixSet:t.tileMatrixSet,format:"image/png",tilematrix:"{z}",tilerow:"{y}",tilecol:"{x}"};return $.urlAppend(t.kvpResourceUrl,this._getParamString(e,t.kvpResourceUrl))}},{key:"_createMarkerLayer",value:function(t,e){var r=this,n=t.minzoom,i=t.maxzoom,o=t.layerID,a={};(e=e||[]).forEach(function(t,e){var n=t.dv_v5_markerStyle,i=t.geometry.type.toUpperCase();"POINT"===i&&n.text&&(i="TEXT");var s=0===e?o:o+"-"+i+"-"+e;"POINT"===i&&n.src&&-1===n.src.indexOf("http://")&&-1===n.src.indexOf("https://")&&(n.src=r.serverUrl+n.src),a[s]||(a[s]={src:n.src,defaultStyle:n,geomType:i})});var s=function(t,e){var n=e.src,i=e.defaultStyle,o=e.geomType;return new Promise(function(e){n||"TEXT"===o?n&&n.indexOf("svg")<0&&(n.startsWith("http://")||n.startsWith("https://"))?r.map.loadImage(n,function(i,o){if(i)return console.log(i),void e(i);!r.map.hasImage(n)&&r.map.addImage(n,o),e(XAt({},t,n))}):(r._svgDiv||(r._svgDiv=document.createElement("div"),document.body.appendChild(r._svgDiv)),r.getCanvasFromSVG(n,r._svgDiv,function(o){r.handleSvgColor(i,o);var a=o.toDataURL("img/png");r.map.loadImage(a,function(i,o){if(i)return console.log(i),void e(i);var s=n||a;!r.map.hasImage(s)&&r.map.addImage(s,o),e(XAt({},t,s))})})):e(XAt({},t,void 0))})},u=[];for(var l in a)u.push(s(l,a[l]));Promise.all(u).then(function(a){for(var s=0;s2&&void 0!==arguments[2])||arguments[2],i=t.minzoom,o=t.maxzoom,a=t.themeSetting,s={gradient:a.colors.slice(),radius:parseInt(a.radius)},u=a.customSettings;for(var l in u)s.gradient[l]=u[l];var c=["interpolate",["linear"],["heatmap-density"]],f=[.1,.3,.5,.7,1];s.gradient.forEach(function(t,e){c.push(f[e]),0===e&&(t=n.supermap.Util.hexToRgba(t,0)),1===e&&(t=n.supermap.Util.hexToRgba(t,.5)),c.push(t)}),this._initLegendConfigInfo(t,c);var h={"heatmap-color":c,"heatmap-radius":3*a.radius,"heatmap-intensity":2.8};if(a.weight&&e.length>=4){var p=[];e.forEach(function(t){t.properties[a.weight]=+t.properties[a.weight],p.push(t.properties[a.weight])});var d=uq.getMax(p),y=uq.getMin(p);h["heatmap-weight"]=["interpolate",["linear"],["get",a.weight],y,0,d,1]}this._addLayer({id:t.layerID,type:"heatmap",source:{type:"geojson",data:{type:"FeatureCollection",features:e}},paint:h,layout:{visibility:t.visible},minzoom:i||0,maxzoom:o||22}),r&&this._addLayerSucceeded({layerInfo:t,features:e})}},{key:"_createRangeLayer",value:function(t,e){var r=t.themeSetting.themeField,n=t.featureType,i=t.minzoom,o=t.maxzoom,a=t.style,s=this.getRangeStyleGroup(t,e),u=["match",["get","index"]],l=(e=this.getFilterFeatures(t.filterCondition,e)).filter(function(t){var e=parseFloat(t.properties[r]);if(!e&&0!==e)return!1;if(s)for(var n=0;n-1;a--){var s=n[a],u=this._getSymbolLabelLayerName(s);this.map.getLayer(u)&&o.push(u)}o.reverse().forEach(function(t){r.map.moveLayer(t)})}},{key:"_getParamString",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[];for(var i in t)n.push((r?i.toUpperCase():i)+"="+t[i]);return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")}},{key:"_transformStyleToMapBoxGl",value:function(t,e,r,n){var i={};"POINT"!==t.type&&"BASIC_POINT"!==t.type&&"POINT"!==e||"LINE"===e?["LINE","LINESTRING","MULTILINESTRING"].includes(e)?i={strokeWidth:"line-width",strokeColor:"line-color",strokeOpacity:"line-opacity"}:["REGION","POLYGON","MULTIPOLYGON"].includes(e)&&(i={fillColor:"fill-color",fillOpacity:"fill-opacity"}):i={fillColor:"circle-color",strokeWidth:"circle-stroke-width",fillOpacity:"circle-opacity",radius:"circle-radius",strokeColor:"circle-stroke-color",strokeOpacity:"circle-stroke-opacity"};var o={};for(var a in t)i[a]&&(o[i[a]]=t[a]);if(r&&(n?o[n]=r:o["circle-color"]?o["circle-color"]=r:o["line-color"]?o["line-color"]=r:o["fill-color"]=r),t.lineDash&&!o["line-dasharray"]&&(Array.isArray(t.lineDash)?o["line-dasharray"]=t.lineDash:"solid"!==t.lineDash&&"LINE"===e&&(o["line-dasharray"]=this.getDashStyle(t.lineDash))),t.lineDash&&!o["circle-translate"])if(Array.isArray(t.circleTranslate))o["circle-translate"]=t.circleTranslate;else if("POINT"===t.type||"BASIC_POINT"===t.type||"POINT"===e){var s=t.offsetX||0,u=t.offsetY||0;o["circle-translate"]=[s*t.radius,u*t.radius]}return o}},{key:"_addOverlayToMap",value:function(t){var e=t.type,r=t.source,n=t.layerID,i=t.parentLayerId,o=t.beforeId,a=t.layerStyle,s=t.minzoom,u=t.maxzoom,l=t.filter,c={POINT:"circle",LINE:"line",POLYGON:"fill"}[e];if("circle"===c||"line"===c||"fill"===c){var f={id:n,type:c,source:r,paint:a.style,layout:a.layout||{},minzoom:s||0,maxzoom:u||22};l&&(f.filter=l),this._addLayer(f,i,o)}}},{key:"_addBaselayer",value:function(t){var e=t.url,r=t.layerID,n=t.parentLayerId,i=t.visibility,o=void 0===i||i,a=t.minzoom,s=void 0===a?0:a,u=t.maxzoom,l=void 0===u?22:u,c=t.isIserver,f=void 0!==c&&c,h=t.bounds,p={type:"raster",tiles:e,minzoom:s||0,maxzoom:l||22,tileSize:f?this.rasterTileSize:256,rasterSource:f?"iserver":"",prjCoordSys:f&&!this.isOnlineBaseLayer(e[0],this.baseProjection)&&+this.baseProjection.split(":")[1]>0?{epsgCode:this.baseProjection.split(":")[1]}:"",proxy:this.baseLayerProxy};h&&(p.bounds=h);var d=p;!this.map.getSource(r)||this.map.getLayer(r)&&this.checkSameLayer&&this._isSameRasterLayer(r,p)||(d="".concat(r,"_").concat(+new Date),this.map.addSource(d,p)),this._addLayer({id:r,type:"raster",source:d,minzoom:s||0,maxzoom:l||22,layout:{visibility:this._getVisibility(o)}},n),this.baseLayerProxy=null}},{key:"_addStrokeLineForPoly",value:function(t){var e=t.style,r=t.source,n=t.layerID,i=t.parentLayerId,o=t.visible,a=t.minzoom,s=t.maxzoom,u={style:this._transformStyleToMapBoxGl(e,"LINE"),layout:{visibility:o}};this._addOverlayToMap({type:"LINE",source:r,layerID:n,parentLayerId:i,layerStyle:u,minzoom:a,maxzoom:s})}},{key:"_initLegendConfigInfo",value:function(t,e){var r=this,n={layerId:t.layerID,layerTitle:t.layerID,themeField:"HEAT"===t.layerType?t.themeSetting.weight:t.themeSetting.themeField,styleGroup:e},i=function(t,e){var n={style:{shape:r._getShape(e.featureType),type:r._getType(t.style.type)}};return r._addProps(n,t),n};switch(t.layerType){case"UNIQUE":n.styleGroup=n.styleGroup.map(function(e){return YAt({fieldValue:e.value},i(e,t))});break;case"RANGE":case"RANK_SYMBOL":n.styleGroup=n.styleGroup.map(function(e){return YAt({start:e.start,end:e.end},i(e,t))});break;case"HEAT":n.styleGroup=[{style:{shape:"POINT",type:"style",colors:this._heatColorToGradient(n.styleGroup)}}]}var o=this._legendList.findIndex(function(e){return e.layerId===t.layerID});o>-1?this._legendList.splice(o,1,n):this._legendList.push(n)}},{key:"_heatColorToGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return t.forEach(function(r,n){n>5&&n%2==0&&e.push({value:r,key:6===n?0:t[n-1]})}),e}},{key:"_getType",value:function(t){return["IMAGE_POINT","SVG_POINT"].includes(t)?"image":"style"}},{key:"_getShape",value:function(t){return"POLYGON"===t?"FILL":t}},{key:"_addProps",value:function(t,e){if("POINT"===t.style.shape){if(Object.assign(t.style,{color:e.style.fillColor||e.color,opacity:e.style.fillOpacity,fontSize:2*e.radius||e.style.fontSize||"14px"}),"image"===t.style.type)return void Object.assign(t.style,{url:(e.style.imageInfo||{}).url||e.style.url});if(e.style.className)return void Object.assign(t.style,{icon:e.style.className})}"LINE"!==t.style.shape?"FILL"===t.style.shape&&Object.assign(t.style,{backgroundColor:e.style.fillColor||e.color,opacity:e.style.fillOpacity,outlineColor:e.style.strokeColor,width:20,height:20}):Object.assign(t.style,{width:20,lineStyles:[{color:e.color,lineDash:[],lineOffset:0,lineWidth:2,opacity:e.style.strokeOpacity||1}]})}},{key:"_createMvtLayer",value:function(t,e,r){var i=this._getDataVectorTileStyle(r),o=this._transformStyleToMapBoxGl(i,r),a=t.url+"/tileFeature.mvt",s=n.CRS.get(this.baseProjection).getOrigin(),u=e.minzoom,l=e.maxzoom;a+="?&returnAttributes=true&width=512&height=512&x={x}&y={y}&scale={scale}&origin={x:".concat(s[0],",y:").concat(s[1],"}"),this._addLayer({id:e.layerID,type:i.mbglType,source:{type:"vector",tiles:[a],proxy:this.webMapService.handleProxy("image")},"source-layer":"".concat(t.datasetName,"@").concat(t.datasourceName),paint:o,layout:{visibility:e.visible?"visible":"none"},minzoom:u||0,maxzoom:l||22}),this._addLayerSucceeded()}},{key:"_getDataVectorTileStyle",value:function(t){var e={radius:8,fillColor:"#EE4D5A",fillOpacity:.9,strokeColor:"#ffffff",strokeWidth:1,strokeOpacity:1,lineDash:"solid",type:"BASIC_POINT",mbglType:"circle"};return["LINE","LINESTRING","MULTILINESTRING"].includes(t)?(e.strokeColor="#4CC8A3",e.strokeWidth=2,e.mbglType="line"):["REGION","POLYGON","MULTIPOLYGON"].includes(t)&&(e.fillColor="#826DBA",e.mbglType="fill"),e}},{key:"_unproject",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this._unprojectProjection||this.baseProjection;if("EPSG:4326"===r)return t;var n=Oq({coordinates:t,sourceProjection:r,proj4:this.specifiedProj4}),i=Tq(r,this.specifiedProj4);return e&&i.axis&&0===i.axis.indexOf("ne")&&n.reverse(),n}},{key:"_getMapCenter",value:function(t){var e=t.center&&[t.center.x,t.center.y];return e||(e=[0,0]),e=this._unproject(e,!1),e=new n.LngLat(e[0],e[1])}},{key:"_getLabelFontFamily",value:function(t){var e=["sans-serif"],r=t.layers;return r&&r.length>0&&r.forEach(function(t){t.labelStyle&&e.push(t.labelStyle.fontFamily)},this),e.push("supermapol-icons"),e.join(",")}},{key:"_getTiandituUrl",value:function(t){for(var e=/t0/gi,r={tiandituUrl:[],labelUrl:[]},n=t.baseLayer.layerType.split("_")[1].toLowerCase(),i=Boolean(t.baseLayer.labelLayerVisible),o=this.tiandituKey||t.baseLayer.tk,a="https://t0.tianditu.gov.cn/{layer}_{proj}/wmts?tk=".concat(o),s=a,u="EPSG:4326"===this.baseProjection?"c":"w",l={service:"WMTS",request:"GetTile",style:"default",version:"1.0.0",layer:n,tilematrixSet:u,format:"tiles",width:256,height:256},c=(a+=this._getParamString(l,a)+"&tilematrix={z}&tilerow={y}&tilecol={x}").replace("{layer}",n).replace("{proj}",u),f=[],h=0;h<8;h++)f.push(c.replace(e,"t".concat(h)));if(r.tiandituUrl=f,i){var p={vec:"cva",ter:"cta",img:"cia"}[n];l.layer=p,s=(s+=this._getParamString(l,s)+"&tilematrix={z}&tilerow={y}&tilecol={x}").replace("{layer}",p).replace("{proj}",u);for(var d=[],y=0;y<8;y++)d.push(s.replace(e,"t".concat(y)));r.labelUrl=d}return r}},{key:"_defineProj4",value:function(t,e){var r=Cq(t),n=/^EPSG:/,i=r&&t.match(n)?Tq(r,this.specifiedProj4):t;return!r&&e&&e.match(n)&&(r=e),kq(r,i,this.specifiedProj4),r}},{key:"_fetchRequest",value:function(t,e,r){return ut.get(t,null,r).then(function(t){return t[e]()}).then(function(t){return t}).catch(function(t){console.log(t)})}},{key:"getEpsgCodeWKT",value:function(t,e){if(t)return this._fetchRequest(t,"text",e)}},{key:"getBounds",value:function(t,e){if(t)return this._fetchRequest(t,"json",e)}},{key:"_addLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.id,r=arguments.length>2?arguments[2]:void 0,n=t.id;if(this.map.getLayer(n))return this.checkSameLayer&&this._isSameRasterLayer(n,t.source)?void this._setCacheLayer({layerInfo:t,parentLayerId:e,id:n,reused:!0,beforeId:r}):void this._updateLayer(t);var i=Object.assign({},t);i.metadata=Object.assign({},i.metadata,{SM_Layer_Id:e}),this.map.addLayer(i),this._setCacheLayer({layerInfo:t,parentLayerId:e,id:n,beforeId:r})}},{key:"_setCacheLayer",value:function(t){var e=t.parentLayerId,r=t.layerInfo,n=t.reused,i=void 0!==n&&n,o=t.beforeId,a=t.subRenderLayers,s=t.metadata,u=a||[{layerId:r.id,reused:i}];if(this._cacheLayerId.has(e)){var l,c=this._cacheLayerId.get(e),f=-1;o&&(f=c.renderLayers.findIndex(function(t){return t.layerId===o}));var h=f<0?c.renderLayers.length:f;(l=c.renderLayers).splice.apply(l,[h,0].concat(FAt(u)))}else{var p=Object.assign({},s||r&&r.metadata,{SM_Layer_Id:e});this._cacheLayerId.set(e,{renderLayers:u,metadata:p})}if(this.addLayersSucceededLen&&this._cacheLayerId.size<=this.expectLayerLen){this._changeSourceListModel();var d=this.getLayers(),y=this.getSelfAppreciableLayers(d),v=this._findTopLayerBeforeId(y);this.rectifyLayersOrder(y,v),this.fire("layeraddchanged",this._getSelfAppreciableLayers(d))}}},{key:"_findTopLayerBeforeId",value:function(t){var e=this,r=t.filter(function(t){return!t.reused}).reduce(function(t,e){return t.concat(e.renderLayers)},[]),n=r.find(function(t){return e.map.style._layers[t]});if(n){var i,o=this.map.getStyle().layers,a=o.findIndex(function(t){return t.id===n}),s=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=zAt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(o.filter(function(t){return!r.some(function(e){return e===t.id})}).map(function(t){return t.id}));try{var u,l=function(){var t=i.value;if(o.findIndex(function(e){return e.id===t})>a)return{v:t}};for(s.s();!(i=s.n()).done;)if(u=l())return u.v}catch(t){s.e(t)}finally{s.f()}}}},{key:"_changeSourceListModel",value:function(){var t=this,e=[],r=[this._mapInfo.baseLayer].concat(this._mapInfo.layers);if(this._graticuleLayer){var n=this._graticuleLayer,i=n.id,o=n.visible;r.push({layerID:i,visible:o,name:"GraticuleLayer"})}if(r.forEach(function(r){var n=r.layerID||r.name,i=void 0===r.visible||"visible"===r.visible||!0===r.visible,o=t._cacheLayerId.get(n);if(o){var a=o.renderLayers.map(function(t){return t.layerId});if(!a.length)return;e.push(YAt(YAt(YAt({},r),o),{},{id:n,visible:i,renderLayers:a,reused:o.renderLayers.some(function(t){return t.reused})}))}}),!this._sourceListModel)return this._sourceListModel=new jAt({map:this.map,layers:e,appendLayers:this._appendLayers}),void this._sourceListModel.on({layerupdatechanged:function(e){t.fire("layerupdatechanged",e)}});this._sourceListModel.setLayers(e)}},{key:"_getSelfAppreciableLayers",value:function(t){return{layers:this.getSelfAppreciableLayers(t),allLoaded:this._cacheLayerId.size===this.expectLayerLen}}},{key:"_isSameRasterLayer",value:function(t,e){return Vi(e,this.map.getSource(t))}},{key:"_centerValid",value:function(t){return!(!t||!(t.length>0||UAt(t)===n.LngLat||t.lng))}},{key:"_getResolution",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512;return t.leftBottom&&t.rightTop?Math.max(t.rightTop.x-t.leftBottom.x,t.rightTop.y-t.leftBottom.y)/e:Math.max(t[2]-t[0],t[3]-t[1])/e}},{key:"_transformScaleToZoom",value:function(t,e){var r=e.getExtent(),n=e.unit,i=1/$.getScaleFromResolutionDpi((r[2]-r[0])/512,96,n),o=t.split(":")[1];return Math.min(24,+Math.log2(i/+o).toFixed(2))}},{key:"_updateLayer",value:function(t){var e=this,r=t.id,n=t.paint,i=t.source,o=i.type,a=i.tiles,s=i.data,u=i.proxy,l=this.map.getSource(r);l&&("geojson"===o||"geojson"===l.type?(Object.keys(n).forEach(function(t){e.map.setPaintProperty(r,t,n[t])}),s&&l.setData(s)):"raster"===o&&this._updateRasterSource(r,{proxy:u,tiles:a}))}},{key:"_updateRasterSource",value:function(t,e){if(t){var r=this.map.getSource(t);Object.assign(r,e),this.map.style.sourceCaches[t].clearTiles(),this.map.style.sourceCaches[t].update(this.map.transform),this.map.triggerRepaint()}}},{key:"updateOverlayLayer",value:function(t,e,r){var n=this._mapInfo.layers.find(function(e){return e.layerID===t.id});if(e)this._initOverlayLayer(n,e,r);else{var i=this.webMapService.getDatasourceType(n);this.getLayerFeatures(n,this._taskID,i)}}},{key:"isOnlineBaseLayer",value:function(t,e){return t.startsWith("https://maptiles.supermapol.com/iserver/services/map_China/rest/maps/China_Dark")&&"EPSG:3857"===e}},{key:"_handleMultyPolygon",value:function(t){var e=this;return t.forEach(function(t){if("Polygon"===t.geometry.type){var r=t.geometry.coordinates;if(r.length>1){for(var n=[[r[0]]],i=1;i0?n[n.length-1].push(r[i]):n.push([r[i]]))}t.geometry.coordinates=n,t.geometry.type="MultiPolygon"}}}),t}},{key:"signedArea",value:function(t){for(var e,r,n=0,i=0,o=t.length,a=o-1;it.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=lPt(this,e,[r]))._mapInfo=r.mapInfo,t._layerCatalog=r.mapInfo.metadata.layerCatalog,t._mapResourceInfo=r.mapResourceInfo,t._l7LayerUtil=r.l7LayerUtil,t._legendList=r.legendList,t._immutableTopOrderLayers=["chart","point-extrusion"];var n=t._generateLayers();return t.setLayers(n),t.initDatas(),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fPt(t,e)}(e,_At),r=e,(n=[{key:"createLayerCatalogs",value:function(){var t=this.getLayers(!1),e=this._createSourceCatalogs(this._layerCatalog,t),r=this.getSelfLayers(),n=t.filter(function(t){return!r.some(function(e){return e.id===t.id})});return this._initSourceList(n).concat(e)}},{key:"getSelfLayerIds",value:function(){return this.layers.reduce(function(t,e){return t.concat(e.layerInfo.renderLayers)},[])}},{key:"initLayers",value:function(){var t=this,e=this._getAllLayersOnMap();this.appendLayers&&(e=[]);var r=this.layers.map(function(e){var r=Object.assign({},e);return e["source-layer"]&&(r.sourceLayer=e["source-layer"]),t._pickLayerFields(r)}),n=this.layers.reduce(function(t,e){return t.concat(e.layerInfo.renderLayers)},[]);return this.concatExpectLayers(r,n,e)}},{key:"_createSourceCatalogs",value:function(t,e){var r=this;return t.map(function(t){var n,i=t.id,o=t.title,a=void 0===o?i:o,s=t.type,u=t.visible,l=t.children;if("group"===s)n={children:r._createSourceCatalogs(l,e),id:i,title:a,type:s,visible:u};else{var c=e.find(function(t){return t.id===i});r.removeLayerExtralFields([c]),n=Object.assign({},c)}return n})}},{key:"_generateLayers",value:function(){var t=this,e=this._mapResourceInfo,r=e.catalogs,n=void 0===r?[]:r,i=e.datas,o=void 0===i?[]:i,a=Ui(n,"catalogType"),s=Ui(this._mapInfo.metadata.layerCatalog),u=this._l7LayerUtil.getL7MarkerLayers(),l=s.map(function(e){var r=t._mapInfo.layers.find(function(t){return t.id===e.id})||{},n={id:r.id,title:e.title,renderLayers:t._getRenderLayers(e.parts,e.id),reused:r.metadata&&r.metadata.reused},i=(a.find(function(t){return t.id===e.id})||{}).msDatasetId,s={};if(i){var l,c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=oPt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(o);try{for(c.s();!(l=c.n()).done;){var f=l.value,h=f.datasets&&f.datasets.find(function(t){return t.msDatasetId===i});if(h){if(s={serverId:h.datasetId,type:f.sourceType},"REST_DATA"===f.sourceType){var p=iPt(f.url.split("/rest/data/datasources/"),2),d=p[0],y=p[1];s.url="".concat(d,"/rest/data"),s.dataSourceName="".concat(y,":").concat(h.datasetName),delete s.serverId}break}}}catch(t){c.e(t)}finally{c.f()}}var v=t.map.getSource(r.source);if(!Object.keys(s).length&&v&&"vector"===v.type){var g=t._mapInfo.sources[r.source]||v;if(g.tiles&&g.tiles[0].includes("/rest/maps/")){var m=iPt(g.tiles[0].split("/rest/maps/"),2),b=m[0],x=iPt(m[1].split("/tileFeature"),1)[0];s.url="".concat(b,"/rest/maps"),s.mapName=x,s.type="REST_MAP"}}n.dataSource=s,t._l7LayerUtil.isL7Layer(r)&&(n.CLASS_NAME="L7Layer"),u[r.id]&&(n.CLASS_INSTANCE=u[r.id]);var w=t._legendList.filter(function(t){return t.layerId===r.id}).map(function(t){return t.themeField}).filter(function(t){return!!t}),_=Array.from(new Set(w));return _.length>0&&(n.themeSetting={themeField:_}),t._immutableTopOrderLayers.some(function(t){return t===r.type})&&(n.metadata=Object.assign({},r.metadata,{SM_Layer_Order:"top"})),Object.assign({},r,{layerInfo:n})});return l.reverse(),l}},{key:"_getRenderLayers",value:function(t,e){return t?t.includes(e)?t:[e].concat(nPt(t)):[e]}}])&&sPt(r.prototype,n),i&&sPt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function pPt(t){return function(t){if(Array.isArray(t))return vPt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||yPt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dPt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=yPt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function yPt(t,e){if(t){if("string"==typeof t)return vPt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vPt(t,e):void 0}}function vPt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function mPt(t){"@babel/helpers - typeof";return(mPt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bPt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function xPt(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),(r=EPt(this,a)).mapId=t,r.options=e,r.mapOptions=n,r._mapResourceInfo={},r._relatedInfo=e.relatedInfo||{},r._sprite="",r._spriteDatas={},r._appendLayers=!1,r._baseProjection="",r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&CPt(t,e)}(a,t),s=a,(u=[{key:"initializeMap",value:function(t,e){if(this._mapInfo=t,this._setBaseProjection()){if(e){this._appendLayers=!0,this.map=e;var r=this._mapInfo.sprite;return r&&(this._sprite=r,this.map.addStyle({sprite:r})),void this._initLayers()}this._createMap()}}},{key:"cleanLayers",value:function(t){kPt(TPt(a.prototype),"cleanLayers",this).call(this,t);var e=o.getL7MarkerLayers();for(var r in e)o.removeL7MarkerLayer(r,this.map.$l7scene)}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.map){if(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),t){var e=this.map.$l7scene;e&&e.removeAllLayer(),this.map.remove()}this.map=null,this._legendList=[],this._mapResourceInfo={},this._sprite="",this._spriteDatas={},this.mapOptions={},this.options={}}}},{key:"copyLayer",value:function(){var t=_Pt(gPt().mark(function t(e){var r,n,i,a,s,u=arguments;return gPt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=u.length>1&&void 0!==u[1]?u[1]:{},(n=this._mapInfo.layers.find(function(t){return t.id===e}))&&!this._getLayerOnMap(r.id)){t.next=4;break}return t.abrupt("return");case 4:if(i=r.id||"".concat(n.id,"_copy"),a=xPt(xPt(xPt({},n),r),{},{id:i}),!o.isL7Layer(a)){t.next=12;break}return s=[a],t.next=10,o.addL7Layers({map:this.map,webMapInfo:xPt(xPt({},this._mapInfo),{},{layers:s,sources:this._mapInfo.sources}),l7Layers:s,spriteDatas:this._spriteDatas,options:this.options});case 10:t.next=14;break;case 12:"object"===mPt(a.source)&&(this.map.addSource(a.id,a.source),a.source=a.id),this.map.addLayer(a);case 14:return t.abrupt("return",a);case 15:case"end":return t.stop()}},t,this)}));return function(e){return t.apply(this,arguments)}}()},{key:"updateOverlayLayer",value:function(t,e,r){if("geojson"===t.renderSource.type){var n=t.renderSource.id,i={type:"FeatureCollection",features:e=Gi({sourceId:n,features:e,mergeByField:r,map:this.map})};this.map.getSource(n).setData(i)}}},{key:"_createMap",value:function(){var t=this,e=this._mapInfo,i=e.name,o=void 0===i?"":i,a=e.center,s=void 0===a?new n.LngLat(0,0):a,u=e.zoom,l=void 0===u?0:u,c=e.bearing,f=void 0===c?0:c,h=e.pitch,p=void 0===h?0:h,d=e.minzoom,y=e.maxzoom,v=e.sprite,g=void 0===v?"":v;s=this.mapOptions.center||s,l=this.mapOptions.zoom||l,f=this.mapOptions.bearing||f,p=this.mapOptions.pitch||p;var m=this._getLabelFontFamily(),b=xPt(xPt({transformRequest:function(e,r){var n={url:e};return"Tile"===r&&t.options.iportalServiceProxyUrl&&e.indexOf(t.options.iportalServiceProxyUrl)>=0&&(n.credentials="include"),n}},this.mapOptions),{},{container:this.options.target,crs:this._baseProjection,center:s,zoom:l,style:{sprite:g,name:o,version:8,sources:{},layers:[]},minZoom:d,maxZoom:y,bearing:f,pitch:p,localIdeographFontFamily:m||""});this.map=new r(b),this._sprite=g,this.fire("mapinitialized",{map:this.map}),this.map.on("load",function(){t._initLayers()})}},{key:"_setBaseProjection",value:function(){var t=this._mapInfo.crs,e=t;if("object"===mPt(t)){if(e=t.name,!n.CRS){var r="The EPSG code ".concat(e," needs to include ").concat(i,"-enhance.js. Refer to the example: https://iclient.supermap.io/examples/").concat(i.replace("-",""),"/editor.html#mvtVectorTile_2362");return this.fire("mapcreatefailed",{error:r}),void console.error(r)}this._setCRS(t)}return this._baseProjection=e,this._baseProjection}},{key:"_setCRS",value:function(t){var e=t.name,r=t.wkt,i=t.extent;if(!n.CRS.get(e)){var o=new n.CRS(e,r,i,i[2]>180?"meter":"degree");n.CRS.set(o)}}},{key:"_initLayers",value:function(){var t=_Pt(gPt().mark(function t(){var e=this;return gPt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.map.getCRS||this.map.getCRS().epsgCode===this._baseProjection){t.next=3;break}return this.fire("projectionnotmatch"),t.abrupt("return");case 3:return t.next=5,this._getSpriteDatas();case 5:if("[object Object]"!==Object.prototype.toString.call(this.mapId)){t.next=11;break}return this.mapParams={title:this._mapInfo.name,description:this._relatedInfo.description},this._relatedInfo.projectInfo&&(this._mapResourceInfo=JSON.parse(this._relatedInfo.projectInfo)),this._createMapRelatedInfo(),this._addLayersToMap(),t.abrupt("return");case 11:this._getMapRelatedInfo().then(function(t){e.mapParams={title:e._mapInfo.name,description:t.description},e._mapResourceInfo=JSON.parse(t.projectInfo),e._createMapRelatedInfo(),e._addLayersToMap()}).catch(function(t){e.fire("mapcreatefailed",{error:t}),console.error(t)});case 12:case"end":return t.stop()}},t,this)}));return function(){return t.apply(this,arguments)}}()},{key:"_createMapRelatedInfo",value:function(){var t=this._mapInfo.glyphs;for(var e in t)this.map.style.addGlyphs(e,t[e])}},{key:"_getMapRelatedInfo",value:function(){var t=function(t){var e=t.url,r=t.server,n=t.excludePortalProxyUrl,i=t.credentialValue,o=t.credentialKey,a=-1===e.indexOf(".json")?"".concat(e,".json"):e,s="getUrlResource.json?url=";if(n&&r.indexOf(s)>-1){var u=r.split(s);u.length>1&&(a=u[0]+s+a)}return i&&o&&(a+="?"+o+"="+i),a}(Object.assign({url:"".concat(this.options.server,"web/maps/").concat(this.mapId)},this.options));return ut.get(t,null,{withCredentials:this.options.withCredentials}).then(function(t){return t.json()})}},{key:"_addLayersToMap",value:function(){var t=_Pt(gPt().mark(function t(){var e,r,n,i,a,s,u=this;return gPt().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,e=this._setUniqueId(this._mapInfo,this._mapResourceInfo),r=e.sources,n=e.layers,i=e.layerCatalog,a=e.catalogs,Object.assign(this._mapInfo,{sources:r,layers:n,metadata:Object.assign(this._mapInfo.metadata,{layerCatalog:i})}),Object.assign(this._mapResourceInfo,{catalogs:a}),n.filter(function(t){return!o.isL7Layer(t)}).forEach(function(t){t.metadata&&t.metadata.reused||(t.source&&!u.map.getSource(t.source)&&u.map.addSource(t.source,r[t.source]),"symbol"===t.type&&0===t.layout["text-z-offset"]&&delete t.layout["text-z-offset"],u.map.addLayer(t))}),!((s=n.filter(function(t){return o.isL7Layer(t)})).length>0)){t.next=10;break}return t.next=10,o.addL7Layers({map:this.map,webMapInfo:xPt(xPt({},this._mapInfo),{},{layers:n,sources:r}),l7Layers:s,spriteDatas:this._spriteDatas,options:xPt(xPt({},this.options),{},{emitterEvent:this.fire.bind(this)})});case 10:this._createLegendInfo(),this._sendMapToUser(),t.next=18;break;case 14:t.prev=14,t.t0=t.catch(0),this.fire("mapcreatefailed",{error:t.t0,map:this.map}),console.error(t.t0);case 18:case"end":return t.stop()}},t,this,[[0,14]])}));return function(){return t.apply(this,arguments)}}()},{key:"_setUniqueId",value:function(t,e){var r=this._handleUnSupportedLayers(t),n=JSON.parse(JSON.stringify(t.layers)).filter(function(t){return!r.includes(t.id)}),i={},o={},a=[],s="_".concat(+new Date);for(var u in t.sources){var l=u;this.map.getSource(u)&&(l=u+s),o[l]=u,i[l]=t.sources[u];var c,f=dPt(n);try{for(f.s();!(c=f.n()).done;){var h=c.value;h.source===u&&(h.source=l)}}catch(t){f.e(t)}finally{f.f()}}var p,d=dPt(n);try{for(d.s();!(p=d.n()).done;){var y=p.value,v=y.id,g=this._getLayerOnMap(y.id);if(g)if(this.options.checkSameLayer&&Vi(i[y.source],this.map.getSource(g.source)))y.metadata=y.metadata||{},y.metadata.reused=!0,y.source=o[y.source];else{var m=y.id+s;y.id=m}a.push({originId:v,renderId:y.id})}}catch(t){d.e(t)}finally{d.f()}var b=JSON.parse(JSON.stringify(t.metadata.layerCatalog),"parts");this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(b)),catalogs:b,layerIdMapList:a,unspportedLayers:r});var x=JSON.parse(JSON.stringify(e.catalogs||[]));return this._updateLayerCatalogsId({loopData:JSON.parse(JSON.stringify(x)),catalogs:x,layerIdMapList:a,catalogTypeField:"catalogType",layerIdsField:"layersContent",unspportedLayers:r}),{sources:i,layers:n,layerCatalog:b,catalogs:x}}},{key:"_getLayerOnMap",value:function(t){var e=this.map.overlayLayersManager[t];if(e)return e;var r=o.getL7MarkerLayers()[t];return r||this.map.getLayer(t)}},{key:"_findLayerCatalog",value:function(t,e){var r,n=dPt(t);try{for(n.s();!(r=n.n()).done;){var i=r.value;if(i.id===e)return i;if(i.children){var o=this._findLayerCatalog(i.children,e);if(o)return o}}}catch(t){n.e(t)}finally{n.f()}return null}},{key:"_deleteLayerCatalog",value:function(t,e){for(var r=0;r0&&e.forEach(function(e){var r=e.layout&&e.layout["text-font"]||[];t.push.apply(t,pPt(r))}),t.join(",")}},{key:"_getSpriteDatas",value:function(){var t=this,e=this._sprite;if(e){var r=[];return"string"==typeof e?r.push(e):"object"===mPt(e)&&Object.keys(e).forEach(function(t){r.push(e[t])}),Promise.all(r.map(function(e){return t._getSpriteData(e)})).then(function(e){e.forEach(function(e){t._spriteDatas=xPt(xPt({},t._spriteDatas),e)})})}}},{key:"_getSpriteData",value:function(t){var e=t.replace(/.+(web\/maps\/.+)/,"".concat(this.options.server,"$1"));return ut.get(e,null,{withCredentials:this.options.withCredentials}).then(function(t){return t.json()})}},{key:"_createLegendInfo",value:function(){var t,e=this,r=this._mapResourceInfo.catalogs,n=dPt(Ui(void 0===r?[]:r,"catalogType"));try{var i=function(){var r,n=t.value,i=n.visualization||{},o=i.renderer,a=i.label;if(!o)return 1;var s,u=e._mapInfo.layers.find(function(t){return t.id===n.id}),l=e._mapInfo.sources[u.source];"clusterField"in l&&(s=l.clusterField);var c=Object.assign({},u,{title:n.title,themeField:s}),f=e._parseRendererStyleData(o);a&&(f.push(xPt(xPt({},a),{},{type:"text"})),a.symbolsContent&&a.symbolsContent.value.symbolId&&f.push(xPt(xPt({},a),{},{type:"symbol"}))),f[0].textField&&f[0].textField.value&&f.push(xPt(xPt({},f[0]),{},{type:"text"}));var h=f.reduce(function(t,r){var n=e._createLayerLegendList(c,r);return n&&t.push.apply(t,pPt(n)),t},[]);(r=e._legendList).push.apply(r,pPt(h))};for(n.s();!(t=n.n()).done;)i()}catch(t){n.e(t)}finally{n.f()}}},{key:"_getAliasKey",value:function(t,e){return"isoline3D"===t&&"dashArray"===e?"lineDasharray":e}},{key:"_transStyleKeys",value:function(t,e){var r=this;return e.map(function(e){return r._getAliasKey(t,e)})}},{key:"_transStyleSetting",value:function(t,e){for(var r in e){var n=this._getAliasKey(t,r);n!==r&&(e[n]=e[r])}}},{key:"_getLegendSimpleStyle",value:function(t,e){var r={};e&&e.filter(function(e){return t[e]&&"simple"===t[e].type}).forEach(function(e){("outlineColor"!==e||(t.antialias||{}).value)&&(r[e]=(t[e]||{}).value)});return r}},{key:"_getLegendRenderType",value:function(t){switch(t){case"text":return PPt.TEXT;case"circle":case"symbol":case"column":return PPt.POINT;case"heatGrid":case"heatHexagon":case"heat3DGrid":case"heat3DHexagon":return PPt.BUILTINSYMBOL;case"line":case"isoline3D":return PPt.LINE;case"fill":return PPt.FILL;case"fillExtrusion":return PPt.FILLEXTRUSION;case"animatePoint":return PPt.ANIMATEPOINT;case"line3D":case"animateLine":return PPt.ANIMATELINE;case"radarPoint":return PPt.RADARPOINT}}},{key:"_getLegendShape",value:function(t,e){switch(t){case"text":return MPt.TEXT;case"circle":case"symbol":return MPt.POINT;case"column":return{cylinder:MPt.POINT,triangleColumn:MPt.TRIANGLE,squareColumn:MPt.RECTANGLE,hexagonColumn:MPt.HEXAGON}[e.shape.value]||MPt.POINT;case"heatHexagon":case"heat3DHexagon":return MPt.HEXAGON;case"line":case"isoline3D":return MPt.LINE;case"fill":case"heatGrid":case"heat3DGrid":case"fillExtrusion":return MPt.RECTANGLE;case"animatePoint":return MPt.ANIMATEPOINT;case"animateLine":case"line3D":return MPt.ANIMATELINE;case"radarPoint":return MPt.RADARPOINT;case"heat":case"heat3D":return MPt.LINEGRADIENT}}},{key:"_isShowLegendSingleItem",value:function(t,e){return 0===t.length||1===t.length&&"color"===t[0]&&e}},{key:"_isWebsymbolById",value:function(t){return["line-","polygon-","point-"].some(function(e){return t&&t.startsWith(e)})}},{key:"_getSymbolSDFStatus",value:function(t,e){return!this._isWebsymbolById(t)&&(!!this._getIconById(t)||(e[t]&&e[t].sdf||!1))}},{key:"_isAllPicturePoint",value:function(t,e){var r=this;return"simple"===t.type?!this._getSymbolSDFStatus(t.value.symbolId,e):[].concat(pPt(t.values),[{value:t.defaultValue}]).filter(function(t){return t.value.symbolId}).every(function(t){return!r._getSymbolSDFStatus(t.value.symbolId,e)})}},{key:"_isAllPictureSymbolSaved",value:function(t,e,r){var n=this;return!!e&&("point"===t?this._isAllPicturePoint(e,r):"simple"===e.type?!!this._getImageIdFromValue(e.value.style,BPt[t]).length:e.values.map(function(t){return t.value}).concat(e.defaultValue).every(function(e){return!!n._getImageIdFromValue(e.style,BPt[t]).length}))}},{key:"_getDataDrivenStyleKeys",value:function(t,e,r){return(OPt({},PPt.TEXT,jPt)[t]||e).filter(function(t){return r[t]&&"simple"!==r[t].type})}},{key:"_createLayerLegendList",value:function(t,e){var r=this,n=t.id,i=t.title,o={themeField:t.themeField||e.field,layerId:n,layerTitle:i},a=e.type||t.type,s=this._getLegendRenderType(a),u=this._getLegendShape(a,e);if(["heat","heat3D"].includes(a)){var l=this._heatColorToGradient((t.paint||{})[{heat:"heatmap-color",heat3D:"heatmap-extrusion-color"}[a]]);return[xPt(xPt({},o),{},{styleGroup:[{style:{type:UPt.STYLE,shape:u,colors:l}}]})]}var c=NPt[s];if(c){var f=this._transStyleKeys(a,c);this._transStyleSetting(a,e);var h=this._getLegendSimpleStyle(e,f),p=this._parseLegendtyle({legendRenderType:s,customValue:h}),d=this._getDataDrivenStyleKeys(s,f,e);if(s===PPt.ANIMATELINE){var y="replace"===e.textureBlend.value,v=!(!e.symbolsContent.value||!e.symbolsContent.value.symbolId);y&&v&&(d=d.filter(function(t){return"color"!==t}))}else{var g=FPt[t.type];this._isAllPictureSymbolSaved(g,e.symbolsContent,this._spriteDatas)&&(d=d.filter(function(t){return"color"!==t}))}var m=e.color&&e.color.interpolateInfo&&"linear"===e.color.interpolateInfo.type,b=[];return this._isShowLegendSingleItem(d,m)&&b.push(xPt(xPt({},o),{},{styleGroup:[{fieldValue:i||n,style:xPt(xPt({},p),{},{shape:u})}]})),b.concat(d.map(function(t){var n=e[t],i=r._getSettingStyle(t,n.defaultValue,h),a=[],l=r._getSettingCustom(n),c=r._getSettingInterpolateInfo(n),f={legendRenderType:s,styleField:t,subStyleSetting:n,simpleStyle:h,defaultSetting:i,custom:l,interpolateInfo:c,shape:u};switch(r._getLegendStyleType({styleField:t,currentType:n.type,custom:l,interpolateInfo:c})){case DPt.LINEAR:a=r._parseLinearStyle(f);break;case DPt.RANGE:a=r._parseRangeStyle(f);break;case DPt.UNIQUE:a=r._parseUniqueStyle(f)}return xPt(xPt({},o),{},{themeField:(n.field||[])[0],styleField:t,styleGroup:a})}))}}},{key:"_heatColorToGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=[];return t.forEach(function(r,n){n>5&&n%2==0&&e.push({value:r,key:6===n?0:t[n-1]})}),e}},{key:"_getSettingCustom",value:function(t){var e=t.value,r=t.values;return this._isLinear(t)?e:r}},{key:"_getSettingInterpolateInfo",value:function(t){var e=t.interpolateInfo,r=void 0===e?{}:e;return this._isLinear(t)?{type:"linear"}:r}},{key:"_isLinear",value:function(t){return"linear"===t.type}},{key:"_getLegendStyleType",value:function(t){var e=t.styleField,r=t.currentType,n=t.custom,i=t.interpolateInfo;return["unique","linear"].includes(r)?this._isColorAttr(e)&&"linear"===i.type&&n.length>1?DPt.LINEAR:DPt.UNIQUE:DPt.RANGE}},{key:"_isColorAttr",value:function(t){return["color","textColor","outlineColor","textHaloColor"].includes(t)}},{key:"_parseLinearStyle",value:function(t){var e=t.shape,r=t.custom;return[{styleField:null,style:{type:UPt.STYLE,shape:e,colors:r}}]}},{key:"_parseUniqueStyle",value:function(t){var e=this,r=t.legendRenderType,n=t.styleField,i=t.simpleStyle,o=t.defaultSetting,a=t.custom,s=t.interpolateInfo,u=t.shape,l=a.map(function(t){var o=e._getSettingStyle(n,t.value,i),a=e._parseLegendtyle({legendRenderType:r,customValue:o});return{fieldValue:t.key,style:xPt(xPt({},a),{},{shape:u})}});if(!s.type||"custom"===s.type){var c=this._parseLegendtyle({legendRenderType:r,customValue:o});l.push({fieldValue:null,style:xPt(xPt({},c),{},{shape:u})})}return l}},{key:"_parseRangeStyle",value:function(t){var e=this,r=t.legendRenderType,n=t.styleField,i=t.simpleStyle,o=t.defaultSetting,a=t.custom,s=t.shape,u=a.map(function(t){var o=e._getSettingStyle(n,t.value,i),a=e._parseLegendtyle({legendRenderType:r,customValue:o});return{start:t.start,end:t.end,style:xPt(xPt({},a),{},{shape:s})}}),l=this._parseLegendtyle({legendRenderType:r,customValue:o});return u.push({start:null,end:null,style:xPt(xPt({},l),{},{shape:s})}),u}},{key:"_getSettingStyle",value:function(t,e,r){var n=Object.assign({},r);return n[t]=e,n}},{key:"_parseLegendtyle",value:function(t){var e=this,r=t.legendRenderType,n=t.customValue,i=xPt({},LPt[r]);Object.keys(i).forEach(function(t){var e=n[IPt[t]||t];([PPt.FILL,PPt.FILLEXTRUSION].includes(r)||e)&&(i[t]=e)});var o=n.symbolsContent||{},a=o.symbolId,s=void 0===a?RPt[r]:a,u=o.style;switch(r){case PPt.TEXT:return xPt({type:UPt.STYLE,icon:"supermapol-icons-text-layer"},i);case PPt.POINT:return"BASE"===(this._getIconById(s)?"BASE":"SERVICE")?xPt({type:UPt.STYLE},i):this._getSpriteStyle(s,i);case PPt.BUILTINSYMBOL:return xPt({type:UPt.STYLE},i);case PPt.ANIMATEPOINT:case PPt.RADARPOINT:return xPt({type:UPt.STYLE},i);case PPt.LINE:case PPt.ANIMATELINE:u=u||[];var l=Object.assign({},n);delete l.symbolsContent;var c=xPt(xPt({type:UPt.STYLE},l),{},{width:zPt}),f=xPt({},LPt.LINE),h=u instanceof Array?u:[u],p=h.some(function(t){return!!e._getImageIdByLegendType(t,r)}),d=h[0];if(p){var y=this._getImageIdByLegendType(d,r),v=xPt(xPt(xPt({},i),l),{},{height:i.width,width:zPt});return r===PPt.ANIMATELINE&&"replace"===l.textureBlend&&(v.backgroundColor="transparent"),this._getSpriteStyle(y,v)}if(!n.symbolsContent||r===PPt.ANIMATELINE&&!p)return xPt(xPt({},c),{},{height:n.width||f.height,lineWidth:n.width||f.width,color:n.color||f.backgroundColor});if(n.symbolsContent){var g=this._getLineWidth(h),m=h.map(function(t){return e._transformLineStyle({oldWidth:g,symbol:t,defaultStyle:f,customValue:n})});return xPt(xPt({},c),{},{lineStyles:m})}return;case PPt.FILL:case PPt.FILLEXTRUSION:var b=i.backgroundColor,x=((u||{}).paint||{})["fill-color"],w=xPt({},LPt.FILL);return b||Object.assign(i,{backgroundColor:x}),Object.keys(i).forEach(function(t){["backgroundColor","width","height","opacity"].includes(t)&&!i[t]&&(i[t]=w[t])}),i.outlineColor&&Object.assign(i,{outline:w.outline,marginLeft:"1px"}),this._spriteDatas[s]?this._getSpriteStyle(s,xPt(xPt({},i),{},{backgroundColor:"transparent"})):xPt({type:UPt.STYLE},i)}}},{key:"_getIconById",value:function(t){if("image"!==(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"svg")){return[{id:"circle",name:"circle"}].find(function(e){return e.id===t})}}},{key:"_getImageIdFromValue",value:function(t,e){var r=Array.isArray(t)?t:[t],n={symbol:"icon-image",line:"line-pattern",fill:"fill-pattern","fill-extrusion":"fill-pattern"}[e];return"symbol"===e?r.map(function(t){return t.layout&&t.layout[n]}).filter(function(t){return t}):r.map(function(t){return t.paint&&t.paint[n]}).filter(function(t){return t})}},{key:"_getImageIdByLegendType",value:function(t,e){var r={ANIMATELINE:BPt.point,LINE:BPt.line}[e],n=t.paint||{};return r===BPt.line?n["line-pattern"]:r===BPt.polygon?n["fill-pattern"]:(t.layout||{})["icon-image"]}},{key:"_getSpriteStyle",value:function(t,e){if(this._spriteDatas[t]){var r=this._spriteDatas[t];if(r.width&&r.height)return xPt(xPt({type:UPt.IMAGE,sprite:r},e),{},{url:"string"==typeof this._sprite?"".concat(this._sprite,".png"):""})}}},{key:"_transformLineStyle",value:function(t){var e,r=t.oldWidth,n=t.symbol,i=t.defaultStyle,o=t.customValue,a=n.paint,s=void 0===a?{}:a;return void 0!==o.height&&(e=this._updateSingleStyleByWidth(r,o.height,n)),{lineWidth:((e||{}).paint||{})[GPt]||s[GPt]||i.height,opacity:o.opacity||s["line-opacity"]||i.opacity,color:o.color||s["line-color"]||i.backgroundColor,lineDash:s["line-dasharray"]||[],lineOffset:s["line-offset"]||0}}},{key:"_updateSingleStyleByWidth",value:function(t,e,r){if(t===e)return r;var n=(r||{}).paint||{};if(0===t)return{paint:Object.assign({},n,{"line-width":Number(e.toFixed(2))})};var i=e/t,o=n["line-width"],a=n["line-offset"]||0,s=n["line-dasharray"]||[],u=this._updateDash(s,i);return{paint:Object.assign({},n,{"line-width":Number((o*i).toFixed(2)),"line-offset":Number((a*i).toFixed(2)),"line-dasharray":u&&u.map(function(t){return Number(t.toFixed(2))})})}}},{key:"_updateDash",value:function(t,e){if(t&&0!==t.length)return t.map(function(t){return t/e})}},{key:"_getLineWidth",value:function(t){return t instanceof Array?this._getWholeWidth(t):(t.paint||{})[GPt]||0}},{key:"_getWholeWidth",value:function(t){var e,r;return t.forEach(function(t){var n=(t||{}).paint||{},i=n["line-width"],o=n["line-offset"]||0,a=o+i/2,s=o-i/2;(a>e||void 0===e)&&(e=a),(s=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function qPt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:function(){return JPt(function t(){$Pt(this,t)})}();return function(e){function r(){var t;return $Pt(this,r),(t=YPt(this,r))._sourceListModel=null,t._legendList=[],t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ZPt(t,e)}(r,t),JPt(r,[{key:"initializeMap",value:function(){throw new Error("initializeMap is not implemented")}},{key:"clean",value:function(){throw new Error("clean is not implemented")}},{key:"getLayerCatalog",value:function(){return this._sourceListModel&&this._sourceListModel.getLayerCatalog()||[]}},{key:"getLayers",value:function(){return this._sourceListModel&&this._sourceListModel.getLayers()||[]}},{key:"getLegends",value:function(){return this._legendList}},{key:"getSelfAppreciableLayers",value:function(){var t;return this._sourceListModel&&(t=this._sourceListModel).getSelfLayers.apply(t,arguments)||[]}},{key:"setLayersVisible",value:function(){var t;this._sourceListModel&&(t=this._sourceListModel).setLayersVisible.apply(t,arguments)}},{key:"toggleLayerVisible",value:function(){var t;this._sourceListModel&&(t=this._sourceListModel).toggleLayerVisible.apply(t,arguments)}},{key:"rectifyLayersOrder",value:function(t,e){for(var r=this,n=t.filter(function(t){return!t.reused}).reduce(function(t,e){return t.concat(e.renderLayers)},[]).filter(function(t){return!!r.map.getLayer(t)}),i=n.length-1;i>-1;i--){var o=n[i],a=n.slice(i+1),s=a.find(function(t){return r.map.style._layers[t]});a.length||(s=e),this.map.moveLayer(o,s)}return n}},{key:"echartsLayerResize",value:function(){}},{key:"updateOverlayLayer",value:function(){}},{key:"copyLayer",value:function(){}},{key:"cleanLayers",value:function(t){var e,r=this,n=[],i=WPt(t);try{var o=function(){var t=e.value;t.renderLayers.forEach(function(e){r.map.getLayer(e)&&(r.map.removeLayer(e),!t.l7Layer&&r.map.getSource(e)&&n.push(e))}),r.map.getSource(t.renderSource.id)&&!t.l7Layer&&n.push(t.renderSource.id)};for(i.s();!(e=i.n()).done;)o()}catch(t){i.e(t)}finally{i.f()}Array.from(new Set(n)).forEach(function(t){r.map.removeSource(t)})}}])}()}function eMt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return rMt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rMt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function rMt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,i),(e=lMt(this,i)).options=r,e.mapOptions=n,e.webMapService=new NOt(t,r),e._layerIdRenameMapList=[],e._appendLayers=!1,e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fMt(t,e)}(i,t),o=i,(a=[{key:"initializeMap",value:function(t,e){var i=this;if(e)return this._appendLayers=!0,this.map=e,void this._addLayersToMap();this.mapOptions.container=this.options.target,"object"===aMt(this.mapOptions.crs)&&this.mapOptions.crs.epsgCode&&(this.mapOptions.crs=new n.CRS(this.mapOptions.crs.epsgCode,this.mapOptions.crs.WKT,this.mapOptions.crs.extent,this.mapOptions.crs.unit)),this.mapOptions.transformRequest||(this.mapOptions.transformRequest=function(t,e){var r="";if("string"==typeof i.options.proxy){var n="data";"Tile"===e&&(n="image"),r=i.webMapService.handleProxy(n)}return{url:r?"".concat(r).concat(encodeURIComponent(t)):t,credentials:i.webMapService.handleWithCredentials(r,t,i.options.withCredentials||!1)?"include":void 0}}),this.mapOptions.center=this.mapOptions.center||[0,0],this.mapOptions.zoom=this.mapOptions.zoom||0;var o=0;Object.prototype.hasOwnProperty.call(this.mapOptions,"fadeDuration")&&(o=this.mapOptions.fadeDuration),this.map=new r(iMt(iMt({},this.mapOptions),{},{fadeDuration:o})),this.fire("mapinitialized",{map:this.map}),this.map.on("load",function(){i._sendMapToUser()})}},{key:"clean",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.map&&(this._sourceListModel&&(this._sourceListModel.destroy(),this._sourceListModel=null),t&&this.map.remove(),this.map=null)}},{key:"_addLayersToMap",value:function(){var t=this,e=this._setUniqueId(this.mapOptions.style),r=e.sources,n=e.layers,i=e.layerIdMapList;n.forEach(function(e){var n=i.find(function(t){return t.renderId===e.id});n&&n.reused||(e.source&&!t.map.getSource(e.source)&&t.map.addSource(e.source,r[e.source]),t.map.addLayer(e))}),Object.assign(this.mapOptions.style,{layers:n,sources:r}),this._layerIdRenameMapList=i,this._sendMapToUser()}},{key:"_setUniqueId",value:function(t){var e=JSON.parse(JSON.stringify(t.layers)),r={},n={},i=[],o="_".concat(+new Date);for(var a in t.sources){var s=a;this.map.getSource(a)&&(s=a+o),n[s]=a,r[s]=t.sources[a];var u,l=eMt(e);try{for(l.s();!(u=l.n()).done;){var c=u.value;c.source===a&&(c.source=s)}}catch(t){l.e(t)}finally{l.f()}}var f,h=eMt(e);try{for(h.s();!(f=h.n()).done;){var p=f.value,d=p.id,y=void 0,v=this.map.getLayer(p.id);if(v)if(this.options.checkSameLayer&&Vi(r[p.source],this.map.getStyle().sources[v.source]))y=!0,p.source=n[p.source];else{var g=p.id+o;p.id=g}i.push({originId:d,renderId:p.id,reused:y})}}catch(t){h.e(t)}finally{h.f()}return{sources:r,layers:e,layerIdMapList:i}}},{key:"_generateAppreciableLayers",value:function(){var t=this;return this.mapOptions.style.layers.reduce(function(e,r){var n=Hi(r["source-layer"]?r:iMt(iMt({},r),{},{layerInfo:{id:r.id}})),i=e.find(function(t){return t.id===n});if(i)i.renderLayers.push(r.id);else{var o=t._layerIdRenameMapList.find(function(t){return t.renderId===r.id});e.push(iMt(iMt({},r),{},{id:n,name:o&&o.originId,renderLayers:[r.id],reused:o&&o.reused}))}return e},[])}},{key:"_sendMapToUser",value:function(){var t=this,e=this._generateAppreciableLayers();this._sourceListModel=new jAt({map:this.map,layers:e,appendLayers:this._appendLayers}),this._sourceListModel.on({layerupdatechanged:function(e){t.fire("layerupdatechanged",e)}}),this.fire("mapcreatesucceeded",{map:this.map,mapparams:{title:this.mapOptions.name,description:""},layers:this.getSelfAppreciableLayers()})}}])&&sMt(o.prototype,a),s&&sMt(o,s),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,a,s}()}var pMt=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8],"doc":"Style specification version number. Must be 8.","example":8},"fragment":{"type":"boolean","doc":"Indicates that a style is a fragment style.","example":true},"name":{"type":"string","doc":"A human-readable name for the style.","example":"Bright"},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"center":{"type":"array","value":"number","doc":"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":[-73.9749,40.7736]},"zoom":{"type":"number","doc":"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":12.5},"bearing":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Default bearing, in degrees. The bearing is the compass direction that is \\"up\\"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":29},"pitch":{"type":"number","default":0,"units":"degrees","doc":"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).","example":50},"light":{"type":"light","doc":"The global light source. Note: This API is deprecated. Prefer using `flat` light type instead in the `lights` API.","example":{"anchor":"viewport","color":"white","intensity":0.4}},"lights":{"required":false,"type":"array","value":"light-3d","doc":"Array of light sources affecting the whole map and the default for 3D style, mutually exclusive with the light property","example":[{"id":"environment","type":"ambient","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4}},{"id":"sun_light","type":"directional","properties":{"color":"rgba(255.0, 0.0, 0.0, 1.0)","intensity":0.4,"direction":[200,40],"cast-shadows":true,"shadow-intensity":0.2}}],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"terrain":{"type":"terrain","optional":true,"doc":"A global modifier that elevates layers and markers based on a DEM data source."},"fog":{"type":"fog","doc":"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},"camera":{"type":"camera","doc":"Global setting to control additional camera intrinsics parameters, e.g. projection type (perspective / orthographic)."},"color-theme":{"type":"colorTheme","doc":"A global modifier for the colors of the style."},"imports":{"type":"array","value":"import","doc":"Imports other styles into this style.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"schema":{"type":"schema","doc":"Definition of the schema for configuration options.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"sources":{"required":true,"type":"sources","doc":"Data source specifications.","example":{"mapbox-streets":{"type":"vector","url":"mapbox://mapbox.mapbox-streets-v6"}}},"sprite":{"type":"string","doc":"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","example":"mapbox://sprites/mapbox/bright-v8"},"glyphs":{"type":"string","doc":"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).","default":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf","example":"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},"transition":{"type":"transition","doc":"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style\'s `transition` property.","example":{"duration":300,"delay":0}},"projection":{"type":"projection","doc":"The projection the map should be rendered in. Supported projections are Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of Mercator.","example":{"name":"albers","center":[-154,50],"parallels":[55,65]}},"layers":{"required":true,"type":"array","value":"layer","doc":"Layers will be drawn in the order of this array.","example":[{"id":"water","source":"mapbox-streets","source-layer":"water","type":"fill","paint":{"fill-color":"#00ffff"}}]},"models":{"type":"models","doc":"Specification of models used in the style.","example":{"spruce1-lod0":"asset://spruce1-lod0.glb","spruce1-lod1":"asset://spruce1-lod1.glb","spruce1-lod2":"asset://spruce1-lod2.glb"}}},"model":{"type":"string","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`.","required":true},"import":{"id":{"type":"string","doc":"Unique import name.","required":true},"url":{"type":"string","doc":"The URL of the style.","required":true},"config":{"type":"config","doc":"Configuration values for the imported style\'s options."},"data":{"type":"$root","doc":"The inlined style that must correspond to the contents of the specified URL."}},"config":{"*":{"type":"*","doc":"Value of the imported style\'s configuration option."}},"schema":{"*":{"type":"option","doc":"Specification of a configuration option."}},"option":{"default":{"type":"*","doc":"Default configuration value for this option.","property-type":"data-constant","expression":{"interpolated":false},"required":true},"type":{"type":"enum","doc":"The type this value is coerced to after evaluating the expression. If unspecified, the result is returned as is and is not validated.","values":{"string":{"doc":"The result will be coerced to a string."},"number":{"doc":"The result will be coerced to a number."},"boolean":{"doc":"The result will be coerced to a boolean."},"color":{"doc":"The result will be coerced to a color."}}},"array":{"type":"boolean","doc":"If true, this option is returned as an array"},"minValue":{"type":"number","doc":"If this option is a number, this specifies the minimum allowed value. Values lower than this will be clamped to the minimum value."},"maxValue":{"type":"number","doc":"If this option is a number, this specifies the maximum allowed value. Values higher than this will be clamped to the maximum value."},"stepValue":{"type":"number","doc":"If this option is a number, this specifies the increment between allowed values. Values will be rounded towards the nearest allowed value."},"values":{"type":"array","value":"*","doc":"If this option is specified, the result must be one of the given values. Otherwise, the default value is used instead."},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."}},"models":{"*":{"type":"model","doc":"A URL to a model resource. Supported protocols are `http:`, `https:`, and `mapbox://`."}},"light-3d":{"id":{"type":"string","doc":"Unique light name.","required":true},"properties":{"type":"properties","doc":"Properties of the light."},"type":{"type":"enum","doc":"Type of the light to be added","values":{"ambient":{"doc":"An indirect light affecting all objects in the map adding a constant amount of light on them. It has no explicit direction and cannot cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"directional":{"doc":"A light that has a direction and is located at infinite distance, so its rays are parallel. It simulates the sun light and can cast shadows.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"flat":{"doc":"A global directional light source which is only applied on 3D and hillshade layers. Using this type disables other light sources.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}}},"properties":["properties_light_directional","properties_light_ambient","properties_light_flat"],"properties_light_directional":{"direction":{"type":"array","default":[210,30],"minimum":[0,0],"maximum":[360,90],"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Direction of the light source specified as [a azimuthal angle, p polar angle] where a indicates the azimuthal angle of the light relative to north (in degrees and proceeding clockwise), and p indicates polar angle of the light (from 0°, directly above, to 180°, directly below).","example":[90,40],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the directional light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"cast-shadows":{"type":"boolean","default":false,"doc":"Enable/Disable shadow casting for this light","transition":false,"expression":{"interpolated":false},"property-type":"data-constant","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"shadow-intensity":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Determines the shadow strength, affecting the shadow receiver surfaces final color. Values near 0.0 reduce the shadow contribution to the final color. Values near to 1.0 make occluded surfaces receive almost no directional light. Designed to be used mostly for transitioning between values 0 and 1.","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_ambient":{"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"A multiplier for the color of the ambient light.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"properties_light_flat":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"sources":{"*":{"type":"source","doc":"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},"source":["source_vector","source_raster","source_raster_dem","source_raster_array","source_geojson","source_video","source_image","source_model"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{"doc":"A vector tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`. If specified as a string for a vector tile source, the same property is used across all its source layers. If specified as an object only specified source layers will have id overriden, others will fallback to original feature id"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{"doc":"A raster tile source."}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"scheme":{"type":"enum","values":{"xyz":{"doc":"Slippy map tilenames scheme."},"tms":{"doc":"OSGeo spec scheme."}},"default":"xyz","doc":"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{"doc":"A RGB-encoded raster DEM source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"encoding":{"type":"enum","values":{"terrarium":{"doc":"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},"mapbox":{"doc":"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},"default":"mapbox","doc":"The encoding used by this source. Mapbox Terrain RGB is used by default"},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_raster_array":{"experimental":true,"type":{"required":true,"type":"enum","values":{"raster-array":{"doc":"A raster array source"}},"doc":"The type of the source."},"url":{"type":"string","doc":"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://`. Required if `tiles` is not provided."},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec. Required if `url` is not provided."},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129],"doc":"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which tiles are available, as in the TileJSON spec."},"maxzoom":{"type":"number","default":22,"doc":"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"tileSize":{"type":"number","default":512,"units":"pixels","doc":"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"rasterLayers":{"type":"*","doc":"Contains the description of the raster data layers and the bands contained within the tiles."},"volatile":{"type":"boolean","default":false,"doc":"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{"android":"9.3.0","ios":"5.10.0"}}},"*":{"type":"*","doc":"Other keys to configure the data source."}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{"doc":"A GeoJSON data source."}},"doc":"The data type of the GeoJSON source."},"data":{"type":"*","doc":"A URL to a GeoJSON file, or inline GeoJSON."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level at which to create vector tiles"},"attribution":{"type":"string","doc":"Contains an attribution to be displayed when the map is shown to a user."},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0,"doc":"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},"filter":{"type":"*","doc":"An expression for filtering features prior to processing them for rendering."},"tolerance":{"type":"number","default":0.375,"doc":"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},"cluster":{"type":"boolean","default":false,"doc":"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count"},"clusterRadius":{"type":"number","default":50,"minimum":0,"doc":"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},"clusterMaxZoom":{"type":"number","doc":"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},"clusterMinPoints":{"type":"number","doc":"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},"clusterProperties":{"type":"*","doc":"An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{\\"property_name\\": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `\\"+\\"` or `\\"max\\"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{\\"sum\\": [\\"+\\", [\\"get\\", \\"scalerank\\"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `[\\"accumulated\\"]` value, e.g.:\\n`{\\"sum\\": [[\\"+\\", [\\"accumulated\\"], [\\"get\\", \\"sum\\"]], [\\"get\\", \\"scalerank\\"]]}`"},"lineMetrics":{"type":"boolean","default":false,"doc":"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},"generateId":{"type":"boolean","default":false,"doc":"Whether to generate ids for the GeoJSON features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},"promoteId":{"type":"promoteId","doc":"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{: }`."},"dynamic":{"type":"boolean","default":false,"doc":"Whether to optimize this source for frequent data updates (e.g. animating features).","sdk-support":{"basic functionality":{"js":"3.4.0"}}}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{"doc":"A video data source."}},"doc":"The data type of the video source."},"urls":{"required":true,"type":"array","value":"string","doc":"URLs to video content in order of preferred format."},"coordinates":{"required":true,"doc":"Corners of video specified in longitude, latitude pairs.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{"doc":"An image data source."}},"doc":"The data type of the image source."},"url":{"required":false,"type":"string","doc":"URL that points to an image. If the URL is not specified, the image is expected to be loaded directly during runtime."},"coordinates":{"required":true,"doc":"Corners of image specified in longitude, latitude pairs. Note: When using globe projection, the image will be centered at the North or South Pole in the respective hemisphere if the average latitude value exceeds 85 degrees or falls below -85 degrees.","type":"array","length":4,"value":{"type":"array","length":2,"value":"number","doc":"A single longitude, latitude pair."}}},"source_model":{"type":{"required":true,"type":"enum","values":{"model":{"doc":"A collection of 3D models"},"batched-model":{"doc":"A collection of 3D models with anchor data"}},"doc":"Type of model source to be added. From single models to represent 2D layers to 3D tiled models covering a wide area."},"maxzoom":{"type":"number","default":18,"doc":"Maximum zoom level at which to create batched model tiles. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},"minzoom":{"type":"number","default":0,"doc":"Minimum zoom level for which batched-model tiles are available"},"tiles":{"type":"array","value":"string","doc":"An array of one or more tile source URLs, as in the TileJSON spec."}},"layer":{"id":{"type":"string","doc":"Unique layer name.","required":true},"type":{"type":"enum","values":{"fill":{"doc":"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"line":{"doc":"A stroked line.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"symbol":{"doc":"An icon or a text label.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"circle":{"doc":"A filled circle.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"heatmap":{"doc":"A heatmap.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"fill-extrusion":{"doc":"An extruded (3D) polygon.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"raster":{"doc":"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"raster-particle":{"experimental":true,"doc":"Particle animation driven by textures such as wind maps.","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}}},"hillshade":{"doc":"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}}},"model":{"doc":"A 3D model","experimental":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"background":{"doc":"The background color or pattern of the map.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}}},"sky":{"doc":"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"slot":{"doc":"Marks the position of a slot.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"clip":{"doc":"Layer that removes 3D content from map.","experimental":true,"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.6.0","ios":"11.6.0"}}}},"doc":"Rendering type of this layer.","required":true},"metadata":{"type":"*","doc":"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},"source":{"type":"string","doc":"Name of a source description to be used for this layer. Required for all layer types except `background` and `slot`."},"source-layer":{"type":"string","doc":"Layer to use from a vector tile source. Required for vector and raster-array sources; prohibited for all other source types, including GeoJSON sources."},"slot":{"type":"string","doc":"The slot this layer is assigned to. If specified, and a slot with that name exists, it will be placed at that position in the layer order.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"minzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},"maxzoom":{"type":"number","minimum":0,"maximum":24,"doc":"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},"filter":{"type":"filter","doc":"An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `[\\"feature-state\\", ...]` expression is not supported in filter expressions. The `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions are supported only for filter expressions on the symbol layer."},"layout":{"type":"layout","doc":"Layout properties for the layer."},"paint":{"type":"paint","doc":"Default paint properties for this layer."}},"layout":["layout_clip","layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_raster-particle","layout_hillshade","layout_background","layout_sky","layout_model"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_model":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"model-id":{"type":"string","default":"","doc":"Model to render. It can be either a string referencing an element to the models root property or an internal or external URL","property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":false,"requires":[{"source":["geojson","vector"]}]}},"layout_clip":{"clip-layer-types":{"type":"array","value":"enum","values":{"model":{"doc":"If present the clip layer would remove all 3d model layers below it. Currently only instanced models (e.g. trees) are removed."},"symbol":{"doc":"If present the clip layer would remove all symbol layers below it."}},"default":[],"doc":"Layer types that will also be removed if fallen below this clip layer.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.6.0","ios":"11.6.0"}},"expression":{"interpolated":false},"property-type":"data-constant","experimental":true}},"layout_fill":{"fill-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"},"data-driven styling":{"js":"1.2.0","android":"9.2.0","ios":"5.9.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","experimental":true,"private":true,"default":0,"minimum":0,"maximum":1,"doc":"Radius of a fill extrusion edge in meters. If not zero, rounds extrusion edges for a smoother appearance.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{"doc":"A cap with a squared-off end which is drawn to the exact endpoint of the line."},"round":{"doc":"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"square":{"doc":"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."}},"default":"butt","doc":"The display of line endings.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{"doc":"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."},"round":{"doc":"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},"miter":{"doc":"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."},"none":{"doc":"Line segments are not joined together, each one creates a separate line. Useful in combination with line-pattern. Line-cap property is not respected. Can\'t be used with data-driven styling."}},"default":"miter","doc":"The display of lines when joining.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"},"`none` value":{"js":"3.4.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"doc":"Used to automatically convert miter joins to bevel joins for sharp angles.","requires":[{"line-join":"miter"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"doc":"Used to automatically convert round joins to miter joins for shallow angles.","requires":[{"line-join":"round"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"},"data-driven styling":{"js":"1.2.0","android":"9.1.0","ios":"5.8.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-z-offset":{"type":"number","experimental":true,"doc":"Vertical offset from ground, in meters. Defaults to 0. Not supported for globe projection at the moment.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"},"data-driven styling":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature","line-progress"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{"doc":"The label is placed at the point where the geometry is located."},"line":{"doc":"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{"doc":"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},"default":"point","doc":"Label placement relative to its geometry.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`line-center` value":{"js":"0.47.0","android":"6.4.0","ios":"4.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","doc":"Distance between two symbol anchors.","requires":[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"doc":"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don\'t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","doc":"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"},"data-driven styling":{"js":"0.53.0","android":"7.4.0","ios":"4.11.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{"doc":"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"source":{"doc":"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},"default":"auto","doc":"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{"js":"0.49.0","android":"6.6.0","ios":"4.5.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-z-elevate":{"type":"boolean","default":false,"doc":"Position symbol on buildings (both fill extrusions and models) rooftops. In order to have minimal impact on performance, this is supported only when `fill-extrusion-height` is not zoom-dependent and remains unchanged. For fading in buildings when zooming in, fill-extrusion-vertical-scale should be used and symbols would raise with building rooftops. Symbols are sorted by elevation, except in cases when `viewport-y` sorting or `symbol-sort-key` are applied.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"requires":[{"symbol-placement":["point"]},{"symbol-z-order":["auto"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the icon will be visible even if it collides with other previously drawn symbols.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the icon.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"doc":"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},"viewport":{"doc":"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of icons.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","doc":"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{"doc":"The icon is displayed at its intrinsic aspect ratio."},"width":{"doc":"The icon is scaled in the x-dimension to fit the width of the text."},"height":{"doc":"The icon is scaled in the y-dimension to fit the height of the text."},"both":{"doc":"The icon is scaled in both x- and y-dimensions."}},"default":"none","doc":"Scales the icon to fit around the associated text.","requires":["icon-image","text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"stretchable icons":{"js":"1.6.0","android":"9.2.0","ios":"5.8.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","doc":"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-image":{"type":"resolvedImage","doc":"Name of image in sprite to use for drawing an image background.","tokens":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the icon clockwise.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the icon bounding box used for detecting symbol collisions.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"doc":"If true, the icon may be flipped to prevent it from being rendered upside-down.","requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"doc":"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{"doc":"The center of the icon is placed closest to the anchor."},"left":{"doc":"The left side of the icon is placed closest to the anchor."},"right":{"doc":"The right side of the icon is placed closest to the anchor."},"top":{"doc":"The top of the icon is placed closest to the anchor."},"bottom":{"doc":"The bottom of the icon is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the icon is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the icon is placed closest to the anchor."}},"default":"center","doc":"Part of the icon placed closest to the anchor.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The icon is aligned to the plane of the map."},"viewport":{"doc":"The icon is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `icon-rotation-alignment`."}},"default":"auto","doc":"Orientation of icon when map is pitched.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The text is aligned to the plane of the map."},"viewport":{"doc":"The text is aligned to the plane of the viewport."},"auto":{"doc":"Automatically matches the value of `text-rotation-alignment`."}},"default":"auto","doc":"Orientation of text when map is pitched.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{"doc":"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},"viewport":{"doc":"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"auto":{"doc":"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},"default":"auto","doc":"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"`auto` value":{"js":"0.25.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"doc":"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"doc":"Font stack to use for displaying text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","doc":"Font size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","doc":"The maximum line width for text wrapping.","requires":["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","doc":"Text leading value for multi-line text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0","android":"10.0.0","ios":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","doc":"Text tracking amount.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.40.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{"doc":"The text is aligned towards the anchor position."},"left":{"doc":"The text is aligned to the left."},"center":{"doc":"The text is centered."},"right":{"doc":"The text is aligned to the right."}},"default":"center","doc":"Text justification options.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"},"auto":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"doc":"Radial offset of text, in the direction of the symbol\'s anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"},"data-driven styling":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"requires":["text-field",{"symbol-placement":["point"]}],"doc":"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{"js":"0.54.0","android":"7.4.0","ios":"4.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{"doc":"The center of the text is placed closest to the anchor."},"left":{"doc":"The left side of the text is placed closest to the anchor."},"right":{"doc":"The right side of the text is placed closest to the anchor."},"top":{"doc":"The top of the text is placed closest to the anchor."},"bottom":{"doc":"The bottom of the text is placed closest to the anchor."},"top-left":{"doc":"The top left corner of the text is placed closest to the anchor."},"top-right":{"doc":"The top right corner of the text is placed closest to the anchor."},"bottom-left":{"doc":"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{"doc":"The bottom right corner of the text is placed closest to the anchor."}},"default":"center","doc":"Part of the text placed closest to the anchor.","requires":["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","doc":"Maximum angle change between adjacent characters.","requires":["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{"doc":"If a text\'s language supports horizontal writing mode, symbols would be laid out horizontally."},"vertical":{"doc":"If a text\'s language supports vertical writing mode, symbols would be laid out vertically."}},"doc":"The property allows control over a symbol\'s orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single \'vertical\' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either [\'horizontal\', \'vertical\'] or [\'vertical\', \'horizontal\'], the order doesn\'t affect the placement.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"1.3.0","android":"8.3.0","ios":"5.3.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","doc":"Rotates the text clockwise.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","doc":"Size of the additional area around the text bounding box used for detecting symbol collisions.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"doc":"If true, the text may be flipped vertically to prevent it from being rendered upside-down.","requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{"doc":"The text is not altered."},"uppercase":{"doc":"Forces all letters to be displayed in uppercase."},"lowercase":{"doc":"Forces all letters to be displayed in lowercase."}},"default":"none","doc":"Specifies how to capitalize text, similar to the CSS `text-transform` property.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","doc":"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.35.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"doc":"If true, the text will be visible even if it collides with other previously drawn symbols.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"doc":"If true, other symbols can be visible even if they collide with the text.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"doc":"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.","requires":["text-field","icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_raster-particle":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"},"expressions support":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{"doc":"The layer is shown."},"none":{"doc":"The layer is not shown."}},"default":"visible","doc":"Whether this layer is displayed.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"},"expressions support":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":false},"property-type":"constant"}},"filter":{"type":"array","value":"*","doc":"A filter selects specific features from a layer."},"filter_symbol":{"type":"boolean","doc":"Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","doc":"Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","doc":"Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","doc":"Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","doc":"Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `[\\"pitch\\"]` and `[\\"distance-from-center\\"]` expressions to reference the current state of the view.","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{"doc":"`[\\"==\\", key, value]` equality: `feature[key] = value`"},"!=":{"doc":"`[\\"!=\\", key, value]` inequality: `feature[key] ≠ value`"},">":{"doc":"`[\\">\\", key, value]` greater than: `feature[key] > value`"},">=":{"doc":"`[\\">=\\", key, value]` greater than or equal: `feature[key] ≥ value`"},"<":{"doc":"`[\\"<\\", key, value]` less than: `feature[key] < value`"},"<=":{"doc":"`[\\"<=\\", key, value]` less than or equal: `feature[key] ≤ value`"},"in":{"doc":"`[\\"in\\", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`"},"!in":{"doc":"`[\\"!in\\", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`"},"all":{"doc":"`[\\"all\\", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`"},"any":{"doc":"`[\\"any\\", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`"},"none":{"doc":"`[\\"none\\", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`"},"has":{"doc":"`[\\"has\\", key]` `feature[key]` exists"},"!has":{"doc":"`[\\"!has\\", key]` `feature[key]` does not exist"}},"doc":"The filter operator."},"geometry_type":{"type":"enum","values":{"Point":{"doc":"Filter to point geometries."},"LineString":{"doc":"Filter to line geometries."},"Polygon":{"doc":"Filter to polygon geometries."}},"doc":"The geometry type for the filter to select."},"function":{"expression":{"type":"expression","doc":"An expression."},"stops":{"type":"array","doc":"An array of stops.","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0,"doc":"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},"property":{"type":"string","doc":"The name of a feature property to use as the function input.","default":"$zoom"},"type":{"type":"enum","values":{"identity":{"doc":"Return the input value as the output value."},"exponential":{"doc":"Generate an output by interpolating between stops just less than and just greater than the function input."},"interval":{"doc":"Return the output value of the stop just less than the function input."},"categorical":{"doc":"Return the output value of the stop equal to the function input."}},"doc":"The interpolation strategy to use in function evaluation.","default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{"doc":"Use the RGB color space to interpolate color values"},"lab":{"doc":"Use the LAB color space to interpolate color values."},"hcl":{"doc":"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},"doc":"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.","default":"rgb"},"default":{"type":"*","required":false,"doc":"A value to serve as a fallback function result when a value isn\'t otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property\'s default is used in these circumstances."}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2,"doc":"Zoom level and value pair."},"expression":{"type":"array","value":"*","minimum":1,"doc":"An expression defines a function that can be used for data-driven style properties or feature filters."},"expression_name":{"doc":"","type":"enum","values":{"let":{"doc":"Binds expressions to named variables, which can then be referenced in the result expression using [\\"var\\", \\"variable_name\\"].","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"var":{"doc":"References variable bound using \\"let\\".","group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"config":{"doc":"Retrieves the configuration value for the given option.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"literal":{"doc":"Provides a literal array or object value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"array":{"doc":"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"at":{"doc":"Retrieves an item from an array.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"in":{"doc":"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.6.0","android":"9.1.0","ios":"5.8.0"}}},"index-of":{"doc":"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"slice":{"doc":"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.","group":"Lookup","sdk-support":{"basic functionality":{"js":"1.10.0","android":"10.0.0","ios":"10.0.0"}}},"case":{"doc":"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"match":{"doc":"Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `[\\"get\\", \\"building_type\\"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `[\\"c\\", \\"b\\"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `\\"in\\"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"coalesce":{"doc":"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`\'image\'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"step":{"doc":"Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). The `input` may be any numeric expression (e.g., `[\\"get\\", \\"population\\"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array`, or `color`.\\n\\nInterpolation types:\\n- `[\\"linear\\"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `[\\"exponential\\", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `[\\"cubic-bezier\\", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"interpolate-hcl":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"interpolate-lab":{"doc":"Produces continuous, smooth results by interpolating between pairs of input and output values (\\"stops\\"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.","group":"Ramps, scales, curves","sdk-support":{"basic functionality":{"js":"0.49.0"}}},"ln2":{"doc":"Returns mathematical constant ln(2).","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pi":{"doc":"Returns the mathematical constant pi.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"e":{"doc":"Returns the mathematical constant e.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"typeof":{"doc":"Returns a string describing the type of the given value.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"string":{"doc":"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"number":{"doc":"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"boolean":{"doc":"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"object":{"doc":"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"collator":{"doc":"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.","group":"Types","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"format":{"doc":"Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `\\"text-font\\"`: Overrides the font stack specified by the root layout property.\\n- `\\"text-color\\"`: Overrides the color specified by the root paint property.\\n- `\\"font-scale\\"`: Applies a scaling factor on `text-size` as specified by the root layout property.","group":"Types","sdk-support":{"basic functionality":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-font":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"font-scale":{"js":"0.48.0","android":"6.7.0","ios":"4.6.0"},"text-color":{"js":"1.3.0","android":"7.3.0","ios":"4.10.0"},"image":{"js":"1.6.0","android":"8.6.0","ios":"5.7.0"}}},"image":{"doc":"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`\'format\'`](#types-format) expression. A [`\'coalesce\'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `\'image\'` argument. To implement crossfading between two images within a symbol layer using the [`icon-image-cross-fade`](/mapbox-gl-js/style-spec/layers/#paint-symbol-icon-image-cross-fade) attribute, include a second image as the second argument in the `\'image\'` expression.","group":"Types","sdk-support":{"basic functionality":{"js":"1.4.0","android":"8.6.0","ios":"5.7.0"}}},"number-format":{"doc":"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `unit` argument specifies a [simple ECMAScript unit](https://tc39.es/proposal-unified-intl-numberformat/section6/locales-currencies-tz_proposed_out.html#sec-issanctionedsimpleunitidentifier) to use for unit-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.","group":"Types","sdk-support":{"basic functionality":{"js":"0.54.0","android":"8.4.0","ios":"5.4.0"}}},"to-string":{"doc":"Converts the input value to a string. If the input is `null`, the result is `\\"\\"`. If the input is a [`boolean`](#types-boolean), the result is `\\"true\\"` or `\\"false\\"`. If the input is a number, it is converted to a string as specified by the [\\"NumberToString\\" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `\\"rgba(r,g,b,a)\\"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\'image\'`](#types-image) expression, `\'to-string\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-number":{"doc":"Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the [\\"ToNumber Applied to the String Type\\" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-boolean":{"doc":"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-rgba":{"doc":"Returns a four-element array containing the input color\'s red, green, blue, and alpha components, in that order.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"to-color":{"doc":"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.","group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgb":{"doc":"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"rgba":{"doc":"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"hsl":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component of 1. If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"hsla":{"doc":"Creates a color value from hue (range 0-360), saturation and lightness components (range 0-100), and an alpha component (range 0-1). If any component is out of range, the expression is an error.","group":"Color","sdk-support":{"basic functionality":{"js":"2.12.1","android":"10.11.0","ios":"10.11.0"}}},"get":{"doc":"Retrieves a property value from the current feature\'s properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"has":{"doc":"Tests for the presence of an property value in the current feature\'s properties, or from another object if a second argument is provided.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"length":{"doc":"Returns the length of an array or string.","group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"properties":{"doc":"Returns the feature properties object. Note that in some cases, it may be more efficient to use `[\\"get\\", \\"property_name\\"]` directly.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"feature-state":{"doc":"Retrieves a property value from the current feature\'s state. Returns `null` if the requested property is not present on the feature\'s state. A feature\'s state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\"feature-state\\"] can only be used with paint properties that support data-driven styling.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.46.0","android":"10.0.0","ios":"10.0.0"}}},"geometry-type":{"doc":"Returns the feature\'s geometry type: `Point`, `LineString` or `Polygon`. `Multi*` feature types return the singular forms.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"id":{"doc":"Returns the feature\'s id, if it has one.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"zoom":{"doc":"Returns the current zoom level. Note that in style layout and paint properties, [\\"zoom\\"] may only appear as the input to a top-level \\"step\\" or \\"interpolate\\" expression.","group":"Camera","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"pitch":{"doc":"Returns the current pitch in degrees. `[\\"pitch\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"distance-from-center":{"doc":"Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `[\\"distance-from-center\\"]` may only be used in the `filter` expression for a `symbol` layer.","group":"Camera","sdk-support":{"basic functionality":{"js":"2.6.0","android":"10.9.0","ios":"10.9.0"}}},"measure-light":{"doc":"Returns a requested property of the light configuration based on the supplied options. Currently the only supported option is `brightness` which returns the global brightness value of the lights on a scale of 0 to 1, where 0 means total darkness and 1 means full brightness. This expression works only with 3D light, i.e. when `lights` root property is defined.","group":"Lookup","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"heatmap-density":{"doc":"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.","group":"Heatmap","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"line-progress":{"doc":"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.6.0"}}},"sky-radial-progress":{"doc":"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.","group":"sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"accumulated":{"doc":"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.","group":"Feature data","sdk-support":{"basic functionality":{"js":"0.53.0","android":"8.4.0","ios":"5.5.0"}}},"+":{"doc":"Returns the sum of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"*":{"doc":"Returns the product of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"-":{"doc":"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"/":{"doc":"Returns the result of floating point division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"%":{"doc":"Returns the remainder after integer division of the first input by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"^":{"doc":"Returns the result of raising the first input to the power specified by the second.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sqrt":{"doc":"Returns the square root of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.42.0","android":"6.0.0","ios":"4.0.0"}}},"log10":{"doc":"Returns the base-ten logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"ln":{"doc":"Returns the natural logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"log2":{"doc":"Returns the base-two logarithm of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"sin":{"doc":"Returns the sine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"cos":{"doc":"Returns the cosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"tan":{"doc":"Returns the tangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"asin":{"doc":"Returns the arcsine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"acos":{"doc":"Returns the arccosine of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"atan":{"doc":"Returns the arctangent of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"min":{"doc":"Returns the minimum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"max":{"doc":"Returns the maximum value of the inputs.","group":"Math","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"round":{"doc":"Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `[\\"round\\", -1.5]` evaluates to -2.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"abs":{"doc":"Returns the absolute value of the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"ceil":{"doc":"Returns the smallest integer that is greater than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"floor":{"doc":"Returns the largest integer that is less than or equal to the input.","group":"Math","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.0.0","ios":"4.0.0"}}},"distance":{"doc":"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"9.2.0","ios":"5.9.0"}}},"==":{"doc":"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"!=":{"doc":"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">":{"doc":"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<":{"doc":"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},">=":{"doc":"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"<=":{"doc":"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"collator":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"all":{"doc":"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"any":{"doc":"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"!":{"doc":"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.","group":"Decision","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"within":{"doc":"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line\'s endpoint is on the boundary.","group":"Decision","sdk-support":{"basic functionality":{"js":"1.9.0","android":"9.1.0","ios":"5.8.0"}}},"is-supported-script":{"doc":"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.6.0","ios":"4.1.0"}}},"upcase":{"doc":"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"downcase":{"doc":"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"concat":{"doc":"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.","group":"String","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"resolved-locale":{"doc":"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.","group":"String","sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.2.0"}}},"raster-value":{"doc":"Returns the raster value of a pixel computed via `raster-color-mix`. Can only be used in the `raster-color` property.","group":"Raster Colorization","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-particle-speed":{"doc":"Returns the length of the particle velocity vector. Can only be used in the `raster-particle-color` property.","group":"Raster Particle Animation","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}}},"random":{"doc":"Returns a random value in the specified range (first two input numbers) based on a supplied seed (third input). The seed can be an expression or a constant number or string value.","group":"Math","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}}},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{"js":"2.3.0","android":"10.6.0","ios":"10.6.0"}}},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true,"doc":"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.6.0","ios":"10.6.0"}}},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"doc":"An array of two number values, specifying the vertical range, measured in meters, over which the fog should gradually fade out. When both parameters are set to zero, the fog will be rendered without any vertical constraints.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}}},"camera":{"camera-projection":{"doc":"Camera projection describes how 3D world geometry get projected into 2D screen","type":"enum","values":{"perspective":{"doc":"linear projection where distant objects appear smaller than closer objects. Lines that are parallel seem to converge towards a vanishing point"},"orthographic":{"doc":"Projection where objects are of the same scale regardless of whether they are far away or near to the camera. Parallel lines remains parallel and there is no vanishing point."}},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","doc":"Expects a base64 encoded PNG image which represents a cube strip LUT. The height of the image cannot exceed 32 pixels and the width must be equal to the height squared.","transition":false,"property-type":"data-constant","expression":{"interpolated":false}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{"doc":"The position of the light source is aligned to the rotation of the map."},"viewport":{"doc":"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"doc":"Whether extruded geometries are lit relative to the map or viewport.","example":"map","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).","example":[1.5,90,80],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}}}},"projection":{"name":{"type":"enum","values":{"albers":{"doc":"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"equalEarth":{"doc":"An Equal Earth projection."},"equirectangular":{"doc":"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},"lambertConformalConic":{"doc":"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},"mercator":{"doc":"The Mercator projection is the default projection."},"naturalEarth":{"doc":"A Natural Earth projection."},"winkelTripel":{"doc":"A Winkel Tripel projection."},"globe":{"doc":"A globe projection."}},"default":"mercator","doc":"The name of the projection to be used for rendering the map.","required":true,"sdk-support":{"basic functionality":{"js":"2.6.0","ios":"10.5.0","android":"10.5.0"}}},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"doc":"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].","example":[-96,37.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"doc":"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).","example":[29.5,45.5],"requires":[{"name":["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{"js":"2.6.0"}}}},"terrain":{"source":{"type":"string","doc":"Name of a source of `raster_dem` type to be used for terrain elevation.","required":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","requires":["source"],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}}}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"doc":"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.21.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","doc":"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color\'s opacity will not affect the opacity of the 1px stroke, if it is used.","transition":true,"requires":[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","doc":"The outline color of the fill. Matches the value of `fill-color` if unspecified.","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.19.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill is translated relative to the map."},"viewport":{"doc":"The fill is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-translate`.","default":"map","requires":["fill-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","doc":"The base color of the extruded fill. The extrusion\'s surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{"doc":"The fill extrusion is translated relative to the map."},"viewport":{"doc":"The fill extrusion is translated relative to the viewport."}},"doc":"Controls the frame of reference for `fill-extrusion-translate`.","default":"map","requires":["fill-extrusion-translate"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude this layer.","transition":true,"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","doc":"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.","transition":true,"requires":["fill-extrusion-height"],"sdk-support":{"basic functionality":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"},"data-driven styling":{"js":"0.27.0","android":"5.1.0","ios":"3.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"doc":"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.","transition":false,"sdk-support":{"basic functionality":{"js":"0.50.0","android":"7.0.0","ios":"4.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Controls the intensity of shading near ground and concave angles between walls. Default value 0.0 disables ambient occlusion and values around 0.3 provide the most plausible results for buildings.","sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings. This property works only with legacy light. When 3D lights are enabled `fill-extrusion-ambient-occlusion-wall-radius` and `fill-extrusion-ambient-occlusion-ground-radius` are used instead.","requires":["fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.7.0","ios":"10.7.0"}}},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"Shades area near ground and concave angles between walls where the radius defines only vertical impact. Default value 3.0 corresponds to height of one floor and brings the most plausible results for buildings.","requires":["lights","fill-extrusion-edge-radius"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"doc":"The extent of the ambient occlusion effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the ambient occlusion on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","doc":"The color of the flood light effect on the walls of the extruded buildings.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"doc":"The intensity of the flood light color.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"units":"meters","default":0,"minimum":0,"doc":"The extent of the flood light effect on the walls of the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"units":"meters","default":0,"doc":"The extent of the flood light effect on the ground beneath the extruded buildings in meters.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"doc":"Provides a control to futher fine-tune the look of the flood light on the ground beneath the extruded buildings. Lower values give the effect a more solid look while higher values make it smoother.","requires":["lights"],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"doc":"A global multiplier that can be used to scale base, height, AO, and flood light of the fill extrusions.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"doc":"Indicates whether top edges should be rounded when fill-extrusion-edge-radius has a value greater than 0. If false, rounded edges are only applied to the sides. Default is true.","requires":["fill-extrusion-edge-radius"],"transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.10.0","ios":"10.10.0"}},"expression":{"interpolated":false,"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. Fade out is implemented by scaling down and removing buildings in the fade range in a staggered fashion. Opacity is not changed. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","doc":"The opacity at which the line will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","doc":"The color with which the line will be drawn.","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.23.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{"doc":"The line is translated relative to the map."},"viewport":{"doc":"The line is translated relative to the viewport."}},"doc":"Controls the frame of reference for `line-translate`.","default":"map","requires":["line-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","doc":"Stroke thickness.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"doc":"Draws a line casing outside of a line\'s actual path. Value indicates the width of the inner gap.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"doc":"The line\'s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.","transition":true,"units":"pixels","sdk-support":{"basic functionality":{"js":"0.12.1","android":"3.0.0","ios":"3.1.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","doc":"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won\'t render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"2.3.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.49.0","android":"6.5.0","ios":"4.4.0"}},"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","doc":"A gradient used to color a line feature at various distances along its length. Defined using a `step` or `interpolate` expression which outputs a color for each corresponding `line-progress` input value. `line-progress` is a percentage of the line feature\'s total length as measured on the webmercator projected coordinate plane (a `number` between `0` and `1`). Can only be used with GeoJSON sources that specify `\\"lineMetrics\\": true`.","example":["interpolate",["linear"],["line-progress"],0,"blue",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"0.45.0","android":"6.5.0","ios":"4.4.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","doc":"The line part between [trim-start, trim-end] will be painted using `line-trim-color,` which is transparent by default to produce a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"2.9.0","android":"10.5.0","ios":"10.5.0"}},"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","doc":"The fade range for the trim-start and trim-end points is defined by the `line-trim-offset` property. The first element of the array represents the fade range from the trim-start point toward the end of the line, while the second element defines the fade range from the trim-end point toward the beginning of the line. The fade result is achieved by interpolating between `line-trim-color` and the color specified by the `line-color` or the `line-gradient` property.","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":["line-trim-offset",{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.6.0","android":"11.6.0","ios":"11.6.0"}},"property-type":"data-constant"},"line-trim-color":{"type":"color","doc":"The color to be used for rendering the trimmed line section that is defined by the `line-trim-offset` property.","experimental":true,"default":"transparent","transition":true,"requires":["line-trim-offset",{"source":"geojson","has":{"lineMetrics":true}}],"sdk-support":{"basic functionality":{"js":"3.6.0","android":"11.6.0","ios":"11.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"doc":"The width of the line border. A value of zero means no border.","default":0,"minimum":0,"transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"doc":"The color of the line border. If line-border-width is greater than zero and the alpha value of this color is 0 (default), the color for the border will be selected automatically based on the line color.","default":"rgba(0, 0, 0, 0)","transition":true,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"},"data-driven styling":{"js":"3.0.0","android":"10.9.0","ios":"10.9.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"experimental":true,"doc":"Opacity multiplier (multiplies line-opacity value) of the line part that is occluded by 3D objects. Value 0 hides occluded part, value 1 means the same opacity as non-occluded part. The property is not supported when `line-opacity` has data-driven styling.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","doc":"Circle radius.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","doc":"The fill color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.18.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"doc":"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","doc":"The opacity at which the circle will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.20.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{"doc":"The circle is translated relative to the map."},"viewport":{"doc":"The circle is translated relative to the viewport."}},"doc":"Controls the frame of reference for `circle-translate`.","default":"map","requires":["circle-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{"doc":"Circles are scaled according to their apparent distance to the camera."},"viewport":{"doc":"Circles are not scaled."}},"default":"map","doc":"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{"js":"0.21.0","android":"4.2.0","ios":"3.4.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{"doc":"The circle is aligned to the plane of the map."},"viewport":{"doc":"The circle is aligned to the plane of the viewport."}},"default":"viewport","doc":"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{"js":"0.39.0","android":"5.2.0","ios":"3.7.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The width of the circle\'s stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","doc":"The stroke color of the circle.","transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","doc":"The opacity of the circle\'s stroke.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"},"data-driven styling":{"js":"0.29.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","doc":"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"doc":"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"doc":"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"doc":"Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `[\\"heatmap-density\\"]` as input.","transition":false,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","doc":"The global opacity at which the heatmap layer will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"doc":"The opacity at which the icon will be drawn.","type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"doc":"The opacity at which the icon will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.","type":"number","minimum":0,"maximum":1,"default":1,"transition":true,"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"},"data-driven styling":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"doc":"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the icon\'s halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the icon outline.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Fade out the halo towards the outside.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the icon\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{"doc":"Icons are translated relative to the map."},"viewport":{"doc":"Icons are translated relative to the viewport."}},"doc":"Controls the frame of reference for `icon-translate`.","default":"map","requires":["icon-image","icon-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"requires":["icon-image"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"doc":"Controls the transition progress between the image variants of icon-image. Zero means the first variant is used, one is the second, and in between they are blended together.","transition":true},"text-opacity":{"type":"number","doc":"The opacity at which the text will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","doc":"The opacity at which the text will be drawn in case of being depth occluded. Not supported on globe zoom levels. Absent value means behavior prior to this property introduction.","minimum":0,"maximum":1,"default":1,"transition":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"},"data-driven styling":{"js":"3.5.0","android":"11.5.0","ios":"11.6.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","doc":"The color with which the text will be drawn.","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"doc":"The color of the text\'s halo, which helps it stand out from backgrounds.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","doc":"The halo\'s fadeout distance towards the outside.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"},"data-driven styling":{"js":"0.33.0","android":"5.0.0","ios":"3.5.0"}},"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","doc":"Distance that the text\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.","requires":["text-field"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{"doc":"The text is translated relative to the map."},"viewport":{"doc":"The text is translated relative to the viewport."}},"doc":"Controls the frame of reference for `text-translate`.","default":"map","requires":["text-field","text-translate"],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":false,"doc":"Increase or reduce the saturation of the symbol icon.","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}},"expression":{"interpolated":false},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":false,"doc":"Increase or reduce the contrast of the symbol icon.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","doc":"Increase or reduce the brightness of the symbols. The value is the minimum brightness.","default":0,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","doc":"Increase or reduce the brightness of the symbols. The value is the maximum brightness.","default":1,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}},"expression":{"interpolated":false},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","doc":"The opacity at which the image will be drawn.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","doc":"Defines a color map by which to colorize a raster layer, parameterized by the `[\\"raster-value\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-color-range`.","transition":false,"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the combination of source RGB channels used to compute the raster value. Computed using the equation `mix.r * src.r + mix.g * src.g + mix.b * src.b + mix.a`. The first three components specify the mix of source red, green, and blue channels, respectively. The fourth component serves as a constant offset and is *not* multipled by source alpha. Source alpha is instead carried through and applied as opacity to the colorized result. Default value corresponds to RGB luminosity.","example":[0.2126,0.7152,0.0722,0],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"requires":["raster-color"],"expression":{"interpolated":true,"parameters":["zoom"]},"doc":"When `raster-color` is active, specifies the range over which `raster-color` is tabulated. Units correspond to the computed raster value via `raster-color-mix`. For `rasterarray` sources, if `raster-color-range` is unspecified, the source\'s stated data range is used.","example":[0.5,10],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","doc":"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the minimum brightness.","default":0,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","doc":"Increase or reduce the brightness of the image. The value is the maximum brightness.","default":1,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","doc":"Increase or reduce the saturation of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","doc":"Increase or reduce the contrast of the image.","default":0,"minimum":-1,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","doc":"The resampling/interpolation method to use for overscaling, also known as texture magnification filter","values":{"linear":{"doc":"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},"nearest":{"doc":"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},"default":"linear","sdk-support":{"basic functionality":{"js":"0.47.0","android":"6.3.0","ios":"4.2.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","doc":"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant","transition":false,"requires":[{"source":"raster-array"}],"doc":"Displayed band of raster array source layer. Defaults to the first band if not set.","example":"band-name","sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.1.0","ios":"11.1.0"}}},"raster-elevation":{"type":"number","doc":"Specifies an uniform elevation from the ground, in meters.","default":0,"minimum":0,"transition":true,"experimental":true,"sdk-support":{"basic functionality":{"js":"3.1.0","android":"11.2.0","ios":"11.2.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant","transition":false,"doc":"Displayed band of raster array source layer","example":"\\"1713348000\\"","sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}}},"raster-particle-count":{"type":"number","doc":"Defines the amount of particles per tile.","default":512,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"property-type":"data-constant"},"raster-particle-color":{"type":"color","doc":"Defines a color map by which to colorize a raster particle layer, parameterized by the `[\\"raster-particle-speed\\"]` expression and evaluated at 256 uniformly spaced steps over the range specified by `raster-particle-max-speed`.","transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","doc":"Defines the maximum speed for particles. Velocities with magnitudes equal to or exceeding this value are clamped to the max value.","default":1,"minimum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","doc":"Defines a coefficient for the speed of particles’ motion.","default":0.2,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","doc":"Defines defines the opacity coefficient applied to the faded particles in each frame. In practice, this property controls the length of the particle tail.","default":0.98,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","doc":"Defines a coefficient for a time period at which particles will restart at a random position, to avoid degeneration (empty areas without particles).","default":0.8,"minimum":0,"maximum":1,"transition":false,"sdk-support":{"basic functionality":{"js":"3.3.0","android":"11.4.0","ios":"11.4.0"}},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"doc":"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map` and no 3d lights enabled. If `hillshade-illumination-anchor` is set to `map` and 3d lights enabled, the direction from 3d lights is used instead.","transition":false,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{"doc":"The hillshade illumination is relative to the north direction."},"viewport":{"doc":"The hillshade illumination is relative to the top of the viewport."}},"default":"viewport","doc":"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","doc":"Intensity of the hillshade","default":0.5,"minimum":0,"maximum":1,"transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","doc":"The shading color of areas that face away from the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","doc":"The shading color of areas that faces towards the light source.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","doc":"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.","transition":true,"sdk-support":{"basic functionality":{"js":"0.43.0","android":"6.0.0","ios":"4.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","doc":"The color with which the background will be drawn.","transition":true,"requires":[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"doc":"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity at which the background will be drawn.","transition":true,"sdk-support":{"basic functionality":{"js":"0.10.0","android":"2.0.1","ios":"2.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"units":"intensity","doc":"Controls the intensity of light emitted on the source features.","requires":["lights"],"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{"doc":"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},"atmosphere":{"doc":"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},"default":"atmosphere","doc":"The type of the sky","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"doc":"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"doc":"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"doc":"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"doc":"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.","transition":false,"requires":[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"},"data-driven styling":{}},"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","doc":"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","doc":"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.","transition":false,"requires":[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the entire sky layer.","transition":true,"sdk-support":{"basic functionality":{"js":"2.0.0","ios":"10.0.0","android":"10.0.0"}},"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"The opacity of the model layer.","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"units":"degrees","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The rotation of the model in euler angles [lon, lat, z]."},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"doc":"The scale of the model. Expressions that are zoom-dependent are not supported if using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true,"doc":"The translation of the model in meters in form of [longitudal, latitudal, altitude] offsets."},"model-color":{"type":"color","default":"#ffffff","doc":"The tint color of the model layer. model-color-mix-intensity (defaults to 0) defines tint(mix) intensity - this means that, this color is not used unless model-color-mix-intensity gets value greater than 0. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"doc":"Intensity of model-color (on a scale from 0 to 1) in color mix with original 3D model\'s colors. Higher number will present a higher model-color contribution in mix. Expressions that depend on measure-light are not supported when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-type":{"type":"enum","values":{"common-3d":{"doc":"Integrated to 3D scene, using depth testing, along with terrain, fill-extrusions and custom layer."},"location-indicator":{"doc":"Displayed over other 3D content, occluded by terrain."}},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"default":"common-3d","doc":"Defines rendering behavior of model in respect to other 3D scene objects.","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow casting for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"doc":"Enable/Disable shadow receiving for this layer","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Intensity of the ambient occlusion if present in the 3D model.","expression":{"interpolated":true,"parameters":["zoom"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"units":"intensity","doc":"Strength of the emission. There is no emission for value 0. For value 1.0, only emissive component (no shading) is displayed and values above 1.0 produce light contribution to surrounding area, for some of the parts (e.g. doors). Expressions that depend on measure-light are only supported as a global layer value (and not for each feature) when using GeoJSON or vector tile as the model layer source.","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"doc":"Material roughness. Material is fully smooth for value 0, and fully rough for value 1. Affects only layers using batched-model source.","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","doc":"Emissive strength multiplier along model height (gradient begin, gradient end, value at begin, value at end, gradient curve power (logarithmic scale, curve power = pow(10, val)).","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"},"data-driven styling":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"doc":"This parameter defines the range for the fade-out effect before an automatic content cutoff on pitched map views. The automatic cutoff range is calculated according to the minimum required zoom level of the source and layer. The fade range is expressed in relation to the height of the map view. A value of 1.0 indicates that the content is faded to the same extent as the map\'s height in pixels, while a value close to zero represents a sharp cutoff. When the value is set to 0.0, the cutoff is completely disabled. Note: The property has no effect on the map if terrain is enabled.","transition":false,"expression":{"interpolated":false},"sdk-support":{"basic functionality":{"js":"3.0.0","android":"11.0.0","ios":"11.0.0"}},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1],"doc":"An array for configuring the fade-out effect for the front cutoff of content on pitched map views. It contains three values: start, range and final opacity. The start parameter defines the point at which the fade-out effect begins, with smaller values causing the effect to start earlier. The range parameter specifies how long the fade-out effect will last. A value of 0.0 for range makes content disappear immediately without a fade-out effect. The final opacity determines content opacity at the end of the fade-out effect. A value of 1.0 for final opacity means that the cutoff is completely disabled.","sdk-support":{"basic functionality":{"js":"3.5.0","android":"11.5.0","ios":"11.5.0"}}}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds","doc":"Time allotted for transitions to complete."},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds","doc":"Length of time before a transition begins."}},"property-type":{"data-driven":{"type":"property-type","doc":"Property is interpolable and can be represented using a property expression."},"color-ramp":{"type":"property-type","doc":"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{"type":"property-type","doc":"Property is interpolable but cannot be represented using a property expression."},"constant":{"type":"property-type","doc":"Property is constant across all zoom levels and property values."}},"promoteId":{"*":{"type":"string","doc":"A name of a feature property to use as ID for feature state."}}}');function dMt(t){"@babel/helpers - typeof";return(dMt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yMt(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0,r=Array.isArray(t)&&t.filter(function(t){return t.metaData.tileType===e.tileType||DMt(t.metaData.prjCoordSys)===DMt(e.prjCoordSys)});return r&&r[0]&&r[0].metaData}function zMt(t,e){var r=t.scale,n=t.dpi,i=t.coordUnit,o=function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:22,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=[],i=Math.abs(t.left-t.right)/r,o=0;oMath.abs(t-e[i])&&(r=Math.abs(t-e[i]),n=i);return n}(Of(r,n,i),o)}function GMt(t){"@babel/helpers - typeof";return(GMt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function UMt(){UMt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof g?e:g,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:T(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var h="suspendedStart",p="suspendedYield",d="executing",y="completed",v={};function g(){}function m(){}function b(){}var x={};l(x,a,function(){return this});var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==r&&n.call(_,a)&&(x=_);var S=b.prototype=g.prototype=Object.create(x);function E(t){["next","throw","return"].forEach(function(e){l(t,e,function(t){return this._invoke(e,t)})})}function k(t,e){function r(i,o,a,s){var u=f(t[i],t,o);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==GMt(c)&&n.call(c,"__await")?e.resolve(c.__await).then(function(t){r("next",t,a,s)},function(t){r("throw",t,a,s)}):e.resolve(c).then(function(t){l.value=t,a(l)},function(t){return r("throw",t,a,s)})}s(u.arg)}var o;i(this,"_invoke",{value:function(t,n){function i(){return new e(function(e,i){r(t,n,e,i)})}return o=o?o.then(i,i):i()}})}function T(e,r,n){var i=h;return function(o,a){if(i===d)throw Error("Generator is already running");if(i===y){if("throw"===o)throw a;return{value:t,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=C(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=d;var l=f(e,r,n);if("normal"===l.type){if(i=n.done?y:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=y,n.method="throw",n.arg=l.arg)}}}function C(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,C(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var a=o.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function M(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function VMt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function HMt(t){for(var e=1;e=1&&(this.beforeLayerId=t.getStyle().layers[0].id),t.addLayer({id:this.id,type:"raster",source:this.id},this.beforeLayerId),this.map.fitBounds([e[1],e[3]]),this._afterAddVideoLayer()}}},{key:"_afterAddVideoLayer",value:function(){this.fire("loaded",{originCoordsRightBottom:this.originCoordsRightBottom,originCoordsLeftTop:this.originCoordsLeftTop,videoWidth:this.videoWidth,videoHeight:this.videoHeight})}},{key:"_calcCoords",value:function(t){var e=this,r=t.width,n=t.height,i=t.videoHeight,o=t.videoWidth||this.videoWidth,a=i||this.videoHeight,s=o/r,u=a/n,l=Math.min(s,u),c=r/2,f=n/2,h=o/l/2,p=a/l/2,d=[[c-h,f-p],[c+h,f-p],[c+h,f+p],[c-h,f+p]].map(function(t){return e.map.unproject(t)});return this.originCoordsLeftTop=d[0],this.originCoordsRightBottom=d[2],d}},{key:"play",value:function(){this.video.play()}},{key:"pause",value:function(){this.video.pause()}},{key:"remove",value:function(){this.id&&(this.map.removeLayer(this.id),this.map.removeSource(this.id),document.body.removeChild(document.getElementById(this.id)))}}])&&eIt(r.prototype,n),i&&eIt(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}();function sIt(t){return function(t){if(Array.isArray(t))return uIt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return uIt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?uIt(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uIt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;A(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:M(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function wIt(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function _It(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function SIt(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},r=new NMt(E9,t,e);return r.getMapInfo((n=YMt(UMt().mark(function n(i,o,a){var s,u,l,c,f,h;return UMt().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,"processCompleted"!==i.type){n.next=15;break}if(s=i.result,u=s.dynamicProjection,l=s.prjCoordSys,c=l.epsgCode,!RMt(l.type)){n.next=6;break}return a(new Error("mapbox-gl cannot support plane coordinate system.")),n.abrupt("return");case 6:if(3857===c||u||O().CRS){n.next=9;break}return a(new Error("The EPSG code ".concat(c," needs to include mapbox-gl-enhance.js. Refer to the example: https://iclient.supermap.io/examples/mapboxgl/editor.html#mvtVectorTile_2362"))),n.abrupt("return");case 9:return n.next=11,QMt(t,i.result,HMt(HMt({},e),{},{initMapService:r}));case 11:return f=n.sent,(h=new(O().Map)(f)).loaded()?o({map:h}):h.on("load",function(){o({map:h})}),n.abrupt("return");case 15:a(new Error("Fetch mapService is failed.")),n.next=21;break;case 18:n.prev=18,n.t0=n.catch(0),a(n.t0);case 21:case"end":return n.stop()}},n,null,[[0,18]])})),function(t,e,r){return n.apply(this,arguments)}));var n},O().supermap.Graphic=IJ,O().supermap.map.getDefaultVectorTileStyle=function(t,e){e=e||{};var r={};r.version=e.version||8,r.layers=e.layers||[],r.light=e.light||{anchor:"viewport",color:"#fcf6ef",intensity:.5,position:[1.15,201,20]};var n={version:r.version,sources:{"vector-tiles":{type:"vector",tiles:[t]}},layers:r.layers,light:r.light};return null!=e.sprite&&(n.sprite=e.sprite),null!=e.glyphs&&(n.glyphs=e.glyphs),n},O().supermap.map.setBackground=function(t,e){e&&t&&t.addLayer({id:"background",type:"background",paint:{"background-color":e}},"background")},O().supermap.map.setPaintProperty=function(t,e,r,n,i,o){if(e&&t){"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]);for(var a=0;at.length)&&(e=t.length);for(var r=0,n=Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function y(t,e,r){return(e=O(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v(){return(v="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=g(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}}).apply(null,arguments)}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}function b(t,e,r,n){r&&Object.defineProperty(t,e,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function x(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(x=function(){return!!t})()}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _(t){for(var e=1;e=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;P(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function k(t,e){return(k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function T(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}}(t,e)||P(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||P(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t){var e=function(t,e){if("object"!=f(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==f(e)?e:e+""}function A(t){return(A="function"==typeof Symbol&&"symbol"==f(Symbol.iterator)?function(t){return f(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":f(t)})(t)}function P(t,e){if(t){if("string"==typeof t)return i(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function M(t){var e="function"==typeof Map?new Map:void 0;return(M=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return function(t,e,r){if(x())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var i=new(t.bind.apply(t,n));return r&&k(i,r.prototype),i}(t,arguments,g(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),k(r,t)})(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var I,L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self?self:{};function j(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function N(t,e){return t(e={exports:{}},e.exports),e.exports}!function(t){!function(e){var r="object"==f(L)?L:"object"==("undefined"==typeof self?"undefined":f(self))?self:"object"==f(this)?this:Function("return this;")(),n=i(t);function i(t,e){return function(r,n){"function"!=typeof t[r]&&Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0===r.Reflect?r.Reflect=t:n=i(r.Reflect,n),function(t){var e=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return I(Object.create(null))}:a?function(){return I({__proto__:null})}:function(){return I({})},has:s?function(t,r){return e.call(t,r)}:function(t,e){return e in t},get:s?function(t,r){return e.call(t,r)?t[r]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),c="object"==("undefined"==typeof process?"undefined":f(process))&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i=0;--r){var n=(0,t[r])(e);if(!w(n)&&!_(n)){if(!C(n))throw new TypeError;e=n}}return e}(t,e)}if(!k(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(n)&&!w(n)&&!_(n))throw new TypeError;return _(n)&&(n=void 0),function(t,e,r,n){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,r,n);if(!w(o)&&!_(o)){if(!S(o))throw new TypeError;n=o}}return n}(t,e,r=E(r),n)}),t("metadata",function(t,e){return function(r,n){if(!S(r))throw new TypeError;if(!w(n)&&!function(t){switch(x(n)){case 3:case 4:return!0;default:return!1}}())throw new TypeError;m(t,e,r,n)}}),t("defineMetadata",function(t,e,r,n){if(!S(r))throw new TypeError;return w(n)||(n=E(n)),m(t,e,r,n)}),t("hasMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),function t(e,r,n){if(v(e,r,n))return!0;var i=M(r);return!_(i)&&t(e,i,n)}(t,e,r)}),t("hasOwnMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),v(t,e,r)}),t("getMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),function t(e,r,n){if(v(e,r,n))return g(e,r,n);var i=M(r);return _(i)?void 0:t(e,i,n)}(t,e,r)}),t("getOwnMetadata",function(t,e,r){if(!S(e))throw new TypeError;return w(r)||(r=E(r)),g(t,e,r)}),t("getMetadataKeys",function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=E(e)),function t(e,r){var n=b(e,r),i=M(e);if(null===i)return n;var o=t(i,r);if(o.length<=0)return n;if(n.length<=0)return o;for(var a=new p,s=[],u=0,l=n;u0)return!0;var i=d.get(e);return i.delete(r),i.size>0||d.delete(e),!0})}(n)}()}(I||(I={}));var R=N(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new function(t,e,r){this.fn=t,this.context=e,this.once=r||!1}(n,i||t,o),s=r?r+e:e;return t._events[s]?t._events[s].fn?t._events[s]=[t._events[s],a]:t._events[s].push(a):(t._events[s]=a,t._eventsCount++),t}function o(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,a=new Array(o);i= than the number of constructor arguments of its base class."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class",e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;e0,p=f.length>n.length,d=function(t,e,r,n,o){for(var a=[],s=0;s0?u:t(e,i)}return 0}});j(tt),tt.getFunctionName,tt.getBaseClassDependencyCount,tt.getDependencies;var et=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=function(){function t(t,e,r,n,i){this.id=z.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=r,this.target=i,this.childRequests=[],this.bindings=Array.isArray(n)?n:[n],this.requestScope=null===r?new Map:null}return t.prototype.addChildRequest=function(e,r,n){var i=new t(e,this.parentContext,this,r,n);return this.childRequests.push(i),i},t}();e.Request=r});j(et),et.Request;var rt=N(function(t,e){function r(t){return t._bindingDictionary}function n(t,e,r,n,o){var a,s=i(r.container,o.serviceIdentifier);return s.length===H.BindingCount.NoBindingsAvailable&&r.container.options.autoBindInjectable&&"function"==typeof o.serviceIdentifier&&t.getConstructorMetadata(o.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(o.serviceIdentifier).toSelf(),s=i(r.container,o.serviceIdentifier)),a=e?s:s.filter(function(t){var e=new et.Request(t.serviceIdentifier,r,n,t,o);return t.constraint(e)}),function(t,e,r,n){switch(e.length){case H.BindingCount.NoBindingsAvailable:if(r.isOptional())return e;var o=q.getServiceIdentifierAsString(t),a=U.NOT_REGISTERED;throw a+=q.listMetadataForTarget(o,r),a+=q.listRegisteredBindingsForServiceIdentifier(n,o,i),new Error(a);case H.BindingCount.OnlyOneBindingAvailable:if(!r.isArray())return e;case H.BindingCount.MultipleBindingsAvailable:default:if(r.isArray())return e;throw o=q.getServiceIdentifierAsString(t),a=U.AMBIGUOUS_MATCH+" "+o,a+=q.listRegisteredBindingsForServiceIdentifier(n,o,i),new Error(a)}}(o.serviceIdentifier,a,o,r.container),a}function i(t,e){var n=[],o=r(t);return o.hasKey(e)?n=o.get(e):null!==t.parent&&(n=i(t.parent,e)),n}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=r,e.plan=function(t,e,r,i,o,a,s,u){void 0===u&&(u=!1);var l=new Y.Context(e),c=function(t,e,r,n,i,o){var a=t?B.MULTI_INJECT_TAG:B.INJECT_TAG,s=new X.Metadata(a,r),u=new $.Target(e,n,r,s);if(void 0!==i){var l=new X.Metadata(i,o);u.metadata.push(l)}return u}(r,i,o,"",a,s);try{return function t(e,r,i,o,a,s){var u,l;if(null===a){u=n(e,r,o,null,s),l=new et.Request(i,o,null,u,s);var c=new Z.Plan(o,l);o.addPlan(c)}else u=n(e,r,o,a,s),l=a.addChildRequest(s.serviceIdentifier,u,s);u.forEach(function(r){var n=null;if(s.isArray())n=l.addChildRequest(r.serviceIdentifier,r,s);else{if(r.cache)return;n=l}if(r.type===F.BindingTypeEnum.Instance&&null!==r.implementationType){var i=tt.getDependencies(e,r.implementationType);if(!o.container.options.skipBaseClassChecks){var a=tt.getBaseClassDependencyCount(e,r.implementationType);if(i.length0?(o=e.filter(function(t){return null!==t.target&&t.target.type===F.TargetTypeEnum.ConstructorArgument}).map(n),a=function(t,e,r){var n=e.filter(function(t){return null!==t.target&&t.target.type===F.TargetTypeEnum.ClassProperty}),i=n.map(r);return n.forEach(function(e,r){var n;n=e.target.name.value();var o=i[r];t[n]=o}),t}(a=new((i=t).bind.apply(i,r([void 0],o))),e,n)):a=new t;return function(t,e){if(Reflect.hasMetadata(B.POST_CONSTRUCT,t)){var r=Reflect.getMetadata(B.POST_CONSTRUCT,t);try{e[r.value]()}catch(e){throw new Error(U.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,a),a}});j(nt),nt.resolveInstance;var it=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=function t(e,r,n){try{return n()}catch(t){throw W.isStackOverflowExeption(t)?new Error(U.CIRCULAR_DEPENDENCY_IN_FACTORY(e,r.toString())):t}};e.resolve=function(t){return function t(e){return function(n){n.parentContext.setCurrentRequest(n);var i=n.bindings,o=n.childRequests,a=n.target&&n.target.isArray(),s=!(n.parentRequest&&n.parentRequest.target&&n.target&&n.parentRequest.target.matchesArray(n.target.serviceIdentifier));if(a&&s)return o.map(function(r){return t(e)(r)});var u=null;if(!n.target.isOptional()||0!==i.length){var l=i[0],c=l.scope===F.BindingScopeEnum.Singleton,f=l.scope===F.BindingScopeEnum.Request;if(c&&l.activated)return l.cache;if(f&&null!==e&&e.has(l.id))return e.get(l.id);if(l.type===F.BindingTypeEnum.ConstantValue)u=l.cache,l.activated=!0;else if(l.type===F.BindingTypeEnum.Function)u=l.cache,l.activated=!0;else if(l.type===F.BindingTypeEnum.Constructor)u=l.implementationType;else if(l.type===F.BindingTypeEnum.DynamicValue&&null!==l.dynamicValue)u=r("toDynamicValue",l.serviceIdentifier,function(){return l.dynamicValue(n.parentContext)});else if(l.type===F.BindingTypeEnum.Factory&&null!==l.factory)u=r("toFactory",l.serviceIdentifier,function(){return l.factory(n.parentContext)});else if(l.type===F.BindingTypeEnum.Provider&&null!==l.provider)u=r("toProvider",l.serviceIdentifier,function(){return l.provider(n.parentContext)});else{if(l.type!==F.BindingTypeEnum.Instance||null===l.implementationType){var h=q.getServiceIdentifierAsString(n.serviceIdentifier);throw new Error(U.INVALID_BINDING_TYPE+" "+h)}u=nt.resolveInstance(l.implementationType,o,t(e))}return"function"==typeof l.onActivation&&(u=l.onActivation(n.parentContext,u)),c&&(l.cache=u,l.activated=!0),f&&null!==e&&!e.has(l.id)&&e.set(l.id,u),u}}}(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}});j(it),it.resolve;var ot=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;e.traverseAncerstors=function t(e,r){var n=e.parentRequest;return null!==n&&(!!r(n)||t(n,r))};var r=function(t){return function(e){var r=function(r){return null!==r&&null!==r.target&&r.target.matchesTag(t)(e)};return r.metaData=new X.Metadata(t,e),r}};e.taggedConstraint=r;var n=r(B.NAMED_TAG);e.namedConstraint=n,e.typeConstraint=function(t){return function(e){var r=null;if(null!==e){if(r=e.bindings[0],"string"==typeof t)return r.serviceIdentifier===t;var n=e.bindings[0].implementationType;return t===n}return!1}}});j(ot),ot.typeConstraint,ot.namedConstraint,ot.taggedConstraint,ot.traverseAncerstors;var at=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=ot.namedConstraint(t),new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new st.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=ot.taggedConstraint(t)(e),new st.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return ot.typeConstraint(t)(e.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return ot.namedConstraint(t)(e.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(r){return ot.taggedConstraint(t)(e)(r.parentRequest)},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,ot.typeConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,ot.typeConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,ot.namedConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,ot.namedConstraint(t))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(r){return ot.traverseAncerstors(r,ot.taggedConstraint(t)(e))},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(r){return!ot.traverseAncerstors(r,ot.taggedConstraint(t)(e))},new st.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return ot.traverseAncerstors(e,t)},new st.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!ot.traverseAncerstors(e,t)},new st.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=r});j(at),at.BindingWhenSyntax;var st=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new at.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=r});j(st),st.BindingOnSyntax;var ut=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var r=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new at.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new st.BindingOnSyntax(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingWhenOnSyntax=r});j(ut),ut.BindingWhenOnSyntax;var lt=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=F.BindingScopeEnum.Request,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=F.BindingScopeEnum.Transient,new ut.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=r});j(lt),lt.BindingInSyntax;var ct=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new at.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new st.BindingOnSyntax(this._binding),this._bindingInSyntax=new lt.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=r});j(ct),ct.BindingInWhenOnSyntax;var ft=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=F.BindingTypeEnum.Instance,this._binding.implementationType=t,new ct.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+U.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=F.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=F.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ct.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=F.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=F.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(U.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=F.BindingTypeEnum.Function,this._binding.scope=F.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=F.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=F.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=F.BindingScopeEnum.Singleton,new ut.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue(function(e){return e.container.get(t)})},t}();e.BindingToSyntax=r});j(ft),ft.BindingToSyntax;var ht=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,r){var n=new t;return n.bindings=e,n.middleware=r,n},t}();e.ContainerSnapshot=r});j(ht),ht.ContainerSnapshot;var pt=N(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(U.NULL_ARGUMENT);if(null==e)throw new Error(U.NULL_ARGUMENT);var r=this._map.get(t);void 0!==r?(r.push(e),this._map.set(t,r)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(U.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(U.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(U.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(U.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach(function(r,n){var i=r.filter(function(e){return!t(e)});i.length>0?e._map.set(n,i):e._map.delete(n)})},t.prototype.hasKey=function(t){if(null==t)throw new Error(U.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach(function(t,r){t.forEach(function(t){return e.add(r,t.clone())})}),e},t.prototype.traverse=function(t){this._map.forEach(function(e,r){t(r,e)})},t}();e.Lookup=r});j(pt),pt.Lookup;var dt=N(function(t,e){var r=L&&L.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},n=L&&L.__generator||function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]"),IRendererService:Symbol.for("IRendererService"),IShaderModuleService:Symbol.for("IShaderModuleService"),IIconService:Symbol.for("IIconService"),IFontService:Symbol.for("IFontService"),IInteractionService:Symbol.for("IInteractionService"),IPickingService:Symbol.for("IPickingService"),IControlService:Symbol.for("IControlService"),IStyleAttributeService:Symbol.for("IStyleAttributeService"),ILayer:Symbol.for("ILayer"),ILayerPlugin:Symbol.for("ILayerPlugin"),INormalPass:Symbol.for("INormalPass"),IPostProcessor:Symbol.for("IPostProcessor"),IPostProcessingPass:Symbol.for("IPostProcessingPass"),IFactoryPostProcessingPass:Symbol.for("Factory"),IFactoryNormalPass:Symbol.for("Factory"),IMultiPassRenderer:Symbol.for("IMultiPassRenderer"),SceneID:Symbol.for("SceneID"),MapConfig:Symbol.for("MapConfig")},Rt=function(t){return t&&t.Math===Math&&t},Dt=Rt("object"==("undefined"==typeof globalThis?"undefined":f(globalThis))&&globalThis)||Rt("object"==("undefined"==typeof window?"undefined":f(window))&&window)||Rt("object"==("undefined"==typeof self?"undefined":f(self))&&self)||Rt("object"==f(L)&&L)||Rt("object"==f(L)&&L)||function(){return this}()||Function("return this")(),Bt=function(t){try{return!!t()}catch(t){return!0}},Ft=!Bt(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),zt=!Bt(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}),Gt=Function.prototype.call,Ut=zt?Gt.bind(Gt):function(){return Gt.apply(Gt,arguments)},Vt={}.propertyIsEnumerable,Ht=Object.getOwnPropertyDescriptor,Wt={f:Ht&&!Vt.call({1:2},1)?function(t){var e=Ht(this,t);return!!e&&e.enumerable}:Vt},qt=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},Yt=Function.prototype,Xt=Yt.call,Zt=zt&&Yt.bind.bind(Xt,Xt),Kt=zt?Zt:function(t){return function(){return Xt.apply(t,arguments)}},Jt=Kt({}.toString),Qt=Kt("".slice),$t=function(t){return Qt(Jt(t),8,-1)},te=Object,ee=Kt("".split),re=Bt(function(){return!te("z").propertyIsEnumerable(0)})?function(t){return"String"===$t(t)?ee(t,""):te(t)}:te,ne=function(t){return null==t},ie=TypeError,oe=function(t){if(ne(t))throw new ie("Can't call method on "+t);return t},ae=function(t){return re(oe(t))},se="object"==("undefined"==typeof document?"undefined":f(document))&&document.all,ue=void 0===se&&void 0!==se?function(t){return"function"==typeof t||t===se}:function(t){return"function"==typeof t},le=function(t){return"object"==f(t)?null!==t:ue(t)},ce=function(t,e){return arguments.length<2?function(t){return ue(t)?t:void 0}(Dt[t]):Dt[t]&&Dt[t][e]},fe=Kt({}.isPrototypeOf),he="undefined"!=typeof navigator&&String(navigator.userAgent)||"",pe=Dt.process,de=Dt.Deno,ye=pe&&pe.versions||de&&de.version,ve=ye&&ye.v8;ve&&(Lt=(It=ve.split("."))[0]>0&&It[0]<4?1:+(It[0]+It[1])),!Lt&&he&&(!(It=he.match(/Edge\/(\d+)/))||It[1]>=74)&&(It=he.match(/Chrome\/(\d+)/))&&(Lt=+It[1]);var ge=Lt,me=Dt.String,be=!!Object.getOwnPropertySymbols&&!Bt(function(){var t=Symbol("symbol detection");return!me(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ge&&ge<41}),xe=be&&!Symbol.sham&&"symbol"==f(Symbol.iterator),we=Object,_e=xe?function(t){return"symbol"==f(t)}:function(t){var e=ce("Symbol");return ue(e)&&fe(e.prototype,we(t))},Se=String,Ee=function(t){try{return Se(t)}catch(t){return"Object"}},ke=TypeError,Te=function(t){if(ue(t))return t;throw new ke(Ee(t)+" is not a function")},Ce=function(t,e){var r=t[e];return ne(r)?void 0:Te(r)},Oe=TypeError,Ae=Object.defineProperty,Pe=function(t,e){try{Ae(Dt,t,{value:e,configurable:!0,writable:!0})}catch(r){Dt[t]=e}return e},Me=N(function(t){var e=t.exports=Dt["__core-js_shared__"]||Pe("__core-js_shared__",{});(e.versions||(e.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})}),Ie=function(t,e){return Me[t]||(Me[t]=e||{})},Le=Object,je=function(t){return Le(oe(t))},Ne=Kt({}.hasOwnProperty),Re=Object.hasOwn||function(t,e){return Ne(je(t),e)},De=0,Be=Math.random(),Fe=Kt(1..toString),ze=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Fe(++De+Be,36)},Ge=Dt.Symbol,Ue=Ie("wks"),Ve=xe?Ge.for||Ge:Ge&&Ge.withoutSetter||ze,He=function(t){return Re(Ue,t)||(Ue[t]=be&&Re(Ge,t)?Ge[t]:Ve("Symbol."+t)),Ue[t]},We=TypeError,qe=He("toPrimitive"),Ye=function(t,e){if(!le(t)||_e(t))return t;var r,n=Ce(t,qe);if(n){if(void 0===e&&(e="default"),r=Ut(n,t,e),!le(r)||_e(r))return r;throw new We("Can't convert object to primitive value")}return void 0===e&&(e="number"),function(t,e){var r,n;if("string"===e&&ue(r=t.toString)&&!le(n=Ut(r,t)))return n;if(ue(r=t.valueOf)&&!le(n=Ut(r,t)))return n;if("string"!==e&&ue(r=t.toString)&&!le(n=Ut(r,t)))return n;throw new Oe("Can't convert object to primitive value")}(t,e)},Xe=function(t){var e=Ye(t,"string");return _e(e)?e:e+""},Ze=Dt.document,Ke=le(Ze)&&le(Ze.createElement),Je=function(t){return Ke?Ze.createElement(t):{}},Qe=!Ft&&!Bt(function(){return 7!==Object.defineProperty(Je("div"),"a",{get:function(){return 7}}).a}),$e=Object.getOwnPropertyDescriptor,tr={f:Ft?$e:function(t,e){if(t=ae(t),e=Xe(e),Qe)try{return $e(t,e)}catch(t){}if(Re(t,e))return qt(!Ut(Wt.f,t,e),t[e])}},er=Ft&&Bt(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),rr=String,nr=TypeError,ir=function(t){if(le(t))return t;throw new nr(rr(t)+" is not an object")},or=TypeError,ar=Object.defineProperty,sr=Object.getOwnPropertyDescriptor,ur={f:Ft?er?function(t,e,r){if(ir(t),e=Xe(e),ir(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=sr(t,e);n&&n.writable&&(t[e]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return ar(t,e,r)}:ar:function(t,e,r){if(ir(t),e=Xe(e),ir(r),Qe)try{return ar(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new or("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},lr=Ft?function(t,e,r){return ur.f(t,e,qt(1,r))}:function(t,e,r){return t[e]=r,t},cr=Function.prototype,fr=Ft&&Object.getOwnPropertyDescriptor,hr=Re(cr,"name"),pr={EXISTS:hr,PROPER:hr&&"something"===function(){}.name,CONFIGURABLE:hr&&(!Ft||Ft&&fr(cr,"name").configurable)},dr=Kt(Function.toString);ue(Me.inspectSource)||(Me.inspectSource=function(t){return dr(t)});var yr,vr,gr,mr=Me.inspectSource,br=Dt.WeakMap,xr=ue(br)&&/native code/.test(String(br)),wr=Ie("keys"),_r=function(t){return wr[t]||(wr[t]=ze(t))},Sr={},Er=Dt.TypeError,kr=Dt.WeakMap;if(xr||Me.state){var Tr=Me.state||(Me.state=new kr);Tr.get=Tr.get,Tr.has=Tr.has,Tr.set=Tr.set,yr=function(t,e){if(Tr.has(t))throw new Er("Object already initialized");return e.facade=t,Tr.set(t,e),e},vr=function(t){return Tr.get(t)||{}},gr=function(t){return Tr.has(t)}}else{var Cr=_r("state");Sr[Cr]=!0,yr=function(t,e){if(Re(t,Cr))throw new Er("Object already initialized");return e.facade=t,lr(t,Cr,e),e},vr=function(t){return Re(t,Cr)?t[Cr]:{}},gr=function(t){return Re(t,Cr)}}var Or={set:yr,get:vr,has:gr,enforce:function(t){return gr(t)?vr(t):yr(t,{})},getterFor:function(t){return function(e){var r;if(!le(e)||(r=vr(e)).type!==t)throw new Er("Incompatible receiver, "+t+" required");return r}}},Ar=N(function(t){var e=pr.CONFIGURABLE,r=Or.enforce,n=Or.get,i=String,o=Object.defineProperty,a=Kt("".slice),s=Kt("".replace),u=Kt([].join),l=Ft&&!Bt(function(){return 8!==o(function(){},"length",{value:8}).length}),c=String(String).split("String"),f=t.exports=function(t,n,f){"Symbol("===a(i(n),0,7)&&(n="["+s(i(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),f&&f.getter&&(n="get "+n),f&&f.setter&&(n="set "+n),(!Re(t,"name")||e&&t.name!==n)&&(Ft?o(t,"name",{value:n,configurable:!0}):t.name=n),l&&f&&Re(f,"arity")&&t.length!==f.arity&&o(t,"length",{value:f.arity});try{f&&Re(f,"constructor")&&f.constructor?Ft&&o(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var h=r(t);return Re(h,"source")||(h.source=u(c,"string"==typeof n?n:"")),t};Function.prototype.toString=f(function(){return ue(this)&&n(this).source||mr(this)},"toString")}),Pr=function(t,e,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:e;if(ue(r)&&Ar(r,o,n),n.global)i?t[e]=r:Pe(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=r:ur.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},Mr=Math.ceil,Ir=Math.floor,Lr=Math.trunc||function(t){var e=+t;return(e>0?Ir:Mr)(e)},jr=function(t){var e=+t;return e!=e||0===e?0:Lr(e)},Nr=Math.max,Rr=Math.min,Dr=function(t,e){var r=jr(t);return r<0?Nr(r+e,0):Rr(r,e)},Br=Math.min,Fr=function(t){var e=jr(t);return e>0?Br(e,9007199254740991):0},zr=function(t){return Fr(t.length)},Gr=function(t){return function(e,r,n){var i=ae(e),o=zr(i);if(0===o)return!t&&-1;var a,s=Dr(n,o);if(t&&r!=r){for(;o>s;)if((a=i[s++])!=a)return!0}else for(;o>s;s++)if((t||s in i)&&i[s]===r)return t||s||0;return!t&&-1}},Ur={includes:Gr(!0),indexOf:Gr(!1)},Vr=Ur.indexOf,Hr=Kt([].push),Wr=function(t,e){var r,n=ae(t),i=0,o=[];for(r in n)!Re(Sr,r)&&Re(n,r)&&Hr(o,r);for(;e.length>i;)Re(n,r=e[i++])&&(~Vr(o,r)||Hr(o,r));return o},qr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yr=qr.concat("length","prototype"),Xr={f:Object.getOwnPropertyNames||function(t){return Wr(t,Yr)}},Zr={f:Object.getOwnPropertySymbols},Kr=Kt([].concat),Jr=ce("Reflect","ownKeys")||function(t){var e=Xr.f(ir(t)),r=Zr.f;return r?Kr(e,r(t)):e},Qr=function(t,e,r){for(var n=Jr(e),i=ur.f,o=tr.f,a=0;a9007199254740991)throw cn("Maximum allowed index exceeded");return t},hn=function(t,e,r){Ft?ur.f(t,e,qt(0,r)):t[e]=r},pn={};pn[He("toStringTag")]="z";var dn="[object z]"===String(pn),yn=He("toStringTag"),vn=Object,gn="Arguments"===$t(function(){return arguments}()),mn=dn?$t:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=vn(t),yn))?r:gn?$t(e):"Object"===(n=$t(e))&&ue(e.callee)?"Arguments":n},bn=function(){},xn=ce("Reflect","construct"),wn=/^\s*(?:class|function)\b/,_n=Kt(wn.exec),Sn=!wn.test(bn),En=function(t){if(!ue(t))return!1;try{return xn(bn,[],t),!0}catch(t){return!1}},kn=function(t){if(!ue(t))return!1;switch(mn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Sn||!!_n(wn,mr(t))}catch(t){return!0}};kn.sham=!0;var Tn=!xn||Bt(function(){var t;return En(En.call)||!En(Object)||!En(function(){t=!0})||t})?kn:En,Cn=He("species"),On=Array,An=function(t,e){return new(function(t){var e;return ln(t)&&(e=t.constructor,(Tn(e)&&(e===On||ln(e.prototype))||le(e)&&null===(e=e[Cn]))&&(e=void 0)),void 0===e?On:e}(t))(0===e?0:e)},Pn=He("species"),Mn=function(t){return ge>=51||!Bt(function(){var e=[];return(e.constructor={})[Pn]=function(){return{foo:1}},1!==e[t](Boolean).foo})},In=He("isConcatSpreadable"),Ln=function(t){if(!le(t))return!1;var e=t[In];return void 0!==e?!!e:ln(t)},jn=!(ge>=51||!Bt(function(){var t=[];return t[In]=!1,t.concat()[0]!==t}))||!Mn("concat");un({target:"Array",proto:!0,arity:1,forced:jn},{concat:function(t){var e,r,n,i,o,a=je(this),s=An(a,0),u=0;for(e=-1,n=arguments.length;ea;)ur.f(t,r=i[a++],n[r]);return t}},Bn=ce("document","documentElement"),Fn=_r("IE_PROTO"),zn=function(){},Gn=function(t){return"