@mapgis/webclient-leaflet-plugin 17.6.18 → 17.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,4 +102,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
102
102
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
103
103
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
104
104
  PERFORMANCE OF THIS SOFTWARE.
105
- ***************************************************************************** */var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function d(t,e){var i=t[0],n=t[1];return[i*Math.cos(e)-n*Math.sin(e),i*Math.sin(e)+n*Math.cos(e)]}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0;i<t.length;i++)if("number"!=typeof t[i])throw new Error("assertNumbers arguments["+i+"] is not a number. "+typeof t[i]+" == typeof "+t[i]);return!0}var y=Math.PI;function m(t,e,i){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var n=t.rX,r=t.rY,o=t.x,s=t.y;n=Math.abs(t.rX),r=Math.abs(t.rY);var a=d([(e-o)/2,(i-s)/2],-t.xRot/180*y),l=a[0],h=a[1],u=Math.pow(l,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(r,2);1<u&&(n*=Math.sqrt(u),r*=Math.sqrt(u)),t.rX=n,t.rY=r;var c=Math.pow(n,2)*Math.pow(h,2)+Math.pow(r,2)*Math.pow(l,2),p=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(r,2)-c)/c)),f=n*h/r*p,g=-r*l/n*p,m=d([f,g],t.xRot/180*y);t.cX=m[0]+(e+o)/2,t.cY=m[1]+(i+s)/2,t.phi1=Math.atan2((h-g)/r,(l-f)/n),t.phi2=Math.atan2((-h-g)/r,(-l-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*y),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*y),t.phi1*=180/y,t.phi2*=180/y}function _(t,e,i){g(t,e,i);var n=t*t+e*e-i*i;if(0>n)return[];if(0===n)return[[t*i/(t*t+e*e),e*i/(t*t+e*e)]];var r=Math.sqrt(n);return[[(t*i+e*r)/(t*t+e*e),(e*i-t*r)/(t*t+e*e)],[(t*i-e*r)/(t*t+e*e),(e*i+t*r)/(t*t+e*e)]]}var v,x=Math.PI/180;function b(t,e,i){return(1-i)*t+i*e}function w(t,e,i,n){return t+Math.cos(n/180*y)*e+Math.sin(n/180*y)*i}function S(t,e,i,n){var r=e-t,o=i-e,s=3*r+3*(n-i)-6*o,a=6*(o-r),l=3*r;return Math.abs(s)<1e-6?[-l/a]:function(t,e,i){void 0===i&&(i=1e-6);var n=t*t/4-l/s;if(n<-i)return[];if(n<=i)return[-t/2];var r=Math.sqrt(n);return[-t/2-r,-t/2+r]}(a/s,0,1e-6)}function E(t,e,i,n,r){var o=1-r;return t*(o*o*o)+e*(3*o*o*r)+i*(3*o*r*r)+n*(r*r*r)}!function(t){function e(){return r(function(t,e,i){return t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=i),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=i),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=i),t.relative=!1),t})}function i(){var t=NaN,e=NaN,i=NaN,n=NaN;return r(function(r,o,s){return r.type&O.SMOOTH_CURVE_TO&&(r.type=O.CURVE_TO,t=isNaN(t)?o:t,e=isNaN(e)?s:e,r.x1=r.relative?o-t:2*o-t,r.y1=r.relative?s-e:2*s-e),r.type&O.CURVE_TO?(t=r.relative?o+r.x2:r.x2,e=r.relative?s+r.y2:r.y2):(t=NaN,e=NaN),r.type&O.SMOOTH_QUAD_TO&&(r.type=O.QUAD_TO,i=isNaN(i)?o:i,n=isNaN(n)?s:n,r.x1=r.relative?o-i:2*o-i,r.y1=r.relative?s-n:2*s-n),r.type&O.QUAD_TO?(i=r.relative?o+r.x1:r.x1,n=r.relative?s+r.y1:r.y1):(i=NaN,n=NaN),r})}function n(){var t=NaN,e=NaN;return r(function(i,n,r){if(i.type&O.SMOOTH_QUAD_TO&&(i.type=O.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?r:e,i.x1=i.relative?n-t:2*n-t,i.y1=i.relative?r-e:2*r-e),i.type&O.QUAD_TO){t=i.relative?n+i.x1:i.x1,e=i.relative?r+i.y1:i.y1;var o=i.x1,s=i.y1;i.type=O.CURVE_TO,i.x1=((i.relative?0:n)+2*o)/3,i.y1=((i.relative?0:r)+2*s)/3,i.x2=(i.x+2*o)/3,i.y2=(i.y+2*s)/3}else t=NaN,e=NaN;return i})}function r(t){var e=0,i=0,n=NaN,r=NaN;return function(o){if(isNaN(n)&&!(o.type&O.MOVE_TO))throw new Error("path must start with moveto");var s=t(o,e,i,n,r);return o.type&O.CLOSE_PATH&&(e=n,i=r),void 0!==o.x&&(e=o.relative?e+o.x:o.x),void 0!==o.y&&(i=o.relative?i+o.y:o.y),o.type&O.MOVE_TO&&(n=e,r=i),s}}function o(t,e,i,n,o,s){return g(t,e,i,n,o,s),r(function(r,a,l,h){var u=r.x1,c=r.x2,p=r.relative&&!isNaN(h),f=void 0!==r.x?r.x:p?0:a,d=void 0!==r.y?r.y:p?0:l;function g(t){return t*t}r.type&O.HORIZ_LINE_TO&&0!==e&&(r.type=O.LINE_TO,r.y=r.relative?0:l),r.type&O.VERT_LINE_TO&&0!==i&&(r.type=O.LINE_TO,r.x=r.relative?0:a),void 0!==r.x&&(r.x=r.x*t+d*i+(p?0:o)),void 0!==r.y&&(r.y=f*e+r.y*n+(p?0:s)),void 0!==r.x1&&(r.x1=r.x1*t+r.y1*i+(p?0:o)),void 0!==r.y1&&(r.y1=u*e+r.y1*n+(p?0:s)),void 0!==r.x2&&(r.x2=r.x2*t+r.y2*i+(p?0:o)),void 0!==r.y2&&(r.y2=c*e+r.y2*n+(p?0:s));var y=t*n-e*i;if(void 0!==r.xRot&&(1!==t||0!==e||0!==i||1!==n))if(0===y)delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag,r.type=O.LINE_TO;else{var m=r.xRot*Math.PI/180,_=Math.sin(m),v=Math.cos(m),x=1/g(r.rX),b=1/g(r.rY),w=g(v)*x+g(_)*b,S=2*_*v*(x-b),E=g(_)*x+g(v)*b,L=w*n*n-S*e*n+E*e*e,C=S*(t*n+e*i)-2*(w*i*n+E*t*e),P=w*i*i-S*t*i+E*t*t,I=(Math.atan2(C,L-P)+Math.PI)%Math.PI/2,M=Math.sin(I),T=Math.cos(I);r.rX=Math.abs(y)/Math.sqrt(L*g(T)+C*M*T+P*g(M)),r.rY=Math.abs(y)/Math.sqrt(L*g(M)-C*M*T+P*g(T)),r.xRot=180*I/Math.PI}return void 0!==r.sweepFlag&&0>y&&(r.sweepFlag=+!r.sweepFlag),r})}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),g(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return r(function(t,e,i){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=i),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=i),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=i),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),r(function(n,r,o,s,a){if(isNaN(s)&&!(n.type&O.MOVE_TO))throw new Error("path must start with moveto");return e&&n.type&O.HORIZ_LINE_TO&&(n.type=O.LINE_TO,n.y=n.relative?0:o),i&&n.type&O.VERT_LINE_TO&&(n.type=O.LINE_TO,n.x=n.relative?0:r),t&&n.type&O.CLOSE_PATH&&(n.type=O.LINE_TO,n.x=n.relative?s-r:s,n.y=n.relative?a-o:a),n.type&O.ARC&&(0===n.rX||0===n.rY)&&(n.type=O.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n})},t.NORMALIZE_ST=i,t.QT_TO_C=n,t.INFO=r,t.SANITIZE=function(t){void 0===t&&(t=0),g(t);var e=NaN,i=NaN,n=NaN,o=NaN;return r(function(r,s,a,l,h){var u=Math.abs,c=!1,p=0,f=0;if(r.type&O.SMOOTH_CURVE_TO&&(p=isNaN(e)?0:s-e,f=isNaN(i)?0:a-i),r.type&(O.CURVE_TO|O.SMOOTH_CURVE_TO)?(e=r.relative?s+r.x2:r.x2,i=r.relative?a+r.y2:r.y2):(e=NaN,i=NaN),r.type&O.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,o=isNaN(o)?a:2*a-o):r.type&O.QUAD_TO?(n=r.relative?s+r.x1:r.x1,o=r.relative?a+r.y1:r.y2):(n=NaN,o=NaN),r.type&O.LINE_COMMANDS||r.type&O.ARC&&(0===r.rX||0===r.rY||!r.lArcFlag)||r.type&O.CURVE_TO||r.type&O.SMOOTH_CURVE_TO||r.type&O.QUAD_TO||r.type&O.SMOOTH_QUAD_TO){var d=void 0===r.x?0:r.relative?r.x:r.x-s,g=void 0===r.y?0:r.relative?r.y:r.y-a;p=isNaN(n)?void 0===r.x1?p:r.relative?r.x:r.x1-s:n-s,f=isNaN(o)?void 0===r.y1?f:r.relative?r.y:r.y1-a:o-a;var y=void 0===r.x2?0:r.relative?r.x:r.x2-s,m=void 0===r.y2?0:r.relative?r.y:r.y2-a;u(d)<=t&&u(g)<=t&&u(p)<=t&&u(f)<=t&&u(y)<=t&&u(m)<=t&&(c=!0)}return r.type&O.CLOSE_PATH&&u(s-l)<=t&&u(a-h)<=t&&(c=!0),c?[]:r})},t.MATRIX=o,t.ROTATE=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),g(t,e,i);var n=Math.sin(t),r=Math.cos(t);return o(r,n,-n,r,e-e*r+i*n,i-e*n-i*r)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),g(t,e),o(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),g(t,e),o(t,0,0,e,0,0)},t.SKEW_X=function(t){return g(t),o(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return g(t),o(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(1,0,0,-1,0,t)},t.A_TO_C=function(){return r(function(t,e,i){return O.ARC===t.type?function(t,e,i){var n,r,o,s;t.cX||m(t,e,i);for(var a=Math.min(t.phi1,t.phi2),l=Math.max(t.phi1,t.phi2)-a,h=Math.ceil(l/90),u=new Array(h),c=e,p=i,f=0;f<h;f++){var g=b(t.phi1,t.phi2,f/h),y=b(t.phi1,t.phi2,(f+1)/h),_=y-g,v=4/3*Math.tan(_*x/4),w=[Math.cos(g*x)-v*Math.sin(g*x),Math.sin(g*x)+v*Math.cos(g*x)],S=w[0],E=w[1],L=[Math.cos(y*x),Math.sin(y*x)],C=L[0],P=L[1],I=[C+v*Math.sin(y*x),P-v*Math.cos(y*x)],M=I[0],T=I[1];u[f]={relative:t.relative,type:O.CURVE_TO};var N=function(e,i){var n=d([e*t.rX,i*t.rY],t.xRot),r=n[0],o=n[1];return[t.cX+r,t.cY+o]};n=N(S,E),u[f].x1=n[0],u[f].y1=n[1],r=N(M,T),u[f].x2=r[0],u[f].y2=r[1],o=N(C,P),u[f].x=o[0],u[f].y=o[1],t.relative&&(u[f].x1-=c,u[f].y1-=p,u[f].x2-=c,u[f].y2-=p,u[f].x-=c,u[f].y-=p),c=(s=[u[f].x,u[f].y])[0],p=s[1]}return u}(t,t.relative?0:e,t.relative?0:i):t})},t.ANNOTATE_ARCS=function(){return r(function(t,e,i){return t.relative&&(e=0,i=0),O.ARC===t.type&&m(t,e,i),t})},t.CLONE=function(){return function(t){var e={};for(var i in t)e[i]=t[i];return e}},t.CALCULATE_BOUNDS=function(){var t=e(),o=n(),s=i(),a=r(function(e,i,n){var r=s(o(t(function(t){var e={};for(var i in t)e[i]=t[i];return e}(e))));function l(t){t>a.maxX&&(a.maxX=t),t<a.minX&&(a.minX=t)}function h(t){t>a.maxY&&(a.maxY=t),t<a.minY&&(a.minY=t)}if(r.type&O.DRAWING_COMMANDS&&(l(i),h(n)),r.type&O.HORIZ_LINE_TO&&l(r.x),r.type&O.VERT_LINE_TO&&h(r.y),r.type&O.LINE_TO&&(l(r.x),h(r.y)),r.type&O.CURVE_TO){l(r.x),h(r.y);for(var u=0,c=S(i,r.x1,r.x2,r.x);u<c.length;u++)0<(A=c[u])&&1>A&&l(E(i,r.x1,r.x2,r.x,A));for(var p=0,f=S(n,r.y1,r.y2,r.y);p<f.length;p++)0<(A=f[p])&&1>A&&h(E(n,r.y1,r.y2,r.y,A))}if(r.type&O.ARC){l(r.x),h(r.y),m(r,i,n);for(var d=r.xRot/180*Math.PI,g=Math.cos(d)*r.rX,y=Math.sin(d)*r.rX,v=-Math.sin(d)*r.rY,x=Math.cos(d)*r.rY,b=r.phi1<r.phi2?[r.phi1,r.phi2]:-180>r.phi2?[r.phi2+360,r.phi1+360]:[r.phi2,r.phi1],L=b[0],C=b[1],P=function(t){var e=t[0],i=t[1],n=180*Math.atan2(i,e)/Math.PI;return n<L?n+360:n},I=0,M=_(v,-g,0).map(P);I<M.length;I++)(A=M[I])>L&&A<C&&l(w(r.cX,g,v,A));for(var T=0,N=_(x,-y,0).map(P);T<N.length;T++){var A;(A=N[T])>L&&A<C&&h(w(r.cY,y,x,A))}}return e});return a.minX=1/0,a.maxX=-1/0,a.minY=1/0,a.maxY=-1/0,a}}(v||(v={}));var C,P=function(){function t(){}return t.prototype.round=function(t){return this.transform(v.ROUND(t))},t.prototype.toAbs=function(){return this.transform(v.TO_ABS())},t.prototype.toRel=function(){return this.transform(v.TO_REL())},t.prototype.normalizeHVZ=function(t,e,i){return this.transform(v.NORMALIZE_HVZ(t,e,i))},t.prototype.normalizeST=function(){return this.transform(v.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(v.QT_TO_C())},t.prototype.aToC=function(){return this.transform(v.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(v.SANITIZE(t))},t.prototype.translate=function(t,e){return this.transform(v.TRANSLATE(t,e))},t.prototype.scale=function(t,e){return this.transform(v.SCALE(t,e))},t.prototype.rotate=function(t,e,i){return this.transform(v.ROTATE(t,e,i))},t.prototype.matrix=function(t,e,i,n,r,o){return this.transform(v.MATRIX(t,e,i,n,r,o))},t.prototype.skewX=function(t){return this.transform(v.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(v.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(v.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(v.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(v.ANNOTATE_ARCS())},t}(),I=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},M=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},T=function(t){function e(){var e=t.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return f(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,e){var i=this;void 0===e&&(e=[]);for(var n=function(t){e.push(t),i.curArgs.length=0,i.canParseCommandOrComma=!0},r=0;r<t.length;r++){var o=t[r],s=!(this.curCommandType!==O.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),a=M(o)&&("0"===this.curNumber&&"0"===o||s);if(!M(o)||a)if("e"!==o&&"E"!==o)if("-"!==o&&"+"!==o||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==o||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+r);if(this.curCommandType===O.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>l)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+r+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+r+'"');this.curArgs.push(l),this.curArgs.length===N[this.curCommandType]&&(O.HORIZ_LINE_TO===this.curCommandType?n({type:O.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):O.VERT_LINE_TO===this.curCommandType?n({type:O.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===O.MOVE_TO||this.curCommandType===O.LINE_TO||this.curCommandType===O.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),O.MOVE_TO===this.curCommandType&&(this.curCommandType=O.LINE_TO)):this.curCommandType===O.CURVE_TO?n({type:O.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===O.SMOOTH_CURVE_TO?n({type:O.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.QUAD_TO?n({type:O.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.ARC&&n({type:O.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!I(o))if(","===o&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==o&&"-"!==o&&"."!==o)if(a)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+r+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==o&&"Z"!==o)if("h"===o||"H"===o)this.curCommandType=O.HORIZ_LINE_TO,this.curCommandRelative="h"===o;else if("v"===o||"V"===o)this.curCommandType=O.VERT_LINE_TO,this.curCommandRelative="v"===o;else if("m"===o||"M"===o)this.curCommandType=O.MOVE_TO,this.curCommandRelative="m"===o;else if("l"===o||"L"===o)this.curCommandType=O.LINE_TO,this.curCommandRelative="l"===o;else if("c"===o||"C"===o)this.curCommandType=O.CURVE_TO,this.curCommandRelative="c"===o;else if("s"===o||"S"===o)this.curCommandType=O.SMOOTH_CURVE_TO,this.curCommandRelative="s"===o;else if("q"===o||"Q"===o)this.curCommandType=O.QUAD_TO,this.curCommandRelative="q"===o;else if("t"===o||"T"===o)this.curCommandType=O.SMOOTH_QUAD_TO,this.curCommandRelative="t"===o;else{if("a"!==o&&"A"!==o)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+".");this.curCommandType=O.ARC,this.curCommandRelative="a"===o}else e.push({type:O.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal="."===o}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,i){void 0===i&&(i=[]);for(var n=0,r=Object.getPrototypeOf(this).parse.call(this,e);n<r.length;n++){var o=r[n],s=t(o);Array.isArray(s)?i.push.apply(i,s):i.push(s)}return i}}})},e}(P),O=function(t){function e(i){var n=t.call(this)||this;return n.commands="string"==typeof i?e.parse(i):i,n}return f(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=v.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var e=[],i=0,n=this.commands;i<n.length;i++){var r=t(n[i]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return this.commands=e,this},e.encode=function(t){return function(t){var e="";Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.type===O.CLOSE_PATH)e+="z";else if(n.type===O.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===O.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===O.MOVE_TO)e+=(n.relative?"m":"M")+n.x+" "+n.y;else if(n.type===O.LINE_TO)e+=(n.relative?"l":"L")+n.x+" "+n.y;else if(n.type===O.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+" "+n.y1+" "+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+" "+n.y1+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+" "+n.y;else{if(n.type!==O.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+i+".");e+=(n.relative?"a":"A")+n.rX+" "+n.rY+" "+n.xRot+" "+ +n.lArcFlag+" "+ +n.sweepFlag+" "+n.x+" "+n.y}}return e}(t)},e.parse=function(t){var e=new T,i=[];return e.parse(t,i),e.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(P),N=((C={})[O.MOVE_TO]=2,C[O.LINE_TO]=2,C[O.HORIZ_LINE_TO]=1,C[O.VERT_LINE_TO]=1,C[O.CLOSE_PATH]=0,C[O.QUAD_TO]=4,C[O.SMOOTH_QUAD_TO]=2,C[O.CURVE_TO]=6,C[O.SMOOTH_CURVE_TO]=4,C[O.ARC]=7,C);const A=r.extend({},r.SVG.prototype);r.SVG.include({_updateStyle(t){const e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?("string"==typeof i.fill&&i.fill.match(/^url\(/)?this._fillPattern(t):e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updateShape:function(t){const e=t._point;let i=t.options.radius;const n=t.options.shape,r=t.options.rotation,o=t.options.xoffset,s=t.options.yoffset,a=t.options.path,l=e.x+o,h=e.y+s;if(t._path.setAttribute("transform",`rotate(${r},${l},${h})`),a){const e=new O(a).toAbs();let n=0,r=0,o=0,s=0;e.commands.forEach(t=>{const{x:e,y:i}=t;n=Math.min(e,n),r=Math.min(i,r),o=Math.max(e,o),s=Math.max(i,s)});const u=2*i/(o>s?o:s);return e.scale(u,u).translate(l-i,h-i),void this._setPath(t,e.encode())}if("arrow"===n){const e=`M${l-.85*i} ${h+.75*i} L${l} ${h} L${l+.85*i} ${h+.75*i} L${l} ${h-i} L${l-.85*i} ${h+.75*i}Z`;this._setPath(t,e)}if("diamond"===n){const e=`M${l-Math.sqrt(2)*i} ${h} L ${l} ${h-Math.sqrt(2)*i} L${l+Math.sqrt(2)*i} ${h} L${l} ${h+Math.sqrt(2)*i} L${l-Math.sqrt(2)*i} ${h}`;this._setPath(t,e)}if("square"===n){const e=`M${l-i} ${h-i} L ${l+i} ${h-i} L${l+i} ${h+i} L${l-i} ${h+i} L${l-i} ${h-i}`;this._setPath(t,e)}if("triangle"===n||"triangle-up"===n){const e=`M${l-1.3*i} ${h+.75*i} L${l} ${h-1.5*i} L${l+1.3*i} ${h+.75*i} Z`;this._setPath(t,e)}if("triangle-down"===n){const e=`M${l-1.3*i} ${h-.75*i} L${l} ${h+1.5*i} L${l+1.3*i} ${h-.75*i} Z`;this._setPath(t,e)}if("arrowhead"===n||"arrowhead-up"===n){const e=`M ${l+1.3*i} ${h+1.3*i} L ${l} ${h-1.3*i} L ${l-1.3*i} ${h+1.3*i} L ${l} ${h+.5*i} L ${l+1.3*i} ${h+1.3*i} Z`;this._setPath(t,e)}if("arrowhead-down"===n){const e=`M ${l-1.3*i} ${h-1.3*i} L ${l} ${h+1.3*i} L ${l+1.3*i} ${h-1.3*i} L ${l} ${h-.5*i} L ${l-1.3*i} ${h-1.3*i} Z`;this._setPath(t,e)}if("circle"===n){const e=`a${i},${i} 0 1,0 `,n=t._empty()?"M0 0":`M${l-i},${h}${e}${2*i},0 ${e}${2*-i},0 `;this._setPath(t,n)}if(n.startsWith("star")){const e=n.split(/[^0-9a-z]/gi,2),r=parseInt(e[1]);let o;o="star"===e[0]&&!isNaN(r)&&r>2?r:5;const s=.5*(1+Math.sqrt(5))+1,a=[];for(let t=0;t<o;t++)a.push(`${l+i/s*Math.sin(2*Math.PI/o*t)},${h+i/s*Math.cos(2*Math.PI/o*t)}`),a.push(`${l+i*Math.sin(1/o*Math.PI+2*Math.PI/o*t)},${h+i*Math.cos(1/o*Math.PI+2*Math.PI/o*t)}`);const u=`M${a.join("L")}Z`;this._setPath(t,u)}if("x"===n){const e=`M${l+(i/=2)},${h+i}L${l-i},${h-i}M${l-i},${h+i}L${l+i},${h-i}`;this._setPath(t,e)}if("cross"===n){const e=`M${l},${h+(i/=2)}L${l},${h-i}M${l+i},${h}L${l-i},${h}`;this._setPath(t,e)}},_fillPattern(t){const e=t._path,i=t.options,n=i.fillDetail;this._defs||(this._defs=r.SVG.create("defs"),this._container.appendChild(this._defs));const o=i.fill.substring(4,i.fill.length-1),s=o;let a;if(!Array.from(this._defs.children).some(t=>t.getAttribute("id")===s)){const t=new Image;t.src=o,(a=r.SVG.create("pattern")).setAttribute("id",s),a.setAttribute("patternUnits","userSpaceOnUse"),this._defs.appendChild(a);const e=r.SVG.create("image");e.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.appendChild(e),t.onload=function(){if(n){const{width:t=10,height:i=10,xoffset:r=0,yoffset:o=0,xscale:s=1,yscale:l=1}=n;a.setAttribute("x",r),a.setAttribute("y",o),e.setAttribute("x",r),e.setAttribute("y",o),a.setAttribute("width",t*s),a.setAttribute("height",i*l),e.style.transform=`scale(${s},${l})`,e.setAttribute("width",t),e.setAttribute("height",i)}else a.setAttribute("x","0"),a.setAttribute("y","0"),e.setAttribute("x","0"),e.setAttribute("y","0"),a.setAttribute("width",t.width),a.setAttribute("height",t.height),e.setAttribute("width",t.width),e.setAttribute("height",t.height)}}e.setAttribute("fill",`url(#${s})`)},_update(){A._update.call(this),this._map._rotate&&this.fire("update")}});const R=r.extend({},r.DivOverlay.prototype);r.DivOverlay.include({getEvents(){return r.extend(R.getEvents.call(this),{rotate:this._updatePosition})},_updatePosition(){if(!this._map)return;let t=this._map.latLngToLayerPoint(this._latlng),e=r.point(this.options.offset);const i=this._getAnchor();this._zoomAnimated?(this._map._rotate&&(t=this._map.rotatedPointToMapPanePoint(t)),r.DomUtil.setPosition(this._container,t.add(i))):e=e.add(t).add(i);const n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=`${n}px`,this._container.style.left=`${o}px`}});const k=r.extend({},r.Popup.prototype);r.Popup.include({_animateZoom(t){this._map._rotate||k._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);const i=this._getAnchor();e=this._map.rotatedPointToMapPanePoint(e),r.DomUtil.setPosition(this._container,e.add(i))},_adjustPan(){if(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)return;const t=this._map,e=parseInt(r.DomUtil.getStyle(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new r.Point(this._containerLeft,-i-this._containerBottom);o._add(r.DomUtil.getPosition(this._container));const s=o._add(this._map._getMapPanePos()),a=r.point(this.options.autoPanPadding),l=r.point(this.options.autoPanPaddingTopLeft||a),h=r.point(this.options.autoPanPaddingBottomRight||a),u=t.getSize();let c=0,p=0;s.x+n+h.x>u.x&&(c=s.x+n-u.x+h.x),s.x-c-l.x<0&&(c=s.x-l.x),s.y+i+h.y>u.y&&(p=s.y+i-u.y+h.y),s.y-p-l.y<0&&(p=s.y-l.y),(c||p)&&t.fire("autopanstart").panBy([c,p])}});const D=r.extend({},r.Tooltip.prototype);function z(t){return"undefined"===t?[]:Array.isArray(t)?t:[t]}r.Tooltip.include({_updatePosition(){if(!this._map._rotate)return D._updatePosition.call(this);let t=this._map.latLngToLayerPoint(this._latlng);t=this._map.rotatedPointToMapPanePoint(t),this._setPosition(t)},_animateZoom(t){if(!this._map._rotate)return D._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);e=this._map.rotatedPointToMapPanePoint(e),this._setPosition(e)}});const V=r.Control.extend({options:{region:.5,mode:"horizontal"},initialize(t,e,i){this.setLeadingLayers(t),this.setTrailingLayers(e),r.setOptions(this,i)},includes:r.Evented.prototype||r.Mixin.Events,_clearSwipeLayers(t){this._forEachLayers(t,t=>{if(t.getContainer){const e=t.getContainer();e&&(e.style.clip="")}})},_updateClip(){if(!this._map||!this._enabled)return this;let t=this._map,e=t.containerPointToLayerPoint([0,0]),i=t.containerPointToLayerPoint(t.getSize()),n="",r="";if("vertical"===this.options.mode){const o=this.options.region*t.getSize().y,s=e.y+o;this.fire("dividermove",{y:o}),n=[e.y,i.x,s,e.x],r=[s,i.x,i.y,e.x]}else if("horizontal"===this.options.mode){const o=this.options.region*t.getSize().x,s=e.x+o;this.fire("dividermove",{x:o}),n=[e.y,s,i.y,e.x],r=[e.y,i.x,i.y,s]}this._forEachLayers(this._leadingLayers,t=>{if(t.getContainer){const e=t.getContainer();e&&(e.style.clip=this._getTransformClip(n,e))}}),this._forEachLayers(this._trailingLayers,t=>{if(t.getContainer){const e=t.getContainer();e&&(e.style.clip=this._getTransformClip(r,e))}})},_getTransformClip(t,e){const i=t.map(t=>t);if(e.style.transform){const t=function(t){const e=t.match(/matrix\((.+)\)/);if(e&&e[1])return e[1].split(",").map(Number).slice(-2);return[0,0]}(window.getComputedStyle(e).transform),n=t[0],r=t[1];i[0]-=r,i[1]-=n,i[2]-=r,i[3]-=n}return`rect(${i.join("px,")}px)`},_forEachLayers(t,e){Array.isArray(t)&&t.forEach(t=>{e(t)})},_addEvents(){let t=this._map;t&&(t.on("move",this._updateClip,this),t.on("layeradd layerremove",this._updateClip,this))},_removeEvents(){let t=this._map;t&&(t.off("layeradd layerremove",this._updateClip,this),t.off("move",this._updateClip,this))}});V.prototype.addTo=function(t){return this.remove(),this._map=t,this._enabled=!0,this._updateClip(),this._addEvents(),this},V.prototype.remove=function(){return this._map?(this._clearSwipeLayers(this._leadingLayers),this._clearSwipeLayers(this._trailingLayers),this._removeEvents(),this._map=null,this):this},V.prototype.setRegion=function(t){this.options.region=t,this._updateClip()},V.prototype.setMode=function(t){this.options.mode=t,this._updateClip()},V.prototype.enable=function(t){this._enabled=t,t?this._updateClip():(this._clearSwipeLayers(this._leadingLayers),this._clearSwipeLayers(this._trailingLayers))},V.prototype.setLeadingLayers=function(t){return this._clearSwipeLayers(this._leadingLayers),this._leadingLayers=z(t),this._updateClip(),this},V.prototype.setTrailingLayers=function(t){return this._clearSwipeLayers(this._trailingLayers),this._trailingLayers=z(t),this._updateClip(),this},r.Control.Swipe=V,r.control.swipe=function(t,e,i){return new r.Control.Swipe(t,e,i)};var F=V;const B=1e-6;var j=i(2);class G{static convertColorToRgb(t){return t instanceof n.Color?t.toCssRGBAString():n.Color.fromColor(t).toCssRGBAString()}static convertLngLatGeometry(t){return t&&t.spatialReference?t.spatialReference.isGeographic?t:n.Projection.project(t,new n.SpatialReference("EPSG:4326")):t}static convertClippingArea(t){if(!t)return t;let e=null;switch(t.type){case n.GeometryType.polygon:case n.GeometryType.multiPolygon:e=G.convertLngLatGeometry(t).toGeoJSON();break;case n.GeometryType.circle:e=G.convertLngLatGeometry(t).toPolygon().toGeoJSON();break;case n.GeometryType.extent:e=G.convertLngLatGeometry(t).toPolygon().toGeoJSON();break}return e}static convertClippAreaToPx(t,e){let i=G.getCRSMinZoom(t);const n=[];for(let o=0;o<e.length;o++){const s=[];for(let n=0;n<e[o].length;n++){const a=t.latLngToPoint(r.latLng(e[o][n][1],e[o][n][0]),i);s.push([a.x,a.y])}n.push(s)}return n}static getCRSMinZoom(t){let e=0;const i=Object.keys(t._scales||{});return 0!==i.length&&(e=parseInt(i[0])),e}static toTurfGeometry(t,e){let i=[];return"Polygon"===t.type?i.push(t.coordinates):i=t.coordinates,i.map(t=>{const i=G.convertClippAreaToPx(e,t);return j.polygon(i)})}static getClippingState(t,e){if(j.booleanContains(t,e))return{in:!0,geometry:null};if(j.booleanContains(e,t))return{intersect:!0,geometry:t};if(!j.booleanOverlap(t,e))return{out:!0,geometry:null};const i=j.intersect(t,e);return i?{intersect:!0,geometry:i}:{out:!0,geometry:null}}static convertLineDash(t,e){switch(t){case"dash":return e?[4,3]:[3,4];case"dash-dot":return e?[4,3,1,3]:[3,4,0,4];case"dot":return e?[1,3]:[0,4];case"long-dash":return e?[8,3]:[7,4];case"long-dash-dot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":return e?[4,1]:[3,2];case"short-dash-dot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":return e?[1,1]:[0,2];case"solid":case"none":default:return}}static calcLineMarkerDetail(t){(!t||Array.isArray(t)&&t.length<=1)&&n.Log.error("计算线样式首尾marker错误,传入几何数组不合法");const e=t[0],i=t[1],o=t[t.length-2],s=t[t.length-1],a=360-((180*Math.atan2(i[1]-e[1],i[0]-e[0])/Math.PI+180)%360-90),l=360-((180*Math.atan2(o[1]-s[1],o[0]-s[0])/Math.PI+180)%360-90),h=n.Projection.project(new n.Point({coordinates:e}),new n.SpatialReference("EPSG:4326")).coordinates,u=n.Projection.project(new n.Point({coordinates:s}),new n.SpatialReference("EPSG:4326")).coordinates;return{latlng1:r.latLng(h[1],h[0]),latlng2:r.latLng(u[1],u[0]),angle1:a,angle2:l}}static getTextWidth(t,e){const i=document.createElement("canvas").getContext("2d");return i.font=e,i.measureText(t).width}static getAreaCenter(t){let e;switch(t.type){case n.GeometryType.point:e=t;break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:case n.GeometryType.multiLineString:case n.GeometryType.multiPolygon:e=t.extent.center;break;case n.GeometryType.polygon:e=t.centroid;break;case n.GeometryType.extent:case n.GeometryType.circle:e=t.center;break;default:e=t.extent.center}const i=G.convertLngLatGeometry(e).coordinates;return r.latLng(i[1],i[0])}static setVisibleOpacity(t,e,i){t&&(t.layerOpacity=e,t.layerVisible=i,G.setGraphicVisibleOpacity(t,e,i))}static setGraphicVisibleOpacity(t,e,i){t.setStyle&&t.setStyle({opacity:i?e:0,fillOpacity:i?e:0}),t instanceof r.Marker&&t.setOpacity(i?e:0),t.eachLayer&&t.eachLayer(function(t){G.setGraphicVisibleOpacity(t,e,i)}),t._nonPointGroup&&G.setGraphicVisibleOpacity(t._nonPointGroup,e,i),t._featureGroup&&G.setGraphicVisibleOpacity(t._featureGroup,e,i)}static insertBefore(t,e){const i=t.parentNode;i&&e!==t&&i.insertBefore(t,e)}static getLeafletGroupLayers(t,e,i){if(i=i||(()=>!0),t instanceof r.LayerGroup)for(const n in t._layers){const r=t._layers[n];G.getLeafletGroupLayers(r,e,i)}else i(t)&&e.push(t)}static getInterceptorsUrl(t){const e=this._map.options.config;if(!e||!e.request||!e.request.interceptors)return t;let i=Object(n.ServiceConfigRequestInterceptors)(e,t),r=`${Object(n.ServiceConfigToken)(e)}`;return!this.options||Object(n.isNull)(this.options.tokenKey)||Object(n.isNull)(this.options.tokenValue)||(r=""),!i||!r||t instanceof Object||(i.includes("?")?i+=`&${r}`:i+=`?${r}`),i}static pointToGeoCoord(t,e,i){const n=t.scale(i);return t.transformation.untransform(e,n)}}var U=G;const q=r.extend({},r.Map.prototype);r.Map.mergeOptions({rotate:!1,bearing:0}),r.Map.include({initialize(t,e){if(e.rotate&&(this._rotate=!0,this._bearing=0),e=r.Util.setOptions(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r.Util.bind(this._onResize,this),this._initEvents(),this.options&&this.options.maxBounds){const t=this.options.zoomSnap;this.options.zoomSnap=B;const e=this.getBoundsZoom(this.options.maxBounds);this.options.zoomSnap=t,this.options.minZoom=e}e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(r.latLng(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=r.DomUtil.TRANSITION&&r.Browser.any3d&&!r.Browser.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),r.DomEvent.on(this._proxy,r.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)),this._addLayers(this.options.layers),this.options.rotate&&this.setBearing(this.options.bearing)},containerPointToLayerPoint(t){return this._rotate?r.point(t).subtract(this._getMapPanePos()).rotateFrom(-this._bearing,this._getRotatePanePos()).subtract(this._getRotatePanePos()):q.containerPointToLayerPoint.call(this,t)},getBounds(){if(!this._rotate)return q.getBounds.call(this);const t=this.getSize(),e=this.layerPointToLatLng(this.containerPointToLayerPoint([0,0])),i=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,0])),n=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,t.y])),o=this.layerPointToLatLng(this.containerPointToLayerPoint([0,t.y]));return new r.LatLngBounds([e,i,n,o])},_getBoundsCenterZoom(t,e){e=e||{},t=t.getBounds?t.getBounds():r.latLngBounds(t);const i=this.toPoint(e.paddingTopLeft||e.padding||[0,0]),n=this.toPoint(e.paddingBottomRight||e.padding||[0,0]);let o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};const s=n.subtract(i).divideBy(2),a=this.project(t.getNorthWest(),o),l=this.project(t.getSouthEast(),o);return{center:this.unproject(l.add(a).divideBy(2).add(s),o),zoom:o}},getGeoBoundsCoord(){const t=this.getPixelBounds(),e=this._zoom,i=U.pointToGeoCoord(this.options.crs,this.toPoint(t.getTopLeft()),e),n=U.pointToGeoCoord(this.options.crs,this.toPoint(t.getBottomRight()),e);return{xmin:i.x,ymin:n.y,xmax:n.x,ymax:i.y}},layerPointToGeo(t){const e=this.toPoint(t).add(this.getPixelOrigin()),i=this._zoom;return U.pointToGeoCoord(this.options.crs,this.toPoint(e),i)},layerPointToContainerPoint(t){return this._rotate?r.point(t).add(this._getRotatePanePos()).rotateFrom(this._bearing,this._getRotatePanePos()).add(this._getMapPanePos()):q.layerPointToContainerPoint.call(this,t)},setBearing(t){if(!r.Browser.any3d||!this._rotate)return;let e=this._getRotatePanePos();const i=this.getSize().divideBy(2),n=this._getMapPanePos();this._pivot=n.clone().multiplyBy(-1).add(i),e=e.rotateFrom(-this._bearing,this._pivot),this._bearing=t*r.DomUtil.DEG_TO_RAD,this._rotatePanePos=e.rotateFrom(this._bearing,this._pivot),r.DomUtil.setPositionBearing(this._rotatePane,e,this._bearing,this._pivot),this.fire("rotate")},getBearing(){return this._bearing*r.DomUtil.RAD_TO_DEG},_initPanes(){const t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),r.DomUtil.setPosition(this._mapPane,new r.Point(0,0)),this._rotate?(this._rotatePane=this.createPane("rotatePane",this._mapPane),this._norotatePane=this.createPane("norotatePane",this._mapPane),this.createPane("tilePane",this._rotatePane),this.createPane("overlayPane",this._rotatePane),this.createPane("shadowPane",this._norotatePane),this.createPane("markerPane",this._norotatePane),this.createPane("tooltipPane",this._norotatePane),this.createPane("popupPane",this._norotatePane)):(this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane")),this.options.markerZoomAnimation||(r.DomUtil.addClass(t.markerPane,"leaflet-zoom-hide"),r.DomUtil.addClass(t.shadowPane,"leaflet-zoom-hide"))},rotatedPointToMapPanePoint(t){return r.point(t).rotate(this._bearing)._add(this._getRotatePanePos())},mapPanePointToRotatedPoint(t){return r.point(t)._subtract(this._getRotatePanePos()).rotate(-this._bearing)},_getCenterOffset(t){let e=q._getCenterOffset.call(this,t);return this._rotate&&(e=e.rotate(this._bearing)),e},_getRotatePanePos(){return this._rotatePanePos||new r.Point(0,0)},_getNewPixelOrigin(t,e){const i=this.getSize()._divideBy(2);return this._rotate||q._getNewPixelOrigin.call(this,t,e),this.project(t,e).rotate(this._bearing)._subtract(i)._add(this._getMapPanePos())._add(this._getRotatePanePos()).rotate(-this._bearing)._round()},_handleGeolocationResponse(t){const e=t.coords.latitude,i=t.coords.longitude,n=t.coords.heading,o=new r.LatLng(e,i),s=o.toBounds(t.coords.accuracy),a=this._locateOptions;if(a.setView){const t=this.getBoundsZoom(s);this.setView(o,a.maxZoom?Math.min(t,a.maxZoom):t)}const l={latlng:o,bounds:s,timestamp:t.timestamp,heading:n};for(const e in t.coords)"number"==typeof t.coords[e]&&(l[e]=t.coords[e]);this.fire("locationfound",l)},toPoint:(t,e,i)=>t instanceof r.Point?t:Array.isArray(t)?new r.Point(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new r.Point(t.x,t.y):new r.Point(t,e,i),panBy(t,e){if(t=this.toPoint(t).round(),e=e||{},t.x||t.y){if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new r.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){r.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");const i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this}}});class H{}H.addIGSTileLayer=function(t){const{layer:e,innerView:i}=t;let n=H.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new wt(e.url,n).addTo(i);return o.id=e.id,o},H.initializeOptions=function(t){const e=ut(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);let o={tileSize:t.tileSize,bounds:e,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:U.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:pt(t),minZoom:i,maxZoom:r,headers:t.headers,decryptOptions:t.decryptOptions};return o=Object(n.deleteNullValue)(o)};var Z=H;class X{}X.addIGSMapImageLayer=function(t){const{layer:e,innerView:i,view:r}=t,o=X.initializeOptions(e);!e.spatialReference.equals(r.spatialReference)&&(o.projectionSrs=Object(n.getProjectionSrs)(r.spatialReference)),o.visible=t._getLayerViewVisible(),o.opacity=t._getOpacity(),o.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const s=new Lt(e.url,o).addTo(i);return s.id=e.id,s},X.initializeOptions=function(t){return gt(t)},X.updateIGSMapImageLayer=function(t){const{innerLayer:e,layer:i}=t,n=gt(i);n.visible=t._getLayerViewVisible(),r.Util.setOptions(e,n)};var Y=X;class W{}W.addWMSLayer=function(t){const{layer:e,innerView:i,view:n}=t;let r=W.initializeOptions(e);r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity(),r.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const{extensionOptions:o={}}=e;if(r=Object.assign(r,o),n){!e.spatialReference.equals(n.spatialReference)&&(r.srs=n.spatialReference,r.crs=n.spatialReference)}const s=new Tt(e.url,r).addTo(i);return s.id=e.id,s},W.initializeOptions=function(t){const e=ut(t);let i={layers:t.layers,format:t.imageFormat,version:t.version,visible:t.visible,opacity:t.opacity,noWrap:!0,tileSize:t.imageWidth,transparent:t.imageTransparency,bounds:e,clippingArea:U.convertClippingArea(t.clippingArea),isReverseBBOX:t.isReverseXY,tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers,srs:t.spatialReference,crs:t.spatialReference,renderMode:t.renderMode};return i=Object(n.deleteNullValue)(i)};var $=W;class K{}K.addWMTSLayer=function(t){const{layer:e,innerView:i}=t;let n=K.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new Ot(e.url,n).addTo(i);return o.id=e.id,o},K.initializeOptions=function(t){const e=ut(t),{activeLayer:i}=t,r=t.getCurrentTileInfo(),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(r);let a={tileMatrixSet:i.tileMatrixSetId,layer:i.identifier,tileSize:r.size[0],bounds:e,style:i.styleId,clippingArea:U.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:pt(t),minZoom:o,maxZoom:s,tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers};return a=Object(n.deleteNullValue)(a)};var Q=K;class J{}J.addArcGISMapImageLayer=function(t){const{layer:e,innerView:i,view:n}=t;let r=J.initializeOptions(e);!e.spatialReference.equals(n.spatialReference)&&(r.spatialReference=n.spatialReference),r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity();const{extensionOptions:o={}}=e;(r=Object.assign(r,o)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const s=new It(e.url,r).addTo(i);return s.id=e.id,s},J.initializeOptions=function(t){const e=ut(t);let i={layers:t.layers,id:t.id,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,transparent:t.imageTransparency,bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,httpMethod:t.httpMethod,renderMode:t.renderMode,headers:t.headers,mapServer:new n.ArcGISMapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers})};return i=Object(n.deleteNullValue)(i)};var tt=J;class et{}et.addWebTileLayer=function(t){const{layer:e,innerView:i}=t;let r=et.initializeOptions(e);r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity(),r.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const{extensionOptions:o={}}=e;r=Object.assign(r,o);const s=new Nt(Object(n.formatWebTileUrl)(e.url),r).addTo(i);return s.id=e.id,s},et.initializeOptions=function(t){const e=ut(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);let o={tileSize:t.tileSize,bounds:e,visible:t.visible,opacity:t.opacity,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:U.convertClippingArea(t.clippingArea),crsOptions:pt(t),tms:"tms"===t.tileSliceType,subdomains:t.subDomains,minZoom:i,maxZoom:r,headers:t.headers};return o=Object(n.deleteNullValue)(o)};var it=et;var nt=class{static addVectorTileLayer(t){const{layer:e,innerView:i}=t;let n=this.initializeOptions(e);const{extensionOptions:r={}}=e;n=Object.assign(n,r);const o=t._getOpacity(),s=t._getLayerViewVisible();this.updateStyleLayer(null,n.style.layers,{opacity:o,visible:s}),t.innerLayer=new Rt(n).addTo(i),t.innerLayer.commonLayerId=e.id}static initializeOptions(t){let e,i;t.style.layers.forEach(t=>{const{minzoom:n,maxzoom:r}=t;void 0===e&&(e=n),void 0===i&&(i=r),e=Math.min(n,e),i=Math.max(r,i)});const r=n.UrlUtil.getBaseUrlAndParams(t.url);let o={style:JSON.parse(JSON.stringify(t.style)),noWrap:!0,clippingArea:U.convertClippingArea(t.clippingArea),tileSize:t.tileInfo.getTileSize(),crsOptions:pt(t),minZoom:e,maxZoom:i,tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers,queryParameters:r.params,decryptOptions:t.decryptOptions};return o=Object(n.deleteNullValue)(o)}static setVisible(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(t=>{r.setLayoutProperty(t.id,"visibility",i?"visible":"none")}),e._update&&e._update(!0)}static setOpacity(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(e=>{const n=t._getBackupProperties(e.id,"opacities");n&&Object.keys(n).forEach(t=>{r.setPaintProperty(e.id,t,n[t]*i)})}),e._update&&e._update(!0)}static removeLayer(t){const{innerView:e,innerLayer:i}=t;e.removeLayer(i)}static setClippingArea(t,e){const{innerLayer:i}=t;i.setClippingArea(U.convertClippingArea(e))}static setPaintProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setPaintProperty(e,t,i[t])}),t._update&&t._update(!0)}static setLayoutProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setLayoutProperty(e,t,i[t])}),t._update&&t._update(!0)}static updateStyleLayer(t,e,i){const{opacity:n=1,visible:r=!0}=i;e.forEach(e=>{e.paint&&Object.keys(e.paint).forEach(i=>{/opacity$/.test(i)&&(e.paint[i]*=n),t&&t.style.getLayer(e.id)&&t.style.setPaintProperty(e.id,i,e.paint[i])}),e.layout&&Object.keys(e.layout).forEach(i=>{/visibility$/.test(i)&&(e.layout[i]=r&&"visible"===e.layout[i]?"visible":"none"),t&&t.style.getLayer(e.id)&&t.style.setLayoutProperty(e.id,i,e.layout[i])})}),t&&t._update&&t._update(!0)}};class rt{}rt.addArcGISTileLayer=function(t){const{layer:e,innerView:i}=t;let n=rt.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new At(e.url,n).addTo(i);return o.id=e.id,o},rt.initializeOptions=function(t){const e=ut(t);let i={tileSize:t.tileSize,bounds:e,opacity:t.opacity,visible:t.visible,crsOptions:pt(t),tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers};return i=Object(n.deleteNullValue)(i)};var ot=rt;class st{}st.addIGSImageryLayer=function(t){const{layer:e,innerView:i,view:n}=t,r=st.initializeOptions(e);!e.spatialReference.equals(n.spatialReference)&&(r.imageSR=n.spatialReference),r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity(),r.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new Xt(e.url,r).addTo(i);return o.id=e.id,o},st.initializeOptions=function(t){const e=ut(t);let i={id:t.id,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.format,opacity:t.opacity,visible:t.visible,bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,httpMethod:t.httpMethod,clippingArea:U.convertClippingArea(t.clippingArea),imageServer:new n.ImageServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers}),renderMode:t.renderMode,interpolation:t.interpolation,renderingRule:t.rasterFunction,bandIds:t.bandIds};const{extensionOptions:r={}}=t;return i=Object.assign(i,r)},st.updateIGSImageLayer=function(t){const{innerLayer:e,layer:i}=t,n=st.initializeOptions(i);n.visible=t._getLayerViewVisible(),r.Util.setOptions(e,n)};var at=st;class lt{}lt.addIGSImageryTileLayer=function(t){const{layer:e,innerView:i}=t;let n=lt.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new qt(e.url,n).addTo(i);return o.id=e.id,o},lt.initializeOptions=function(t){const e=ut(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);return{tileSize:t.tileInfo.getTileSize(),bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:U.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:pt(t),minZoom:i,maxZoom:r}};var ht=lt;function ut(t){let e=void 0;const i=Object(n.limitExtentToSRSMaxExtent)(t.extent),o=i.spatialReference.isGeographic?i:n.Projection.project(i,new n.SpatialReference({wkid:4326})),s=r.latLng(o.ymin,o.xmin),a=r.latLng(o.ymax,o.xmax);return e=r.latLngBounds(s,a)}function ct(t){const e=t.getBounds(),i=e.getNorthWest(),n=e.getSouthEast(),o=e.getSouthWest(),s=e.getNorthEast(),a=t.latLngToLayerPoint(i),l=t.latLngToLayerPoint(n),h=t.latLngToLayerPoint(o),u=t.latLngToLayerPoint(s),c=r.bounds(a,l);c.extend(h),c.extend(u);const p=t.getSize(),f=t.containerPointToLayerPoint([0,0]),d=t.containerPointToLayerPoint([p.x,p.y]),g=r.bounds(f,d);return c.extend(g.getBottomLeft()),c.extend(g.getTopRight()),c}function pt(t){t&&t.spatialReference||n.Log.error("计算crsOptions错误");let e=t.tileInfo;t.type===n.LayerType.WMTS&&(e=t.getCurrentTileInfo());const i=t.spatialReference,r=e.origin.coordinates,o=t.extent,s=e.lods.map(t=>t.clone());return{wkid:i.wkid,wkt:i.wkt,lods:s,origin:r,unit:i.isGeographic?"degree":void 0,extent:{xmin:o.xmin,ymin:o.ymin,xmax:o.xmax,ymax:o.ymax}}}function ft(t,e){e=Object(n.defaultValue)(e,[t]);const i=Object(n.getValidLayers)(t,e),r=Object(n.getLayersExtent)(i,t.spatialReference),o=Object(n.getCrsOptions)(t,i,{fullExtent:r});return new l({wkid:o.spatialReference.wkid,wkt:o.spatialReference.wkt,lods:o.lods,origin:o.origin,extent:o.extent})}function dt(t){switch(t.type){case n.LayerType.IGSTile:return Z.initializeOptions(t);case n.LayerType.IGSMapImage:return Y.initializeOptions(t);case n.LayerType.WMS:return $.initializeOptions(t);case n.LayerType.WMTS:return Q.initializeOptions(t);case n.LayerType.ArcGISMapImage:return tt.initializeOptions(t);case n.LayerType.ArcGISTile:return ot.initializeOptions(t);case n.LayerType.webTile:return it.initializeOptions(t);case n.LayerType.IGSVectorTile:case n.LayerType.ArcGISVectorTile:return nt.initializeOptions(t);case n.LayerType.IGSImage:return at.initializeOptions(t);case n.LayerType.IGSImageTile:return ht.initializeOptions(t);default:n.Log.error(`暂不支持为${t.type}类型的图层构造实例化参数`)}}function gt(t){const e=t.imageWidth||256,i=Math.max(t.extent.xmax-t.extent.xmin,t.extent.ymax-t.extent.ymin)/e,o=function(t,e){let i=void 0;const o=Object(n.getExtendExtentByPixel)(t,{extendPixel:100,resolution:e,outSpatialReference:new n.SpatialReference({wkid:4326})}),s=r.latLng(o.ymin,o.xmin),a=r.latLng(o.ymax,o.xmax);return i=r.latLngBounds(s,a)}(t.extent,i);let s={layers:t.layers,id:t.id,clientId:t.clientId,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,imageTransparent:t.imageTransparency,bounds:o,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,httpMethod:t.httpMethod,clippingArea:U.convertClippingArea(t.clippingArea),mapServer:new n.MapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers}),isAntialiasing:t.isAntialiasing,renderMode:t.renderMode,headers:t.headers};const{extensionOptions:a={}}=t;s=Object.assign(s,a),s=Object(n.deleteNullValue)(s);const l=Object(n.getIGSDynamicLayer)(t);l.length>0?s.dynamicLayers=JSON.stringify(l):s.dynamicLayers=null;const h=t.getFilters();return h&&(s.layerFilters=JSON.stringify(h)),t.isSupportHiRender&&(s.hiRender=!t.disableHiRender&&void 0),s}function yt(t){if(t){let e;const i=t.def;return t.code&&(e=t.code.indexOf(":")>-1?t.code.split(":")[1]:t.code),new n.SpatialReference({wkid:e,wkt:i})}return null}const mt=r.ImageOverlay.extend({options:{clippingArea:null,bboxBounds:null,pixBoundsSize:null,container:null},_initImage(){const t="IMG"===this._url.tagName,e=t?this._url:r.DomUtil.create("img"),i=this._map.project(this._bounds.getNorthWest()),o=this.options.pixBoundsSize,s=this._map.getZoomScale(this._map.getZoom(),U.getCRSMinZoom(this._map.options.crs)),a=document.createElement("canvas");a.width=o.x,a.height=o.y;const l=a.getContext("2d");this._image=a,r.DomUtil.addClass(a,"leaflet-image-layer"),this._zoomAnimated&&r.DomUtil.addClass(a,"leaflet-zoom-animated"),this.options.className&&r.DomUtil.addClass(a,this.options.className),a.onselectstart=r.Util.falseFn,a.onmousemove=r.Util.falseFn;let h=[];this.options.clippingArea&&(h=this._getTileGeometryAndState());e.onload=(()=>{a.complete=!0,setTimeout(()=>{const t=l.createPattern(e,"repeat");((t,e)=>{if(!Array.isArray(e)||0===e.length||e.some(t=>t.in))return!0;if(e.every(t=>t.out))return!1;const n=e.filter(t=>t.geometry).map(t=>t.geometry);return n.length>0?(t.beginPath(),n.forEach(e=>{const n=j.coordAll(e);let r=n[0][0]*s-i.x,o=n[0][1]*s-i.y;t.moveTo(r,o);for(let e=1;e<n.length;e++)r=n[e][0]*s-i.x,o=n[e][1]*s-i.y,t.lineTo(r,o)}),t.clip(),!0):void 0})(l,h)&&(l.beginPath(),l.rect(0,0,a.width,a.height),l.fillStyle=t,l.fill()),this.fire("load")},0)}),e.onerror=(()=>{this._overlayOnError("error")}),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(fetch(this._url,{headers:this.options.headers}).then(t=>t.blob()).then(t=>{e.src=window.URL.createObjectURL(t)}).catch(t=>{n.Log.error(t)}),e.alt=this.options.alt)},getPane(){return this.options.container?this.options.container:r.ImageOverlay.prototype.getPane.call(this)},_toTurfGeometry(t){const e=this._map.options.crs;return U.toTurfGeometry(t,e)},_getClippingAreaPx(){return this._clippingAreaPx?this._clippingAreaPx:(this.options.clippingArea?this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea):this._clippingAreaPx=null,this._clippingAreaPx)},_getTileGeometryAndState(){if(!this.options.clippingArea)return null;const t=this._getClippingAreaPx(),e=this._map.getGeoBoundsCoord(),i=this._map.options.crs,n=i.scale(U.getCRSMinZoom(i)),o=i.transformation._transform(r.point(e.xmin,e.ymin),n),s=i.transformation._transform(r.point(e.xmax,e.ymax),n),a=o.x,l=s.y,h=s.x,u=o.y,c=j.polygon([[[a,l],[h,l],[h,u],[a,u],[a,l]]]);return t.map(t=>U.getClippingState(t,c))},_animateZoom(t){if(!this._map._rotate||0===this._map._bearing)return r.ImageOverlay.prototype._animateZoom.call(this,t)},_reset(){const t=this._image,e=this._calcLayerPointBounds(),i=e.getSize(),n=i.divideBy(2);r.DomUtil.setPosition(t,e.getCenter().subtract(n)),t.style.width=`${i.x}px`,t.style.height=`${i.y}px`},_calcLayerPointBounds(){const t=this._map.getCenter(),e=this._map.getZoom(),i=this.options.bboxBounds,n=this._map.options.crs,o=n.unproject(i.getTopLeft()),s=n.unproject(i.getBottomRight());return new r.Bounds(this._map._latLngToNewLayerPoint(o,e,t),this._map._latLngToNewLayerPoint(s,e,t))}});r.ImageOverlay.clip=function(t,e,i){return new r.ImageOverlay.Clip(t,e,i)};var _t=mt;var vt=r.Layer.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",noWrap:!0,clippingArea:null,pane:"tilePane",onDataUpdateAndRenderCompleted:null},initialize(t,e){t=n.LayerBaseUrlRegExp.matchString(t),this._initOptions(t,e)},onAdd(t){t.on("moveend",this.refresh,this),this._initUrlTemplate(),this._initContainer(),this._updateClippingArea(this.options.clippingArea),this.refresh()},getContainer(){return this._container},_initContainer(){this._container||(this._container=r.DomUtil.create("div",`leaflet-layer ${this.options.className||""}`),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},onRemove(){this._waitToUpdateImage&&this._map.removeLayer(this._waitToUpdateImage),this._currentImage&&this._map.removeLayer(this._currentImage),r.DomUtil.remove(this._container),this._map.off("moveend",this.refresh,this)},refresh(){if(!this._map)return;const t=this._map.getZoom();t>(this._map.options.maxZoom||18)||t<(this._map.options.minZoom||0)?this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null):this.server?(this._initUrlTemplate&&this._initUrlTemplate(),this._requestImage()):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)},setOpacity(t){this.options.opacity=t,this._updateOpacity()},_updateOpacity(){this._container&&r.DomUtil.setOpacity(this._container,this.options.opacity)},setVisible(t){if((t=!!t)!==this.options.visible)if(this.options.visible=t,this._currentImage){this._currentImage.getElement().style.display=this.options.visible?"inline":"none"}else this.refresh()},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_requestImage(){const t=this._map,e=this;if(!t||!this.options.visible)return;this._caculateBBOX();const i=this._map.getBounds(),n=n=>{if(!e._isValidateLayerStatus())return;const r=this._currentImage;n._bounds&&n._bounds.equals(i)&&n._bounds.equals(t.getBounds())?(n.getElement().style.display=this.options.visible?"inline":"none",this._currentImage=n,r&&t.removeLayer(r),this.fire("dataUpdateAndRenderCompleted",{}),this.options.onDataUpdateAndRenderCompleted&&this.options.onDataUpdateAndRenderCompleted()):t.removeLayer(n),this._waitToUpdateImage=null},r=i=>{e._isValidateLayerStatus()&&t.removeLayer(i)},o=(new Date).getTime();this.buildRequestImageSrc().then(i=>{if(!e._isValidateLayerStatus())return;let s=i;if(this.options&&"GET"===this.options.httpMethod&&(s=U.getInterceptorsUrl.call(this,s)),this._currentImage&&this._currentImage.timeStamp>o)return;const a=this._createImage(s,n,r);a.addTo(t),a.timeStamp=o,this._waitToUpdateImage=a})},_createImage(t,e,i){const n=this._map.getBounds(),r=new _t(t,n,{alt:this.options.alt,zIndex:this.options.zIndex,className:this.options.className,errorOverlayUrl:this.options.error,crossOrigin:this.options.crossOrigin,pane:this.options.pane||this.getPane(),interactive:this.options.interactive,clippingArea:this.options.clippingArea,bboxBounds:this.bboxBounds,pixBoundsSize:this.pixBoundsSize,container:this._container,headers:this.options.headers,timeStamp:(new Date).getTime()});return r.once("load",()=>{e(r)},self),r.once("error",()=>{i(r)},self),r},_caculateBBOX(){const t=this._map,e=t.getZoom(),i=t.options.crs,o=ct(t).getSize().round();this.imageHeight=o.y||512,this.imageWidth=o.x||512;const s=t.project(t.getBounds().getNorthWest()),a=s.add(o),l=U.pointToGeoCoord(i,t.toPoint(s),e),h=U.pointToGeoCoord(i,t.toPoint(a),e);this.bbox=new n.Extent({xmin:l.x,xmax:h.x,ymin:h.y,ymax:l.y,spatialReference:yt(t.options.crs)}),this.bboxBounds=r.bounds(l,h),this.pixBoundsSize=o},setClippingArea(t){return this.options.clippingArea=t,this._updateClippingArea(t),this.refresh(),this},_updateClippingArea(t){const e=this._map;this._clippingPolygons=t&&e?U.toTurfGeometry(t,e.options.crs):null},buildRequestImageSrc:()=>new Promise(t=>{t()}),buildRequestParamsObject:()=>new Promise(()=>{}),_isValidateLayerStatus(){return this._map&&this._map._mapPane},_initOptions(t,e){r.setOptions(this,e),this.id=this.options.id,this.httpMethod=this.options.httpMethod,this.url=t;const i=n.UrlUtil.getBaseUrlAndParams(t);this._queryParameters=i.params,this._initServer(),r.stamp(this),this._currentImage=null,this._waitToUpdateImage=null,this.bboxBounds=null,this.pixBoundsSize=null},_initServer(){n.Log.error("未实现服务对象,无法出图!")},_initRequestParameters(){this.exportOptions={}},_updateExportOptions(){this.exportOptions[this.options.tokenKey]=this.options.tokenValue,this.exportOptions=Object.assign(this.extensionsParameters,this.exportOptions),this.exportOptions=Object(n.deleteNullValue)(this.exportOptions)},_initUrlTemplate(){}});var xt=r.TileLayer.extend({options:{clippingArea:null,crsOptions:null,noWrap:!0,customWKID:null,decryptOptions:null,onDataUpdateAndRenderCompleted:null},initialize(t,e){t=n.LayerBaseUrlRegExp.matchString(t),this._initOptions(t,e)},createTile(t,e){const i=this.getTileUrl(t);return this._drawClippingTile(i,t,e)},onAdd(t){this._initUrlTemplate(),this._TileClippingGeometryCache={},this._tileMonitor=new n.TileMonitor({onAllTilesComplete:()=>{this._tiles&&0!==Object.keys(this._tiles).length&&(this.fire("dataUpdateAndRenderCompleted",{}),this.options.onDataUpdateAndRenderCompleted&&this.options.onDataUpdateAndRenderCompleted())}}),this._map.on("movestart zoomstart",this._startTileMonitor,this),this._map.on("moveend zoomend",this._endTileMonitor,this),this.on("tileloadstart",this._addTileMetadata,this),this.on("tileunload tileerror tileload tilerendered",this._removeTileMetadata,this),this._startTileMonitor(),r.TileLayer.prototype.onAdd.call(this,t),this._endTileMonitor()},_startTileMonitor(){this._tileMonitor.clear(),this._tileMonitor.status="waiting"},_addTileMetadata(t){t.tile&&(t.tile.__key__=Object(n.getGUID)(),this._tileMonitor.addTileMetadata(t.tile.__key__,{tile:t.tile}))},_removeTileMetadata(t){if(t.tile){if(this._map&&this._map._fadeAnimated&&"tileload"===t.type)return;this._tileMonitor.removeTileMetadata(t.tile.__key__)}},_endTileMonitor(){this._tileMonitor.status="wait-end",this._tileMonitor.onTileComplete()},onRemove(t){this._map.off("movestart zoomstart",this._startTileMonitor,this),this._map.off("moveend zoomend",this._endTileMonitor,this),this.off("tileloadstart",this._addTileMetadata,this),this.off("tileunload tileerror tileload tilerendered",this._removeTileMetadata,this),r.TileLayer.prototype.onRemove.call(this,t)},setClippingArea(t){return this.options.clippingArea=t,this._clearClippingCache(),this._removeAllTiles(),this._resetView(),this},getClippingArea(){return this.options.clippingArea},_getTileGeometryAndState(t,e,i){if(!this.options.clippingArea)return null;const n=`${t},${e},${i}`;if(this._TileClippingGeometryCache[n])return this._TileClippingGeometryCache[n];const r=this.options.crs,o=this._getClippingAreaPx(),s=this.options.tileSize,a=U.getCRSMinZoom(r),l=r.scale(i)/r.scale(a),h=t*s/l,u=e*s/l,c=(t+1)*s/l,p=(e+1)*s/l,f=j.polygon([[[h,u],[c,u],[c,p],[h,p],[h,u]]]),d=o.map(t=>U.getClippingState(t,f));return d.some(t=>t.geometry)&&(this._TileClippingGeometryCache[n]=d),d},_toTurfGeometry(t){const e=this.options.crs||this._map.options.crs;return U.toTurfGeometry(t,e)},_getClippingAreaPx(){if(this._clippingAreaPx)return this._clippingAreaPx;if(this.options.clippingArea){if(this.options&&this.options.customWKID&&this.options.customWKID===n.CustomWKID.gcj02mc&&this.options.clippingArea&&this.options.clippingArea.coordinates){const t=[];this.options.clippingArea.coordinates.forEach(e=>{t.push(n.Projection.projectPoints({points:e,originWKID:4326,targetWKID:n.CustomWKID.gcj02ll}))}),this.options.clippingArea.coordinates=t}if(this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea),this.options&&this.options.customWKID&&this.options.customWKID===n.CustomWKID.bd09mc){let t=this._getBiasedParams(this._map.getCenter(),0,this._levels[this._tileZoom],this._tileZoom);t.centerPiexlOffset&&this._clippingAreaPx[0]&&this._clippingAreaPx[0].geometry&&this._clippingAreaPx[0].geometry.coordinates&&this._clippingAreaPx[0].geometry.coordinates.forEach(e=>{e.forEach(e=>{e[0]-=t.centerPiexlOffset.x,e[1]-=t.centerPiexlOffset.y})})}}else this._clippingAreaPx=null;return this._clippingAreaPx},_clearClippingCache(){this._clippingAreaPx=null,this._TileClippingGeometryCache={}},_drawClippingTile(t,e,i){const{x:n,y:r,z:o}=e,s=this._getTileGeometryAndState(n,r,o),a=document.createElement("img"),l=this.options.crs,h=U.getCRSMinZoom(l);if(!s||s.some(t=>t.in))return this._getTileImage(a,t,i);if(s.every(t=>t.out)){const t=document.createElement("canvas");return t.width=this.options.width,t.height=this.options.height,this._getTileImage(a,null,i)}const u=s.filter(t=>t.geometry).map(t=>t.geometry);if(u.length>0){this._getTileImage(a,t,i);const e=document.createElement("canvas");e.width=this.options.tileSize,e.height=this.options.tileSize;const s=e.getContext("2d"),c=this.options.tileSize,p=c*n,f=c*r,d=l.scale(o-this.options.zoomOffset)/l.scale(h);return a.onload=function(){e.complete=!0,setTimeout(()=>{const t=s.createPattern(a,"repeat");let n,r;s.beginPath(),u.forEach(t=>{const e=j.coordAll(t);n=e[0][0]*d-p,r=e[0][1]*d-f,s.moveTo(n,r);for(let t=1;t<e.length;t++)n=e[t][0]*d-p,r=e[t][1]*d-f,s.lineTo(n,r)}),s.clip(),s.beginPath(),s.rect(0,0,e.width,e.height),s.fillStyle=t,s.fill(),i()},0)},this.options.crossOrigin&&(a.crossOrigin=""),e}},_getTileImage(t,e,i){if(!e)return t;r.DomEvent.on(t,"load",r.Util.bind(this._tileOnLoad,this,i,t)),r.DomEvent.on(t,"error",r.Util.bind(this._tileOnError,this,i,t)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(t.referrerPolicy=this.options.referrerPolicy),t.alt="";let o=e;if(!/data:image\/jpg;base64/.test(e)){o=U.getInterceptorsUrl.call(this,e);const i=this._map.options.config;t.onload=function(){i&&i.request&&i.request.interceptors&&Object(n.ServiceConfigResponseInterceptors)(i,o,t)}}return this.httpMethod===n.FetchMethod.post?this._postImage(t,e).catch(e=>{t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC",this.fire("tileerror",{error:e,tile:t})}):fetch(e,{headers:this.options.headers}).then(t=>{const e=this.options.decryptOptions;return e?t.arrayBuffer().then(t=>{const i=Object(n.decryptIGS)(Object.assign({arrayBuffer:t},e));return new Blob([i])}):t.blob()}).then(e=>{t.src=window.URL.createObjectURL(e)}).catch(e=>{n.Log.error(e),this.fire("tileerror",{error:e,tile:t})}),t},_tileOnError(t,e,i){r.TileLayer.prototype._tileOnError.call(this,t,e,i),e instanceof Element&&(e.style.display="none")},_postImage:(t,e)=>Promise.resolve(""),_initOptions(t,e){e=Object(n.defaultValue)(e,{}),r.setOptions(this,e),this.url=t;const i=n.UrlUtil.getBaseUrlAndParams(t);this._queryParameters=i.params;let o={};if(e.crsOptions&&e.crsOptions.wkid&&[n.CustomWKID.gcj02mc,n.CustomWKID.bd09mc].indexOf(e.crsOptions.wkid)>-1){const t=Object.assign({},e.crsOptions,{wkid:3857});o.crsOptions=t,o.customWKID=e.crsOptions.wkid}this._clippingAreaPx=null,this.httpMethod=Object(n.defaultValue)(e.httpMethod,n.FetchMethod.get),r.TileLayer.prototype.initialize.call(this,t,Object.assign({},e,o)),r.GridLayer.prototype.initialize(arguments[1]),r.stamp(this)},_getBiasedParams(t,e,i,o){let s={biasedCenter:t};if(void 0!=t&&this.options){let a;if(this.options.customWKID==n.CustomWKID.gcj02mc)(a=n.Projection.projectPoints({points:[[t.lng,t.lat]],originWKID:4326,targetWKID:n.CustomWKID.gcj02ll}))&&a.length>0&&(s.biasedCenter=r.latLng(a[0][1],a[0][0]));else if(this.options.customWKID==n.CustomWKID.bd09mc){const r=this._map.options.crs,a=this.options.crs;let l=r.scale(e)/a.scale(o);i.origin.multiplyBy(l);const h=n.Projection.projectPoints({points:[[t.lng,t.lat]],originWKID:4326,targetWKID:n.CustomWKID.bd09mc}),u=n.Projection.projectPoints({points:[[t.lng,t.lat]],originWKID:4326,targetWKID:3857}),c={x:h[0][0]*a.scale(o)*l,y:h[0][1]*a.scale(o)*l},p={x:u[0][0]*a.scale(o)*l,y:u[0][1]*a.scale(o)*l},f={x:-(c.x-p.x),y:c.y-p.y};s.centerPiexlOffset=f;const d=this._map,g=this._toTileZoom(d._animatingZoom?Math.max(d._animateToZoom,d.getZoom()):d.getZoom()),y=this.getZoomScale(g,this._tileZoom);let m={x:(c.x-p.x)/y,y:-(c.y-p.y)/y};s.boundsPixelOffset=m}}return s},_getTiledPixelBounds(t){let e=this._getBiasedParams(t,this._map.getZoom(),this._levels[this._tileZoom],this._tileZoom);return r.GridLayer.prototype._getTiledPixelBounds.call(this,e.biasedCenter,e.boundsPixelOffset,e.centerPiexlOffset)},_setZoomTransform(t,e,i){let n=this._getBiasedParams(e,i,t,t.zoom);r.GridLayer.prototype._setZoomTransform.call(this,t,n.biasedCenter,i,n.centerPiexlOffset)},_initUrlTemplate(){},_getZoomForUrl(){const t=r.TileLayer.prototype._getZoomForUrl.call(this);return this._getLevelValue(t)},_updateOpacity(){if(!this._map)return;if(r.Browser.ielt9)return;r.DomUtil.setOpacity(this._container,this.options.opacity);let t=+new Date,e=!1,i=!1;for(let n in this._tiles){let o=this._tiles[n];if(!o.current||!o.loaded)continue;let s=Math.min(1,(t-o.loaded)/200);r.DomUtil.setOpacity(o.el,s),s<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0,this.fire("tilerendered",{tile:o.el,coords:o.coords}))}i&&!this._noPrune&&this._pruneTiles(),e&&(r.Util.cancelAnimFrame(this._fadeFrame),this._fadeFrame=r.Util.requestAnimFrame(this._updateOpacity,this))},refresh(){this._startTileMonitor(),this._initUrlTemplate&&this._initUrlTemplate();for(const t in this._tiles){const e=this._tiles[t];this._replaceTile(e,this._level.el)}this._endTileMonitor()},_replaceTile(t,e){const i=t.coords,n=t.el,o=this,s=this._getTilePos(i),a=this._tileCoordsToKey(i),l=this.createTile(this._wrapCoords(i),r.Util.bind(function(e,i,s){n&&n.startTimeStamp&&s.startTimeStamp<n.startTimeStamp||(r.DomUtil.remove(t.el),o._tileReady(e,i,s))},this,i));this._addTileMetadata({tile:l,coords:i}),l.startTimeStamp=(new Date).getTime(),this._initTile(l),this.createTile.length<2&&r.Util.requestAnimFrame(r.Util.bind(this._tileReady,this,i,null,l)),r.DomUtil.setPosition(l,s),this._tiles[a]={el:l,coords:i,current:!0},l.style.transition="opacity 0.5s ease-in-out",e.appendChild(l)}});var bt=xt.extend({getTileUrl(t){const e=this._tileCoordsToNwSe(t),i=r.bounds(this.options.crs.project(e[0]),this.options.crs.project(e[1])),n=(this.options.isReverseBBOX?[i.min.y,i.min.x,i.max.y,i.max.x]:[i.min.x,i.min.y,i.max.x,i.max.y]).join(",");return this._urlTemplate.replace("{bbox}",n)},_initUrlTemplate(){const t=n.ServerUtil.getImage(this.url,{version:this.options.version,layers:this.options.layers,styles:this.options.styles,width:this.options.width,height:this.options.height,format:this.options.format,transparent:this.options.transparent,srs:this.options.srs,crs:this.options.crs,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var wt=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",this._getZoomForUrl())},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var St=xt.extend({options:{projectionSrs:null,httpMethod:n.FetchMethod.get,imageWidth:256,imageHeight:256,imageFormat:"png",opacity:1,visible:!0,imageTransparent:!0,clippingArea:null,mapServer:null,tokenAttachType:!1,isAntialiasing:null,extensions:{},dynamicLayers:null,hiRender:null},getTileUrl(t){const e=this._map,i=this.getTileSize(),o=t.scaleBy(i),s=o.add(i),a=e.unproject(o,t.z),l=e.unproject(s,t.z),h=new r.LatLngBounds(a,l),u=this._map.options.crs.project(h.getNorthWest()),c=this._map.options.crs.project(h.getSouthEast()),p=`${u.x},${c.y},${c.x},${u.y}`;return"POST"===this.httpMethod?(this.requestStructure.commonQueryParameters.bbox=new n.Extent({xmin:u.x,ymin:c.y,xmax:c.x,ymax:u.y,spatialReference:yt(e.options.crs)}),this.requestStructure):this._urlTemplate.replace("{bbox}",p)},_postImage(t,e){return this.server.exportImage(e.commonQueryParameters).then(e=>{const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),e instanceof Blob&&i.readAsDataURL(e),i.onerror=(()=>{})})},_initUrlTemplate(){let t={clientId:this.options.clientId,layers:this.options.layers,transparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,size:`${this.options.imageWidth},${this.options.imageHeight}`,style:this.options.style,format:this.options.imageFormat,layerFilters:this.options.layerFilters,layerStyles:this.options.layerStyles,dynamicLayers:this.options.dynamicLayers,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,hiRender:this.options.hiRender};this.options.projectionSrs&&(t.projectionSrs=this.options.projectionSrs.toString()),t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e,this.server=Object(n.defaultValue)(this.options.mapServer,new n.MapServer({url:this.url}))}});var Et=vt.extend({options:{projectionSrs:null,httpMethod:n.FetchMethod.get,imageWidth:256,imageHeight:256,imageFormat:"png",opacity:1,visible:!0,imageTransparent:!0,dynamicLayers:null,clippingArea:null,mapServer:null,tokenAttachType:!1,isAntialiasing:null,extensions:{},hiRender:null},buildRequestImageSrc(){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else{let e=this._urlTemplate.replace("{bbox}",this.bbox.toString());e="1.0"===this.server.igsType?e.replace("w={w}",`w=${this.imageWidth}`).replace("h={h}",`h=${this.imageHeight}`):e.replace("size={size}",`size=${this.imageWidth},${this.imageHeight}`),t(e)}})},_initUrlTemplate(){const t={clientId:this.options.clientId,layers:this.options.layers,transparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,imageWidth:this.options.imageWidth,imageHeight:this.options.imageHeight,style:this.options.style,format:this.options.imageFormat,layerFilters:this.options.layerFilters,layerStyles:this.options.layerStyles,dynamicLayers:this.options.dynamicLayers,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,formatMode:"replace",hiRender:this.options.hiRender};this.options.projectionSrs&&(t.projectionSrs=this.options.projectionSrs.toString()),t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.mapServer,new n.MapServer({url:this.url}))}});var Lt=class{constructor(t,e){let i;return(e=Object(n.defaultValue)(e,{})).renderMode=Object(n.defaultValue)(e.renderMode,"tile"),i="tile"===e.renderMode?new St(t,e):new Et(t,e)}};var Ct=vt.extend({options:{opacity:1,visible:!0,imageFormat:"png",imageTransparent:!0,tokenAttachType:!1,httpMethod:n.FetchMethod.get,spatialReference:null},buildRequestImageSrc(){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else t(this._urlTemplate.replace("{bbox}",this.bbox.toString()).replace("size={size}",`size=${this.imageWidth},${this.imageHeight}`))})},_initUrlTemplate(){let t={layers:this.options.layers,format:this.options.imageFormat,transparent:this.options.imageTransparent,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,formatMode:"replace"};const e=n.ServerUtil.getImage(this.url,t);this.options.spatialReference&&(t.imageSR=this.options.spatialReference),this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.mapServer,new n.ArcGISMapServer({url:this.url}))}});var Pt=xt.extend({options:{imageWidth:256,imageHeight:256,spatialReference:null,opacity:1,visible:!0,imageFormat:"png",imageTransparent:!0,tokenAttachType:!1,httpMethod:n.FetchMethod.get},getTileUrl(t){const e=this._map,i=this.getTileSize(),o=t.scaleBy(i),s=o.add(i),a=e.unproject(o,t.z),l=e.unproject(s,t.z),h=new r.LatLngBounds(a,l),u=this._map.options.crs.project(h.getNorthWest()),c=this._map.options.crs.project(h.getSouthEast()),p=`${u.x},${c.y},${c.x},${u.y}`;return"POST"===this.httpMethod?(this.requestStructure.commonQueryParameters.bbox=new n.Extent({xmin:u.x,xmax:c.x,ymin:c.y,ymax:u.y,spatialReference:yt(e.options.crs)}),this.requestStructure):this._urlTemplate.replace("{bbox}",p)},_postImage(t){const e=this.requestStructure.commonQueryParameters;return e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(e){const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),e instanceof Blob&&i.readAsDataURL(e),i.onerror=(()=>{})})},_initUrlTemplate(){let t={layers:this.options.layers,format:this.options.imageFormat,transparent:this.options.imageTransparent,size:`${this.options.imageWidth},${this.options.imageWidth}`,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue};this.options.spatialReference&&(t.imageSR=this.options.spatialReference),t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e}});var It=class{constructor(t,e){let i;return i="tile"===e.renderMode?new Pt(t,e):new Ct(t,e)}};var Mt=vt.extend({buildRequestImageSrc(){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else t(this._urlTemplate.replace("{bbox}",this.bbox.toString()).replace("width=256&height=256",`width=${this.imageWidth}&height=${this.imageHeight}`))})},_initUrlTemplate(){const t={version:this.options.version,layers:this.options.layers,styles:this.options.styles,width:this.options.width,height:this.options.height,style:this.options.style,format:this.options.format,transparent:this.options.transparent,srs:this.options.srs,crs:this.options.crs,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters};this.options.projectionSrs&&(t.projectionSrs=this.options.projectionSrs.toString());const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.mapServer,new n.MapServer({url:this.url}))}});var Tt=class{constructor(t,e){let i;return i="image"===e.renderMode?new Mt(t,e):new bt(t,e)}};var Ot=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{z}",this._getZoomForUrl()).replace("{y}",t.y).replace("{x}",t.x)},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{version:this.options.version,style:this.options.style,tileMatrixSet:this.options.tileMatrixSet,format:this.options.format,layer:this.options.layer,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var Nt=xt.extend({options:{customWKID:null},getTileUrl(t){const e={r:r.Browser.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this.options.crs.infinite){const i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.row=i,e.y=i),e["-row"]=i}return r.Util.template(this._urlTemplate,r.Util.extend(e,this.options))},_initUrlTemplate(){this._urlTemplate=this.url;let t={};t[this.options.tokenKey]=this.options.tokenValue,t=Object.assign(t,this._queryParameters);const e=n.UrlUtil.getStringFromObject(t);e&&(this._urlTemplate=n.UrlUtil.completeUrlEndMark(this._urlTemplate),this._urlTemplate+=`${e}`),this._urlTemplate=Object(n.formatWebTileUrl)(this._urlTemplate)}});var At=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",this._getZoomForUrl())},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var Rt=class{constructor(t){let e;return t=Object(n.defaultValue)(t,{}),function(t,e){class i extends t.Projection{constructor(t,i){super();const n=(i||{}).def;if(!n)throw new Error("自定义参考系必须指定参数系信息def");if(this._def=n,!e)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");const r=this._isProj4Obj(t);this._proj=r?t:this._projFromCodeDef(t,n)}project(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat),this._proj.forward([e,i])}unproject(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y),this._proj.inverse([e,i])}_projFromCodeDef(t,i){if(i)e.defs(t,i);else if(void 0===e.defs[t]){const i=t.split(":");if(i.length>3&&(t=`${i[i.length-3]}:${i[i.length-1]}`),void 0===e.defs[t])throw`No projection definition for code ${t}`}return e(t)}_isProj4Obj(t){return void 0!==t.inverse&&void 0!==t.forward}}class n extends t.CRS{_parseParams(t){this._crsType="proj4",this.epsgCode=t[0],this.def=t[1];const e=t[2]||{};this._parseOptions(e)}_parseOptions(t){if(super._parseOptions(t),this._resolutions=t.resolutions,Array.isArray(this._resolutions)){const t={};this._resolutions.forEach((e,i)=>{t[i]=e}),this._resolutions=t}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=t.tileSize||256}_setProjection(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}t.Proj||(t.Proj={}),t.Proj.CRS=n,t.Proj.Projection=i}(e=i(4),n.proj4),function(t,e){t.mapboxgl&&t.MapboxGL||(t.MapboxGL=t.Layer.extend({options:{updateInterval:32,padding:0,interactive:!1,pane:"tilePane",clippingArea:null,zoomOffset:0,tileSize:256,zIndex:1,crsOptions:null,decryptOptions:null},initialize(i){t.setOptions(this,i),i.accessToken&&(e.accessToken=i.accessToken),this._throttledUpdate=t.Util.throttle(this._update,this.options.updateInterval,this)},onAdd(e){this._container||this._initContainer();const i=this.getPaneName();e.getPane(i).appendChild(this._container),this._updateZIndex(),this._initGL(),this._offset=this._map.getBounds().getNorthWest(),e.options.zoomAnimation&&t.DomEvent.on(e._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this),e._addZoomLimit(this)},onRemove(e){this._map._proxy&&this._map.options.zoomAnimation&&t.DomEvent.off(this._map._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this);const i=this.getPaneName();e.getPane(i).removeChild(this._container)},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},getEvents(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize,rotate:this._rotate}},setClippingArea(t){this.options.clippingArea=t;const e=this.getMapboxMap(),i=this.options.style.sources;i&&Object.entries(i).forEach(i=>{const n=i[0],r=e.getSource(n);r&&"vector"===r.type&&r.setClippingArea&&r.setClippingArea(t)})},getClippingArea(){return this.options.clippingArea},getMapboxMap(){return this._glMap},getCanvas(){return this._glMap.getCanvas()},getSize(){return this._map.getSize().multiplyBy(1+2*this.options.padding)},getBounds(){const e=this.getSize().multiplyBy(.5),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getCenter()));return t.latLngBounds(this._map.containerPointToLatLng(i.subtract(e)),this._map.containerPointToLatLng(i.add(e)))},getContainer(){return this._container},getPaneName(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},_initContainer(){const e=this._container=t.DomUtil.create("div","leaflet-gl-layer"),i=this.getSize();e.style.width=`${i.x}px`,e.style.height=`${i.y}px`,e.style.position="absolute";const n=this._calcRotateOffset();t.DomUtil.setPosition(e,n)},_initGL(){let i;const r=this._map.options.crs,o=this._map.getCenter(),s=this.options.crsOptions;if(s){const t=s.extent,n={},o={};s.lods.forEach(t=>{n[t.level]=t.resolution,o[t.level]=t.levelValue});const a=this.options.tileSize||256,l={levelValues:o,resolutions:n,origin:s.origin,tileSize:a,bounds:[t.xmin,t.ymin,t.xmax,t.ymax],unit:s.unit};i=e.Proj&&e.Proj.CRS?new e.Proj.CRS(r.code,r.def,l):new e.CRS(r.code,l)}else i=r.code;let a={};Object(n.defined)(this.options.tokenKey)&&Object(n.defined)(this.options.tokenValue)&&(a[this.options.tokenKey]=this.options.tokenValue);const l={data:a=Object.assign(this.options.queryParameters,a),headers:this.options.headers};this.options.tokenKey&&this.options.tokenValue&&(l.data[this.options.tokenKey]=this.options.tokenValue);const h=t.extend({},this.options,{container:this._container,center:[o.lng,o.lat],zoom:Math.max(0,this._map.getZoom()),attributionControl:!1,crs:i,minZoom:-2,renderWorldCopies:!1,requestParams:l});try{if(h.style){const t=h.style.sources;t&&Object.entries(t).forEach(t=>{"vector"===t[1].type&&(t[1].clippingArea=this.options.clippingArea,t[1].decryptOptions=this.options.decryptOptions)})}}catch(t){}this._glMap?(this._glMap.setCenter(h.center),this._glMap.setZoom(h.zoom)):this._glMap=new e.Map(h),this._glMap.transform.latRange=null,this._transformGL(this._glMap),this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas;const u=this._glMap._actualCanvas;t.DomUtil.addClass(u,"leaflet-image-layer"),t.DomUtil.addClass(u,"leaflet-zoom-animated"),this.options.interactive&&t.DomUtil.addClass(u,"leaflet-interactive"),this.options.className&&t.DomUtil.addClass(u,this.options.className)},_calcRotateOffset(){const t=this._map.getSize().multiplyBy(this.options.padding),e=this._map.getSize()._divideBy(2);return this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()).subtract(e).subtract(t)},_update(t){if(!this._map)return;if(this._offset=this._map.getBounds().getNorthWest(),this._zooming)return;const e=this._glMap,i=this.getSize(),n=this._container;this._transformGL(e);const r=Math.round(i.x),o=Math.round(i.y);Math.round(e.transform.width)!==r||Math.round(e.transform.height)!==o?(n.style.width=`${r}px`,n.style.height=`${o}px`,e.transform.width=r,e.transform.height=o,null!==e._resize&&void 0!==e._resize?e._resize():e.resize()):null!==e._update&&void 0!==e._update?e._update():e.update()},_transformGL(i){const n=this._clampCenter(this._map.getCenter()),r=i.transform;r.resetZoomScale=!1;const o=this._getZoom();r.zoom=o,r.center=e.LngLat.convert([n.lng,n.lat]);const s=r.center,a=[0,0];if(Math.abs(s.lng-n.lng)>1e-7||Math.abs(s.lat-n.lat)>1e-7){const t=r.coordinatePoint(r.locationCoordinate(s)),e=r.coordinatePoint(r.locationCoordinate(n));a[0]=t.x-e.x,a[1]=t.y-e.y}const l=this._container,h=this._calcRotateOffset().add(a);t.DomUtil.setPosition(l,h)},_clampCenter(e){if(!e)return e;const i=Math.min(Math.max(e.lng,-180),180),n=Math.min(Math.max(e.lat,-90),90);return t.latLng(n,i)},_pinchZoom(t){this._glMap.jumpTo({zoom:Math.max(0,this._getZoom()),center:this._clampCenter(this._map.getCenter())})},_animateZoom(e){const i=this._map.getZoomScale(e.zoom),n=this._map.getSize().multiplyBy(this.options.padding*i),r=this.getSize()._divideBy(2),o=this._map.project(this._clampCenter(e.center),e.zoom)._subtract(r)._add(this._map._getMapPanePos().add(n))._round(),s=this._map.project(this._clampCenter(this._map.getBounds().getNorthWest()),e.zoom)._subtract(o),a=this._map.latLngToLayerPoint(this._offset)._add(this._map._getRotatePanePos());t.DomUtil.setTransform(this._glMap._actualCanvas,s.subtract(a),i)},_zoomStart(t){this._zooming=!0,this._container&&this._map._rotate&&0!==this._map._bearing&&(this._container.style.visibility="hidden")},_zoomEnd(){const e=this._map.getZoomScale(this._map.getZoom());t.DomUtil.setTransform(this._glMap._actualCanvas,null,e),this._zooming=!1,this._update(),this._container&&(this._container.style.visibility="visible")},_transitionEnd(e){t.Util.requestAnimFrame(function(){const e=this._map.getCenter(),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getBounds().getNorthWest()));t.DomUtil.setTransform(this._glMap._actualCanvas,i,1),this._glMap.once("moveend",t.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:this._clampCenter(e),zoom:Math.max(0,this._getZoom())})},this)},_resize(t){this._transitionEnd(t)},_getZoom(){const t=this._map.getSize()._divideBy(2),e=this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()),i=e.subtract(t),n=e.add(t),r=this._map.layerPointToLatLng(i),o=this._map.layerPointToLatLng(n),s=[[Math.min(Math.max(o.lng,-180),180),Math.min(Math.max(r.lat,-90),90)],[Math.min(Math.max(r.lng,-180),180),Math.min(Math.max(o.lat,-90),90)]],a=this._map.getSize().multiplyBy(this.options.padding),l=this._glMap.cameraForBounds(s,{padding:{left:a.x,right:a.x,top:a.y,bottom:a.y}});return l?parseFloat(l.zoom.toFixed(10)):-2},_rotate(e){if(!this._map)return;const i=this._map.getSize(),n=this._map._bearing,r=t.point(i.x/2,i.y/2),o=t.point(0,0).rotateFrom(n,r),s=t.point(i.x,0).rotateFrom(n,r),a=t.point(i.x,i.y).rotateFrom(n,r),l=t.point(0,i.y).rotateFrom(n,r),h=t.bounds(o,l);h.extend(s),h.extend(a);const u=h.getSize(),c=(u.x-i.x)/i.x,p=(u.y-i.y)/i.y,f=Math.max(c,p)/2;this.options.padding=f,this._update()}}),t.mapboxGL=function(e){return new t.MapboxGL(e)})}(r,e),r.mapboxGL(t)}};var kt=class{constructor(){return new r.FeatureGroup}};const Dt=window.mapv||{},zt=Dt.baiduMapLayer?Dt.baiduMapLayer.__proto__:Function;var Vt=r.Layer.extend({initialize(t,e,i,n){this.map=t,this.dataset=e||{},this.mapvoption=i,n=n||{},this.render=this.render.bind(this),r.Util.setOptions(this,n),this._canvas=this._createCanvas(),r.stamp(this),this.innerMoveStartEvent=this.moveStartEvent.bind(this),this.innerMoveEndEvent=this.moveEndEvent.bind(this),this.innnerZoomstart=this.zoomStartEvent.bind(this),this.innerViewreset=this.viewresetEvent.bind(this),this.innerResize=this.resizeEvent.bind(this),this.innerRotate=this.rotateEvent.bind(this)},addData(t,e){this.mapvBaseLayer.addData(t,e)},updateData(t,e){this.mapvBaseLayer.updateData(t,e)},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},_createCanvas(){const t=document.createElement("canvas");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=this.options.zIndex||100;const e=this.map.getSize();t.width=e.x,t.height=e.y,t.style.width=`${e.x}px`,t.style.height=`${e.y}px`;const i=this.devicePixelRatio;return t.getContext("2d").scale(i,i),"2d"===this.mapvoption.context&&t.getContext("2d").scale(i,i),t},onAdd(t){const e=this.getPane("tilePane"),i=r.DomUtil.create("div","leaflet-layer",e);i.appendChild(this._canvas),this._container=i,this.mapvBaseLayer=new class extends zt{constructor(t,e,i,n){super(t,e,i),zt&&(this.map=t,this.dataSet=e,this.options=i,i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=n,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent())}clickEvent(t){const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}mousemoveEvent(t){if(!t)return;const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}addAnimatorEvent(){}animatorMovestartEvent(){const t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent),this.options.methods.mousemove&&t.on("mousemove",this.mousemoveEvent))}unbindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.removeListener("click",this.clickEvent),this.options.methods.mousemove&&t.removeListener("mousemove",this.mousemoveEvent))}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}getContext(){return this.canvasLayer.getCanvas().getContext(this.context)}_canvasUpdate(t){if(!this.canvasLayer||this.canvasLayer.disposeFlag)return;const e=this,i=this.map,n=e.options.animation,o=this.getContext();if(e.isEnabledTime()){if(void 0===t)return void this.clear(o);"2d"===this.context&&(o.save(),o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, .1)",o.fillRect(0,0,o.canvas.width,o.canvas.height),o.restore())}else this.clear(o);if("2d"===this.context)for(const t in e.options)o[t]=e.options[t];else o.clear(o.COLOR_BUFFER_BIT);if(e.options.minZoom&&i.getZoom()<e.options.minZoom||e.options.maxZoom&&i.getZoom()>e.options.maxZoom)return;const s=i.getBounds().getNorthWest(),a=i.latLngToLayerPoint(s),l={transferCoordinate(t){const n=i.latLngToLayerPoint(new r.LatLng(t[1],t[0]));return"heatmap"===e.options.draw&&(n.x/=e.devicePixelRatio,n.y/=e.devicePixelRatio),[n.x-a.x,n.y-a.y]}};void 0!==t&&(l.filter=function(e){const i=n.trails||10;return t&&e.time>t-i&&e.time<t});const h=e.dataSet.get(l);this.processData(h),"m"===e.options.unit&&e.options.size,e.options._size=e.options.size;const u=i.latLngToLayerPoint(r.latLng(0,0)),c={x:u.x-a.x,y:u.y-a.y};this.drawContext(o,new Dt.DataSet(h),e.options,c),e.options.updateCallback&&e.options.updateCallback instanceof Function&&e.options.updateCallback(t)}init(t){const e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&e.canvasLayer&&e.canvasLayer.setZIndex(e.options.zIndex),this.initAnimator()}updateData(t,e){let i=t;i&&i.get&&(i=i.get()),void 0!==i&&this.dataSet.set(i),super.update({options:e})}addData(t,e){let i=t;t&&t.get&&(i=t.get()),this.dataSet.add(i),this.update({options:e})}draw(){this.canvasLayer.draw()}clear(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}}(t,this.dataset,this.mapvoption,this),this.bindEvent(),this.options.tileLoader&&this._initTileLoader(),this._reset(),this.fire("loaded")},getContainer(){return this._container},bindEvent(){const t=this.map;t.on("movestart",this.innerMoveStartEvent),t.on("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.on("zoomstart",this.innnerZoomstart),t.on("viewreset",this.innerViewreset),t.on("resize ",this.innerResize),t.on("rotate",this.innerRotate),this.mapvBaseLayer.bindEvent()},unbindEvent(){const t=this.map;t.off("movestart",this.innerMoveStartEvent),t.off("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.off("zoomstart",this.innnerZoomstart),t.off("viewreset",this.innerViewreset),t.off("resize ",this.innerResize),t.off("rotate",this.innerRotate),this.removeAllData(),this.mapvBaseLayer.unbindEvent()},moveStartEvent(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()},moveEndEvent(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()},zoomStartEvent(){this._unvisiable()},viewresetEvent(){this._reset(),this._visiable()},resizeEvent(){this._reset(),this._visiable()},rotateEvent(){this._reset(),this._visiable()},_animateZoom(){this._animating||(this._animating=!0)},_endZoomAnim(){},getCanvas(){return this._canvas},getAttribution(){return this.options.attribution},draw(){return this._reset()},onRemove(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},setOpacity(t){this._canvas.style.opacity=t},setZIndex(t){this._canvas.style.zIndex=t},bringToFront(){return this},bringToBack(){return this},_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()},_visiable(){this.getCanvas().style.display="block"},_unvisiable(){this.getCanvas().style.display="none"},_render(){this.render()},fixPosition(){const t=this.map.getBounds().getNorthWest(),e=this.map.latLngToLayerPoint(t);t&&r.DomUtil.setPosition(this._canvas,{x:e.x,y:e.y})},resizeCanvas(){let t;t=this.map._rotate?ct(this.map).getSize():this.map.getSize();const e=this.getCanvas();e.width=t.x,e.height=t.y,e.style.width=`${t.x}px`,e.style.height=`${t.y}px`},redraw(t){this.resizeCanvas(),this.fixPosition(),this.render()},show(){this._visiable()},hide(){this._unvisiable()},destroy(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},update(t){void 0!==t&&this.mapvBaseLayer.updateData(t.data,t.options)},removeData(t){this.mapvBaseLayer&&this.mapvBaseLayer.removeData(t)},removeAllData(){},onResize(){},render(){this.mapvBaseLayer._canvasUpdate()}});const Ft=window.echarts;function Bt(t,e){this._LeafletMap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e}Bt.prototype.dimensions=["lng","lat"],Bt.prototype.setMapOffset=function(t){this._mapOffset=t},Bt.prototype.getBMap=function(){return this._LeafletMap},Bt.prototype.dataToPoint=function(t){null===t[1]&&(t[1]=89.99);const e=new r.latLng(t[1],t[0]),i=this._LeafletMap.latLngToLayerPoint(e),n=this._mapOffset;return[i.x-n[0],i.y-n[1]]},Bt.prototype.pointToData=function(t){const e=this._mapOffset,i=this._LeafletMap.layerPointToLatLng([t[0]+e[0],t[1]+e[1]]);return[i.lng,i.lat]},Bt.prototype.getViewRect=function(){const t=this._api;return new Ft.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},Bt.prototype.getRoamTransform=function(){return Ft.matrix.create()},Bt.prototype.prepareCustoms=function(){const t=Ft.util,e=this.getViewRect(),i=this;return{coordSys:{type:"leaflet",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.bind(this.dataToPoint,this),size:t.bind(function(e,n){return n=n||[0,0],t.map([0,1],function(t){const r=n[t],o=e[t]/2,s=[],a=[];return s[t]=r-o,a[t]=r+o,s[1-t]=n[1-t],a[1-t]=n[1-t],Math.abs(i.dataToPoint(s)[t]-i.dataToPoint(a)[t])},i)},this)}}},Bt.dimensions=Bt.prototype.dimensions,Bt.create=function(t,e){let i;t.eachComponent("leaflet",function(t){const n=Ft.leafletMap;i||(i=new Bt(n,e)),i.setMapOffset(t.__mapOffset||[0,0]),t.coordinateSystem=i}),t.eachSeries(function(t){if(!t.get("coordinateSystem")||"leaflet"===t.get("coordinateSystem")){if(!i){const t=Ft.leafletMap;i=new Bt(t,e)}t.coordinateSystem=i,t.animation=!0===t.animation}})};var jt=Bt;const Gt=window.echarts;var Ut=r.Layer.extend({map:null,chart:null,options:null,echartsInitOpts:null,canvas:null,initialize(t,e){this.map=t,this.options=e,this.echartsInitOpts=e.echartsInitOpts,this.layerId=e.layerId||"echartlayerdefaultid",this.layerClass=e.classId||"echartlayerdefaultclass",this.visible=!0,this.initDevicePixelRatio(),this.initOptions(this.options),this.initEcharts()},getContainer(){return this.canvas},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},initOptions(t){if(t){if(t.leaflet)return;this.options.leaflet={roam:!0}}},initEcharts(){Gt.registerCoordinateSystem("leaflet",jt),Gt.extendComponentModel({type:"leaflet",getBMap(){return this.__leaflet},defaultOption:{roam:!1}}),Gt.registerAction({type:"LeafletRoma",event:"LeafletRoma",update:"updateLayout"},function(){})},_visible(){this.visible=!0,this.canvas.style.visibility="visible"},_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"},onAdd(t){const e=this;this.map=t,this.canvas=this._createCanvas(),this.map.getPane("tilePane").appendChild(this.canvas),this.chart=Gt.init(this.canvas,null,this.echartsInitOpts),Gt.leafletMap=t;const i=this;this.resize=this.resize.bind(this),t.on("resize",i.resize,this),t.on("zoomstart",i._unvisible,this),t.on("rotate",i.resize,this),window.addEventListener("resize",this.resize),Gt.extendComponentView({type:"leaflet",render(t,n,r){let o=!0;i._echartRenderApi||(i._echartRenderApi=r),i._mapModel||(i._mapModel=t);const s=Gt.leafletMap,a=r.getZr().painter.getViewportRoot(),l=t.coordinateSystem,h=function(){if(o||!e.visible)return;const i=s.getBounds().getNorthWest(),n=s.latLngToLayerPoint(i),h=[parseInt(n.x,10)||0,parseInt(n.y,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,l.setMapOffset(h),t.__mapOffset=h,r.dispatchAction({type:"LeafletRoma"})},u=function(){i._visible(),!o&&e.visible&&r.dispatchAction({type:"LeafletRoma"})};this._oldMoveHandler&&s.off("move",this._oldMoveHandler),this._oldZoomEndHandler&&s.off("zoomend",this._oldZoomEndHandler),s.on("move",h),s.on("zoomend",u),this._oldMoveHandler=h,this._oldZoomEndHandler=u,o=!1}}),this.chart.setOption(this.options)},onRemove(){this.chart.dispose()},_createCanvas(){const t=document.createElement("div");return t.id=this.layerId,t.style.top="0px",t.style.left="0px",t.height=`${this.map.getSize().y}px`,t.width=`${this.map.getSize().x}px`,t.style.height=`${this.map.getSize().y}px`,t.style.width=`${this.map.getSize().x}px`,t.style.zIndex=1e3,t.setAttribute("id",this.layerId),t.setAttribute("class",`leaflet-layer ${this.layerClass}`),this.canvas=t,t},_calcRotateBounds(){return ct(this.map)},show(){this._visible()},hide(){this._unvisible()},resize(){const t=this,e=t._calcRotateBounds().getSize();if(t.canvas.style.width=`${e.x}px`,t.canvas.style.height=`${e.y}px`,t.canvas.width=e.x,t.canvas.height=e.y,t.chart.resize(),t._echartRenderApi&&t._mapModel&&t.map._rotate){const e=t._echartRenderApi,i=t._mapModel,n=e.getZr().painter.getViewportRoot(),r=i.coordinateSystem,o=t.map.getBounds().getNorthWest(),s=t.map.latLngToLayerPoint(o),a=[parseInt(s.x,10)||0,parseInt(s.y,10)||0];n.style.left=`${a[0]}px`,n.style.top=`${a[1]}px`,r.setMapOffset(a),i.__mapOffset=a,e.dispatchAction({type:"LeafletRoma"})}},update(t){this.chart.setOption(t)},remove(){return this.map&&(this.map.off("resize",this.resize,this),this.map.off("zoomstart",this._unvisible,this),this.map.off("rotate",this.resize,this)),window.removeEventListener("resize",this.resize),this.chart.clear(),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this},setOpacity(t){this.canvas.style.opacity=t}});var qt=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",this._getZoomForUrl())},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var Ht=xt.extend({options:{imageFormat:"PNG",imageSR:"",interpolation:"",renderingRule:"",bandIds:null,tokenKey:"",tokenValue:"",httpMethod:"GET",visible:!0,opacity:1,pane:"tilePane",imageServer:null,clippingArea:null,imageHeight:512,imageWidth:512},getTileUrl(t){const e=this._map,i=this.getTileSize(),r=t.scaleBy(i),o=r.add(i),s=e.unproject(r,t.z),a=e.unproject(o,t.z),l=new L.LatLngBounds(s,a),h=this._map.options.crs.project(l.getNorthWest()),u=this._map.options.crs.project(l.getSouthEast()),c=`${h.x},${u.y},${u.x},${h.y}`;return"POST"===this.httpMethod?(this.requestStructure.commonQueryParameters.bbox=new n.Extent({xmin:h.x,ymin:u.y,xmax:u.x,ymax:h.y}),this.requestStructure):this._urlTemplate.replace("{bbox}",c)},_postImage(t,e){return this.server.exportImage(e.commonQueryParameters).then(e=>{const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),e instanceof Blob&&i.readAsDataURL(e),i.onerror=(()=>{})})},_initUrlTemplate(){const t={};this.options.tokenKey&&this.options.tokenValue&&(t.tokenKey=this.options.tokenKey,t.tokenValue=this.options.tokenValue),t.size=`${this.options.imageWidth},${this.options.imageHeight}`,t.format=this.options.imageFormat,t.f="image",t.imageSR=this.options.imageSR,t.interpolation=this.options.interpolation,t.renderingRule=this.options.renderingRule,t.bandIds=this.options.bandIds,t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e,this.server=Object(n.defaultValue)(this.options.imageServer,new n.ImageServer({url:this.url}))}});var Zt=vt.extend({options:{imageFormat:"PNG",imageSR:"",interpolation:"",renderingRule:null,bandIds:null,tokenKey:"",tokenValue:"",httpMethod:"GET",visible:!0,opacity:1,pane:"tilePane",imageServer:null,clippingArea:null},buildRequestImageSrc(t,e){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else t(this._urlTemplate.replace("{bbox}",this.bbox.toString()).replace("{size}",`${this.imageWidth},${this.imageHeight}`))})},_initUrlTemplate(){const t={};this.options.tokenKey&&this.options.tokenValue&&(t.tokenKey=this.options.tokenKey,t.tokenValue=this.options.tokenValue),t.format=this.options.imageFormat,t.f="image",t.imageSR=this.options.imageSR,t.interpolation=this.options.interpolation,t.renderingRule=this.options.renderingRule,t.bandIds=this.options.bandIds,t.formatMode="replace",t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.imageServer,new n.ImageServer({url:this.url}))}});var Xt=class{constructor(t,e){let i;return(e=Object(n.defaultValue)(e,{})).renderMode=Object(n.defaultValue)(e.renderMode,"image"),"tile"===e.renderMode?(e.imageWidth=Object(n.defaultValue)(e.imageWidth,512),e.imageHeight=Object(n.defaultValue)(e.imageHeight,512),i=new Ht(t,e)):i=new Zt(t,e),i}};var Yt=class extends n.BaseSwipeTool{constructor(t){super(t),this._addEvents(),this._reCreatedControl()}enable(t){this._swipeControl&&this._swipeControl.enable(t)}destroy(){this._removeEvents(),this._swipeControl&&this._swipeControl.remove()}_reCreatedControl(){this._swipeControl&&(this._swipeControl.remove(),this._swipeControl=null),this.innerView=this.view.getInnerView();const t=new F([],[],{mode:this.mode,region:this.region});this._swipeControl=t,t.addTo(this.innerView),this._updateLeadingLayers(),this._updateTrailingLayers()}_updateLeadingLayers(){if(this._swipeControl){const t=this.leadingLayers.items.map(t=>this.view.getInnerLayer(t)).filter(t=>t);this._swipeControl.setLeadingLayers(t)}}_updateTrailingLayers(){if(this._swipeControl){const t=this.trailingLayers.items.map(t=>this.view.getInnerLayer(t)).filter(t=>t);this._swipeControl.setTrailingLayers(t)}}_processLayerViewCreated(t){if(this._swipeControl){const e=t.layer;this.leadingLayers.items.some(t=>t.id===e.id)&&this._updateLeadingLayers(),this.trailingLayers.items.some(t=>t.id===e.id)&&this._updateTrailingLayers()}}_addEvents(){const t=this.view;t.on("innerview-recreated",this._reCreatedControl,this),t.on("layerview-created",this._processLayerViewCreated,this)}_removeEvents(){const t=this.view;t.off("innerview-recreated",this._reCreatedControl,this),t.off("layerview-created",this._processLayerViewCreated,this)}_updateDiff(t,e,i){switch(t){case"leadingLayers":this._updateLeadingLayers();break;case"trailingLayers":this._updateTrailingLayers();break;case"region":this._swipeControl&&this._swipeControl.setRegion(this.region);break;case"mode":this._swipeControl&&this._swipeControl.setMode(this.mode)}}};var Wt=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!");this._collection=new n.Collection}add(t){this._collection.add(t),t._addView()}remove(t){this._collection.remove(t),t._removeView(),t&&t.destroy&&t.destroy()}findControlById(t){return this._collection.filter(e=>e._id===t)}};class $t{}$t.getMouseEvent=function(t,e,i){const r=e._spatialReference;let o=void 0;return{mapPoint:o=r&&!r.isGeographic?n.Projection.project(new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),r):new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),x:t.containerPoint.x,y:t.containerPoint.y,button:t.originalEvent.button,buttons:t.originalEvent.buttons,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,innerViewerEvent:t,type:i}},$t.getKeyEvent=function(t,e,i){const n={key:t.originalEvent.key,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,innerViewerEvent:t,type:i};return"key-down"===i&&(n.repeat=t.originalEvent.repeat),n},$t.getViewChangeEvent=function(t,e,i){const n={event:t,innerViewerEvent:t,target:e,type:i};return n.mapView=e,n.scale=e._scale,n.zoom=e._zoom,n.center=e.center,n.extent=e._extent,n},$t.getDragEvent=function(t,e,i,n,r){return{x:t.originalEvent.layerX,y:t.originalEvent.layerY,button:void 0!==r?r:t.originalEvent.button,buttons:t.originalEvent.buttons,cancelable:t.originalEvent.cancelable,origin:i,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,action:n,innerViewerEvent:t,type:"drag"}};var Kt=$t;var Qt=class extends n.LayerView{onAdd(){return this._layerViewVisible=this._getLayerViewVisible(),nt.addVectorTileLayer(this),Promise.resolve(this)}onRemove(){return nt.removeLayer(this),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);const{innerLayer:e}=this;if(t.updateContent&&e&&e.getMapboxMap){const i=e.getMapboxMap();t.updateContent.forEach(t=>{t&&(i._loaded?this._onUpdate(t,i):i.once("load",()=>{this._onUpdate(t,i)}))})}return Promise.resolve(this)}_onUpdate(t,e){if(e[t.name])return void e[t.name].apply(e,t.params);const{params:i}=t;switch(t.name){case"setPaintProperties":nt.setPaintProperties(e,i[0],i[1]);break;case"setLayoutProperties":nt.setLayoutProperties(e,i[0],i[1]);break;case"sublayerUpdate":this._updateStyle(e,JSON.parse(JSON.stringify(i[0])));break;case"opacity":case"setStyleLayer":case"deleteStyleLayer":case"refresh":this._updateStyle(e,JSON.parse(JSON.stringify(this.layer.style.layers)));break;case"scaleVisible":case"minScale":case"maxScale":case"visible":{const i=this._getLayerViewVisible("scaleVisible"===t.name);this._layerViewVisible!==i&&(this._updateStyle(e,JSON.parse(JSON.stringify(this.layer.style.layers))),this._layerViewVisible=i);break}case"clippingArea":nt.setClippingArea(this,i[0]);break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}_updateStyle(t,e){const i=this._getOpacity(),n=this._getLayerViewVisible();nt.updateStyleLayer(t,e,{opacity:i,visible:n})}};var Jt=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=$.addWMSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.onRefresh();break;case"sublayerVisible":this.innerLayer.setParams({layers:this.layer.layers});break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}onRefresh(){this.innerLayer.redraw()}};var te=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=Q.addWMTSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};var ee=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=Z.addIGSTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};var ie=class extends n.Evented{constructor(t){super(t),this.view=Object(n.defaultValue)(t.view,null),this.location=Object(n.defaultValue)(t.location,""),this.title=Object(n.defaultValue)(t.title,""),this.content=Object(n.defaultValue)(t.content,""),this.alignment=Object(n.defaultValue)(t.alignment,"bottom-center"),this.defaultButtons=Object(n.defaultValue)(t.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initPopup(),this._initDefaultClass()}_initPopup(){this._customPopup(),this.view._innerView.closePopupOnClick=!1}_customPopup(){r.CustomPopup=r.Popup.extend({_initLayout(){const t="leaflet-popup",e=r.DomUtil.create("div",`${t} ${this.options.className||""} leaflet-zoom-animated`);this._container=e,e.setAttribute("style","margin: 0;");const i=r.DomUtil.create("div",`zondy-popup__container ${t}-content-wrapper`,e);this._wrapper=i,this._contentNode=r.DomUtil.create("div",`${t}-content`,i),this._contentNode.setAttribute("style","margin:0"),r.DomEvent.disableClickPropagation(i).disableScrollPropagation(this._contentNode).on(i,"contextmenu",r.DomEvent.stopPropagation),this._tipContainer=r.DomUtil.create("div","",e),this._tipContainer.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),this._tip=r.DomUtil.create("div",`zondy-popup__tip ${t}-tip`,this._tipContainer)}})}_contentUI(t,e){const i=this;let n=void 0;const r=function(t){const e=document.createElement("div");return e.innerHTML=t,e.childNodes};(n=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const o=document.createElement("div");o.setAttribute("class","zondy-popup__header-default zondy-popup__header"),o.setAttribute("style","display: flex;");const s=r('<div class="zondy-popup__toggle-default zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],a=r('<div class="zondy-popup__close-default zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(t||""===t){const e=r('<div class="zondy-popup__title" style="flex: 1;"></div>')[0];if(o.appendChild(e),"object"==typeof t?t instanceof Node?e.appendChild(t):t instanceof NodeList&&t.forEach(t=>{e.appendChild(t)}):e.innerHTML=t,this.defaultButtons.indexOf("toggle")>-1){o.appendChild(s);let t=!0;o.onclick=function(){t=!t,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content-default").style.display=t?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(o.appendChild(a),a.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content-default zondy-popup__content"),e)if("object"==typeof e){if(e instanceof Node)l.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)l.appendChild(e[t]),t--}else l.innerHTML=e;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer-default zondy-popup__footer");const u=r('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(u),u.onclick=function(){i.view.flyTo({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer-division zondy-popup__footer-default zondy-popup__footer"),n.appendChild(o),n.appendChild(l),n.appendChild(h),n}_initDefaultClass(){let t=!1;const e=document.head.getElementsByTagName("style");if(e)for(let i=0;i<e.length;i++)if(e[i].innerHTML.indexOf("styleDomString")>-1){t=!0;break}if(!t){const t=document.createElement("style");t.innerHTML="\n .zondy-popup__container-default{\n background-color: #fff;\n padding:0;\n border-radius: 10px;\n }\n .zondy-popup__tip-default{\n background-color: #fff;\n }\n .zondy-popup__header-default{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n }\n .zondy-popup__content-default{\n padding: 8px;\n }\n .zondy-popup__footer-default{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle-default,.zondy-popup__close-default{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(t)}}open(t){this._popup?(this.close(),this._popup=void 0,this.openPopup(t)):this.openPopup(t)}openPopup(t){if(this.view=Object(n.defaultValue)(t.view,this.view),this.location=Object(n.defaultValue)(t.location,this.location),this.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),this.title=Object(n.defaultValue)(t.title,this.title),this.content=Object(n.defaultValue)(t.content,this.content),this.alignment=Object(n.defaultValue)(t.alignment,this.alignment),this.defaultButtons=Object(n.defaultValue)(t.defaultButtons,this.defaultButtons),!this.view._innerView)return void n.Log.info("没有视图引擎!");const e=r.latLng(this._location.coordinates[1],this._location.coordinates[0]),i=this._contentUI(this.title,this.content);this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView);const o=this._getOffset();this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,offset:o,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView)}_getOffset(){let t=null;if(this._popup&&this._popup._container&&this.alignment){const e=this._popup._container.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,e.width,e.height);t=new r.Point(i.x,i.y)}return t}_getOffsetByAlignment(t,e,i){let n=0,r=0;switch(t){case"top-left":n=e/2,r=i;break;case"top-center":r=i;break;case"top-right":n=-e/2,r=i;break;case"bottom-left":n=e/2;break;case"auto":case"bottom-center":break;case"bottom-right":n=-e/2}return{x:n,y:r}}close(){this.view._innerView&&this.view._innerView.closePopup(this._popup)}destroy(){}},ne=i(5),re=i(6);var oe=function(t){t.Control.EasyPrint=t.Control.extend({options:{title:"Print map",position:"topleft",sizeModes:["Current"],filename:"map",exportOnly:!1,hidden:!1,tileWait:500,hideControlContainer:!0,hideClasses:[],customWindowTitle:window.document.title,spinnerBgCOlor:"#0DC5C1",customSpinnerClass:"epLoader",defaultSizeTitles:{Current:"Current Size",A4Landscape:"A4 Landscape",A4Portrait:"A4 Portrait"}},onAdd:function(){this.mapContainer=this._map.getContainer(),this.options.sizeModes=this.options.sizeModes.map(function(t){return"Current"===t?{name:this.options.defaultSizeTitles.Current,className:"CurrentSize"}:"A4Landscape"===t?{height:this._a4PageSize.height,width:this._a4PageSize.width,name:this.options.defaultSizeTitles.A4Landscape,className:"A4Landscape page"}:"A4Portrait"===t?{height:this._a4PageSize.width,width:this._a4PageSize.height,name:this.options.defaultSizeTitles.A4Portrait,className:"A4Portrait page"}:t},this);var e=t.DomUtil.create("div","leaflet-control-easyPrint leaflet-bar leaflet-control");if(!this.options.hidden){this._addCss(),t.DomEvent.addListener(e,"mouseover",this._togglePageSizeButtons,this),t.DomEvent.addListener(e,"mouseout",this._togglePageSizeButtons,this);var i="leaflet-control-easyPrint-button";this.options.exportOnly&&(i+="-export"),this.link=t.DomUtil.create("a",i,e),this.link.id="leafletEasyPrint",this.link.title=this.options.title,this.holder=t.DomUtil.create("ul","easyPrintHolder",e),this.options.sizeModes.forEach(function(e){var i=t.DomUtil.create("li","easyPrintSizeMode",this.holder);i.title=e.name,t.DomUtil.create("a",e.className,i),t.DomEvent.addListener(i,"click",this.printMap,this)},this),t.DomEvent.disableClickPropagation(e)}return e},printMap:async function(t,e){e&&(this.options.filename=e),this.options.format?("jpeg"==this.options.format.toLowerCase()?this.formatFun="toJpeg":"svg"==this.options.format.toLowerCase()?this.formatFun="toSvg":this.formatFun="toPng",this.format=this.options.format):(this.formatFun="toPng",this.format="png"),this.options.width=this.options.width?this.options.width:this.mapContainer.clientWidth,this.options.height=this.options.height?this.options.height:this.mapContainer.clientHeight,this.options.exportOnly||(this._page=window.open("","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10, top=10, width=200, height=250, visible=none"),this._page.document.write(this._createSpinner(this.options.customWindowTitle,this.options.customSpinnerClass,this.options.spinnerBgCOlor))),this.originalState={mapWidth:this.mapContainer.style.width,widthWasAuto:!1,widthWasPercentage:!1,mapHeight:this.mapContainer.style.height,zoom:this._map.getZoom(),center:this._map.getCenter()},"auto"===this.originalState.mapWidth?(this.originalState.mapWidth=this._map.getSize().x+"px",this.originalState.widthWasAuto=!0):this.originalState.mapWidth.includes("%")&&(this.originalState.percentageWidth=this.originalState.mapWidth,this.originalState.widthWasPercentage=!0,this.originalState.mapWidth=this._map.getSize().x+"px"),this._map.fire("easyPrint-start",{event:t}),this.options.hidden||this._togglePageSizeButtons({type:null}),this.options.hideControlContainer&&this._toggleControls(),this.options.hideClasses&&this._toggleClasses(this.options.hideClasses);var i="string"!=typeof t?t.target.className:t;if("CurrentSize"===i)return await this._printOpertion(i);this.outerContainer=this._createOuterContainer(this.mapContainer),this.originalState.widthWasAuto&&(this.outerContainer.style.width=this.originalState.mapWidth),this._createImagePlaceholder(i)},_createImagePlaceholder:function(t){var e=this;ne.toPng(this.mapContainer,{width:parseInt(this.originalState.mapWidth.replace("px")),height:parseInt(this.originalState.mapHeight.replace("px"))}).then(function(i){e.blankDiv=document.createElement("div");var n=e.blankDiv;e.outerContainer.parentElement.insertBefore(n,e.outerContainer),n.className="epHolder",n.style.backgroundImage='url("'+i+'")',n.style.position="absolute",n.style.zIndex=1011,n.style.display="initial",n.style.width=e.originalState.mapWidth,n.style.height=e.originalState.mapHeight,e._resizeAndPrintMap(t)}).catch(function(t){console.error("oops, something went wrong!",t)})},_resizeAndPrintMap:function(t){this.outerContainer.style.opacity=0;var e=this.options.sizeModes.filter(function(e){return e.className.indexOf(t)>-1});e=e[0],this.mapContainer.style.width=e.width+"px",this.mapContainer.style.height=e.height+"px",this.mapContainer.style.width>this.mapContainer.style.height?this.orientation="portrait":this.orientation="landscape",this._map.setView(this.originalState.center),this._map.setZoom(this.originalState.zoom),this._map.invalidateSize(),this.options.tileLayer?this._pausePrint(t):this._printOpertion(t)},_pausePrint:function(t){var e=this,i=setInterval(function(){e.options.tileLayer.isLoading()||(clearInterval(i),e._printOpertion(t))},e.options.tileWait)},_getValidDom:function(t){for(var e=t.cloneNode(!0),i=e.getElementsByClassName("leaflet-tile"),n=0;n<i.length;n++){var r=i[n];(!r.classList.contains("leaflet-tile-loaded")&&r.parentElement.classList.contains("leaflet-tile-container")||""===r.src)&&(r.remove(),n--)}return e},_printOpertion:function(t){var e=this,i=this.options.width?this.options.width:this.mapContainer.style.width.replace("px"),n=this.options.height?this.options.height:this.mapContainer.style.height.replace("px"),r=this.options.isDownload;return(this.originalState.widthWasAuto&&"CurrentSize"===t||this.originalState.widthWasPercentage&&"CurrentSize"===t)&&(i=this.originalState.mapWidth),new Promise(t=>{const o=e._getValidDom(e.mapContainer);document.body.appendChild(o),ne[this.formatFun](o,{width:parseInt(i),height:parseInt(n)}).then(function(i){var n=e._dataURItoBlob(i);e.options.exportOnly?r&&re.saveAs(n,e.options.filename+"."+e.format):e._sendToBrowserPrint(i,e.orientation),e._toggleControls(!0),e._toggleClasses(e.options.hideClasses,!0),e.outerContainer&&(e.originalState.widthWasAuto?e.mapContainer.style.width="auto":e.originalState.widthWasPercentage?e.mapContainer.style.width=e.originalState.percentageWidth:e.mapContainer.style.width=e.originalState.mapWidth,e.mapContainer.style.height=e.originalState.mapHeight,e._removeOuterContainer(e.mapContainer,e.outerContainer,e.blankDiv),e._map.invalidateSize(),e._map.setView(e.originalState.center),e._map.setZoom(e.originalState.zoom)),e._map.fire("easyPrint-finished"),t({dataUrl:i})}).catch(function(t){console.error("Print operation failed",t)}).finally(()=>{document.body.removeChild(o)})})},_sendToBrowserPrint:function(t,e){this._page.resizeTo(600,800);var i=this._createNewWindow(t,e,this);this._page.document.body.innerHTML="",this._page.document.write(i),this._page.document.close()},_createSpinner:function(t,e,i){return"<html><head><title>"+t+"</title></head><body><style>\n body{\n background: "+i+";\n }\n .epLoader,\n .epLoader:before,\n .epLoader:after {\n border-radius: 50%;\n }\n .epLoader {\n color: #ffffff;\n font-size: 11px;\n text-indent: -99999em;\n margin: 55px auto;\n position: relative;\n width: 10em;\n height: 10em;\n box-shadow: inset 0 0 0 1em;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n }\n .epLoader:before,\n .epLoader:after {\n position: absolute;\n content: '';\n }\n .epLoader:before {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 10.2em 0 0 10.2em;\n top: -0.1em;\n left: -0.1em;\n -webkit-transform-origin: 5.2em 5.1em;\n transform-origin: 5.2em 5.1em;\n -webkit-animation: load2 2s infinite ease 1.5s;\n animation: load2 2s infinite ease 1.5s;\n }\n .epLoader:after {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 0 10.2em 10.2em 0;\n top: -0.1em;\n left: 5.1em;\n -webkit-transform-origin: 0px 5.1em;\n transform-origin: 0px 5.1em;\n -webkit-animation: load2 2s infinite ease;\n animation: load2 2s infinite ease;\n }\n @-webkit-keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n @keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n </style>\n <div class=\""+e+'">Loading...</div></body></html>'},_createNewWindow:function(t,e,i){return"<html><head>\n <style>@media print {\n img { max-width: 98%!important; max-height: 98%!important; }\n @page { size: "+e+";}}\n </style>\n <script>function step1(){\n setTimeout('step2()', 10);}\n function step2(){window.print();window.close()}\n <\/script></head><body onload='step1()'>\n <img src=\""+t+'" style="display:block; margin:auto;"></body></html>'},_createOuterContainer:function(t){var e=document.createElement("div");return t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t),e.appendChild(t),e.style.width=t.style.width,e.style.height=t.style.height,e.style.display="inline-block",e.style.overflow="hidden",e},_removeOuterContainer:function(t,e,i){e.parentNode&&(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(i),e.parentNode.removeChild(e))},_addCss:function(){var t=document.createElement("style");t.type="text/css",t.innerHTML=".leaflet-control-easyPrint-button { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMiA1MTI7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8cGF0aCBkPSJNMTI4LDMyaDI1NnY2NEgxMjhWMzJ6IE00ODAsMTI4SDMyYy0xNy42LDAtMzIsMTQuNC0zMiwzMnYxNjBjMCwxNy42LDE0LjM5OCwzMiwzMiwzMmg5NnYxMjhoMjU2VjM1Mmg5NiAgIGMxNy42LDAsMzItMTQuNCwzMi0zMlYxNjBDNTEyLDE0Mi40LDQ5Ny42LDEyOCw0ODAsMTI4eiBNMzUyLDQ0OEgxNjBWMjg4aDE5MlY0NDh6IE00ODcuMTk5LDE3NmMwLDEyLjgxMy0xMC4zODcsMjMuMi0yMy4xOTcsMjMuMiAgIGMtMTIuODEyLDAtMjMuMjAxLTEwLjM4Ny0yMy4yMDEtMjMuMnMxMC4zODktMjMuMiwyMy4xOTktMjMuMkM0NzYuODE0LDE1Mi44LDQ4Ny4xOTksMTYzLjE4Nyw0ODcuMTk5LDE3NnoiIGZpbGw9IiMwMDAwMDAiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .leaflet-control-easyPrint-button-export { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDQzMy41IDQzMy41IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MzMuNSA0MzMuNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnIGlkPSJmaWxlLWRvd25sb2FkIj4KCQk8cGF0aCBkPSJNMzk1LjI1LDE1M2gtMTAyVjBoLTE1M3YxNTNoLTEwMmwxNzguNSwxNzguNUwzOTUuMjUsMTUzeiBNMzguMjUsMzgyLjV2NTFoMzU3di01MUgzOC4yNXoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .easyPrintHolder a {\n background-size: 16px 16px;\n cursor: pointer;\n }\n .easyPrintHolder .CurrentSize{\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTZweCIgdmVyc2lvbj0iMS4xIiBoZWlnaHQ9IjE2cHgiIHZpZXdCb3g9IjAgMCA2NCA2NCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNjQgNjQiPgogIDxnPgogICAgPGcgZmlsbD0iIzFEMUQxQiI+CiAgICAgIDxwYXRoIGQ9Ik0yNS4yNTUsMzUuOTA1TDQuMDE2LDU3LjE0NVY0Ni41OWMwLTEuMTA4LTAuODk3LTIuMDA4LTIuMDA4LTIuMDA4QzAuODk4LDQ0LjU4MiwwLDQ1LjQ4MSwwLDQ2LjU5djE1LjQwMiAgICBjMCwwLjI2MSwwLjA1MywwLjUyMSwwLjE1NSwwLjc2N2MwLjIwMywwLjQ5MiwwLjU5NCwwLjg4MiwxLjA4NiwxLjA4N0MxLjQ4Niw2My45NDcsMS43NDcsNjQsMi4wMDgsNjRoMTUuNDAzICAgIGMxLjEwOSwwLDIuMDA4LTAuODk4LDIuMDA4LTIuMDA4cy0wLjg5OC0yLjAwOC0yLjAwOC0yLjAwOEg2Ljg1NWwyMS4yMzgtMjEuMjRjMC43ODQtMC43ODQsMC43ODQtMi4wNTUsMC0yLjgzOSAgICBTMjYuMDM5LDM1LjEyMSwyNS4yNTUsMzUuOTA1eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgICA8cGF0aCBkPSJtNjMuODQ1LDEuMjQxYy0wLjIwMy0wLjQ5MS0wLjU5NC0wLjg4Mi0xLjA4Ni0xLjA4Ny0wLjI0NS0wLjEwMS0wLjUwNi0wLjE1NC0wLjc2Ny0wLjE1NGgtMTUuNDAzYy0xLjEwOSwwLTIuMDA4LDAuODk4LTIuMDA4LDIuMDA4czAuODk4LDIuMDA4IDIuMDA4LDIuMDA4aDEwLjU1NmwtMjEuMjM4LDIxLjI0Yy0wLjc4NCwwLjc4NC0wLjc4NCwyLjA1NSAwLDIuODM5IDAuMzkyLDAuMzkyIDAuOTA2LDAuNTg5IDEuNDIsMC41ODlzMS4wMjctMC4xOTcgMS40MTktMC41ODlsMjEuMjM4LTIxLjI0djEwLjU1NWMwLDEuMTA4IDAuODk3LDIuMDA4IDIuMDA4LDIuMDA4IDEuMTA5LDAgMi4wMDgtMC44OTkgMi4wMDgtMi4wMDh2LTE1LjQwMmMwLTAuMjYxLTAuMDUzLTAuNTIyLTAuMTU1LTAuNzY3eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==)\n }\n .easyPrintHolder .page {\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQ0NC44MzMgNDQ0LjgzMyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDQ0LjgzMyA0NDQuODMzOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNTUuMjUsNDQ0LjgzM2gzMzQuMzMzYzkuMzUsMCwxNy03LjY1LDE3LTE3VjEzOS4xMTdjMC00LjgxNy0xLjk4My05LjM1LTUuMzgzLTEyLjQ2N0wyNjkuNzMzLDQuNTMzICAgIEMyNjYuNjE3LDEuNywyNjIuMzY3LDAsMjU4LjExNywwSDU1LjI1Yy05LjM1LDAtMTcsNy42NS0xNywxN3Y0MTAuODMzQzM4LjI1LDQzNy4xODMsNDUuOSw0NDQuODMzLDU1LjI1LDQ0NC44MzN6ICAgICBNMzcyLjU4MywxNDYuNDgzdjAuODVIMjU2LjQxN3YtMTA4LjhMMzcyLjU4MywxNDYuNDgzeiBNNzIuMjUsMzRoMTUwLjE2N3YxMzAuMzMzYzAsOS4zNSw3LjY1LDE3LDE3LDE3aDEzMy4xNjd2MjI5LjVINzIuMjVWMzR6ICAgICIgZmlsbD0iIzAwMDAwMCIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);\n }\n .easyPrintHolder .A4Landscape { \n transform: rotate(-90deg);\n }\n \n .leaflet-control-easyPrint-button{\n display: inline-block;\n }\n .easyPrintHolder{\n margin-top:-31px;\n margin-bottom: -5px;\n margin-left: 30px;\n padding-left: 0px;\n display: none;\n }\n \n .easyPrintSizeMode {\n display: inline-block;\n }\n .easyPrintHolder .easyPrintSizeMode a {\n border-radius: 0px;\n }\n \n .easyPrintHolder .easyPrintSizeMode:last-child a{\n border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\n margin-left: -1px;\n }\n \n .easyPrintPortrait:hover, .easyPrintLandscape:hover{\n background-color: #757570;\n cursor: pointer;\n }",document.body.appendChild(t)},_dataURItoBlob:function(t){for(var e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),r=new DataView(n),o=0;o<e.length;o++)r.setUint8(o,e.charCodeAt(o));return new Blob([n],{type:i})},_togglePageSizeButtons:function(t){var e=this.holder.style,i=this.link.style;"mouseover"===t.type?(e.display="block",i.borderTopRightRadius="0",i.borderBottomRightRadius="0"):(e.display="none",i.borderTopRightRadius="2px",i.borderBottomRightRadius="2px")},_toggleControls:function(t){var e=document.getElementsByClassName("leaflet-control-container")[0];if(t)return e.style.display="block";e.style.display="none"},_toggleClasses:function(t,e){t.forEach(function(t){var i=document.getElementsByClassName(t)[0];if(e)return i.style.display="block";i.style.display="none"})},_a4PageSize:{height:715,width:1045}}),t.EasyPrint=function(e){return new t.Control.EasyPrint(e)}};var se=class{constructor(t){t=Object(n.defaultValue)(t,{}),this.view=Object(n.defaultValue)(t.view,null),this.format=Object(n.defaultValue)(t.format,n.PictureFormat.PNG),this.filename=Object(n.defaultValue)(t.filename,"screenshotFile"),this.width=Object(n.defaultValue)(t.width,this.view.width),this.height=Object(n.defaultValue)(t.height,this.view.height),this.x=Object(n.defaultValue)(t.x,0),this.y=Object(n.defaultValue)(t.y,0),this.isDownload=Object(n.defaultValue)(t.isDownload,!0),this._print=void 0,this._initEasyPrint()}_initEasyPrint(){oe(r)}_addView(){const t=this.view._innerView;if(t){const e={format:this.format,sizeModes:["Current","A4Landscape","A4Portrait"],filename:"新地图",exportOnly:!0,hidden:!0,isDownload:!1,width:this.view.width,height:this.view.height,hideControlContainer:!0};return this._print=r.EasyPrint(e).addTo(t),new Promise(t=>{this._print.printMap("CurrentSize",this.filename).then(e=>{this._cutImage(e.dataUrl).then(e=>{t({dataUrl:e.dataUrl})})})})}}_cutImage(t){const e=this,i=document.createElement("canvas");i.width=this.width,i.height=this.height;const r=i.getContext("2d"),o=function(t,e){const i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click()};return new Promise(s=>{if(this.width&&this.height){const a=new Image;a.src=t,a.onload=function(){r.drawImage(a,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let t=null;e.format===n.PictureFormat.PNG?t=i.toDataURL():e.format===n.PictureFormat.JPEG?t=i.toDataURL("image/jpeg"):"svg"===e.format&&(t=i.toDataURL()),e.isDownload&&o(t,e.filename),s({dataUrl:t})}}else e.isDownload&&o(t,this.filename),s({dataUrl:t})})}_removeView(){super._removeView();const t=this.view._innerView;t&&this._print&&(t.removeControl(this._print),this._print=null)}};var ae=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=Y.addIGSMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":const t=this._getLayerViewVisible("scaleVisible"===i.name);this.innerLayer.setVisible(t);break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"sublayerVisible":this.onRefresh();break;case"refresh":case"disableHiRender":this.onRefresh();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}onRefresh(){const{innerLayer:t}=this;Y.updateIGSMapImageLayer(this),t.refresh()}};var le=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=at.addIGSImageryLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":const t=this._getLayerViewVisible("scaleVisible"===i.name);this.innerLayer.setVisible(t);break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"refresh":case"bandIds":case"interpolation":case"rasterFunction":this.onRefresh();break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}onRefresh(){const{innerLayer:t}=this;at.updateIGSImageLayer(this),t.refresh()}};class he extends n.BaseGraphicsLayerView{onAdd(t){const e=this.layer,i=this.innerView,n=e.graphics||[],o=this;o.innerLayer=r.featureGroup().addTo(i),o.innerLayer.commonLayerId=e.id;const s=o._getLayerViewVisible(),a=o._getOpacity();return U.setVisibleOpacity(o.innerLayer,a,s),n.forEach(t=>{o._addFeature(o.innerLayer,t)}),Promise.resolve(this)}onRemove(t){return this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){this.layer;const e=this.innerLayer;return t.updateContent&&e&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"scaleVisible":case"opacity":case"minScale":case"maxScale":case"visible":{const e=this._getOpacity(),i=this._getLayerViewVisible("scaleVisible"===t.name);U.setVisibleOpacity(this.innerLayer,e,i);break}}if(t&&"method"===t.operationType)switch(t.name){case"add":{const i=t.params;this._addFeature(e,i[0]),this._updateGraphicsInOrder();break}case"remove":{const i=t.params;this._removeFeature(e,i[0]);break}case"addMany":{let i=t.params[0];i instanceof n.FeatureSet&&(i=i.features),i.forEach(t=>{this._addFeature(e,t)}),this._updateGraphicsInOrder();break}case"removeMany":t.params[0].forEach(t=>{this._removeFeature(e,t)});break;case"removeAll":e.clearLayers();break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}),Promise.resolve(this)}_addFeature(t,e){Object(n.defined)(e.geometry)?(e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this.layer.spatialReference),this.render.drawFeature(t,[e])):n.Log.warning("要素几何信息缺失,无法绘制要素:",e)}_removeFeature(t,e){this.render.clearFeature(t,[e])}_updateGraphicsInOrder(){const t=this.view.allLayerViews.toArray(),e=t.findIndex(t=>t.id===this.id);if(e>-1){const i=t.slice(e+1).find(t=>t instanceof he);i&&i!==this&&this._insertBeforeLayerView(i)}}_insertBeforeLayerView(t){const e=[];U.getLeafletGroupLayers(this.innerLayer,e,t=>t instanceof r.Path);const i=[];if(U.getLeafletGroupLayers(t.innerLayer,i,t=>t instanceof r.Path),0===i.length||0===e.length)return;const n=i[0];e.forEach(t=>{U.insertBefore(t._path,n._path)})}}var ue=he;class ce{}ce.addEchartsLayer=function(t){const{layer:e,innerView:i}=t,{extensionOptions:r={}}=e;let o=Object.assign(e.echartsOptions,r);o=Object(n.deleteNullValue)(o);const s=new Ut(i,o).addTo(i);return s.id=e.id,s},ce.removeLayer=function(t){t.remove()};var pe=ce;var fe=class extends n.LayerView{onAdd(t){const e=this.layer;return this.innerLayer=pe.addEchartsLayer(this),this.innerLayer.commonLayerId=e.commonLayerId,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(t){return pe.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this._getLayerViewVisible("scaleVisible"===i.name)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};class de{}de.addMapVLayer=function(t){const{layer:e,innerView:i}=t,{extensionOptions:r={}}=e;let o=Object.assign(e.mapVOptions,r);o=Object(n.deleteNullValue)(o);const s=new Vt(i,e.data,o).addTo(i);return s.id=e.id,s},de.removeLayer=function(t){t.remove()};var ge=de;var ye=class extends n.LayerView{onAdd(t){const e=this.layer;this.innerLayer=ge.addMapVLayer(this),this.innerLayer.commonLayerId=e.id,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide();const i=this._getOpacity();return this.innerLayer.setOpacity(i),Promise.resolve(this)}onRemove(t){return ge.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this._getLayerViewVisible("scaleVisible"===i.name)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};const me=r.Icon.extend({options:{iconUrl:null,iconRetinaUrl:null,shadowUrl:null,iconSize:[0,0],iconAnchor:[0,0],popupAnchor:[0,0],shadowSize:[0,0],className:"",prefix:"",glyph:"text",glyphColor:"white",lineHeight:1,horizontalAlignment:"center",verticalAlignment:"middle",font:{family:"微软雅黑",size:9,style:"normal",weight:"normal"},haloSize:0,haloColor:"#000000",angle:0,rotated:!1,backgroundColor:void 0,borderLineColor:"#ff0000",borderLineSize:0,lineWidth:192,kerning:!1,calcWidth:1},createIcon(){const t=document.createElement("div"),e=this.options;return e.glyph&&(this._textGlyph=this._createGlyph(),t.appendChild(this._textGlyph)),this._setIconStyles(t,e.className),t},_createGlyph(){let t,e;const i=this.options;i.prefix?t="fab"===i.prefix||"fal"===i.prefix||"far"===i.prefix||"fas"===i.prefix?`fa-${i.glyph}`:i.glyph.slice(0,i.prefix.length+1)===`${i.prefix}-`?i.glyph:`${i.prefix}-${i.glyph}`:(t="",e=i.glyph);const n=r.DomUtil.create("div");n.style.width="100%",n.style.height="100%",n.style.boxSizing="content-box",i.backgroundColor&&(n.style.backgroundColor=i.backgroundColor),i.borderLineColor&&i.borderLineSize&&(n.style.border=`${i.borderLineSize}px solid ${i.borderLineColor}`),i.rotated&&n.style.setProperty("transform",`rotate(${i.angle}deg)`);const o=r.DomUtil.create("span",`${i.prefix} ${t}`),s=0!==i.haloSize?r.DomUtil.create("span",`${i.prefix} ${t}`):void 0;return[s,o].forEach(t=>{if(t){const{size:n,weight:r,style:o,family:s,decoration:a}=i.font;t.style.fontSize=`${n}px`,t.style.fontWeight=r,t.style.fontStyle=o,t.style.fontFamily=s,t.style.color=i.glyphColor,t.style.lineHeight=i.lineHeight,t.style.textAlign=i.horizontalAlignment,t.style.verticalAlign=i.verticalAlignment,t.style.pointerEvents="none",t.style.display="inline-block",t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.textDecoration=a,i.kerning&&(t.style.transformOrigin="left",t.style.transform=`scale(${i.iconSize[0]/i.calcWidth},1)`),e&&(t.innerHTML=e)}}),s&&(s.style.setProperty("-webkit-text-stroke",`${i.haloSize}px ${i.haloColor}`),s.style.color="transparent",n.appendChild(s)),n.appendChild(o),n},_setIconStyles(t,e){if("shadow"===e)return r.Icon.prototype._setIconStyles.call(this,t,e);const i=this.options,n=r.point(i.iconSize);let o=r.point(i.iconAnchor);!o&&n&&(o=n.divideBy(2,!0)),t.className=`leaflet-marker-icon leaflet-glyph-icon ${e}`;const s=this._getIconUrl("icon");s&&(t.style.backgroundImage=`url('${s}')`),i.bgPos&&(t.style.backgroundPosition=`${-i.bgPos.x}px ${-i.bgPos.y}px`),i.bgSize&&(t.style.backgroundSize=`${i.bgSize.x}px ${i.bgSize.y}px`),o&&(t.style.marginLeft=`${-o.x}px`,t.style.marginTop=`${-o.y}px`),n&&(t.style.width=`${n.x}px`,t.style.height=`${n.y}px`)}});me.prototype.options.iconUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUlSURBVFjDrZdLiBxVFIb/e289uqt6kkx6zIiIoKgLRReKuMhCcaOIAUEIiCCE4CIPggZ8kBjooPgM0TiYEUUjqBGchZqAQlyYRTA+kJiJQiJGMjN5zYzT3dP1rrr3HBeTjDGTSfc8Dvyruud89Z9z6kIJdBj31763MivsJXKuZYF6dak5++2mh7NOcsXVHq6sHbhOK/24kOJJMO4AE1vKygwZhxlKSHGKiD+RSu09vOXB43OCrHz96y6T2lsh+OmKXzFdlbLne2UopSAupBhjECcZgjDMgiiSxPhcK/nCr1sfOtcWcm/tq9uEsL4rl0vdK67pKVu2jUwTMk0wBBAzpBCQAnAtiZIlwWQwPlHPglZQAFj1Y23VwVkh92zbd59U+Kanp+p2L12mooKQ5AbcpuclS6LiKoRhxOfHzhXMcs3PtVV7Z0DufXH/LSzpSG9vr1/p6kIz0dDUrvx/IYXAsrJCkWc4e/Z0Zpgf+KX26A/TkNtrXziesY9Xq8tvWNZdVfVYg7hzwKVv3O3ZiKMWj46OTrq5fdOh1x5pSADwjdzo2nbv0u6qqkca2jCIMGcZAuqRhu8vEX7ZK2V2WgMAcXdtvyeKbPS662+osCohzMycHVweniNREoShoZO5KYobpciSh23bFq7rIUgNiLFghRkBlg2v7GlpiccsCHrcryzxUk3zmsNskeYGvt/lxVH4hMWEu9xSWaQFYQ7L1B6iGZ5bBoy+zWKiHiltFHpqeIsVhWaosg1iqlgg4wAAEYEXsV3EmNppJmExMFYUxfVSuIs6E0sI5FkBBhLJzH9laQxLSjBj0WQJgSJPweDTkknvS4JGbCuxKOt7UY4lEQfNnAu9TzLxN2nUdAQTLAEw8YIlAVgAkmDCSBL75eCutSeY+GTUqqNkqUVxUbIl4qgJo4vWzecrhyQAMJldYf1MXLLl1EIsYBZgoGwpRI2zMTPtGBhYbSQAlJF9lieRzNMIriVBzPOWawvoIkYaNC0u9IcAIAHgp75NLQl8ENbPZJ6jgAU48RyFqHEuZyE+Pda/vjENAQBD5s209Y+kPJlyM4+r3lUS0AWSyVEhpHnjYu1pyO+7N4ywwPvhxHDiuwo8j1b5rkQwMZIziYHBXetPzIAAgIV8exZOSMoieI6aU5vKtgR0jqw1JtiYbZfW/R/kSN+mcWbxdtwYjn1XTd9B7cQAfNdCWB/OhBR7jvWv/3tWCAAoO3ktjyZZJ0HHbsq2AooERVQXzPKly2vOgPz29jNNBr+e1IcSz5YAM4hmFzPDtyWS+lDK4N2DfU+dbgsBAFHyd+oszE3agt/GjWcrUBEjj5sQBb96pXpXhAzueDJi4u1p41TsuQpCiFln4bkKeXMoJeadg++tG+sYAgBBXOo3RRrruAnfkWDmGfIdCeQhiiQgQbxjtlqzQk59vCZlNluL5lDiORLyMjcA4DsKeXM4AfDKxa97ThAAqPaMfaR1Nq6jOiqOAhOm5TsKJg1QZGGRedY7V6tzVcjBWk1D0JZ8cigt2RJSimkXnqOgW8MxQLUTb6wN5g0BgGPV0c9BekTH41xx5YXrQ8FkTRgdpxU7ea9djbYQ1GokmJ43wUhWtgRcS04tQjAcw9CWw29tThYOAXD03XVfMps/TTTOy30blDZgiqxFK6p7OsnvCDJ1UD9LyUjORoPDkUQyPfdHbXW+qJCjfRsOwOAoNY4z6Xz01rHq3k5zO4ZMHTabYSIhJD87MLB64f8Ys8WdG/tfBljMJedfwY+s/2P4Pv8AAAAASUVORK5CYII=";var _e=me;function ve(t,e){if(!t)return e;e.stroke=!0,e.color=n.Color.fromColor(t.color).toCssRGBAString(),e.weight=Object(n.defaultValue)(t.width,3),e.lineJoin=Object(n.defaultValue)(t.join,"round"),e.lineCap=Object(n.defaultValue)(t.cap,"round");let i=U.convertLineDash(t.style,"butt"===t.cap);i&&Array.isArray(i)&&(i=i.map(e=>t.width*e)),e.dashArray=i,e.marker=t.marker,e.noClip=!0}function xe(t,e){if(!t)return e;"solid"!==t.style?e.fill=`url(${Object(n.createSimpleFillSymbolCanvas)(t,{lineWidth:1}).toDataURL()})`:e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};ve(t.outline,i);for(const t in i)e[t]=i[t]}var be=class{static convertSymboltoLeafletStyle(t){const e={};if(!t)return e;switch(t.type){case n.SymbolType.simpleMarker:!function(t,e){Object(n.defined)(t.size)&&(e.radius=Object(n.defaultValue)(parseFloat(t.size)/2,10)),e.xoffset=t.xoffset,e.yoffset=t.yoffset,e.rotation=t.angle,e.shape=t.style,e.path=t.path,e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};ve(t.outline,i);for(const t in i)e[t]=i[t]}(t,e);break;case n.SymbolType.pictureMarker:!function(t,e){const i={},o=[10,10];Object(n.defined)(t.width)&&(o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(o[1]=parseFloat(t.height)),i.iconSize=o,Object(n.defined)(t.url)&&(i.iconUrl=t.url);const s=[o[0]/2,o[1]/2];Object(n.defined)(t.xoffset)&&(s[0]=t.xoffset+s[0]),Object(n.defined)(t.yoffset)&&(s[1]=t.yoffset+s[1]),i.iconAnchor=s;const a=r.icon(i);e.icon=a,e.rotationAngle=t.angle}(t,e);break;case n.SymbolType.simpleLine:ve(t,e);break;case n.SymbolType.simpleFill:xe(t,e);break;case n.SymbolType.pictureFill:!function(t,e){if(!t)return e;const{width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a,url:l}=t;e.fill=`url(${l})`,e.fillDetail={width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a};const h={};ve(t.outline,h);for(const t in h)e[t]=h[t]}(t,e);break;case n.SymbolType.text:!function(t,e){const i=U.getTextWidth(t.text,`${t.font.weight} ${t.font.size}px ${t.font.family}`);let r=i<t.lineWidth?i:t.lineWidth,o=Math.ceil(i/r);t.kerning&&(r=t.lineWidth,o=1);const s=t.font.size*t.lineHeight*o;let a=0,l=0;switch(t.horizontalAlignment){case"left":a=0;break;case"right":a=r;break;case"center":a=r/2;break;default:a=0}switch(t.verticalAlignment){case"baseline":l=s/2;break;case"top":l=0;break;case"middle":l=s/2;break;case"bottom":l=s;break;default:l=0}const h=[-t.xoffset+a,t.yoffset+l],u={glyph:t.text,iconUrl:null,iconSize:[r,s],font:t.font,lineHeight:t.lineHeight,iconAnchor:h,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,glyphColor:n.Color.fromColor(t.color).toCssRGBAString(),haloSize:t.haloSize,haloColor:n.Color.fromColor(t.haloColor).toCssRGBAString(),angle:t.angle,rotated:t.rotated,backgroundColor:t.backgroundColor?n.Color.fromColor(t.backgroundColor).toCssRGBAString():void 0,borderLineColor:t.borderLineColor?n.Color.fromColor(t.borderLineColor).toCssRGBAString():void 0,borderLineSize:t.borderLineSize,lineWidth:t.lineWidth,kerning:t.kerning,calcWidth:i},c=new _e(u);e.icon=c}(t,e);break;default:xe(t,e)}return e}};const{MarkerClusterGroup:we,MarkerWithText:Se}=function(t){const e=t.Marker.extend({options:{textIcon:null},onAdd(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this._initTextIcon(),this.update()},onRemove(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeTextIcon(),this._removeShadow()},setTextIcon(t){return this.options.textIcon=t,this._map&&(this._initTextIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},_initTextIcon(){if(!this.options.textIcon)return;const e=this.options,i=`leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`,n=e.textIcon.createIcon(this._textIcon);let r=!1;n!==this._textIcon&&(this._textIcon&&this._removeTextIcon(),r=!0,e.title&&(n.title=e.title),"IMG"===n.tagName&&(n.alt=e.alt||"")),t.DomUtil.addClass(n,i),e.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._textIcon=n,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._textIcon),this._initTextIconInteraction()},_removeTextIcon(){this._textIcon&&(t.DomUtil.remove(this._textIcon),this.removeInteractiveTarget(this._textIcon),this._textIcon=null)},_setPos(e){this._icon&&t.DomUtil.setPosition(this._icon,e),this._textIcon&&t.DomUtil.setPosition(this._textIcon,e),this._shadow&&t.DomUtil.setPosition(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t),this._textIcon&&(this._textIcon.style.zIndex=this._zIndex+t)},_initTextIconInteraction(){if(this.options.interactive&&this._textIcon&&(t.DomUtil.addClass(this._textIcon,"leaflet-interactive"),this.addInteractiveTarget(this._textIcon),t.MarkerDrag)){let e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new t.MarkerDrag(this),e&&this.dragging.enable()}},_updateOpacity(){const e=this.options.opacity;this._icon&&t.DomUtil.setOpacity(this._icon,e),this._textIcon&&t.DomUtil.setOpacity(this._textIcon,e),this._shadow&&t.DomUtil.setOpacity(this._shadow,e)}});function i(t,e,i,o,s){!function t(e,i,r,o,s){for(;o>r;){if(o-r>600){const n=o-r+1,a=i-r+1,l=Math.log(n),h=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*h*(n-h)/n)*(a-n/2<0?-1:1),c=Math.max(r,Math.floor(i-a*h/n+u)),p=Math.min(o,Math.floor(i+(n-a)*h/n+u));t(e,i,c,p,s)}const a=e[i];let l=r,h=o;for(n(e,r,i),s(e[o],a)>0&&n(e,r,o);l<h;){for(n(e,l,h),l++,h--;s(e[l],a)<0;)l++;for(;s(e[h],a)>0;)h--}0===s(e[r],a)?n(e,r,h):n(e,++h,o),h<=i&&(r=h+1),i<=h&&(o=h-1)}}(t,e,i||0,o||t.length-1,s||r)}function n(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function r(t,e){return t<e?-1:t>e?1:0}function o(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function s(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function a(t,e){l(t,0,t.children.length,e,t)}function l(t,e,i,n,r){r||(r=_(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];h(r,t.leaf?n(e):e)}return r}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function p(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function g(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function y(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,n,r,o){const s=[e,n];for(;s.length;){if((n=s.pop())-(e=s.pop())<=r)continue;const a=e+Math.ceil((n-e)/r/2)*r;i(t,a,e,n,o),s.push(e,a,a,n)}}t.MarkerWithText=e,o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(t){let e=this.data;const i=[];if(!m(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;m(t,a)&&(e.leaf?i.push(s):y(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i},o.prototype.collides=function(t){let e=this.data;if(!m(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(m(t,o)){if(e.leaf||y(t,o))return!0;i.push(r)}}e=i.pop()}return!1},o.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},o.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},o.prototype.clear=function(){return this.data=_([]),this},o.prototype.remove=function(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let a,l,h;for(;i||r.length;){if(i||(i=r.pop(),l=r[r.length-1],a=o.pop(),h=!0),i.leaf){const n=s(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}h||i.leaf||!y(i,n)?l?(a++,i=l.children[a],h=!1):i=null:(r.push(i),o.push(a),a=0,l=i,i=i.children[0])}return this},o.prototype.toBBox=function(t){return t},o.prototype.compareMinX=function(t,e){return t.minX-e.minX},o.prototype.compareMinY=function(t,e){return t.minY-e.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(t){return this.data=t,this},o.prototype._all=function(t,e){const i=[];for(;t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},o.prototype._build=function(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return a(o=_(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),(o=_([])).leaf=!1,o.height=n;const l=Math.ceil(r/s),h=l*Math.ceil(Math.sqrt(s));v(t,e,i,h,this.compareMinX);for(let r=e;r<=i;r+=h){const e=Math.min(r+h-1,i);v(t,r,e,l,this.compareMinY);for(let i=r;i<=e;i+=l){const r=Math.min(i+l-1,e);o.children.push(this._build(t,i,r,n-1))}}return a(o,this.toBBox),o},o.prototype._chooseSubtree=function(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i=1/0,n=1/0,r=void 0;for(let o=0;o<e.children.length;o++){const s=e.children[o],a=p(s),l=d(t,s)-a;l<n?(n=l,i=a<i?a:i,r=s):l===n&&a<i&&(i=a,r=s)}e=r||e.children[0]}return e},o.prototype._insert=function(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),h(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},o.prototype._split=function(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=_(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,a(i,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},o.prototype._splitRoot=function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=l(t,0,s,this.toBBox),a=l(t,s,i,this.toBBox),h=g(e,a),u=p(e)+p(a);h<r?(r=h,n=s,o=u<o?u:o):h===r&&u<o&&(o=u,n=s)}return n||i-e},o.prototype._chooseSplitAxis=function(t,e,i){const n=t.leaf?this.compareMinX:u,r=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)},o.prototype._allDistMargin=function(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=l(t,0,e,r),s=l(t,i-e,i,r);let a=f(o)+f(s);for(let n=e;n<i-e;n++){const e=t.children[n];h(o,t.leaf?r(e):e),a+=f(o)}for(let n=i-e-1;n>=e;n--){const e=t.children[n];h(s,t.leaf?r(e):e),a+=f(s)}return a},o.prototype._adjustParentBBoxes=function(t,e,i){for(let n=i;n>=0;n--)h(e[n],t)},o.prototype._condense=function(t){for(let e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)};const x=t.MarkerClusterGroup=t.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:t.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{},maxClusterNum:0,deconflictionStrategy:"none"},initialize(e){t.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=t.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=t.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd},this._rbush=new o;const i=t.DomUtil.TRANSITION&&this.options.animate;t.extend(this,i?this._withAnimation:this._noAnimation),this._markerCluster=i?t.MarkerCluster:t.MarkerClusterNonAnimated},addLayer(e){if(e instanceof t.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();let i=e;const n=this._zoom;if(e.__parent)for(;i.__parent._zoom>=n;)i=i.__parent;return this._currentShownBounds.contains(i.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,i):this._animationAddLayerNonAnimated(e,i)),this},removeLayer(e){return e instanceof t.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers(e,i){if(!t.Util.isArray(e))return this.addLayer(e);const n=this._featureGroup,r=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress;let l,h=e.length,u=0,c=!0;if(this._map){const f=(new Date).getTime();var p=t.bind(function(){const d=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<h&&!(o&&u%200==0&&(new Date).getTime()-d>s);u++)if((l=e[u])instanceof t.LayerGroup)c&&(e=e.slice(),c=!1),this._extractNonGroupLayers(l,e),h=e.length;else if(l.getLatLng){if(!this.hasLayer(l)&&(this._addLayer(l,this._maxZoom),i||this.fire("layeradd",{layer:l}),l.__parent&&2===l.__parent.getChildCount())){const t=l.__parent.getAllChildMarkers(),e=t[0]===l?t[1]:t[0];n.removeLayer(e)}}else r.addLayer(l),i||this.fire("layeradd",{layer:l});a&&a(u,h,(new Date).getTime()-f),u===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds,this._rbush,this.options.deconflictionStrategy)):setTimeout(p,this.options.chunkDelay)},this);p()}else{const i=this._needsClustering;for(;u<h;u++)(l=e[u])instanceof t.LayerGroup?(c&&(e=e.slice(),c=!1),this._extractNonGroupLayers(l,e),h=e.length):l.getLatLng?this.hasLayer(l)||i.push(l):r.addLayer(l)}return this},removeLayers(e){let i,n,r=e.length;const o=this._featureGroup,s=this._nonPointGroup;let a=!0;if(!this._map){for(i=0;i<r;i++)(n=e[i])instanceof t.LayerGroup?(a&&(e=e.slice(),a=!1),this._extractNonGroupLayers(n,e),r=e.length):(this._arraySplice(this._needsClustering,n),s.removeLayer(n),this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n}));return this}if(this._unspiderfy){this._unspiderfy();const o=e.slice();let s=r;for(i=0;i<s;i++)(n=o[i])instanceof t.LayerGroup?(this._extractNonGroupLayers(n,o),s=o.length):this._unspiderfyLayer(n)}for(i=0;i<r;i++)(n=e[i])instanceof t.LayerGroup?(a&&(e=e.slice(),a=!1),this._extractNonGroupLayers(n,e),r=e.length):n.__parent?(this._removeLayer(n,!0,!0),this.fire("layerremove",{layer:n}),o.hasLayer(n)&&(o.removeLayer(n),n.clusterShow&&n.clusterShow())):(s.removeLayer(n),this.fire("layerremove",{layer:n}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds(){const e=new t.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer(t,e){const i=this._needsClustering.slice(),n=this._needsRemoving;let r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&t.call(e,i[o])}this._nonPointGroup.eachLayer(t,e)},getLayers(){const t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer(e){let i=null;return e=parseInt(e,10),this.eachLayer(function(n){t.stamp(n)===e&&(i=n)}),i},hasLayer(t){if(!t)return!1;let e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;e>=0;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer(t,e){const i=this._map;"function"!=typeof e&&(e=function(){});var n=function(){!i.hasLayer(t)&&!i.hasLayer(t.__parent)||this._inZoomAnimation||(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),t.__parent.zoomToBounds())},onAdd(t){let e,i,n;for(this._map=t,this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)(n=this._needsRemoving[e]).newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0),this._zoomEnd()},onRemove(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent(t){let e=t;for(;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice(t,e){for(let i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered(t,e){const i=this._map,n=this._gridUnclustered,r=Math.floor(this.getMinZoom());for(;e>=r&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved(t){if(!this._ignoreMove&&!t.target.__dragStart){const e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd(t){const e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer(t,e,i){const n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);let l=t.__parent;const h=l._markers;let u;for(this._arraySplice(h,t);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)e&&l._childCount<=1?(u=l._markers[0]===t?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,s.project(l._cLatLng,l._zoom)),r[l._zoom].addObject(u,s.project(u.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(u),u.__parent=l.__parent,l._icon&&(o.removeLayer(l),i||o.addLayer(u))):l._iconNeedsUpdate=!0,l=l.__parent;delete t.__parent},_isOrIsParent(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire(e,i,n){if(i&&i.layer instanceof t.MarkerCluster){if(i.originalEvent&&this._isOrIsParent(i.layer._icon,i.originalEvent.relatedTarget))return;e=`cluster${e}`}t.FeatureGroup.prototype.fire.call(this,e,i,n)},listens(e,i){return t.FeatureGroup.prototype.listens.call(this,e,i)||t.FeatureGroup.prototype.listens.call(this,`cluster${e}`,i)},_defaultIconCreateFunction(e){const i=e.getChildCount();let n=" marker-cluster-";return n+=i<10?"small":i<100?"medium":"large",new t.DivIcon({html:`<div><span>${i} <span aria-label="markers"></span>`+"</span></div>",className:`marker-cluster${n}`,iconSize:new t.Point(40,40)})},_bindEvents(){const t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(e||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy(t){const e=t.layer;let i=e;if(!("clusterkeypress"===t.type&&t.originalEvent&&13!==t.originalEvent.keyCode||t.originalEvent.defaultPrevented)){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage(e){const i=this._map;this._inZoomAnimation||(this._shownPolygon&&i.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new t.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),i.addLayer(this._shownPolygon)))},_hideCoverage(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents(){const t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd(){if(this._inZoomAnimation)return;const t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t},_generateInitialClusters(){let e=Math.ceil(this._map.getMaxZoom());const i=Math.floor(this.getMinZoom()),n=this.options.maxClusterRadius;let r=n;if("function"!=typeof n&&(r=function(){return n}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={},!isFinite(e))throw"Map has no maxZoom specified";if(!isFinite(i))throw"Map has no minZoom specified";for(let n=e;n>=i;n--)this._gridClusters[n]=new t.DistanceGrid(r(n)),this._gridUnclustered[n]=new t.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,i-1)},_addLayer(t,e){const i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this.getMinZoom());let o,s;this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);const a=this.options.maxClusterNum;for(;e>=r;e--){o=this._map.project(t.getLatLng(),e);const r=i[e].getNearObjectArr(o);if(r&&Array.isArray(r)&&r.length>0)for(let e=0;e<r.length;e++){const i=r[e].obj,n=i.getChildCount(),o=i.getAllChildMarkers();if(n>=a-1||o&&Array.isArray(o)&&o.length>0&&o[0].options&&t.options&&t.options.groupName===o[0].options.groupName)return i._addChild(t),void(t.__parent=i)}const u=n[e].getNearObjectArr(o);if(u&&Array.isArray(u)){let n=[],r=[];var l;const o=u.length;if(u.length>0)if(o>=a-1)u.forEach(t=>{n.push(t.obj),r.push(t.obj)}),r.push(t),l=r[0].__parent;else{for(let e=0;e<u.length;e++){const{obj:i,dist:o}=u[e];if(i.options&&t.options&&t.options.groupName===i.options.groupName){r=[i,t],n=[i];break}}r.length>0&&(l=r[0].__parent)}if(r.length>0&&l){n.forEach(t=>{t.__parent&&this._removeLayer(t,!1)});var h=new this._markerCluster(this,e);r.forEach(t=>{h._addChild(t),t.__parent=h}),i[e].addObject(h,this._map.project(h._cLatLng,e));let t=h;for(s=e-1;s>l._zoom;s--)t=new this._markerCluster(this,s,t),i[s].addObject(t,this._map.project(h._cLatLng,s));return l._addChild(t),void n.forEach(t=>{this._removeFromGridUnclustered(t,e)})}}n[e].addObject(t,o)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons(){this._featureGroup.eachLayer(function(e){e instanceof t.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(t.bind(this._processQueue,this),300))},_processQueue(){for(let t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters(){const t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds(){return this.options.removeOutsideVisibleBounds?t.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat(t){const e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();const t=e.getAllChildMarkers();this._featureGroup.removeLayer(t[0]),this._featureGroup.removeLayer(t[1])}else e._updateIcon()},_extractNonGroupLayers(e,i){const n=e.getLayers();let r,o=0;for(i=i||[];o<n.length;o++)(r=n[o])instanceof t.LayerGroup?this._extractNonGroupLayers(r,i):i.push(r);return i},_overrideMarkerIcon(t){return t.getChildCount=function(){return 1},t.getAllChildMarkers=function(){return[t]},t.options.icon=this.options.iconCreateFunction(t)},_animationCreateMarkerIcon(t){!t||t.isRefreshIcon||this.options.singleMarkerMode||(this._overrideMarkerIcon(t),t.isRefreshIcon=!0)}});t.MarkerClusterGroup.include({_mapBoundsInfinite:new t.LatLngBounds(new t.LatLng(-1/0,-1/0),new t.LatLng(1/0,1/0))}),t.MarkerClusterGroup.include({_noAnimation:{_animationStart(){},_animationZoomIn(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn(e,i){const n=this._getExpandedVisibleBounds(),r=this._featureGroup,o=Math.floor(this.getMinZoom());let s;this._ignoreMove=!0,this._rbush.clear();const a=this;this._topClusterLevel._recursively(n,e,o,function(t){let o=t._latlng;const a=t._markers.map(t=>t);let l;for(n.contains(o)||(o=null),t._isSingleParent()&&e+1===i?(r.removeLayer(t),t._recursivelyAddChildrenToMap(null,i,n)):(t.clusterHide(),t._recursivelyAddChildrenToMap(o,i,n)),s=a.length-1;s>=0;s--)l=a[s],n.contains(l._latlng)||r.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,i),r.eachLayer(function(e){e instanceof t.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(n,e,i,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildPositions(i,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._topClusterLevel._recursively(n,Math.floor(this.getMinZoom())-1,i,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildMarkerPositions(i,n,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,o,function(t){r.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut(t,e){this._rbush.clear(),this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._ignoreMove=!0,this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds(),this._rbush,this.options.deconflictionStrategy),this._ignoreMove=!1,this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer(t,e){const i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle(t,e,i){const n=this._getExpandedVisibleBounds(),r=Math.floor(this.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,e+1,i);const o=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){const e=t._markers[0];this._ignoreMove=!0,e.setLatLng(e.getLatLng()),this._ignoreMove=!1,e.clusterShow&&e.clusterShow()}else t._recursively(n,i,r,function(t){t._recursivelyRemoveChildrenFromMap(n,r,e+1)});o._animationEnd()})},_animationEnd(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout(){t.Util.falseFn(document.body.offsetWidth)},getMinZoom:()=>0}),t.markerClusterGroup=function(e){return new t.MarkerClusterGroup(e)};var b=t.MarkerCluster=t.MarkerWithText.extend({options:t.Icon.prototype.options,initialize(e,i,n,r){t.Marker.prototype.initialize.call(this,n?n._cLatLng||n.getLatLng():new t.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=i,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new t.LatLngBounds,n&&this._addChild(n),r&&this._addChild(r)},getAllChildMarkers(t,e){t=t||[];for(let i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(t,e);for(let i=this._markers.length-1;i>=0;i--)e&&this._markers[i].__dragStart||t.push(this._markers[i]);return t},getChildCount(){return this._childCount},zoomToBounds(t){let e=this._childClusters.slice();const i=this._group._map,n=i.getBoundsZoom(this._bounds);let r=this._zoom+1;const o=i.getZoom();let s;for(;e.length>0&&n>r;){r++;let t=[];for(s=0;s<e.length;s++)t=t.concat(e[s]._childClusters);e=t}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,t)},getBounds(){const e=new t.LatLngBounds;return e.extend(this._bounds),e},_updateIcon(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow(){return this._iconObj.createShadow()},_addChild(e,i){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof t.MarkerCluster?(i||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(i||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds(){const t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds(){const e=this._markers,i=this._childClusters;let n=0,r=0;const o=this._childCount;let s,a,l,h;if(0!==o){for(this._resetBounds(),s=0;s<e.length;s++)l=e[s]._latlng,this._bounds.extend(l),n+=l.lat,r+=l.lng;for(s=0;s<i.length;s++)(a=i[s])._boundsNeedUpdate&&a._recalculateBounds(),this._bounds.extend(a._bounds),l=a._wLatLng,h=a._childCount,n+=l.lat*h,r+=l.lng*h;this._latlng=this._wLatLng=new t.LatLng(n/o,r/o),this._boundsNeedUpdate=!1}},_addToMap(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn(t,e,i){this._recursively(t,this._group.getMinZoom(),i-1,function(t){const i=t._markers;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())},function(t){const i=t._childClusters;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap(t,e,i,n){this._recursively(t,n,e,function(r){r._recursivelyAnimateChildrenIn(t,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(t,e,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible(t,e){this._recursively(t,this._group.getMinZoom(),e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap(t,e,i,n,r){const o=this;this._recursively(i,this._group.getMinZoom()-1,e,function(s){if(e===s._zoom)return;const a=s._markers.map(t=>t);for(let l=a.length-1;l>=0;l--){const h=a[l];i.contains(h._latlng)&&(t&&(h._backupLatlng=h.getLatLng(),h.setLatLng(t),h.clusterHide&&h.clusterHide()),s._group._animationCreateMarkerIcon(h),s._group._featureGroup.addLayer(h),"static"===r&&o._adjustClusterOrMarkerStatus(h,n,e))}},function(i){i._addToMap(t),"static"===r&&o._adjustClusterOrMarkerStatus(i,n,e)})},_getAdjustPoint(e,i,n){const r=2*n,o=t.point(i.x-e.x,i.y-e.y),s=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return e.add(o._divideBy(s)._multiplyBy(r))},_calcAdjustPoint(e,i,n,r){const o=r*Math.SQRT2;let s,a,l=n,h=r;a=e.search(l);do{let e,n,u,c;a.forEach(t=>{e=Math.min(void 0===e?t.minX:e,t.minX),n=Math.min(void 0===n?t.minY:n,t.minY),u=Math.max(void 0===u?t.maxX:u,t.maxX),c=Math.max(void 0===c?t.maxY:c,t.maxY)});const p=t.point((u+e)/2,(n+c)/2);if(s=this._getAdjustPoint(p,i,h),h>o)return null;h+=1,l={minX:s.x-r,minY:s.y-r,maxX:s.x+r,maxY:s.y+r,point:s}}while(e.collides(l));return s},_adjustClusterOrMarkerStatus(t,e,i){if(t&&e&&e){let n,r;i=i||this._zoom,t instanceof b?(n=t._group._map,r=t._iconObj):(n=t._map,r=t.options.icon);const o=n.latLngToLayerPoint(t.getLatLng(),i);if(!r)return;if(isNaN(o.x)||isNaN(o.y))return;const s=r.options.iconSize,a=Math.max(s.x,s.y)/2;let l={minX:o.x-a,minY:o.y-a,maxX:o.x+a,maxY:o.y+a,point:o,obj:t};if(e.collides(l)){const r=this._calcAdjustPoint(e,o,l,a);if(!r||isNaN(r.x)||isNaN(r.y))return void t.setOpacity(0);const s=n.layerPointToLatLng(r,i);t.setLatLng(s),l={minX:r.x-a,minY:r.y-a,maxX:r.x+a,maxY:r.y+a,point:r,obj:t}}e.insert(l)}},_recursivelyRestoreChildMarkerPositions(t,e,i,n){for(let r=this._markers.length-1;r>=0;r--){const o=this._markers[r];o._backupLatlng&&(o.setLatLng(o._backupLatlng),delete o._backupLatlng),o&&o._map&&e&&e.contains(o._latlng)&&"static"===n&&this._adjustClusterOrMarkerStatus(o,i,t)}},_recursivelyRestoreChildPositions(t,e,i){const n=this._childClusters.slice().sort((t,e)=>t._childCount-e._childCount);if(t-1===this._zoom)for(let r=n.length-1;r>=0;r--)n[r]._restorePosition(),"static"===i&&this._adjustClusterOrMarkerStatus(n[r],e,t);else for(let e=this._childClusters.length-1;e>=0;e--)this._childClusters[e]._recursivelyRestoreChildPositions(t)},_restorePosition(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap(t,e,i,n){let r,o;this._recursively(t,e-1,i-1,function(t){const e=t._markers.map(t=>t);for(o=e.length-1;o>=0;o--)r=e[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(t){for(o=t._childClusters.length-1;o>=0;o--)r=t._childClusters[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively(t,e,i,n,r){const o=this._childClusters,s=this._zoom;let a,l;if(e<=s&&(r&&s===i&&r(this),n&&n(this)),o.sort((t,e)=>t._childCount-e._childCount),s<e||s<i)for(a=o.length-1;a>=0;a--)(l=o[a])._boundsNeedUpdate&&l._recalculateBounds(),t.intersects(l._bounds)&&l._recursively(t,e,i,n,r)},_isSingleParent(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});return t.Marker.include({clusterHide(){const t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow(){return this.setOpacity(this.options.opacity)}}),t.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},t.DistanceGrid.prototype={addObject(e,i){const n=this._getCoord(i.x),r=this._getCoord(i.y),o=this._grid,s=o[r]=o[r]||{},a=s[n]=s[n]||[],l=t.Util.stamp(e);this._objectPoint[l]=i,a.push(e)},updateObject(t,e){this.removeObject(t,e),this.addObject(t,e)},removeObject(e,i){const n=this._getCoord(i.x),r=this._getCoord(i.y),o=this._grid,s=o[r]=o[r]||{},a=s[n]=s[n]||[];let l,h;for(delete this._objectPoint[t.Util.stamp(e)],l=0,h=a.length;l<h;l++)if(a[l]===e)return a.splice(l,1),1===h&&delete s[n],!0},eachObject(t,e){let i,n,r,o,s,a,l;const h=this._grid;for(i in h)for(n in s=h[i])for(r=0,o=(a=s[n]).length;r<o;r++)(l=t.call(e,a[r]))&&(r--,o--)},getNearObject(e){const i=this._getCoord(e.x),n=this._getCoord(e.y);let r,o,s,a,l,h,u,c;const p=this._objectPoint;let f=this._sqCellSize,d=null;for(r=n-1;r<=n+1;r++)if(a=this._grid[r])for(o=i-1;o<=i+1;o++)if(l=a[o])for(s=0,h=l.length;s<h;s++)u=l[s],((c=this._sqDist(p[t.Util.stamp(u)],e))<f||c<=f&&null===d)&&(f=c,d=u);return d},getNearObjectArr(e,i){const n=this._getCoord(e.x),r=this._getCoord(e.y);let o,s,a,l,h,u,c,p;const f=this._objectPoint;let d=i||this._sqCellSize;const g=[];for(o=r-1;o<=r+1;o++)if(l=this._grid[o])for(s=n-1;s<=n+1;s++)if(h=l[s])for(a=0,u=h.length;a<u;a++)c=h[a],(p=this._sqDist(f[t.Util.stamp(c)],e))<=d&&(d=p,g.push({obj:c,dist:p,point:f[t.Util.stamp(c)]}));return g.sort((t,e)=>t.dist-e.dist),g},_getCoord(t){const e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist(t,e){const i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},t.QuickHull={getDistant(t,e){const i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine(t,e){let i=0,n=null;const r=[];let o,s,a;for(o=e.length-1;o>=0;o--)s=e[o],(a=this.getDistant(s,t))>0&&(r.push(s),a>i&&(i=a,n=s));return{maxPoint:n,newPoints:r}},buildConvexHull(t,e){let i=[];const n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull(t){let e,i=!1,n=!1,r=!1,o=!1,s=null,a=null,l=null,h=null,u=null,c=null;for(e=t.length-1;e>=0;e--){const u=t[e];(!1===i||u.lat>i)&&(s=u,i=u.lat),(!1===n||u.lat<n)&&(a=u,n=u.lat),(!1===r||u.lng>r)&&(l=u,r=u.lng),(!1===o||u.lng<o)&&(h=u,o=u.lng)}return n!==i?(c=a,u=s):(c=h,u=l),[].concat(this.buildConvexHull([c,u],t),this.buildConvexHull([u,c],t))}},t.MarkerCluster.include({getConvexHull(){const e=this.getAllChildMarkers(),i=[];let n,r;for(r=e.length-1;r>=0;r--)n=e[r].getLatLng(),i.push(n);return t.QuickHull.getConvexHull(i)}}),t.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy(){if(this._group._spiderfied===this||this._group._inZoomAnimation)return;const t=this.getAllChildMarkers(null,!0),e=this._group._map.latLngToLayerPoint(this._latlng);let i;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?i=this._group.options.spiderfyShapePositions(t.length,e):t.length>=this._circleSpiralSwitchover?i=this._generatePointsSpiral(t.length,e):(e.y+=10,i=this._generatePointsCircle(t.length,e)),this._animationSpiderfy(t,i)},unspiderfy(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle(e,i){let n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI;const r=this._2PI/e,o=[];let s,a;for(n=Math.max(n,35),o.length=e,s=0;s<e;s++)a=this._circleStartAngle+s*r,o[s]=new t.Point(i.x+n*Math.cos(a),i.y+n*Math.sin(a))._round();return o},_generatePointsSpiral(e,i){const n=this._group.options.spiderfyDistanceMultiplier;let r=n*this._spiralLengthStart;const o=n*this._spiralFootSeparation,s=n*this._spiralLengthFactor*this._2PI;let a=0;const l=[];let h;for(l.length=e,h=e;h>=0;h--)h<e&&(l[h]=new t.Point(i.x+r*Math.cos(a),i.y+r*Math.sin(a))._round()),r+=s/(a+=o/r+5e-4*h);return l},_noanimationUnspiderfy(){const t=this._group,e=t._map,i=t._featureGroup,n=this.getAllChildMarkers(null,!0);let r,o;for(t._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(e.removeLayer(r._spiderLeg),delete r._spiderLeg);t.fire("unspiderfied",{cluster:this,markers:n}),t._ignoreMove=!1,t._spiderfied=null}}),t.MarkerClusterNonAnimated=t.MarkerCluster.extend({_animationSpiderfy(e,i){const n=this._group,r=n._map,o=n._featureGroup,s=this._group.options.spiderLegPolylineOptions;let a,l,h,u;for(n._ignoreMove=!0,a=0;a<e.length;a++)u=r.layerPointToLatLng(i[a]),l=e[a],h=new t.Polyline([this._latlng,u],s),r.addLayer(h),l._spiderLeg=h,l._preSpiderfyLatlng=l._latlng,l.setLatLng(u),l.setZIndexOffset&&l.setZIndexOffset(1e6),o.addLayer(l);this.setOpacity(.3),n._ignoreMove=!1,n.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy(){this._noanimationUnspiderfy()}}),t.MarkerCluster.include({_animationSpiderfy(e,i){const n=this,r=this._group,o=r._map,s=r._featureGroup,a=this._latlng,l=o.latLngToLayerPoint(a),h=t.Path.SVG,u=t.extend({},this._group.options.spiderLegPolylineOptions);let c,p,f,d,g,y,m=u.opacity;for(void 0===m&&(m=t.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),h?(u.opacity=0,u.className=`${u.className||""} leaflet-cluster-spider-leg`):u.opacity=m,r._ignoreMove=!0,c=0;c<e.length;c++)p=e[c],r._animationCreateMarkerIcon(p),y=o.layerPointToLatLng(i[c]),f=new t.Polyline([a,y],u),o.addLayer(f),p._spiderLeg=f,h&&(g=(d=f._path).getTotalLength()+.1,d.style.strokeDasharray=g,d.style.strokeDashoffset=g),p.setZIndexOffset&&p.setZIndexOffset(1e6),p.clusterHide&&p.clusterHide(),s.addLayer(p),p._setPos&&p._setPos(l);for(r._forceLayout(),r._animationStart(),c=e.length-1;c>=0;c--)y=o.layerPointToLatLng(i[c]),(p=e[c])._preSpiderfyLatlng=p._latlng,p.setLatLng(y),p.clusterShow&&p.clusterShow(),h&&((d=(f=p._spiderLeg)._path).style.strokeDashoffset=0,f.setStyle({opacity:m}));this.setOpacity(.3),r._ignoreMove=!1,setTimeout(function(){r._animationEnd(),r.fire("spiderfied",{cluster:n,markers:e})},200)},_animationUnspiderfy(e){const i=this,n=this._group,r=n._map,o=n._featureGroup,s=e?r._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):r.latLngToLayerPoint(this._latlng),a=this.getAllChildMarkers(null,!0),l=t.Path.SVG;let h,u,c,p,f,d;for(n._ignoreMove=!0,n._animationStart(),this.setOpacity(1),u=a.length-1;u>=0;u--)(h=a[u])._preSpiderfyLatlng&&(h.closePopup(),h.setLatLng(h._preSpiderfyLatlng),delete h._preSpiderfyLatlng,d=!0,h._setPos&&(h._setPos(s),d=!1),h.clusterHide&&(h.clusterHide(),d=!1),d&&o.removeLayer(h),l&&(f=(p=(c=h._spiderLeg)._path).getTotalLength()+.1,p.style.strokeDashoffset=f,c.setStyle({opacity:0})));n._ignoreMove=!1,setTimeout(function(){let t=0;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&t++;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&(h.clusterShow&&h.clusterShow(),h.setZIndexOffset&&h.setZIndexOffset(0),t>1&&o.removeLayer(h),r.removeLayer(h._spiderLeg),delete h._spiderLeg);n._animationEnd(),n.fire("unspiderfied",{cluster:i,markers:a})},200)}}),t.MarkerClusterGroup.include({_spiderfied:null,unspiderfy(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),t.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim(e){t.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper(){this._unspiderfy()},_unspiderfy(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),t.MarkerClusterGroup.include({refreshClusters(e){return e?e instanceof t.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof t.LayerGroup?e=e._layers:e instanceof t.MarkerCluster?e=e.getAllChildMarkers():e instanceof t.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate(t){let e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers(t){let e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),t.Marker.include({refreshIconOptions(e,i){const n=this.options.icon;return t.setOptions(n,e),this.setIcon(n),i&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),{MarkerWithText:e,MarkerClusterGroup:x,MarkerCluster:b}}(r);function Ee(t,e,i,n){return t.evaluate({$feature:e,$cluster_count:i,$is_same_group:n})}function Le(t,e){for(let i=0;i<t.length;i++){const n=t[i];if(void 0!==n.value){if(n.value===e)return n}else if("undefined"!==n.minValue&&void 0!==n.maxValue&&(e=parseFloat(e),n.minValue<=e&&n.maxValue>e&&!isNaN(e)))return n}return null}function Ce(t,e,i,n,r,o){const s=Le(o,Ee(e,i,n,r));if(s){const e=t.findIndex(t=>t.object===s);if(e>-1)return t[e].groupName;{const e={groupName:String(t.length),object:s};return t.push(e),e.groupName}}return t[0].groupName}class Pe{static createClusterLayer(t,e,i){Pe.isAddClusterCss||(Object(n.inputCss)("\n .leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {\n -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;\n -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;\n -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;\n transition: transform 0.3s ease-out, opacity 0.3s ease-in;\n }\n .leaflet-cluster-spider-leg {\n /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */\n -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;\n -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;\n -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;\n transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;\n }\n "),Pe.isAddClusterCss=!0);const o={},s=t.renderer,{defaultSymbol:a,defaultLabelSymbol:l,defaultLabelExpressionInfo:h,radius:u,clusterBoundSymbol:c,maxScale:p,isExpandOnClick:f,isHoverShowBound:d,valueExpression:g,minHybridClusterCount:y,deconflictionStrategy:m}=s,_=s.clusterInfos||[];let v=20;if(e){const t=p/96*.0254,i=e.unproject(r.point(0,0),0),n=e.unproject(r.point(0,1),0);let o=e.distance(i,n),s=0;for(;s<=20&&o>t;)s+=1,o/=2;v=Math.max(s-1,0)}o.disableClusteringAtZoom=v,o.singleMarkerMode=!1,o.maxClusterRadius=u,o.polygonOptions=be.convertSymboltoLeafletStyle(c),o.zoomToBoundsOnClick=f,o.showCoverageOnHover=d,o.deconflictionStrategy=m,o.maxClusterNum=y;const x=n.ExpressionParser.createValueExpressionParser(),b=x.parse(g);let w;const S={};h&&h.expression&&(w=x.parse(h.expression));for(let t=0;t<_.length;t++){const e=_[t];e&&e.labelExpressionInfo&&e.labelExpressionInfo.expression&&(S[e.labelExpressionInfo.expression]=x.parse(e.labelExpressionInfo.expression))}o.iconCreateFunction=(t=>{const e=t.getChildCount();let i,o=!0;if(1===e)i=t;else{const e=t.getAllChildMarkers(),n={};for(let t=0;t<e.length;t++){const i=e[t];n[i.options.groupName]?n[i.options.groupName].count+=1:n[i.options.groupName]={count:1,marker:i}}let r;for(const t in n)(void 0===r||r&&n[t].count>r.count)&&(r=n[t]);i=r.marker,o=!(Object.keys(n).length>1)}const s=Ee(b,i.attributes,e,o),h=Le(_,s);let u=a,c=l,p=w;if(h&&(u=h.symbol,c=h.labelSymbol,h.labelExpressionInfo&&h.labelExpressionInfo.expression&&S[h.labelExpressionInfo.expression]&&(p=S[h.labelExpressionInfo.expression])),t instanceof r.Marker)if(c&&p){const i=function(t,e){return t.evaluate({$cluster_count:e})}(p,e),n=c.clone();n.text=i;const r=be.convertSymboltoLeafletStyle(n);t.setTextIcon(r.icon)}else t._removeTextIcon();return function(t){const e=document.createElement("div"),i=document.createElement("div");let o=[10,10],s=0,a="none";if(n.SymbolType.pictureMarker===t.type)Object(n.defined)(t.width)&&(e.style.width=`${parseFloat(t.width)}px`,o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(e.style.height=`${parseFloat(t.height)}px`,o[1]=parseFloat(t.height)),Object(n.defined)(t.xoffset)&&(e.style.marginLeft=t.xoffset),Object(n.defined)(t.yoffset)&&(e.style.marginTop=t.yoffset),Object(n.defined)(t.angle)&&(e.style.transform=`rotate(${t.angle}deg)`),Object(n.defined)(t.url)&&(e.style.backgroundImage=`url(${t.url})`,e.style.backgroundSize="100% 100%");else{const{size:i=20,outline:r=null,style:l="circle",path:h="",angle:u=0,xoffset:c=0,yoffset:p=0,color:f}=t;if(Object(n.defined)(r)){const{width:t,color:n}=r;"circle"===l&&(e.style.borderRadius=`${i}px`,e.style.backgroundClip="padding-box"),s=t,a=U.convertColorToRgb(n)}Object(n.defined)(f)&&(e.style.backgroundColor=U.convertColorToRgb(f),e.style.backgroundSize="100% 100%"),Object(n.defined)(i)&&(o=[i,i],e.style.width=`${i}px`,e.style.height=`${i}px`),Object(n.defined)(c)&&(e.style.marginLeft=`${c}px`),Object(n.defined)(p)&&(e.style.marginTop=`${p}px`),Object(n.defined)(u)&&(e.style.transform=`rotate(${u}deg)`)}const l=o[0]+2*s,h=o[1]+2*s;return i.style=`border:none;background-color:${a};border-radius:${"circle"===t.style?`${l}px`:"none"};padding:${s}px;`,i.appendChild(e),new r.DivIcon({html:i,iconSize:new r.Point(l,h),className:""})}(u)});const E=new we(o);i=i||[];const L=[{groupName:"0",object:null}];for(let t=0;t<i.length;t++){const e=i[t];if(Object(n.defined)(e.geometry)){const t=new Se(U.getAreaCenter(e.geometry)),i=e.attributes,n=Ce(L,b,i,0,!0,_);t.options.groupName=n,E.addLayer(t),t.attributes=i}else n.Log.warning("要素几何信息缺失,无法绘制要素:",e)}return E}}var Ie=Pe;var Me=class extends n.BaseFeatureLayerView{onAdd(t){return this._addInnerLayer()}_processData(){return new Promise(t=>{})}onRemove(t){return super.onRemove(t),this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){this.layer;const e=this.innerLayer;return t.updateContent&&e&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":case"opacity":{const e=this._getOpacity(),i=this._getLayerViewVisible("scaleVisible"===t.name);U.setVisibleOpacity(this.innerLayer,e,i);break}}if(t&&"method"===t.operationType)switch(t.name){case"refresh":this.innerView.removeLayer(this.innerLayer),this._addInnerLayer()}}),Promise.resolve(this)}_addInnerLayer(){return this._processData().then(t=>{const e=this.layer,i=this,n=this.innerView,r=e.renderer;i._initInnerLayer(e,n,t,r);const o=i._getLayerViewVisible(),s=i._getOpacity();return U.setVisibleOpacity(i.innerLayer,s,o),i.innerLayer.addTo(n),new Promise(t=>{t(i)})})}_initInnerLayer(t,e,i,o){let s;o=o||{};let a=!1;if(this._isCommonRenderer(o))a=!0,s=r.featureGroup();else switch(o.type){case n.RendererType.cluster:s=Ie.createClusterLayer(t,e,i.features);break;default:n.Log.error("无法解析renderer信息")}return s.commonLayerId=t.id,this.innerLayer=s,a&&this._initFeatures(i.features,o),s}_rendererChangeAction(t){const{sourceEventData:e={}}=t;if("renderer"===e.key){const t=e.oldValue,i=e.value;if(!this._isCommonRenderer(t)||!this._isCommonRenderer(i))return this.innerView.removeLayer(this.innerLayer),void this._addInnerLayer()}const i=this.layer.renderer;this._isCommonRenderer(i)?super._rendererChangeAction(t):Ie.updateCluster(this.innerLayer,this.layer,this.view)}_isCommonRenderer(t){return t&&[n.RendererType.classBreak,n.RendererType.simple,n.RendererType.uniqueValue,n.RendererType.random,n.RendererType.rank].some(e=>e===t.type)}};var Te=class extends Me{_processData(){const t=this.layer;return Promise.resolve(t._source)}};class Oe{}Oe.addIGSVectorLayer=function(t,e,i,o){const s=xt.extend({options:{gdbps:null,filters:null,style:null,f:null,keepCache:!0,guid:null,attribution:"Zondy Map vector Data",proj:null,noWrap:!0,extensions:[]},initialize(t){t=t||{},this.url=t.url||"",this.layer=t.layer,r.setOptions(this,t),r.stamp(this)},onAdd(t){this._crs=t.options.crs,this._initLayerUrl(),xt.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._tileCoordsToBounds(t),i=this._crs.project(e.getNorthWest()),n=this._crs.project(e.getSouthEast());let r=this._layerUrl;return this.options.keepCache||(r+=`&temp=${Math.random()}`),r.replace("bbox={bbox}",`bbox=${i.x},${n.y},${n.x},${i.y}`)},_initLayerUrl(){const t=this._initAllRequestParams(),e=n.ServerUtil.getImage(this.url,t);this._layerUrl=n.UrlUtil.completeUrlEndMark(this.url)+n.UrlUtil.getStringFromObject(e.queryParameters)},_initAllRequestParams(){const t=this.options||{};let e=this.options.tileSize;return e instanceof r.Point||(e=r.point(e,e)),{gdbps:t.gdbps.toString(),urls:t.gdbps.toString(),f:t.f,w:e.x,h:e.y,size:`${e.x},${e.y}`,filters:t.filters,style:t.style,projectionSrs:t.projectionSrs,isAntialiasing:t.isAntialiasing,tokenKey:t.tokenKey,tokenValue:t.tokenValue}},redraw(){if(this._map){this._removeAllTiles();const t=Object(n.getGUID)();this.options.guid=t,this._initLayerUrl(),this._update()}return this}});n.EPSG.find(t=>t.id===i.view.spatialReference.wkid);let a={url:t,gdbps:[e.gdbp],tokenKey:e.tokenKey,tokenValue:e.tokenValue,filters:e.definitionExpression?`0:${e.definitionExpression}`:"",layer:e,projectionSrs:Object(n.getProjectionSrs)(i.view.spatialReference),headers:e.headers,visible:i._getLayerViewVisible(),opacity:i._getOpacity(),f:"1.0"===e._igsVersion?"png":"image",onDataUpdateAndRenderCompleted:()=>{i._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})}};const l=new s(a=Object(n.deleteNullValue)(a)).addTo(o);return l.id=e.id,l};var Ne=Oe;var Ae=class extends Me{_processData(){return this.layer._reloadFeatures()}onAdd(t){const e=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){const t=Object(n.getBaseUrl)(i.url);let o=`${t}/igs/rest/mrms/layers`;"2.0"===i._igsVersion&&(o=`${t}/igs/rest/services/system/ResourceServer/tempData/image`),e.innerLayer=Ne.addIGSVectorLayer(o,i,e,r);const s=e._getLayerViewVisible(),a=e._getOpacity();return U.setVisibleOpacity(e.innerLayer,a,s),Promise.resolve(e)}return super.onAdd(t)}onUpdate(t){if("server"===this.layer.renderMode){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}return super.onUpdate(t)}onRemove(t){const e=this;return"server"===this.layer.renderMode?(this.innerView.removeLayer(this.innerLayer),Promise.resolve(e)):super.onRemove(t)}};var Re=class extends n.GroupLayerView{};var ke=class extends Me{_processData(){return this.layer.queryFeatures().then(t=>t)}};var De=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=tt.addArcGISMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}break;case"refresh":this.onRefresh()}}return Promise.resolve(this)}};var ze=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=ot.addArcGISTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};var Ve=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=it.addWebTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};function Fe(t){return t.length>2?new r.LatLng(t[1],t[0],t[2]):new r.LatLng(t[1],t[0])}function Be(t,e,i){const n=[];for(let r,o=0,s=t.length;o<s;o++)r=e?Be(t[o],e-1,i):(i||Fe)(t[o]),n.push(r);return n}function je(t,e){return t.isGeographic?e:(e.spatialReference=t,n.Projection.project(e,new n.SpatialReference("EPSG:4326")))}var Ge=class{static toLeafletCoords(t,e){let i=[];const r=Object(n.defaultValue)(e,{}),o=Object(n.defaultValue)(r.additional,void 0);let s=Object(n.defaultValue)(n.SpatialReference.fromJSON(r.spatialReference),new n.SpatialReference("EPSG:4326"));switch(t.spatialReference&&(s=t.spatialReference),t.type){case n.GeometryType.point:{let e=t.clone();const n=(e=je(s,e)).coordinates;i.push(Fe(n));break}case n.GeometryType.multiPoint:{let e=t.clone();i=Be((e=je(s,e)).coordinates,0,Fe);break}case n.GeometryType.lineString:{let e=t.clone();i=Be((e=je(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,0,Fe);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let e=t.clone();i=Be((e=je(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,1,Fe);break}case n.GeometryType.multiPolygon:{let e=t.clone();i=Be((e=je(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,2,Fe);break}case n.GeometryType.extent:{let e=t.clone();const n=(e=je(s,e)).xmin,r=e.xmax,o=e.ymin,a=e.ymax;i.push([o,n]),i.push([a,r]);break}case n.GeometryType.circle:{let e=t.clone();const n=(e=je(s,e)).center;i.push([n[1],n[0]]);break}}return i}};var Ue=r.CircleMarker.extend({options:{fill:!0,shape:"circle",radius:10,rotation:0,xoffset:0,yoffset:0,path:""},setStyle(t){const e=t&&t.radius||this.options.radius||this._radius;r.Path.prototype.setStyle.call(this,t),this.setRadius(e)},setPath(t){return this.options.path=t,this.redraw()},getPath(){return this.options.path},setXoffset(t){return this.options.xoffset=t,this.redraw()},getXoffset(){return this.options.xoffset},setYoffset(t){return this.options.yoffset=t,this.redraw()},getYoffset(){return this.options.yoffset},setRadius(t){return this.options.radius=t,this.redraw()},getRadius(){return this.options.radius},setRotation(t){return this.options.rotation=t,this.redraw()},getRotation(){return this.options.rotation},_updatePath(){this._renderer._updateShape(this)},toGeoJSON(){return r.GeoJSON.getFeature(this,{type:"Point",coordinates:r.GeoJSON.latLngToCoords(this.getLatLng())})}});const qe=Ge.toLeafletCoords,He=be.convertSymboltoLeafletStyle;function Ze(t,e,i){let o;switch(t){case n.SymbolType.simpleMarker:o=new Ue(e,i);break;case n.SymbolType.pictureMarker:o=r.marker(e,i);break;case n.SymbolType.line:o=r.polyline(e,i);break;case n.SymbolType.text:o=r.marker(e,i);break;case n.SymbolType.fill:case n.SymbolType.pictureFill:o=r.polygon(e,i);break;default:n.Log.error("符号类型错误,不合法的符号类型")}return o}function Xe(t,e,i){const r=[];if(t){const{color:o,style:s,placement:a}=t,l=U.calcLineMarkerDetail(i),{angle1:h,angle2:u,latlng1:c,latlng2:p}=l,f=He(new n.SimpleMarkerSymbol({angle:h,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})),d=Ze(n.SymbolType.simpleMarker,c,f),g=Ze(n.SymbolType.simpleMarker,p,He(new n.SimpleMarkerSymbol({angle:u,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})));"begin"===a?r.push(d):"end"===a?r.push(g):(r.push(d),r.push(g))}return r}function Ye(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=Xe(t.symbol.marker,i,t.geometry.coordinates),o=new r.FeatureGroup(n);e.__marker__group=o,e.addLayer(o)}function We(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=t.symbol.marker;let o=[];t.geometry.coordinates.forEach(t=>{const e=Xe(n,i,t);o=o.concat(e)});const s=new r.FeatureGroup(o);e.__marker__group=s,e.addLayer(s)}function $e(t,e,i){let r;return r=n.SymbolType.simpleMarker===t||n.SymbolType.text===t||n.SymbolType.pictureMarker===t?U.getAreaCenter(e):qe(e,{additional:i.additional})}function Ke(t){const e=He(t.symbol),i=t.symbol.type;return Ze(i,$e(i,t.geometry.toPolygon(),t),e)}function Qe(t){let e=null;if(!(t instanceof n.Feature))return e;if(!t.geometry)return n.Log.error("几何不存在"),e;switch(t.geometry.type){case n.GeometryType.point:e=function(t){const e=qe(t.geometry),i=He(t.symbol);return Ze(t.symbol.type,e[0],i)}(t);break;case n.GeometryType.lineString:e=function(t){const e=qe(t.geometry,{additional:t.additional}),i=He(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=Ze(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&Ye(t,o),o}(t);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:e=function(t){const e=He(t.symbol),i=t.symbol.type;return Ze(i,$e(i,t.geometry,t),e)}(t);break;case n.GeometryType.extent:case n.GeometryType.circle:e=Ke(t);break;case n.GeometryType.multiPoint:e=function(t){const e=qe(t.geometry),i=He(t.symbol),n=t.symbol.type,o=[];return e.forEach(t=>{const e=Ze(n,t,i);o.push(e)}),new r.FeatureGroup(o)}(t);break;case n.GeometryType.multiLineString:e=function(t){const e=qe(t.geometry,{additional:t.additional}),i=He(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=Ze(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&We(t,o),o}(t)}return e}const Je=be.convertSymboltoLeafletStyle;var ti=class extends n.FeatureRender{drawFeature(t,e){if(t){const{layerVisible:i,layerOpacity:n}=t;e.forEach(e=>{if(e.visible){const r=Qe(e);r.commonFeatureId=e.id,r.commonLayerId=t.commonLayerId,U.setGraphicVisibleOpacity(r,n,i),t.addLayer(r)}})}}updateFeature(t,e,i){t&&(super.updateFeature(t,e,i),e.forEach((e,n)=>{const r=i[n];r&&e&&this._update(t,r.symbolUpdated,r.geometryUpdated,e)}))}_update(t,e,i,r){const o=r.geometry,s=r.symbol,a=!!i,l=!!e;let h=!1;const u=this._getGraphicByFeatureId(t,r.id);if(r.visible)if(u){if(e){const{key:t,oldValue:i,value:n}=e;i&&n&&i.type!==n.type&&(h=!0),"type"===t&&(h=!0)}if(!h)switch(o.type){case n.GeometryType.point:if(l){const t=Je(r.symbol)||{};u.setStyle(t)}if(a){const t=Ge.toLeafletCoords(o);u.setLatLng(t[0])}break;case n.GeometryType.multiPoint:if(l){const t=Je(r.symbol);u.eachLayer(e=>{e.setStyle(t)})}if(a){const t=Ge.toLeafletCoords(o),e=Object.keys(u._layers).map(t=>u._layers[t])||[],i=t.length;let n=e.length;if(n!==i)if(n>i){for(;n!==i;)u.removeLayer(e[n-1]),n-=1;let r=0;u.eachLayer(e=>{e.setLatLng(t[r]),r+=1})}else{const i=r.symbol.type,o=Je(r.symbol);t.forEach((t,r)=>{if(r<n)e[r].setLatLng(t);else{const e=Ze(i,t,o);u.addLayer(e)}})}else{let e=0;u.eachLayer(i=>{i.setLatLng(t[e]),e+=1})}}break;case n.GeometryType.lineString:if(l){const t=Je(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=Ge.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&Ye(r,u);break;case n.GeometryType.multiLineString:if(l){const t=Je(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=Ge.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&We(r,u);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:if(l){const t=Je(r.symbol);u.setStyle(t)}if(a){const t=$e(s.type,o,r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}break;case n.GeometryType.extent:case n.GeometryType.circle:if(l){const t=Je(r.symbol);u.setStyle(t)}if(a){const t=$e(s.type,o.toPolygon(),r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}}h&&this._redrawFeature(t,r)}else this.drawFeature(t,[r]);else this.clearFeature(t,[r])}clearFeature(t,e){t&&(super.clearFeature(t,e),e.forEach(e=>{const i=this._getGraphicByFeatureId(t,e.id);i&&t.removeLayer(i)}))}clear(t){t&&(super.clear(t),t.clearLayers())}_getGraphicByFeatureId(t,e){let i=null;return t&&e&&t.eachLayer(t=>{if(t.commonFeatureId===e)return i=t}),i}_redrawFeature(t,e){this.clearFeature(t,[e]),this.drawFeature(t,[e])}};var ei=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=ht.addIGSImageryTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":const t=this._getLayerViewVisible("scaleVisible"===i.name);this.innerLayer.setVisible(t);break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};function ii(t,e){let i=null;switch(e.type){case n.LayerType.IGSVectorTile:case n.LayerType.ArcGISVectorTile:i=new Qt({view:t,layer:e});break;case n.LayerType.WMTS:i=new te({view:t,layer:e});break;case n.LayerType.IGSMapImage:i=new ae({view:t,layer:e});break;case n.LayerType.IGSTile:i=new ee({view:t,layer:e});break;case n.LayerType.WMS:i=new Jt({view:t,layer:e});break;case n.LayerType.ECharts:i=new fe({view:t,layer:e});break;case n.LayerType.MapV:i=new ye({view:t,layer:e});break;case n.LayerType.graphics:i=new ue({view:t,layer:e,render:new ti});break;case n.LayerType.GeoJSON:i=new Te({view:t,layer:e,render:new ti});break;case n.LayerType.IGSFeature:i=new Ae({view:t,layer:e,render:new ti});break;case n.LayerType.group:i=new Re({view:t,layer:e});break;case n.LayerType.WFS:i=new ke({view:t,layer:e,render:new ti});break;case n.LayerType.ArcGISMapImage:i=new De({view:t,layer:e});break;case n.LayerType.ArcGISTile:i=new ze({view:t,layer:e});break;case n.LayerType.webTile:i=new Ve({view:t,layer:e});break;case n.LayerType.IGSImage:i=new le({view:t,layer:e});break;case n.LayerType.IGSImageTile:i=new ei({view:t,layer:e})}return i}class ni extends n.MapView{constructor(t){if(super(t),t=Object(n.defaultValue)(t,{}),this._options=t,this._center=this._getValidCenter(t.center),this._extent=Object(n.isNull)(t.extent)?void 0:n.Extent.fromJSON(t.extent),this.animation=Object(n.defaultValue)(t.animation,!0),this.width=void 0,this.height=void 0,this._zoom=Object(n.defaultValue)(t.zoom,void 0),this._resolution=0,this._scale=Object(n.defaultValue)(t.scale,void 0),this.maxScale=Object(n.defaultValue)(t.maxScale,void 0),this.minScale=Object(n.defaultValue)(t.minScale,void 0),this.minZoom=Object(n.defaultValue)(t.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(t.maxZoom,void 0),this.popup=Object(n.defaultValue)(t.popup,void 0),this.preferCanvas=Object(n.defaultValue)(t.preferCanvas,!1),this.spatialReferenceLocked=Object(n.defaultValue)(t.spatialReferenceLocked,!1),this._rotation=Object(n.defaultValue)(t.rotation,0),this.stationary=!0,this.engineType=n.EngineType.leaflet,this._zoomSnap=Object(n.defaultValue)(t.zoomSnap,1),this._zoomDelta=Object(n.defaultValue)(t.zoomDelta,1),this._isCustomCrs=!1,this._map._initLeafletView=!0,this._screenshot=null,t.fullExtent){let e=n.Extent.fromJSON(t.fullExtent.toJSON());e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._initFullExtent=e}this._fullExtent=this._initFullExtent,this._mapExtent=null,this.extensionOptions=Object(n.defaultValue)(t.extensionOptions,{}),this._fireLoaded=!1,this._initView(!0,this._options)}flyTo(t,e={animate:!0}){t=Object(n.defaultValue)(t,{});const i=Object(n.defaultValue)(t.zoom,1),r=this._getFlyToCenter(t),o=this._getFlyToExtent(t);if(this._innerView){if(this._zoomSnap>B&&(this._innerView.options.zoomSnap=B),this._zoomDelta>B&&(this._innerView.options.zoomDelta=B),r){let t=r.coordinates[1],o=r.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(o>this._fullExtent.xmax||o<this._fullExtent.xmin)&&(o=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(o)){let s=!1;const a=this._innerView.getCenter();if(i===this._zoom&&t===a.lat&&o===a.lng&&(s=!0),!s){let s;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(s=this._innerView._limitCenter({lat:t,lng:o},i,this._innerView.options.maxBounds)),s&&s.lat!==t&&s.lng!==o?n.Log.warning(`中心点${r}、层级${i}的视图,范围超过最大视图范围!`):(this._center=r,this._scale=this._getScaleByZoom(i),this._zoom=void 0,this._innerView.setView([t,o],i,e))}}}else if(o){let t=o.xmin,i=o.xmax,n=o.ymin,r=o.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),i>this._fullExtent.xmax&&(i=this._fullExtent.xmax),n<this._fullExtent.ymin&&(n=this._fullExtent.ymin),r>this._fullExtent.ymax&&(r=this._fullExtent.ymax)),isFinite(t)&&isFinite(i)&&isFinite(n)&&isFinite(r)&&(this._center=void 0,this._scale=void 0,this._zoom=void 0,this._extent=o,this._setViewExtent(o,e))}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}}goTo(t={},e={}){let i=new Promise(t=>{t(!1)});if(this._innerView){let{center:r,zoom:o,extent:s}=this._getValidGoToParams(t,e);Object(n.isNull)(r)||(this._center=r),Object(n.isNull)(o)||(this._scale=this._getScaleByZoom(o),this._zoom=void 0),Object(n.isNull)(t.scale)||(this._scale=t.scale),Object(n.isNull)(s)||(this._center=void 0,this._scale=void 0,this._zoom=void 0,this._extent=s);const a={animate:!0,duration:200};if(!Object(n.isNull)(e)){const t=Object(n.defaultValue)(e.animate,!0);a.animate=t,t?Object(n.isNull)(e.duration)||(a.duration=e.duration/1e3):a.duration=0}if(this._zoomSnap>B&&(this._innerView.options.zoomSnap=B),this._zoomDelta>B&&(this._innerView.options.zoomDelta=B),Object(n.isNull)(r)||Object(n.isNull)(o)){if(!Object(n.isNull)(s)){let t=s.xmin,e=s.xmax,n=s.ymin,r=s.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),e>this._fullExtent.xmax&&(e=this._fullExtent.xmax),n<this._fullExtent.ymin&&(n=this._fullExtent.ymin),r>this._fullExtent.ymax&&(r=this._fullExtent.ymax)),isFinite(t)&&isFinite(e)&&isFinite(n)&&isFinite(r)&&(i=this._setViewExtent(s,a))}}else{let t=r.coordinates[1],e=r.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(e>this._fullExtent.xmax||e<this._fullExtent.xmin)&&(e=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(e)){let s=!1;const l=this._innerView.getCenter();if(o===this._zoom&&t===l.lat&&e===l.lng&&(s=!0),s)return i;let h;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(h=this._innerView._limitCenter({lat:t,lng:e},o,this._innerView.options.maxBounds)),h&&h.lat!==t&&h.lat!==e?n.Log.warning(`中心点${r}、层级${o}的视图,范围超过最大视图范围!`):i=new Promise(i=>{this._innerView.setView([t,e],o,a),this._innerView.once("moveend",()=>{i(!0)})})}}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}return i}_getFlyToExtent(t){let e=t.extent;if(!e)return;const i=n.Projection.project(new n.Point({coordinates:[e.xmin,e.ymax],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326")),r=n.Projection.project(new n.Point({coordinates:[e.xmax,e.ymin],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326"));return e=new n.Extent({xmin:i.coordinates[0],ymin:r.coordinates[1],xmax:r.coordinates[0],ymax:i.coordinates[1]})}_setViewExtent(t,e){t.spatialReference&&!t.spatialReference.isGeographic&&(t=n.Projection.project(t,new n.SpatialReference("EPSG:4326")));const i=t.xmin,o=t.ymin,s=t.xmax,a=t.ymax,l=this.getExtent();let h=!1;if(l.ymin===o&&l.xmin===i&&l.ymax===a&&l.xmax===s)h=!0;else{const i=this._innerView.getCenter(),n=this._innerView._getBoundsCenterZoom(r.latLngBounds(r.latLng(t.ymin,t.xmin),r.latLng(t.ymax,t.xmax)));if(n.zoom===this._zoom&&n.center.lat===i.lat&&n.center.lng===i.lng&&(h=!0),!h)return new Promise(t=>{this._innerView.setView([n.center.lat,n.center.lng],n.zoom,e),this._innerView.once("moveend",()=>{t(!0)})})}return new Promise(t=>{t(!1)})}_getLatLngFromExtent(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return{northEastLatlng:new r.latLng(i.ymax,i.xmax),southWestLatlng:new r.latLng(i.ymin,i.xmin)}}_getLatLngFromPoint(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return new r.latLng(i.coordinates[1],i.coordinates[0])}_initViewEvent(){super._initViewEvent();const t=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null,dragMouseUp:!1},this._innerView.on("click",e=>{t._dragParams.dragMouseUp?t._dragParams.dragMouseUp=!1:(t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,Kt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,Kt.getMouseEvent(e,t)))}),this._innerView.on("contextmenu",e=>{t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,Kt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,Kt.getMouseEvent(e,t))}),this._innerView.on("dblclick",e=>{t._clickStore&&(clearTimeout(this._clickStore),t._clickStore=null),t.fire(n.ViewEventType.doubleClick,Kt.getMouseEvent(e,t))}),this._innerView.on("mousedown",e=>{t.fire(n.ViewEventType.pointerDown,Kt.getMouseEvent(e,t)),this._dragParams.isDrag||(this._dragParams.origin={x:e.originalEvent.layerX,y:e.originalEvent.layerY},this._dragParams.button=e.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)}),this._innerView.on("mouseup",e=>{t.fire(n.ViewEventType.pointerUp,Kt.getMouseEvent(e,t)),t._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",this._innerView.dragging._enabled||(t._dragParams.dragMouseUp=!0),t.fire(n.ViewEventType.drag,Kt.getDragEvent(e,t,t._dragParams.origin,this._dragParams.action))),t._dragParams.isDrag=!1,t._dragParams.origin=null,t._dragParams.action="",t._dragParams.button=null}),this._innerView.on("mousemove",e=>{t.fire(n.ViewEventType.pointerMove,Kt.getMouseEvent(e,t)),t._dragParams.isDrag?(t.fire(n.ViewEventType.drag,Kt.getDragEvent(e,t,t._dragParams.origin,t._dragParams.action,t._dragParams.button)),t._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",t._dragParams.isDrag=!0)}),this._innerView.on("keydown",e=>{t.fire(n.ViewEventType.keyDown,Kt.getKeyEvent(e,t,n.ViewEventType.keyDown))}),this._innerView.on("keyup",e=>{t.fire(n.ViewEventType.keyUp,Kt.getKeyEvent(e,t,n.ViewEventType.keyUp))}),this._innerView.on("movestart",()=>{t.stationary=!1}),this._innerView.on("zoom",e=>{t.fire(n.ViewEventType.zoom,{zoom:e.target._zoom,event:e})}),this._innerView.on("zoomend",e=>{t._zoomEndHandler(),t.fire(n.ViewEventType.viewChange,Kt.getViewChangeEvent(e,t))}),this._innerView.on("moveend",e=>{t._moveEndHandler(),t.fire(n.ViewEventType.viewChange,Kt.getViewChangeEvent(e,t)),t.stationary=!0}),this._innerView.on("resize",e=>{t.fire(n.ViewEventType.resize,{oldWidth:e.oldSize.x,oldHeight:e.oldSize.y,width:e.newSize.x,height:e.newSize.y}),t._initSize()}),this.fire(n.ViewEventType.viewCreated,this._innerView)}_mapActionControl(t,e){this._innerView&&("drag-pan"===t?e?this._innerView.dragging.enable():this._innerView.dragging.disable():"double-click-zoom"===t&&(e?this._innerView.doubleClickZoom.enable():this._innerView.doubleClickZoom.disable()))}_initView(t,e){let i;if(t&&e){let t;i={center:t=Object(n.isNull)(e.center)&&Object(n.isNull)(e.extent)?new n.Point({coordinates:[105.1250000000032,24.427133220306196]}):Object(n.isNull)(e.center)?void 0:this._getValidCenter(e.center),scale:Object(n.isNull)(e.scale)&&Object(n.isNull)(e.zoom)?36978669.4318207:e.scale,zoom:e.zoom,target:Object(n.isNull)(e.extent)?void 0:n.Extent.fromJSON(e.extent)},this.minScale=Object(n.defaultValue)(e.minScale,void 0),this.maxScale=Object(n.defaultValue)(e.maxScale,void 0),this.minZoom=Object(n.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(e.maxZoom,void 0)}else this._zoom=void 0,this._extent=void 0,i={center:this._center,scale:this._scale};let{center:o,zoom:s,extent:a}=this._getValidGoToParams(i);Object(n.isNull)(o)||Object(n.isNull)(s)?Object(n.isNull)(a)||(this._extent=a):(this._center=o,this._zoom=s);const l=this._getMaxBounds();let h={preferCanvas:this.preferCanvas,attributionControl:Object(n.defaultValue)(e.attributionControl,!1),zoomControl:Object(n.defaultValue)(e.zoomControl,!0),doubleClickZoom:Object(n.defaultValue)(e.doubleClickZoom,!0),dragging:Object(n.defaultValue)(e.dragging,!0),zoomSnap:this._zoomSnap,zoomDelta:this._zoomDelta,trackResize:Object(n.defaultValue)(e.trackResize,!0),keyboard:Object(n.defaultValue)(e.keyboard,!0),keyboardPanDelta:Object(n.defaultValue)(e.keyboardPanDelta,80),scrollWheelZoom:Object(n.defaultValue)(e.scrollWheelZoom,!0),wheelDebounceTime:Object(n.defaultValue)(e.wheelDebounceTime,40),wheelPxPerZoomLevel:Object(n.defaultValue)(e.wheelDebounceTime,60),tapHold:Object(n.defaultValue)(e.tapHold,!0),tapTolerance:Object(n.defaultValue)(e.tapTolerance,15),touchZoom:Object(n.defaultValue)(e.touchZoom,!0),bounceAtZoomLimits:Object(n.defaultValue)(e.bounceAtZoomLimits,!0),crs:this.crs,maxBounds:l,zoomAnimation:this.animation,config:n.Config,rotate:!0,bearing:this._rotation};return this.initialGoTo?(Object(n.isNull)(this._center)||Object(n.isNull)(this._center.coordinates)||(h.center=[this._center.coordinates[1],this._center.coordinates[0]]),Object(n.isNull)(this._zoom)||(h.zoom=this._zoom)):(h.center=[0,0],h.zoom=0),h=Object.assign(h,this.extensionOptions),t&&e&&e.innerView?(this._innerView=e.innerView,this._innerView._container&&(this._viewId=this._innerView._container.id)):this._innerView=r.map(this._viewId,h),this.ui=new Wt({view:this}),this._initViewEvent(),this._initSize(),this._initScaleLimit(),this._initPopup(),this._initCursor(),new Promise(i=>{function r(t,e){if(t.initialGoTo&&e&&t._extent){let e=t._extent;t._extent.spatialReference.isGeographic||(e=n.Projection.project(t._extent.clone(),new n.SpatialReference({wkid:4326}))),t._fullExtent&&(e.xmax>t._fullExtent.xmax||e.ymax>t._fullExtent.ymax||e.xmin<t._fullExtent.xmin||e.ymin<t._fullExtent.ymin)&&(e=t._fullExtent),t.goTo({target:t._extent},{animate:!1})}t._fireLoaded||(t._zoomEndHandler(),t.fire(n.ViewEventType.loaded,{}),t._fireLoaded=!0),i(self)}t&&e&&e.innerView&&(!this.initialGoTo||Object(n.isNull)(this._center)||Object(n.isNull)(this._zoom)?Promise.resolve().then(()=>{r(this,t)}):this.goTo({center:this._center,zoom:this._zoom},{animate:!1}).finally(()=>{r(this,t)})),this._innerView._loaded?Promise.resolve().then(()=>{r(this,t)}):this._innerView.whenReady(()=>{r(this,t)})})}_reCreateView(t){return this._innerView&&(this._innerView._animatingZoom=!1,this._innerView.remove()),t?this._initView(!0,this._options):this._initView(!1,this._options)}_resetExtent(){this._extent&&(this._extent=void 0,this._zoom=Math.max(this.minZoom,0))}_createCrsObject(t){if(t.spatialReference&&t.lods&&t.origin&&t.extent)return new l({wkid:t.spatialReference.wkid,wkt:t.spatialReference.wkt,lods:t.lods,origin:t.origin,unit:t.spatialReference.isGeographic?"degree":void 0,extent:t.extent})}_processEvent(t){super._processEvent(t),t.type===n.MapEventType.layerRemove&&(this._map._isRemoveMany||this._map._isRemoveAll||!this._map._canResetView||this._setSpatialReference()),t.type===n.MapEventType.layerRemoveMany&&this._map._canResetView&&t.layers&&this._setSpatialReference()}_initSize(){const t=this._innerView.getSize();this.width=t.x,this.height=t.y}destroy(){this._innerView.remove()}getCenter(){if(Object(n.isNull)(this._innerView))return;const t=this._innerView.getCenter();let e=new n.Point({coordinates:[t.lng,t.lat]});this._center=e;const i=this._spatialReference;return i.isGeographic||(e=n.Projection.project(e,i)),e}setCenter(t){this._innerView&&(Array.isArray(t)&&t.length>1?(this._center=new n.Point({coordinates:[t[0],t[1]],spatialReference:this._spatialReference}),this.flyTo({zoom:this._zoom,center:this._center})):t instanceof n.Point&&(this._center=t,this.flyTo({zoom:this._zoom,center:this._center})))}getZoom(){if(!Object(n.isNull)(this._innerView))return this._zoom=this._innerView.getZoom(),this._zoom}setZoom(t){if(!this._innerView)return;const e=Math.max(this.minZoom,t);this.flyTo({zoom:e,center:this._center})}getMinZoom(){return this._innerView.getMinZoom()}getSize(){return this._innerView.getSize()}getMaxZoom(){return this._innerView.getMaxZoom()}getPixelExtent(){return this._innerView.getPixelBounds()}getPixelCenter(){return this._innerView.getPixelOrigin()}getPixelWorldExtent(){return this._innerView.getPixelWorldBounds()}toJSON(){const t=super.toJSON();return t.extent=Object(n.toJSON)(this._extent,n.Extent),t.animation=this.animation,t.width=this.width,t.height=this.height,t.preferCanvas=this.preferCanvas,t.spatialReferenceLocked=this.spatialReferenceLocked,t}clone(){return Object(n.cloneObject)(this)}static fromJSON(t){return new ni(t)}toMap(t){const e=this._innerView.containerPointToLatLng(t);let i=new n.Point({coordinates:[e.lng,e.lat]});const r=this._spatialReference;return r.isGeographic?i.spatialReference=r:i=n.Projection.project(i,r),i}toScreen(t){let e=n.Geometry.fromJSON(t);return e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._innerView.latLngToContainerPoint([e.coordinates[1],e.coordinates[0]])}takeScreenshot(t){t.view=this;let e=null;return this._screenshot?e=this._screenshot._addView():(this._screenshot=new se(t),e=this._screenshot._addView()),e}getExtent(){if(!this._innerView)return;const t=this._innerView.getGeoBoundsCoord(),e=new n.Extent({xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax,spatialReference:this._spatialReference});return this._extent=e,e}getZoomByExtent(t){let e=0;if(this._innerView){let i=n.Extent.fromJSON(t.toJSON());i.spatialReference.isGeographic||(i=n.Projection.project(i,new n.SpatialReference("EPSG:4326")));const o=r.latLng(i.ymin,i.xmin),s=r.latLng(i.ymax,i.xmax),a=r.latLngBounds(o,s);e=this._innerView.getBoundsZoom(a)}return e}setExtent(t){this._innerView&&(this._extent=t,this.flyTo({extent:t}))}_zoomEndHandler(){this.getExtent(),this.getZoom(),this.getCenter(),this.getScale(),this.getResolution(),this._updateLayerViewScaleVisible()}_moveEndHandler(){this.getCenter(),this.getExtent()}_initScaleLimit(){if(void 0!==this._options.minScale)if(this.minScale>0){const t=this._getZoomByScale(this.minScale);void 0!==t&&this._innerView.setMinZoom(t),this.minZoom=t}else this.minZoom=void 0,this.minScale=0,this._innerView.setMinZoom(this.minZoom);else if(Object(n.isNull)(this._options.minZoom)){const t=this._innerView.getMinZoom();isFinite(t)?(this.minZoom=t,this.minScale=this._getScaleByZoom(this.minZoom)):(this.minZoom=void 0,this.minScale=void 0)}else this.minZoom=this._options.minZoom,this.minScale=this._getScaleByZoom(this.minZoom),this._innerView.setMinZoom(this.minZoom);if(void 0!==this._options.maxScale)if(this.maxScale>0){const t=this._getZoomByScale(this.maxScale);void 0!==t&&this._innerView.setMaxZoom(t),this.maxZoom=t}else this.maxScale<=0&&(this.maxZoom=void 0,this.maxScale=0,this._innerView.setMaxZoom(this.maxZoom));else if(Object(n.isNull)(this._options.maxZoom)){let t=this._innerView.getMaxZoom();const e=((this.crs||{}).options||{}).lods;e&&Array.isArray(e)&&t>=e.length-1&&(t=e.length-1,this._innerView.setMaxZoom(t)),isFinite(t)?(this.maxZoom=t,this.maxScale=this._getScaleByZoom(this.maxZoom)):(this.maxZoom=void 0,this.maxScale=void 0)}else this.maxZoom=this._options.maxZoom,this.maxScale=this._getScaleByZoom(this.maxZoom),this._innerView.setMaxZoom(this.maxZoom);!this._scale||this._scale<=0?this._scale=this.minScale:this._scale>this.minScale?this._scale=this.minScale:this._scale<this.maxScale&&(this._scale=this.maxScale)}_limitZoomByExtent(t){this._innerView.getBoundsZoom(t);this._innerView.options.minZoom=this.minZoom}_getMaxBounds(){return function(t){if(t){const e=r.latLng(t.ymin,t.xmin),i=r.latLng(t.ymax,t.xmax);return r.latLngBounds(e,i)}return null}(this._fullExtent)}_initPopup(){this.popup=new ie({view:this})}hitTest(t){let e=[];return e=this.preferCanvas?this._hitTestCanvas(t):this._hitTestSVG(t)}_hitTestSVG(t){const e=this,i=[],r=this._innerView._container.getBoundingClientRect();document.elementsFromPoint(r.x+t.x,r.y+t.y).forEach(t=>{t&&t._leaflet_id&&t.classList.contains("leaflet-interactive")&&t._leaflet_id&&i.push(e._innerView._targets[t._leaflet_id])});const o=[];return i.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let s=null;if(r.type===n.LayerType.IGSFeature||r.type===n.LayerType.GeoJSON){s=this._getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(s=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:s&&s.items.length>0?s.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};o.push(a)}),o}_hitTestCanvas(t){const e=[],i=this._innerView._renderer,r={clientX:t.x,clientY:t.y},o=i._map.mouseEventToContainerPoint(r);for(let t=i._dragFirst;t;t=t.next){const n=t.layer;n.options.interactive&&n._containsPoint(o)&&("click"!==r.type&&"preclick"!==r.type||!i._map._draggableMoved(n))&&n.feature&&e.push(n)}const s=[];return e.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let o=null;if(r.type===n.LayerType.IGSFeature||r.type===n.LayerType.GeoJSON){o=this.getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(o=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:o.items.length>0?o.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};s.push(a)}),s}_getInnerLayerId(t){let e;const i=function(t){let e,n;for(const r in t){if(void 0!==t[r].commonLayerId){e=t[r].commonLayerId,n=t[r].commonFeatureId;break}{const o=i(t[r]._eventParents);e=o.commonLayerId,n=o.commonFeatureId}}return{commonLayerId:e,commonFeatureId:n}};return e=void 0===t.commonLayerId?i(t._eventParents):{commonLayerId:t.commonLayerId,commonFeatureId:t.commonFeatureId}}_initScale(){this._scale&&this._scale>0&&this.minScale>0&&this.maxScale>0&&this._scale<this.minScale&&this._scale>this.maxScale&&this.setScale()}_getZoomByScale(t){let e=void 0;if(this.crs&&this.crs.options&&this.crs.options.lods){let i=-1;for(let n=0;n<this.crs.options.lods.length;n++){const r=this.crs.options.lods[n],o=this.crs.options.lods[n-1];if(r.scale<=0)break;if(i<0&&(i=n),n===i){if(r.scale>0&&t>=r.scale){e=r.level;break}}else{if(t>=r.scale&&t<=o.scale&&o.scale!==r.scale){e=r.level-(t-r.scale)/(o.scale-r.scale);break}if(n===this.crs.options.lods.length-1&&r.scale>0&&t<=r.scale){e=r.level;break}}}}return e}_getScaleExtent(t){return this._getScaleDefaultExtent(t)}_getScaleDefaultExtent(t){const e=this.getSize(),i=e.x/96*.0254*t,r=e.y/96*.0254*t,o=Math.sqrt(i*i+r*r),s=180/Math.PI*Math.atan2(i,r),a=this._center.coordinates,l=(t,e,i)=>{t=n.T.point(t);return n.T.destination(t,e,i,{units:"kilometers"}).geometry.coordinates},h=l(a,o/2e3,-s),u=l(a,o/2e3,180-s);return new n.Extent({xmin:h[0],xmax:u[0],ymin:u[1],ymax:h[1]})}getScale(){const t=this._getScaleByZoom(this._zoom);return this._scale=t,t}_getScaleByZoom(t){let e;if(this.crs&&this.crs.options&&this.crs.options.lods&&!Object(n.isNull)(t))if(t%1==0){const i=this.crs.options.lods[t];e=i?i.scale:void 0}else{const i=Math.floor(t),n=Math.ceil(t),r=this.crs.options.lods[i],o=this.crs.options.lods[n];e=void 0===r&&void 0===o?0:void 0===r?o.scale:void 0===o?r.scale:r.scale-(r.scale-o.scale)*(t-i)}return e}_getScaleByExtent(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=this._getLatLngFromExtent(t),a=n.T.point([s.southWestLatlng.lng,s.southWestLatlng.lat]),l=n.T.point([s.northEastLatlng.lng,s.northEastLatlng.lat]),h=1e3*n.T.distance(a,l,{units:"kilometers"})/o;return this._scale=h,h}_isEqualBounds(t,e){return t.equals(e)}setScale(t){if(!this._innerView)return;const e=this._getZoomByScale(t);e&&this.flyTo({center:this._center,zoom:e})}getExtentScale(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=n.T.point([t.xmin,t.ymax]),a=n.T.point([t.xmax,t.ymin]),l=1e3*n.T.distance(s,a,{units:"kilometers"})/o;return this._scale=l,l}getResolutionByScale(t){return this._resolution=.0254/96*t,this._resolution}getResolution(){const t=this.getSize(),e=Math.sqrt(t.x*t.x+t.y*t.y),i=this._innerView.getBounds(),r=n.T.point([i._southWest.lng,i._southWest.lat]),o=n.T.point([i._northEast.lng,i._northEast.lat]),s=n.T.distance(r,o,{units:"kilometers"});return this._resolution=1e3*s/e,this._resolution}_moveLayerView(t,e){if(this._isImageLayerView(t)||this._isVectorTileLayerView(t)){const t=this.allLayerViews.toArray();for(let e=0;e<t.length;e++){const i=t[e];(this._isImageLayerView(i)||this._isVectorTileLayerView(i))&&i.innerLayer&&i.innerLayer.setZIndex&&i.innerLayer.setZIndex(e)}}else t instanceof ue&&t._updateGraphicsInOrder()}_createLayerViewObj(t){let e=null;return t&&t.autoAddTo2D&&(e=ii(this,t)),e}_isEqualCrs(t,e){let i=!1;if(!t||!e)return i;let r=void 0;t.code.split(":").length>1&&(r=t.code.split(":")[1]);const o=new n.SpatialReference({wkid:r,wkt:t.def});let s=void 0;e.code.split(":").length>1&&(s=e.code.split(":")[1]);const a=new n.SpatialReference({wkid:s,wkt:e.def});return o.equals(a)&&e.options&&t.options&&Object(n.compareObject)(e.options.lods,t.options.lods)&&Object(n.compareObject)(e.options.origin,t.options.origin)&&Object(n.compareObject)(e.options.bounds,t.options.bounds)&&(i=!0),i}_getValidGoToParams(t,e){let i,r,o;if(Object(n.isNull)(t.center)&&Object(n.isNull)(t.zoom)&&Object(n.isNull)(t.scale)||(i=Object(n.isNull)(t.center)?this._center:this._getFlyToCenter({center:t.center}),r=!Object(n.isNull)(t.scale)&&t.scale>0?this._getZoomByScale(t.scale):Object(n.isNull)(t.zoom)?this._zoom:t.zoom),!Object(n.isNull)(t.target)||!Object(n.isNull)(t.layer)&&!Object(n.isNull)(t.layer.extent))if(t.layer&&n.LayerType.isTileLayer(t.layer.type)&&!Object(n.defined)(i)&&!Object(n.defined)(r)&&"fix-level"===t.goToLayerMode){const e=t.layer.type===n.LayerType.wmts?t.layer.getCurrentTileInfo():t.layer.tileInfo,o=Object(n.getTileLayerNearestCenterAndScale)(e,t.layer.extent,this.width,this.height);i=this._getFlyToCenter({center:o.center}),r=this._getZoomByScale(o.scale)}else{const e=this._getTargetExtent(t.target||t.layer.extent);e.xmin!==e.xmax&&e.ymin!==e.ymax?o=e:i=this._getFlyToCenter({center:new n.Point({coordinates:[e.xmin,e.ymin]})})}return{center:i,zoom:r,extent:o}}}ni.fromJSON=function(t){return t=Object(n.defaultValue)(t,{}),new ni(t)},Object.defineProperties(ni.prototype,{scale:{get(){return this.getScale()},set(t){this.setScale(t)}},zoom:{get(){return this.getZoom()},set(t){this.setZoom(t)}},extent:{get(){return this.getExtent()},set(t){this.setExtent(t)}},center:{get(){return this.getCenter()},set(t){this.setCenter(t)}},spatialReference:{get(){return this._spatialReference},set(){}},rotation:{get(){return this._rotation},set(t){this._rotation=t,this._innerView&&this._innerView.setBearing(t)}}});var ri=ni;var oi=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._container=this._createContainer(e.container),this._visible=Object(n.defaultValue)(e.visible,!0),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!")}_addView(){}_removeView(){}destroy(){}_createContainer(t){let e=t;return"string"==typeof e&&(e=document.getElementById(e)),t instanceof HTMLElement?e:e=document.createElement("div")}};var si=class extends oi{constructor(t){super(t),t=Object(n.defaultValue)(t,{}),this.drawConfig=Object(n.defaultValue)(t.drawConfig,{polygon:{allowIntersection:!1,showArea:!0},circlemarker:!1}),this._complete=Object(n.defaultValue)(t.complete,function(){}),this._drawHandler=null,this._drawTool=null,this._initHandler(),this._initStyles()}_initHandler(){const t=this._view.getInnerView();this._processEvent=this._processEvent.bind(this),t&&t.on(L.Draw.Event.CREATED,this._processEvent)}_initStyles(){this.styles={circle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},marker:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},polygon:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},polyline:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},rectangle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0}}}_removeHandler(){const t=this._view.getInnerView();t&&t.off(L.Draw.Event.CREATED,this._processEvent)}_processEvent(t){if(t&&t.layer){let e,i;const r=t.layer.toGeoJSON();switch(e=r.geometry.type){case"LineString":i=new n.Feature({geometry:new n.LineString({coordinates:r.geometry.coordinates})});break;case"Polygon":i=new n.Feature({geometry:new n.Polygon({coordinates:r.geometry.coordinates})});break;case"Point":let o;o=t.layer._mRadius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._mRadius}):t.layer._radius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._radius}):new n.Point({coordinates:r.geometry.coordinates}),i=new n.Feature({geometry:o})}this._complete(e,i)}}_addView(){super._addView();const t=this._view.getInnerView();if(t&&this._visible){const e=L.featureGroup().addTo(t);this._drawTool=new L.Control.Draw({edit:{featureGroup:e,poly:{allowIntersection:!1}},draw:this.drawConfig}),t.addControl(this._drawTool)}}_removeView(){super._removeView();const t=this._view.getInnerView();t&&this._visible&&(this._removeHandler(),this._drawTool&&(t.removeControl(this._drawTool),this._print=null))}start(t,e){const i=this._view.getInnerView();if(i)switch(this._drawHandler&&this._drawHandler.disable(),t){case"lineString":this._drawHandler=new L.Draw.Polyline(i,{...this.styles.polyline,...e}),this._drawHandler.enable();break;case"polygon":this._drawHandler=new L.Draw.Polygon(i,{...this.styles.polygon,...e}),this._drawHandler.enable();break;case"rectangle":this._drawHandler=new L.Draw.Rectangle(i,{...this.styles.rectangle,...e}),this._drawHandler.enable();break;case"marker":this._drawHandler=new L.Draw.Marker(i,{...this.styles.marker,...e}),this._drawHandler.enable();break;case"circle":this._drawHandler=new L.Draw.Circle(i,{...this.styles.circle,...e}),this._drawHandler.enable()}}end(){this._drawHandler&&(this._drawHandler.disable(),this._drawHandler=null)}destory(){}};var ai=class extends n.SketchEditor{constructor(t){super(t),this._hitTestSketchHandlers=[]}start(t,e){super.start(t,e)}startCustomDrawTool(t){super.startCustomDrawTool(t)}stop(){super.stop()}remove(){super.remove()}update(t,e){super.updateFeature(t,e)}addVertex(t,e){super.addVertex(t,e)}updateVertex(t,e){super.updateVertex(t,e)}removeVertex(t){super.removeVertex(t)}getSketchDataType(){super.getSketchDataType()}setSketchStyle(t){super.setSketchStyle(t)}getSketchStyle(){return super.getSketchStyle()}getGeometry(){return super.getGeometry()}union(t){return super.union(t)}split(t,e){return super.split(t,e)}drawPolylineToPolygon(t){super.drawPolylineToPolygon(t)}undo(){return super.undo()}redo(){return super.redo()}canUndo(){return super.canUndo()}canRedo(){return super.canRedo()}_hitTestSketchEvent(){const t=this,e=e=>{if(!e||!e.x||!e.y)return;if(t._drawTool&&t._drawTool._editMode===n.SketchEditMode.drawing)return;const i=t._getGraphicsLayer(t._layer),r=t._getGraphicsLayer(t._sketchInnerLayer);if(!i&&!r)return;let o=void 0;const s=this.view.hitTest({x:e.x,y:e.y});if(s&&Array.isArray(s)&&(o=s[0]),o&&(i&&i.id===o.layer.id||r&&r.id===o.layer.id)){const i=this._getCurDrawTool(o.layer.id,o.graphic.id);if(!i||i===t._drawTool&&"drawn"!==i.state)return;if(i===t._drawTool&&o.graphic.id===t._drawTool.sketchStage.entityGraphic.id&&t._drawTool._editMode===n.SketchEditMode.editGraphic)return;if(0===i.editOption._hitTestMode){const r=()=>{if(t._editable&&(void 0===t._drawTool||null===t._drawTool||3!==t._drawTool._editMode)){if(!Object(n.isNull)(i)&&Object(n.isNull)(i._parent)&&i._editMode===n.SketchEditMode.none){t.fire("selected",{isSelected:!0,selectedDrawTool:t._drawTool,selectedGeometry:t._drawTool.sketchStage.entityGraphic.geometry},t);const e=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:t,toolEventInfo:null,state:n.SketchEditorState.start,feature:t._drawTool.sketchStage.entityGraphic,geometry:t._drawTool.sketchStage.entityGraphic.geometry});t.fire(n.SketchEditorEventType.update,e)}i._isAddTip&&i._updateTipText(i._tipText.editGraphic,i._sketchInnerLayer,e),i.hitTestFeature(i.sketchStage.entityGraphic,e),t.view.off(n.ViewEventType.mouseUp,r)}};t.view.on(n.ViewEventType.mouseUp,r)}else{if(!t._editable)return;if(void 0!==t._drawTool&&null!==t._drawTool&&3===t._drawTool._editMode)return;i._parent&&i._parent._isAddTip&&i._parent._updateTipText(i._parent._tipText.editVertex,i._parent._sketchInnerLayer),i.hitTestFeature(i.sketchStage.entityGraphic,e)}}};this._hitTestSketchHandler||(this.view.on(n.ViewEventType.mouseDown,e),this._hitTestSketchHandler=e)}_getCurDrawTool(t,e){const i=this;let r=i._drawTool?i._drawTool._getDrawToolByFeatureId(e):void 0;if(!r&&(!i._drawTool||i._drawTool.sketchStage.entityGraphic&&"drawn"===i._drawTool.state)){const o=i.view.getLayer(t).graphics.filter(t=>t.id===e),s=o&&o.items.length>0?o.items[0]:void 0;s&&(i._drawTool&&(i._drawTool._clearEditGraphics(i._drawTool._editMode),i._drawTool.fire("selected",{isSelected:!1},i),i._drawTool.view.off(n.ViewEventType.immediateClick,i._drawTool._mapClickEvent),i._drawTool._fireRemoveSelectEvent(i._drawTool.sketchStage.entityGraphic)),this._addFeatureToSketchEditor(s),i._undoRedoManager.reset(),i._drawTools=[i._drawTool],r=i._drawTool)}return r}_removeHitTestSketchEvent(){this.view.off(n.ViewEventType.mouseDown,this._hitTestSketchHandler)}_getCenterCoordinate(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}},li=function(t,e,i){if(t=t||{},e)for(var n in e){var r=!1;if(i&&i.length)for(var o=0,s=i.length;o<s;o++)if(n===i[o]){r=!0;break}if(!0!==r){var a=e[n];void 0!==a&&"CLASS_NAME"!==n&&"function"!=typeof a&&(t[n]=a)}}return t},hi=function(t,e){if(t=t||{},e){for(var i in e){var n=e[i];void 0!==n&&(t[i]=n)}!("function"==typeof window.Event&&e instanceof window.Event)&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&(t.toString=e.toString)}return t},ui=function(...t){class e{constructor(e){for(var i=0;i<t.length;i++)r(this,new t[i](e))}}for(var i=0;i<t.length;i++){var n=t[i];r(e,n),r(e.prototype,n.prototype),r(e.prototype,new n)}return e;function r(t,e){var i=Object.getOwnPropertyNames(e);Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n++){var r=i[n];if("constructor"!==r&&"prototype"!==r&&"name"!==r&&"length"!==r){let i=Object.getOwnPropertyDescriptor(e,r);window.ActiveXObject?Object.defineProperty(t,r,i||{}):Object.defineProperty(t,r,i)}}}},ci=function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},pi=function(){for(var t="",e=1;e<=32;e++){t+=Math.floor(16*Math.random()).toString(16),8!=e&&12!=e&&16!=e&&20!=e||(t+="-")}return t},fi=function(t,e,i){for(var n in e)mergeItem(t,e,n,i);return t},di=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return(e=new Date).setTime(t.getTime()),e;if(t instanceof Array)return e=t.slice(0);if(t instanceof Object){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=di(t[i]));return e}throw new Error("Unable to copy obj! Its type isn't supported.")};class gi{constructor(){this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=!0,this.hoverable=!0,this.style=null,this.highlightStyle={},this.CLASS_NAME="Zondy.Feature.ShapeParameters"}destroy(){this.refOriginalPosition=null,this.refDataID=null,this.isHoverByRefDataID=null,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=null,this.hoverable=null,this.style=null,this.highlightStyle=null}}class yi extends gi{constructor(t,e){super(t,e),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=6,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Point"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class mi extends gi{constructor(t){super(t),this.pointList=t,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class _i extends gi{constructor(t){super(t),this.pointList=t,this.holePolygonPointLists=null,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Polygon"}destroy(){this.pointList=null,this.holePolygonPointLists=null,super.destroy()}}class vi extends gi{constructor(t,e,i,n){super(t,e,i,n),this.x=isNaN(t)?0:t,this.y=isNaN(t)?0:e,this.width=isNaN(i)?0:i,this.height=isNaN(n)?0:n,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class xi extends gi{constructor(t,e,i,n,r,o,s){super(t,e,i,n,r,o,s),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.startAngle=isNaN(n)?0:n,this.endAngle=isNaN(r)?0:r,this.r0=isNaN(o)?0:o,this.clockWise=s,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Sector"}destroy(){this.x=null,this.y=null,this.r=null,this.startAngle=null,this.endAngle=null,this.r0=null,this.clockWise=null,super.destroy()}}class bi extends gi{constructor(t,e,i){super(t,e,i),this.x=t,this.y=e,this.text=i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class wi extends gi{constructor(t,e,i,n,r,o,s,a,l){super(t,e,i,n,r,o,s,a,l),this.x=t,this.y=e,this.image=i,this.width=n,this.height=r,this.sx=o,this.sy=s,this.sWidth=a,this.sHeight=l,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Image"}destroy(){this.x=null,this.y=null,this.image=null,this.width=null,this.height=null,this.sx=null,this.sy=null,this.sWidth=null,this.sHeight=null,super.destroy()}}class Si extends gi{constructor(t,e,i){super(t,e,i),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class Ei{constructor(){this._handlers={},this.CLASS_NAME="Zondy.LevelRenderer.Eventful"}destroy(){this._handlers=null}one(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!0,ctx:i||this}),this):this}bind(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!1,ctx:i||this}),this):this}unbind(t,e){var i=this._handlers;if(!t)return this._handlers={},this;if(e){if(i[t]){for(var n=[],r=0,o=i[t].length;r<o;r++)i[t][r].h!==e&&n.push(i[t][r]);i[t]=n}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this}dispatch(t){if(this._handlers[t]){var e=arguments,i=e.length;i>3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],r=n.length,o=0;o<r;){switch(i){case 1:n[o].h.call(n[o].ctx);break;case 2:n[o].h.call(n[o].ctx,e[1]);break;case 3:n[o].h.call(n[o].ctx,e[1],e[2]);break;default:n[o].h.apply(n[o].ctx,e)}n[o].one?(n.splice(o,1),r--):o++}}return this}dispatchWithContext(t){if(this._handlers[t]){var e=arguments,i=e.length;i>4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],r=this._handlers[t],o=r.length,s=0;s<o;){switch(i){case 1:r[s].h.call(n);break;case 2:r[s].h.call(n,e[1]);break;case 3:r[s].h.call(n,e[1],e[2]);break;default:r[s].h.apply(n,e)}r[s].one?(r.splice(s,1),o--):s++}}return this}}class Li{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Util"}clone(t){var e=this.BUILTIN_OBJECT;if("object"==typeof t&&null!==t){var i=t;if(t instanceof Array){i=[];for(var n=0,r=t.length;n<r;n++)i[n]=this.clone(t[n])}else if(!e[Object.prototype.toString.call(t)])for(var o in i={},t)t.hasOwnProperty(o)&&(i[o]=this.clone(t[o]));return i}return t}mergeItem(t,e,i,n){var r=this.BUILTIN_OBJECT;e.hasOwnProperty(i)&&("object"!=typeof t[i]||r[Object.prototype.toString.call(t[i])]?!n&&i in t||(t[i]=e[i]):this.merge(t[i],e[i],n))}merge(t,e,i){for(var n in e)this.mergeItem(t,e,n,i);return t}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(t,e){var i,n=this._canvas,r=this._pixelCtx,o=this._width,s=this._height,a=this._offsetX,l=this._offsetY;t+a>o&&(o=t+a+100,n.width=o,i=!0),e+l>s&&(s=e+l+100,n.height=s,i=!0),t<-a&&(o+=a=100*Math.ceil(-t/100),n.width=o,i=!0),e<-l&&(s+=l=100*Math.ceil(-e/100),n.height=s,i=!0),i&&r.translate(a,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}inherits(t,e){var i=t.prototype;function n(){}for(var r in n.prototype=e.prototype,t.prototype=new n,i)t.prototype[r]=i[r];t.constructor=t}}class Ci{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Vector"}create(t,e){var i=new(0,this.ArrayCtor)(2);return i[0]=t||0,i[1]=e||0,i}copy(t,e){return t[0]=e[0],t[1]=e[1],t}set(t,e,i){return t[0]=e,t[1]=i,t}add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}scaleAndAdd(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t}sub(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}len(t){return Math.sqrt(this.lenSquare(t))}lenSquare(t){return t[0]*t[0]+t[1]*t[1]}mul(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}div(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}dot(t,e){return t[0]*e[0]+t[1]*e[1]}scale(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}normalize(t,e){var i=this.len(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}distance(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}distanceSquare(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}negate(t,e){return t[0]=-e[0],t[1]=-e[1],t}lerp(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t}applyTransform(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}min(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}max(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}length(t){return this.len(t)}lengthSquare(t){return this.lenSquare(t)}dist(t,e){return this.distance(t,e)}distSquare(t,e){return this.distanceSquare(t,e)}}class Pi{constructor(){this.vector=new Ci,this.EPSILON=1e-4,this.THREE_SQRT=Math.sqrt(3),this.ONE_THIRD=1/3,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Curve"}isAroundZero(t){return t>-this.EPSILON&&t<this.EPSILON}isNotAroundZero(t){return t>this.EPSILON||t<-this.EPSILON}cubicAt(t,e,i,n,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*n+3*o*i)}cubicDerivativeAt(t,e,i,n,r){var o=1-r;return 3*(((e-t)*o+2*(i-e)*r)*o+(n-i)*r*r)}cubicRootAt(t,e,i,n,r,o){var s=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),h=t-r,u=a*a-3*s*l,c=a*l-9*s*h,p=l*l-3*a*h,f=0;if(this.isAroundZero(u)&&this.isAroundZero(c))if(this.isAroundZero(a))o[0]=0;else{let t=-l/a;t>=0&&t<=1&&(o[f++]=t)}else{var d=c*c-4*u*p;if(this.isAroundZero(d)){var g=c/u;let t=-a/s+g,e=-g/2;t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e)}else if(d>0){let t=Math.sqrt(d),e=u*a+1.5*s*(-c+t),i=u*a+1.5*s*(-c-t),n=(-a-((e=e<0?-Math.pow(-e,this.ONE_THIRD):Math.pow(e,this.ONE_THIRD))+(i=i<0?-Math.pow(-i,this.ONE_THIRD):Math.pow(i,this.ONE_THIRD))))/(3*s);n>=0&&n<=1&&(o[f++]=n)}else{var y=(2*u*a-3*s*c)/(2*Math.sqrt(u*u*u)),m=Math.acos(y)/3,_=Math.sqrt(u),v=Math.cos(m);let t=(-a-2*_*v)/(3*s),e=(-a+_*(v+this.THREE_SQRT*Math.sin(m)))/(3*s),i=(-a+_*(v-this.THREE_SQRT*Math.sin(m)))/(3*s);t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e),i>=0&&i<=1&&(o[f++]=i)}}return f}cubicExtrema(t,e,i,n,r){var o=6*i-12*e+6*t,s=9*e+3*n-3*t-9*i,a=3*e-3*t,l=0;if(this.isAroundZero(s)){if(this.isNotAroundZero(o)){let t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{var h=o*o-4*s*a;if(this.isAroundZero(h))r[0]=-o/(2*s);else if(h>0){let t=Math.sqrt(h),e=(-o+t)/(2*s),i=(-o-t)/(2*s);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}cubicSubdivide(t,e,i,n,r,o){var s=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,h=(a-s)*r+s,u=(l-a)*r+a,c=(u-h)*r+h;o[0]=t,o[1]=s,o[2]=h,o[3]=c,o[4]=c,o[5]=u,o[6]=l,o[7]=n}cubicProjectPoint(t,e,i,n,r,o,s,a,l,h,u){var c,p=this.vector.create(),f=this.vector.create(),d=this.vector.create(),g=.005,y=1/0;p[0]=l,p[1]=h;for(let l=0;l<1;l+=.05){f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let h=this.vector.distSquare(p,f);h<y&&(c=l,y=h)}y=1/0;for(let l=0;l<32&&!(g<this.EPSILON);l++){let l=c-g,h=c+g;f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let u=this.vector.distSquare(f,p);if(l>=0&&u<y)c=l,y=u;else{d[0]=this.cubicAt(t,i,r,s,h),d[1]=this.cubicAt(e,n,o,a,h);let l=this.vector.distSquare(d,p);h<=1&&l<y?(c=h,y=l):g*=.5}}return u&&(u[0]=this.cubicAt(t,i,r,s,c),u[1]=this.cubicAt(e,n,o,a,c)),Math.sqrt(y)}quadraticAt(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}quadraticDerivativeAt(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}quadraticRootAt(t,e,i,n,r){var o=t-2*e+i,s=2*(e-t),a=t-n,l=0;if(this.isAroundZero(o)){if(this.isNotAroundZero(s)){var h=-a/s;h>=0&&h<=1&&(r[l++]=h)}}else{var u=s*s-4*o*a;if(this.isAroundZero(u)){let t=-s/(2*o);t>=0&&t<=1&&(r[l++]=t)}else if(u>0){let t=Math.sqrt(u),e=(-s+t)/(2*o),i=(-s-t)/(2*o);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}quadraticExtremum(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}quadraticProjectPoint(t,e,i,n,r,o,s,a,l){var h,u=this.vector.create(),c=this.vector.create(),p=this.vector.create(),f=.005,d=1/0;u[0]=s,u[1]=a;for(let s=0;s<1;s+=.05){c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let a=this.vector.distSquare(u,c);a<d&&(h=s,d=a)}d=1/0;for(let s=0;s<32&&!(f<this.EPSILON);s++){let s=h-f,a=h+f;c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let l=this.vector.distSquare(c,u);if(s>=0&&l<d)h=s,d=l;else{p[0]=this.quadraticAt(t,i,r,a),p[1]=this.quadraticAt(e,n,o,a);let s=this.vector.distSquare(p,u);a<=1&&s<d?(h=a,d=s):f*=.5}}return l&&(l[0]=this.quadraticAt(t,i,r,h),l[1]=this.quadraticAt(e,n,o,h)),Math.sqrt(d)}}class Ii{constructor(){this.util=new Li,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,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"},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Color"}customPalette(t){this.palette=t}resetPalette(){this.palette=this._palette}getColor(t,e){return t|=0,(e=e||this.palette)[t%e.length]}customHighlight(t){this.highlightColor=t}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(t,e,i,n,r,o,s){var a=this.util;this._ctx||(this._ctx=a.getContext());for(var l=this._ctx.createRadialGradient(t,e,i,n,r,o),h=0,u=s.length;h<u;h++)l.addColorStop(s[h][0],s[h][1]);return l.__nonRecursion=!0,l}getLinearGradient(t,e,i,n,r){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var s=this._ctx.createLinearGradient(t,e,i,n),a=0,l=r.length;a<l;a++)s.addColorStop(r[a][0],r[a][1]);return s.__nonRecursion=!0,s}getStepColors(t,e,i){t=this.toRGBA(t),e=this.toRGBA(e),t=this.getData(t);for(var n=[],r=((e=this.getData(e))[0]-t[0])/i,o=(e[1]-t[1])/i,s=(e[2]-t[2])/i,a=(e[3]-t[3])/i,l=0,h=t[0],u=t[1],c=t[2],p=t[3];l<i;l++)n[l]=this.toColor([this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(u),[0,255]),this.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"rgba"),h+=r,u+=o,c+=s,p+=a;return h=e[0],u=e[1],c=e[2],p=e[3],n[l]=this.toColor([h,u,c,p],"rgba"),n}getGradientColors(t,e){var i=[],n=t.length;if(void 0===e&&(e=20),1===n)i=this.getStepColors(t[0],t[0],e);else if(n>1)for(var r=0,o=n-1;r<o;r++){var s=this.getStepColors(t[r],t[r+1],e);r<o-1&&s.pop(),i=i.concat(s)}return i}toColor(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 i=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=i[0],t[2]=i[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(",")+")"}}toArray(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],i=0;return t.replace(/[\d.]+/g,function(t){i<3?t|=0:t=+t,e[i++]=t}),e}convert(t,e){if(!this.isCalculableColor(t))return t;var i=this.getData(t),n=i[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?i=this._HSV_2_RGB(i):t.indexOf("hsl")>-1&&(i=this._HSL_2_RGB(i)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?i=this._RGB_2_HSB(i):e.indexOf("hsl")>-1&&(i=this._RGB_2_HSL(i)),i[3]=n,this.toColor(i,e)}toRGBA(t){return this.convert(t,"rgba")}toRGB(t){return this.convert(t,"rgb")}toHex(t){return this.convert(t,"hex")}toHSVA(t){return this.convert(t,"hsva")}toHSV(t){return this.convert(t,"hsv")}toHSBA(t){return this.convert(t,"hsba")}toHSB(t){return this.convert(t,"hsb")}toHSLA(t){return this.convert(t,"hsla")}toHSL(t){return this.convert(t,"hsl")}toName(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}trim(t){return String(t).replace(/\s+/g,"")}normalize(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,i=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(i<<4)+i+(n<<4)+n).toString(16).slice(1)}return t}lift(t,e){if(!this.isCalculableColor(t))return t;var i=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),r=0;r<3;r++)n[r]=1===i?n[r]*(1-e)|0:(255-n[r])*e+n[r]|0;return"rgb("+n.join(",")+")"}reverse(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")}mix(t,e,i){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===i&&(i=.5);for(var n=2*(i=1-this.adjust(i,[0,1]))-1,r=this.getData(this.toRGBA(t)),o=this.getData(this.toRGBA(e)),s=r[3]-o[3],a=((n*s==-1?n:(n+s)/(1+n*s))+1)/2,l=1-a,h=[],u=0;u<3;u++)h[u]=r[u]*a+o[u]*l;var c=r[3]*i+o[3]*(1-i);return c=Math.max(0,Math.min(1,c)),1===r[3]&&1===o[3]?this.toColor(h,"rgb"):(h[3]=c,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(t){var e,i,n=(t=this.normalize(t)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var r,o=[];if(n[2])r=[(e=n[2].replace("#","").split(""))[0]+e[1],e[2]+e[3],e[4]+e[5]],o=this.map(r,function(t){return Ii.prototype.adjust.call(this,parseInt(t,16),[0,255])});else if(n[4]){var s=n[4].split(",");i=s[3],r=s.slice(0,3),o=this.map(r,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),Ii.prototype.adjust.call(this,t,[0,255])}),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}else if(n[5]||n[6]){var a=(n[5]||n[6]).split(","),l=parseInt(a[0],0)/360,h=a[1],u=a[2];i=a[3],(o=this.map([h,u],function(t){return Ii.prototype.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(l),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}return o}alpha(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var i=this.getData(this.toRGBA(t));return i[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(i,"rgba")}map(t,e){if("function"!=typeof e)throw new TypeError;for(var i=t?t.length:0,n=0;n<i;n++)t[n]=e(t[n]);return t}adjust(t,e){return t<=e[0]?t=e[0]:t>=e[1]&&(t=e[1]),t}isCalculableColor(t){return t instanceof Array||"string"==typeof t}_HSV_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a=6*r;6===a&&(a=0);var l=0|a,h=s*(1-o),u=s*(1-o*(a-l)),c=s*(1-o*(1-(a-l))),p=0,f=0,d=0;0===l?(p=s,f=c,d=h):1===l?(p=u,f=s,d=h):2===l?(p=h,f=s,d=c):3===l?(p=h,f=u,d=s):4===l?(p=c,f=h,d=s):(p=s,f=h,d=u),e=255*p,i=255*f,n=255*d}return[e,i,n]}_HSL_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a,l=2*s-(a=s<.5?s*(1+o):s+o-o*s);e=255*this._HUE_2_RGB(l,a,r+1/3),i=255*this._HUE_2_RGB(l,a,r),n=255*this._HUE_2_RGB(l,a,r-1/3)}return[e,i,n]}_HUE_2_RGB(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?t+6*(e-t)*i:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}_RGB_2_HSB(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=a;if(0===l)e=0,i=0;else{i=l/a;var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}_RGB_2_HSL(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=(a+s)/2;if(0===l)e=0,i=0;else{i=h<.5?l/(a+s):l/(2-a-s);var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}}class Mi{static SUtil_smoothBezier(t,e,i,n,r){r&&2===r||(r=[0,0]);var o,s,a=r,l=[],h=[],u=[],c=[],p=!!n;if(p){o=[1/0,1/0],s=[-1/0,-1/0];let e=t.length;for(let i=0;i<e;i++)Mi.Util_vector.min(o,o,[t[i][0]+a[0],t[i][1]+a[1]]),Mi.Util_vector.max(s,s,[t[i][0]+a[0],t[i][1]+a[1]]);Mi.Util_vector.min(o,o,n[0]),Mi.Util_vector.max(s,s,n[1])}let f=t.length;for(let n=0;n<f;n++){let r,d,g=[t[n][0]+a[0],t[n][1]+a[1]];if(i)r=[t[n?n-1:f-1][0]+a[0],t[n?n-1:f-1][1]+a[1]],d=[t[(n+1)%f][0]+a[0],t[(n+1)%f][1]+a[1]];else{if(0===n||n===f-1){l.push([t[n][0]+a[0],t[n][1]+a[1]]);continue}r=[t[n-1][0]+a[0],t[n-1][1]+a[1]],d=[t[n+1][0]+a[0],t[n+1][1]+a[1]]}Mi.Util_vector.sub(h,d,r),Mi.Util_vector.scale(h,h,e);let y=Mi.Util_vector.distance(g,r),m=Mi.Util_vector.distance(g,d),_=y+m;0!==_&&(y/=_,m/=_),Mi.Util_vector.scale(u,h,-y),Mi.Util_vector.scale(c,h,m);let v=Mi.Util_vector.add([],g,u),x=Mi.Util_vector.add([],g,c);p&&(Mi.Util_vector.max(v,v,o),Mi.Util_vector.min(v,v,s),Mi.Util_vector.max(x,x,o),Mi.Util_vector.min(x,x,s)),l.push(v),l.push(x)}return i&&l.push(l.shift()),l}static SUtil_smoothSpline(t,e,i,n){n&&2===n||(n=[0,0]);var r=n,o=t.length,s=[],a=0;for(let e=1;e<o;e++)a+=Mi.Util_vector.distance([t[e-1][0]+r[0],t[e-1][1]+r[1]],[t[e][0]+r[0],t[e][1]+r[1]]);var l=a/5;l=l<o?o:l;for(let i=0;i<l;i++){let n,a,u,c=i/(l-1)*(e?o:o-1),p=Math.floor(c),f=c-p,d=[t[p%o][0]+r[0],t[p%o][1]+r[1]];e?(n=[t[(p-1+o)%o][0]+r[0],t[(p-1+o)%o][1]+r[1]],a=[t[(p+1)%o][0]+r[0],t[(p+1)%o][1]+r[1]],u=[t[(p+2)%o][0]+r[0],t[(p+2)%o][1]+r[1]]):(n=[t[0===p?p:p-1][0]+r[0],t[0===p?p:p-1][1]+r[1]],a=[t[p>o-2?o-1:p+1][0]+r[0],t[p>o-2?o-1:p+1][1]+r[1]],u=[t[p>o-3?o-1:p+2][0]+r[0],t[p>o-3?o-1:p+2][1]+r[1]]);let g=f*f,y=f*g;s.push([h(n[0],d[0],a[0],u[0],f,g,y),h(n[1],d[1],a[1],u[1],f,g,y)])}return s;function h(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}}static SUtil_dashedLineTo(t,e,i,n,r,o,s){var a=[5,5];if(o="number"!=typeof o?5:o,t.setLineDash)return a[0]=o,a[1]=o,s&&s instanceof Array?t.setLineDash(s):t.setLineDash(a),t.moveTo(e,i),void t.lineTo(n,r);var l=n-e,h=r-i,u=Math.floor(Math.sqrt(l*l+h*h)/o);l/=u,h/=u;for(var c=!0,p=0;p<u;++p)c?t.moveTo(e,i):t.lineTo(e,i),c=!c,e+=l,i+=h;t.lineTo(n,r)}}Mi.Util_area=new class{constructor(){this.util=new Li,this.curve=new Pi,this._ctx=null,this._textWidthCache={},this._textHeightCache={},this._textWidthCacheCounter=0,this._textHeightCacheCounter=0,this.TEXT_CACHE_MAX=5e3,this.PI2=2*Math.PI,this.roots=[-1,-1,-1],this.extrema=[-1,-1],this.CLASS_NAME="Zondy.LevelRenderer.Tool.Area"}normalizeRadian(t){return(t%=this.PI2)<0&&(t+=this.PI2),t}isInside(t,e,i,n){if(!e||!t)return!1;var r=t.type;this._ctx=this._ctx||this.util.getContext();var o=this._mathMethod(t,e,i,n);if(void 0!==o)return o;if(t.buildPath&&this._ctx.isPointInPath)return this._buildPathMethod(t,this._ctx,e,i,n);switch(r){case"ellipse":case"smicellipse":return!0;case"trochoid":var s="out"===e.location?e.r1+e.r2+e.d:e.r1-e.r2+e.d;return this.isInsideCircle(e,i,n,s);case"rose":return this.isInsideCircle(e,i,n,e.maxr);default:return!1}}_mathMethod(t,e,i,n){switch(t.type){case"bezier-curve":return void 0===e.cpX2?this.isInsideQuadraticStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.xEnd,e.yEnd,e.lineWidth,i,n):this.isInsideCubicStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.cpX2,e.cpY2,e.xEnd,e.yEnd,e.lineWidth,i,n);case"line":return this.isInsideLine(e.xStart,e.yStart,e.xEnd,e.yEnd,e.lineWidth,i,n);case"broken-line":return this.isInsideBrokenLine(e.pointList,e.lineWidth,i,n);case"smicbroken-line":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideBrokenLine(e.pointList,e.lineWidth,r,o)}case"ring":return this.isInsideRing(e.x,e.y,e.r0,e.r,i,n);case"smicring":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRing(r,o,e.r0,e.r,i,n)}case"circle":return this.isInsideCircle(e.x,e.y,e.r,i,n);case"smicpoint":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideCircle(e.x,e.y,e.r,r,o)}case"sector":{let t=e.startAngle*Math.PI/180,r=e.endAngle*Math.PI/180;return e.clockWise||(t=-t,r=-r),this.isInsideSector(e.x,e.y,e.r0,e.r,t,r,!e.clockWise,i,n)}case"smicsector":{let r=e.startAngle*Math.PI/180,o=e.endAngle*Math.PI/180;e.clockWise||(r=-r,o=-o);let s=e.x,a=e.y;return t.refOriginalPosition&&(s=e.x+t.refOriginalPosition[0],a=e.y+t.refOriginalPosition[1]),this.isInsideSector(s,a,e.r0,e.r,r,o,!e.clockWise,i,n)}case"path":return this.isInsidePath(e.pathArray,Math.max(e.lineWidth,5),e.brushType,i,n);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(e.pointList,i,n);case"smicpolygon":{let u=i,c=n;if(t.refOriginalPosition&&(u=i-t.refOriginalPosition[0],c=n-t.refOriginalPosition[1]),t.holePolygonPointLists&&t.holePolygonPointLists.length>0){for(var r=this.isInsidePolygon(e.pointList,u,c),o=t.holePolygonPointLists,s=!1,a=0,l=o.length;a<l;a++){var h=o[a];!0===this.isInsidePolygon(h,u,c)&&(s=!0)}return!0===r&&!1===s}return this.isInsidePolygon(e.pointList,u,c)}case"text":var u=e.__rect||t.getRect(e);return this.isInsideRect(u.x,u.y,u.width,u.height,i,n);case"smictext":var c=t.getTextBackground(e);return this.isInsidePolygon(c,i,n);case"rectangle":case"image":return this.isInsideRect(e.x,e.y,e.width,e.height,i,n);case"smicimage":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRect(r,o,e.width,e.height,i,n)}}}_buildPathMethod(t,e,i,n,r){return e.beginPath(),t.buildPath(e,i),e.closePath(),e.isPointInPath(n,r)}isOutside(t,e,i,n){return!this.isInside(t,e,i,n)}isInsideLine(t,e,i,n,r,o,s){if(0===r)return!1;var a=Math.max(r,5),l=0;if(s>e+a&&s>n+a||s<e-a&&s<n-a||o>t+a&&o>i+a||o<t-a&&o<i-a)return!1;if(t===i)return Math.abs(o-t)<=a/2;var h=(l=(e-n)/(t-i))*o-s+(t*n-i*e)/(t-i);return h*h/(l*l+1)<=a/2*a/2}isInsideCubicStroke(t,e,i,n,r,o,s,a,l,h,u){if(0===l)return!1;var c=Math.max(l,5);return!(u>e+c&&u>n+c&&u>o+c&&u>a+c||u<e-c&&u<n-c&&u<o-c&&u<a-c||h>t+c&&h>i+c&&h>r+c&&h>s+c||h<t-c&&h<i-c&&h<r-c&&h<s-c)&&this.curve.cubicProjectPoint(t,e,i,n,r,o,s,a,h,u,null)<=c/2}isInsideQuadraticStroke(t,e,i,n,r,o,s,a,l){if(0===s)return!1;var h=Math.max(s,5);return!(l>e+h&&l>n+h&&l>o+h||l<e-h&&l<n-h&&l<o-h||a>t+h&&a>i+h&&a>r+h||a<t-h&&a<i-h&&a<r-h)&&this.curve.quadraticProjectPoint(t,e,i,n,r,o,a,l,null)<=h/2}isInsideArcStroke(t,e,i,n,r,o,s,a,l){var h=this.PI2;if(0===s)return!1;var u=Math.max(s,5);a-=t,l-=e;var c=Math.sqrt(a*a+l*l);if(c-u>i||c+u<i)return!1;if(Math.abs(n-r)>=h)return!0;if(o){var p=n;n=this.normalizeRadian(r),r=this.normalizeRadian(p)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var f=Math.atan2(l,a);return f<0&&(f+=h),f>=n&&f<=r||f+h>=n&&f+h<=r}isInsideBrokenLine(t,e,i,n){for(var r=Math.max(e,10),o=0,s=t.length-1;o<s;o++){var a=t[o][0],l=t[o][1],h=t[o+1][0],u=t[o+1][1];if(this.isInsideLine(a,l,h,u,r,i,n))return!0}return!1}isInsideRing(t,e,i,n,r,o){var s=(r-t)*(r-t)+(o-e)*(o-e);return s<n*n&&s>i*i}isInsideRect(t,e,i,n,r,o){return r>=t&&r<=t+i&&o>=e&&o<=e+n}isInsideCircle(t,e,i,n,r){return(n-t)*(n-t)+(r-e)*(r-e)<i*i}isInsideSector(t,e,i,n,r,o,s,a,l){return this.isInsideArcStroke(t,e,(i+n)/2,r,o,s,n-i,a,l)}isInsidePolygon(t,e,i){for(var n=t.length,r=0,o=0,s=n-1;o<n;o++){var a=t[s][0],l=t[s][1],h=t[o][0],u=t[o][1];r+=this.windingLine(a,l,h,u,e,i),s=o}return 0!==r}windingLine(t,e,i,n,r,o){return o>e&&o>n||o<e&&o<n?0:n==e?0:(o-e)/(n-e)*(i-t)+t>r?n<e?1:-1:0}swapExtrema(){var t=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=t}windingCubic(t,e,i,n,r,o,s,a,l,h){var u=this.curve,c=this.roots,p=this.extrema;if(h>e&&h>n&&h>o&&h>a||h<e&&h<n&&h<o&&h<a)return 0;var f=u.cubicRootAt(e,n,o,a,h,c);if(0===f)return 0;for(var d,g,y=0,m=-1,_=0;_<f;_++){var v=c[_];u.cubicAt(t,i,r,s,v)<l||(m<0&&(m=u.cubicExtrema(e,n,o,a,p),p[1]<p[0]&&m>1&&this.swapExtrema(),d=u.cubicAt(e,n,o,a,p[0]),m>1&&(g=u.cubicAt(e,n,o,a,p[1]))),2===m?v<p[0]?y+=d<e?1:-1:v<p[1]?y+=g<d?1:-1:y+=a<g?1:-1:v<p[0]?y+=d<e?1:-1:y+=a<d?1:-1)}return y}windingQuadratic(t,e,i,n,r,o,s,a){var l=this.curve,h=this.roots;if(a>e&&a>n&&a>o||a<e&&a<n&&a<o)return 0;var u=l.quadraticRootAt(e,n,o,a,h);if(0===u)return 0;var c=l.quadraticExtremum(e,n,o);if(c>=0&&c<=1){var p=0,f=l.quadraticAt(e,n,o,c);for(let n=0;n<u;n++)l.quadraticAt(t,i,r,h[n])>s||(h[n]<c?p+=f<e?1:-1:p+=o<f?1:-1);return p}return l.quadraticAt(t,i,r,h[0])>s?0:o<e?1:-1}windingArc(t,e,i,n,r,o,s,a){var l=this.roots,h=this.PI2;if((a-=e)>i||a<-i)return 0;let u=Math.sqrt(i*i-a*a);if(l[0]=-u,l[1]=u,Math.abs(n-r)>=h){n=0,r=h;var c=o?1:-1;return s>=l[0]+t&&s<=l[1]+t?c:0}if(o){let t=n;n=this.normalizeRadian(r),r=this.normalizeRadian(t)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var p=0;for(let e=0;e<2;e++){var f=l[e];if(f+t>s){let t=Math.atan2(a,f),e=o?1:-1;t<0&&(t=h+t),(t>=n&&t<=r||t+h>=n&&t+h<=r)&&(t>Math.PI/2&&t<1.5*Math.PI&&(e=-e),p+=e)}}return p}isInsidePath(t,e,i,n,r){for(var o=0,s=0,a=0,l=0,h=0,u=!0,c=!0,p="stroke"===(i=i||"fill")||"both"===i,f="fill"===i||"both"===i,d=0;d<t.length;d++){var g=t[d],y=g.points;if(u||"M"===g.command){if(d>0&&(f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o))return!0;l=y[y.length-2],h=y[y.length-1],u=!1,c&&"A"!==g.command&&(c=!1,s=l,a=h)}switch(g.command){case"M":s=y[0],a=y[1];break;case"L":if(p&&this.isInsideLine(s,a,y[0],y[1],e,n,r))return!0;f&&(o+=this.windingLine(s,a,y[0],y[1],n,r)),s=y[0],a=y[1];break;case"C":if(p&&this.isInsideCubicStroke(s,a,y[0],y[1],y[2],y[3],y[4],y[5],e,n,r))return!0;f&&(o+=this.windingCubic(s,a,y[0],y[1],y[2],y[3],y[4],y[5],n,r)),s=y[4],a=y[5];break;case"Q":if(p&&this.isInsideQuadraticStroke(s,a,y[0],y[1],y[2],y[3],e,n,r))return!0;f&&(o+=this.windingQuadratic(s,a,y[0],y[1],y[2],y[3],n,r)),s=y[2],a=y[3];break;case"A":var m=y[0],_=y[1],v=y[2],x=y[3],b=y[4],w=y[5],S=Math.cos(b)*v+m,E=Math.sin(b)*x+_;c?(c=!1,l=S,h=E):o+=this.windingLine(s,a,S,E);var L=(n-m)*x/v+m;if(p&&this.isInsideArcStroke(m,_,x,b,b+w,1-y[7],e,L,r))return!0;f&&(o+=this.windingArc(m,_,x,b,b+w,1-y[7],L,r)),s=Math.cos(b+w)*v+m,a=Math.sin(b+w)*x+_;break;case"z":if(p&&this.isInsideLine(s,a,l,h,e,n,r))return!0;u=!0}}return f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o}getTextWidth(t,e){var i=t+":"+e;if(this._textWidthCache[i])return this._textWidthCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,r=0,o=(t=(t+"").split("\n")).length;r<o;r++)n=Math.max(this._ctx.measureText(t[r]).width,n);return this._ctx.restore(),this._textWidthCache[i]=n,++this._textWidthCacheCounter>this.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}getTextHeight(t,e){var i=t+":"+e;if(this._textHeightCache[i])return this._textHeightCache[i];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[i]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}},Mi.Util_color=new Ii,Mi.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="Zondy.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(t,e,i){if(0!==t.length){for(var n=t[0][0],r=t[0][0],o=t[0][1],s=t[0][1],a=1;a<t.length;a++){var l=t[a];l[0]<n&&(n=l[0]),l[0]>r&&(r=l[0]),l[1]<o&&(o=l[1]),l[1]>s&&(s=l[1])}e[0]=n,e[1]=o,i[0]=r,i[1]=s}}cubeBezier(t,e,i,n,r,o){var s=new Pi,a=[];s.cubicExtrema(t[0],e[0],i[0],n[0],a);for(let r=0;r<a.length;r++)a[r]=s.cubicAt(t[0],e[0],i[0],n[0],a[r]);var l=[];s.cubicExtrema(t[1],e[1],i[1],n[1],l);for(let r=0;r<l.length;r++)l[r]=s.cubicAt(t[1],e[1],i[1],n[1],l[r]);a.push(t[0],n[0]),l.push(t[1],n[1]);var h=Math.min.apply(null,a),u=Math.max.apply(null,a),c=Math.min.apply(null,l),p=Math.max.apply(null,l);r[0]=h,r[1]=c,o[0]=u,o[1]=p}quadraticBezier(t,e,i,n,r){var o=new Pi,s=o.quadraticExtremum(t[0],e[0],i[0]),a=o.quadraticExtremum(t[1],e[1],i[1]),l=1-(s=Math.max(Math.min(s,1),0)),h=1-(a=Math.max(Math.min(a,1),0)),u=l*l*t[0]+2*l*s*e[0]+s*s*i[0],c=l*l*t[1]+2*l*s*e[1]+s*s*i[1],p=h*h*t[0]+2*h*a*e[0]+a*a*i[0],f=h*h*t[1]+2*h*a*e[1]+a*a*i[1];n[0]=Math.min(t[0],i[0],u,p),n[1]=Math.min(t[1],i[1],c,f),r[0]=Math.max(t[0],i[0],u,p),r[1]=Math.max(t[1],i[1],c,f)}arc(t,e,i,n,r,o,s,a){var l=new Ci,h=l.create(),u=l.create(),c=l.create();if(h[0]=Math.cos(n)*i+t,h[1]=Math.sin(n)*i+e,u[0]=Math.cos(r)*i+t,u[1]=Math.sin(r)*i+e,l.min(s,h,u),l.max(a,h,u),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(r%=2*Math.PI)<0&&(r+=2*Math.PI),n>r&&!o?r+=2*Math.PI:n<r&&o&&(n+=2*Math.PI),o){var p=r;r=n,n=p}for(var f=0;f<r;f+=Math.PI/2)f>n&&(c[0]=Math.cos(f)*i+t,c[1]=Math.sin(f)*i+e,l.min(s,c,s),l.max(a,c,a))}},Mi.Util_curve=new Pi,Mi.Util_env=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Env";var t=this;return function(e){var i=t.os={},n=t.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),o=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),a=e.match(/(iPod)(.*OS\s([\d_]+))?/),l=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),h=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),u=h&&e.match(/TouchPad/),c=e.match(/Kindle\/([\d.]+)/),p=e.match(/Silk\/([\d._]+)/),f=e.match(/(BlackBerry).*Version\/([\d.]+)/),d=e.match(/(BB10).*Version\/([\d.]+)/),g=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),y=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),_=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),x=r&&e.match(/Mobile\//)&&!m,b=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m;return(n.webkit=!!r)&&(n.version=r[1]),o&&(i.android=!0,i.version=o[2]),l&&!a&&(i.ios=i.iphone=!0,i.version=l[2].replace(/_/g,".")),s&&(i.ios=i.ipad=!0,i.version=s[2].replace(/_/g,".")),a&&(i.ios=i.ipod=!0,i.version=a[3]?a[3].replace(/_/g,"."):null),h&&(i.webos=!0,i.version=h[2]),u&&(i.touchpad=!0),f&&(i.blackberry=!0,i.version=f[2]),d&&(i.bb10=!0,i.version=d[2]),g&&(i.rimtabletos=!0,i.version=g[2]),y&&(n.playbook=!0),c&&(i.kindle=!0,i.version=c[1]),p&&(n.silk=!0,n.version=p[1]),!p&&i.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),_&&(n.firefox=!0,n.version=_[1]),v&&(n.ie=!0,n.version=v[1]),x&&(e.match(/Safari/)||i.ios)&&(n.safari=!0),b&&(n.webview=!0),v&&(n.ie=!0,n.version=v[1]),i.tablet=!!(s||y||o&&!e.match(/Mobile/)||_&&e.match(/Tablet/)||v&&!e.match(/Phone/)&&e.match(/Touch/)),i.phone=!(i.tablet||i.ipod||!(o||l||h||f||d||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||_&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:n,os:i,canvasSupported:!!document.createElement("canvas").getContext}}(navigator.userAgent)}destory(){return!0}},Mi.Util_event=new class{constructor(){this.stop="function"==typeof window.addEventListener?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Event"}getX(t){return void 0!==t.zrenderX&&t.zrenderX||void 0!==t.offsetX&&t.offsetX||void 0!==t.layerX&&t.layerX||void 0!==t.clientX&&t.clientX}getY(t){return void 0!==t.zrenderY&&t.zrenderY||void 0!==t.offsetY&&t.offsetY||void 0!==t.layerY&&t.layerY||void 0!==t.clientY&&t.clientY}getDelta(t){return void 0!==t.zrenderDelta&&t.zrenderDelta||void 0!==t.wheelDelta&&t.wheelDelta||void 0!==t.detail&&-t.detail}},Mi.Util_http=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Http"}get(t,e,i){if("object"==typeof t){var n=t;t=n.url,e=n.onsuccess,i=n.onerror}var r=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");r.open("GET",t,!0),r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||304===r.status?e&&e(r.responseText):i&&i(),r.onreadystatechange=new Function,r=null)},r.send(null)}},Mi.Util_math=new class{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Math"}sin(t,e){return window.Math.sin(e?t*this._radians:t)}cos(t,e){return window.Math.cos(e?t*this._radians:t)}degreeToRadian(t){return t*this._radians}radianToDegree(t){return t/this._radians}},Mi.Util_matrix=new class{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Matrix"}create(){var t=new(0,this.ArrayCtor)(6);return this.identity(t),t}identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}copy(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}mul(t,e,i){return t[0]=e[0]*i[0]+e[2]*i[1],t[1]=e[1]*i[0]+e[3]*i[1],t[2]=e[0]*i[2]+e[2]*i[3],t[3]=e[1]*i[2]+e[3]*i[3],t[4]=e[0]*i[4]+e[2]*i[5]+e[4],t[5]=e[1]*i[4]+e[3]*i[5]+e[5],t}translate(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}rotate(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5],h=Math.sin(i),u=Math.cos(i);return t[0]=n*u+s*h,t[1]=-n*h+s*u,t[2]=r*u+a*h,t[3]=-r*h+u*a,t[4]=u*o+h*l,t[5]=u*l-h*o,t}scale(t,e,i){var n=i[0],r=i[1];return t[0]=e[0]*n,t[1]=e[1]*r,t[2]=e[2]*n,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*r,t}invert(t,e){var i=e[0],n=e[2],r=e[4],o=e[1],s=e[3],a=e[5],l=i*s-o*n;return l?(l=1/l,t[0]=s*l,t[1]=-o*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*a-s*r)*l,t[5]=(o*r-i*a)*l,t):null}mulVector(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5];return t[0]=i[0]*n+i[1]*r+o,t[1]=i[0]*s+i[1]*a+l,t}},Mi.Util=new Li,Mi.Util_vector=new Ci;class Ti{constructor(){this.position=[0,0],this.rotation=[0,0,0],this.scale=[1,1,0,0],this.needLocalTransform=!1,this.needTransform=!1,this.CLASS_NAME="Zondy.LevelRenderer.Transformable",this.lookAt=function(){var t=Mi.Util_vector.create();return function(e){this.transform||(this.transform=Mi.Util_matrix.create());var i=this.transform;function n(t){return t>-5e-5&&t<5e-5}Mi.Util_vector.sub(t,e,this.position),n(t[0])&&n(t[1])||(Mi.Util_vector.normalize(t,t),i[2]=t[0]*this.scale[1],i[3]=t[1]*this.scale[1],i[0]=t[1]*this.scale[0],i[1]=-t[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform())}}()}destroy(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}updateNeedTransform(){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)}updateTransform(){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||Mi.Util_matrix.create();if(Mi.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;let n=i(t[0])||i(t[1]);n&&Mi.Util_matrix.translate(e,e,t),Mi.Util_matrix.scale(e,e,this.scale),n&&(t[0]=-t[0],t[1]=-t[1],Mi.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;let n=i(t[0])||i(t[1]);n&&Mi.Util_matrix.translate(e,e,t),Mi.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],Mi.Util_matrix.translate(e,e,t))}}else 0!==this.rotation&&Mi.Util_matrix.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&Mi.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Mi.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Mi.Util_matrix.copy(this.transform,this.parent.transform))}function i(t){return t>5e-5||t<-5e-5}}setTransform(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}decomposeTransform(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],i=this.position,n=this.scale,r=this.rotation;s(e-1)&&(e=Math.sqrt(e));var o=t[2]*t[2]+t[3]*t[3];s(o-1)&&(o=Math.sqrt(o)),i[0]=t[4],i[1]=t[5],n[0]=e,n[1]=o,n[2]=n[3]=0,r[0]=Math.atan2(-t[1]/o,t[0]/e),r[1]=r[2]=0}function s(t){return t>5e-5||t<-5e-5}}}class Oi extends(ui(Ei,Ti)){constructor(t){super(t),t=t||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,hi(this,t),this.id=this.id||pi(),this.CLASS_NAME="Zondy.LevelRenderer.Shape",this.getTansform=function(){var t=[];return function(e,i){var n=[e,i];return this.needTransform&&this.transform&&(Mi.Util_matrix.invert(t,this.transform),Mi.Util_matrix.mulVector(n,t,[e,i,1]),e===n[0]&&i===n[1]&&this.updateNeedTransform()),n}}()}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),t.fill(),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}beforeBrush(t,e){var i=this.style;return this.brushTypeOnly&&(i.brushType=this.brushTypeOnly),e&&(i=this.getHighlightStyle(i,this.highlightStyle||{},this.brushTypeOnly)),"stroke"===this.brushTypeOnly&&(i.strokeColor=i.strokeColor||i.color),t.save(),this.doClip(t),this.setContext(t,i),this.setTransform(t),i}afterBrush(t){t.restore()}setContext(t,e){for(var i=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,r=i.length;n<r;n++){var o=e[i[n][0]],s=i[n][1];void 0!==o&&(t[s]=o)}}doClip(t){var e=Mi.Util_matrix.create();if(this.__clipShapes)for(var i=0;i<this.__clipShapes.length;i++){var n=this.__clipShapes[i];if(n.needTransform){let i=n.transform;Mi.Util_matrix.invert(e,i),t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}if(t.beginPath(),n.buildPath(t,n.style),t.clip(),n.needTransform){let i=e;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}}}getHighlightStyle(t,e,i){var n={};for(let e in t)n[e]=t[e];var r=Mi.Util_color.getHighlightColor();"stroke"!==t.brushType?(n.strokeColor=r,n.lineWidth=t.lineWidth||1,n.brushType="both"):"stroke"!==i?(n.strokeColor=r,n.lineWidth=t.lineWidth||1):n.strokeColor=e.strokeColor||Mi.Util_color.mix(t.strokeColor,Mi.Util_color.toRGB(r));for(let t in e)void 0!==e[t]&&(n[t]=e[t]);return n}getHighlightZoom(){return"text"!==this.type?6:2}drift(t,e){this.position[0]+=t,this.position[1]+=e}buildPath(t,e){}getRect(t){}isCover(t,e){var i=this.getTansform(t,e);t=i[0],e=i[1];var n=this.style.__rect;return n||(n=this.style.__rect=this.getRect(this.style)),t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&Mi.Util_area.isInside(this,this.style,t,e)}drawText(t,e,i){if(void 0!==e.text&&!1!==e.text){var n=e.textColor||e.color||e.strokeColor;t.fillStyle=n;var r,o,s,a,l=10,h=e.textPosition||this.textPosition||"top",u=[];switch(u=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(i||e).__rect||this.getRect(i||e);switch(h){case"inside":s=c.x+c.width/2,a=c.y+c.height/2,r="center",o="middle","stroke"!==e.brushType&&n===e.color&&(t.fillStyle="#fff");break;case"left":s=c.x-l,a=c.y+c.height/2,r="end",o="middle";break;case"right":s=c.x+c.width+l,a=c.y+c.height/2,r="start",o="middle";break;case"top":s=c.x+c.width/2,a=c.y-l,r="center",o="bottom";break;case"bottom":s=c.x+c.width/2,a=c.y+c.height+l,r="center",o="top"}}break;case"start":case"end":var p=0,f=0,d=0,g=0;if(void 0!==e.pointList){var y=e.pointList;if(y.length<2)return;var m=y.length;switch(h){case"start":p=y[0][0]+u[0],f=y[1][0]+u[0],d=y[0][1]+u[1],g=y[1][1]+u[1];break;case"end":p=y[m-2][0]+u[0],f=y[m-1][0]+u[0],d=y[m-2][1]+u[1],g=y[m-1][1]+u[1]}}else p=e.xStart+u[0]||0,f=e.xEnd+u[0]||0,d=e.yStart+u[1]||0,g=e.yEnd+u[1]||0;switch(h){case"start":r=p<f?"end":"start",o=d<g?"bottom":"top",s=p,a=d;break;case"end":r=p<f?"start":"end",o=d<g?"top":"bottom",s=f,a=g}l-=4,p&&f&&p!==f?s-="end"===r?l:-l:r="center",d!==g?a-="bottom"===o?l:-l:o="middle";break;case"specific":s=e.textX||0,a=e.textY||0,r="start",o="middle"}e.labelXOffset&&!isNaN(e.labelXOffset)&&(s+=e.labelXOffset),e.labelYOffset&&!isNaN(e.labelYOffset)&&(a+=e.labelYOffset),null!=s&&null!=a&&Oi._fillText(t,e.text,s,a,e.textFont,e.textAlign||r,e.textBaseline||o)}}modSelf(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)}isSilent(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)}setCtxGlobalAlpha(t,e,i){t.globalAlpha="fill"===e?void 0===i.fillOpacity?void 0===i.opacity?1:i.opacity:i.fillOpacity:"stroke"===e?void 0===i.strokeOpacity?void 0===i.opacity?1:i.opacity:i.strokeOpacity:void 0===i.opacity?1:i.opacity}static _fillText(t,e,i,n,r,o,s){r&&(t.font=r),t.textAlign=o,t.textBaseline=s;var a=Oi._getTextRect(e,i,n,r,o,s);e=(e+"").split("\n");var l=Mi.Util_area.getTextHeight("ZH",r);switch(s){case"top":n=a.y;break;case"bottom":n=a.y+l;break;default:n=a.y+l/2}for(var h=0,u=e.length;h<u;h++)t.fillText(e[h],i,n),n+=l}static _getTextRect(t,e,i,n,r,o){var s=Mi.Util_area.getTextWidth(t,n),a=Mi.Util_area.getTextHeight("ZH",n);switch(t=(t+"").split("\n"),r){case"end":case"right":e-=s;break;case"center":e-=s/2}switch(o){case"top":break;case"bottom":i-=a*t.length;break;default:i-=a*t.length/2}return{x:e,y:i,width:s,height:a*t.length}}}class Ni extends Oi{constructor(t){super(t),this.type="smicpoint",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPoint"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;t.arc(e.x+i[0],e.y+i[1],e.r,0,2*Math.PI,!0)}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=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+i[0]-t.r-e/2),y:Math.round(t.y+i[1]-t.r-e/2),width:2*t.r+e,height:2*t.r+e},t.__rect)}}class Ai extends Oi{constructor(t){super(t),this.type="smictext",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicText"}destroy(){this.type=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=this.style;if(e&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),void 0!==n.text&&!1!==n.text){t.save(),this.doClip(t),this.setContext(t,n),this.setTransform(t),n.textFont&&(t.font=n.textFont),t.textAlign=n.textAlign||"start",t.textBaseline=n.textBaseline||"middle";var r,o=(n.text+"").split("\n"),s=Mi.Util_area.getTextHeight("ZH",n.textFont),a=this.getRectNoRotation(n),l=n.x+i[0];r="top"===n.textBaseline?a.y:"bottom"===n.textBaseline?a.y+s:a.y+s/2;for(var h=n.x+i[0],u=n.y+i[1],c=0,p=o.length;c<p;c++){switch(n.labelRect&&(t.fillRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.strokeColor,t.strokeRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.textColor),n.brushType){case"stroke":this.setCtxGlobalAlpha(t,"stroke",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*c,n.maxWidth):t.strokeText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.strokeText(o[c],l,r,n.maxWidth):t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n);break;case"both":n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n)):"bottom"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n)):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n)),t.restore()):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n));break;default:this.setCtxGlobalAlpha(t,"fill",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*c,n.maxWidth):t.fillText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.fillText(o[c],l,r,n.maxWidth):t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n)}r+=s}t.restore()}}getRect(t){if(t.__rect)return t.__rect;for(var e,i,n,r,o=this.getTextBackground(t,!0),s=0,a=o.length;s<a;s++){var l=o[s];0===s?(e=l[0],n=l[0],i=l[1],r=l[1]):(l[0]<e&&(e=l[0]),l[0]>n&&(n=l[0]),l[1]<i&&(i=l[1]),l[1]>r&&(r=l[1]))}return t.__rect={x:e,y:i,width:n-e,height:r-i},t.__rect}getRectNoRotation(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=Mi.Util_area.getTextHeight("ZH",t.textFont),r=Mi.Util_area.getTextWidth(t.text,t.textFont),o=Mi.Util_area.getTextHeight(t.text,t.textFont),s=t.x+i[0];"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2),e="top"===t.textBaseline?t.y+i[1]:"bottom"===t.textBaseline?t.y+i[1]-o:t.y+i[1]-o/2;var a,l=!1;if(t.maxWidth){var h=parseInt(t.maxWidth);h<r&&(a=r,l=!0,r=h),s=t.x+i[0],"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2)}t.textFont&&(t.textFont.toLowerCase().indexOf("italic")>-1&&(r+=a&&!0===l?n/3*(r/a):n/3));return{x:s,y:e,width:r,height:o}}getTextBackground(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;if((!e||!1===e)&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),r=t.x+i[0],o=t.y+i[1],s=[];if(t.textRotation&&0!==t.textRotation){let e=t.textRotation,i=this.getRotatedLocation(n.x,n.y,r,o,e),a=this.getRotatedLocation(n.x+n.width,n.y,r,o,e),l=this.getRotatedLocation(n.x+n.width,n.y+n.height,r,o,e),h=this.getRotatedLocation(n.x,n.y+n.height,r,o,e);s.push(i),s.push(a),s.push(l),s.push(h)}else{let t=[n.x,n.y],e=[n.x+n.width,n.y],i=[n.x+n.width,n.y+n.height],r=[n.x,n.y+n.height];s.push(t),s.push(e),s.push(i),s.push(r)}return t.__textBackground=s,t.__textBackground}getRotatedLocation(t,e,i,n,r){var o,s,a=new Array;return e=-e,n=-n,r=-r,o=(t-i)*Math.cos(r/180*Math.PI)-(e-n)*Math.sin(r/180*Math.PI)+i,s=(t-i)*Math.sin(r/180*Math.PI)+(e-n)*Math.cos(r/180*Math.PI)+n,a[0]=o,a[1]=-s,a}}class Ri extends Oi{constructor(t){super(t),this.type="smiccircle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1];return t.moveTo(n+e.r,r),t.arc(n,r,e.r,0,2*Math.PI,!0),!0}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=t.x+i[0],r=t.y+i[1],o=t.r;return e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(n-o-e/2),y:Math.round(r-o-e/2),width:2*o+e,height:2*o+e},t.__rect}}class ki extends Oi{constructor(t){super(t),this.type="smicpolygon",this.holePolygonPointLists=null,this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.style;e&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),t.save(),this.setContext(t,i),this.setTransform(t);var n=!1;"fill"!==i.brushType&&"both"!==i.brushType&&void 0!==i.brushType||(t.beginPath(),"dashed"===i.lineType||"dotted"===i.lineType||"dot"===i.lineType||"dash"===i.lineType||"dashot"===i.lineType||"longdash"===i.lineType||"longdashdot"===i.lineType?this.buildPath(t,{lineType:"solid",lineWidth:i.lineWidth,pointList:i.pointList}):(this.buildPath(t,i),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)),i.lineWidth>0&&("stroke"===i.brushType||"both"===i.brushType)&&(n||(t.beginPath(),this.buildPath(t,i)),this.setCtxGlobalAlpha(t,"stroke",i),t.stroke(),this.setCtxGlobalAlpha(t,"reset",i)),this.drawText(t,i,this.style);var r=di(i);if(r.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,s=o.length,a=0;a<s;a++){var l=o[a];r.pointList=l,t.globalCompositeOperation="destination-out",n=!1,"fill"!==r.brushType&&"both"!==r.brushType&&void 0!==r.brushType||(t.beginPath(),"dashed"===r.lineType||"dotted"===r.lineType||"dot"===r.lineType||"dash"===r.lineType||"dashot"===r.lineType||"longdash"===r.lineType||"longdashdot"===r.lineType?this.buildPath(t,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(t,r),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)),r.lineWidth>0&&("stroke"===r.brushType||"both"===r.brushType)?(n||(t.beginPath(),this.buildPath(t,r)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)):t.globalCompositeOperation="source-over"}t.restore()}buildPath(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 i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var r,o,s,a=Mi.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var l=n.length,h=0;h<l;h++)r=a[2*h],o=a[2*h+1],s=[n[(h+1)%l][0]+i[0],n[(h+1)%l][1]+i[1]],t.bezierCurveTo(r[0],r[1],o[0],o[1],s[0],s[1])}else if("spline"===e.smooth&&(n=Mi.SUtil_smoothSpline(n,!0,null,i)),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Mi.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a]);Mi.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Mi.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h]);Mi.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1]);t.lineTo(n[0][0]+i[0],n[0][1]+i[1])}}getRect(t,e){var i;if(e?i=e:(this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),i=this.refOriginalPosition),t.__rect)return t.__rect;for(var n,r=Number.MAX_VALUE,o=Number.MIN_VALUE,s=Number.MAX_VALUE,a=Number.MIN_VALUE,l=t.pointList,h=0,u=l.length;h<u;h++)l[h][0]+i[0]<r&&(r=l[h][0]+i[0]),l[h][0]+i[0]>o&&(o=l[h][0]+i[0]),l[h][1]+i[1]<s&&(s=l[h][1]+i[1]),l[h][1]+i[1]>a&&(a=l[h][1]+i[1]);return n="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(r-n/2),y:Math.round(s-n/2),width:o-r+n,height:a-s+n},t.__rect}}class Di extends Oi{constructor(t){super(t),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2)){var r=Math.min(e.pointList.length,Math.round(e.pointListLength||e.pointList.length));if(e.smooth&&"spline"!==e.smooth){var o,s,a,l=Mi.SUtil_smoothBezier(n,e.smooth,!1,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=0;e<r-1;e++)o=l[2*e],s=l[2*e+1],a=[n[e+1][0]+i[0],n[e+1][1]+i[1]],t.bezierCurveTo(o[0],o[1],s[0],s[1],a[0],a[1])}else if("spline"===e.smooth&&(r=(n=Mi.SUtil_smoothSpline(n,null,null,i)).length),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var h=1;h<r;h++)Mi.SUtil_dashedLineTo(t,n[h-1][0]+i[0],n[h-1][1]+i[1],n[h][0]+i[0],n[h][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),o=(e.lineWidth||1)*("dashed"===e.lineType?5:1),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)Mi.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1])}}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return ki.prototype.getRect.apply(this,[t,e])}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}}class zi extends Oi{constructor(t){super(t),this.type="smicimage",this._imageCache={},this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicImage"}destroy(){this.type=null,this._imageCache=null,super.destroy()}brush(t,e,i){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var n=this.refOriginalPosition,r=this.style||{};e&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));var o=r.image,s=this;if("string"==typeof o){var a=o;this._imageCache[a]?o=this._imageCache[a]:((o=new Image).onload=function(){o.onload=null,clearTimeout(zi._refreshTimeout),zi._needsRefresh.push(s),zi._refreshTimeout=setTimeout(function(){i&&i(zi._needsRefresh),zi._needsRefresh=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if("IMG"===o.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!==o.readyState)return}else if(!o.complete)return;var l=r.width||o.width,h=r.height||o.height,u=r.x+n[0],c=r.y+n[1];if(!o.width||!o.height)return;if(t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r.sWidth&&r.sHeight){let e=r.sx+n[0]||0,i=r.sy+n[1]||0;t.drawImage(o,e,i,r.sWidth,r.sHeight,u,c,l,h)}else if(r.sx&&r.sy){let e=r.sx+n[0],i=r.sy+n[1];var p=l-e,f=h-i;t.drawImage(o,e,i,p,f,u,c,l,h)}else t.drawImage(o,u,c,l,h);r.width||(r.width=l),r.height||(r.height=h),this.style.width||(this.style.width=l),this.style.height||(this.style.height=h),this.drawText(t,r,this.style),t.restore()}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return{x:t.x+e[0],y:t.y+e[1],width:t.width,height:t.height}}clearCache(){this._imageCache={}}}zi._needsRefresh=[],zi._refreshTimeout=null;class Vi extends Oi{constructor(t){super(t),this.type="smicrectangle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicRectangle"}destroy(){this.type=null,super.destroy()}_buildRadiusPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i,n,r,o,s,a=this.refOriginalPosition,l=e.x+a[0],h=e.y+a[1],u=e.width,c=e.height,p=e.radius;"number"==typeof p?i=n=r=o=p:p instanceof Array?1===p.length?i=n=r=o=p[0]:2===p.length?(i=r=p[0],n=o=p[1]):3===p.length?(i=p[0],n=o=p[1],r=p[2]):(i=p[0],n=p[1],r=p[2],o=p[3]):i=n=r=o=0,i+n>u&&(i*=u/(s=i+n),n*=u/s),r+o>u&&(r*=u/(s=r+o),o*=u/s),n+r>c&&(n*=c/(s=n+r),r*=c/s),i+o>c&&(i*=c/(s=i+o),o*=c/s),t.moveTo(l+i,h),t.lineTo(l+u-n,h),0!==n&&t.quadraticCurveTo(l+u,h,l+u,h+n),t.lineTo(l+u,h+c-r),0!==r&&t.quadraticCurveTo(l+u,h+c,l+u-r,h+c),t.lineTo(l+o,h+c),0!==o&&t.quadraticCurveTo(l,h+c,l,h+c-o),t.lineTo(l,h+i),0!==i&&t.quadraticCurveTo(l,h,l+i,h)}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+i[0],e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1])),t.closePath()}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=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+i[0]-e/2),y:Math.round(t.y+i[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}class Fi extends Oi{constructor(t){super(t),this.type="smicsector",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1],o=e.r0||0,s=e.r,a=e.startAngle,l=e.endAngle,h=e.clockWise||!1;a=Mi.Util_math.degreeToRadian(a),l=Mi.Util_math.degreeToRadian(l),h||(a=-a,l=-l);var u=Mi.Util_math.cos(a),c=Mi.Util_math.sin(a);t.moveTo(u*o+n,c*o+r),t.lineTo(u*s+n,c*s+r),t.arc(n,r,s,a,l,!h),t.lineTo(Mi.Util_math.cos(l)*o+n,Mi.Util_math.sin(l)*o+r),0!==o&&t.arc(n,r,o,l,a,h),t.closePath()}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition,i=Mi.Util_vector.create(),n=Mi.Util_vector.create(),r=Mi.Util_vector.create(),o=Mi.Util_vector.create(),s=t.x+e[0],a=t.y+e[1],l=t.r0||0,h=t.r,u=Mi.Util_math.degreeToRadian(t.startAngle),c=Mi.Util_math.degreeToRadian(t.endAngle),p=t.clockWise;return p||(u=-u,c=-c),l>1?Mi.Util_computeBoundingBox.arc(s,a,l,u,c,!p,i,r):(i[0]=r[0]=s,i[1]=r[1]=a),Mi.Util_computeBoundingBox.arc(s,a,h,u,c,!p,n,o),Mi.Util_vector.min(i,i,n),Mi.Util_vector.max(r,r,o),t.__rect={x:i[0],y:i[1],width:r[0]-i[0],height:r[1]-i[1]},t.__rect}}class Bi{constructor(t){this.shapeParameters=t,this.CLASS_NAME="Zondy.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(t){if(t&&(this.shapeParameters=t),!this.shapeParameters)return null;var e=this.shapeParameters;if(e instanceof yi){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t=li(t,e.style,["x","y"]);let i=new Ni;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","style","highlightStyle"]),i}if(e instanceof mi){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=li(t,e.style,["pointList"]);let i=new Di;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof _i){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=li(t,e.style,["pointList"]);let i=new ki;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof vi){if(!e.x&&!e.y&!e.width&!e.height)return null;let t=new Object;t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t=li(t,e.style,["x","y","width","height"]);let i=new Vi;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","width","height","style","highlightStyle"]),i}if(e instanceof xi){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t.startAngle=e.startAngle,t.endAngle=e.endAngle,e.r0&&(t.r0=e.r0),e.clockWise&&(t.clockWise=e.clockWise),t=li(t,e.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new Fi;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}if(e instanceof bi){let t=new Object;t.x=e.x,t.y=e.y,t.text=e.text,t=li(t,e.style,["x","y","text"]);let i=new Ai;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","text","style","highlightStyle"]),i}if(e instanceof wi){let t=new Object;t.x=e.x,t.y=e.y,e.image&&(t.image=e.image),e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.sx&&(t.sx=e.sx),e.sy&&(t.sy=e.sy),e.sWidth&&(t.sWidth=e.sWidth),e.sHeight&&(t.sHeight=e.sHeight),t=li(t,e.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new zi;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","image","width","height","style","highlightStyle"]),i}if(e instanceof Si){let t=new Object;t.x=e.x,t.r=e.r,t.y=e.y,t=li(t,e.style,["x","y","r"]);let i=new Ri;return i.style=new Bi.transformStyle(t),i.highlightStyle=new Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(t){var e={},i=["normal","normal","normal","12","arial,sans-serif"],n=[!0,!1];for(var r in t)switch(r){case"fill":n[0]=t[r];break;case"fillColor":e.color=t[r];break;case"stroke":n[1]=t[r];break;case"strokeWidth":e.lineWidth=t[r];break;case"strokeLinecap":e.lineCap=t[r];break;case"strokeLineJoin":e.lineJoin=t[r];break;case"strokeDashstyle":e.lineType=t[r];break;case"pointRadius":e.r=t[r];break;case"label":e.text=t[r];break;case"labelRect":e.labelRect=t[r];break;case"fontColor":e.textColor=t[r];break;case"fontStyle":i[0]=t[r];break;case"fontVariant":i[1]=t[r];break;case"fontWeight":i[2]=t[r];break;case"fontSize":var o="";t[r]&&t[r].toString().indexOf("px")<0&&(o="px"),i[3]=t[r]+o;break;case"fontFamily":i[4]=t[r];break;case"fontOpacity":e.opacity=t[r];break;case"labelPosition":e.textPosition=t[r];break;case"labelAlign":e.textAlign=t[r];break;case"labelBaseline":e.textBaseline=t[r];break;case"labelRotation":e.textRotation=t[r];break;default:e[r]=t[r]}return e.textFont=i.join(" "),!0===n[0]&&!1===n[1]?e.brushType="fill":!1===n[0]&&!0===n[1]?e.brushType="stroke":!0===n[0]&&!0===n[1]?e.brushType="both":e.brushType="fill",null==e.lineWidth&&(e.lineWidth=1),e}static Background(t,e,i){var n=i||{},r=new vi(e[0],e[3],Math.abs(e[2]-e[0]),Math.abs(e[3]-e[1]));return r.style={fillColor:"#f3f3f3"},n.backgroundStyle&&li(r.style,n.backgroundStyle),n.backgroundRadius&&(r.style.radius=n.backgroundRadius),r.clickable=!1,r.hoverable=!1,t.createShape(r)}static GraphAxis(t,e,i,n){var r=e,o=i||{},s=[],a=[],l=!!o.useXReferenceLine&&o.useXReferenceLine,h=o.axisYTick&&!isNaN(o.axisYTick)?o.axisYTick:0,u=[],c=[];if(0===h){if(c.push([r[0],r[3]-5]),c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}else{var p=Math.abs(r[1]-r[3])/h,f=r[3];c.push([r[0],f-5]);for(var d=0;d<h;d++){if(c.push([r[0],f]),c.push([r[0]-5,f]),c.push([r[0],f]),l){var g=new mi([[r[0],f],[r[2],f]]);g.style={strokeColor:"#cfcfcf",strokeLinecap:"butt",strokeLineJoin:"round",strokeWidth:1},g.clickable=!1,g.hoverable=!1,o.xReferenceLineStyle&&li(g.style,o.xReferenceLineStyle),s.push(t.createShape(g))}f+=p}if(c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}if(o.axisUseArrow){var y=[[r[2]+5,r[1]+4],[r[2]+13,r[1]],[r[2]+5,r[1]-4]],m=[[r[0]-4,r[3]-5],[r[0],r[3]-13],[r[0]+4,r[3]-5]],_=new _i(y);_.style={fillColor:"#008acd"},li(_.style,o.axisStyle),a.push(t.createShape(_));var v=new _i(m);if(v.style={fillColor:"#008acd"},li(v.style,o.axisStyle),a.push(t.createShape(v)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var x=new _i(u);x.style={fillColor:"#008acd"},li(x.style,o.axisStyle),a.push(t.createShape(x))}}var b=new mi(c);b.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&li(b.style,o.axisStyle),b.clickable=!1,b.hoverable=!1;var w=[t.createShape(b)],S=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var E=o.axisYLabels;let e=E.length;var L=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(L=o.axisYLabelsOffset),1===e){let e=new bi(r[0]-5+L[0],r[3]+L[1],E[0]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&li(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,S.push(t.createShape(e))}else for(var C=r[3],P=Math.abs(r[1]-r[3])/(e-1),I=0;I<e;I++){let e=new bi(r[0]-5+L[0],C+L[1],E[I]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&li(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,S.push(t.createShape(e)),C+=P}}var M=[];if(o.axisXLabels&&o.axisXLabels.length&&o.axisXLabels.length>0){let e=o.axisXLabels,i=e.length,s=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(s=o.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length===i){let a=n.xPositions;for(let n=0;n<i;n++){let i=new bi(a[n]+s[0],r[1]+s[1],e[n]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&li(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}}else if(1===i){let i=new bi(r[0]-5+s[0],r[1]+s[0],e[0]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&li(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}else{let n=r[0],a=Math.abs(r[2]-r[0])/(i-1);for(let l=0;l<i;l++){let i=new bi(n+s[0],r[1]+s[1],e[l]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&li(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i)),n+=a}}}return s.concat(w).concat(S).concat(M).concat(a)}static ShapeStyleTool(t,e,i,n,r,o){var s=t||{};if(e&&li(s,e),i&&i.length&&void 0!==r&&!isNaN(r)&&r>=0&&i[r]&&li(s,i[r]),n&&n.length&&void 0!==o)for(var a=n,l=a.length,h=parseFloat(o),u=0;u<l;u++)if(a[u].start<=h&&h<a[u].end){li(s,a[u].style);break}return s}}class ji{constructor(t,e){t&&e&&e.map&&e.renderer&&(this.id=pi(),this.lonlat=null,this.location=[],this.data=t,this.shapes=[],this.layer=e,this.CLASS_NAME="Zondy.Feature.Theme")}destroy(){this.data=null,this.id=null,this.lonlat=null,this.location=null,this.shapes=null,this.layer=null}}class Gi extends ji{constructor(t,e,i,n,r,o){if(super(t,e,i,n,r,o),this.shapeFactory=new Bi,this.shapeParameters=null,this.RelativeCoordinate=!1,this.setting=null,this.origonPoint=null,this.chartBox=null,this.chartBounds=null,this.width=null,this.height=null,this.XOffset=0,this.YOffset=0,this.DVBParameter=null,this.dataViewBox=null,this.DVBCodomain=null,this.DVBCenterPoint=null,this.DVBUnitValue=null,this.DVBOrigonPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.origonPointOffset=null,this.fields=i||[],this.dataValues=null,r)this.lonlat=r;else if(o&&o.calGravity){let t;const e=this.data.geometry;switch(e.type){case"Point":t=e.clone();break;case"MultiPoint":case"LineString":case"MultiLineString":case"MultiPolygon":t=e.extent.center;break;case"Polygon":t=e.centroid;break;case"Extent":case"Circle":t=e.center;break;default:t=e.extent.center}const i=t.coordinates;this.lonlat=[i[0],i[1]]}else{const t=feature.geometry.extent.center.coordinates;this.lonlat=[t[0],t[1]]}n&&n.width&&n.height&&n.codomain&&(this.setting=n),this.CLASS_NAME="Zondy.Feature.Theme.Graph"}destroy(){this.shapeFactory=null,this.shapeParameters=null,this.width=null,this.height=null,this.origonPoint=null,this.chartBox=null,this.dataViewBox=null,this.chartBounds=null,this.DVBParameter=null,this.DVBOrigonPoint=null,this.DVBCenterPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.DVBCodomain=null,this.DVBUnitValue=null,this.origonPointOffset=null,this.XOffset=null,this.YOffset=null,this.fields=null,this.dataValues=null,this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;if(!(t.width&&t.height&&t.codomain))return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=ji.getDataValues(this.data,this.fields,e);this.dataValues=i||[],this.width=parseFloat(t.width),this.height=parseFloat(t.height),this.DVBCodomain=t.codomain,this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var n=this.width,r=this.height,o=this.location;this.origonPoint=[o[0]-n/2,o[1]-r/2];var s=this.origonPoint;this.chartBox=[s[0],s[1]+r,s[0]+n,s[1]];var a=this.chartBox,l=this.DVBParameter;this.dataViewBox=[a[0]+l[0],a[1]-l[1],a[2]-l[2],a[3]+l[3]];var h=this.dataViewBox;return!(h[0]>=h[2]||h[1]<=h[3])&&(this.DVBOrigonPoint=[h[0],h[3]],this.DVBWidth=Math.abs(h[2]-h[0]),this.DVBHeight=Math.abs(h[1]-h[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-s[0],this.DVBOrigonPoint[1]-s[1]],!0)}resetLocation(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var i=this.width,n=this.height,r=this.location;return this.chartBounds=[r[0]-i/2,r[1]-n/2,r[0]+i/2,r[1]+n/2],this.chartBounds.xmin=r[0]-i/2,this.chartBounds.ymin=r[1]-n/2,this.chartBounds.xmax=r[0]+i/2,this.chartBounds.ymax=r[1]+n/2,this.resetLinearGradient(),r}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var t=this.shapes,e=this.location,i=0,n=t.length;i<n;i++){t[i].refOriginalPosition=e;var r=t[i].style;for(var o in r)switch(o){case"pointList":for(var s=r[o],a=0,l=s.length;a<l;a++)s[a][0]-=e[0],s[a][1]-=e[1];break;case"x":r[o]-=e[0];break;case"y":r[o]-=e[1]}}this.RelativeCoordinate=!0}assembleShapes(){}getLocalXY(t){return this.layer.getLocalXY(t)}getCenterOfGravityPoint(t){var e=[],i=0,n=0,r=0;if(t.ftype===Zondy.Enum.FeatureType.Reg)for(var o=t.fGeom.RegGeom,s=0;s<o.length;s++){var a=o[s];if(null!=a&&null!=a.Rings)for(var l=a.Rings,h=0;h<l.length;h++){var u=l[h];if(null!=u&&null!=u.Arcs)for(var c=u.Arcs,p=0;p<c.length;p++){var f=c[p];if(null!=f&&null!=f.Dots)for(var d=f.Dots,g=0;g<d.length;g++)e.push(d[g])}}}for(h=1;h<=e.length;h++){var y=e[h%e.length].x,m=e[h%e.length].y,_=e[h-1].x,v=e[h-1].y,x=(y*v-m*_)/2;i+=x,n+=x*(y+_)/3,r+=x*(m+v)/3}return[n/=i,r/=i]}}ji.getDataValues=function(t,e,i){if(!t.attributes)return!1;for(var n=[],r=t.attributes,o=0;o<e.length;o++)for(var s in r)if(s===e[o]&&null!==r[s]&&void 0!==r[s])try{!isNaN(i)&&i>=0?n.push(parseFloat(r[s].toString()).toFixed(i)):n.push(parseFloat(r[s].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};class Ui extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.setting=null,n&&n.codomain&&(this.setting=n,this.DVBCodomain=this.setting.codomain),this.CLASS_NAME="Zondy.Theme.RankSymbol"}destroy(){this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;t.XOffset&&(this.XOffset=t.XOffset),t.YOffset&&(this.YOffset=t.YOffset),this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var e=this.width,i=this.height,n=this.location;this.origonPoint=[n[0]-e/2,n[1]-i/2];var r=this.origonPoint;this.chartBox=[r[0],r[1]+i,r[0]+e,r[1]];var o=this.chartBox,s=this.DVBParameter;this.dataViewBox=[o[0]+s[0],o[1]-s[1],o[2]-s[2],o[3]+s[3]];var a=this.dataViewBox;return!(a[0]>=a[2]||a[1]<=a[3])&&(this.DVBOrigonPoint=[a[0],a[3]],this.DVBWidth=Math.abs(a[2]-a[0]),this.DVBHeight=Math.abs(a[1]-a[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-r[0],this.DVBOrigonPoint[1]-r[1]],!0)}}class qi extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues,o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Bi.GraphAxis(this.shapeFactory,e,t,o));for(var h=0,u=r.length;h<u;h++){if(r[h]<i[0]||r[h]>i[1])return null;s=l[h],a=e[1]-(r[h]-i[0])/n;var c=new yi(s,a);c.style=Bi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,h,r[h]),c.highlightStyle=Bi.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(c.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(c.clickable=t.pointClickAble),c.refDataID=this.data.id,c.dataInfo={field:this.fields[h],value:r[h]},this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}}class Hi extends ji{constructor(t,e,i,n,r){if(super(t,e),t.fGeom){this.dataBounds=t.bound,this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=i||{},this.CLASS_NAME="Zondy.Theme.ThemeVector",this.style=i||{},n&&li(this,n,["shapeOptions","dataBounds"]),r&&li(this.shapeOptions,r);t.fGeom;switch(this.lonlat=[(this.dataBounds.xmin+this.dataBounds.xmax)/2,(this.dataBounds.ymin+this.dataBounds.ymax)/2],this.location=this.getLocalXY(this.lonlat),t.ftype){case 0:break;case 1:this.pointsToTF(t.fGeom.PntGeom);break;case 2:this.linesToTF(t.fGeom.LinGeom);break;case 3:this.regsToTF(t.fGeom.RegGeom)}}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}pointsToTF(t){if(!(null==t||t.length<=0)){t.components;for(var e=[],i=[],n=this.location,r=[],o=this.nodesClipPixel,s=0;s<t.length;s++){var a=t[s];if(i=[],e=this.getLocalXY([a.Dot.x,a.Dot.y]),i[0]=e[0]-n[0],i[1]=e[1]-n[1],r.length>0){var l=r[r.length-1];if(Math.abs(l[0]-i[0])<=o&&Math.abs(l[1]-i[1])<=o)continue}r.push(i);var h=new Object;h.r=6,(h=li(h,this.style)).x=i[0],h.y=i[1];var u=new Ni({style:h,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(u.highlightStyle=this.highlightStyle),u.refOriginalPosition=n,u.refDataID=this.data.id,u.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&li(u,this.shapeOptions),this.shapes.push(u)}}}linesToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.lineToTF(t[e])}lineToTF(t){var e=[];if(null!=t.Line&&null!=t.Line.Arcs&&t.Line.Arcs.length>0)for(var i=t.Line.Arcs,n=0;n<i.length;n++)for(var r=i[n].Dots,o=0;o<r.length;o++)e.push([r[o].x,r[o].y]);if(!(e.length<=0)){var s=[],a=[],l=this.location,h=[],u=this.nodesClipPixel;for(n=0;n<e.length;n++){var c=e[n];if(a=[],s=this.getLocalXY(c),a[0]=s[0]-l[0],a[1]=s[1]-l[1],h.length>0){var p=h[h.length-1];if(Math.abs(p[0]-a[0])<=u&&Math.abs(p[1]-a[1])<=u)continue}h.push(a)}if(h.length<2)return null;var f=new Object;(f=li(f,this.style,["pointList"])).pointList=h;var d=new Di({style:f,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(d.highlightStyle=this.highlightStyle),d.refOriginalPosition=this.location,d.refDataID=this.data.id,d.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&li(d,this.shapeOptions),this.shapes.push(d)}}regsToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.regToTF(t[e])}regToTF(t){var e=t.Rings;if(!(null==e||e.length<=0)){for(var i=[],n=[],r=this.location,o=[],s=[],a=[],l=this.nodesClipPixel,h=0;h<e.length;h++){if(0===h){if(o=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(var u=e[h].Arcs,c=0;c<u.length;c++)for(var p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],o.length>0){var d=o[o.length-1];if(Math.abs(d[0]-n[0])<=l&&Math.abs(d[1]-n[1])<=l)continue}o.push(n)}}else if(s=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(u=e[h].Arcs,c=0;c<u.length;c++)for(p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],s.length>0){var g=s[s.length-1];if(Math.abs(g[0]-n[0])<=l&&Math.abs(g[1]-n[1])<=l)continue}s.push(n)}s.length<2||a.push(s)}if(!(o.length<2)){var y={};(y=li(y,this.style,["pointList"])).pointList=o;var m=new ki({style:y,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,a.length>0&&(m.holePolygonPointLists=a),this.shapeOptions&&li(m,this.shapeOptions),this.shapes.push(m)}}}updateAndAddShapes(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,i=0,n=this.shapes.length;i<n;i++){var r=this.shapes[i];r.refOriginalPosition=t,e.addShape(r)}}getShapesCount(){return this.shapes.length}getLocalXY(t){return this.layer.getLocalXY(t)}}class Zi extends(ui(Ei,Ti)){constructor(t){super(t),t=t||{},this.id=null,this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,this.ignore=!1,hi(this,t),this.id=this.id||pi(),this.CLASS_NAME="Zondy.LevelRenderer.Group"}destroy(){this.id=null,this.type=null,this.clipShape=null,this._children=null,this._storage=null,this.__dirty=null,this.ignore=null,super.destroy()}children(){return this._children.slice()}childAt(t){return this._children[t]}addChild(t){t!==this&&t.parent!==this&&(t.parent&&t.parent.removeChild(t),this._children.push(t),t.parent=this,this._storage&&this._storage!==t._storage&&(this._storage.addToMap(t),t instanceof Zi&&t.addChildrenToStorage(this._storage)))}removeChild(t){var e=ci(this._children,t);this._children.splice(e,1),t.parent=null,this._storage&&(this._storage.delFromMap(t.id),t instanceof Zi&&t.delChildrenFromStorage(this._storage))}eachChild(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r)}}traverse(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r),"group"===r.type&&r.traverse(t,e)}}addChildrenToStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.addToMap(i),"group"===i.type&&i.addChildrenToStorage(t)}}delChildrenFromStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.delFromMap(i.id),"group"===i.type&&i.delChildrenFromStorage(t)}}modSelf(){this.__dirty=!0}}class Xi{constructor(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0,this.CLASS_NAME="Zondy.LevelRenderer.Storage"}destroy(){this.dispose(),this._shapeList=null,this._shapeListOffset=null}iterShape(t,e){if(!e){e={hover:!1,normal:"down",update:!1}}if(e.hover)for(var i=0,n=this._hoverElements.length;i<n;i++){var r=this._hoverElements[i];if(r.updateTransform(),t(r))return this}switch(e.update&&this.updateShapeList(),e.normal){case"down":{let e=this._shapeList.length;for(;e--;)if(t(this._shapeList[e]))return this;break}default:for(let e=0,i=this._shapeList.length;e<i;e++)if(t(this._shapeList[e]))return this}return this}getHoverShapes(t){var e=[],i=this._hoverElements.length;for(let t=0;t<i;t++){e.push(this._hoverElements[t]);var n=this._hoverElements[t].hoverConnect;if(n)for(var r,o=0,s=(n=n instanceof Array?n:[n]).length;o<s;o++)(r=n[o].id?n[o]:this.get(n[o]))&&e.push(r)}if(e.sort(Xi.shapeCompareFunc),t)for(let t=0,i=e.length;t<i;t++)e[t].updateTransform();return e}getShapeList(t){return t&&this.updateShapeList(),this._shapeList}updateShapeList(){this._shapeListOffset=0;var t=this._roots.length;for(let e=0;e<t;e++){let t=this._roots[e];this._updateAndAddShape(t)}this._shapeList.length=this._shapeListOffset;var e=this._shapeList.length;for(let t=0;t<e;t++)this._shapeList[t].__renderidx=t;this._shapeList.sort(Xi.shapeCompareFunc)}_updateAndAddShape(t,e){if(!t.ignore)if(t.updateTransform(),"group"===t.type){t.clipShape&&(t.clipShape.parent=t,t.clipShape.updateTransform(),e?(e=e.slice()).push(t.clipShape):e=[t.clipShape]);for(var i=0;i<t._children.length;i++){var n=t._children[i];n.__dirty=t.__dirty||n.__dirty,this._updateAndAddShape(n,e)}t.__dirty=!1}else t.__clipShapes=e,this._shapeList[this._shapeListOffset++]=t}mod(t,e){var i=this._elements[t];if(i&&(i.modSelf(),e))if(e.parent||e._storage||e.__startClip){var n={};for(var r in e)"parent"!==r&&"_storage"!==r&&"__startClip"!==r&&e.hasOwnProperty(r)&&(n[r]=e[r]);fi(i,n,!0)}else fi(i,e,!0);return this}drift(t,e,i){var n=this._elements[t];return n&&(n.needTransform=!0,"horizontal"===n.draggable?i=0:"vertical"===n.draggable&&(e=0),(!n.ondrift||n.ondrift&&!n.ondrift(e,i))&&n.drift(e,i)),this}addHover(t){return t.updateNeedTransform(),this._hoverElements.push(t),this}delHover(){return this._hoverElements=[],this}hasHoverShape(){return this._hoverElements.length>0}addRoot(t){t instanceof Zi&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}delRoot(t){if(void 0===t){for(var e=0;e<this._roots.length;e++){var i=this._roots[e];i instanceof Zi&&i.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],void(this._roots=[])}if(t instanceof Array){var n=t.length;for(let e=0;e<n;e++)this.delRoot(t[e])}else{var r;r="string"==typeof t?this._elements[t]:t;var o=ci(this._roots,r);o>=0&&(this.delFromMap(r.id),this._roots.splice(o,1),r instanceof Zi&&r.delChildrenFromStorage(this))}}addToMap(t){return t instanceof Zi&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}get(t){return this._elements[t]}delFromMap(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof Zi&&(e._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.__renderidx-e.__renderidx:t.z-e.z:t.zlevel-e.zlevel}}class Yi{}Yi.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},Yi.catchBrushException=!1,Yi.debugMode=0;class Wi{constructor(t,e){this.root=t,this.storage=e,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,Wi.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="Zondy.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var i=document.createElement("div");this._domRoot=i,i.style.position="relative",i.style.overflow="hidden",i.style.width=this._width+"px",i.style.height=this._height+"px",this.root.appendChild(i),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=Wi.createDom(pi(),"div",this),i.appendChild(this._bgDom),this._bgDom.onselectstart=o,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var n=new $i(pi(),this);this._layers.hover=n,i.appendChild(n.dom),n.initContext(),n.dom.onselectstart=o,n.dom.style["-webkit-user-select"]="none",n.dom.style["user-select"]="none",n.dom.style["-webkit-touch-callout"]="none";var r=this;function o(){return!1}this.updatePainter=function(t,e){r.refreshShapes(t,e)}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(t){return this.refresh(t,!0),this}refresh(t,e){var i=this.storage.getShapeList(!0);return this._paintList(i,e),"function"==typeof t&&t(),this}_paintList(t,e){var i,n,r;for(var o in void 0===e&&(e=!1),this._updateLayerStatus(t),this._layers)"hover"!==o&&(this._layers[o].unusedCount++,this._layers[o].updateTransform());for(var s=[],a=0,l=t.length;a<l;a++){var h=t[a];if(n!==h.zlevel&&(i&&i.needTransform&&r.restore(),r=(i=this.getLayer(h.zlevel)).ctx,n=h.zlevel,i.unusedCount=0,(i.dirty||e)&&i.clear(),i.needTransform&&(r.save(),i.setTransform(r))),r&&h.__startClip){var u=h.__startClip;if(r.save(),u.needTransform){let t=u.transform;Mi.Util_matrix.invert(s,t),r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}if(r.beginPath(),u.buildPath(r,u.style),r.clip(),u.needTransform){let t=s;r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}if((i&&i.dirty||e)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(r,!1)))if(Yi.catchBrushException)try{h.brush(r,!1,this.updatePainter)}catch(t){}else h.brush(r,!1,this.updatePainter);r&&h.__stopClip&&r.restore(),h.__dirty=!1}r&&i&&i.needTransform&&r.restore();for(let t in this._layers)if("hover"!==t){var c=this._layers[t];c.dirty=!1,1===c.unusedCount&&c.clear()}}getLayer(t){var e=this._layers[t];if(!e){var i=this._zlevelList.length,n=null,r=-1;if(i>0&&t>this._zlevelList[0]){for(r=0;r<i-1&&!(this._zlevelList[r]<t&&this._zlevelList[r+1]>t);r++);n=this._layers[this._zlevelList[r]]}this._zlevelList.splice(r+1,0,t),e=new $i(pi(),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 Li).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}getLayers(){return this._layers}_updateLayerStatus(t){var e=this._layers,i={};for(let t in e)"hover"!==t&&(i[t]=e[t].elCount,e[t].elCount=0);for(let i=0;i<t.length;i++){var n=t[i],r=e[n.zlevel];if(r){if(r.elCount++,r.dirty)continue;r.dirty=n.__dirty}}for(let t in e)"hover"!==t&&i[t]!==e[t].elCount&&(e[t].dirty=!0)}refreshShapes(t,e){for(var i=0,n=t.length;i<n;i++){var r=t[i];this.storage.mod(r.id)}return this.refresh(e),this}clear(){for(var t in this._layers)"hover"!==t&&this._layers[t].clear();return this}modLayer(t,e){if(e){this._layerConfig[t]?(new Li).merge(this._layerConfig[t],e,!0):this._layerConfig[t]=e;var i=this._layers[t];i&&(new Li).merge(i,this._layerConfig[t],!0)}}delLayer(t){var e=this._layers[t];e&&(this.modLayer(t,{position:e.position,rotation:e.rotation,scale:e.scale}),e.dom.parentNode.removeChild(e.dom),delete this._layers[t],this._zlevelList.splice((new Li).indexOf(this._zlevelList,t),1))}refreshHover(){this.clearHover();for(var t=this.storage.getHoverShapes(!0),e=0,i=t.length;e<i;e++)this._brushHover(t[e]);return this.storage.delHover(),this}clearHover(){var t=this._layers.hover;return t&&t.clear(),this}resize(){var t=this._domRoot;t.style.display="none";var e=this._getWidth(),i=this._getHeight();if(t.style.display="",this._width!==e||i!==this._height){for(var n in this._width=e,this._height=i,t.style.width=e+"px",t.style.height=i+"px",this._layers)this._layers[n].resize(e,i);this.refresh(null,!0)}return this}clearLayer(t){var e=this._layers[t];e&&e.clear()}dispose(){this.root.innerHTML="",this.root=null,this.storage=null,this._domRoot=null,this._layers=null}getDomHover(){return this._layers.hover.dom}toDataURL(t,e,i){var n=Wi.createDom(pi(),"canvas",this);this._bgDom.appendChild(n);var r=n.getContext("2d");1!==Wi.devicePixelRatio&&r.scale(Wi.devicePixelRatio,Wi.devicePixelRatio),r.fillStyle=e||"#fff",r.rect(0,0,this._width*Wi.devicePixelRatio,this._height*Wi.devicePixelRatio),r.fill();var o=this;this.storage.iterShape(function(t){if(!t.invisible&&(!t.onbrush||t.onbrush&&!t.onbrush(r,!1)))if(Yi.catchBrushException)try{t.brush(r,!1,o.updatePainter)}catch(t){}else t.brush(r,!1,o.updatePainter)},{normal:"up",update:!0});var s=n.toDataURL(t,i);return r=null,this._bgDom.removeChild(n),s}getWidth(){return this._width}getHeight(){return this._height}_getWidth(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10)).toFixed(0)-0}_getHeight(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)).toFixed(0)-0}_brushHover(t){var e=this._layers.hover.ctx;if(!t.onbrush||t.onbrush&&!t.onbrush(e,!0)){var i=this.getLayer(t.zlevel);if(i.needTransform&&(e.save(),i.setTransform(e)),Yi.catchBrushException)try{t.brush(e,!0,this.updatePainter)}catch(t){}else t.brush(e,!0,this.updatePainter);i.needTransform&&e.restore()}}_shapeToImage(t,e,i,n,r){var o=document.createElement("canvas"),s=o.getContext("2d"),a=r||window.devicePixelRatio||1;o.style.width=i+"px",o.style.height=n+"px",o.setAttribute("width",i*a),o.setAttribute("height",n*a),s.clearRect(0,0,i*a,n*a);var l={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[0,0,0],e.rotation=0,e.scale=[1,1],e&&e.brush(s,!1);var h=new zi({id:t,style:{x:0,y:0,image:o}});return null!=l.position&&(h.position=e.position=l.position),null!=l.rotation&&(h.rotation=e.rotation=l.rotation),null!=l.scale&&(h.scale=e.scale=l.scale),h}_createShapeToImageProcessor(){var t=this;return function(e,i,n,r){return t._shapeToImage(e,i,n,r,Wi.devicePixelRatio)}}updateHoverLayer(t){if(!(t instanceof Array))return this;this.clearHover(),this.storage.delHover();for(var e=0;e<t.length;e++)this.storage.addHover(t[e]),this._brushHover(t[e])}static createDom(t,e,i){var n=document.createElement(e),r=i._width,o=i._height;return n.style.position="absolute",n.style.left=0,n.style.top=0,n.style.width=r+"px",n.style.height=o+"px",n.setAttribute("width",r*Wi.devicePixelRatio),n.setAttribute("height",o*Wi.devicePixelRatio),n.setAttribute("id",t),n}}class $i extends Ti{constructor(t,e){super(t,e),this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=e,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,this.ctx=null,this.dom=Wi.createDom(pi(),"canvas",e),this.dom.onselectstart=function(){return!1},this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.CLASS_NAME="Zondy.LevelRenderer.Painter.Layer"}destroy(){this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=null,this.unusedCount=null,this.config=null,this.dirty=null,this.elCount=null,this.clearColor=null,this.motionBlur=null,this.lastFrameAlpha=null,this.zoomable=null,this.panable=null,this.maxZoom=null,this.minZoom=null,this.ctx=null,Ti.destroy.apply(this,arguments)}initContext(){this.ctx=this.dom.getContext("2d"),1!==Wi.devicePixelRatio&&this.ctx.scale(Wi.devicePixelRatio,Wi.devicePixelRatio)}createBackBuffer(){this.domBack=Wi.createDom(pi(),"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!==Wi.devicePixelRatio&&this.ctxBack.scale(Wi.devicePixelRatio,Wi.devicePixelRatio)}resize(t,e){this.dom.style.width=t+"px",this.dom.style.height=e+"px",this.dom.setAttribute("width",t*Wi.devicePixelRatio),this.dom.setAttribute("height",e*Wi.devicePixelRatio),1!==Wi.devicePixelRatio&&this.ctx.scale(Wi.devicePixelRatio,Wi.devicePixelRatio),this.domBack&&(this.domBack.setAttribute("width",t*Wi.devicePixelRatio),this.domBack.setAttribute("height",e*Wi.devicePixelRatio),1!==Wi.devicePixelRatio&&this.ctxBack.scale(Wi.devicePixelRatio,Wi.devicePixelRatio))}clear(){var t=this.dom,e=this.ctx,i=t.width,n=t.height,r=this.clearColor,o=this.motionBlur,s=this.lastFrameAlpha;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(t,0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio)),r?(e.save(),e.fillStyle=this.config.clearColor,e.fillRect(0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio),e.restore()):e.clearRect(0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio),o){var a=this.domBack;e.save(),e.globalAlpha=s,e.drawImage(a,0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio),e.restore()}}}class Ki extends Ei{constructor(t,e,i){super(t,e,i),this.root=t,this.storage=e,this.painter=i,this._lastX=0,this._lastY=0,this._mouseX=0,this._mouseY=0,this._findHover=null,this._domHover=null,this._findHover=function(t,e){return function(i,n,r){return t.call(e,i,n,r)}}(function(t,e,i){var n=this;if(n._draggingTarget&&n._draggingTarget.id===t.id||t.isSilent())return!1;var r=n._event;if(t.isCover(e,i)){if(t.hoverable)if(t.isHoverByRefDataID&&!0===t.isHoverByRefDataID){if(t.refDataID){var o=t.refDataID,s=null;t.refDataHoverGroup&&(s=t.refDataHoverGroup);for(var a=n.storage._shapeList,l=0,h=a.length;l<h;l++){var u=a[l];u.refDataID&&o===u.refDataID&&(s?u.refDataHoverGroup&&s===u.refDataHoverGroup&&n.storage.addHover(u):n.storage.addHover(u))}}}else n.storage.addHover(t);for(var c=t.parent;c;){if(c.clipShape&&!c.clipShape.isCover(n._mouseX,n._mouseY))return!1;c=c.parent}return n._lastHover!==t&&(n._processOutShape(r),n._processDragLeave(r),n._lastHover=t,n._processDragEnter(r)),n._processOverShape(r),n._processDragOver(r),n._hasfound=1,!0}return!1},this),this._domHover=i.getDomHover(),this.CLASS_NAME="Zondy.LevelRenderer.Handler";var n={resize:function(t){t=t||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(Yi.EVENT.RESIZE,t)},click:function(t){t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<10&&this._dispatchAgency(e,Yi.EVENT.CLICK,t),this._mousemoveHandler(t)},dblclick:function(t){t=t||window.event,t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<5&&this._dispatchAgency(e,Yi.EVENT.DBLCLICK,t),this._mousemoveHandler(t)},mousewheel:function(t){var e=((t=this._zrenderEventFixed(t)).wheelDelta||-t.detail)>0?1.1:1/1.1,i=this.painter.getLayers(),n=!1;for(var r in i)if("hover"!==r){var o=i[r],s=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var a=o.__zoom;a*=e,e=(a=Math.max(Math.min(o.maxZoom,a),o.minZoom))/o.__zoom,o.__zoom=a,s[0]-=(this._mouseX-s[0])*(e-1),s[1]-=(this._mouseY-s[1])*(e-1),o.scale[0]*=e,o.scale[1]*=e,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,Yi.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=Mi.Util_event.getX(t),this._mouseY=Mi.Util_event.getY(t);var e=this._mouseX-this._lastX,i=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,i),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var r=this.painter.getLayers(),o=!1;for(var s in r)if("hover"!==s){var a=r[s];a.panable&&(n="move",a.position[0]+=e,a.position[1]+=i,o=!0,a.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,Yi.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(Yi.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,Yi.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,Yi.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&&Mi.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment<Yi.EVENT.touchClickDelay&&(this._mobildFindFixed(t),this._clickHandler(t),e-this._lastClickMoment<Yi.EVENT.touchClickDelay/2&&(this._dblclickHandler(t),this._lastHover&&this._lastHover.clickable&&Mi.Util_event.stop(t)),this._lastClickMoment=e),this.painter.clearHover()}};function r(t,e){return function(i){return t.call(e,i)}}!function(t){var e=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],i=e.length;for(;i--;){var o=e[i];t["_"+o+"Handler"]=r(n[o],t)}}(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),Mi.Util_env.os.tablet||Mi.Util_env.os.phone?(t.addEventListener("touchstart",this._touchstartHandler),t.addEventListener("touchmove",this._touchmoveHandler),t.addEventListener("touchend",this._touchendHandler)):(t.addEventListener("click",this._clickHandler),t.addEventListener("dblclick",this._dblclickHandler),t.addEventListener("mousewheel",this._mousewheelHandler),t.addEventListener("mousemove",this._mousemoveHandler),t.addEventListener("mousedown",this._mousedownHandler),t.addEventListener("mouseup",this._mouseupHandler)),t.addEventListener("DOMMouseScroll",this._mousewheelHandler),t.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),t.attachEvent("onclick",this._clickHandler),t.ondblclick=this._dblclickHandler,t.attachEvent("onmousewheel",this._mousewheelHandler),t.attachEvent("onmousemove",this._mousemoveHandler),t.attachEvent("onmouseout",this._mouseoutHandler),t.attachEvent("onmousedown",this._mousedownHandler),t.attachEvent("onmouseup",this._mouseupHandler))}destroy(){this.dispose(),this._lastX=null,this._lastY=null,this._mouseX=null,this._mouseY=null,this._findHover=null,Ei.prototype.destroy.apply(this,arguments)}on(t,e){return this.bind(t,e),this}un(t,e){return this.unbind(t,e),this}trigger(t,e){var i=Yi.EVENT;switch(t){case i.RESIZE:case i.CLICK:case i.DBLCLICK:case i.MOUSEWHEEL:case i.MOUSEMOVE:case i.MOUSEDOWN:case i.MOUSEUP:case i.MOUSEOUT:this["_"+t+"Handler"](e)}}dispose(){var t=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),Mi.Util_env.os.tablet||Mi.Util_env.os.phone?(t.removeEventListener("touchstart",this._touchstartHandler),t.removeEventListener("touchmove",this._touchmoveHandler),t.removeEventListener("touchend",this._touchendHandler)):(t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblclickHandler),t.removeEventListener("mousewheel",this._mousewheelHandler),t.removeEventListener("mousemove",this._mousemoveHandler),t.removeEventListener("mousedown",this._mousedownHandler),t.removeEventListener("mouseup",this._mouseupHandler)),t.removeEventListener("DOMMouseScroll",this._mousewheelHandler),t.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),t.detachEvent("onclick",this._clickHandler),t.detachEvent("dblclick",this._dblclickHandler),t.detachEvent("onmousewheel",this._mousewheelHandler),t.detachEvent("onmousemove",this._mousemoveHandler),t.detachEvent("onmouseout",this._mouseoutHandler),t.detachEvent("onmousedown",this._mousedownHandler),t.detachEvent("onmouseup",this._mouseupHandler)),this.root=null,this._domHover=null,this.storage=null,this.painter=null,this.un()}_processDragStart(t){var e=this._lastHover;if(this._isMouseDown&&e&&e.draggable&&!this._draggingTarget&&this._mouseDownTarget===e){if(e.dragEnableTime&&new Date-this._lastMouseDownMoment<e.dragEnableTime)return;var i=e;this._draggingTarget=i,this._isDragging=1,i.invisible=!0,this.storage.mod(i.id),this._dispatchAgency(i,Yi.EVENT.DRAGSTART,t),this.painter.refresh()}}_processDragEnter(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,Yi.EVENT.DRAGENTER,t,this._draggingTarget)}_processDragOver(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,Yi.EVENT.DRAGOVER,t,this._draggingTarget)}_processDragLeave(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,Yi.EVENT.DRAGLEAVE,t,this._draggingTarget)}_processDrop(t){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,Yi.EVENT.DROP,t,this._draggingTarget))}_processDragEnd(t){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,Yi.EVENT.DRAGEND,t),this._lastHover=null),this._isDragging=0,this._draggingTarget=null}_processOverShape(t){this._dispatchAgency(this._lastHover,Yi.EVENT.MOUSEOVER,t)}_processOutShape(t){this._dispatchAgency(this._lastHover,Yi.EVENT.MOUSEOUT,t)}_dispatchAgency(t,e,i,n){var r="on"+e,o={type:e,event:i,target:t,cancelBubble:!1},s=t;for(n&&(o.dragged=n);s&&(s[r]&&(o.cancelBubble=s[r](o)),s.dispatch(e,o),s=s.parent,!o.cancelBubble););t?o.cancelBubble||this.dispatch(e,o):n||this.dispatch(e,{type:e,event:i})}_iterateAndFindHover(){for(var t,e=Mi.Util_matrix.create(),i=this.storage.getShapeList(),n=[0,0],r=i.length-1;r>=0;r--){var o=i[r];if(void 0!==o.zlevel&&(t=this.painter.getLayer(o.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(Mi.Util_matrix.invert(e,t.transform),Mi.Util_vector.applyTransform(n,n,e))),this._findHover(o,n[0],n[1]))break}}_mobildFindFixed(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 i=0;!this._lastHover&&i<e.length;i++){var n=e[i];n.x&&(this._mouseX+=n.x),n.y&&(this._mouseX+=n.y),this._iterateAndFindHover()}this._lastHover&&(t.zrenderX=this._mouseX,t.zrenderY=this._mouseY)}_zrenderEventFixed(t,e){if(t.zrenderFixed)return t;if(e){var i="touchend"!==t.type?t.targetTouches[0]:t.changedTouches[0];if(i){var n=this.root.getBoundingClientRect();t.zrenderX=i.clientX-n.left,t.zrenderY=i.clientY-n.top}}else{var r=(t=t||window.event).toElement||t.relatedTarget||t.srcElement||t.target;r&&r!==this._domHover&&(t.zrenderX=(void 0!==t.offsetX?t.offsetX:t.layerX)+r.offsetLeft,t.zrenderY=(void 0!==t.offsetY?t.offsetY:t.layerY)+r.offsetTop)}return t.zrenderFixed=1,t}getLastHoverOne(){return this._lastHover?this._lastHover:null}}class Qi{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Animation.Easing"}destroy(){}Linear(t){return t}QuadraticIn(t){return t*t}QuadraticOut(t){return t*(2-t)}QuadraticInOut(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}CubicIn(t){return t*t*t}CubicOut(t){return--t*t*t+1}CubicInOut(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}QuarticIn(t){return t*t*t*t}QuarticOut(t){return 1- --t*t*t*t}QuarticInOut(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}QuinticIn(t){return t*t*t*t*t}QuinticOut(t){return--t*t*t*t*t+1}QuinticInOut(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}SinusoidalIn(t){return 1-Math.cos(t*Math.PI/2)}SinusoidalOut(t){return Math.sin(t*Math.PI/2)}SinusoidalInOut(t){return.5*(1-Math.cos(Math.PI*t))}ExponentialIn(t){return 0===t?0:Math.pow(1024,t-1)}ExponentialOut(t){return 1===t?1:1-Math.pow(2,-10*t)}ExponentialInOut(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}CircularIn(t){return 1-Math.sqrt(1-t*t)}CircularOut(t){return Math.sqrt(1- --t*t)}CircularInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}ElasticIn(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))}ElasticOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)}ElasticInOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)}BackIn(t){var e=1.70158;return t*t*((e+1)*t-e)}BackOut(t){var e=1.70158;return--t*t*((e+1)*t+e)+1}BackInOut(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}BounceIn(t){return 1-this.BounceOut(1-t)}BounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}BounceInOut(t){return t<.5?.5*this.BounceIn(2*t):.5*this.BounceOut(2*t-1)+.5}}class Ji{constructor(t){this._targetPool=t.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=t.life||1e3,this._delay=t.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop=void 0!==t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this.CLASS_NAME="Zondy.LevelRenderer.Animation.Clip"}destroy(){}step(t){var e=new Qi,i=(t-this._startTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n="string"==typeof this.easing?e[this.easing]:this.easing,r="function"==typeof n?n(i):i;return this.fire("frame",r),1===i?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}}restart(){var t=((new Date).getTime()-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap}fire(t,e){for(var i=0,n=this._targetPool.length;i<n;i++)this["on"+t]&&this["on"+t](this._targetPool[i],e)}}class tn extends Ei{constructor(t){super(t),t=t||{},this.stage={},this.onframe=function(){},this._clips=[],this._running=!1,this._time=0,hi(this,t),this.CLASS_NAME="Zondy.LevelRenderer.Animation"}add(t){this._clips.push(t)}remove(t){var e=(new Li).indexOf(this._clips,t);e>=0&&this._clips.splice(e,1)}_update(){var t=(new Date).getTime(),e=t-this._time,i=this._clips,n=i.length,r=[],o=[];for(let e=0;e<n;e++){var s=i[e],a=s.step(t);a&&(r.push(a),o.push(s))}this.stage.update&&this.stage.update();for(let t=0;t<n;)i[t]._needsRemove?(i[t]=i[n-1],i.pop(),n--):t++;n=r.length;for(let t=0;t<n;t++)o[t].fire(r[t]);this._time=t,this.onframe(e),this.dispatch("frame",e)}start(){var t=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){setTimeout(t,16)},e=this;this._running=!0,this._time=(new Date).getTime(),t(function i(){e._running&&(e._update(),t(i))})}stop(){this._running=!1}clear(){this._clips=[]}animate(t,e){var i=new en(t,(e=e||{}).loop,e.getter,e.setter);return i.animation=this,i}static _interpolateNumber(t,e,i){return(e-t)*i+t}static _interpolateArray(t,e,i,n,r){var o=t.length;if(1===r)for(let r=0;r<o;r++)n[r]=tn._interpolateNumber(t[r],e[r],i);else{var s=t[0].length;for(let r=0;r<o;r++)for(let o=0;o<s;o++)n[r][o]=tn._interpolateNumber(t[r][o],e[r][o],i)}}static _isArrayLike(t){switch(typeof t){case"undefined":case"string":return!1}return void 0!==t.length}static _catmullRomInterpolateArray(t,e,i,n,r,o,s,a,l){var h=t.length;if(1===l)for(let l=0;l<h;l++)a[l]=tn._catmullRomInterpolate(t[l],e[l],i[l],n[l],r,o,s);else{var u=t[0].length;for(let l=0;l<h;l++)for(var c=0;c<u;c++)a[l][c]=tn._catmullRomInterpolate(t[l][c],e[l][c],i[l][c],n[l][c],r,o,s)}}static _catmullRomInterpolate(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}static _cloneValue(t){var e=Array.prototype.slice;if(tn._isArrayLike(t)){var i=t.length;if(tn._isArrayLike(t[0])){for(var n=[],r=0;r<i;r++)n.push(e.call(t[r]));return n}return e.call(t)}return t}static rgba2String(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}}class en{constructor(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||function(t,e){return t[e]},this._setter=n||function(t,e,i){t[e]=i},this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[],this.CLASS_NAME="Zondy.LevelRenderer.Animation.Animator"}when(t,e){for(var i in e)this._tracks[i]||(this._tracks[i]=[],0!==t&&this._tracks[i].push({time:0,value:tn._cloneValue(this._getter(this._target,i))})),this._tracks[i].push({time:parseInt(t,10),value:e[i]});return this}during(t){return this._onframeList.push(t),this}start(t){var e=this,i=this._setter,n=this._getter,r=e._onframeList.length,o="spline"===t,s=function(){if(e._clipCount--,0===e._clipCount){e._tracks={};for(var t=e._doneList.length,i=0;i<t;i++)e._doneList[i].call(e)}},a=function(a,l){var h=a.length;if(h){var u=a[0].value,c=tn._isArrayLike(u),p=!1,f=c&&tn._isArrayLike(u[0])?2:1;a.sort(function(t,e){return t.time-e.time});var d=a[h-1].time,g=[],y=[];for(let t=0;t<h;t++){g.push(a[t].time/d);var m=a[t].value;"string"==typeof m&&(0===(m=Mi.Util_color.toArray(m)).length&&(m[0]=m[1]=m[2]=0,m[3]=1),p=!0),y.push(m)}var _,v,x,b,w,S,E,L=0,C=0;if(p)var P=[0,0,0,0];var I=new Ji({target:e._target,life:d,loop:e._loop,delay:e._delay,onframe:function(t,s){if(s<C){for(_=Math.min(L+1,h-1),v=_;v>=0&&!(g[v]<=s);v--);v=Math.min(v,h-2)}else{for(v=L;v<h&&!(g[v]>s);v++);v=Math.min(v-1,h-2)}L=v,C=s;var a=g[v+1]-g[v];if(0!==a){if(x=(s-g[v])/a,o)if(w=y[v],b=y[0===v?v:v-1],S=y[v>h-2?h-1:v+1],E=y[v>h-3?h-1:v+2],c)tn._catmullRomInterpolateArray(b,w,S,E,x,x*x,x*x*x,n(t,l),f);else{let e;e=p?tn.rgba2String(P):tn._catmullRomInterpolate(b,w,S,E,x,x*x,x*x*x),i(t,l,e)}else if(c)tn._interpolateArray(y[v],y[v+1],x,n(t,l),f);else{let e;p?(tn._interpolateArray(y[v],y[v+1],x,P,1),e=tn.rgba2String(P)):e=tn._interpolateNumber(y[v],y[v+1],x),i(t,l,e)}for(v=0;v<r;v++)e._onframeList[v](t,s)}},ondestroy:s});t&&"spline"!==t&&(I.easing=t),e._clipList.push(I),e._clipCount++,e.animation.add(I)}};for(var l in this._tracks)a(this._tracks[l],l);return this}stop(){for(var t=0;t<this._clipList.length;t++){var e=this._clipList[t];this.animation.remove(e)}this._clipList=[]}delay(t){return this._delay=t,this}done(t){return t&&this._doneList.push(t),this}}class nn{constructor(t,e){this.id=t,this.storage=new Xi,this.painter=new Wi(e,this.storage),this.handler=new Ki(e,this.storage,this.painter),this.animatingElements=[],this.animation=new tn({stage:{update:nn.getFrameCallback(this)}}),this._needsRefreshNextFrame=!1,this.animation.start(),this.CLASS_NAME="Zondy.LevelRenderer.Render"}destroy(){this.id=null,this.storage=null,this.painter=null,this.handler=null,this.animatingElements=null,this.animation=null,this._needsRefreshNextFrame=null}getId(){return this.id}addShape(t){return this.storage.addRoot(t),this}addGroup(t){return this.storage.addRoot(t),this}delShape(t){return this.storage.delRoot(t),this}delGroup(t){return this.storage.delRoot(t),this}modShape(t,e){return this.storage.mod(t,e),this}modGroup(t,e){return this.storage.mod(t,e),this}modLayer(t,e){return this.painter.modLayer(t,e),this}addHoverShape(t){return this.storage.addHover(t),this}render(t){return this.painter.render(t),this._needsRefreshNextFrame=!1,this}refresh(t){return this.painter.refresh(t),this._needsRefreshNextFrame=!1,this}refreshNextFrame(){return this._needsRefreshNextFrame=!0,this}refreshHover(t){return this.painter.refreshHover(t),this}refreshShapes(t,e){return this.painter.refreshShapes(t,e),this}resize(){return this.painter.resize(),this}animate(t,e,i){if("string"==typeof t&&(t=this.storage.get(t)),t){var n;if(e){for(var r=e.split("."),o=t,s=0,a=r.length;s<a;s++)o&&(o=o[r[s]]);o&&(n=o)}else n=t;if(!n)return;var l=this.animatingElements;return void 0===t.__aniCount&&(t.__aniCount=0),0===t.__aniCount&&l.push(t),t.__aniCount++,this.animation.animate(n,{loop:i}).done(function(){if(t.__aniCount--,0===t.__aniCount){var e=ci(l,t);l.splice(e,1)}})}}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(t,e,i){return this.painter.toDataURL(t,e,i)}shapeToImage(t,e,i){var n=pi();return this.painter.shapeToImage(n,t,e,i)}on(t,e){return this.handler.on(t,e),this}un(t,e){return this.handler.un(t,e),this}trigger(t,e){return this.handler.trigger(t,e),this.handler.dispatch(t,e),this}clear(){return this.storage.delRoot(),this.painter.clear(),this}dispose(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=null,this.animatingElements=null,this.storage=null,this.painter=null,this.handler=null}updateHoverShapes(t){return this.painter.updateHoverLayer(t),this}getAllShapes(){return this.storage._shapeList}clearAll(){return this.clear(),this.painter.clearHover(),this}getHoverOne(){return this.handler.getLastHoverOne()}static getFrameCallback(t){return function(){var e=t.animatingElements;if(e instanceof Array){for(var i=0,n=e.length;i<n;i++)t.storage.mod(e[i].id);(e.length||t._needsRefreshNextFrame)&&t.refresh()}}}}class rn{constructor(){rn._instances={},rn.Tool={},this.CLASS_NAME="Zondy.LevelRenderer"}destroy(){this.dispose()}init(t){var e=new nn(pi(),t);return rn._instances[e.id]=e,e}dispose(t){if(t)t.dispose(),this.delInstance(t.id);else{for(var e in rn._instances)rn._instances[e].dispose();rn._instances={}}return this}getInstance(t){return rn._instances[t]}delInstance(t){return delete rn._instances[t],this}}const on={Bar:class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar"}destroy(){super.destroy()}assembleShapes(){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 i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.dataViewBox,r=this.dataValues;if(!(r.length<1)){for(let t=0,e=r.length;t<e;t++)if(r[t]<i[0]||r[t]>i[1])return;var o=this.calculateXShapeInfo();if(o){var s=o.xPositions,a=o.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(Bi.GraphAxis(this.shapeFactory,n,e,o)));for(var l=0;l<r.length;l++){var h=n[1]-(r[l]-i[0])/this.DVBUnitValue,u=[[s[l]-a/2,n[1]-1],[s[l]+a/2,n[1]-1],[s[l]+a/2,h],[s[l]-a/2,h]],c=new _i(u);if(void 0===e.showShadow||e.showShadow){if(e.barShadowStyle){var p=e.barShadowStyle;p.shadowBlur&&(t.shadowBlur=p.shadowBlur),p.shadowColor&&(t.shadowColor=p.shadowColor),p.shadowOffsetX&&(t.shadowOffsetX=p.shadowOffsetX),p.shadowOffsetY&&(t.shadowOffsetY=p.shadowOffsetY)}c.style={},li(c.style,t)}c.refDataID=this.data.id,c.dataInfo={field:this.fields[l],value:r[l]},void 0!==e.barHoverAble&&(c.hoverable=e.barHoverAble),void 0!==e.barClickAble&&(c.clickable=e.barClickAble),this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}resetLinearGradient(){if(this.RelativeCoordinate)for(var t=this.shapes.length,e=this.setting.barLinearGradient,i=-1,n=0;n<t;n++){var r=this.shapes[n];if("Zondy.LevelRenderer.Shape.SmicPolygon"===r.CLASS_NAME){var o=r.style,s=this.location[0]+o.pointList[0][0],a=this.location[0]+o.pointList[1][0];++i>=e.length&&(i%=e.length);var l=e[i][0],h=e[i][1],u=(new Ii).getLinearGradient(s,0,a,0,[[0,l],[1,h]]);r.style.color=u}}}},Bar3D:class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,25,20,20]:t.dataViewBoxParameter=[5,5,5,5]),t.axisUseArrow=void 0===t.axisUseArrow||t.axisUseArrow,t.axisXLabelsOffset=void 0!==t.axisXLabelsOffset?t.axisXLabelsOffset:[-10,10],this.initBaseParameter()){var e=this.DVBCodomain;this.DVBUnitValue=(e[1]-e[0])/this.DVBHeight;var i=this.dataViewBox,n=this.dataValues;if(!(n.length<1)){for(let t=0,i=n.length;t<i;t++)if(n[t]<e[0]||n[t]>e[1])return;var r=this.calculateXShapeInfo();if(r){var o=r.xPositions,s=r.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Bi.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(Bi.GraphAxis(this.shapeFactory,i,t,r)));var a=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10;for(let r=0;r<n.length;r++){var l=i[1]-(n[r]-e[0])/this.DVBUnitValue,h=o[r]-s/2,u=o[r]+s/2,c=[[h,l],[u,l],[u-a,l+a],[h-a,l+a]],p=[[u,l],[u-a,l+a],[u-a,i[1]+a],[u,i[1]]],f=[[h-a,i[1]+a],[u-a,i[1]+a],[u-a,l+a],[h-a,l+a]];a<=0&&(f=[[h,i[1]],[u,i[1]],[u,l],[h,l]]);var d=new _i(c),g=new _i(p),y=new _i(f);t.barSideStyle=t.barSideStyle?t.barSideStyle:t.barFaceStyle,t.barSideStyleByFields=t.barSideStyleByFields?t.barSideStyleByFields:t.barFaceStyleByFields,t.barSideStyleByCodomain=t.barSideStyleByCodomain?t.barSideStyleByCodomain:t.barFaceStyleByCodomain,t.barTopStyle=t.barTopStyle?t.barTopStyle:t.barFaceStyle,t.barTopStyleByFields=t.barTopStyleByFields?t.barTopStyleByFields:t.barFaceStyleByFields,t.barTopStyleByCodomain=t.barTopStyleByCodomain?t.barTopStyleByCodomain:t.barFaceStyleByCodomain,y.style=Bi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barFaceStyle,t.barFaceStyleByFields,t.barFaceStyleByCodomain,r,n[r]),g.style=Bi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barSideStyle,t.barSideStyleByFields,t.barSideStyleByCodomain,r,n[r]),d.style=Bi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barTopStyle,t.barTopStyleByFields,t.barTopStyleByCodomain,r,n[r]),t.barSideHoverStyle=t.barSideHoverStyle?t.barSideHoverStyle:t.barFaceHoverStyle,t.barTopHoverStyle=t.barTopHoverStyle?t.barTopHoverStyle:t.barFaceHoverStyle,y.highlightStyle=Bi.ShapeStyleTool({stroke:!0},t.barFaceHoverStyle),g.highlightStyle=Bi.ShapeStyleTool({stroke:!0},t.barSideHoverStyle),d.highlightStyle=Bi.ShapeStyleTool({stroke:!0},t.barTopHoverStyle),d.refDataID=g.refDataID=y.refDataID=this.data.id,d.isHoverByRefDataID=g.isHoverByRefDataID=y.isHoverByRefDataID=!0,d.refDataHoverGroup=g.refDataHoverGroup=y.refDataHoverGroup=pi(),d.dataInfo=g.dataInfo=y.dataInfo={field:this.fields[r],value:n[r]},void 0!==t.barHoverAble&&(d.hoverable=g.hoverable=y.hoverable=t.barHoverAble),void 0!==t.barClickAble&&(d.clickable=g.clickable=y.clickable=t.barClickAble),this.shapes.push(this.shapeFactory.createShape(g)),this.shapes.push(this.shapeFactory.createShape(d)),this.shapes.push(this.shapeFactory.createShape(y))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}},OverlayCircle:class extends Ui{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Circle"}destroy(){super.destroy()}assembleShapes(){if(!this.setting)return!1;var t=this.setting;if(!t.codomain)return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=ji.getDataValues(this.data,this.fields,e);this.dataValues=i||[];var n=this.dataValues;t.maxR||(t.maxR=100),t.minR||(t.minR=0);var r=this.DVBCodomain;r&&r[1]-r[0]>0?this.DVBUnitValue=t.maxR/(r[1]-r[0]):this.DVBUnitValue=t.maxR;var o=this.DVBUnitValue,s=n[0]*o+t.minR;if(this.width=2*s,this.height=2*s,this.initBaseParameter()&&(!r||!(n[0]<r[0]||n[0]>r[1]))){var a=this.DVBCenterPoint,l=new Si(a[0],a[1],s);l.style=Bi.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?l.style.fillColor=t.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=Bi.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(l.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(l.clickable=t.circleClickAble),l.refDataID=this.data.id,l.dataInfo={field:this.fields[0],r:s,value:n[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}}};on.Graph=Gi,on.Line=class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues;if(!(r.length<1)){var o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Bi.GraphAxis(this.shapeFactory,e,t,o));for(var h=[],u=[],c=0,p=r.length;c<p;c++){if(r[c]<i[0]||r[c]>i[1])return null;s=l[c],a=e[1]-(r[c]-i[0])/n;var f=new yi(s,a);f.style=Bi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,c,r[c]),f.highlightStyle=Bi.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[c],value:r[c]},u.push(this.shapeFactory.createShape(f));var d=[s,a];h.push(d)}var g=new mi(h);g.style=Bi.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),g.clickable=!1,g.hoverable=!1;var y=this.shapeFactory.createShape(g);this.shapes.push(y),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}},on.Pie=class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Pie"}destroy(){super.destroy()}assembleShapes(){var t=this.setting,e=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}];if(this.initBaseParameter()){t.useBackground&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,t));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=0;c<i.length;c++){var p=Math.abs(i[c]);(l=0===c?a+p*o:c===p.length-1?h:a+p*o)-a>=360&&(l=359.9999999);var f=new xi(s[0],s[1],u,a,l);if(void 0===t.sectorStyleByFields){var d=c%e.length;f.style=Bi.ShapeStyleTool(null,t.sectorStyle,e,null,d)}else f.style=Bi.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,c,i[c]);f.highlightStyle=Bi.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(f.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(f.clickable=t.sectorClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[c],value:i[c]},this.shapes.push(this.shapeFactory.createShape(f)),a=l}this.shapesConvertToRelativeCoordinate()}}}},on.OverlayPoint=qi,on.RankSymbol=Ui,on.Ring=class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Ring"}destroy(){super.destroy()}assembleShapes(){if(this.initBaseParameter()){var t=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}],e=this.setting;e.useBackground&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,e));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=e.innerRingRadius>=0&&e.innerRingRadius<u,p=void 0!==e.innerRingRadius&&!isNaN(e.innerRingRadius)&&c?e.innerRingRadius:0,f=0;f<i.length;f++){var d=Math.abs(i[f]);l=0===f?a+d*o:f===d.length-1?h:a+d*o;var g=new xi(s[0],s[1],u,a,l,p);if(void 0===e.sectorStyleByFields){var y=f%t.length;g.style=Bi.ShapeStyleTool(null,e.sectorStyle,t,null,y)}else g.style=Bi.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,f,i[f]);g.highlightStyle=Bi.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(g.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(g.clickable=e.sectorClickAble),g.refDataID=this.data.id,g.dataInfo={field:this.fields[f],value:i[f]},this.shapes.push(this.shapeFactory.createShape(g)),a=l}this.shapesConvertToRelativeCoordinate()}}}},on.ThemeVector=Hi,on.Point=qi;var sn=r.Layer.extend({options:{name:null,opacity:1,TFEvents:null},initialize(t,e){r.Util.setOptions(this,e),this.options.name=t,this.features=[],this.TFEvents=e&&e.TFEvents?e.TFEvents:[],this.levelRenderer=new rn,this.movingOffset=[0,0]},getEvents(){const t=this,e={zoomend:t._reset,moveend:t._reset,resize:t._resize};return this._map._zoomAnimated&&(e.zoomanim=t._zoomAnim),e},onRemove(t){r.DomUtil.remove(this.container),t.off("mousemove",this.mouseMoveHandler)},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.update()},addFeatures(t){},redrawThematicFeatures(t){},destroyFeatures(t){if(void 0===t&&(t=this.features),t){this.removeFeatures(t);for(let e=t.length-1;e>=0;e--)t[e].destroy()}},removeFeatures(t){const e=this;if(!t||0===t.length)return;if(t===e.features)return e.removeAllFeatures();r.Util.isArray(t)||(t=[t]);const i=[];for(let o=t.length-1;o>=0;o--){var n=t[o];const s=r.Util.indexOf(e.features,n);-1!==s?e.features.splice(s,1):i.push(n)}const o=[];for(let t=0,i=e.features.length;t<i;t++)n=e.features[t],o.push(n);e.features=[],e.addFeatures(o),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures());const s=0===i.length;e.fire("featuresremoved",{features:i,succeed:s})},removeAllFeatures(){const t=this;t.renderer&&t.renderer.clear(),t.features=[],t.fire("featuresremoved",{features:[],succeed:!0})},getFeatures(){const t=this,e=t.features.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=t.features[n];return i},getFeatureBy(t,e){return this.features.find(i=>{const n=i.attributes;if(i[t]===e||n[t]===e)return i})},getFeatureById(t){return this.getFeatureBy("id",t)},getFeaturesByAttribute(t,e){const i=this;let n;const r=[];for(const o in i.features)(n=i.features[o])&&n.attributes&&n.attributes[t]===e&&r.push(n);return r},update(t){const e=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,e);const i=this;i.renderer&&i.redrawThematicFeatures(t),i.currentMousePosition&&(i.currentMousePosition=r.point(i.currentMousePosition.x-i.movingOffset[0],i.currentMousePosition.y-i.movingOffset[1])),i.movingOffset=[0,0],i._zoom=i._map.getZoom(),i._center=i._map.getCenter()},setOpacity(t){const e=this;t!==e.options.opacity&&(isNaN(t)||(e.options.opacity=t,e._updateOpacity()))},redraw(){const t=this;return!!t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures(),!0)},on(t,e,i){return this.renderer?this.renderer.on(t,e):r.Layer.prototype.on.call(this,t,e),this},off(t,e,i){const n=this;return n.renderer?n.renderer.un(t,e):r.Layer.prototype.off.call(this,t,e),this},fire(t,e,i){return this.renderer&&this.renderer.trigger(t,e),r.Layer.prototype.fire.call(this,t,e,i),this},addTFEvents(){const t=this,e=t.TFEvents,i=e.length;for(let n=0;n<i;n++)t.renderer.on(e[n][0],e[n][1])},getLocalXY(t){if(!this._map)return t;let e=t;r.Util.isArray(t)?e=r.point(t[0],t[1]):t instanceof r.Point||(e=t instanceof Zondy.LonLat?r.point(t.lon,t.lat):r.point(t.x,t.y));const i=this._map.latLngToContainerPoint(this._map.options.crs.unproject(e));return[i.x,i.y]},_initContainer(){const t=this.getPane(),e=this._map.options.zoomAnimation&&r.Browser.any3d;let i=this.options.name||"themeLayer";i+=` leaflet-layer leaflet-zoom-${e?"animated":"hide"}`,this.container=r.DomUtil.create("div",i,t);const n=r.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);this.container.style[n]="50% 50%",this.container.style.position="absolute",this.container.style.zIndex=200},_zoomAnim(t){const e=this._map.getZoomScale(t.zoom),i=this._map._getCenterOffset(t.center)._multiplyBy(-e).subtract(this._map._getMapPanePos());r.DomUtil.setTransform?r.DomUtil.setTransform(this.container,i,e):this.container.style[r.DomUtil.TRANSFORM]=`${r.DomUtil.getTranslateString(i)} scale(${e})`},_updateOpacity(){const t=this;!function(t,e,i,n,r,o,s,a){e&&(t.id=e),i&&(t.style.left=i.x+"px",t.style.top=i.y+"px"),n&&(t.style.width=n.w+"px",t.style.height=n.h+"px"),r&&(t.style.position=r),o&&(t.style.border=o),s&&(t.style.overflow=s),parseFloat(a)>=0&&parseFloat(a)<1?(t.style.filter="alpha(opacity="+100*a+")",t.style.opacity=a):1===parseFloat(a)&&(t.style.filter="",t.style.opacity="")}(t.container,null,null,null,null,null,null,t.options.opacity),null!==t._map&&t._map.fire("changelayer",{layer:t,property:"opacity"})},_reset(){const t=this,e=t._map.getBounds();t.update(e);const i=t._map.getSize(),n=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,n),parseFloat(t.container.width)!==parseFloat(i.x)&&(t.container.width=`${i.x}px`),parseFloat(t.container.height)!==parseFloat(i.y)&&(t.container.height=`${i.y}px`),t.redraw()},_resize(){const t=this._map.getSize();this.container.style.width=`${t.x}px`,this.container.style.height=`${t.y}px`,this.renderer.resize()}});var an=sn.extend({options:{nodesClipPixel:2,isHoverAble:!1,isMultiHover:!1,isClickAble:!0,isAllowFeatureStyle:!1},initialize(t,e){sn.prototype.initialize.call(this,t,e),r.Util.setOptions(this,e);this.cache={},this.cacheFields=[],this.style={},this.highlightStyle={}},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=null,n=t.AttStruct,r=t.SFEleArray;if(null!==r&&r.length>0)for(let t=0;t<r.length;t++){const o=r[t];if(null!==o.AttValue&&o.AttValue.length>0){const t={};for(let e=0;e<o.AttValue.length;e++)t[n.FldName[e]]=o.AttValue[e];t.FID=o.FID}o.attributes=i,e.features.push(o)}}e.isCustomSetMaxCacheCount||(e.maxCacheCount=5*e.features.length),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},removeFeatures(t){this.clearCache(),sn.prototype.removeFeatures.call(this,arguments)},removeAllFeatures(){this.clearCache(),sn.prototype.removeAllFeatures.call(this,arguments)},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;if(i&&i.refDataID&&(o=i.refDataID),t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent(t.min.x,t.min.y,t.max.x,t.max.y)}e.renderer.clearAll();const s=e.features,a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i],r=n.bound;if(t&&!t.intersectsBounds(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},createThematicFeature(t){const e=this,i=e.getStyleByData(t),n={};n.nodesClipPixel=e.options.nodesClipPixel,n.isHoverAble=e.options.isHoverAble,n.isMultiHover=e.options.isMultiHover,n.isClickAble=e.options.isClickAble,n.highlightStyle=Bi.transformStyle(e.highlightStyle);const r=new Hi(t,e,Bi.transformStyle(i),n);for(let t=0;t<r.shapes.length;t++)e.renderer.addShape(r.shapes[t]);return r},getStyleByData(t){},redraw(){return this.clearCache(),sn.prototype.redraw.apply(this,arguments)},clearCache(){this.cache={},this.cacheFields=[]},clear(){this.renderer.clearAll(),this.renderer.refresh(),this.removeAllFeatures(),this.clearCache()},getCacheCount(){return this.cacheFields.length},setMaxCacheCount(t){isNaN(t)||(this.maxCacheCount=t,this.isCustomSetMaxCacheCount=!0)},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=li({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++){if(t===e-1?s>=r[t].start&&s<=r[t].end:s>=r[t].start&&s<r[t].end){const e=r[t].style;n=li(n,e)}}return n}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=li({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++)if(!s&&!r[t].value||s&&r[t].value&&s.toString()===r[t].value.toString()){const e=r[t].style;n=li(n,e);break}return n}});var ln=sn.extend({options:{isOverLay:!0},initialize(t,e,i){const n=[];n.push(t),n.push(i),sn.prototype.initialize.apply(this,n),this.chartsType=e,this.themeFields=i&&i.themeFields?i.themeFields:null,this.charts=i&&i.charts?i.charts:[],this.cache=i&&i.cache?i.cache:{},this.chartsSetting=i&&i.chartsSetting?i.chartsSetting:{}},setChartsType(t){this.chartsType=t,this.redraw()},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=t.features;if(Array.isArray(i)&&i.length>0)for(let t=0;t<i.length;t++){const n=i[t];e.features.push(n)}}e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},redrawThematicFeatures(t){const e=this;e.renderer.clearAll();const i=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}for(let n=0,r=i.length;n<r;n++){const r=i[n];if(!r||!r.geometry)continue;const o=r.geometry.extent;if(t&&!t.intersects(o))continue;const s=e.cache,a=r.id;if(!s[a]){s[a]=a;const t=e.createThematicFeature(r),i=e.overlayWeightField&&r.attributes[e.overlayWeightField]&&!isNaN(r.attributes[e.overlayWeightField]);t&&i&&(t.__overlayWeight=r.attributes[e.overlayWeightField]),t&&e.charts.push(t)}}e.drawCharts()},createThematicFeature(t){const e=this;let i;return on[e.chartsType]&&e.themeFields&&e.chartsSetting&&(i=new on[e.chartsType](t,e,e.themeFields,e.chartsSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},drawCharts(){const t=this;t.renderer&&(t.overlayWeightField&&t._sortChart(),t.options&&!t.options.isOverLay?t._addOverlayShape():t._addNoOverlayShape(),t.renderer.render())},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e},isQuadrilateralOverLap(t,e){const i=[{x:t.xmin,y:t.ymin},{x:t.xmax,y:t.ymin},{x:t.xmax,y:t.ymax},{x:t.xmin,y:t.ymax}],r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}],o=this,s=i.length,a=r.length;if(4!==s||4!==a)return null;let l=!1;for(let t=0;t<s;t++)if(o.isPointInPoly(i[t],r)){l=!0;break}for(let t=0;t<a;t++)if(o.isPointInPoly(r[t],i)){l=!0;break}for(let t=0;t<s-1&&!l;t++)for(let e=0;e<a-1;e++){const s=o.lineIntersection(i[t],i[t+1],r[e],r[e+1]);if(s&&s.type===n.GeometryType.point){l=!0;break}}return l},lineIntersection(t,e,i,r){let o,s,a=null;const l=(r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x),h=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),u=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==u)s=h/u,a=(o=l/u)>=0&&s<=1&&o<=1&&s>=0?new n.Point({coordinates:[t.x+o*(e.x-t.x),t.y+o*(e.y-t.y)]}):"No Intersection";else if(0===l&&0===h){const n=Math.max(t.y,e.y),o=Math.min(t.y,e.y),s=Math.max(t.x,e.x),l=Math.min(t.x,e.x);a=(i.y>=o&&i.y<=n||r.y>=o&&r.y<=n)&&i.x>=l&&i.x<=s||r.x>=l&&r.x<=s?"Coincident":"Parallel"}else a="Parallel";return a},isPointInPoly(t,e){for(var i=!1,n=-1,r=e.length,o=r-1;++n<r;o=n)(e[n].y<=t.y&&t.y<e[o].y||e[o].y<=t.y&&t.y<e[n].y)&&t.x<(e[o].x-e[n].x)*(t.y-e[n].y)/(e[o].y-e[n].y)+e[n].x&&(i=!i);return i},isChartInMap(t,e){const i=t;let n=!1;const r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}];for(let t=0,e=r.length;t<e;t++){const e=r[t];if(e.x>=i.xmin&&e.x<=i.xmax&&e.y>=i.ymin&&e.y<=i.ymax){n=!0;break}}return n},isSuitableChart:(t,e,i)=>Math.abs(i)<=1,clearCache(){this.cache={},this.charts=[]},removeFeatures(t){this.clearCache(),sn.prototype.removeFeatures.apply(this,arguments)},removeAllFeatures(){this.clearCache(),sn.prototype.removeAllFeatures.apply(this,arguments)},redraw(){return this.clearCache(),sn.prototype.redraw.apply(this,arguments)},clear(){const t=this;t.renderer&&(t.renderer.clearAll(),t.renderer.refresh()),t.removeAllFeatures(),t.clearCache()},getWeightFieldValue(t,e,i){if((void 0===i||isNaN(i))&&(i=0),!t.attributes)return i;let n=t.attributes[e];return(void 0===n||isNaN(n))&&(n=i),n},_sortChart(){this.charts&&this.charts.sort(function(t,e){return void 0===t.__overlayWeight&&void 0===e.__overlayWeight?0:void 0!==t.__overlayWeight&&void 0===e.__overlayWeight?-1:void 0===t.__overlayWeight&&void 0!==e.__overlayWeight?1:void 0!==t.__overlayWeight&&void 0!==e.__overlayWeight?parseFloat(t.__overlayWeight)<parseFloat(e.__overlayWeight)?1:-1:0})},_addOverlayShape(){const t=this,e=t.charts;for(let i=0,n=e.length;i<n;i++){const n=e[i],r=n.resetLocation(),o=n.shapes;for(let e=0,i=o.length;e<i;e++)o[e].refOriginalPosition=r,t.renderer.addShape(o[e])}},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.charts,s=[],a=t.getLocalXY(e.min),l=t.getLocalXY(e.max),h=new n.Extent({xmin:Math.min(parseFloat(a[0]),parseFloat(l[0])),xmax:Math.max(parseFloat(a[0]),parseFloat(l[0])),ymin:Math.min(parseFloat(a[1]),parseFloat(l[1])),ymax:Math.max(parseFloat(a[1]),parseFloat(l[1]))});for(let e=0,i=o.length;e<i;e++){const i=o[e],n=i.resetLocation(),r=i.chartBounds;if(h&&!t.isChartInMap(h,r))continue;const a=t._map.getZoom()-t.options.fitZoom;if(h&&t.options.fitZoom>-1&&!t.isSuitableChart(h,r,a))continue;let l=!1;for(let e=0;e<s.length;e++)if(t.isQuadrilateralOverLap(r,s[e])){l=!0;break}if(l)continue;s.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[],this.keepStyle=!0},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=li({},this.style);return t.fillColor=this.getColor(),t},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.zoomstartHandler=function(t){e.keepStyle=!1},t.on("zoomstart ",e.zoomstartHandler),e.zoomendHandler=function(t){e.keepStyle=!0},t.on("zoomend",e.zoomendHandler),e.update()},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;i&&i.refDataID&&(o=i.refDataID);const s=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}e.renderer.clearAll();const a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i];if(!n||!n.geometry)continue;const r=n.geometry.extent;if(t&&!t.intersects(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]&&e.keepStyle){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},redraw(){return this.keepStyle||this.clearCache(),sn.prototype.redraw.apply(this,arguments)}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[]},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=this,e=li({},t.style);return null===e.fillColor&&(e.fillColor=t.getColor()),t.style=e,e},redraw(){return sn.prototype.redraw.apply(this,arguments)}});ln.extend({initialize(t,e,i){ln.prototype.initialize.apply(this,arguments),this.symbolType=e,this.symbolSetting={}},setSymbolType(t){this.symbolType=t,this.redraw()},createThematicFeature(t){const e=this;let i;return ji[e.symbolType]&&e.themeField&&e.symbolSetting&&(i=new ji[e.symbolType](t,e,[e.themeField],e.symbolSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.getLocalXY(e.min),s=t.getLocalXY(e.max),a=new n.Extent({xmin:Math.min(parseFloat(o[0]),parseFloat(s[0])),xmax:Math.max(parseFloat(o[0]),parseFloat(s[0])),ymin:Math.min(parseFloat(o[1]),parseFloat(s[1])),ymax:Math.max(parseFloat(o[1]),parseFloat(s[1]))}),l=t.charts,h=[];for(let e=0,i=l.length;e<i;e++){const i=l[e],n=i.resetLocation(),r=i.chartBounds;if(a&&!t.isChartInMap(a,r))continue;const o=t._map.getZoom();t.options.fitZoom;if(a&&t.options.fitZoom>-1&&Math.abs(o-t.options.fitZoom)>1)continue;let s=!1;for(let e=0;e<h.length;e++)if(t.isQuadrilateralOverLap(r,h[e])){s=!0;break}if(s)continue;h.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});var hn=class{constructor(t){t=t||{},this.fill=!0,this.fillColor="#000000",this.fillOpacity=1,this.stroke=!1,this.strokeColor="#000000",this.strokeOpacity=1,this.strokeWidth=1,this.strokeLinecap="butt",this.strokeLineJoin="miter",this.strokeDashstyle="solid",this.pointRadius=6,this.shadowBlur=0,this.shadowColor="#000000",this.shadowOffsetX=0,this.shadowOffsetY=0,this.label="",this.labelRect=!1,this.fontColor="",this.fontSize=12,this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontFamily="arial,sans-serif",this.labelPosition="top",this.labelAlign="center",this.labelBaseline="middle",this.labelXOffset=0,this.labelYOffset=0,hi(this,t)}};class un{}un.convertFeature=Qe;var cn=un;i.d(e,"MapViewLeaflet",function(){return ri}),i.d(e,"MapView",function(){return ri}),i.d(e,"Popup",function(){return ie}),i.d(e,"Screenshot",function(){return se}),i.d(e,"DrawControl",function(){return si}),i.d(e,"SketchEditorLeaflet",function(){return ai}),i.d(e,"SketchEditor",function(){return ai}),i.d(e,"GraphThemeLayer",function(){return ln}),i.d(e,"ThemeStyle",function(){return hn}),i.d(e,"getLayerView",function(){return ii}),i.d(e,"initializeOptions",function(){return dt}),i.d(e,"initializeCRS",function(){return ft}),i.d(e,"IGSTileLayer",function(){return wt}),i.d(e,"IGSMapImageLayer",function(){return Lt}),i.d(e,"IGSImageryLayer",function(){return Xt}),i.d(e,"IGSImageryTileLayer",function(){return qt}),i.d(e,"ArcGISMapImageLayer",function(){return It}),i.d(e,"WebMapServiceLayer",function(){return Tt}),i.d(e,"WebMapTileServiceLayer",function(){return Ot}),i.d(e,"WebTileLayer",function(){return Nt}),i.d(e,"ArcGISTileLayer",function(){return At}),i.d(e,"VectorTileLayer",function(){return Rt}),i.d(e,"FeatureLayer",function(){return kt}),i.d(e,"MapVLayer",function(){return Vt}),i.d(e,"EchartsLayer",function(){return Ut}),i.d(e,"FeatureLayerUtil",function(){return cn}),i.d(e,"SwipeControl",function(){return F}),i.d(e,"SwipeTool",function(){return Yt}),i.d(e,"L",function(){return r}),window.L=r,n.zondy.leaflet={},n.zondy.leaflet.layer={},n.zondy.leaflet.layer.IGSTileLayer=wt,n.zondy.leaflet.layer.IGSMapImageLayer=Lt,n.zondy.leaflet.layer.IGSImageryLayer=Xt,n.zondy.leaflet.layer.IGSImageryTileLayer=qt,n.zondy.leaflet.layer.ArcGISMapImageLayer=It,n.zondy.leaflet.layer.WebMapServiceLayer=Tt,n.zondy.leaflet.layer.WebMapTileServiceLayer=Ot,n.zondy.leaflet.layer.WebTileLayer=Nt,n.zondy.leaflet.layer.ArcGISTileLayer=At,n.zondy.leaflet.layer.VectorTileLayer=Rt,n.zondy.leaflet.layer.FeatureLayer=kt,n.zondy.leaflet.layer.MapVLayer=Vt,n.zondy.leaflet.layer.EchartsLayer=Ut,n.zondy.leaflet.GraphThemeLayer=ln,n.zondy.leaflet.tool={},n.zondy.leaflet.tool.sketch={},n.zondy.leaflet.tool.sketch.SketchEditor=ai,n.zondy.leaflet.tool.Screenshot=se,n.zondy.leaflet.tool.SwipeTool=Yt,n.zondy.leaflet.SwipeControl=F,n.zondy.leaflet.widget={},n.zondy.leaflet.widget.DrawControl=si,n.zondy.leaflet.widget.Popup=ie,n.zondy.leaflet.util={},n.zondy.leaflet.util.getLayerView=ii,n.zondy.leaflet.util.initializeOptions=dt,n.zondy.leaflet.util.initializeCRS=ft,n.zondy.leaflet.util.FeatureLayerUtil=cn,n.zondy.leaflet.MapView=ri,n.zondy.leaflet.object={},n.zondy.leaflet.object.theme={},n.zondy.leaflet.object.theme.ThemeStyle=hn,n.zondy.leaflet.VERSION="17.6.18",n.Zondy.SketchEditorLeaflet=ai,n.Zondy.PluginVersion=n.zondy.leaflet.VERSION,window.MapGISLeafletPlugin={MapViewLeaflet:ri,MapView:ri,Popup:ie,Screenshot:se,DrawControl:si,SketchEditorLeaflet:ai,SketchEditor:ai,GraphThemeLayer:ln,ThemeStyle:hn,getLayerView:ii,initializeOptions:dt,initializeCRS:ft,IGSTileLayer:wt,IGSMapImageLayer:Lt,IGSImageryLayer:Xt,IGSImageryTileLayer:qt,ArcGISMapImageLayer:It,WebMapServiceLayer:Tt,WebMapTileServiceLayer:Ot,WebTileLayer:Nt,ArcGISTileLayer:At,VectorTileLayer:Rt,FeatureLayer:kt,MapVLayer:Vt,EchartsLayer:Ut,FeatureLayerUtil:cn,SwipeControl:F,SwipeTool:Yt,L:r}}])});
105
+ ***************************************************************************** */var p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function d(t,e){var i=t[0],n=t[1];return[i*Math.cos(e)-n*Math.sin(e),i*Math.sin(e)+n*Math.cos(e)]}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=0;i<t.length;i++)if("number"!=typeof t[i])throw new Error("assertNumbers arguments["+i+"] is not a number. "+typeof t[i]+" == typeof "+t[i]);return!0}var y=Math.PI;function m(t,e,i){t.lArcFlag=0===t.lArcFlag?0:1,t.sweepFlag=0===t.sweepFlag?0:1;var n=t.rX,r=t.rY,o=t.x,s=t.y;n=Math.abs(t.rX),r=Math.abs(t.rY);var a=d([(e-o)/2,(i-s)/2],-t.xRot/180*y),l=a[0],h=a[1],u=Math.pow(l,2)/Math.pow(n,2)+Math.pow(h,2)/Math.pow(r,2);1<u&&(n*=Math.sqrt(u),r*=Math.sqrt(u)),t.rX=n,t.rY=r;var c=Math.pow(n,2)*Math.pow(h,2)+Math.pow(r,2)*Math.pow(l,2),p=(t.lArcFlag!==t.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(n,2)*Math.pow(r,2)-c)/c)),f=n*h/r*p,g=-r*l/n*p,m=d([f,g],t.xRot/180*y);t.cX=m[0]+(e+o)/2,t.cY=m[1]+(i+s)/2,t.phi1=Math.atan2((h-g)/r,(l-f)/n),t.phi2=Math.atan2((-h-g)/r,(-l-f)/n),0===t.sweepFlag&&t.phi2>t.phi1&&(t.phi2-=2*y),1===t.sweepFlag&&t.phi2<t.phi1&&(t.phi2+=2*y),t.phi1*=180/y,t.phi2*=180/y}function _(t,e,i){g(t,e,i);var n=t*t+e*e-i*i;if(0>n)return[];if(0===n)return[[t*i/(t*t+e*e),e*i/(t*t+e*e)]];var r=Math.sqrt(n);return[[(t*i+e*r)/(t*t+e*e),(e*i-t*r)/(t*t+e*e)],[(t*i-e*r)/(t*t+e*e),(e*i+t*r)/(t*t+e*e)]]}var v,x=Math.PI/180;function b(t,e,i){return(1-i)*t+i*e}function w(t,e,i,n){return t+Math.cos(n/180*y)*e+Math.sin(n/180*y)*i}function S(t,e,i,n){var r=e-t,o=i-e,s=3*r+3*(n-i)-6*o,a=6*(o-r),l=3*r;return Math.abs(s)<1e-6?[-l/a]:function(t,e,i){void 0===i&&(i=1e-6);var n=t*t/4-l/s;if(n<-i)return[];if(n<=i)return[-t/2];var r=Math.sqrt(n);return[-t/2-r,-t/2+r]}(a/s,0,1e-6)}function E(t,e,i,n,r){var o=1-r;return t*(o*o*o)+e*(3*o*o*r)+i*(3*o*r*r)+n*(r*r*r)}!function(t){function e(){return r(function(t,e,i){return t.relative&&(void 0!==t.x1&&(t.x1+=e),void 0!==t.y1&&(t.y1+=i),void 0!==t.x2&&(t.x2+=e),void 0!==t.y2&&(t.y2+=i),void 0!==t.x&&(t.x+=e),void 0!==t.y&&(t.y+=i),t.relative=!1),t})}function i(){var t=NaN,e=NaN,i=NaN,n=NaN;return r(function(r,o,s){return r.type&O.SMOOTH_CURVE_TO&&(r.type=O.CURVE_TO,t=isNaN(t)?o:t,e=isNaN(e)?s:e,r.x1=r.relative?o-t:2*o-t,r.y1=r.relative?s-e:2*s-e),r.type&O.CURVE_TO?(t=r.relative?o+r.x2:r.x2,e=r.relative?s+r.y2:r.y2):(t=NaN,e=NaN),r.type&O.SMOOTH_QUAD_TO&&(r.type=O.QUAD_TO,i=isNaN(i)?o:i,n=isNaN(n)?s:n,r.x1=r.relative?o-i:2*o-i,r.y1=r.relative?s-n:2*s-n),r.type&O.QUAD_TO?(i=r.relative?o+r.x1:r.x1,n=r.relative?s+r.y1:r.y1):(i=NaN,n=NaN),r})}function n(){var t=NaN,e=NaN;return r(function(i,n,r){if(i.type&O.SMOOTH_QUAD_TO&&(i.type=O.QUAD_TO,t=isNaN(t)?n:t,e=isNaN(e)?r:e,i.x1=i.relative?n-t:2*n-t,i.y1=i.relative?r-e:2*r-e),i.type&O.QUAD_TO){t=i.relative?n+i.x1:i.x1,e=i.relative?r+i.y1:i.y1;var o=i.x1,s=i.y1;i.type=O.CURVE_TO,i.x1=((i.relative?0:n)+2*o)/3,i.y1=((i.relative?0:r)+2*s)/3,i.x2=(i.x+2*o)/3,i.y2=(i.y+2*s)/3}else t=NaN,e=NaN;return i})}function r(t){var e=0,i=0,n=NaN,r=NaN;return function(o){if(isNaN(n)&&!(o.type&O.MOVE_TO))throw new Error("path must start with moveto");var s=t(o,e,i,n,r);return o.type&O.CLOSE_PATH&&(e=n,i=r),void 0!==o.x&&(e=o.relative?e+o.x:o.x),void 0!==o.y&&(i=o.relative?i+o.y:o.y),o.type&O.MOVE_TO&&(n=e,r=i),s}}function o(t,e,i,n,o,s){return g(t,e,i,n,o,s),r(function(r,a,l,h){var u=r.x1,c=r.x2,p=r.relative&&!isNaN(h),f=void 0!==r.x?r.x:p?0:a,d=void 0!==r.y?r.y:p?0:l;function g(t){return t*t}r.type&O.HORIZ_LINE_TO&&0!==e&&(r.type=O.LINE_TO,r.y=r.relative?0:l),r.type&O.VERT_LINE_TO&&0!==i&&(r.type=O.LINE_TO,r.x=r.relative?0:a),void 0!==r.x&&(r.x=r.x*t+d*i+(p?0:o)),void 0!==r.y&&(r.y=f*e+r.y*n+(p?0:s)),void 0!==r.x1&&(r.x1=r.x1*t+r.y1*i+(p?0:o)),void 0!==r.y1&&(r.y1=u*e+r.y1*n+(p?0:s)),void 0!==r.x2&&(r.x2=r.x2*t+r.y2*i+(p?0:o)),void 0!==r.y2&&(r.y2=c*e+r.y2*n+(p?0:s));var y=t*n-e*i;if(void 0!==r.xRot&&(1!==t||0!==e||0!==i||1!==n))if(0===y)delete r.rX,delete r.rY,delete r.xRot,delete r.lArcFlag,delete r.sweepFlag,r.type=O.LINE_TO;else{var m=r.xRot*Math.PI/180,_=Math.sin(m),v=Math.cos(m),x=1/g(r.rX),b=1/g(r.rY),w=g(v)*x+g(_)*b,S=2*_*v*(x-b),E=g(_)*x+g(v)*b,L=w*n*n-S*e*n+E*e*e,C=S*(t*n+e*i)-2*(w*i*n+E*t*e),P=w*i*i-S*t*i+E*t*t,I=(Math.atan2(C,L-P)+Math.PI)%Math.PI/2,M=Math.sin(I),T=Math.cos(I);r.rX=Math.abs(y)/Math.sqrt(L*g(T)+C*M*T+P*g(M)),r.rY=Math.abs(y)/Math.sqrt(L*g(M)-C*M*T+P*g(T)),r.xRot=180*I/Math.PI}return void 0!==r.sweepFlag&&0>y&&(r.sweepFlag=+!r.sweepFlag),r})}t.ROUND=function(t){function e(e){return Math.round(e*t)/t}return void 0===t&&(t=1e13),g(t),function(t){return void 0!==t.x1&&(t.x1=e(t.x1)),void 0!==t.y1&&(t.y1=e(t.y1)),void 0!==t.x2&&(t.x2=e(t.x2)),void 0!==t.y2&&(t.y2=e(t.y2)),void 0!==t.x&&(t.x=e(t.x)),void 0!==t.y&&(t.y=e(t.y)),void 0!==t.rX&&(t.rX=e(t.rX)),void 0!==t.rY&&(t.rY=e(t.rY)),t}},t.TO_ABS=e,t.TO_REL=function(){return r(function(t,e,i){return t.relative||(void 0!==t.x1&&(t.x1-=e),void 0!==t.y1&&(t.y1-=i),void 0!==t.x2&&(t.x2-=e),void 0!==t.y2&&(t.y2-=i),void 0!==t.x&&(t.x-=e),void 0!==t.y&&(t.y-=i),t.relative=!0),t})},t.NORMALIZE_HVZ=function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),r(function(n,r,o,s,a){if(isNaN(s)&&!(n.type&O.MOVE_TO))throw new Error("path must start with moveto");return e&&n.type&O.HORIZ_LINE_TO&&(n.type=O.LINE_TO,n.y=n.relative?0:o),i&&n.type&O.VERT_LINE_TO&&(n.type=O.LINE_TO,n.x=n.relative?0:r),t&&n.type&O.CLOSE_PATH&&(n.type=O.LINE_TO,n.x=n.relative?s-r:s,n.y=n.relative?a-o:a),n.type&O.ARC&&(0===n.rX||0===n.rY)&&(n.type=O.LINE_TO,delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag),n})},t.NORMALIZE_ST=i,t.QT_TO_C=n,t.INFO=r,t.SANITIZE=function(t){void 0===t&&(t=0),g(t);var e=NaN,i=NaN,n=NaN,o=NaN;return r(function(r,s,a,l,h){var u=Math.abs,c=!1,p=0,f=0;if(r.type&O.SMOOTH_CURVE_TO&&(p=isNaN(e)?0:s-e,f=isNaN(i)?0:a-i),r.type&(O.CURVE_TO|O.SMOOTH_CURVE_TO)?(e=r.relative?s+r.x2:r.x2,i=r.relative?a+r.y2:r.y2):(e=NaN,i=NaN),r.type&O.SMOOTH_QUAD_TO?(n=isNaN(n)?s:2*s-n,o=isNaN(o)?a:2*a-o):r.type&O.QUAD_TO?(n=r.relative?s+r.x1:r.x1,o=r.relative?a+r.y1:r.y2):(n=NaN,o=NaN),r.type&O.LINE_COMMANDS||r.type&O.ARC&&(0===r.rX||0===r.rY||!r.lArcFlag)||r.type&O.CURVE_TO||r.type&O.SMOOTH_CURVE_TO||r.type&O.QUAD_TO||r.type&O.SMOOTH_QUAD_TO){var d=void 0===r.x?0:r.relative?r.x:r.x-s,g=void 0===r.y?0:r.relative?r.y:r.y-a;p=isNaN(n)?void 0===r.x1?p:r.relative?r.x:r.x1-s:n-s,f=isNaN(o)?void 0===r.y1?f:r.relative?r.y:r.y1-a:o-a;var y=void 0===r.x2?0:r.relative?r.x:r.x2-s,m=void 0===r.y2?0:r.relative?r.y:r.y2-a;u(d)<=t&&u(g)<=t&&u(p)<=t&&u(f)<=t&&u(y)<=t&&u(m)<=t&&(c=!0)}return r.type&O.CLOSE_PATH&&u(s-l)<=t&&u(a-h)<=t&&(c=!0),c?[]:r})},t.MATRIX=o,t.ROTATE=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),g(t,e,i);var n=Math.sin(t),r=Math.cos(t);return o(r,n,-n,r,e-e*r+i*n,i-e*n-i*r)},t.TRANSLATE=function(t,e){return void 0===e&&(e=0),g(t,e),o(1,0,0,1,t,e)},t.SCALE=function(t,e){return void 0===e&&(e=t),g(t,e),o(t,0,0,e,0,0)},t.SKEW_X=function(t){return g(t),o(1,0,Math.atan(t),1,0,0)},t.SKEW_Y=function(t){return g(t),o(1,Math.atan(t),0,1,0,0)},t.X_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(-1,0,0,1,t,0)},t.Y_AXIS_SYMMETRY=function(t){return void 0===t&&(t=0),g(t),o(1,0,0,-1,0,t)},t.A_TO_C=function(){return r(function(t,e,i){return O.ARC===t.type?function(t,e,i){var n,r,o,s;t.cX||m(t,e,i);for(var a=Math.min(t.phi1,t.phi2),l=Math.max(t.phi1,t.phi2)-a,h=Math.ceil(l/90),u=new Array(h),c=e,p=i,f=0;f<h;f++){var g=b(t.phi1,t.phi2,f/h),y=b(t.phi1,t.phi2,(f+1)/h),_=y-g,v=4/3*Math.tan(_*x/4),w=[Math.cos(g*x)-v*Math.sin(g*x),Math.sin(g*x)+v*Math.cos(g*x)],S=w[0],E=w[1],L=[Math.cos(y*x),Math.sin(y*x)],C=L[0],P=L[1],I=[C+v*Math.sin(y*x),P-v*Math.cos(y*x)],M=I[0],T=I[1];u[f]={relative:t.relative,type:O.CURVE_TO};var N=function(e,i){var n=d([e*t.rX,i*t.rY],t.xRot),r=n[0],o=n[1];return[t.cX+r,t.cY+o]};n=N(S,E),u[f].x1=n[0],u[f].y1=n[1],r=N(M,T),u[f].x2=r[0],u[f].y2=r[1],o=N(C,P),u[f].x=o[0],u[f].y=o[1],t.relative&&(u[f].x1-=c,u[f].y1-=p,u[f].x2-=c,u[f].y2-=p,u[f].x-=c,u[f].y-=p),c=(s=[u[f].x,u[f].y])[0],p=s[1]}return u}(t,t.relative?0:e,t.relative?0:i):t})},t.ANNOTATE_ARCS=function(){return r(function(t,e,i){return t.relative&&(e=0,i=0),O.ARC===t.type&&m(t,e,i),t})},t.CLONE=function(){return function(t){var e={};for(var i in t)e[i]=t[i];return e}},t.CALCULATE_BOUNDS=function(){var t=e(),o=n(),s=i(),a=r(function(e,i,n){var r=s(o(t(function(t){var e={};for(var i in t)e[i]=t[i];return e}(e))));function l(t){t>a.maxX&&(a.maxX=t),t<a.minX&&(a.minX=t)}function h(t){t>a.maxY&&(a.maxY=t),t<a.minY&&(a.minY=t)}if(r.type&O.DRAWING_COMMANDS&&(l(i),h(n)),r.type&O.HORIZ_LINE_TO&&l(r.x),r.type&O.VERT_LINE_TO&&h(r.y),r.type&O.LINE_TO&&(l(r.x),h(r.y)),r.type&O.CURVE_TO){l(r.x),h(r.y);for(var u=0,c=S(i,r.x1,r.x2,r.x);u<c.length;u++)0<(A=c[u])&&1>A&&l(E(i,r.x1,r.x2,r.x,A));for(var p=0,f=S(n,r.y1,r.y2,r.y);p<f.length;p++)0<(A=f[p])&&1>A&&h(E(n,r.y1,r.y2,r.y,A))}if(r.type&O.ARC){l(r.x),h(r.y),m(r,i,n);for(var d=r.xRot/180*Math.PI,g=Math.cos(d)*r.rX,y=Math.sin(d)*r.rX,v=-Math.sin(d)*r.rY,x=Math.cos(d)*r.rY,b=r.phi1<r.phi2?[r.phi1,r.phi2]:-180>r.phi2?[r.phi2+360,r.phi1+360]:[r.phi2,r.phi1],L=b[0],C=b[1],P=function(t){var e=t[0],i=t[1],n=180*Math.atan2(i,e)/Math.PI;return n<L?n+360:n},I=0,M=_(v,-g,0).map(P);I<M.length;I++)(A=M[I])>L&&A<C&&l(w(r.cX,g,v,A));for(var T=0,N=_(x,-y,0).map(P);T<N.length;T++){var A;(A=N[T])>L&&A<C&&h(w(r.cY,y,x,A))}}return e});return a.minX=1/0,a.maxX=-1/0,a.minY=1/0,a.maxY=-1/0,a}}(v||(v={}));var C,P=function(){function t(){}return t.prototype.round=function(t){return this.transform(v.ROUND(t))},t.prototype.toAbs=function(){return this.transform(v.TO_ABS())},t.prototype.toRel=function(){return this.transform(v.TO_REL())},t.prototype.normalizeHVZ=function(t,e,i){return this.transform(v.NORMALIZE_HVZ(t,e,i))},t.prototype.normalizeST=function(){return this.transform(v.NORMALIZE_ST())},t.prototype.qtToC=function(){return this.transform(v.QT_TO_C())},t.prototype.aToC=function(){return this.transform(v.A_TO_C())},t.prototype.sanitize=function(t){return this.transform(v.SANITIZE(t))},t.prototype.translate=function(t,e){return this.transform(v.TRANSLATE(t,e))},t.prototype.scale=function(t,e){return this.transform(v.SCALE(t,e))},t.prototype.rotate=function(t,e,i){return this.transform(v.ROTATE(t,e,i))},t.prototype.matrix=function(t,e,i,n,r,o){return this.transform(v.MATRIX(t,e,i,n,r,o))},t.prototype.skewX=function(t){return this.transform(v.SKEW_X(t))},t.prototype.skewY=function(t){return this.transform(v.SKEW_Y(t))},t.prototype.xSymmetry=function(t){return this.transform(v.X_AXIS_SYMMETRY(t))},t.prototype.ySymmetry=function(t){return this.transform(v.Y_AXIS_SYMMETRY(t))},t.prototype.annotateArcs=function(){return this.transform(v.ANNOTATE_ARCS())},t}(),I=function(t){return" "===t||"\t"===t||"\r"===t||"\n"===t},M=function(t){return"0".charCodeAt(0)<=t.charCodeAt(0)&&t.charCodeAt(0)<="9".charCodeAt(0)},T=function(t){function e(){var e=t.call(this)||this;return e.curNumber="",e.curCommandType=-1,e.curCommandRelative=!1,e.canParseCommandOrComma=!0,e.curNumberHasExp=!1,e.curNumberHasExpDigits=!1,e.curNumberHasDecimal=!1,e.curArgs=[],e}return f(e,t),e.prototype.finish=function(t){if(void 0===t&&(t=[]),this.parse(" ",t),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return t},e.prototype.parse=function(t,e){var i=this;void 0===e&&(e=[]);for(var n=function(t){e.push(t),i.curArgs.length=0,i.canParseCommandOrComma=!0},r=0;r<t.length;r++){var o=t[r],s=!(this.curCommandType!==O.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),a=M(o)&&("0"===this.curNumber&&"0"===o||s);if(!M(o)||a)if("e"!==o&&"E"!==o)if("-"!==o&&"+"!==o||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==o||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+r);if(this.curCommandType===O.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>l)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+r+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+r+'"');this.curArgs.push(l),this.curArgs.length===N[this.curCommandType]&&(O.HORIZ_LINE_TO===this.curCommandType?n({type:O.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):O.VERT_LINE_TO===this.curCommandType?n({type:O.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===O.MOVE_TO||this.curCommandType===O.LINE_TO||this.curCommandType===O.SMOOTH_QUAD_TO?(n({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),O.MOVE_TO===this.curCommandType&&(this.curCommandType=O.LINE_TO)):this.curCommandType===O.CURVE_TO?n({type:O.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===O.SMOOTH_CURVE_TO?n({type:O.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.QUAD_TO?n({type:O.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===O.ARC&&n({type:O.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!I(o))if(","===o&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==o&&"-"!==o&&"."!==o)if(a)this.curNumber=o,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+r+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==o&&"Z"!==o)if("h"===o||"H"===o)this.curCommandType=O.HORIZ_LINE_TO,this.curCommandRelative="h"===o;else if("v"===o||"V"===o)this.curCommandType=O.VERT_LINE_TO,this.curCommandRelative="v"===o;else if("m"===o||"M"===o)this.curCommandType=O.MOVE_TO,this.curCommandRelative="m"===o;else if("l"===o||"L"===o)this.curCommandType=O.LINE_TO,this.curCommandRelative="l"===o;else if("c"===o||"C"===o)this.curCommandType=O.CURVE_TO,this.curCommandRelative="c"===o;else if("s"===o||"S"===o)this.curCommandType=O.SMOOTH_CURVE_TO,this.curCommandRelative="s"===o;else if("q"===o||"Q"===o)this.curCommandType=O.QUAD_TO,this.curCommandRelative="q"===o;else if("t"===o||"T"===o)this.curCommandType=O.SMOOTH_QUAD_TO,this.curCommandRelative="t"===o;else{if("a"!==o&&"A"!==o)throw new SyntaxError('Unexpected character "'+o+'" at index '+r+".");this.curCommandType=O.ARC,this.curCommandRelative="a"===o}else e.push({type:O.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=o,this.curNumberHasDecimal="."===o}else this.curNumber+=o,this.curNumberHasDecimal=!0;else this.curNumber+=o;else this.curNumber+=o,this.curNumberHasExp=!0;else this.curNumber+=o,this.curNumberHasExpDigits=this.curNumberHasExp}return e},e.prototype.transform=function(t){return Object.create(this,{parse:{value:function(e,i){void 0===i&&(i=[]);for(var n=0,r=Object.getPrototypeOf(this).parse.call(this,e);n<r.length;n++){var o=r[n],s=t(o);Array.isArray(s)?i.push.apply(i,s):i.push(s)}return i}}})},e}(P),O=function(t){function e(i){var n=t.call(this)||this;return n.commands="string"==typeof i?e.parse(i):i,n}return f(e,t),e.prototype.encode=function(){return e.encode(this.commands)},e.prototype.getBounds=function(){var t=v.CALCULATE_BOUNDS();return this.transform(t),t},e.prototype.transform=function(t){for(var e=[],i=0,n=this.commands;i<n.length;i++){var r=t(n[i]);Array.isArray(r)?e.push.apply(e,r):e.push(r)}return this.commands=e,this},e.encode=function(t){return function(t){var e="";Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];if(n.type===O.CLOSE_PATH)e+="z";else if(n.type===O.HORIZ_LINE_TO)e+=(n.relative?"h":"H")+n.x;else if(n.type===O.VERT_LINE_TO)e+=(n.relative?"v":"V")+n.y;else if(n.type===O.MOVE_TO)e+=(n.relative?"m":"M")+n.x+" "+n.y;else if(n.type===O.LINE_TO)e+=(n.relative?"l":"L")+n.x+" "+n.y;else if(n.type===O.CURVE_TO)e+=(n.relative?"c":"C")+n.x1+" "+n.y1+" "+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_CURVE_TO)e+=(n.relative?"s":"S")+n.x2+" "+n.y2+" "+n.x+" "+n.y;else if(n.type===O.QUAD_TO)e+=(n.relative?"q":"Q")+n.x1+" "+n.y1+" "+n.x+" "+n.y;else if(n.type===O.SMOOTH_QUAD_TO)e+=(n.relative?"t":"T")+n.x+" "+n.y;else{if(n.type!==O.ARC)throw new Error('Unexpected command type "'+n.type+'" at index '+i+".");e+=(n.relative?"a":"A")+n.rX+" "+n.rY+" "+n.xRot+" "+ +n.lArcFlag+" "+ +n.sweepFlag+" "+n.x+" "+n.y}}return e}(t)},e.parse=function(t){var e=new T,i=[];return e.parse(t,i),e.finish(i),i},e.CLOSE_PATH=1,e.MOVE_TO=2,e.HORIZ_LINE_TO=4,e.VERT_LINE_TO=8,e.LINE_TO=16,e.CURVE_TO=32,e.SMOOTH_CURVE_TO=64,e.QUAD_TO=128,e.SMOOTH_QUAD_TO=256,e.ARC=512,e.LINE_COMMANDS=e.LINE_TO|e.HORIZ_LINE_TO|e.VERT_LINE_TO,e.DRAWING_COMMANDS=e.HORIZ_LINE_TO|e.VERT_LINE_TO|e.LINE_TO|e.CURVE_TO|e.SMOOTH_CURVE_TO|e.QUAD_TO|e.SMOOTH_QUAD_TO|e.ARC,e}(P),N=((C={})[O.MOVE_TO]=2,C[O.LINE_TO]=2,C[O.HORIZ_LINE_TO]=1,C[O.VERT_LINE_TO]=1,C[O.CLOSE_PATH]=0,C[O.QUAD_TO]=4,C[O.SMOOTH_QUAD_TO]=2,C[O.CURVE_TO]=6,C[O.SMOOTH_CURVE_TO]=4,C[O.ARC]=7,C);const A=r.extend({},r.SVG.prototype);r.SVG.include({_updateStyle(t){const e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?("string"==typeof i.fill&&i.fill.match(/^url\(/)?this._fillPattern(t):e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updateShape:function(t){const e=t._point;let i=t.options.radius;const n=t.options.shape,r=t.options.rotation,o=t.options.xoffset,s=t.options.yoffset,a=t.options.path,l=e.x+o,h=e.y+s;if(t._path.setAttribute("transform",`rotate(${r},${l},${h})`),a){const e=new O(a).toAbs();let n=0,r=0,o=0,s=0;e.commands.forEach(t=>{const{x:e,y:i}=t;n=Math.min(e,n),r=Math.min(i,r),o=Math.max(e,o),s=Math.max(i,s)});const u=2*i/(o>s?o:s);return e.scale(u,u).translate(l-i,h-i),void this._setPath(t,e.encode())}if("arrow"===n){const e=`M${l-.85*i} ${h+.75*i} L${l} ${h} L${l+.85*i} ${h+.75*i} L${l} ${h-i} L${l-.85*i} ${h+.75*i}Z`;this._setPath(t,e)}if("diamond"===n){const e=`M${l-Math.sqrt(2)*i} ${h} L ${l} ${h-Math.sqrt(2)*i} L${l+Math.sqrt(2)*i} ${h} L${l} ${h+Math.sqrt(2)*i} L${l-Math.sqrt(2)*i} ${h}`;this._setPath(t,e)}if("square"===n){const e=`M${l-i} ${h-i} L ${l+i} ${h-i} L${l+i} ${h+i} L${l-i} ${h+i} L${l-i} ${h-i}`;this._setPath(t,e)}if("triangle"===n||"triangle-up"===n){const e=`M${l-1.3*i} ${h+.75*i} L${l} ${h-1.5*i} L${l+1.3*i} ${h+.75*i} Z`;this._setPath(t,e)}if("triangle-down"===n){const e=`M${l-1.3*i} ${h-.75*i} L${l} ${h+1.5*i} L${l+1.3*i} ${h-.75*i} Z`;this._setPath(t,e)}if("arrowhead"===n||"arrowhead-up"===n){const e=`M ${l+1.3*i} ${h+1.3*i} L ${l} ${h-1.3*i} L ${l-1.3*i} ${h+1.3*i} L ${l} ${h+.5*i} L ${l+1.3*i} ${h+1.3*i} Z`;this._setPath(t,e)}if("arrowhead-down"===n){const e=`M ${l-1.3*i} ${h-1.3*i} L ${l} ${h+1.3*i} L ${l+1.3*i} ${h-1.3*i} L ${l} ${h-.5*i} L ${l-1.3*i} ${h-1.3*i} Z`;this._setPath(t,e)}if("circle"===n){const e=`a${i},${i} 0 1,0 `,n=t._empty()?"M0 0":`M${l-i},${h}${e}${2*i},0 ${e}${2*-i},0 `;this._setPath(t,n)}if(n.startsWith("star")){const e=n.split(/[^0-9a-z]/gi,2),r=parseInt(e[1]);let o;o="star"===e[0]&&!isNaN(r)&&r>2?r:5;const s=.5*(1+Math.sqrt(5))+1,a=[];for(let t=0;t<o;t++)a.push(`${l+i/s*Math.sin(2*Math.PI/o*t)},${h+i/s*Math.cos(2*Math.PI/o*t)}`),a.push(`${l+i*Math.sin(1/o*Math.PI+2*Math.PI/o*t)},${h+i*Math.cos(1/o*Math.PI+2*Math.PI/o*t)}`);const u=`M${a.join("L")}Z`;this._setPath(t,u)}if("x"===n){const e=`M${l+(i/=2)},${h+i}L${l-i},${h-i}M${l-i},${h+i}L${l+i},${h-i}`;this._setPath(t,e)}if("cross"===n){const e=`M${l},${h+(i/=2)}L${l},${h-i}M${l+i},${h}L${l-i},${h}`;this._setPath(t,e)}},_fillPattern(t){const e=t._path,i=t.options,n=i.fillDetail;this._defs||(this._defs=r.SVG.create("defs"),this._container.appendChild(this._defs));const o=i.fill.substring(4,i.fill.length-1),s=o;let a;if(!Array.from(this._defs.children).some(t=>t.getAttribute("id")===s)){const t=new Image;t.src=o,(a=r.SVG.create("pattern")).setAttribute("id",s),a.setAttribute("patternUnits","userSpaceOnUse"),this._defs.appendChild(a);const e=r.SVG.create("image");e.setAttributeNS("http://www.w3.org/1999/xlink","href",o),a.appendChild(e),t.onload=function(){if(n){const{width:t=10,height:i=10,xoffset:r=0,yoffset:o=0,xscale:s=1,yscale:l=1}=n;a.setAttribute("x",r),a.setAttribute("y",o),e.setAttribute("x",r),e.setAttribute("y",o),a.setAttribute("width",t*s),a.setAttribute("height",i*l),e.style.transform=`scale(${s},${l})`,e.setAttribute("width",t),e.setAttribute("height",i)}else a.setAttribute("x","0"),a.setAttribute("y","0"),e.setAttribute("x","0"),e.setAttribute("y","0"),a.setAttribute("width",t.width),a.setAttribute("height",t.height),e.setAttribute("width",t.width),e.setAttribute("height",t.height)}}e.setAttribute("fill",`url(#${s})`)},_update(){A._update.call(this),this._map._rotate&&this.fire("update")}});const R=r.extend({},r.DivOverlay.prototype);r.DivOverlay.include({getEvents(){return r.extend(R.getEvents.call(this),{rotate:this._updatePosition})},_updatePosition(){if(!this._map)return;let t=this._map.latLngToLayerPoint(this._latlng),e=r.point(this.options.offset);const i=this._getAnchor();this._zoomAnimated?(this._map._rotate&&(t=this._map.rotatedPointToMapPanePoint(t)),r.DomUtil.setPosition(this._container,t.add(i))):e=e.add(t).add(i);const n=this._containerBottom=-e.y,o=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=`${n}px`,this._container.style.left=`${o}px`}});const k=r.extend({},r.Popup.prototype);r.Popup.include({_animateZoom(t){this._map._rotate||k._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);const i=this._getAnchor();e=this._map.rotatedPointToMapPanePoint(e),r.DomUtil.setPosition(this._container,e.add(i))},_adjustPan(){if(!this.options.autoPan||this._map._panAnim&&this._map._panAnim._inProgress)return;const t=this._map,e=parseInt(r.DomUtil.getStyle(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,n=this._containerWidth,o=new r.Point(this._containerLeft,-i-this._containerBottom);o._add(r.DomUtil.getPosition(this._container));const s=o._add(this._map._getMapPanePos()),a=r.point(this.options.autoPanPadding),l=r.point(this.options.autoPanPaddingTopLeft||a),h=r.point(this.options.autoPanPaddingBottomRight||a),u=t.getSize();let c=0,p=0;s.x+n+h.x>u.x&&(c=s.x+n-u.x+h.x),s.x-c-l.x<0&&(c=s.x-l.x),s.y+i+h.y>u.y&&(p=s.y+i-u.y+h.y),s.y-p-l.y<0&&(p=s.y-l.y),(c||p)&&t.fire("autopanstart").panBy([c,p])}});const D=r.extend({},r.Tooltip.prototype);function z(t){return"undefined"===t?[]:Array.isArray(t)?t:[t]}r.Tooltip.include({_updatePosition(){if(!this._map._rotate)return D._updatePosition.call(this);let t=this._map.latLngToLayerPoint(this._latlng);t=this._map.rotatedPointToMapPanePoint(t),this._setPosition(t)},_animateZoom(t){if(!this._map._rotate)return D._animateZoom.call(this,t);let e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);e=this._map.rotatedPointToMapPanePoint(e),this._setPosition(e)}});const V=r.Control.extend({options:{region:.5,mode:"horizontal"},initialize(t,e,i){this.setLeadingLayers(t),this.setTrailingLayers(e),r.setOptions(this,i)},includes:r.Evented.prototype||r.Mixin.Events,_clearSwipeLayers(t){this._forEachLayers(t,t=>{if(t.getContainer){const e=t.getContainer();e&&(e.style.clip="")}})},_updateClip(){if(!this._map||!this._enabled)return this;let t=this._map,e=t.containerPointToLayerPoint([0,0]),i=t.containerPointToLayerPoint(t.getSize()),n="",r="";if("vertical"===this.options.mode){const o=this.options.region*t.getSize().y,s=e.y+o;this.fire("dividermove",{y:o}),n=[e.y,i.x,s,e.x],r=[s,i.x,i.y,e.x]}else if("horizontal"===this.options.mode){const o=this.options.region*t.getSize().x,s=e.x+o;this.fire("dividermove",{x:o}),n=[e.y,s,i.y,e.x],r=[e.y,i.x,i.y,s]}this._forEachLayers(this._leadingLayers,t=>{if(t.getContainer){const e=t.getContainer();e&&(e.style.clip=this._getTransformClip(n,e))}}),this._forEachLayers(this._trailingLayers,t=>{if(t.getContainer){const e=t.getContainer();e&&(e.style.clip=this._getTransformClip(r,e))}})},_getTransformClip(t,e){const i=t.map(t=>t);if(e.style.transform){const t=function(t){const e=t.match(/matrix\((.+)\)/);if(e&&e[1])return e[1].split(",").map(Number).slice(-2);return[0,0]}(window.getComputedStyle(e).transform),n=t[0],r=t[1];i[0]-=r,i[1]-=n,i[2]-=r,i[3]-=n}return`rect(${i.join("px,")}px)`},_forEachLayers(t,e){Array.isArray(t)&&t.forEach(t=>{e(t)})},_addEvents(){let t=this._map;t&&(t.on("move",this._updateClip,this),t.on("layeradd layerremove",this._updateClip,this))},_removeEvents(){let t=this._map;t&&(t.off("layeradd layerremove",this._updateClip,this),t.off("move",this._updateClip,this))}});V.prototype.addTo=function(t){return this.remove(),this._map=t,this._enabled=!0,this._updateClip(),this._addEvents(),this},V.prototype.remove=function(){return this._map?(this._clearSwipeLayers(this._leadingLayers),this._clearSwipeLayers(this._trailingLayers),this._removeEvents(),this._map=null,this):this},V.prototype.setRegion=function(t){this.options.region=t,this._updateClip()},V.prototype.setMode=function(t){this.options.mode=t,this._updateClip()},V.prototype.enable=function(t){this._enabled=t,t?this._updateClip():(this._clearSwipeLayers(this._leadingLayers),this._clearSwipeLayers(this._trailingLayers))},V.prototype.setLeadingLayers=function(t){return this._clearSwipeLayers(this._leadingLayers),this._leadingLayers=z(t),this._updateClip(),this},V.prototype.setTrailingLayers=function(t){return this._clearSwipeLayers(this._trailingLayers),this._trailingLayers=z(t),this._updateClip(),this},r.Control.Swipe=V,r.control.swipe=function(t,e,i){return new r.Control.Swipe(t,e,i)};var F=V;const B=1e-6;var j=i(2);class G{static convertColorToRgb(t){return t instanceof n.Color?t.toCssRGBAString():n.Color.fromColor(t).toCssRGBAString()}static convertLngLatGeometry(t){return t&&t.spatialReference?t.spatialReference.isGeographic?t:n.Projection.project(t,new n.SpatialReference("EPSG:4326")):t}static convertClippingArea(t){if(!t)return t;let e=null;switch(t.type){case n.GeometryType.polygon:case n.GeometryType.multiPolygon:e=G.convertLngLatGeometry(t).toGeoJSON();break;case n.GeometryType.circle:e=G.convertLngLatGeometry(t).toPolygon().toGeoJSON();break;case n.GeometryType.extent:e=G.convertLngLatGeometry(t).toPolygon().toGeoJSON();break}return e}static convertClippAreaToPx(t,e){let i=G.getCRSMinZoom(t);const n=[];for(let o=0;o<e.length;o++){const s=[];for(let n=0;n<e[o].length;n++){const a=t.latLngToPoint(r.latLng(e[o][n][1],e[o][n][0]),i);s.push([a.x,a.y])}n.push(s)}return n}static getCRSMinZoom(t){let e=0;const i=Object.keys(t._scales||{});return 0!==i.length&&(e=parseInt(i[0])),e}static toTurfGeometry(t,e){let i=[];return"Polygon"===t.type?i.push(t.coordinates):i=t.coordinates,i.map(t=>{const i=G.convertClippAreaToPx(e,t);return j.polygon(i)})}static getClippingState(t,e){if(j.booleanContains(t,e))return{in:!0,geometry:null};if(j.booleanContains(e,t))return{intersect:!0,geometry:t};if(!j.booleanOverlap(t,e))return{out:!0,geometry:null};const i=j.intersect(t,e);return i?{intersect:!0,geometry:i}:{out:!0,geometry:null}}static convertLineDash(t,e){switch(t){case"dash":return e?[4,3]:[3,4];case"dash-dot":return e?[4,3,1,3]:[3,4,0,4];case"dot":return e?[1,3]:[0,4];case"long-dash":return e?[8,3]:[7,4];case"long-dash-dot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":return e?[4,1]:[3,2];case"short-dash-dot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":return e?[1,1]:[0,2];case"solid":case"none":default:return}}static calcLineMarkerDetail(t){(!t||Array.isArray(t)&&t.length<=1)&&n.Log.error("计算线样式首尾marker错误,传入几何数组不合法");const e=t[0],i=t[1],o=t[t.length-2],s=t[t.length-1],a=360-((180*Math.atan2(i[1]-e[1],i[0]-e[0])/Math.PI+180)%360-90),l=360-((180*Math.atan2(o[1]-s[1],o[0]-s[0])/Math.PI+180)%360-90),h=n.Projection.project(new n.Point({coordinates:e}),new n.SpatialReference("EPSG:4326")).coordinates,u=n.Projection.project(new n.Point({coordinates:s}),new n.SpatialReference("EPSG:4326")).coordinates;return{latlng1:r.latLng(h[1],h[0]),latlng2:r.latLng(u[1],u[0]),angle1:a,angle2:l}}static getTextWidth(t,e){const i=document.createElement("canvas").getContext("2d");return i.font=e,i.measureText(t).width}static getAreaCenter(t){let e;switch(t.type){case n.GeometryType.point:e=t;break;case n.GeometryType.multiPoint:case n.GeometryType.lineString:case n.GeometryType.multiLineString:case n.GeometryType.multiPolygon:e=t.extent.center;break;case n.GeometryType.polygon:e=t.centroid;break;case n.GeometryType.extent:case n.GeometryType.circle:e=t.center;break;default:e=t.extent.center}const i=G.convertLngLatGeometry(e).coordinates;return r.latLng(i[1],i[0])}static setVisibleOpacity(t,e,i){t&&(t.layerOpacity=e,t.layerVisible=i,G.setGraphicVisibleOpacity(t,e,i))}static setGraphicVisibleOpacity(t,e,i){t.setStyle&&t.setStyle({opacity:i?e:0,fillOpacity:i?e:0}),t instanceof r.Marker&&t.setOpacity(i?e:0),t.eachLayer&&t.eachLayer(function(t){G.setGraphicVisibleOpacity(t,e,i)}),t._nonPointGroup&&G.setGraphicVisibleOpacity(t._nonPointGroup,e,i),t._featureGroup&&G.setGraphicVisibleOpacity(t._featureGroup,e,i)}static insertBefore(t,e){const i=t.parentNode;i&&e!==t&&i.insertBefore(t,e)}static getLeafletGroupLayers(t,e,i){if(i=i||(()=>!0),t instanceof r.LayerGroup)for(const n in t._layers){const r=t._layers[n];G.getLeafletGroupLayers(r,e,i)}else i(t)&&e.push(t)}static getInterceptorsUrl(t){const e=this._map.options.config;if(!e||!e.request||!e.request.interceptors)return t;let i=Object(n.ServiceConfigRequestInterceptors)(e,t),r=`${Object(n.ServiceConfigToken)(e)}`;return!this.options||Object(n.isNull)(this.options.tokenKey)||Object(n.isNull)(this.options.tokenValue)||(r=""),!i||!r||t instanceof Object||(i.includes("?")?i+=`&${r}`:i+=`?${r}`),i}static pointToGeoCoord(t,e,i){const n=t.scale(i);return t.transformation.untransform(e,n)}}var U=G;const q=r.extend({},r.Map.prototype);r.Map.mergeOptions({rotate:!1,bearing:0}),r.Map.include({initialize(t,e){if(e.rotate&&(this._rotate=!0,this._bearing=0),e=r.Util.setOptions(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r.Util.bind(this._onResize,this),this._initEvents(),this.options&&this.options.maxBounds){const t=this.options.zoomSnap;this.options.zoomSnap=B;const e=this.getBoundsZoom(this.options.maxBounds);this.options.zoomSnap=t,this.options.minZoom=e}e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(r.latLng(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=r.DomUtil.TRANSITION&&r.Browser.any3d&&!r.Browser.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),r.DomEvent.on(this._proxy,r.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)),this._addLayers(this.options.layers),this.options.rotate&&this.setBearing(this.options.bearing)},containerPointToLayerPoint(t){return this._rotate?r.point(t).subtract(this._getMapPanePos()).rotateFrom(-this._bearing,this._getRotatePanePos()).subtract(this._getRotatePanePos()):q.containerPointToLayerPoint.call(this,t)},getBounds(){if(!this._rotate)return q.getBounds.call(this);const t=this.getSize(),e=this.layerPointToLatLng(this.containerPointToLayerPoint([0,0])),i=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,0])),n=this.layerPointToLatLng(this.containerPointToLayerPoint([t.x,t.y])),o=this.layerPointToLatLng(this.containerPointToLayerPoint([0,t.y]));return new r.LatLngBounds([e,i,n,o])},_getBoundsCenterZoom(t,e){e=e||{},t=t.getBounds?t.getBounds():r.latLngBounds(t);const i=this.toPoint(e.paddingTopLeft||e.padding||[0,0]),n=this.toPoint(e.paddingBottomRight||e.padding||[0,0]);let o=this.getBoundsZoom(t,!1,i.add(n));if((o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0)return{center:t.getCenter(),zoom:o};const s=n.subtract(i).divideBy(2),a=this.project(t.getNorthWest(),o),l=this.project(t.getSouthEast(),o);return{center:this.unproject(l.add(a).divideBy(2).add(s),o),zoom:o}},getGeoBoundsCoord(){const t=this.getPixelBounds(),e=this._zoom,i=U.pointToGeoCoord(this.options.crs,this.toPoint(t.getTopLeft()),e),n=U.pointToGeoCoord(this.options.crs,this.toPoint(t.getBottomRight()),e);return{xmin:i.x,ymin:n.y,xmax:n.x,ymax:i.y}},layerPointToGeo(t){const e=this.toPoint(t).add(this.getPixelOrigin()),i=this._zoom;return U.pointToGeoCoord(this.options.crs,this.toPoint(e),i)},layerPointToContainerPoint(t){return this._rotate?r.point(t).add(this._getRotatePanePos()).rotateFrom(this._bearing,this._getRotatePanePos()).add(this._getMapPanePos()):q.layerPointToContainerPoint.call(this,t)},setBearing(t){if(!r.Browser.any3d||!this._rotate)return;let e=this._getRotatePanePos();const i=this.getSize().divideBy(2),n=this._getMapPanePos();this._pivot=n.clone().multiplyBy(-1).add(i),e=e.rotateFrom(-this._bearing,this._pivot),this._bearing=t*r.DomUtil.DEG_TO_RAD,this._rotatePanePos=e.rotateFrom(this._bearing,this._pivot),r.DomUtil.setPositionBearing(this._rotatePane,e,this._bearing,this._pivot),this.fire("rotate")},getBearing(){return this._bearing*r.DomUtil.RAD_TO_DEG},_initPanes(){const t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),r.DomUtil.setPosition(this._mapPane,new r.Point(0,0)),this._rotate?(this._rotatePane=this.createPane("rotatePane",this._mapPane),this._norotatePane=this.createPane("norotatePane",this._mapPane),this.createPane("tilePane",this._rotatePane),this.createPane("overlayPane",this._rotatePane),this.createPane("shadowPane",this._norotatePane),this.createPane("markerPane",this._norotatePane),this.createPane("tooltipPane",this._norotatePane),this.createPane("popupPane",this._norotatePane)):(this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane")),this.options.markerZoomAnimation||(r.DomUtil.addClass(t.markerPane,"leaflet-zoom-hide"),r.DomUtil.addClass(t.shadowPane,"leaflet-zoom-hide"))},rotatedPointToMapPanePoint(t){return r.point(t).rotate(this._bearing)._add(this._getRotatePanePos())},mapPanePointToRotatedPoint(t){return r.point(t)._subtract(this._getRotatePanePos()).rotate(-this._bearing)},_getCenterOffset(t){let e=q._getCenterOffset.call(this,t);return this._rotate&&(e=e.rotate(this._bearing)),e},_getRotatePanePos(){return this._rotatePanePos||new r.Point(0,0)},_getNewPixelOrigin(t,e){const i=this.getSize()._divideBy(2);return this._rotate||q._getNewPixelOrigin.call(this,t,e),this.project(t,e).rotate(this._bearing)._subtract(i)._add(this._getMapPanePos())._add(this._getRotatePanePos()).rotate(-this._bearing)._round()},_handleGeolocationResponse(t){const e=t.coords.latitude,i=t.coords.longitude,n=t.coords.heading,o=new r.LatLng(e,i),s=o.toBounds(t.coords.accuracy),a=this._locateOptions;if(a.setView){const t=this.getBoundsZoom(s);this.setView(o,a.maxZoom?Math.min(t,a.maxZoom):t)}const l={latlng:o,bounds:s,timestamp:t.timestamp,heading:n};for(const e in t.coords)"number"==typeof t.coords[e]&&(l[e]=t.coords[e]);this.fire("locationfound",l)},toPoint:(t,e,i)=>t instanceof r.Point?t:Array.isArray(t)?new r.Point(t[0],t[1]):void 0===t||null===t?t:"object"==typeof t&&"x"in t&&"y"in t?new r.Point(t.x,t.y):new r.Point(t,e,i),panBy(t,e){if(t=this.toPoint(t).round(),e=e||{},t.x||t.y){if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new r.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){r.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");const i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this}},_updateZoomLevels(){let t=1/0,e=-1/0,i=this._getZoomSpan();const n=(t,e)=>{if(!e)return t;const i=this.options.crs,n=e.scale(t);return i.zoom(n)};for(let i in this._zoomBoundLayers){let r=this._zoomBoundLayers[i].options;const o=r.crsOptions?new l(r.crsOptions):null;t=void 0===r.minZoom?t:Math.min(t,n(r.minZoom,o)),e=void 0===r.maxZoom?e:Math.max(e,n(r.maxZoom,o))}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});class H{}H.addIGSTileLayer=function(t){const{layer:e,innerView:i}=t;let n=H.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new wt(e.url,n).addTo(i);return o.id=e.id,o},H.initializeOptions=function(t){const e=ut(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);let o={tileSize:t.tileSize,bounds:e,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:U.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:pt(t),minZoom:i,maxZoom:r,headers:t.headers,decryptOptions:t.decryptOptions};return o=Object(n.deleteNullValue)(o)};var Z=H;class X{}X.addIGSMapImageLayer=function(t){const{layer:e,innerView:i,view:r}=t,o=X.initializeOptions(e);!e.spatialReference.equals(r.spatialReference)&&(o.projectionSrs=Object(n.getProjectionSrs)(r.spatialReference)),o.visible=t._getLayerViewVisible(),o.opacity=t._getOpacity(),o.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const s=new Lt(e.url,o).addTo(i);return s.id=e.id,s},X.initializeOptions=function(t){return gt(t)},X.updateIGSMapImageLayer=function(t){const{innerLayer:e,layer:i}=t,n=gt(i);n.visible=t._getLayerViewVisible(),r.Util.setOptions(e,n)};var Y=X;class W{}W.addWMSLayer=function(t){const{layer:e,innerView:i,view:n}=t;let r=W.initializeOptions(e);r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity(),r.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const{extensionOptions:o={}}=e;if(r=Object.assign(r,o),n){!e.spatialReference.equals(n.spatialReference)&&(r.srs=n.spatialReference,r.crs=n.spatialReference)}const s=new Tt(e.url,r).addTo(i);return s.id=e.id,s},W.initializeOptions=function(t){const e=ut(t);let i={layers:t.layers,format:t.imageFormat,version:t.version,visible:t.visible,opacity:t.opacity,noWrap:!0,tileSize:t.imageWidth,transparent:t.imageTransparency,bounds:e,clippingArea:U.convertClippingArea(t.clippingArea),isReverseBBOX:t.isReverseXY,tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers,srs:t.spatialReference,crs:t.spatialReference,renderMode:t.renderMode};return i=Object(n.deleteNullValue)(i)};var $=W;class K{}K.addWMTSLayer=function(t){const{layer:e,innerView:i}=t;let n=K.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new Ot(e.url,n).addTo(i);return o.id=e.id,o},K.initializeOptions=function(t){const e=ut(t),{activeLayer:i}=t,r=t.getCurrentTileInfo(),[o,s]=n.TileInfoUtil.getLevelRangeByTileInfo(r);let a={tileMatrixSet:i.tileMatrixSetId,layer:i.identifier,tileSize:r.size[0],bounds:e,style:i.styleId,clippingArea:U.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:pt(t),minZoom:o,maxZoom:s,tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers};return a=Object(n.deleteNullValue)(a)};var Q=K;class J{}J.addArcGISMapImageLayer=function(t){const{layer:e,innerView:i,view:n}=t;let r=J.initializeOptions(e);!e.spatialReference.equals(n.spatialReference)&&(r.spatialReference=n.spatialReference),r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity();const{extensionOptions:o={}}=e;(r=Object.assign(r,o)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const s=new It(e.url,r).addTo(i);return s.id=e.id,s},J.initializeOptions=function(t){const e=ut(t);let i={layers:t.layers,id:t.id,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,transparent:t.imageTransparency,bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,httpMethod:t.httpMethod,renderMode:t.renderMode,headers:t.headers,mapServer:new n.ArcGISMapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers})};return i=Object(n.deleteNullValue)(i)};var tt=J;class et{}et.addWebTileLayer=function(t){const{layer:e,innerView:i}=t;let r=et.initializeOptions(e);r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity(),r.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const{extensionOptions:o={}}=e;r=Object.assign(r,o);const s=new Nt(Object(n.formatWebTileUrl)(e.url),r).addTo(i);return s.id=e.id,s},et.initializeOptions=function(t){const e=ut(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);let o={tileSize:t.tileSize,bounds:e,visible:t.visible,opacity:t.opacity,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:U.convertClippingArea(t.clippingArea),crsOptions:pt(t),tms:"tms"===t.tileSliceType,subdomains:t.subDomains,minZoom:i,maxZoom:r,headers:t.headers};return o=Object(n.deleteNullValue)(o)};var it=et;var nt=class{static addVectorTileLayer(t){const{layer:e,innerView:i}=t;let n=this.initializeOptions(e);const{extensionOptions:r={}}=e;n=Object.assign(n,r);const o=t._getOpacity(),s=t._getLayerViewVisible();this.updateStyleLayer(null,n.style.layers,{opacity:o,visible:s}),t.innerLayer=new Rt(n).addTo(i),t.innerLayer.commonLayerId=e.id}static initializeOptions(t){let e,i;t.style.layers.forEach(t=>{const{minzoom:n,maxzoom:r}=t;void 0===e&&(e=n),void 0===i&&(i=r),e=Math.min(n,e),i=Math.max(r,i)});const r=n.UrlUtil.getBaseUrlAndParams(t.url);let o={style:JSON.parse(JSON.stringify(t.style)),noWrap:!0,clippingArea:U.convertClippingArea(t.clippingArea),tileSize:t.tileInfo.getTileSize(),crsOptions:pt(t),minZoom:e,maxZoom:i,tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers,queryParameters:r.params,decryptOptions:t.decryptOptions};return o=Object(n.deleteNullValue)(o)}static setVisible(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(t=>{r.setLayoutProperty(t.id,"visibility",i?"visible":"none")}),e._update&&e._update(!0)}static setOpacity(t,e,i){const{layers:n}=t.style,{style:r}=e;n.forEach(e=>{const n=t._getBackupProperties(e.id,"opacities");n&&Object.keys(n).forEach(t=>{r.setPaintProperty(e.id,t,n[t]*i)})}),e._update&&e._update(!0)}static removeLayer(t){const{innerView:e,innerLayer:i}=t;e.removeLayer(i)}static setClippingArea(t,e){const{innerLayer:i}=t;i.setClippingArea(U.convertClippingArea(e))}static setPaintProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setPaintProperty(e,t,i[t])}),t._update&&t._update(!0)}static setLayoutProperties(t,e,i){const{style:n}=t;Object.keys(i).forEach(t=>{n.setLayoutProperty(e,t,i[t])}),t._update&&t._update(!0)}static updateStyleLayer(t,e,i){const{opacity:n=1,visible:r=!0}=i;e.forEach(e=>{e.paint&&Object.keys(e.paint).forEach(i=>{/opacity$/.test(i)&&(e.paint[i]*=n),t&&t.style.getLayer(e.id)&&t.style.setPaintProperty(e.id,i,e.paint[i])}),e.layout&&Object.keys(e.layout).forEach(i=>{/visibility$/.test(i)&&(e.layout[i]=r&&"visible"===e.layout[i]?"visible":"none"),t&&t.style.getLayer(e.id)&&t.style.setLayoutProperty(e.id,i,e.layout[i])})}),t&&t._update&&t._update(!0)}};class rt{}rt.addArcGISTileLayer=function(t){const{layer:e,innerView:i}=t;let n=rt.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new At(e.url,n).addTo(i);return o.id=e.id,o},rt.initializeOptions=function(t){const e=ut(t);let i={tileSize:t.tileSize,bounds:e,opacity:t.opacity,visible:t.visible,crsOptions:pt(t),tokenKey:t.tokenKey,tokenValue:t.tokenValue,headers:t.headers};return i=Object(n.deleteNullValue)(i)};var ot=rt;class st{}st.addIGSImageryLayer=function(t){const{layer:e,innerView:i,view:n}=t,r=st.initializeOptions(e);!e.spatialReference.equals(n.spatialReference)&&(r.imageSR=n.spatialReference),r.visible=t._getLayerViewVisible(),r.opacity=t._getOpacity(),r.onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new Xt(e.url,r).addTo(i);return o.id=e.id,o},st.initializeOptions=function(t){const e=ut(t);let i={id:t.id,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.format,opacity:t.opacity,visible:t.visible,bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,httpMethod:t.httpMethod,clippingArea:U.convertClippingArea(t.clippingArea),imageServer:new n.ImageServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers}),renderMode:t.renderMode,interpolation:t.interpolation,renderingRule:t.rasterFunction,bandIds:t.bandIds};const{extensionOptions:r={}}=t;return i=Object.assign(i,r)},st.updateIGSImageLayer=function(t){const{innerLayer:e,layer:i}=t,n=st.initializeOptions(i);n.visible=t._getLayerViewVisible(),r.Util.setOptions(e,n)};var at=st;class lt{}lt.addIGSImageryTileLayer=function(t){const{layer:e,innerView:i}=t;let n=lt.initializeOptions(e);n.visible=t._getLayerViewVisible(),n.opacity=t._getOpacity();const{extensionOptions:r={}}=e;(n=Object.assign(n,r)).onDataUpdateAndRenderCompleted=(()=>{t._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})});const o=new qt(e.url,n).addTo(i);return o.id=e.id,o},lt.initializeOptions=function(t){const e=ut(t),[i,r]=n.TileInfoUtil.getLevelRangeByTileInfo(t.tileInfo);return{tileSize:t.tileInfo.getTileSize(),bounds:e,tokenKey:t.tokenKey,tokenValue:t.tokenValue,clippingArea:U.convertClippingArea(t.clippingArea),visible:t.visible,opacity:t.opacity,crsOptions:pt(t),minZoom:i,maxZoom:r}};var ht=lt;function ut(t){let e=void 0;const i=Object(n.limitExtentToSRSMaxExtent)(t.extent),o=i.spatialReference.isGeographic?i:n.Projection.project(i,new n.SpatialReference({wkid:4326})),s=r.latLng(o.ymin,o.xmin),a=r.latLng(o.ymax,o.xmax);return e=r.latLngBounds(s,a)}function ct(t){const e=t.getBounds(),i=e.getNorthWest(),n=e.getSouthEast(),o=e.getSouthWest(),s=e.getNorthEast(),a=t.latLngToLayerPoint(i),l=t.latLngToLayerPoint(n),h=t.latLngToLayerPoint(o),u=t.latLngToLayerPoint(s),c=r.bounds(a,l);c.extend(h),c.extend(u);const p=t.getSize(),f=t.containerPointToLayerPoint([0,0]),d=t.containerPointToLayerPoint([p.x,p.y]),g=r.bounds(f,d);return c.extend(g.getBottomLeft()),c.extend(g.getTopRight()),c}function pt(t){t&&t.spatialReference||n.Log.error("计算crsOptions错误");let e=t.tileInfo;t.type===n.LayerType.WMTS&&(e=t.getCurrentTileInfo());const i=t.spatialReference,r=e.origin.coordinates,o=t.extent,s=e.lods.map(t=>t.clone());return{wkid:i.wkid,wkt:i.wkt,lods:s,origin:r,unit:i.isGeographic?"degree":void 0,extent:{xmin:o.xmin,ymin:o.ymin,xmax:o.xmax,ymax:o.ymax}}}function ft(t,e){e=Object(n.defaultValue)(e,[t]);const i=Object(n.getValidLayers)(t,e),r=Object(n.getLayersExtent)(i,t.spatialReference),o=Object(n.getCrsOptions)(t,i,{fullExtent:r});return new l({wkid:o.spatialReference.wkid,wkt:o.spatialReference.wkt,lods:o.lods,origin:o.origin,extent:o.extent})}function dt(t){switch(t.type){case n.LayerType.IGSTile:return Z.initializeOptions(t);case n.LayerType.IGSMapImage:return Y.initializeOptions(t);case n.LayerType.WMS:return $.initializeOptions(t);case n.LayerType.WMTS:return Q.initializeOptions(t);case n.LayerType.ArcGISMapImage:return tt.initializeOptions(t);case n.LayerType.ArcGISTile:return ot.initializeOptions(t);case n.LayerType.webTile:return it.initializeOptions(t);case n.LayerType.IGSVectorTile:case n.LayerType.ArcGISVectorTile:return nt.initializeOptions(t);case n.LayerType.IGSImage:return at.initializeOptions(t);case n.LayerType.IGSImageTile:return ht.initializeOptions(t);default:n.Log.error(`暂不支持为${t.type}类型的图层构造实例化参数`)}}function gt(t){const e=t.imageWidth||256,i=Math.max(t.extent.xmax-t.extent.xmin,t.extent.ymax-t.extent.ymin)/e,o=function(t,e){let i=void 0;const o=Object(n.getExtendExtentByPixel)(t,{extendPixel:100,resolution:e,outSpatialReference:new n.SpatialReference({wkid:4326})}),s=r.latLng(o.ymin,o.xmin),a=r.latLng(o.ymax,o.xmax);return i=r.latLngBounds(s,a)}(t.extent,i);let s={layers:t.layers,id:t.id,clientId:t.clientId,imageWidth:t.imageWidth,imageHeight:t.imageHeight,imageFormat:t.imageFormat,opacity:t.opacity,visible:t.visible,imageTransparent:t.imageTransparency,bounds:o,igsVersion:t._igsVersion,tokenKey:t.tokenKey,tokenValue:t.tokenValue,tokenAttachType:t.tokenAttachType,httpMethod:t.httpMethod,clippingArea:U.convertClippingArea(t.clippingArea),mapServer:new n.MapServer({url:t.url,tokenKey:t.tokenKey,tokenValue:t.tokenValue,enableGlobeFetch:!1,headers:t.headers}),isAntialiasing:t.isAntialiasing,renderMode:t.renderMode,headers:t.headers};const{extensionOptions:a={}}=t;s=Object.assign(s,a),s=Object(n.deleteNullValue)(s);const l=Object(n.getIGSDynamicLayer)(t);l.length>0?s.dynamicLayers=JSON.stringify(l):s.dynamicLayers=null;const h=t.getFilters();return h&&(s.layerFilters=JSON.stringify(h)),t.isSupportHiRender&&(s.hiRender=!t.disableHiRender&&void 0),s}function yt(t){if(t){let e;const i=t.def;return t.code&&(e=t.code.indexOf(":")>-1?t.code.split(":")[1]:t.code),new n.SpatialReference({wkid:e,wkt:i})}return null}const mt=r.ImageOverlay.extend({options:{clippingArea:null,bboxBounds:null,pixBoundsSize:null,container:null},_initImage(){const t="IMG"===this._url.tagName,e=t?this._url:r.DomUtil.create("img"),i=this._map.project(this._bounds.getNorthWest()),o=this.options.pixBoundsSize,s=this._map.getZoomScale(this._map.getZoom(),U.getCRSMinZoom(this._map.options.crs)),a=document.createElement("canvas");a.width=o.x,a.height=o.y;const l=a.getContext("2d");this._image=a,r.DomUtil.addClass(a,"leaflet-image-layer"),this._zoomAnimated&&r.DomUtil.addClass(a,"leaflet-zoom-animated"),this.options.className&&r.DomUtil.addClass(a,this.options.className),a.onselectstart=r.Util.falseFn,a.onmousemove=r.Util.falseFn;let h=[];this.options.clippingArea&&(h=this._getTileGeometryAndState());e.onload=(()=>{a.complete=!0,setTimeout(()=>{const t=l.createPattern(e,"repeat");((t,e)=>{if(!Array.isArray(e)||0===e.length||e.some(t=>t.in))return!0;if(e.every(t=>t.out))return!1;const n=e.filter(t=>t.geometry).map(t=>t.geometry);return n.length>0?(t.beginPath(),n.forEach(e=>{const n=j.coordAll(e);let r=n[0][0]*s-i.x,o=n[0][1]*s-i.y;t.moveTo(r,o);for(let e=1;e<n.length;e++)r=n[e][0]*s-i.x,o=n[e][1]*s-i.y,t.lineTo(r,o)}),t.clip(),!0):void 0})(l,h)&&(l.beginPath(),l.rect(0,0,a.width,a.height),l.fillStyle=t,l.fill()),this.fire("load")},0)}),e.onerror=(()=>{this._overlayOnError("error")}),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(fetch(this._url,{headers:this.options.headers}).then(t=>t.blob()).then(t=>{e.src=window.URL.createObjectURL(t)}).catch(t=>{n.Log.error(t)}),e.alt=this.options.alt)},getPane(){return this.options.container?this.options.container:r.ImageOverlay.prototype.getPane.call(this)},_toTurfGeometry(t){const e=this._map.options.crs;return U.toTurfGeometry(t,e)},_getClippingAreaPx(){return this._clippingAreaPx?this._clippingAreaPx:(this.options.clippingArea?this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea):this._clippingAreaPx=null,this._clippingAreaPx)},_getTileGeometryAndState(){if(!this.options.clippingArea)return null;const t=this._getClippingAreaPx(),e=this._map.getGeoBoundsCoord(),i=this._map.options.crs,n=i.scale(U.getCRSMinZoom(i)),o=i.transformation._transform(r.point(e.xmin,e.ymin),n),s=i.transformation._transform(r.point(e.xmax,e.ymax),n),a=o.x,l=s.y,h=s.x,u=o.y,c=j.polygon([[[a,l],[h,l],[h,u],[a,u],[a,l]]]);return t.map(t=>U.getClippingState(t,c))},_animateZoom(t){if(!this._map._rotate||0===this._map._bearing)return r.ImageOverlay.prototype._animateZoom.call(this,t)},_reset(){const t=this._image,e=this._calcLayerPointBounds(),i=e.getSize(),n=i.divideBy(2);r.DomUtil.setPosition(t,e.getCenter().subtract(n)),t.style.width=`${i.x}px`,t.style.height=`${i.y}px`},_calcLayerPointBounds(){const t=this._map.getCenter(),e=this._map.getZoom(),i=this.options.bboxBounds,n=this._map.options.crs,o=n.unproject(i.getTopLeft()),s=n.unproject(i.getBottomRight());return new r.Bounds(this._map._latLngToNewLayerPoint(o,e,t),this._map._latLngToNewLayerPoint(s,e,t))}});r.ImageOverlay.clip=function(t,e,i){return new r.ImageOverlay.Clip(t,e,i)};var _t=mt;var vt=r.Layer.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:"",noWrap:!0,clippingArea:null,pane:"tilePane",onDataUpdateAndRenderCompleted:null},initialize(t,e){t=n.LayerBaseUrlRegExp.matchString(t),this._initOptions(t,e)},onAdd(t){t.on("moveend",this.refresh,this),this._initUrlTemplate(),this._initContainer(),this._updateClippingArea(this.options.clippingArea),this.refresh()},getContainer(){return this._container},_initContainer(){this._container||(this._container=r.DomUtil.create("div",`leaflet-layer ${this.options.className||""}`),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},onRemove(){this._waitToUpdateImage&&this._map.removeLayer(this._waitToUpdateImage),this._currentImage&&this._map.removeLayer(this._currentImage),r.DomUtil.remove(this._container),this._map.off("moveend",this.refresh,this)},refresh(){if(!this._map)return;const t=this._map.getZoom();t>(this._map.options.maxZoom||18)||t<(this._map.options.minZoom||0)?this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null):this.server?(this._initUrlTemplate&&this._initUrlTemplate(),this._requestImage()):this._currentImage&&(this._currentImage._map.removeLayer(this._currentImage),this._currentImage=null)},setOpacity(t){this.options.opacity=t,this._updateOpacity()},_updateOpacity(){this._container&&r.DomUtil.setOpacity(this._container,this.options.opacity)},setVisible(t){if((t=!!t)!==this.options.visible)if(this.options.visible=t,this._currentImage){this._currentImage.getElement().style.display=this.options.visible?"inline":"none"}else this.refresh()},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_requestImage(){const t=this._map,e=this;if(!t||!this.options.visible)return;this._caculateBBOX();const i=this._map.getBounds(),n=n=>{if(!e._isValidateLayerStatus())return;const r=this._currentImage;n._bounds&&n._bounds.equals(i)&&n._bounds.equals(t.getBounds())?(n.getElement().style.display=this.options.visible?"inline":"none",this._currentImage=n,r&&t.removeLayer(r),this.fire("dataUpdateAndRenderCompleted",{}),this.options.onDataUpdateAndRenderCompleted&&this.options.onDataUpdateAndRenderCompleted()):t.removeLayer(n),this._waitToUpdateImage=null},r=i=>{e._isValidateLayerStatus()&&t.removeLayer(i)},o=(new Date).getTime();this.buildRequestImageSrc().then(i=>{if(!e._isValidateLayerStatus())return;let s=i;if(this.options&&"GET"===this.options.httpMethod&&(s=U.getInterceptorsUrl.call(this,s)),this._currentImage&&this._currentImage.timeStamp>o)return;const a=this._createImage(s,n,r);a.addTo(t),a.timeStamp=o,this._waitToUpdateImage=a})},_createImage(t,e,i){const n=this._map.getBounds(),r=new _t(t,n,{alt:this.options.alt,zIndex:this.options.zIndex,className:this.options.className,errorOverlayUrl:this.options.error,crossOrigin:this.options.crossOrigin,pane:this.options.pane||this.getPane(),interactive:this.options.interactive,clippingArea:this.options.clippingArea,bboxBounds:this.bboxBounds,pixBoundsSize:this.pixBoundsSize,container:this._container,headers:this.options.headers,timeStamp:(new Date).getTime()});return r.once("load",()=>{e(r)},self),r.once("error",()=>{i(r)},self),r},_caculateBBOX(){const t=this._map,e=t.getZoom(),i=t.options.crs,o=ct(t).getSize().round();this.imageHeight=o.y||512,this.imageWidth=o.x||512;const s=t.project(t.getBounds().getNorthWest()),a=s.add(o),l=U.pointToGeoCoord(i,t.toPoint(s),e),h=U.pointToGeoCoord(i,t.toPoint(a),e);this.bbox=new n.Extent({xmin:l.x,xmax:h.x,ymin:h.y,ymax:l.y,spatialReference:yt(t.options.crs)}),this.bboxBounds=r.bounds(l,h),this.pixBoundsSize=o},setClippingArea(t){return this.options.clippingArea=t,this._updateClippingArea(t),this.refresh(),this},_updateClippingArea(t){const e=this._map;this._clippingPolygons=t&&e?U.toTurfGeometry(t,e.options.crs):null},buildRequestImageSrc:()=>new Promise(t=>{t()}),buildRequestParamsObject:()=>new Promise(()=>{}),_isValidateLayerStatus(){return this._map&&this._map._mapPane},_initOptions(t,e){r.setOptions(this,e),this.id=this.options.id,this.httpMethod=this.options.httpMethod,this.url=t;const i=n.UrlUtil.getBaseUrlAndParams(t);this._queryParameters=i.params,this._initServer(),r.stamp(this),this._currentImage=null,this._waitToUpdateImage=null,this.bboxBounds=null,this.pixBoundsSize=null},_initServer(){n.Log.error("未实现服务对象,无法出图!")},_initRequestParameters(){this.exportOptions={}},_updateExportOptions(){this.exportOptions[this.options.tokenKey]=this.options.tokenValue,this.exportOptions=Object.assign(this.extensionsParameters,this.exportOptions),this.exportOptions=Object(n.deleteNullValue)(this.exportOptions)},_initUrlTemplate(){}});var xt=r.TileLayer.extend({options:{clippingArea:null,crsOptions:null,noWrap:!0,customWKID:null,decryptOptions:null,onDataUpdateAndRenderCompleted:null},initialize(t,e){t=n.LayerBaseUrlRegExp.matchString(t),this._initOptions(t,e)},createTile(t,e){const i=this.getTileUrl(t);return this._drawClippingTile(i,t,e)},onAdd(t){this._initUrlTemplate(),this._TileClippingGeometryCache={},this._tileMonitor=new n.TileMonitor({onAllTilesComplete:()=>{this._tiles&&0!==Object.keys(this._tiles).length&&(this.fire("dataUpdateAndRenderCompleted",{}),this.options.onDataUpdateAndRenderCompleted&&this.options.onDataUpdateAndRenderCompleted())}}),this._map.on("movestart zoomstart",this._startTileMonitor,this),this._map.on("moveend zoomend",this._endTileMonitor,this),this.on("tileloadstart",this._addTileMetadata,this),this.on("tileunload tileerror tileload tilerendered",this._removeTileMetadata,this),this._startTileMonitor(),r.TileLayer.prototype.onAdd.call(this,t),this._endTileMonitor()},_startTileMonitor(){this._tileMonitor.clear(),this._tileMonitor.status="waiting"},_addTileMetadata(t){t.tile&&(t.tile.__key__=Object(n.getGUID)(),this._tileMonitor.addTileMetadata(t.tile.__key__,{tile:t.tile}))},_removeTileMetadata(t){if(t.tile){if(this._map&&this._map._fadeAnimated&&"tileload"===t.type)return;this._tileMonitor.removeTileMetadata(t.tile.__key__)}},_endTileMonitor(){this._tileMonitor.status="wait-end",this._tileMonitor.onTileComplete()},onRemove(t){this._map.off("movestart zoomstart",this._startTileMonitor,this),this._map.off("moveend zoomend",this._endTileMonitor,this),this.off("tileloadstart",this._addTileMetadata,this),this.off("tileunload tileerror tileload tilerendered",this._removeTileMetadata,this),r.TileLayer.prototype.onRemove.call(this,t)},setClippingArea(t){return this.options.clippingArea=t,this._clearClippingCache(),this._removeAllTiles(),this._resetView(),this},getClippingArea(){return this.options.clippingArea},_getTileGeometryAndState(t,e,i){if(!this.options.clippingArea)return null;const n=`${t},${e},${i}`;if(this._TileClippingGeometryCache[n])return this._TileClippingGeometryCache[n];const r=this.options.crs,o=this._getClippingAreaPx(),s=this.options.tileSize,a=U.getCRSMinZoom(r),l=r.scale(i)/r.scale(a),h=t*s/l,u=e*s/l,c=(t+1)*s/l,p=(e+1)*s/l,f=j.polygon([[[h,u],[c,u],[c,p],[h,p],[h,u]]]),d=o.map(t=>U.getClippingState(t,f));return d.some(t=>t.geometry)&&(this._TileClippingGeometryCache[n]=d),d},_toTurfGeometry(t){const e=this.options.crs||this._map.options.crs;return U.toTurfGeometry(t,e)},_getClippingAreaPx(){if(this._clippingAreaPx)return this._clippingAreaPx;if(this.options.clippingArea){if(this.options&&this.options.customWKID&&this.options.customWKID===n.CustomWKID.gcj02mc&&this.options.clippingArea&&this.options.clippingArea.coordinates){const t=[];this.options.clippingArea.coordinates.forEach(e=>{t.push(n.Projection.projectPoints({points:e,originWKID:4326,targetWKID:n.CustomWKID.gcj02ll}))}),this.options.clippingArea.coordinates=t}if(this._clippingAreaPx=this._toTurfGeometry(this.options.clippingArea),this.options&&this.options.customWKID&&this.options.customWKID===n.CustomWKID.bd09mc){let t=this._getBiasedParams(this._map.getCenter(),0,this._levels[this._tileZoom],this._tileZoom);t.centerPiexlOffset&&this._clippingAreaPx[0]&&this._clippingAreaPx[0].geometry&&this._clippingAreaPx[0].geometry.coordinates&&this._clippingAreaPx[0].geometry.coordinates.forEach(e=>{e.forEach(e=>{e[0]-=t.centerPiexlOffset.x,e[1]-=t.centerPiexlOffset.y})})}}else this._clippingAreaPx=null;return this._clippingAreaPx},_clearClippingCache(){this._clippingAreaPx=null,this._TileClippingGeometryCache={}},_drawClippingTile(t,e,i){const{x:n,y:r,z:o}=e,s=this._getTileGeometryAndState(n,r,o),a=document.createElement("img"),l=this.options.crs,h=U.getCRSMinZoom(l);if(!s||s.some(t=>t.in))return this._getTileImage(a,t,i);if(s.every(t=>t.out)){const t=document.createElement("canvas");return t.width=this.options.width,t.height=this.options.height,this._getTileImage(a,null,i)}const u=s.filter(t=>t.geometry).map(t=>t.geometry);if(u.length>0){this._getTileImage(a,t,i);const e=document.createElement("canvas");e.width=this.options.tileSize,e.height=this.options.tileSize;const s=e.getContext("2d"),c=this.options.tileSize,p=c*n,f=c*r,d=l.scale(o-this.options.zoomOffset)/l.scale(h);return a.onload=function(){e.complete=!0,setTimeout(()=>{const t=s.createPattern(a,"repeat");let n,r;s.beginPath(),u.forEach(t=>{const e=j.coordAll(t);n=e[0][0]*d-p,r=e[0][1]*d-f,s.moveTo(n,r);for(let t=1;t<e.length;t++)n=e[t][0]*d-p,r=e[t][1]*d-f,s.lineTo(n,r)}),s.clip(),s.beginPath(),s.rect(0,0,e.width,e.height),s.fillStyle=t,s.fill(),i()},0)},this.options.crossOrigin&&(a.crossOrigin=""),e}},_getTileImage(t,e,i){if(!e)return t;r.DomEvent.on(t,"load",r.Util.bind(this._tileOnLoad,this,i,t)),r.DomEvent.on(t,"error",r.Util.bind(this._tileOnError,this,i,t)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(t.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(t.referrerPolicy=this.options.referrerPolicy),t.alt="";let o=e;if(!/data:image\/jpg;base64/.test(e)){o=U.getInterceptorsUrl.call(this,e);const i=this._map.options.config;t.onload=function(){i&&i.request&&i.request.interceptors&&Object(n.ServiceConfigResponseInterceptors)(i,o,t)}}return this.httpMethod===n.FetchMethod.post?this._postImage(t,e).catch(e=>{t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAAtJREFUGFdjYAACAAAFAAGq1chRAAAAAElFTkSuQmCC",this.fire("tileerror",{error:e,tile:t})}):fetch(e,{headers:this.options.headers}).then(t=>{const e=this.options.decryptOptions;return e?t.arrayBuffer().then(t=>{const i=Object(n.decryptIGS)(Object.assign({arrayBuffer:t},e));return new Blob([i])}):t.blob()}).then(e=>{t.src=window.URL.createObjectURL(e)}).catch(e=>{n.Log.error(e),this.fire("tileerror",{error:e,tile:t})}),t},_tileOnError(t,e,i){r.TileLayer.prototype._tileOnError.call(this,t,e,i),e instanceof Element&&(e.style.display="none")},_postImage:(t,e)=>Promise.resolve(""),_initOptions(t,e){e=Object(n.defaultValue)(e,{}),r.setOptions(this,e),this.url=t;const i=n.UrlUtil.getBaseUrlAndParams(t);this._queryParameters=i.params;let o={};if(e.crsOptions&&e.crsOptions.wkid&&[n.CustomWKID.gcj02mc,n.CustomWKID.bd09mc].indexOf(e.crsOptions.wkid)>-1){const t=Object.assign({},e.crsOptions,{wkid:3857});o.crsOptions=t,o.customWKID=e.crsOptions.wkid}this._clippingAreaPx=null,this.httpMethod=Object(n.defaultValue)(e.httpMethod,n.FetchMethod.get),r.TileLayer.prototype.initialize.call(this,t,Object.assign({},e,o)),r.GridLayer.prototype.initialize(arguments[1]),r.stamp(this)},_getBiasedParams(t,e,i,o){let s={biasedCenter:t};if(void 0!=t&&this.options){let a;if(this.options.customWKID==n.CustomWKID.gcj02mc)(a=n.Projection.projectPoints({points:[[t.lng,t.lat]],originWKID:4326,targetWKID:n.CustomWKID.gcj02ll}))&&a.length>0&&(s.biasedCenter=r.latLng(a[0][1],a[0][0]));else if(this.options.customWKID==n.CustomWKID.bd09mc){const r=this._map.options.crs,a=this.options.crs;let l=r.scale(e)/a.scale(o);i.origin.multiplyBy(l);const h=n.Projection.projectPoints({points:[[t.lng,t.lat]],originWKID:4326,targetWKID:n.CustomWKID.bd09mc}),u=n.Projection.projectPoints({points:[[t.lng,t.lat]],originWKID:4326,targetWKID:3857}),c={x:h[0][0]*a.scale(o)*l,y:h[0][1]*a.scale(o)*l},p={x:u[0][0]*a.scale(o)*l,y:u[0][1]*a.scale(o)*l},f={x:-(c.x-p.x),y:c.y-p.y};s.centerPiexlOffset=f;const d=this._map,g=this._toTileZoom(d._animatingZoom?Math.max(d._animateToZoom,d.getZoom()):d.getZoom()),y=this.getZoomScale(g,this._tileZoom);let m={x:(c.x-p.x)/y,y:-(c.y-p.y)/y};s.boundsPixelOffset=m}}return s},_getTiledPixelBounds(t){let e=this._getBiasedParams(t,this._map.getZoom(),this._levels[this._tileZoom],this._tileZoom);return r.GridLayer.prototype._getTiledPixelBounds.call(this,e.biasedCenter,e.boundsPixelOffset,e.centerPiexlOffset)},_setZoomTransform(t,e,i){let n=this._getBiasedParams(e,i,t,t.zoom);r.GridLayer.prototype._setZoomTransform.call(this,t,n.biasedCenter,i,n.centerPiexlOffset)},_initUrlTemplate(){},_getZoomForUrl(){const t=r.TileLayer.prototype._getZoomForUrl.call(this);return this._getLevelValue(t)},_updateOpacity(){if(!this._map)return;if(r.Browser.ielt9)return;r.DomUtil.setOpacity(this._container,this.options.opacity);let t=+new Date,e=!1,i=!1;for(let n in this._tiles){let o=this._tiles[n];if(!o.current||!o.loaded)continue;let s=Math.min(1,(t-o.loaded)/200);r.DomUtil.setOpacity(o.el,s),s<1?e=!0:(o.active?i=!0:this._onOpaqueTile(o),o.active=!0,this.fire("tilerendered",{tile:o.el,coords:o.coords}))}i&&!this._noPrune&&this._pruneTiles(),e&&(r.Util.cancelAnimFrame(this._fadeFrame),this._fadeFrame=r.Util.requestAnimFrame(this._updateOpacity,this))},refresh(){this._startTileMonitor(),this._initUrlTemplate&&this._initUrlTemplate();for(const t in this._tiles){const e=this._tiles[t];this._replaceTile(e,this._level.el)}this._endTileMonitor()},_replaceTile(t,e){const i=t.coords,n=t.el,o=this,s=this._getTilePos(i),a=this._tileCoordsToKey(i),l=this.createTile(this._wrapCoords(i),r.Util.bind(function(e,i,s){n&&n.startTimeStamp&&s.startTimeStamp<n.startTimeStamp||(r.DomUtil.remove(t.el),o._tileReady(e,i,s))},this,i));this._addTileMetadata({tile:l,coords:i}),l.startTimeStamp=(new Date).getTime(),this._initTile(l),this.createTile.length<2&&r.Util.requestAnimFrame(r.Util.bind(this._tileReady,this,i,null,l)),r.DomUtil.setPosition(l,s),this._tiles[a]={el:l,coords:i,current:!0},l.style.transition="opacity 0.5s ease-in-out",e.appendChild(l)}});var bt=xt.extend({getTileUrl(t){const e=this._tileCoordsToNwSe(t),i=r.bounds(this.options.crs.project(e[0]),this.options.crs.project(e[1])),n=(this.options.isReverseBBOX?[i.min.y,i.min.x,i.max.y,i.max.x]:[i.min.x,i.min.y,i.max.x,i.max.y]).join(",");return this._urlTemplate.replace("{bbox}",n)},_initUrlTemplate(){const t=n.ServerUtil.getImage(this.url,{version:this.options.version,layers:this.options.layers,styles:this.options.styles,width:this.options.width,height:this.options.height,format:this.options.format,transparent:this.options.transparent,srs:this.options.srs,crs:this.options.crs,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var wt=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",this._getZoomForUrl())},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var St=xt.extend({options:{projectionSrs:null,httpMethod:n.FetchMethod.get,imageWidth:256,imageHeight:256,imageFormat:"png",opacity:1,visible:!0,imageTransparent:!0,clippingArea:null,mapServer:null,tokenAttachType:!1,isAntialiasing:null,extensions:{},dynamicLayers:null,hiRender:null},getTileUrl(t){const e=this._map,i=this.getTileSize(),o=t.scaleBy(i),s=o.add(i),a=e.unproject(o,t.z),l=e.unproject(s,t.z),h=new r.LatLngBounds(a,l),u=this._map.options.crs.project(h.getNorthWest()),c=this._map.options.crs.project(h.getSouthEast()),p=`${u.x},${c.y},${c.x},${u.y}`;return"POST"===this.httpMethod?(this.requestStructure.commonQueryParameters.bbox=new n.Extent({xmin:u.x,ymin:c.y,xmax:c.x,ymax:u.y,spatialReference:yt(e.options.crs)}),this.requestStructure):this._urlTemplate.replace("{bbox}",p)},_postImage(t,e){return this.server.exportImage(e.commonQueryParameters).then(e=>{const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),e instanceof Blob&&i.readAsDataURL(e),i.onerror=(()=>{})})},_initUrlTemplate(){let t={clientId:this.options.clientId,layers:this.options.layers,transparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,size:`${this.options.imageWidth},${this.options.imageHeight}`,style:this.options.style,format:this.options.imageFormat,layerFilters:this.options.layerFilters,layerStyles:this.options.layerStyles,dynamicLayers:this.options.dynamicLayers,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,hiRender:this.options.hiRender};this.options.projectionSrs&&(t.projectionSrs=this.options.projectionSrs.toString()),t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e,this.server=Object(n.defaultValue)(this.options.mapServer,new n.MapServer({url:this.url}))}});var Et=vt.extend({options:{projectionSrs:null,httpMethod:n.FetchMethod.get,imageWidth:256,imageHeight:256,imageFormat:"png",opacity:1,visible:!0,imageTransparent:!0,dynamicLayers:null,clippingArea:null,mapServer:null,tokenAttachType:!1,isAntialiasing:null,extensions:{},hiRender:null},buildRequestImageSrc(){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else{let e=this._urlTemplate.replace("{bbox}",this.bbox.toString());e="1.0"===this.server.igsType?e.replace("w={w}",`w=${this.imageWidth}`).replace("h={h}",`h=${this.imageHeight}`):e.replace("size={size}",`size=${this.imageWidth},${this.imageHeight}`),t(e)}})},_initUrlTemplate(){const t={clientId:this.options.clientId,layers:this.options.layers,transparent:this.options.imageTransparent,isAntialiasing:this.options.isAntialiasing,imageWidth:this.options.imageWidth,imageHeight:this.options.imageHeight,style:this.options.style,format:this.options.imageFormat,layerFilters:this.options.layerFilters,layerStyles:this.options.layerStyles,dynamicLayers:this.options.dynamicLayers,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,formatMode:"replace",hiRender:this.options.hiRender};this.options.projectionSrs&&(t.projectionSrs=this.options.projectionSrs.toString()),t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.mapServer,new n.MapServer({url:this.url}))}});var Lt=class{constructor(t,e){let i;return(e=Object(n.defaultValue)(e,{})).renderMode=Object(n.defaultValue)(e.renderMode,"tile"),i="tile"===e.renderMode?new St(t,e):new Et(t,e)}};var Ct=vt.extend({options:{opacity:1,visible:!0,imageFormat:"png",imageTransparent:!0,tokenAttachType:!1,httpMethod:n.FetchMethod.get,spatialReference:null},buildRequestImageSrc(){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else t(this._urlTemplate.replace("{bbox}",this.bbox.toString()).replace("size={size}",`size=${this.imageWidth},${this.imageHeight}`))})},_initUrlTemplate(){let t={layers:this.options.layers,format:this.options.imageFormat,transparent:this.options.imageTransparent,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,formatMode:"replace"};const e=n.ServerUtil.getImage(this.url,t);this.options.spatialReference&&(t.imageSR=this.options.spatialReference),this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.mapServer,new n.ArcGISMapServer({url:this.url}))}});var Pt=xt.extend({options:{imageWidth:256,imageHeight:256,spatialReference:null,opacity:1,visible:!0,imageFormat:"png",imageTransparent:!0,tokenAttachType:!1,httpMethod:n.FetchMethod.get},getTileUrl(t){const e=this._map,i=this.getTileSize(),o=t.scaleBy(i),s=o.add(i),a=e.unproject(o,t.z),l=e.unproject(s,t.z),h=new r.LatLngBounds(a,l),u=this._map.options.crs.project(h.getNorthWest()),c=this._map.options.crs.project(h.getSouthEast()),p=`${u.x},${c.y},${c.x},${u.y}`;return"POST"===this.httpMethod?(this.requestStructure.commonQueryParameters.bbox=new n.Extent({xmin:u.x,xmax:c.x,ymin:c.y,ymax:u.y,spatialReference:yt(e.options.crs)}),this.requestStructure):this._urlTemplate.replace("{bbox}",p)},_postImage(t){const e=this.requestStructure.commonQueryParameters;return e.tokenAttachType=this.options.tokenAttachType,this.options.mapServer.exportImage(e).then(function(e){const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),e instanceof Blob&&i.readAsDataURL(e),i.onerror=(()=>{})})},_initUrlTemplate(){let t={layers:this.options.layers,format:this.options.imageFormat,transparent:this.options.imageTransparent,size:`${this.options.imageWidth},${this.options.imageWidth}`,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue};this.options.spatialReference&&(t.imageSR=this.options.spatialReference),t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e}});var It=class{constructor(t,e){let i;return i="tile"===e.renderMode?new Pt(t,e):new Ct(t,e)}};var Mt=vt.extend({buildRequestImageSrc(){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else t(this._urlTemplate.replace("{bbox}",this.bbox.toString()).replace("width=256&height=256",`width=${this.imageWidth}&height=${this.imageHeight}`))})},_initUrlTemplate(){const t={version:this.options.version,layers:this.options.layers,styles:this.options.styles,width:this.options.width,height:this.options.height,style:this.options.style,format:this.options.format,transparent:this.options.transparent,srs:this.options.srs,crs:this.options.crs,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters};this.options.projectionSrs&&(t.projectionSrs=this.options.projectionSrs.toString());const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.mapServer,new n.MapServer({url:this.url}))}});var Tt=class{constructor(t,e){let i;return i="image"===e.renderMode?new Mt(t,e):new bt(t,e)}};var Ot=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{z}",this._getZoomForUrl()).replace("{y}",t.y).replace("{x}",t.x)},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{version:this.options.version,style:this.options.style,tileMatrixSet:this.options.tileMatrixSet,format:this.options.format,layer:this.options.layer,tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var Nt=xt.extend({options:{customWKID:null},getTileUrl(t){const e={r:r.Browser.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this.options.crs.infinite){const i=this._globalTileRange.max.y-t.y;this.options.tms&&(e.row=i,e.y=i),e["-row"]=i}return r.Util.template(this._urlTemplate,r.Util.extend(e,this.options))},_initUrlTemplate(){this._urlTemplate=this.url;let t={};t[this.options.tokenKey]=this.options.tokenValue,t=Object.assign(t,this._queryParameters);const e=n.UrlUtil.getStringFromObject(t);e&&(this._urlTemplate=n.UrlUtil.completeUrlEndMark(this._urlTemplate),this._urlTemplate+=`${e}`),this._urlTemplate=Object(n.formatWebTileUrl)(this._urlTemplate)}});var At=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",this._getZoomForUrl())},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var Rt=class{constructor(t){let e;return t=Object(n.defaultValue)(t,{}),function(t,e){class i extends t.Projection{constructor(t,i){super();const n=(i||{}).def;if(!n)throw new Error("自定义参考系必须指定参数系信息def");if(this._def=n,!e)throw new Error("proj4对象不存在,自定义投影必须引入proj4对象");const r=this._isProj4Obj(t);this._proj=r?t:this._projFromCodeDef(t,n)}project(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.lng,i=t.lat),this._proj.forward([e,i])}unproject(t){let e,i;return Array.isArray(t)?(e=t[0],i=t[1]):(e=t.x,i=t.y),this._proj.inverse([e,i])}_projFromCodeDef(t,i){if(i)e.defs(t,i);else if(void 0===e.defs[t]){const i=t.split(":");if(i.length>3&&(t=`${i[i.length-3]}:${i[i.length-1]}`),void 0===e.defs[t])throw`No projection definition for code ${t}`}return e(t)}_isProj4Obj(t){return void 0!==t.inverse&&void 0!==t.forward}}class n extends t.CRS{_parseParams(t){this._crsType="proj4",this.epsgCode=t[0],this.def=t[1];const e=t[2]||{};this._parseOptions(e)}_parseOptions(t){if(super._parseOptions(t),this._resolutions=t.resolutions,Array.isArray(this._resolutions)){const t={};this._resolutions.forEach((e,i)=>{t[i]=e}),this._resolutions=t}if(!this._resolutions)throw new Error("自定义坐标系时,未设置分辨率数组");if(!this.origin)throw new Error("自定义坐标系时,未设置原点");this.tileSize=t.tileSize||256}_setProjection(){this.projection=new i(this.getEpsgCode(),{origin:this.origin,def:this.def})}}t.Proj||(t.Proj={}),t.Proj.CRS=n,t.Proj.Projection=i}(e=i(4),n.proj4),function(t,e){t.mapboxgl&&t.MapboxGL||(t.MapboxGL=t.Layer.extend({options:{updateInterval:32,padding:0,interactive:!1,pane:"tilePane",clippingArea:null,zoomOffset:0,tileSize:256,zIndex:1,crsOptions:null,decryptOptions:null},initialize(i){t.setOptions(this,i),i.accessToken&&(e.accessToken=i.accessToken),this._throttledUpdate=t.Util.throttle(this._update,this.options.updateInterval,this)},onAdd(e){this._container||this._initContainer();const i=this.getPaneName();e.getPane(i).appendChild(this._container),this._updateZIndex(),this._initGL(),this._offset=this._map.getBounds().getNorthWest(),e.options.zoomAnimation&&t.DomEvent.on(e._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this),e._addZoomLimit(this)},onRemove(e){this._map._proxy&&this._map.options.zoomAnimation&&t.DomEvent.off(this._map._proxy,t.DomUtil.TRANSITION_END,this._transitionEnd,this);const i=this.getPaneName();e.getPane(i).removeChild(this._container)},setZIndex(t){this.options.zIndex=t,this._updateZIndex()},_updateZIndex(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},getEvents(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize,rotate:this._rotate}},setClippingArea(t){this.options.clippingArea=t;const e=this.getMapboxMap(),i=this.options.style.sources;i&&Object.entries(i).forEach(i=>{const n=i[0],r=e.getSource(n);r&&"vector"===r.type&&r.setClippingArea&&r.setClippingArea(t)})},getClippingArea(){return this.options.clippingArea},getMapboxMap(){return this._glMap},getCanvas(){return this._glMap.getCanvas()},getSize(){return this._map.getSize().multiplyBy(1+2*this.options.padding)},getBounds(){const e=this.getSize().multiplyBy(.5),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getCenter()));return t.latLngBounds(this._map.containerPointToLatLng(i.subtract(e)),this._map.containerPointToLatLng(i.add(e)))},getContainer(){return this._container},getPaneName(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},_initContainer(){const e=this._container=t.DomUtil.create("div","leaflet-gl-layer"),i=this.getSize();e.style.width=`${i.x}px`,e.style.height=`${i.y}px`,e.style.position="absolute";const n=this._calcRotateOffset();t.DomUtil.setPosition(e,n)},_initGL(){let i;const r=this._map.options.crs,o=this._map.getCenter(),s=this.options.crsOptions;if(s){const t=s.extent,n={},o={};s.lods.forEach(t=>{n[t.level]=t.resolution,o[t.level]=t.levelValue});const a=this.options.tileSize||256,l={levelValues:o,resolutions:n,origin:s.origin,tileSize:a,bounds:[t.xmin,t.ymin,t.xmax,t.ymax],unit:s.unit};i=e.Proj&&e.Proj.CRS?new e.Proj.CRS(r.code,r.def,l):new e.CRS(r.code,l)}else i=r.code;let a={};Object(n.defined)(this.options.tokenKey)&&Object(n.defined)(this.options.tokenValue)&&(a[this.options.tokenKey]=this.options.tokenValue);const l={data:a=Object.assign(this.options.queryParameters,a),headers:this.options.headers};this.options.tokenKey&&this.options.tokenValue&&(l.data[this.options.tokenKey]=this.options.tokenValue);const h=t.extend({},this.options,{container:this._container,center:[o.lng,o.lat],zoom:Math.max(0,this._map.getZoom()),attributionControl:!1,crs:i,minZoom:-2,renderWorldCopies:!1,requestParams:l});try{if(h.style){const t=h.style.sources;t&&Object.entries(t).forEach(t=>{"vector"===t[1].type&&(t[1].clippingArea=this.options.clippingArea,t[1].decryptOptions=this.options.decryptOptions)})}}catch(t){}this._glMap?(this._glMap.setCenter(h.center),this._glMap.setZoom(h.zoom)):this._glMap=new e.Map(h),this._glMap.transform.latRange=null,this._transformGL(this._glMap),this._glMap._canvas.canvas?this._glMap._actualCanvas=this._glMap._canvas.canvas:this._glMap._actualCanvas=this._glMap._canvas;const u=this._glMap._actualCanvas;t.DomUtil.addClass(u,"leaflet-image-layer"),t.DomUtil.addClass(u,"leaflet-zoom-animated"),this.options.interactive&&t.DomUtil.addClass(u,"leaflet-interactive"),this.options.className&&t.DomUtil.addClass(u,this.options.className)},_calcRotateOffset(){const t=this._map.getSize().multiplyBy(this.options.padding),e=this._map.getSize()._divideBy(2);return this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()).subtract(e).subtract(t)},_update(t){if(!this._map)return;if(this._offset=this._map.getBounds().getNorthWest(),this._zooming)return;const e=this._glMap,i=this.getSize(),n=this._container;this._transformGL(e);const r=Math.round(i.x),o=Math.round(i.y);Math.round(e.transform.width)!==r||Math.round(e.transform.height)!==o?(n.style.width=`${r}px`,n.style.height=`${o}px`,e.transform.width=r,e.transform.height=o,null!==e._resize&&void 0!==e._resize?e._resize():e.resize()):null!==e._update&&void 0!==e._update?e._update():e.update()},_transformGL(i){const n=this._clampCenter(this._map.getCenter()),r=i.transform;r.resetZoomScale=!1;const o=this._getZoom();r.zoom=o,r.center=e.LngLat.convert([n.lng,n.lat]);const s=r.center,a=[0,0];if(Math.abs(s.lng-n.lng)>1e-7||Math.abs(s.lat-n.lat)>1e-7){const t=r.coordinatePoint(r.locationCoordinate(s)),e=r.coordinatePoint(r.locationCoordinate(n));a[0]=t.x-e.x,a[1]=t.y-e.y}const l=this._container,h=this._calcRotateOffset().add(a);t.DomUtil.setPosition(l,h)},_clampCenter(e){if(!e)return e;const i=Math.min(Math.max(e.lng,-180),180),n=Math.min(Math.max(e.lat,-90),90);return t.latLng(n,i)},_pinchZoom(t){this._glMap.jumpTo({zoom:Math.max(0,this._getZoom()),center:this._clampCenter(this._map.getCenter())})},_animateZoom(e){const i=this._map.getZoomScale(e.zoom),n=this._map.getSize().multiplyBy(this.options.padding*i),r=this.getSize()._divideBy(2),o=this._map.project(this._clampCenter(e.center),e.zoom)._subtract(r)._add(this._map._getMapPanePos().add(n))._round(),s=this._map.project(this._clampCenter(this._map.getBounds().getNorthWest()),e.zoom)._subtract(o),a=this._map.latLngToLayerPoint(this._offset)._add(this._map._getRotatePanePos());t.DomUtil.setTransform(this._glMap._actualCanvas,s.subtract(a),i)},_zoomStart(t){this._zooming=!0,this._container&&this._map._rotate&&0!==this._map._bearing&&(this._container.style.visibility="hidden")},_zoomEnd(){const e=this._map.getZoomScale(this._map.getZoom());t.DomUtil.setTransform(this._glMap._actualCanvas,null,e),this._zooming=!1,this._update(),this._container&&(this._container.style.visibility="visible")},_transitionEnd(e){t.Util.requestAnimFrame(function(){const e=this._map.getCenter(),i=this._map.latLngToContainerPoint(this._clampCenter(this._map.getBounds().getNorthWest()));t.DomUtil.setTransform(this._glMap._actualCanvas,i,1),this._glMap.once("moveend",t.Util.bind(function(){this._zoomEnd()},this)),this._glMap.jumpTo({center:this._clampCenter(e),zoom:Math.max(0,this._getZoom())})},this)},_resize(t){this._transitionEnd(t)},_getZoom(){const t=this._map.getSize()._divideBy(2),e=this._map._latLngToNewLayerPoint(this._map.getCenter(),this._map.getZoom(),this._map.getCenter()),i=e.subtract(t),n=e.add(t),r=this._map.layerPointToLatLng(i),o=this._map.layerPointToLatLng(n),s=[[Math.min(Math.max(o.lng,-180),180),Math.min(Math.max(r.lat,-90),90)],[Math.min(Math.max(r.lng,-180),180),Math.min(Math.max(o.lat,-90),90)]],a=this._map.getSize().multiplyBy(this.options.padding),l=this._glMap.cameraForBounds(s,{padding:{left:a.x,right:a.x,top:a.y,bottom:a.y}});return l?parseFloat(l.zoom.toFixed(10)):-2},_rotate(e){if(!this._map)return;const i=this._map.getSize(),n=this._map._bearing,r=t.point(i.x/2,i.y/2),o=t.point(0,0).rotateFrom(n,r),s=t.point(i.x,0).rotateFrom(n,r),a=t.point(i.x,i.y).rotateFrom(n,r),l=t.point(0,i.y).rotateFrom(n,r),h=t.bounds(o,l);h.extend(s),h.extend(a);const u=h.getSize(),c=(u.x-i.x)/i.x,p=(u.y-i.y)/i.y,f=Math.max(c,p)/2;this.options.padding=f,this._update()}}),t.mapboxGL=function(e){return new t.MapboxGL(e)})}(r,e),r.mapboxGL(t)}};var kt=class{constructor(){return new r.FeatureGroup}};const Dt=window.mapv||{},zt=Dt.baiduMapLayer?Dt.baiduMapLayer.__proto__:Function;var Vt=r.Layer.extend({initialize(t,e,i,n){this.map=t,this.dataset=e||{},this.mapvoption=i,n=n||{},this.render=this.render.bind(this),r.Util.setOptions(this,n),this._canvas=this._createCanvas(),r.stamp(this),this.innerMoveStartEvent=this.moveStartEvent.bind(this),this.innerMoveEndEvent=this.moveEndEvent.bind(this),this.innnerZoomstart=this.zoomStartEvent.bind(this),this.innerViewreset=this.viewresetEvent.bind(this),this.innerResize=this.resizeEvent.bind(this),this.innerRotate=this.rotateEvent.bind(this)},addData(t,e){this.mapvBaseLayer.addData(t,e)},updateData(t,e){this.mapvBaseLayer.updateData(t,e)},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},_createCanvas(){const t=document.createElement("canvas");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=this.options.zIndex||100;const e=this.map.getSize();t.width=e.x,t.height=e.y,t.style.width=`${e.x}px`,t.style.height=`${e.y}px`;const i=this.devicePixelRatio;return t.getContext("2d").scale(i,i),"2d"===this.mapvoption.context&&t.getContext("2d").scale(i,i),t},onAdd(t){const e=this.getPane("tilePane"),i=r.DomUtil.create("div","leaflet-layer",e);i.appendChild(this._canvas),this._container=i,this.mapvBaseLayer=new class extends zt{constructor(t,e,i,n){super(t,e,i),zt&&(this.map=t,this.dataSet=e,this.options=i,i=i||{},this.init(i),this.argCheck(i),this.initDevicePixelRatio(),this.canvasLayer=n,this.clickEvent=this.clickEvent.bind(this),this.mousemoveEvent=this.mousemoveEvent.bind(this),this.bindEvent())}clickEvent(t){const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}mousemoveEvent(t){if(!t)return;const e=this.map.containerPointToLayerPoint([0,0]),i=(this.devicePixelRatio,t.layerPoint);i.x,e.x,i.y,e.y}addAnimatorEvent(){}animatorMovestartEvent(){const t=this.options.animation;this.isEnabledTime()&&this.animator&&(this.steps.step=t.stepsRange.start)}animatorMoveendEvent(){this.isEnabledTime()&&this.animator}bindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.on("click",this.clickEvent),this.options.methods.mousemove&&t.on("mousemove",this.mousemoveEvent))}unbindEvent(){const t=this.map;this.options.methods&&(this.options.methods.click&&t.removeListener("click",this.clickEvent),this.options.methods.mousemove&&t.removeListener("mousemove",this.mousemoveEvent))}initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1}getContext(){return this.canvasLayer.getCanvas().getContext(this.context)}_canvasUpdate(t){if(!this.canvasLayer||this.canvasLayer.disposeFlag)return;const e=this,i=this.map,n=e.options.animation,o=this.getContext();if(e.isEnabledTime()){if(void 0===t)return void this.clear(o);"2d"===this.context&&(o.save(),o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, .1)",o.fillRect(0,0,o.canvas.width,o.canvas.height),o.restore())}else this.clear(o);if("2d"===this.context)for(const t in e.options)o[t]=e.options[t];else o.clear(o.COLOR_BUFFER_BIT);if(e.options.minZoom&&i.getZoom()<e.options.minZoom||e.options.maxZoom&&i.getZoom()>e.options.maxZoom)return;const s=i.getBounds().getNorthWest(),a=i.latLngToLayerPoint(s),l={transferCoordinate(t){const n=i.latLngToLayerPoint(new r.LatLng(t[1],t[0]));return"heatmap"===e.options.draw&&(n.x/=e.devicePixelRatio,n.y/=e.devicePixelRatio),[n.x-a.x,n.y-a.y]}};void 0!==t&&(l.filter=function(e){const i=n.trails||10;return t&&e.time>t-i&&e.time<t});const h=e.dataSet.get(l);this.processData(h),"m"===e.options.unit&&e.options.size,e.options._size=e.options.size;const u=i.latLngToLayerPoint(r.latLng(0,0)),c={x:u.x-a.x,y:u.y-a.y};this.drawContext(o,new Dt.DataSet(h),e.options,c),e.options.updateCallback&&e.options.updateCallback instanceof Function&&e.options.updateCallback(t)}init(t){const e=this;e.options=t,this.initDataRange(t),this.context=e.options.context||"2d",e.options.zIndex&&e.canvasLayer&&e.canvasLayer.setZIndex(e.options.zIndex),this.initAnimator()}updateData(t,e){let i=t;i&&i.get&&(i=i.get()),void 0!==i&&this.dataSet.set(i),super.update({options:e})}addData(t,e){let i=t;t&&t.get&&(i=t.get()),this.dataSet.add(i),this.update({options:e})}draw(){this.canvasLayer.draw()}clear(t){t&&t.clearRect&&t.clearRect(0,0,t.canvas.width,t.canvas.height)}}(t,this.dataset,this.mapvoption,this),this.bindEvent(),this.options.tileLoader&&this._initTileLoader(),this._reset(),this.fire("loaded")},getContainer(){return this._container},bindEvent(){const t=this.map;t.on("movestart",this.innerMoveStartEvent),t.on("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.on("zoomstart",this.innnerZoomstart),t.on("viewreset",this.innerViewreset),t.on("resize ",this.innerResize),t.on("rotate",this.innerRotate),this.mapvBaseLayer.bindEvent()},unbindEvent(){const t=this.map;t.off("movestart",this.innerMoveStartEvent),t.off("moveend",this.innerMoveEndEvent),t.on("zoomend",this.innerMoveEndEvent),t.off("zoomstart",this.innnerZoomstart),t.off("viewreset",this.innerViewreset),t.off("resize ",this.innerResize),t.off("rotate",this.innerRotate),this.removeAllData(),this.mapvBaseLayer.unbindEvent()},moveStartEvent(){this.mapvBaseLayer.animatorMovestartEvent(),this._unvisiable()},moveEndEvent(){this.mapvBaseLayer.animatorMoveendEvent(),this._reset(),this._visiable()},zoomStartEvent(){this._unvisiable()},viewresetEvent(){this._reset(),this._visiable()},resizeEvent(){this._reset(),this._visiable()},rotateEvent(){this._reset(),this._visiable()},_animateZoom(){this._animating||(this._animating=!0)},_endZoomAnim(){},getCanvas(){return this._canvas},getAttribution(){return this.options.attribution},draw(){return this._reset()},onRemove(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},setOpacity(t){this._canvas.style.opacity=t},setZIndex(t){this._canvas.style.zIndex=t},bringToFront(){return this},bringToBack(){return this},_reset(){this.resizeCanvas(),this.fixPosition(),this.onResize(),this.render()},_visiable(){this.getCanvas().style.display="block"},_unvisiable(){this.getCanvas().style.display="none"},_render(){this.render()},fixPosition(){const t=this.map.getBounds().getNorthWest(),e=this.map.latLngToLayerPoint(t);t&&r.DomUtil.setPosition(this._canvas,{x:e.x,y:e.y})},resizeCanvas(){let t;t=this.map._rotate?ct(this.map).getSize():this.map.getSize();const e=this.getCanvas();e.width=t.x,e.height=t.y,e.style.width=`${t.x}px`,e.style.height=`${t.y}px`},redraw(t){this.resizeCanvas(),this.fixPosition(),this.render()},show(){this._visiable()},hide(){this._unvisiable()},destroy(){r.DomUtil.remove(this._container),this.unbindEvent(),this.disposeFlag=!0},update(t){void 0!==t&&this.mapvBaseLayer.updateData(t.data,t.options)},removeData(t){this.mapvBaseLayer&&this.mapvBaseLayer.removeData(t)},removeAllData(){},onResize(){},render(){this.mapvBaseLayer._canvasUpdate()}});const Ft=window.echarts;function Bt(t,e){this._LeafletMap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e}Bt.prototype.dimensions=["lng","lat"],Bt.prototype.setMapOffset=function(t){this._mapOffset=t},Bt.prototype.getBMap=function(){return this._LeafletMap},Bt.prototype.dataToPoint=function(t){null===t[1]&&(t[1]=89.99);const e=new r.latLng(t[1],t[0]),i=this._LeafletMap.latLngToLayerPoint(e),n=this._mapOffset;return[i.x-n[0],i.y-n[1]]},Bt.prototype.pointToData=function(t){const e=this._mapOffset,i=this._LeafletMap.layerPointToLatLng([t[0]+e[0],t[1]+e[1]]);return[i.lng,i.lat]},Bt.prototype.getViewRect=function(){const t=this._api;return new Ft.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},Bt.prototype.getRoamTransform=function(){return Ft.matrix.create()},Bt.prototype.prepareCustoms=function(){const t=Ft.util,e=this.getViewRect(),i=this;return{coordSys:{type:"leaflet",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:t.bind(this.dataToPoint,this),size:t.bind(function(e,n){return n=n||[0,0],t.map([0,1],function(t){const r=n[t],o=e[t]/2,s=[],a=[];return s[t]=r-o,a[t]=r+o,s[1-t]=n[1-t],a[1-t]=n[1-t],Math.abs(i.dataToPoint(s)[t]-i.dataToPoint(a)[t])},i)},this)}}},Bt.dimensions=Bt.prototype.dimensions,Bt.create=function(t,e){let i;t.eachComponent("leaflet",function(t){const n=Ft.leafletMap;i||(i=new Bt(n,e)),i.setMapOffset(t.__mapOffset||[0,0]),t.coordinateSystem=i}),t.eachSeries(function(t){if(!t.get("coordinateSystem")||"leaflet"===t.get("coordinateSystem")){if(!i){const t=Ft.leafletMap;i=new Bt(t,e)}t.coordinateSystem=i,t.animation=!0===t.animation}})};var jt=Bt;const Gt=window.echarts;var Ut=r.Layer.extend({map:null,chart:null,options:null,echartsInitOpts:null,canvas:null,initialize(t,e){this.map=t,this.options=e,this.echartsInitOpts=e.echartsInitOpts,this.layerId=e.layerId||"echartlayerdefaultid",this.layerClass=e.classId||"echartlayerdefaultclass",this.visible=!0,this.initDevicePixelRatio(),this.initOptions(this.options),this.initEcharts()},getContainer(){return this.canvas},initDevicePixelRatio(){this.devicePixelRatio=window.devicePixelRatio||1},initOptions(t){if(t){if(t.leaflet)return;this.options.leaflet={roam:!0}}},initEcharts(){Gt.registerCoordinateSystem("leaflet",jt),Gt.extendComponentModel({type:"leaflet",getBMap(){return this.__leaflet},defaultOption:{roam:!1}}),Gt.registerAction({type:"LeafletRoma",event:"LeafletRoma",update:"updateLayout"},function(){})},_visible(){this.visible=!0,this.canvas.style.visibility="visible"},_unvisible(){this.visible=!1,this.canvas.style.visibility="hidden"},onAdd(t){const e=this;this.map=t,this.canvas=this._createCanvas(),this.map.getPane("tilePane").appendChild(this.canvas),this.chart=Gt.init(this.canvas,null,this.echartsInitOpts),Gt.leafletMap=t;const i=this;this.resize=this.resize.bind(this),t.on("resize",i.resize,this),t.on("zoomstart",i._unvisible,this),t.on("rotate",i.resize,this),window.addEventListener("resize",this.resize),Gt.extendComponentView({type:"leaflet",render(t,n,r){let o=!0;i._echartRenderApi||(i._echartRenderApi=r),i._mapModel||(i._mapModel=t);const s=Gt.leafletMap,a=r.getZr().painter.getViewportRoot(),l=t.coordinateSystem,h=function(){if(o||!e.visible)return;const i=s.getBounds().getNorthWest(),n=s.latLngToLayerPoint(i),h=[parseInt(n.x,10)||0,parseInt(n.y,10)||0];a.style.left=`${h[0]}px`,a.style.top=`${h[1]}px`,l.setMapOffset(h),t.__mapOffset=h,r.dispatchAction({type:"LeafletRoma"})},u=function(){i._visible(),!o&&e.visible&&r.dispatchAction({type:"LeafletRoma"})};this._oldMoveHandler&&s.off("move",this._oldMoveHandler),this._oldZoomEndHandler&&s.off("zoomend",this._oldZoomEndHandler),s.on("move",h),s.on("zoomend",u),this._oldMoveHandler=h,this._oldZoomEndHandler=u,o=!1}}),this.chart.setOption(this.options)},onRemove(){this.chart.dispose()},_createCanvas(){const t=document.createElement("div");return t.id=this.layerId,t.style.top="0px",t.style.left="0px",t.height=`${this.map.getSize().y}px`,t.width=`${this.map.getSize().x}px`,t.style.height=`${this.map.getSize().y}px`,t.style.width=`${this.map.getSize().x}px`,t.style.zIndex=1e3,t.setAttribute("id",this.layerId),t.setAttribute("class",`leaflet-layer ${this.layerClass}`),this.canvas=t,t},_calcRotateBounds(){return ct(this.map)},show(){this._visible()},hide(){this._unvisible()},resize(){const t=this,e=t._calcRotateBounds().getSize();if(t.canvas.style.width=`${e.x}px`,t.canvas.style.height=`${e.y}px`,t.canvas.width=e.x,t.canvas.height=e.y,t.chart.resize(),t._echartRenderApi&&t._mapModel&&t.map._rotate){const e=t._echartRenderApi,i=t._mapModel,n=e.getZr().painter.getViewportRoot(),r=i.coordinateSystem,o=t.map.getBounds().getNorthWest(),s=t.map.latLngToLayerPoint(o),a=[parseInt(s.x,10)||0,parseInt(s.y,10)||0];n.style.left=`${a[0]}px`,n.style.top=`${a[1]}px`,r.setMapOffset(a),i.__mapOffset=a,e.dispatchAction({type:"LeafletRoma"})}},update(t){this.chart.setOption(t)},remove(){return this.map&&(this.map.off("resize",this.resize,this),this.map.off("zoomstart",this._unvisible,this),this.map.off("rotate",this.resize,this)),window.removeEventListener("resize",this.resize),this.chart.clear(),this.canvas.parentElement&&this.canvas.parentElement.removeChild(this.canvas),this.map=void 0,this},setOpacity(t){this.canvas.style.opacity=t}});var qt=xt.extend({getTileUrl(t){return this._urlTemplate.replace("{x}",t.x.toString()).replace("{y}",t.y.toString()).replace("{z}",this._getZoomForUrl())},_initUrlTemplate(){const t=n.ServerUtil.getTile(this.url,{tokenKey:this.options.tokenKey,tokenValue:this.options.tokenValue,queryParameters:this._queryParameters});this._urlTemplate=t.url;const e=n.UrlUtil.getStringFromObject(t.queryParameters);e&&(this._urlTemplate+=`?${e}`)}});var Ht=xt.extend({options:{imageFormat:"PNG",imageSR:"",interpolation:"",renderingRule:"",bandIds:null,tokenKey:"",tokenValue:"",httpMethod:"GET",visible:!0,opacity:1,pane:"tilePane",imageServer:null,clippingArea:null,imageHeight:512,imageWidth:512},getTileUrl(t){const e=this._map,i=this.getTileSize(),r=t.scaleBy(i),o=r.add(i),s=e.unproject(r,t.z),a=e.unproject(o,t.z),l=new L.LatLngBounds(s,a),h=this._map.options.crs.project(l.getNorthWest()),u=this._map.options.crs.project(l.getSouthEast()),c=`${h.x},${u.y},${u.x},${h.y}`;return"POST"===this.httpMethod?(this.requestStructure.commonQueryParameters.bbox=new n.Extent({xmin:h.x,ymin:u.y,xmax:u.x,ymax:h.y}),this.requestStructure):this._urlTemplate.replace("{bbox}",c)},_postImage(t,e){return this.server.exportImage(e.commonQueryParameters).then(e=>{const i=new FileReader;i.onload=(e=>{t.src=e.target.result}),e instanceof Blob&&i.readAsDataURL(e),i.onerror=(()=>{})})},_initUrlTemplate(){const t={};this.options.tokenKey&&this.options.tokenValue&&(t.tokenKey=this.options.tokenKey,t.tokenValue=this.options.tokenValue),t.size=`${this.options.imageWidth},${this.options.imageHeight}`,t.format=this.options.imageFormat,t.f="image",t.imageSR=this.options.imageSR,t.interpolation=this.options.interpolation,t.renderingRule=this.options.renderingRule,t.bandIds=this.options.bandIds,t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e,this.server=Object(n.defaultValue)(this.options.imageServer,new n.ImageServer({url:this.url}))}});var Zt=vt.extend({options:{imageFormat:"PNG",imageSR:"",interpolation:"",renderingRule:null,bandIds:null,tokenKey:"",tokenValue:"",httpMethod:"GET",visible:!0,opacity:1,pane:"tilePane",imageServer:null,clippingArea:null},buildRequestImageSrc(t,e){return new Promise(t=>{if("POST"===this.options.httpMethod){const e=this.requestStructure.commonQueryParameters;e.tokenAttachType=this.options.tokenAttachType,e.size=`${this.imageWidth},${this.imageHeight}`,e.bbox=this.bbox,this.server.exportImage(e).then(e=>{const i=new FileReader;i.onload=(e=>{this._map?t(e.target.result):t("")}),i.readAsDataURL(e)})}else t(this._urlTemplate.replace("{bbox}",this.bbox.toString()).replace("{size}",`${this.imageWidth},${this.imageHeight}`))})},_initUrlTemplate(){const t={};this.options.tokenKey&&this.options.tokenValue&&(t.tokenKey=this.options.tokenKey,t.tokenValue=this.options.tokenValue),t.format=this.options.imageFormat,t.f="image",t.imageSR=this.options.imageSR,t.interpolation=this.options.interpolation,t.renderingRule=this.options.renderingRule,t.bandIds=this.options.bandIds,t.formatMode="replace",t.queryParameters=this._queryParameters;const e=n.ServerUtil.getImage(this.url,t);this._urlTemplate=e.url;const i=n.UrlUtil.getStringFromObject(e.queryParameters);i&&(this._urlTemplate+=`?${i}`),this.requestStructure=e},_initServer(){this.server=Object(n.defaultValue)(this.options.imageServer,new n.ImageServer({url:this.url}))}});var Xt=class{constructor(t,e){let i;return(e=Object(n.defaultValue)(e,{})).renderMode=Object(n.defaultValue)(e.renderMode,"image"),"tile"===e.renderMode?(e.imageWidth=Object(n.defaultValue)(e.imageWidth,512),e.imageHeight=Object(n.defaultValue)(e.imageHeight,512),i=new Ht(t,e)):i=new Zt(t,e),i}};var Yt=class extends n.BaseSwipeTool{constructor(t){super(t),this._addEvents(),this._reCreatedControl()}enable(t){this._swipeControl&&this._swipeControl.enable(t)}destroy(){this._removeEvents(),this._swipeControl&&this._swipeControl.remove()}_reCreatedControl(){this._swipeControl&&(this._swipeControl.remove(),this._swipeControl=null),this.innerView=this.view.getInnerView();const t=new F([],[],{mode:this.mode,region:this.region});this._swipeControl=t,t.addTo(this.innerView),this._updateLeadingLayers(),this._updateTrailingLayers()}_updateLeadingLayers(){if(this._swipeControl){const t=this.leadingLayers.items.map(t=>this.view.getInnerLayer(t)).filter(t=>t);this._swipeControl.setLeadingLayers(t)}}_updateTrailingLayers(){if(this._swipeControl){const t=this.trailingLayers.items.map(t=>this.view.getInnerLayer(t)).filter(t=>t);this._swipeControl.setTrailingLayers(t)}}_processLayerViewCreated(t){if(this._swipeControl){const e=t.layer;this.leadingLayers.items.some(t=>t.id===e.id)&&this._updateLeadingLayers(),this.trailingLayers.items.some(t=>t.id===e.id)&&this._updateTrailingLayers()}}_addEvents(){const t=this.view;t.on("innerview-recreated",this._reCreatedControl,this),t.on("layerview-created",this._processLayerViewCreated,this)}_removeEvents(){const t=this.view;t.off("innerview-recreated",this._reCreatedControl,this),t.off("layerview-created",this._processLayerViewCreated,this)}_updateDiff(t,e,i){switch(t){case"leadingLayers":this._updateLeadingLayers();break;case"trailingLayers":this._updateTrailingLayers();break;case"region":this._swipeControl&&this._swipeControl.setRegion(this.region);break;case"mode":this._swipeControl&&this._swipeControl.setMode(this.mode)}}};var Wt=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!");this._collection=new n.Collection}add(t){this._collection.add(t),t._addView()}remove(t){this._collection.remove(t),t._removeView(),t&&t.destroy&&t.destroy()}findControlById(t){return this._collection.filter(e=>e._id===t)}};class $t{}$t.getMouseEvent=function(t,e,i){const r=e._spatialReference;let o=void 0;return{mapPoint:o=r&&!r.isGeographic?n.Projection.project(new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),r):new n.Point({coordinates:[t.latlng.lng,t.latlng.lat]}),x:t.containerPoint.x,y:t.containerPoint.y,button:t.originalEvent.button,buttons:t.originalEvent.buttons,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,innerViewerEvent:t,type:i}},$t.getKeyEvent=function(t,e,i){const n={key:t.originalEvent.key,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,innerViewerEvent:t,type:i};return"key-down"===i&&(n.repeat=t.originalEvent.repeat),n},$t.getViewChangeEvent=function(t,e,i){const n={event:t,innerViewerEvent:t,target:e,type:i};return n.mapView=e,n.scale=e._scale,n.zoom=e._zoom,n.center=e.center,n.extent=e._extent,n},$t.getDragEvent=function(t,e,i,n,r){return{x:t.originalEvent.layerX,y:t.originalEvent.layerY,button:void 0!==r?r:t.originalEvent.button,buttons:t.originalEvent.buttons,cancelable:t.originalEvent.cancelable,origin:i,stopPropagation:t.originalEvent.stopPropagation,timeStamp:t.originalEvent.timeStamp,native:t.originalEvent,action:n,innerViewerEvent:t,type:"drag"}};var Kt=$t;var Qt=class extends n.LayerView{onAdd(){return this._layerViewVisible=this._getLayerViewVisible(),nt.addVectorTileLayer(this),Promise.resolve(this)}onRemove(){return nt.removeLayer(this),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);const{innerLayer:e}=this;if(t.updateContent&&e&&e.getMapboxMap){const i=e.getMapboxMap();t.updateContent.forEach(t=>{t&&(i._loaded?this._onUpdate(t,i):i.once("load",()=>{this._onUpdate(t,i)}))})}return Promise.resolve(this)}_onUpdate(t,e){if(e[t.name])return void e[t.name].apply(e,t.params);const{params:i}=t;switch(t.name){case"setPaintProperties":nt.setPaintProperties(e,i[0],i[1]);break;case"setLayoutProperties":nt.setLayoutProperties(e,i[0],i[1]);break;case"sublayerUpdate":this._updateStyle(e,JSON.parse(JSON.stringify(i[0])));break;case"opacity":case"setStyleLayer":case"deleteStyleLayer":case"refresh":this._updateStyle(e,JSON.parse(JSON.stringify(this.layer.style.layers)));break;case"scaleVisible":case"minScale":case"maxScale":case"visible":{const i=this._getLayerViewVisible("scaleVisible"===t.name);this._layerViewVisible!==i&&(this._updateStyle(e,JSON.parse(JSON.stringify(this.layer.style.layers))),this._layerViewVisible=i);break}case"clippingArea":nt.setClippingArea(this,i[0]);break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}_updateStyle(t,e){const i=this._getOpacity(),n=this._getLayerViewVisible();nt.updateStyleLayer(t,e,{opacity:i,visible:n})}};var Jt=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=$.addWMSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.onRefresh();break;case"sublayerVisible":this.innerLayer.setParams({layers:this.layer.layers});break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}onRefresh(){this.innerLayer.redraw()}};var te=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=Q.addWMTSLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};var ee=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=Z.addIGSTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};var ie=class extends n.Evented{constructor(t){super(t),this.view=Object(n.defaultValue)(t.view,null),this.location=Object(n.defaultValue)(t.location,""),this.title=Object(n.defaultValue)(t.title,""),this.content=Object(n.defaultValue)(t.content,""),this.alignment=Object(n.defaultValue)(t.alignment,"bottom-center"),this.defaultButtons=Object(n.defaultValue)(t.defaultButtons,["toggle","close","zoom"]),this._popup=void 0,this._initPopup(),this._initDefaultClass()}_initPopup(){this._customPopup(),this.view._innerView.closePopupOnClick=!1}_customPopup(){r.CustomPopup=r.Popup.extend({_initLayout(){const t="leaflet-popup",e=r.DomUtil.create("div",`${t} ${this.options.className||""} leaflet-zoom-animated`);this._container=e,e.setAttribute("style","margin: 0;");const i=r.DomUtil.create("div",`zondy-popup__container ${t}-content-wrapper`,e);this._wrapper=i,this._contentNode=r.DomUtil.create("div",`${t}-content`,i),this._contentNode.setAttribute("style","margin:0"),r.DomEvent.disableClickPropagation(i).disableScrollPropagation(this._contentNode).on(i,"contextmenu",r.DomEvent.stopPropagation),this._tipContainer=r.DomUtil.create("div","",e),this._tipContainer.setAttribute("style","margin: auto;width: 40px;height: 20px;pointer-events: none;overflow: hidden;pointer-events: none;"),this._tip=r.DomUtil.create("div",`zondy-popup__tip ${t}-tip`,this._tipContainer)}})}_contentUI(t,e){const i=this;let n=void 0;const r=function(t){const e=document.createElement("div");return e.innerHTML=t,e.childNodes};(n=document.createElement("div")).setAttribute("id",`${this.id}-popup-default`);const o=document.createElement("div");o.setAttribute("class","zondy-popup__header-default zondy-popup__header"),o.setAttribute("style","display: flex;");const s=r('<div class="zondy-popup__toggle-default zondy-popup__toggle">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 24 24" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M5 13.793l7-7 7 7v1.414l-7-7-7 7z"></path></svg>\n </div>')[0],a=r('<div class="zondy-popup__close-default zondy-popup__close">\n <svg aria-hidden="true" class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M3.98 11.303L7.281 8 3.98 4.697l.707-.707L7.99 7.293l.01-.01.01.01 3.304-3.303.707.707L8.718 8l3.303 3.303-.707.707L8.01 8.707l-.01.01-.01-.01-3.304 3.303z"></path></svg>\n </div>')[0];if(t||""===t){const e=r('<div class="zondy-popup__title" style="flex: 1;"></div>')[0];if(o.appendChild(e),"object"==typeof t?t instanceof Node?e.appendChild(t):t instanceof NodeList&&t.forEach(t=>{e.appendChild(t)}):e.innerHTML=t,this.defaultButtons.indexOf("toggle")>-1){o.appendChild(s);let t=!0;o.onclick=function(){t=!t,document.getElementById(`${i.id}-popup-default`).querySelector(".zondy-popup__content-default").style.display=t?"block":"none"}}this.defaultButtons.indexOf("close")>-1&&(o.appendChild(a),a.onclick=(()=>{this.close()}))}const l=document.createElement("div");if(l.setAttribute("class","zondy-popup__content-default zondy-popup__content"),e)if("object"==typeof e){if(e instanceof Node)l.appendChild(e);else if(e instanceof NodeList)for(let t=0;t<e.length;t++)l.appendChild(e[t]),t--}else l.innerHTML=e;const h=document.createElement("div");h.setAttribute("class","zondy-popup__footer-default zondy-popup__footer");const u=r('<div class="zondy-popup__zoom" style="display: inline-block;width: 36px;height: 36px;line-height: 36px;text-align: center;">\n <svg class="svg" fill="currentColor" height="16px" width="16px" viewBox="0 0 16 16" width="100%" xmlns="http://www.w3.org/2000/svg"><path d="M9 7H7v2H6V7H4V6h2V4h1v2h2zm6.805 7.861l-.943.942a.665.665 0 0 1-.943 0l-3.067-3.067a.667.667 0 0 1 0-.943l.129-.13-1.108-1.107A5.279 5.279 0 1 1 11.8 6.5a5.251 5.251 0 0 1-1.237 3.366l1.108 1.108.124-.124a.668.668 0 0 1 .943 0l3.067 3.068a.666.666 0 0 1 0 .943zM10.8 6.5a4.3 4.3 0 1 0-4.3 4.3 4.304 4.304 0 0 0 4.3-4.3zm4.062 7.89l-2.595-2.598-.473.473 2.597 2.595z"></path></svg>\n </div>')[0];return this.defaultButtons.indexOf("zoom")>-1&&(h.appendChild(u),u.onclick=function(){i.view.flyTo({zoom:i.view._zoom+1,center:i.location})}),h.childNodes.length>0&&h.setAttribute("class","zondy-popup__footer-division zondy-popup__footer-default zondy-popup__footer"),n.appendChild(o),n.appendChild(l),n.appendChild(h),n}_initDefaultClass(){let t=!1;const e=document.head.getElementsByTagName("style");if(e)for(let i=0;i<e.length;i++)if(e[i].innerHTML.indexOf("styleDomString")>-1){t=!0;break}if(!t){const t=document.createElement("style");t.innerHTML="\n .zondy-popup__container-default{\n background-color: #fff;\n padding:0;\n border-radius: 10px;\n }\n .zondy-popup__tip-default{\n background-color: #fff;\n }\n .zondy-popup__header-default{\n padding: 8px;\n font-size: 18px;\n font-weight: 600;\n line-height: 20px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n }\n .zondy-popup__content-default{\n padding: 8px;\n }\n .zondy-popup__footer-default{\n }\n .zondy-popup__footer-division{\n border-top: 1px solid;\n }\n .zondy-popup__toggle-default,.zondy-popup__close-default{\n display: inline-block;width: 30px;text-align: center;\n }\n ",document.querySelector("head").append(t)}}open(t){this._popup?(this.close(),this._popup=void 0,this.openPopup(t)):this.openPopup(t)}openPopup(t){if(this.view=Object(n.defaultValue)(t.view,this.view),this.location=Object(n.defaultValue)(t.location,this.location),this.location.spatialReference.isGeographic?this._location=this.location:this._location=n.Projection.project(this.location,new n.SpatialReference({wkid:4326})),this.title=Object(n.defaultValue)(t.title,this.title),this.content=Object(n.defaultValue)(t.content,this.content),this.alignment=Object(n.defaultValue)(t.alignment,this.alignment),this.defaultButtons=Object(n.defaultValue)(t.defaultButtons,this.defaultButtons),!this.view._innerView)return void n.Log.info("没有视图引擎!");const e=r.latLng(this._location.coordinates[1],this._location.coordinates[0]),i=this._contentUI(this.title,this.content);this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView);const o=this._getOffset();this._popup=new r.CustomPopup({className:"layerPopup",maxWidth:1900,minWidth:50,closeOnClick:!1,offset:o,autoPan:!1}).setLatLng(e).setContent(i).openOn(this.view._innerView)}_getOffset(){let t=null;if(this._popup&&this._popup._container&&this.alignment){const e=this._popup._container.getBoundingClientRect(),i=this._getOffsetByAlignment(this.alignment,e.width,e.height);t=new r.Point(i.x,i.y)}return t}_getOffsetByAlignment(t,e,i){let n=0,r=0;switch(t){case"top-left":n=e/2,r=i;break;case"top-center":r=i;break;case"top-right":n=-e/2,r=i;break;case"bottom-left":n=e/2;break;case"auto":case"bottom-center":break;case"bottom-right":n=-e/2}return{x:n,y:r}}close(){this.view._innerView&&this.view._innerView.closePopup(this._popup)}destroy(){}},ne=i(5),re=i(6);var oe=function(t){t.Control.EasyPrint=t.Control.extend({options:{title:"Print map",position:"topleft",sizeModes:["Current"],filename:"map",exportOnly:!1,hidden:!1,tileWait:500,hideControlContainer:!0,hideClasses:[],customWindowTitle:window.document.title,spinnerBgCOlor:"#0DC5C1",customSpinnerClass:"epLoader",defaultSizeTitles:{Current:"Current Size",A4Landscape:"A4 Landscape",A4Portrait:"A4 Portrait"}},onAdd:function(){this.mapContainer=this._map.getContainer(),this.options.sizeModes=this.options.sizeModes.map(function(t){return"Current"===t?{name:this.options.defaultSizeTitles.Current,className:"CurrentSize"}:"A4Landscape"===t?{height:this._a4PageSize.height,width:this._a4PageSize.width,name:this.options.defaultSizeTitles.A4Landscape,className:"A4Landscape page"}:"A4Portrait"===t?{height:this._a4PageSize.width,width:this._a4PageSize.height,name:this.options.defaultSizeTitles.A4Portrait,className:"A4Portrait page"}:t},this);var e=t.DomUtil.create("div","leaflet-control-easyPrint leaflet-bar leaflet-control");if(!this.options.hidden){this._addCss(),t.DomEvent.addListener(e,"mouseover",this._togglePageSizeButtons,this),t.DomEvent.addListener(e,"mouseout",this._togglePageSizeButtons,this);var i="leaflet-control-easyPrint-button";this.options.exportOnly&&(i+="-export"),this.link=t.DomUtil.create("a",i,e),this.link.id="leafletEasyPrint",this.link.title=this.options.title,this.holder=t.DomUtil.create("ul","easyPrintHolder",e),this.options.sizeModes.forEach(function(e){var i=t.DomUtil.create("li","easyPrintSizeMode",this.holder);i.title=e.name,t.DomUtil.create("a",e.className,i),t.DomEvent.addListener(i,"click",this.printMap,this)},this),t.DomEvent.disableClickPropagation(e)}return e},printMap:async function(t,e){e&&(this.options.filename=e),this.options.format?("jpeg"==this.options.format.toLowerCase()?this.formatFun="toJpeg":"svg"==this.options.format.toLowerCase()?this.formatFun="toSvg":this.formatFun="toPng",this.format=this.options.format):(this.formatFun="toPng",this.format="png"),this.options.width=this.options.width?this.options.width:this.mapContainer.clientWidth,this.options.height=this.options.height?this.options.height:this.mapContainer.clientHeight,this.options.exportOnly||(this._page=window.open("","_blank","toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,left=10, top=10, width=200, height=250, visible=none"),this._page.document.write(this._createSpinner(this.options.customWindowTitle,this.options.customSpinnerClass,this.options.spinnerBgCOlor))),this.originalState={mapWidth:this.mapContainer.style.width,widthWasAuto:!1,widthWasPercentage:!1,mapHeight:this.mapContainer.style.height,zoom:this._map.getZoom(),center:this._map.getCenter()},"auto"===this.originalState.mapWidth?(this.originalState.mapWidth=this._map.getSize().x+"px",this.originalState.widthWasAuto=!0):this.originalState.mapWidth.includes("%")&&(this.originalState.percentageWidth=this.originalState.mapWidth,this.originalState.widthWasPercentage=!0,this.originalState.mapWidth=this._map.getSize().x+"px"),this._map.fire("easyPrint-start",{event:t}),this.options.hidden||this._togglePageSizeButtons({type:null}),this.options.hideControlContainer&&this._toggleControls(),this.options.hideClasses&&this._toggleClasses(this.options.hideClasses);var i="string"!=typeof t?t.target.className:t;if("CurrentSize"===i)return await this._printOpertion(i);this.outerContainer=this._createOuterContainer(this.mapContainer),this.originalState.widthWasAuto&&(this.outerContainer.style.width=this.originalState.mapWidth),this._createImagePlaceholder(i)},_createImagePlaceholder:function(t){var e=this;ne.toPng(this.mapContainer,{width:parseInt(this.originalState.mapWidth.replace("px")),height:parseInt(this.originalState.mapHeight.replace("px"))}).then(function(i){e.blankDiv=document.createElement("div");var n=e.blankDiv;e.outerContainer.parentElement.insertBefore(n,e.outerContainer),n.className="epHolder",n.style.backgroundImage='url("'+i+'")',n.style.position="absolute",n.style.zIndex=1011,n.style.display="initial",n.style.width=e.originalState.mapWidth,n.style.height=e.originalState.mapHeight,e._resizeAndPrintMap(t)}).catch(function(t){console.error("oops, something went wrong!",t)})},_resizeAndPrintMap:function(t){this.outerContainer.style.opacity=0;var e=this.options.sizeModes.filter(function(e){return e.className.indexOf(t)>-1});e=e[0],this.mapContainer.style.width=e.width+"px",this.mapContainer.style.height=e.height+"px",this.mapContainer.style.width>this.mapContainer.style.height?this.orientation="portrait":this.orientation="landscape",this._map.setView(this.originalState.center),this._map.setZoom(this.originalState.zoom),this._map.invalidateSize(),this.options.tileLayer?this._pausePrint(t):this._printOpertion(t)},_pausePrint:function(t){var e=this,i=setInterval(function(){e.options.tileLayer.isLoading()||(clearInterval(i),e._printOpertion(t))},e.options.tileWait)},_getValidDom:function(t){for(var e=t.cloneNode(!0),i=e.getElementsByClassName("leaflet-tile"),n=0;n<i.length;n++){var r=i[n];(!r.classList.contains("leaflet-tile-loaded")&&r.parentElement.classList.contains("leaflet-tile-container")||""===r.src)&&(r.remove(),n--)}return e},_printOpertion:function(t){var e=this,i=this.options.width?this.options.width:this.mapContainer.style.width.replace("px"),n=this.options.height?this.options.height:this.mapContainer.style.height.replace("px"),r=this.options.isDownload;return(this.originalState.widthWasAuto&&"CurrentSize"===t||this.originalState.widthWasPercentage&&"CurrentSize"===t)&&(i=this.originalState.mapWidth),new Promise(t=>{const o=e._getValidDom(e.mapContainer);document.body.appendChild(o),ne[this.formatFun](o,{width:parseInt(i),height:parseInt(n)}).then(function(i){var n=e._dataURItoBlob(i);e.options.exportOnly?r&&re.saveAs(n,e.options.filename+"."+e.format):e._sendToBrowserPrint(i,e.orientation),e._toggleControls(!0),e._toggleClasses(e.options.hideClasses,!0),e.outerContainer&&(e.originalState.widthWasAuto?e.mapContainer.style.width="auto":e.originalState.widthWasPercentage?e.mapContainer.style.width=e.originalState.percentageWidth:e.mapContainer.style.width=e.originalState.mapWidth,e.mapContainer.style.height=e.originalState.mapHeight,e._removeOuterContainer(e.mapContainer,e.outerContainer,e.blankDiv),e._map.invalidateSize(),e._map.setView(e.originalState.center),e._map.setZoom(e.originalState.zoom)),e._map.fire("easyPrint-finished"),t({dataUrl:i})}).catch(function(t){console.error("Print operation failed",t)}).finally(()=>{document.body.removeChild(o)})})},_sendToBrowserPrint:function(t,e){this._page.resizeTo(600,800);var i=this._createNewWindow(t,e,this);this._page.document.body.innerHTML="",this._page.document.write(i),this._page.document.close()},_createSpinner:function(t,e,i){return"<html><head><title>"+t+"</title></head><body><style>\n body{\n background: "+i+";\n }\n .epLoader,\n .epLoader:before,\n .epLoader:after {\n border-radius: 50%;\n }\n .epLoader {\n color: #ffffff;\n font-size: 11px;\n text-indent: -99999em;\n margin: 55px auto;\n position: relative;\n width: 10em;\n height: 10em;\n box-shadow: inset 0 0 0 1em;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n }\n .epLoader:before,\n .epLoader:after {\n position: absolute;\n content: '';\n }\n .epLoader:before {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 10.2em 0 0 10.2em;\n top: -0.1em;\n left: -0.1em;\n -webkit-transform-origin: 5.2em 5.1em;\n transform-origin: 5.2em 5.1em;\n -webkit-animation: load2 2s infinite ease 1.5s;\n animation: load2 2s infinite ease 1.5s;\n }\n .epLoader:after {\n width: 5.2em;\n height: 10.2em;\n background: #0dc5c1;\n border-radius: 0 10.2em 10.2em 0;\n top: -0.1em;\n left: 5.1em;\n -webkit-transform-origin: 0px 5.1em;\n transform-origin: 0px 5.1em;\n -webkit-animation: load2 2s infinite ease;\n animation: load2 2s infinite ease;\n }\n @-webkit-keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n @keyframes load2 {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n }\n </style>\n <div class=\""+e+'">Loading...</div></body></html>'},_createNewWindow:function(t,e,i){return"<html><head>\n <style>@media print {\n img { max-width: 98%!important; max-height: 98%!important; }\n @page { size: "+e+";}}\n </style>\n <script>function step1(){\n setTimeout('step2()', 10);}\n function step2(){window.print();window.close()}\n <\/script></head><body onload='step1()'>\n <img src=\""+t+'" style="display:block; margin:auto;"></body></html>'},_createOuterContainer:function(t){var e=document.createElement("div");return t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t),e.appendChild(t),e.style.width=t.style.width,e.style.height=t.style.height,e.style.display="inline-block",e.style.overflow="hidden",e},_removeOuterContainer:function(t,e,i){e.parentNode&&(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(i),e.parentNode.removeChild(e))},_addCss:function(){var t=document.createElement("style");t.type="text/css",t.innerHTML=".leaflet-control-easyPrint-button { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMiA1MTI7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPGc+Cgk8cGF0aCBkPSJNMTI4LDMyaDI1NnY2NEgxMjhWMzJ6IE00ODAsMTI4SDMyYy0xNy42LDAtMzIsMTQuNC0zMiwzMnYxNjBjMCwxNy42LDE0LjM5OCwzMiwzMiwzMmg5NnYxMjhoMjU2VjM1Mmg5NiAgIGMxNy42LDAsMzItMTQuNCwzMi0zMlYxNjBDNTEyLDE0Mi40LDQ5Ny42LDEyOCw0ODAsMTI4eiBNMzUyLDQ0OEgxNjBWMjg4aDE5MlY0NDh6IE00ODcuMTk5LDE3NmMwLDEyLjgxMy0xMC4zODcsMjMuMi0yMy4xOTcsMjMuMiAgIGMtMTIuODEyLDAtMjMuMjAxLTEwLjM4Ny0yMy4yMDEtMjMuMnMxMC4zODktMjMuMiwyMy4xOTktMjMuMkM0NzYuODE0LDE1Mi44LDQ4Ny4xOTksMTYzLjE4Nyw0ODcuMTk5LDE3NnoiIGZpbGw9IiMwMDAwMDAiLz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .leaflet-control-easyPrint-button-export { \n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTYuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgd2lkdGg9IjE2cHgiIGhlaWdodD0iMTZweCIgdmlld0JveD0iMCAwIDQzMy41IDQzMy41IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0MzMuNSA0MzMuNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8Zz4KCTxnIGlkPSJmaWxlLWRvd25sb2FkIj4KCQk8cGF0aCBkPSJNMzk1LjI1LDE1M2gtMTAyVjBoLTE1M3YxNTNoLTEwMmwxNzguNSwxNzguNUwzOTUuMjUsMTUzeiBNMzguMjUsMzgyLjV2NTFoMzU3di01MUgzOC4yNXoiIGZpbGw9IiMwMDAwMDAiLz4KCTwvZz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8Zz4KPC9nPgo8L3N2Zz4K);\n background-size: 16px 16px; \n cursor: pointer; \n }\n .easyPrintHolder a {\n background-size: 16px 16px;\n cursor: pointer;\n }\n .easyPrintHolder .CurrentSize{\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMTZweCIgdmVyc2lvbj0iMS4xIiBoZWlnaHQ9IjE2cHgiIHZpZXdCb3g9IjAgMCA2NCA2NCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgNjQgNjQiPgogIDxnPgogICAgPGcgZmlsbD0iIzFEMUQxQiI+CiAgICAgIDxwYXRoIGQ9Ik0yNS4yNTUsMzUuOTA1TDQuMDE2LDU3LjE0NVY0Ni41OWMwLTEuMTA4LTAuODk3LTIuMDA4LTIuMDA4LTIuMDA4QzAuODk4LDQ0LjU4MiwwLDQ1LjQ4MSwwLDQ2LjU5djE1LjQwMiAgICBjMCwwLjI2MSwwLjA1MywwLjUyMSwwLjE1NSwwLjc2N2MwLjIwMywwLjQ5MiwwLjU5NCwwLjg4MiwxLjA4NiwxLjA4N0MxLjQ4Niw2My45NDcsMS43NDcsNjQsMi4wMDgsNjRoMTUuNDAzICAgIGMxLjEwOSwwLDIuMDA4LTAuODk4LDIuMDA4LTIuMDA4cy0wLjg5OC0yLjAwOC0yLjAwOC0yLjAwOEg2Ljg1NWwyMS4yMzgtMjEuMjRjMC43ODQtMC43ODQsMC43ODQtMi4wNTUsMC0yLjgzOSAgICBTMjYuMDM5LDM1LjEyMSwyNS4yNTUsMzUuOTA1eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgICA8cGF0aCBkPSJtNjMuODQ1LDEuMjQxYy0wLjIwMy0wLjQ5MS0wLjU5NC0wLjg4Mi0xLjA4Ni0xLjA4Ny0wLjI0NS0wLjEwMS0wLjUwNi0wLjE1NC0wLjc2Ny0wLjE1NGgtMTUuNDAzYy0xLjEwOSwwLTIuMDA4LDAuODk4LTIuMDA4LDIuMDA4czAuODk4LDIuMDA4IDIuMDA4LDIuMDA4aDEwLjU1NmwtMjEuMjM4LDIxLjI0Yy0wLjc4NCwwLjc4NC0wLjc4NCwyLjA1NSAwLDIuODM5IDAuMzkyLDAuMzkyIDAuOTA2LDAuNTg5IDEuNDIsMC41ODlzMS4wMjctMC4xOTcgMS40MTktMC41ODlsMjEuMjM4LTIxLjI0djEwLjU1NWMwLDEuMTA4IDAuODk3LDIuMDA4IDIuMDA4LDIuMDA4IDEuMTA5LDAgMi4wMDgtMC44OTkgMi4wMDgtMi4wMDh2LTE1LjQwMmMwLTAuMjYxLTAuMDUzLTAuNTIyLTAuMTU1LTAuNzY3eiIgZmlsbD0iIzAwMDAwMCIvPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==)\n }\n .easyPrintHolder .page {\n background-image: url(data:image/svg+xml;utf8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTguMS4xLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiBpZD0iQ2FwYV8xIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDQ0NC44MzMgNDQ0LjgzMyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDQ0LjgzMyA0NDQuODMzOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgd2lkdGg9IjUxMnB4IiBoZWlnaHQ9IjUxMnB4Ij4KPGc+Cgk8Zz4KCQk8cGF0aCBkPSJNNTUuMjUsNDQ0LjgzM2gzMzQuMzMzYzkuMzUsMCwxNy03LjY1LDE3LTE3VjEzOS4xMTdjMC00LjgxNy0xLjk4My05LjM1LTUuMzgzLTEyLjQ2N0wyNjkuNzMzLDQuNTMzICAgIEMyNjYuNjE3LDEuNywyNjIuMzY3LDAsMjU4LjExNywwSDU1LjI1Yy05LjM1LDAtMTcsNy42NS0xNywxN3Y0MTAuODMzQzM4LjI1LDQzNy4xODMsNDUuOSw0NDQuODMzLDU1LjI1LDQ0NC44MzN6ICAgICBNMzcyLjU4MywxNDYuNDgzdjAuODVIMjU2LjQxN3YtMTA4LjhMMzcyLjU4MywxNDYuNDgzeiBNNzIuMjUsMzRoMTUwLjE2N3YxMzAuMzMzYzAsOS4zNSw3LjY1LDE3LDE3LDE3aDEzMy4xNjd2MjI5LjVINzIuMjVWMzR6ICAgICIgZmlsbD0iIzAwMDAwMCIvPgoJPC9nPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+CjxnPgo8L2c+Cjwvc3ZnPgo=);\n }\n .easyPrintHolder .A4Landscape { \n transform: rotate(-90deg);\n }\n \n .leaflet-control-easyPrint-button{\n display: inline-block;\n }\n .easyPrintHolder{\n margin-top:-31px;\n margin-bottom: -5px;\n margin-left: 30px;\n padding-left: 0px;\n display: none;\n }\n \n .easyPrintSizeMode {\n display: inline-block;\n }\n .easyPrintHolder .easyPrintSizeMode a {\n border-radius: 0px;\n }\n \n .easyPrintHolder .easyPrintSizeMode:last-child a{\n border-top-right-radius: 2px;\n border-bottom-right-radius: 2px;\n margin-left: -1px;\n }\n \n .easyPrintPortrait:hover, .easyPrintLandscape:hover{\n background-color: #757570;\n cursor: pointer;\n }",document.body.appendChild(t)},_dataURItoBlob:function(t){for(var e=atob(t.split(",")[1]),i=t.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(e.length),r=new DataView(n),o=0;o<e.length;o++)r.setUint8(o,e.charCodeAt(o));return new Blob([n],{type:i})},_togglePageSizeButtons:function(t){var e=this.holder.style,i=this.link.style;"mouseover"===t.type?(e.display="block",i.borderTopRightRadius="0",i.borderBottomRightRadius="0"):(e.display="none",i.borderTopRightRadius="2px",i.borderBottomRightRadius="2px")},_toggleControls:function(t){var e=document.getElementsByClassName("leaflet-control-container")[0];if(t)return e.style.display="block";e.style.display="none"},_toggleClasses:function(t,e){t.forEach(function(t){var i=document.getElementsByClassName(t)[0];if(e)return i.style.display="block";i.style.display="none"})},_a4PageSize:{height:715,width:1045}}),t.EasyPrint=function(e){return new t.Control.EasyPrint(e)}};var se=class{constructor(t){t=Object(n.defaultValue)(t,{}),this.view=Object(n.defaultValue)(t.view,null),this.format=Object(n.defaultValue)(t.format,n.PictureFormat.PNG),this.filename=Object(n.defaultValue)(t.filename,"screenshotFile"),this.width=Object(n.defaultValue)(t.width,this.view.width),this.height=Object(n.defaultValue)(t.height,this.view.height),this.x=Object(n.defaultValue)(t.x,0),this.y=Object(n.defaultValue)(t.y,0),this.isDownload=Object(n.defaultValue)(t.isDownload,!0),this._print=void 0,this._initEasyPrint()}_initEasyPrint(){oe(r)}_addView(){const t=this.view._innerView;if(t){const e={format:this.format,sizeModes:["Current","A4Landscape","A4Portrait"],filename:"新地图",exportOnly:!0,hidden:!0,isDownload:!1,width:this.view.width,height:this.view.height,hideControlContainer:!0};return this._print=r.EasyPrint(e).addTo(t),new Promise(t=>{this._print.printMap("CurrentSize",this.filename).then(e=>{this._cutImage(e.dataUrl).then(e=>{t({dataUrl:e.dataUrl})})})})}}_cutImage(t){const e=this,i=document.createElement("canvas");i.width=this.width,i.height=this.height;const r=i.getContext("2d"),o=function(t,e){const i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click()};return new Promise(s=>{if(this.width&&this.height){const a=new Image;a.src=t,a.onload=function(){r.drawImage(a,e.x,e.y,e.width,e.height,0,0,e.width,e.height);let t=null;e.format===n.PictureFormat.PNG?t=i.toDataURL():e.format===n.PictureFormat.JPEG?t=i.toDataURL("image/jpeg"):"svg"===e.format&&(t=i.toDataURL()),e.isDownload&&o(t,e.filename),s({dataUrl:t})}}else e.isDownload&&o(t,this.filename),s({dataUrl:t})})}_removeView(){super._removeView();const t=this.view._innerView;t&&this._print&&(t.removeControl(this._print),this._print=null)}};var ae=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=Y.addIGSMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":const t=this._getLayerViewVisible("scaleVisible"===i.name);this.innerLayer.setVisible(t);break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"sublayerVisible":this.onRefresh();break;case"refresh":case"disableHiRender":this.onRefresh();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}onRefresh(){const{innerLayer:t}=this;Y.updateIGSMapImageLayer(this),t.refresh()}};var le=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=at.addIGSImageryLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":const t=this._getLayerViewVisible("scaleVisible"===i.name);this.innerLayer.setVisible(t);break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"refresh":case"bandIds":case"interpolation":case"rasterFunction":this.onRefresh();break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}onRefresh(){const{innerLayer:t}=this;at.updateIGSImageLayer(this),t.refresh()}};class he extends n.BaseGraphicsLayerView{onAdd(t){const e=this.layer,i=this.innerView,n=e.graphics||[],o=this;o.innerLayer=r.featureGroup().addTo(i),o.innerLayer.commonLayerId=e.id;const s=o._getLayerViewVisible(),a=o._getOpacity();return U.setVisibleOpacity(o.innerLayer,a,s),n.forEach(t=>{o._addFeature(o.innerLayer,t)}),Promise.resolve(this)}onRemove(t){return this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){this.layer;const e=this.innerLayer;return t.updateContent&&e&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"scaleVisible":case"opacity":case"minScale":case"maxScale":case"visible":{const e=this._getOpacity(),i=this._getLayerViewVisible("scaleVisible"===t.name);U.setVisibleOpacity(this.innerLayer,e,i);break}}if(t&&"method"===t.operationType)switch(t.name){case"add":{const i=t.params;this._addFeature(e,i[0]),this._updateGraphicsInOrder();break}case"remove":{const i=t.params;this._removeFeature(e,i[0]);break}case"addMany":{let i=t.params[0];i instanceof n.FeatureSet&&(i=i.features),i.forEach(t=>{this._addFeature(e,t)}),this._updateGraphicsInOrder();break}case"removeMany":t.params[0].forEach(t=>{this._removeFeature(e,t)});break;case"removeAll":e.clearLayers();break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}),Promise.resolve(this)}_addFeature(t,e){Object(n.defined)(e.geometry)?(e.geometry&&!e.geometry.spatialReference&&(e.geometry.spatialReference=this.layer.spatialReference),this.render.drawFeature(t,[e])):n.Log.warning("要素几何信息缺失,无法绘制要素:",e)}_removeFeature(t,e){this.render.clearFeature(t,[e])}_updateGraphicsInOrder(){const t=this.view.allLayerViews.toArray(),e=t.findIndex(t=>t.id===this.id);if(e>-1){const i=t.slice(e+1).find(t=>t instanceof he);i&&i!==this&&this._insertBeforeLayerView(i)}}_insertBeforeLayerView(t){const e=[];U.getLeafletGroupLayers(this.innerLayer,e,t=>t instanceof r.Path);const i=[];if(U.getLeafletGroupLayers(t.innerLayer,i,t=>t instanceof r.Path),0===i.length||0===e.length)return;const n=i[0];e.forEach(t=>{U.insertBefore(t._path,n._path)})}}var ue=he;class ce{}ce.addEchartsLayer=function(t){const{layer:e,innerView:i}=t,{extensionOptions:r={}}=e;let o=Object.assign(e.echartsOptions,r);o=Object(n.deleteNullValue)(o);const s=new Ut(i,o).addTo(i);return s.id=e.id,s},ce.removeLayer=function(t){t.remove()};var pe=ce;var fe=class extends n.LayerView{onAdd(t){const e=this.layer;return this.innerLayer=pe.addEchartsLayer(this),this.innerLayer.commonLayerId=e.commonLayerId,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide(),Promise.resolve(this)}onRemove(t){return pe.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this._getLayerViewVisible("scaleVisible"===i.name)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};class de{}de.addMapVLayer=function(t){const{layer:e,innerView:i}=t,{extensionOptions:r={}}=e;let o=Object.assign(e.mapVOptions,r);o=Object(n.deleteNullValue)(o);const s=new Vt(i,e.data,o).addTo(i);return s.id=e.id,s},de.removeLayer=function(t){t.remove()};var ge=de;var ye=class extends n.LayerView{onAdd(t){const e=this.layer;this.innerLayer=ge.addMapVLayer(this),this.innerLayer.commonLayerId=e.id,this._getLayerViewVisible()?this.innerLayer.show():this.innerLayer.hide();const i=this._getOpacity();return this.innerLayer.setOpacity(i),Promise.resolve(this)}onRemove(t){return ge.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this._getLayerViewVisible("scaleVisible"===i.name)?this.innerLayer.show():this.innerLayer.hide();break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};const me=r.Icon.extend({options:{iconUrl:null,iconRetinaUrl:null,shadowUrl:null,iconSize:[0,0],iconAnchor:[0,0],popupAnchor:[0,0],shadowSize:[0,0],className:"",prefix:"",glyph:"text",glyphColor:"white",lineHeight:1,horizontalAlignment:"center",verticalAlignment:"middle",font:{family:"微软雅黑",size:9,style:"normal",weight:"normal"},haloSize:0,haloColor:"#000000",angle:0,rotated:!1,backgroundColor:void 0,borderLineColor:"#ff0000",borderLineSize:0,lineWidth:192,kerning:!1,calcWidth:1},createIcon(){const t=document.createElement("div"),e=this.options;return e.glyph&&(this._textGlyph=this._createGlyph(),t.appendChild(this._textGlyph)),this._setIconStyles(t,e.className),t},_createGlyph(){let t,e;const i=this.options;i.prefix?t="fab"===i.prefix||"fal"===i.prefix||"far"===i.prefix||"fas"===i.prefix?`fa-${i.glyph}`:i.glyph.slice(0,i.prefix.length+1)===`${i.prefix}-`?i.glyph:`${i.prefix}-${i.glyph}`:(t="",e=i.glyph);const n=r.DomUtil.create("div");n.style.width="100%",n.style.height="100%",n.style.boxSizing="content-box",i.backgroundColor&&(n.style.backgroundColor=i.backgroundColor),i.borderLineColor&&i.borderLineSize&&(n.style.border=`${i.borderLineSize}px solid ${i.borderLineColor}`),i.rotated&&n.style.setProperty("transform",`rotate(${i.angle}deg)`);const o=r.DomUtil.create("span",`${i.prefix} ${t}`),s=0!==i.haloSize?r.DomUtil.create("span",`${i.prefix} ${t}`):void 0;return[s,o].forEach(t=>{if(t){const{size:n,weight:r,style:o,family:s,decoration:a}=i.font;t.style.fontSize=`${n}px`,t.style.fontWeight=r,t.style.fontStyle=o,t.style.fontFamily=s,t.style.color=i.glyphColor,t.style.lineHeight=i.lineHeight,t.style.textAlign=i.horizontalAlignment,t.style.verticalAlign=i.verticalAlignment,t.style.pointerEvents="none",t.style.display="inline-block",t.style.position="absolute",t.style.left="0px",t.style.top="0px",t.style.textDecoration=a,i.kerning&&(t.style.transformOrigin="left",t.style.transform=`scale(${i.iconSize[0]/i.calcWidth},1)`),e&&(t.innerHTML=e)}}),s&&(s.style.setProperty("-webkit-text-stroke",`${i.haloSize}px ${i.haloColor}`),s.style.color="transparent",n.appendChild(s)),n.appendChild(o),n},_setIconStyles(t,e){if("shadow"===e)return r.Icon.prototype._setIconStyles.call(this,t,e);const i=this.options,n=r.point(i.iconSize);let o=r.point(i.iconAnchor);!o&&n&&(o=n.divideBy(2,!0)),t.className=`leaflet-marker-icon leaflet-glyph-icon ${e}`;const s=this._getIconUrl("icon");s&&(t.style.backgroundImage=`url('${s}')`),i.bgPos&&(t.style.backgroundPosition=`${-i.bgPos.x}px ${-i.bgPos.y}px`),i.bgSize&&(t.style.backgroundSize=`${i.bgSize.x}px ${i.bgSize.y}px`),o&&(t.style.marginLeft=`${-o.x}px`,t.style.marginTop=`${-o.y}px`),n&&(t.style.width=`${n.x}px`,t.style.height=`${n.y}px`)}});me.prototype.options.iconUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAUlSURBVFjDrZdLiBxVFIb/e289uqt6kkx6zIiIoKgLRReKuMhCcaOIAUEIiCCE4CIPggZ8kBjooPgM0TiYEUUjqBGchZqAQlyYRTA+kJiJQiJGMjN5zYzT3dP1rrr3HBeTjDGTSfc8Dvyruud89Z9z6kIJdBj31763MivsJXKuZYF6dak5++2mh7NOcsXVHq6sHbhOK/24kOJJMO4AE1vKygwZhxlKSHGKiD+RSu09vOXB43OCrHz96y6T2lsh+OmKXzFdlbLne2UopSAupBhjECcZgjDMgiiSxPhcK/nCr1sfOtcWcm/tq9uEsL4rl0vdK67pKVu2jUwTMk0wBBAzpBCQAnAtiZIlwWQwPlHPglZQAFj1Y23VwVkh92zbd59U+Kanp+p2L12mooKQ5AbcpuclS6LiKoRhxOfHzhXMcs3PtVV7Z0DufXH/LSzpSG9vr1/p6kIz0dDUrvx/IYXAsrJCkWc4e/Z0Zpgf+KX26A/TkNtrXziesY9Xq8tvWNZdVfVYg7hzwKVv3O3ZiKMWj46OTrq5fdOh1x5pSADwjdzo2nbv0u6qqkca2jCIMGcZAuqRhu8vEX7ZK2V2WgMAcXdtvyeKbPS662+osCohzMycHVweniNREoShoZO5KYobpciSh23bFq7rIUgNiLFghRkBlg2v7GlpiccsCHrcryzxUk3zmsNskeYGvt/lxVH4hMWEu9xSWaQFYQ7L1B6iGZ5bBoy+zWKiHiltFHpqeIsVhWaosg1iqlgg4wAAEYEXsV3EmNppJmExMFYUxfVSuIs6E0sI5FkBBhLJzH9laQxLSjBj0WQJgSJPweDTkknvS4JGbCuxKOt7UY4lEQfNnAu9TzLxN2nUdAQTLAEw8YIlAVgAkmDCSBL75eCutSeY+GTUqqNkqUVxUbIl4qgJo4vWzecrhyQAMJldYf1MXLLl1EIsYBZgoGwpRI2zMTPtGBhYbSQAlJF9lieRzNMIriVBzPOWawvoIkYaNC0u9IcAIAHgp75NLQl8ENbPZJ6jgAU48RyFqHEuZyE+Pda/vjENAQBD5s209Y+kPJlyM4+r3lUS0AWSyVEhpHnjYu1pyO+7N4ywwPvhxHDiuwo8j1b5rkQwMZIziYHBXetPzIAAgIV8exZOSMoieI6aU5vKtgR0jqw1JtiYbZfW/R/kSN+mcWbxdtwYjn1XTd9B7cQAfNdCWB/OhBR7jvWv/3tWCAAoO3ktjyZZJ0HHbsq2AooERVQXzPKly2vOgPz29jNNBr+e1IcSz5YAM4hmFzPDtyWS+lDK4N2DfU+dbgsBAFHyd+oszE3agt/GjWcrUBEjj5sQBb96pXpXhAzueDJi4u1p41TsuQpCiFln4bkKeXMoJeadg++tG+sYAgBBXOo3RRrruAnfkWDmGfIdCeQhiiQgQbxjtlqzQk59vCZlNluL5lDiORLyMjcA4DsKeXM4AfDKxa97ThAAqPaMfaR1Nq6jOiqOAhOm5TsKJg1QZGGRedY7V6tzVcjBWk1D0JZ8cigt2RJSimkXnqOgW8MxQLUTb6wN5g0BgGPV0c9BekTH41xx5YXrQ8FkTRgdpxU7ea9djbYQ1GokmJ43wUhWtgRcS04tQjAcw9CWw29tThYOAXD03XVfMps/TTTOy30blDZgiqxFK6p7OsnvCDJ1UD9LyUjORoPDkUQyPfdHbXW+qJCjfRsOwOAoNY4z6Xz01rHq3k5zO4ZMHTabYSIhJD87MLB64f8Ys8WdG/tfBljMJedfwY+s/2P4Pv8AAAAASUVORK5CYII=";var _e=me;function ve(t,e){if(!t)return e;e.stroke=!0,e.color=n.Color.fromColor(t.color).toCssRGBAString(),e.weight=Object(n.defaultValue)(t.width,3),e.lineJoin=Object(n.defaultValue)(t.join,"round"),e.lineCap=Object(n.defaultValue)(t.cap,"round");let i=U.convertLineDash(t.style,"butt"===t.cap);i&&Array.isArray(i)&&(i=i.map(e=>t.width*e)),e.dashArray=i,e.marker=t.marker,e.noClip=!0}function xe(t,e){if(!t)return e;"solid"!==t.style?e.fill=`url(${Object(n.createSimpleFillSymbolCanvas)(t,{lineWidth:1}).toDataURL()})`:e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};ve(t.outline,i);for(const t in i)e[t]=i[t]}var be=class{static convertSymboltoLeafletStyle(t){const e={};if(!t)return e;switch(t.type){case n.SymbolType.simpleMarker:!function(t,e){Object(n.defined)(t.size)&&(e.radius=Object(n.defaultValue)(parseFloat(t.size)/2,10)),e.xoffset=t.xoffset,e.yoffset=t.yoffset,e.rotation=t.angle,e.shape=t.style,e.path=t.path,e.fill=!0,e.fillColor=n.Color.fromColor(t.color).toCssRGBAString();const i={};ve(t.outline,i);for(const t in i)e[t]=i[t]}(t,e);break;case n.SymbolType.pictureMarker:!function(t,e){const i={},o=[10,10];Object(n.defined)(t.width)&&(o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(o[1]=parseFloat(t.height)),i.iconSize=o,Object(n.defined)(t.url)&&(i.iconUrl=t.url);const s=[o[0]/2,o[1]/2];Object(n.defined)(t.xoffset)&&(s[0]=t.xoffset+s[0]),Object(n.defined)(t.yoffset)&&(s[1]=t.yoffset+s[1]),i.iconAnchor=s;const a=r.icon(i);e.icon=a,e.rotationAngle=t.angle}(t,e);break;case n.SymbolType.simpleLine:ve(t,e);break;case n.SymbolType.simpleFill:xe(t,e);break;case n.SymbolType.pictureFill:!function(t,e){if(!t)return e;const{width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a,url:l}=t;e.fill=`url(${l})`,e.fillDetail={width:i,height:n,xscale:r,yscale:o,xoffset:s,yoffset:a};const h={};ve(t.outline,h);for(const t in h)e[t]=h[t]}(t,e);break;case n.SymbolType.text:!function(t,e){const i=U.getTextWidth(t.text,`${t.font.weight} ${t.font.size}px ${t.font.family}`);let r=i<t.lineWidth?i:t.lineWidth,o=Math.ceil(i/r);t.kerning&&(r=t.lineWidth,o=1);const s=t.font.size*t.lineHeight*o;let a=0,l=0;switch(t.horizontalAlignment){case"left":a=0;break;case"right":a=r;break;case"center":a=r/2;break;default:a=0}switch(t.verticalAlignment){case"baseline":l=s/2;break;case"top":l=0;break;case"middle":l=s/2;break;case"bottom":l=s;break;default:l=0}const h=[-t.xoffset+a,t.yoffset+l],u={glyph:t.text,iconUrl:null,iconSize:[r,s],font:t.font,lineHeight:t.lineHeight,iconAnchor:h,horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,glyphColor:n.Color.fromColor(t.color).toCssRGBAString(),haloSize:t.haloSize,haloColor:n.Color.fromColor(t.haloColor).toCssRGBAString(),angle:t.angle,rotated:t.rotated,backgroundColor:t.backgroundColor?n.Color.fromColor(t.backgroundColor).toCssRGBAString():void 0,borderLineColor:t.borderLineColor?n.Color.fromColor(t.borderLineColor).toCssRGBAString():void 0,borderLineSize:t.borderLineSize,lineWidth:t.lineWidth,kerning:t.kerning,calcWidth:i},c=new _e(u);e.icon=c}(t,e);break;default:xe(t,e)}return e}};const{MarkerClusterGroup:we,MarkerWithText:Se}=function(t){const e=t.Marker.extend({options:{textIcon:null},onAdd(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this._initTextIcon(),this.update()},onRemove(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeTextIcon(),this._removeShadow()},setTextIcon(t){return this.options.textIcon=t,this._map&&(this._initTextIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},_initTextIcon(){if(!this.options.textIcon)return;const e=this.options,i=`leaflet-zoom-${this._zoomAnimated?"animated":"hide"}`,n=e.textIcon.createIcon(this._textIcon);let r=!1;n!==this._textIcon&&(this._textIcon&&this._removeTextIcon(),r=!0,e.title&&(n.title=e.title),"IMG"===n.tagName&&(n.alt=e.alt||"")),t.DomUtil.addClass(n,i),e.keyboard&&(n.tabIndex="0",n.setAttribute("role","button")),this._textIcon=n,e.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._textIcon),this._initTextIconInteraction()},_removeTextIcon(){this._textIcon&&(t.DomUtil.remove(this._textIcon),this.removeInteractiveTarget(this._textIcon),this._textIcon=null)},_setPos(e){this._icon&&t.DomUtil.setPosition(this._icon,e),this._textIcon&&t.DomUtil.setPosition(this._textIcon,e),this._shadow&&t.DomUtil.setPosition(this._shadow,e),this._zIndex=e.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t),this._textIcon&&(this._textIcon.style.zIndex=this._zIndex+t)},_initTextIconInteraction(){if(this.options.interactive&&this._textIcon&&(t.DomUtil.addClass(this._textIcon,"leaflet-interactive"),this.addInteractiveTarget(this._textIcon),t.MarkerDrag)){let e=this.options.draggable;this.dragging&&(e=this.dragging.enabled(),this.dragging.disable()),this.dragging=new t.MarkerDrag(this),e&&this.dragging.enable()}},_updateOpacity(){const e=this.options.opacity;this._icon&&t.DomUtil.setOpacity(this._icon,e),this._textIcon&&t.DomUtil.setOpacity(this._textIcon,e),this._shadow&&t.DomUtil.setOpacity(this._shadow,e)}});function i(t,e,i,o,s){!function t(e,i,r,o,s){for(;o>r;){if(o-r>600){const n=o-r+1,a=i-r+1,l=Math.log(n),h=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*h*(n-h)/n)*(a-n/2<0?-1:1),c=Math.max(r,Math.floor(i-a*h/n+u)),p=Math.min(o,Math.floor(i+(n-a)*h/n+u));t(e,i,c,p,s)}const a=e[i];let l=r,h=o;for(n(e,r,i),s(e[o],a)>0&&n(e,r,o);l<h;){for(n(e,l,h),l++,h--;s(e[l],a)<0;)l++;for(;s(e[h],a)>0;)h--}0===s(e[r],a)?n(e,r,h):n(e,++h,o),h<=i&&(r=h+1),i<=h&&(o=h-1)}}(t,e,i||0,o||t.length-1,s||r)}function n(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function r(t,e){return t<e?-1:t>e?1:0}function o(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function s(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function a(t,e){l(t,0,t.children.length,e,t)}function l(t,e,i,n,r){r||(r=_(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;o<i;o++){const e=t.children[o];h(r,t.leaf?n(e):e)}return r}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function u(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function p(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function g(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,o-n)}function y(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,n,r,o){const s=[e,n];for(;s.length;){if((n=s.pop())-(e=s.pop())<=r)continue;const a=e+Math.ceil((n-e)/r/2)*r;i(t,a,e,n,o),s.push(e,a,a,n)}}t.MarkerWithText=e,o.prototype.all=function(){return this._all(this.data,[])},o.prototype.search=function(t){let e=this.data;const i=[];if(!m(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?n(s):s;m(t,a)&&(e.leaf?i.push(s):y(t,a)?this._all(s,i):r.push(s))}e=r.pop()}return i},o.prototype.collides=function(t){let e=this.data;if(!m(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],o=e.leaf?this.toBBox(r):r;if(m(t,o)){if(e.leaf||y(t,o))return!0;i.push(r)}}e=i.pop()}return!1},o.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this},o.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},o.prototype.clear=function(){return this.data=_([]),this},o.prototype.remove=function(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],o=[];let a,l,h;for(;i||r.length;){if(i||(i=r.pop(),l=r[r.length-1],a=o.pop(),h=!0),i.leaf){const n=s(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}h||i.leaf||!y(i,n)?l?(a++,i=l.children[a],h=!1):i=null:(r.push(i),o.push(a),a=0,l=i,i=i.children[0])}return this},o.prototype.toBBox=function(t){return t},o.prototype.compareMinX=function(t,e){return t.minX-e.minX},o.prototype.compareMinY=function(t,e){return t.minY-e.minY},o.prototype.toJSON=function(){return this.data},o.prototype.fromJSON=function(t){return this.data=t,this},o.prototype._all=function(t,e){const i=[];for(;t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},o.prototype._build=function(t,e,i,n){const r=i-e+1;let o,s=this._maxEntries;if(r<=s)return a(o=_(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,n-1))),(o=_([])).leaf=!1,o.height=n;const l=Math.ceil(r/s),h=l*Math.ceil(Math.sqrt(s));v(t,e,i,h,this.compareMinX);for(let r=e;r<=i;r+=h){const e=Math.min(r+h-1,i);v(t,r,e,l,this.compareMinY);for(let i=r;i<=e;i+=l){const r=Math.min(i+l-1,e);o.children.push(this._build(t,i,r,n-1))}}return a(o,this.toBBox),o},o.prototype._chooseSubtree=function(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i=1/0,n=1/0,r=void 0;for(let o=0;o<e.children.length;o++){const s=e.children[o],a=p(s),l=d(t,s)-a;l<n?(n=l,i=a<i?a:i,r=s):l===n&&a<i&&(i=a,r=s)}e=r||e.children[0]}return e},o.prototype._insert=function(t,e,i){const n=i?t:this.toBBox(t),r=[],o=this._chooseSubtree(n,this.data,e,r);for(o.children.push(t),h(o,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)},o.prototype._split=function(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const o=this._chooseSplitIndex(i,r,n),s=_(i.children.splice(o,i.children.length-o));s.height=i.height,s.leaf=i.leaf,a(i,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(i,s)},o.prototype._splitRoot=function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},o.prototype._chooseSplitIndex=function(t,e,i){let n,r=1/0,o=1/0;for(let s=e;s<=i-e;s++){const e=l(t,0,s,this.toBBox),a=l(t,s,i,this.toBBox),h=g(e,a),u=p(e)+p(a);h<r?(r=h,n=s,o=u<o?u:o):h===r&&u<o&&(o=u,n=s)}return n||i-e},o.prototype._chooseSplitAxis=function(t,e,i){const n=t.leaf?this.compareMinX:u,r=t.leaf?this.compareMinY:c;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)},o.prototype._allDistMargin=function(t,e,i,n){t.children.sort(n);const r=this.toBBox,o=l(t,0,e,r),s=l(t,i-e,i,r);let a=f(o)+f(s);for(let n=e;n<i-e;n++){const e=t.children[n];h(o,t.leaf?r(e):e),a+=f(o)}for(let n=i-e-1;n>=e;n--){const e=t.children[n];h(s,t.leaf?r(e):e),a+=f(s)}return a},o.prototype._adjustParentBBoxes=function(t,e,i){for(let n=i;n>=0;n--)h(e[n],t)},o.prototype._condense=function(t){for(let e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)};const x=t.MarkerClusterGroup=t.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:t.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{},maxClusterNum:0,deconflictionStrategy:"none"},initialize(e){t.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=t.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=t.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd},this._rbush=new o;const i=t.DomUtil.TRANSITION&&this.options.animate;t.extend(this,i?this._withAnimation:this._noAnimation),this._markerCluster=i?t.MarkerCluster:t.MarkerClusterNonAnimated},addLayer(e){if(e instanceof t.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();let i=e;const n=this._zoom;if(e.__parent)for(;i.__parent._zoom>=n;)i=i.__parent;return this._currentShownBounds.contains(i.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,i):this._animationAddLayerNonAnimated(e,i)),this},removeLayer(e){return e instanceof t.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers(e,i){if(!t.Util.isArray(e))return this.addLayer(e);const n=this._featureGroup,r=this._nonPointGroup,o=this.options.chunkedLoading,s=this.options.chunkInterval,a=this.options.chunkProgress;let l,h=e.length,u=0,c=!0;if(this._map){const f=(new Date).getTime();var p=t.bind(function(){const d=(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();u<h&&!(o&&u%200==0&&(new Date).getTime()-d>s);u++)if((l=e[u])instanceof t.LayerGroup)c&&(e=e.slice(),c=!1),this._extractNonGroupLayers(l,e),h=e.length;else if(l.getLatLng){if(!this.hasLayer(l)&&(this._addLayer(l,this._maxZoom),i||this.fire("layeradd",{layer:l}),l.__parent&&2===l.__parent.getChildCount())){const t=l.__parent.getAllChildMarkers(),e=t[0]===l?t[1]:t[0];n.removeLayer(e)}}else r.addLayer(l),i||this.fire("layeradd",{layer:l});a&&a(u,h,(new Date).getTime()-f),u===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds,this._rbush,this.options.deconflictionStrategy)):setTimeout(p,this.options.chunkDelay)},this);p()}else{const i=this._needsClustering;for(;u<h;u++)(l=e[u])instanceof t.LayerGroup?(c&&(e=e.slice(),c=!1),this._extractNonGroupLayers(l,e),h=e.length):l.getLatLng?this.hasLayer(l)||i.push(l):r.addLayer(l)}return this},removeLayers(e){let i,n,r=e.length;const o=this._featureGroup,s=this._nonPointGroup;let a=!0;if(!this._map){for(i=0;i<r;i++)(n=e[i])instanceof t.LayerGroup?(a&&(e=e.slice(),a=!1),this._extractNonGroupLayers(n,e),r=e.length):(this._arraySplice(this._needsClustering,n),s.removeLayer(n),this.hasLayer(n)&&this._needsRemoving.push({layer:n,latlng:n._latlng}),this.fire("layerremove",{layer:n}));return this}if(this._unspiderfy){this._unspiderfy();const o=e.slice();let s=r;for(i=0;i<s;i++)(n=o[i])instanceof t.LayerGroup?(this._extractNonGroupLayers(n,o),s=o.length):this._unspiderfyLayer(n)}for(i=0;i<r;i++)(n=e[i])instanceof t.LayerGroup?(a&&(e=e.slice(),a=!1),this._extractNonGroupLayers(n,e),r=e.length):n.__parent?(this._removeLayer(n,!0,!0),this.fire("layerremove",{layer:n}),o.hasLayer(n)&&(o.removeLayer(n),n.clusterShow&&n.clusterShow())):(s.removeLayer(n),this.fire("layerremove",{layer:n}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){t.off(this._childMarkerEventHandlers,this),delete t.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds(){const e=new t.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(let t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer(t,e){const i=this._needsClustering.slice(),n=this._needsRemoving;let r,o,s;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(i),o=i.length-1;o>=0;o--){for(r=!0,s=n.length-1;s>=0;s--)if(n[s].layer===i[o]){r=!1;break}r&&t.call(e,i[o])}this._nonPointGroup.eachLayer(t,e)},getLayers(){const t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer(e){let i=null;return e=parseInt(e,10),this.eachLayer(function(n){t.stamp(n)===e&&(i=n)}),i},hasLayer(t){if(!t)return!1;let e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(e=(i=this._needsRemoving).length-1;e>=0;e--)if(i[e].layer===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer(t,e){const i=this._map;"function"!=typeof e&&(e=function(){});var n=function(){!i.hasLayer(t)&&!i.hasLayer(t.__parent)||this._inZoomAnimation||(this._map.off("moveend",n,this),this.off("animationend",n,this),i.hasLayer(t)?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};t._icon&&this._map.getBounds().contains(t.getLatLng())?e():t.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",n,this),this._map.panTo(t.getLatLng())):(this._map.on("moveend",n,this),this.on("animationend",n,this),t.__parent.zoomToBounds())},onAdd(t){let e,i,n;for(this._map=t,this._featureGroup.addTo(t),this._nonPointGroup.addTo(t),this._gridClusters||this._generateInitialClusters(),this._maxLat=t.options.crs.projection.MAX_LATITUDE,e=0,i=this._needsRemoving.length;e<i;e++)(n=this._needsRemoving[e]).newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(e=0,i=this._needsRemoving.length;e<i;e++)n=this._needsRemoving[e],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0),this._zoomEnd()},onRemove(t){t.off("zoomend",this._zoomEnd,this),t.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent(t){let e=t;for(;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice(t,e){for(let i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered(t,e){const i=this._map,n=this._gridUnclustered,r=Math.floor(this.getMinZoom());for(;e>=r&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_childMarkerDragStart(t){t.target.__dragStart=t.target._latlng},_childMarkerMoved(t){if(!this._ignoreMove&&!t.target.__dragStart){const e=t.target._popup&&t.target._popup.isOpen();this._moveChild(t.target,t.oldLatLng,t.latlng),e&&t.target.openPopup()}},_moveChild(t,e,i){t._latlng=e,this.removeLayer(t),t._latlng=i,this.addLayer(t)},_childMarkerDragEnd(t){const e=t.target.__dragStart;delete t.target.__dragStart,e&&this._moveChild(t.target,e,t.target._latlng)},_removeLayer(t,e,i){const n=this._gridClusters,r=this._gridUnclustered,o=this._featureGroup,s=this._map,a=Math.floor(this.getMinZoom());e&&this._removeFromGridUnclustered(t,this._maxZoom);let l=t.__parent;const h=l._markers;let u;for(this._arraySplice(h,t);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)e&&l._childCount<=1?(u=l._markers[0]===t?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,s.project(l._cLatLng,l._zoom)),r[l._zoom].addObject(u,s.project(u.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(u),u.__parent=l.__parent,l._icon&&(o.removeLayer(l),i||o.addLayer(u))):l._iconNeedsUpdate=!0,l=l.__parent;delete t.__parent},_isOrIsParent(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},fire(e,i,n){if(i&&i.layer instanceof t.MarkerCluster){if(i.originalEvent&&this._isOrIsParent(i.layer._icon,i.originalEvent.relatedTarget))return;e=`cluster${e}`}t.FeatureGroup.prototype.fire.call(this,e,i,n)},listens(e,i){return t.FeatureGroup.prototype.listens.call(this,e,i)||t.FeatureGroup.prototype.listens.call(this,`cluster${e}`,i)},_defaultIconCreateFunction(e){const i=e.getChildCount();let n=" marker-cluster-";return n+=i<10?"small":i<100?"medium":"large",new t.DivIcon({html:`<div><span>${i} <span aria-label="markers"></span>`+"</span></div>",className:`marker-cluster${n}`,iconSize:new t.Point(40,40)})},_bindEvents(){const t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom;(e||n||r)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy(t){const e=t.layer;let i=e;if(!("clusterkeypress"===t.type&&t.originalEvent&&13!==t.originalEvent.keyCode||t.originalEvent.defaultPrevented)){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount&&this.options.spiderfyOnMaxZoom?e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),this.options.spiderfyOnEveryZoom&&e.spiderfy(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage(e){const i=this._map;this._inZoomAnimation||(this._shownPolygon&&i.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new t.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),i.addLayer(this._shownPolygon)))},_hideCoverage(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents(){const t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom,r=this._map;(t||i||n)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),e&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),r.off("zoomend",this._hideCoverage,this))},_zoomEnd(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd(){if(this._inZoomAnimation)return;const t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),t),this._currentShownBounds=t},_generateInitialClusters(){let e=Math.ceil(this._map.getMaxZoom());const i=Math.floor(this.getMinZoom()),n=this.options.maxClusterRadius;let r=n;if("function"!=typeof n&&(r=function(){return n}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={},!isFinite(e))throw"Map has no maxZoom specified";if(!isFinite(i))throw"Map has no minZoom specified";for(let n=e;n>=i;n--)this._gridClusters[n]=new t.DistanceGrid(r(n)),this._gridUnclustered[n]=new t.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,i-1)},_addLayer(t,e){const i=this._gridClusters,n=this._gridUnclustered,r=Math.floor(this.getMinZoom());let o,s;this.options.singleMarkerMode&&this._overrideMarkerIcon(t),t.on(this._childMarkerEventHandlers,this);const a=this.options.maxClusterNum;for(;e>=r;e--){o=this._map.project(t.getLatLng(),e);const r=i[e].getNearObjectArr(o);if(r&&Array.isArray(r)&&r.length>0)for(let e=0;e<r.length;e++){const i=r[e].obj,n=i.getChildCount(),o=i.getAllChildMarkers();if(n>=a-1||o&&Array.isArray(o)&&o.length>0&&o[0].options&&t.options&&t.options.groupName===o[0].options.groupName)return i._addChild(t),void(t.__parent=i)}const u=n[e].getNearObjectArr(o);if(u&&Array.isArray(u)){let n=[],r=[];var l;const o=u.length;if(u.length>0)if(o>=a-1)u.forEach(t=>{n.push(t.obj),r.push(t.obj)}),r.push(t),l=r[0].__parent;else{for(let e=0;e<u.length;e++){const{obj:i,dist:o}=u[e];if(i.options&&t.options&&t.options.groupName===i.options.groupName){r=[i,t],n=[i];break}}r.length>0&&(l=r[0].__parent)}if(r.length>0&&l){n.forEach(t=>{t.__parent&&this._removeLayer(t,!1)});var h=new this._markerCluster(this,e);r.forEach(t=>{h._addChild(t),t.__parent=h}),i[e].addObject(h,this._map.project(h._cLatLng,e));let t=h;for(s=e-1;s>l._zoom;s--)t=new this._markerCluster(this,s,t),i[s].addObject(t,this._map.project(h._cLatLng,s));return l._addChild(t),void n.forEach(t=>{this._removeFromGridUnclustered(t,e)})}}n[e].addObject(t,o)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_refreshClustersIcons(){this._featureGroup.eachLayer(function(e){e instanceof t.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(t.bind(this._processQueue,this),300))},_processQueue(){for(let t=0;t<this._queue.length;t++)this._queue[t].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters(){const t=Math.round(this._map._zoom);this._processQueue(),this._zoom<t&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,t)):this._zoom>t?(this._animationStart(),this._animationZoomOut(this._zoom,t)):this._moveEnd()},_getExpandedVisibleBounds(){return this.options.removeOutsideVisibleBounds?t.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat(t){const e=this._maxLat;return void 0!==e&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();const t=e.getAllChildMarkers();this._featureGroup.removeLayer(t[0]),this._featureGroup.removeLayer(t[1])}else e._updateIcon()},_extractNonGroupLayers(e,i){const n=e.getLayers();let r,o=0;for(i=i||[];o<n.length;o++)(r=n[o])instanceof t.LayerGroup?this._extractNonGroupLayers(r,i):i.push(r);return i},_overrideMarkerIcon(t){return t.getChildCount=function(){return 1},t.getAllChildMarkers=function(){return[t]},t.options.icon=this.options.iconCreateFunction(t)},_animationCreateMarkerIcon(t){!t||t.isRefreshIcon||this.options.singleMarkerMode||(this._overrideMarkerIcon(t),t.isRefreshIcon=!0)}});t.MarkerClusterGroup.include({_mapBoundsInfinite:new t.LatLngBounds(new t.LatLng(-1/0,-1/0),new t.LatLng(1/0,1/0))}),t.MarkerClusterGroup.include({_noAnimation:{_animationStart(){},_animationZoomIn(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn(e,i){const n=this._getExpandedVisibleBounds(),r=this._featureGroup,o=Math.floor(this.getMinZoom());let s;this._ignoreMove=!0,this._rbush.clear();const a=this;this._topClusterLevel._recursively(n,e,o,function(t){let o=t._latlng;const a=t._markers.map(t=>t);let l;for(n.contains(o)||(o=null),t._isSingleParent()&&e+1===i?(r.removeLayer(t),t._recursivelyAddChildrenToMap(null,i,n)):(t.clusterHide(),t._recursivelyAddChildrenToMap(o,i,n)),s=a.length-1;s>=0;s--)l=a[s],n.contains(l._latlng)||r.removeLayer(l)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,i),r.eachLayer(function(e){e instanceof t.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(n,e,i,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildPositions(i,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._topClusterLevel._recursively(n,Math.floor(this.getMinZoom())-1,i,function(t){a._ignoreMove=!0,t._recursivelyRestoreChildMarkerPositions(i,n,a._rbush,a.options.deconflictionStrategy),a._ignoreMove=!1}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,o,function(t){r.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut(t,e){this._rbush.clear(),this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._ignoreMove=!0,this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds(),this._rbush,this.options.deconflictionStrategy),this._ignoreMove=!1,this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this.getMinZoom()),t,this._getExpandedVisibleBounds())},_animationAddLayer(t,e){const i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle(t,e,i){const n=this._getExpandedVisibleBounds(),r=Math.floor(this.getMinZoom());t._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,e+1,i);const o=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){const e=t._markers[0];this._ignoreMove=!0,e.setLatLng(e.getLatLng()),this._ignoreMove=!1,e.clusterShow&&e.clusterShow()}else t._recursively(n,i,r,function(t){t._recursivelyRemoveChildrenFromMap(n,r,e+1)});o._animationEnd()})},_animationEnd(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout(){t.Util.falseFn(document.body.offsetWidth)},getMinZoom:()=>0}),t.markerClusterGroup=function(e){return new t.MarkerClusterGroup(e)};var b=t.MarkerCluster=t.MarkerWithText.extend({options:t.Icon.prototype.options,initialize(e,i,n,r){t.Marker.prototype.initialize.call(this,n?n._cLatLng||n.getLatLng():new t.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=i,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new t.LatLngBounds,n&&this._addChild(n),r&&this._addChild(r)},getAllChildMarkers(t,e){t=t||[];for(let i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(t,e);for(let i=this._markers.length-1;i>=0;i--)e&&this._markers[i].__dragStart||t.push(this._markers[i]);return t},getChildCount(){return this._childCount},zoomToBounds(t){let e=this._childClusters.slice();const i=this._group._map,n=i.getBoundsZoom(this._bounds);let r=this._zoom+1;const o=i.getZoom();let s;for(;e.length>0&&n>r;){r++;let t=[];for(s=0;s<e.length;s++)t=t.concat(e[s]._childClusters);e=t}n>r?this._group._map.setView(this._latlng,r):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,t)},getBounds(){const e=new t.LatLngBounds;return e.extend(this._bounds),e},_updateIcon(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow(){return this._iconObj.createShadow()},_addChild(e,i){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof t.MarkerCluster?(i||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(i||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds(){const t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds(){const e=this._markers,i=this._childClusters;let n=0,r=0;const o=this._childCount;let s,a,l,h;if(0!==o){for(this._resetBounds(),s=0;s<e.length;s++)l=e[s]._latlng,this._bounds.extend(l),n+=l.lat,r+=l.lng;for(s=0;s<i.length;s++)(a=i[s])._boundsNeedUpdate&&a._recalculateBounds(),this._bounds.extend(a._bounds),l=a._wLatLng,h=a._childCount,n+=l.lat*h,r+=l.lng*h;this._latlng=this._wLatLng=new t.LatLng(n/o,r/o),this._boundsNeedUpdate=!1}},_addToMap(t){t&&(this._backupLatlng=this._latlng,this.setLatLng(t)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn(t,e,i){this._recursively(t,this._group.getMinZoom(),i-1,function(t){const i=t._markers;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())},function(t){const i=t._childClusters;let n,r;for(n=i.length-1;n>=0;n--)(r=i[n])._icon&&(r._setPos(e),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap(t,e,i,n){this._recursively(t,n,e,function(r){r._recursivelyAnimateChildrenIn(t,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(t,e,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible(t,e){this._recursively(t,this._group.getMinZoom(),e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap(t,e,i,n,r){const o=this;this._recursively(i,this._group.getMinZoom()-1,e,function(s){if(e===s._zoom)return;const a=s._markers.map(t=>t);for(let l=a.length-1;l>=0;l--){const h=a[l];i.contains(h._latlng)&&(t&&(h._backupLatlng=h.getLatLng(),h.setLatLng(t),h.clusterHide&&h.clusterHide()),s._group._animationCreateMarkerIcon(h),s._group._featureGroup.addLayer(h),"static"===r&&o._adjustClusterOrMarkerStatus(h,n,e))}},function(i){i._addToMap(t),"static"===r&&o._adjustClusterOrMarkerStatus(i,n,e)})},_getAdjustPoint(e,i,n){const r=2*n,o=t.point(i.x-e.x,i.y-e.y),s=Math.sqrt(Math.pow(o.x,2)+Math.pow(o.y,2));return e.add(o._divideBy(s)._multiplyBy(r))},_calcAdjustPoint(e,i,n,r){const o=r*Math.SQRT2;let s,a,l=n,h=r;a=e.search(l);do{let e,n,u,c;a.forEach(t=>{e=Math.min(void 0===e?t.minX:e,t.minX),n=Math.min(void 0===n?t.minY:n,t.minY),u=Math.max(void 0===u?t.maxX:u,t.maxX),c=Math.max(void 0===c?t.maxY:c,t.maxY)});const p=t.point((u+e)/2,(n+c)/2);if(s=this._getAdjustPoint(p,i,h),h>o)return null;h+=1,l={minX:s.x-r,minY:s.y-r,maxX:s.x+r,maxY:s.y+r,point:s}}while(e.collides(l));return s},_adjustClusterOrMarkerStatus(t,e,i){if(t&&e&&e){let n,r;i=i||this._zoom,t instanceof b?(n=t._group._map,r=t._iconObj):(n=t._map,r=t.options.icon);const o=n.latLngToLayerPoint(t.getLatLng(),i);if(!r)return;if(isNaN(o.x)||isNaN(o.y))return;const s=r.options.iconSize,a=Math.max(s.x,s.y)/2;let l={minX:o.x-a,minY:o.y-a,maxX:o.x+a,maxY:o.y+a,point:o,obj:t};if(e.collides(l)){const r=this._calcAdjustPoint(e,o,l,a);if(!r||isNaN(r.x)||isNaN(r.y))return void t.setOpacity(0);const s=n.layerPointToLatLng(r,i);t.setLatLng(s),l={minX:r.x-a,minY:r.y-a,maxX:r.x+a,maxY:r.y+a,point:r,obj:t}}e.insert(l)}},_recursivelyRestoreChildMarkerPositions(t,e,i,n){for(let r=this._markers.length-1;r>=0;r--){const o=this._markers[r];o._backupLatlng&&(o.setLatLng(o._backupLatlng),delete o._backupLatlng),o&&o._map&&e&&e.contains(o._latlng)&&"static"===n&&this._adjustClusterOrMarkerStatus(o,i,t)}},_recursivelyRestoreChildPositions(t,e,i){const n=this._childClusters.slice().sort((t,e)=>t._childCount-e._childCount);if(t-1===this._zoom)for(let r=n.length-1;r>=0;r--)n[r]._restorePosition(),"static"===i&&this._adjustClusterOrMarkerStatus(n[r],e,t);else for(let e=this._childClusters.length-1;e>=0;e--)this._childClusters[e]._recursivelyRestoreChildPositions(t)},_restorePosition(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap(t,e,i,n){let r,o;this._recursively(t,e-1,i-1,function(t){const e=t._markers.map(t=>t);for(o=e.length-1;o>=0;o--)r=e[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(t){for(o=t._childClusters.length-1;o>=0;o--)r=t._childClusters[o],n&&n.contains(r._latlng)||(t._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively(t,e,i,n,r){const o=this._childClusters,s=this._zoom;let a,l;if(e<=s&&(r&&s===i&&r(this),n&&n(this)),o.sort((t,e)=>t._childCount-e._childCount),s<e||s<i)for(a=o.length-1;a>=0;a--)(l=o[a])._boundsNeedUpdate&&l._recalculateBounds(),t.intersects(l._bounds)&&l._recursively(t,e,i,n,r)},_isSingleParent(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});return t.Marker.include({clusterHide(){const t=this.options.opacity;return this.setOpacity(0),this.options.opacity=t,this},clusterShow(){return this.setOpacity(this.options.opacity)}}),t.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},t.DistanceGrid.prototype={addObject(e,i){const n=this._getCoord(i.x),r=this._getCoord(i.y),o=this._grid,s=o[r]=o[r]||{},a=s[n]=s[n]||[],l=t.Util.stamp(e);this._objectPoint[l]=i,a.push(e)},updateObject(t,e){this.removeObject(t,e),this.addObject(t,e)},removeObject(e,i){const n=this._getCoord(i.x),r=this._getCoord(i.y),o=this._grid,s=o[r]=o[r]||{},a=s[n]=s[n]||[];let l,h;for(delete this._objectPoint[t.Util.stamp(e)],l=0,h=a.length;l<h;l++)if(a[l]===e)return a.splice(l,1),1===h&&delete s[n],!0},eachObject(t,e){let i,n,r,o,s,a,l;const h=this._grid;for(i in h)for(n in s=h[i])for(r=0,o=(a=s[n]).length;r<o;r++)(l=t.call(e,a[r]))&&(r--,o--)},getNearObject(e){const i=this._getCoord(e.x),n=this._getCoord(e.y);let r,o,s,a,l,h,u,c;const p=this._objectPoint;let f=this._sqCellSize,d=null;for(r=n-1;r<=n+1;r++)if(a=this._grid[r])for(o=i-1;o<=i+1;o++)if(l=a[o])for(s=0,h=l.length;s<h;s++)u=l[s],((c=this._sqDist(p[t.Util.stamp(u)],e))<f||c<=f&&null===d)&&(f=c,d=u);return d},getNearObjectArr(e,i){const n=this._getCoord(e.x),r=this._getCoord(e.y);let o,s,a,l,h,u,c,p;const f=this._objectPoint;let d=i||this._sqCellSize;const g=[];for(o=r-1;o<=r+1;o++)if(l=this._grid[o])for(s=n-1;s<=n+1;s++)if(h=l[s])for(a=0,u=h.length;a<u;a++)c=h[a],(p=this._sqDist(f[t.Util.stamp(c)],e))<=d&&(d=p,g.push({obj:c,dist:p,point:f[t.Util.stamp(c)]}));return g.sort((t,e)=>t.dist-e.dist),g},_getCoord(t){const e=Math.floor(t/this._cellSize);return isFinite(e)?e:t},_sqDist(t,e){const i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},t.QuickHull={getDistant(t,e){const i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine(t,e){let i=0,n=null;const r=[];let o,s,a;for(o=e.length-1;o>=0;o--)s=e[o],(a=this.getDistant(s,t))>0&&(r.push(s),a>i&&(i=a,n=s));return{maxPoint:n,newPoints:r}},buildConvexHull(t,e){let i=[];const n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?i=(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints))).concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints)):[t[0]]},getConvexHull(t){let e,i=!1,n=!1,r=!1,o=!1,s=null,a=null,l=null,h=null,u=null,c=null;for(e=t.length-1;e>=0;e--){const u=t[e];(!1===i||u.lat>i)&&(s=u,i=u.lat),(!1===n||u.lat<n)&&(a=u,n=u.lat),(!1===r||u.lng>r)&&(l=u,r=u.lng),(!1===o||u.lng<o)&&(h=u,o=u.lng)}return n!==i?(c=a,u=s):(c=h,u=l),[].concat(this.buildConvexHull([c,u],t),this.buildConvexHull([u,c],t))}},t.MarkerCluster.include({getConvexHull(){const e=this.getAllChildMarkers(),i=[];let n,r;for(r=e.length-1;r>=0;r--)n=e[r].getLatLng(),i.push(n);return t.QuickHull.getConvexHull(i)}}),t.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy(){if(this._group._spiderfied===this||this._group._inZoomAnimation)return;const t=this.getAllChildMarkers(null,!0),e=this._group._map.latLngToLayerPoint(this._latlng);let i;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?i=this._group.options.spiderfyShapePositions(t.length,e):t.length>=this._circleSpiralSwitchover?i=this._generatePointsSpiral(t.length,e):(e.y+=10,i=this._generatePointsCircle(t.length,e)),this._animationSpiderfy(t,i)},unspiderfy(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle(e,i){let n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI;const r=this._2PI/e,o=[];let s,a;for(n=Math.max(n,35),o.length=e,s=0;s<e;s++)a=this._circleStartAngle+s*r,o[s]=new t.Point(i.x+n*Math.cos(a),i.y+n*Math.sin(a))._round();return o},_generatePointsSpiral(e,i){const n=this._group.options.spiderfyDistanceMultiplier;let r=n*this._spiralLengthStart;const o=n*this._spiralFootSeparation,s=n*this._spiralLengthFactor*this._2PI;let a=0;const l=[];let h;for(l.length=e,h=e;h>=0;h--)h<e&&(l[h]=new t.Point(i.x+r*Math.cos(a),i.y+r*Math.sin(a))._round()),r+=s/(a+=o/r+5e-4*h);return l},_noanimationUnspiderfy(){const t=this._group,e=t._map,i=t._featureGroup,n=this.getAllChildMarkers(null,!0);let r,o;for(t._ignoreMove=!0,this.setOpacity(1),o=n.length-1;o>=0;o--)r=n[o],i.removeLayer(r),r._preSpiderfyLatlng&&(r.setLatLng(r._preSpiderfyLatlng),delete r._preSpiderfyLatlng),r.setZIndexOffset&&r.setZIndexOffset(0),r._spiderLeg&&(e.removeLayer(r._spiderLeg),delete r._spiderLeg);t.fire("unspiderfied",{cluster:this,markers:n}),t._ignoreMove=!1,t._spiderfied=null}}),t.MarkerClusterNonAnimated=t.MarkerCluster.extend({_animationSpiderfy(e,i){const n=this._group,r=n._map,o=n._featureGroup,s=this._group.options.spiderLegPolylineOptions;let a,l,h,u;for(n._ignoreMove=!0,a=0;a<e.length;a++)u=r.layerPointToLatLng(i[a]),l=e[a],h=new t.Polyline([this._latlng,u],s),r.addLayer(h),l._spiderLeg=h,l._preSpiderfyLatlng=l._latlng,l.setLatLng(u),l.setZIndexOffset&&l.setZIndexOffset(1e6),o.addLayer(l);this.setOpacity(.3),n._ignoreMove=!1,n.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy(){this._noanimationUnspiderfy()}}),t.MarkerCluster.include({_animationSpiderfy(e,i){const n=this,r=this._group,o=r._map,s=r._featureGroup,a=this._latlng,l=o.latLngToLayerPoint(a),h=t.Path.SVG,u=t.extend({},this._group.options.spiderLegPolylineOptions);let c,p,f,d,g,y,m=u.opacity;for(void 0===m&&(m=t.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),h?(u.opacity=0,u.className=`${u.className||""} leaflet-cluster-spider-leg`):u.opacity=m,r._ignoreMove=!0,c=0;c<e.length;c++)p=e[c],r._animationCreateMarkerIcon(p),y=o.layerPointToLatLng(i[c]),f=new t.Polyline([a,y],u),o.addLayer(f),p._spiderLeg=f,h&&(g=(d=f._path).getTotalLength()+.1,d.style.strokeDasharray=g,d.style.strokeDashoffset=g),p.setZIndexOffset&&p.setZIndexOffset(1e6),p.clusterHide&&p.clusterHide(),s.addLayer(p),p._setPos&&p._setPos(l);for(r._forceLayout(),r._animationStart(),c=e.length-1;c>=0;c--)y=o.layerPointToLatLng(i[c]),(p=e[c])._preSpiderfyLatlng=p._latlng,p.setLatLng(y),p.clusterShow&&p.clusterShow(),h&&((d=(f=p._spiderLeg)._path).style.strokeDashoffset=0,f.setStyle({opacity:m}));this.setOpacity(.3),r._ignoreMove=!1,setTimeout(function(){r._animationEnd(),r.fire("spiderfied",{cluster:n,markers:e})},200)},_animationUnspiderfy(e){const i=this,n=this._group,r=n._map,o=n._featureGroup,s=e?r._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):r.latLngToLayerPoint(this._latlng),a=this.getAllChildMarkers(null,!0),l=t.Path.SVG;let h,u,c,p,f,d;for(n._ignoreMove=!0,n._animationStart(),this.setOpacity(1),u=a.length-1;u>=0;u--)(h=a[u])._preSpiderfyLatlng&&(h.closePopup(),h.setLatLng(h._preSpiderfyLatlng),delete h._preSpiderfyLatlng,d=!0,h._setPos&&(h._setPos(s),d=!1),h.clusterHide&&(h.clusterHide(),d=!1),d&&o.removeLayer(h),l&&(f=(p=(c=h._spiderLeg)._path).getTotalLength()+.1,p.style.strokeDashoffset=f,c.setStyle({opacity:0})));n._ignoreMove=!1,setTimeout(function(){let t=0;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&t++;for(u=a.length-1;u>=0;u--)(h=a[u])._spiderLeg&&(h.clusterShow&&h.clusterShow(),h.setZIndexOffset&&h.setZIndexOffset(0),t>1&&o.removeLayer(h),r.removeLayer(h._spiderLeg),delete h._spiderLeg);n._animationEnd(),n.fire("unspiderfied",{cluster:i,markers:a})},200)}}),t.MarkerClusterGroup.include({_spiderfied:null,unspiderfy(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),t.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim(e){t.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper(){this._unspiderfy()},_unspiderfy(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),t.MarkerClusterGroup.include({refreshClusters(e){return e?e instanceof t.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof t.LayerGroup?e=e._layers:e instanceof t.MarkerCluster?e=e.getAllChildMarkers():e instanceof t.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate(t){let e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers(t){let e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),t.Marker.include({refreshIconOptions(e,i){const n=this.options.icon;return t.setOptions(n,e),this.setIcon(n),i&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),{MarkerWithText:e,MarkerClusterGroup:x,MarkerCluster:b}}(r);function Ee(t,e,i,n){return t.evaluate({$feature:e,$cluster_count:i,$is_same_group:n})}function Le(t,e){for(let i=0;i<t.length;i++){const n=t[i];if(void 0!==n.value){if(n.value===e)return n}else if("undefined"!==n.minValue&&void 0!==n.maxValue&&(e=parseFloat(e),n.minValue<=e&&n.maxValue>e&&!isNaN(e)))return n}return null}function Ce(t,e,i,n,r,o){const s=Le(o,Ee(e,i,n,r));if(s){const e=t.findIndex(t=>t.object===s);if(e>-1)return t[e].groupName;{const e={groupName:String(t.length),object:s};return t.push(e),e.groupName}}return t[0].groupName}class Pe{static createClusterLayer(t,e,i){Pe.isAddClusterCss||(Object(n.inputCss)("\n .leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {\n -webkit-transition: -webkit-transform 0.3s ease-out, opacity 0.3s ease-in;\n -moz-transition: -moz-transform 0.3s ease-out, opacity 0.3s ease-in;\n -o-transition: -o-transform 0.3s ease-out, opacity 0.3s ease-in;\n transition: transform 0.3s ease-out, opacity 0.3s ease-in;\n }\n .leaflet-cluster-spider-leg {\n /* stroke-dashoffset (duration and function) should match with leaflet-marker-icon transform in order to track it exactly */\n -webkit-transition: -webkit-stroke-dashoffset 0.3s ease-out, -webkit-stroke-opacity 0.3s ease-in;\n -moz-transition: -moz-stroke-dashoffset 0.3s ease-out, -moz-stroke-opacity 0.3s ease-in;\n -o-transition: -o-stroke-dashoffset 0.3s ease-out, -o-stroke-opacity 0.3s ease-in;\n transition: stroke-dashoffset 0.3s ease-out, stroke-opacity 0.3s ease-in;\n }\n "),Pe.isAddClusterCss=!0);const o={},s=t.renderer,{defaultSymbol:a,defaultLabelSymbol:l,defaultLabelExpressionInfo:h,radius:u,clusterBoundSymbol:c,maxScale:p,isExpandOnClick:f,isHoverShowBound:d,valueExpression:g,minHybridClusterCount:y,deconflictionStrategy:m}=s,_=s.clusterInfos||[];let v=20;if(e){const t=p/96*.0254,i=e.unproject(r.point(0,0),0),n=e.unproject(r.point(0,1),0);let o=e.distance(i,n),s=0;for(;s<=20&&o>t;)s+=1,o/=2;v=Math.max(s-1,0)}o.disableClusteringAtZoom=v,o.singleMarkerMode=!1,o.maxClusterRadius=u,o.polygonOptions=be.convertSymboltoLeafletStyle(c),o.zoomToBoundsOnClick=f,o.showCoverageOnHover=d,o.deconflictionStrategy=m,o.maxClusterNum=y;const x=n.ExpressionParser.createValueExpressionParser(),b=x.parse(g);let w;const S={};h&&h.expression&&(w=x.parse(h.expression));for(let t=0;t<_.length;t++){const e=_[t];e&&e.labelExpressionInfo&&e.labelExpressionInfo.expression&&(S[e.labelExpressionInfo.expression]=x.parse(e.labelExpressionInfo.expression))}o.iconCreateFunction=(t=>{const e=t.getChildCount();let i,o=!0;if(1===e)i=t;else{const e=t.getAllChildMarkers(),n={};for(let t=0;t<e.length;t++){const i=e[t];n[i.options.groupName]?n[i.options.groupName].count+=1:n[i.options.groupName]={count:1,marker:i}}let r;for(const t in n)(void 0===r||r&&n[t].count>r.count)&&(r=n[t]);i=r.marker,o=!(Object.keys(n).length>1)}const s=Ee(b,i.attributes,e,o),h=Le(_,s);let u=a,c=l,p=w;if(h&&(u=h.symbol,c=h.labelSymbol,h.labelExpressionInfo&&h.labelExpressionInfo.expression&&S[h.labelExpressionInfo.expression]&&(p=S[h.labelExpressionInfo.expression])),t instanceof r.Marker)if(c&&p){const i=function(t,e){return t.evaluate({$cluster_count:e})}(p,e),n=c.clone();n.text=i;const r=be.convertSymboltoLeafletStyle(n);t.setTextIcon(r.icon)}else t._removeTextIcon();return function(t){const e=document.createElement("div"),i=document.createElement("div");let o=[10,10],s=0,a="none";if(n.SymbolType.pictureMarker===t.type)Object(n.defined)(t.width)&&(e.style.width=`${parseFloat(t.width)}px`,o[0]=parseFloat(t.width)),Object(n.defined)(t.height)&&(e.style.height=`${parseFloat(t.height)}px`,o[1]=parseFloat(t.height)),Object(n.defined)(t.xoffset)&&(e.style.marginLeft=t.xoffset),Object(n.defined)(t.yoffset)&&(e.style.marginTop=t.yoffset),Object(n.defined)(t.angle)&&(e.style.transform=`rotate(${t.angle}deg)`),Object(n.defined)(t.url)&&(e.style.backgroundImage=`url(${t.url})`,e.style.backgroundSize="100% 100%");else{const{size:i=20,outline:r=null,style:l="circle",path:h="",angle:u=0,xoffset:c=0,yoffset:p=0,color:f}=t;if(Object(n.defined)(r)){const{width:t,color:n}=r;"circle"===l&&(e.style.borderRadius=`${i}px`,e.style.backgroundClip="padding-box"),s=t,a=U.convertColorToRgb(n)}Object(n.defined)(f)&&(e.style.backgroundColor=U.convertColorToRgb(f),e.style.backgroundSize="100% 100%"),Object(n.defined)(i)&&(o=[i,i],e.style.width=`${i}px`,e.style.height=`${i}px`),Object(n.defined)(c)&&(e.style.marginLeft=`${c}px`),Object(n.defined)(p)&&(e.style.marginTop=`${p}px`),Object(n.defined)(u)&&(e.style.transform=`rotate(${u}deg)`)}const l=o[0]+2*s,h=o[1]+2*s;return i.style=`border:none;background-color:${a};border-radius:${"circle"===t.style?`${l}px`:"none"};padding:${s}px;`,i.appendChild(e),new r.DivIcon({html:i,iconSize:new r.Point(l,h),className:""})}(u)});const E=new we(o);i=i||[];const L=[{groupName:"0",object:null}];for(let t=0;t<i.length;t++){const e=i[t];if(Object(n.defined)(e.geometry)){const t=new Se(U.getAreaCenter(e.geometry)),i=e.attributes,n=Ce(L,b,i,0,!0,_);t.options.groupName=n,E.addLayer(t),t.attributes=i}else n.Log.warning("要素几何信息缺失,无法绘制要素:",e)}return E}}var Ie=Pe;var Me=class extends n.BaseFeatureLayerView{onAdd(t){return this._addInnerLayer()}_processData(){return new Promise(t=>{})}onRemove(t){return super.onRemove(t),this.innerView.removeLayer(this.innerLayer),this.innerLayer=null,Promise.resolve(this)}onUpdate(t){this.layer;const e=this.innerLayer;return t.updateContent&&e&&t.updateContent.forEach(t=>{if(t&&"property"===t.operationType)switch(t.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":case"opacity":{const e=this._getOpacity(),i=this._getLayerViewVisible("scaleVisible"===t.name);U.setVisibleOpacity(this.innerLayer,e,i);break}}if(t&&"method"===t.operationType)switch(t.name){case"refresh":this.innerView.removeLayer(this.innerLayer),this._addInnerLayer()}}),Promise.resolve(this)}_addInnerLayer(){return this._processData().then(t=>{const e=this.layer,i=this,n=this.innerView,r=e.renderer;i._initInnerLayer(e,n,t,r);const o=i._getLayerViewVisible(),s=i._getOpacity();return U.setVisibleOpacity(i.innerLayer,s,o),i.innerLayer.addTo(n),new Promise(t=>{t(i)})})}_initInnerLayer(t,e,i,o){let s;o=o||{};let a=!1;if(this._isCommonRenderer(o))a=!0,s=r.featureGroup();else switch(o.type){case n.RendererType.cluster:s=Ie.createClusterLayer(t,e,i.features);break;default:n.Log.error("无法解析renderer信息")}return s.commonLayerId=t.id,this.innerLayer=s,a&&this._initFeatures(i.features,o),s}_rendererChangeAction(t){const{sourceEventData:e={}}=t;if("renderer"===e.key){const t=e.oldValue,i=e.value;if(!this._isCommonRenderer(t)||!this._isCommonRenderer(i))return this.innerView.removeLayer(this.innerLayer),void this._addInnerLayer()}const i=this.layer.renderer;this._isCommonRenderer(i)?super._rendererChangeAction(t):Ie.updateCluster(this.innerLayer,this.layer,this.view)}_isCommonRenderer(t){return t&&[n.RendererType.classBreak,n.RendererType.simple,n.RendererType.uniqueValue,n.RendererType.random,n.RendererType.rank].some(e=>e===t.type)}};var Te=class extends Me{_processData(){const t=this.layer;return Promise.resolve(t._source)}};class Oe{}Oe.addIGSVectorLayer=function(t,e,i,o){const s=xt.extend({options:{gdbps:null,filters:null,style:null,f:null,keepCache:!0,guid:null,attribution:"Zondy Map vector Data",proj:null,noWrap:!0,extensions:[]},initialize(t){t=t||{},this.url=t.url||"",this.layer=t.layer,r.setOptions(this,t),r.stamp(this)},onAdd(t){this._crs=t.options.crs,this._initLayerUrl(),xt.prototype.onAdd.call(this,t)},getTileUrl(t){const e=this._tileCoordsToBounds(t),i=this._crs.project(e.getNorthWest()),n=this._crs.project(e.getSouthEast());let r=this._layerUrl;return this.options.keepCache||(r+=`&temp=${Math.random()}`),r.replace("bbox={bbox}",`bbox=${i.x},${n.y},${n.x},${i.y}`)},_initLayerUrl(){const t=this._initAllRequestParams(),e=n.ServerUtil.getImage(this.url,t);this._layerUrl=n.UrlUtil.completeUrlEndMark(this.url)+n.UrlUtil.getStringFromObject(e.queryParameters)},_initAllRequestParams(){const t=this.options||{};let e=this.options.tileSize;return e instanceof r.Point||(e=r.point(e,e)),{gdbps:t.gdbps.toString(),urls:t.gdbps.toString(),f:t.f,w:e.x,h:e.y,size:`${e.x},${e.y}`,filters:t.filters,style:t.style,projectionSrs:t.projectionSrs,isAntialiasing:t.isAntialiasing,tokenKey:t.tokenKey,tokenValue:t.tokenValue}},redraw(){if(this._map){this._removeAllTiles();const t=Object(n.getGUID)();this.options.guid=t,this._initLayerUrl(),this._update()}return this}});n.EPSG.find(t=>t.id===i.view.spatialReference.wkid);let a={url:t,gdbps:[e.gdbp],tokenKey:e.tokenKey,tokenValue:e.tokenValue,filters:e.definitionExpression?`0:${e.definitionExpression}`:"",layer:e,projectionSrs:Object(n.getProjectionSrs)(i.view.spatialReference),headers:e.headers,visible:i._getLayerViewVisible(),opacity:i._getOpacity(),f:"1.0"===e._igsVersion?"png":"image",onDataUpdateAndRenderCompleted:()=>{i._fireLayerViewUpdateEvent("图层视图数据更新且渲染完毕",{name:"dataUpdateAndRenderCompleted"})}};const l=new s(a=Object(n.deleteNullValue)(a)).addTo(o);return l.id=e.id,l};var Ne=Oe;var Ae=class extends Me{_processData(){return this.layer._reloadFeatures()}onAdd(t){const e=this,i=this.layer,r=this.innerView;if("server"===i.renderMode){const t=Object(n.getBaseUrl)(i.url);let o=`${t}/igs/rest/mrms/layers`;"2.0"===i._igsVersion&&(o=`${t}/igs/rest/services/system/ResourceServer/tempData/image`),e.innerLayer=Ne.addIGSVectorLayer(o,i,e,r);const s=e._getLayerViewVisible(),a=e._getOpacity();return U.setVisibleOpacity(e.innerLayer,a,s),Promise.resolve(e)}return super.onAdd(t)}onUpdate(t){if("server"===this.layer.renderMode){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}return super.onUpdate(t)}onRemove(t){const e=this;return"server"===this.layer.renderMode?(this.innerView.removeLayer(this.innerLayer),Promise.resolve(e)):super.onRemove(t)}};var Re=class extends n.GroupLayerView{};var ke=class extends Me{_processData(){return this.layer.queryFeatures().then(t=>t)}};var De=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=tt.addArcGISMapImageLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}break;case"refresh":this.onRefresh()}}return Promise.resolve(this)}};var ze=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=ot.addArcGISTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};var Ve=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=it.addWebTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":this.innerLayer.setVisible(this._getLayerViewVisible("scaleVisible"===i.name));break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};function Fe(t){return t.length>2?new r.LatLng(t[1],t[0],t[2]):new r.LatLng(t[1],t[0])}function Be(t,e,i){const n=[];for(let r,o=0,s=t.length;o<s;o++)r=e?Be(t[o],e-1,i):(i||Fe)(t[o]),n.push(r);return n}function je(t,e){return t.isGeographic?e:(e.spatialReference=t,n.Projection.project(e,new n.SpatialReference("EPSG:4326")))}var Ge=class{static toLeafletCoords(t,e){let i=[];const r=Object(n.defaultValue)(e,{}),o=Object(n.defaultValue)(r.additional,void 0);let s=Object(n.defaultValue)(n.SpatialReference.fromJSON(r.spatialReference),new n.SpatialReference("EPSG:4326"));switch(t.spatialReference&&(s=t.spatialReference),t.type){case n.GeometryType.point:{let e=t.clone();const n=(e=je(s,e)).coordinates;i.push(Fe(n));break}case n.GeometryType.multiPoint:{let e=t.clone();i=Be((e=je(s,e)).coordinates,0,Fe);break}case n.GeometryType.lineString:{let e=t.clone();i=Be((e=je(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,0,Fe);break}case n.GeometryType.multiLineString:case n.GeometryType.polygon:{let e=t.clone();i=Be((e=je(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,1,Fe);break}case n.GeometryType.multiPolygon:{let e=t.clone();i=Be((e=je(s,e=Object(n.editGeometryByArc3)(e,o))).coordinates,2,Fe);break}case n.GeometryType.extent:{let e=t.clone();const n=(e=je(s,e)).xmin,r=e.xmax,o=e.ymin,a=e.ymax;i.push([o,n]),i.push([a,r]);break}case n.GeometryType.circle:{let e=t.clone();const n=(e=je(s,e)).center;i.push([n[1],n[0]]);break}}return i}};var Ue=r.CircleMarker.extend({options:{fill:!0,shape:"circle",radius:10,rotation:0,xoffset:0,yoffset:0,path:""},setStyle(t){const e=t&&t.radius||this.options.radius||this._radius;r.Path.prototype.setStyle.call(this,t),this.setRadius(e)},setPath(t){return this.options.path=t,this.redraw()},getPath(){return this.options.path},setXoffset(t){return this.options.xoffset=t,this.redraw()},getXoffset(){return this.options.xoffset},setYoffset(t){return this.options.yoffset=t,this.redraw()},getYoffset(){return this.options.yoffset},setRadius(t){return this.options.radius=t,this.redraw()},getRadius(){return this.options.radius},setRotation(t){return this.options.rotation=t,this.redraw()},getRotation(){return this.options.rotation},_updatePath(){this._renderer._updateShape(this)},toGeoJSON(){return r.GeoJSON.getFeature(this,{type:"Point",coordinates:r.GeoJSON.latLngToCoords(this.getLatLng())})}});const qe=Ge.toLeafletCoords,He=be.convertSymboltoLeafletStyle;function Ze(t,e,i){let o;switch(t){case n.SymbolType.simpleMarker:o=new Ue(e,i);break;case n.SymbolType.pictureMarker:o=r.marker(e,i);break;case n.SymbolType.line:o=r.polyline(e,i);break;case n.SymbolType.text:o=r.marker(e,i);break;case n.SymbolType.fill:case n.SymbolType.pictureFill:o=r.polygon(e,i);break;default:n.Log.error("符号类型错误,不合法的符号类型")}return o}function Xe(t,e,i){const r=[];if(t){const{color:o,style:s,placement:a}=t,l=U.calcLineMarkerDetail(i),{angle1:h,angle2:u,latlng1:c,latlng2:p}=l,f=He(new n.SimpleMarkerSymbol({angle:h,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})),d=Ze(n.SymbolType.simpleMarker,c,f),g=Ze(n.SymbolType.simpleMarker,p,He(new n.SimpleMarkerSymbol({angle:u,color:o,outline:{color:o,width:e},style:s,size:Math.max(15,4*e)})));"begin"===a?r.push(d):"end"===a?r.push(g):(r.push(d),r.push(g))}return r}function Ye(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=Xe(t.symbol.marker,i,t.geometry.coordinates),o=new r.FeatureGroup(n);e.__marker__group=o,e.addLayer(o)}function We(t,e){e.__marker__group&&e.removeLayer(e.__marker__group);const i=t.symbol.width,n=t.symbol.marker;let o=[];t.geometry.coordinates.forEach(t=>{const e=Xe(n,i,t);o=o.concat(e)});const s=new r.FeatureGroup(o);e.__marker__group=s,e.addLayer(s)}function $e(t,e,i){let r;return r=n.SymbolType.simpleMarker===t||n.SymbolType.text===t||n.SymbolType.pictureMarker===t?U.getAreaCenter(e):qe(e,{additional:i.additional})}function Ke(t){const e=He(t.symbol),i=t.symbol.type;return Ze(i,$e(i,t.geometry.toPolygon(),t),e)}function Qe(t){let e=null;if(!(t instanceof n.Feature))return e;if(!t.geometry)return n.Log.error("几何不存在"),e;switch(t.geometry.type){case n.GeometryType.point:e=function(t){const e=qe(t.geometry),i=He(t.symbol);return Ze(t.symbol.type,e[0],i)}(t);break;case n.GeometryType.lineString:e=function(t){const e=qe(t.geometry,{additional:t.additional}),i=He(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=Ze(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&Ye(t,o),o}(t);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:e=function(t){const e=He(t.symbol),i=t.symbol.type;return Ze(i,$e(i,t.geometry,t),e)}(t);break;case n.GeometryType.extent:case n.GeometryType.circle:e=Ke(t);break;case n.GeometryType.multiPoint:e=function(t){const e=qe(t.geometry),i=He(t.symbol),n=t.symbol.type,o=[];return e.forEach(t=>{const e=Ze(n,t,i);o.push(e)}),new r.FeatureGroup(o)}(t);break;case n.GeometryType.multiLineString:e=function(t){const e=qe(t.geometry,{additional:t.additional}),i=He(t.symbol),n=t.symbol.type,o=new r.FeatureGroup,s=Ze(n,e,i);return o.__line__graphic=s,o.addLayer(s),t.symbol.marker&&We(t,o),o}(t)}return e}const Je=be.convertSymboltoLeafletStyle;var ti=class extends n.FeatureRender{drawFeature(t,e){if(t){const{layerVisible:i,layerOpacity:n}=t;e.forEach(e=>{if(e.visible){const r=Qe(e);r.commonFeatureId=e.id,r.commonLayerId=t.commonLayerId,U.setGraphicVisibleOpacity(r,n,i),t.addLayer(r)}})}}updateFeature(t,e,i){t&&(super.updateFeature(t,e,i),e.forEach((e,n)=>{const r=i[n];r&&e&&this._update(t,r.symbolUpdated,r.geometryUpdated,e)}))}_update(t,e,i,r){const o=r.geometry,s=r.symbol,a=!!i,l=!!e;let h=!1;const u=this._getGraphicByFeatureId(t,r.id);if(r.visible)if(u){if(e){const{key:t,oldValue:i,value:n}=e;i&&n&&i.type!==n.type&&(h=!0),"type"===t&&(h=!0)}if(!h)switch(o.type){case n.GeometryType.point:if(l){const t=Je(r.symbol)||{};u.setStyle(t)}if(a){const t=Ge.toLeafletCoords(o);u.setLatLng(t[0])}break;case n.GeometryType.multiPoint:if(l){const t=Je(r.symbol);u.eachLayer(e=>{e.setStyle(t)})}if(a){const t=Ge.toLeafletCoords(o),e=Object.keys(u._layers).map(t=>u._layers[t])||[],i=t.length;let n=e.length;if(n!==i)if(n>i){for(;n!==i;)u.removeLayer(e[n-1]),n-=1;let r=0;u.eachLayer(e=>{e.setLatLng(t[r]),r+=1})}else{const i=r.symbol.type,o=Je(r.symbol);t.forEach((t,r)=>{if(r<n)e[r].setLatLng(t);else{const e=Ze(i,t,o);u.addLayer(e)}})}else{let e=0;u.eachLayer(i=>{i.setLatLng(t[e]),e+=1})}}break;case n.GeometryType.lineString:if(l){const t=Je(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=Ge.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&Ye(r,u);break;case n.GeometryType.multiLineString:if(l){const t=Je(r.symbol);u.__line__graphic&&u.__line__graphic.setStyle(t)}if(a){const t=Ge.toLeafletCoords(o);u.__line__graphic&&u.__line__graphic.setLatLngs(t)}s.marker&&We(r,u);break;case n.GeometryType.multiPolygon:case n.GeometryType.polygon:if(l){const t=Je(r.symbol);u.setStyle(t)}if(a){const t=$e(s.type,o,r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}break;case n.GeometryType.extent:case n.GeometryType.circle:if(l){const t=Je(r.symbol);u.setStyle(t)}if(a){const t=$e(s.type,o.toPolygon(),r);u.setLatLngs?u.setLatLngs(t):u.setLatLng&&u.setLatLng(t)}}h&&this._redrawFeature(t,r)}else this.drawFeature(t,[r]);else this.clearFeature(t,[r])}clearFeature(t,e){t&&(super.clearFeature(t,e),e.forEach(e=>{const i=this._getGraphicByFeatureId(t,e.id);i&&t.removeLayer(i)}))}clear(t){t&&(super.clear(t),t.clearLayers())}_getGraphicByFeatureId(t,e){let i=null;return t&&e&&t.eachLayer(t=>{if(t.commonFeatureId===e)return i=t}),i}_redrawFeature(t,e){this.clearFeature(t,[e]),this.drawFeature(t,[e])}};var ei=class extends n.LayerView{onAdd(){const t=this.layer;return this.innerLayer=ht.addIGSImageryTileLayer(this),this.innerLayer.commonLayerId=t.id,Promise.resolve(this)}onRemove(){return this.innerView.removeLayer(this.innerLayer),Promise.resolve(this)}onUpdate(t){if(!this.innerLayer)return Promise.resolve(this);if(t.updateContent)for(let e=0;e<t.updateContent.length;e++){const i=t.updateContent[e];if(i)switch(i.name){case"scaleVisible":case"minScale":case"maxScale":case"visible":const t=this._getLayerViewVisible("scaleVisible"===i.name);this.innerLayer.setVisible(t);break;case"opacity":this.innerLayer.setOpacity(this._getOpacity());break;case"refresh":this.innerLayer.redraw();break;case"clippingArea":{const t=i.params[0];this.innerLayer.setClippingArea(U.convertClippingArea(t));break}case"extensionOptions":if(this.innerLayer){const t=this.layer.extensionOptions||{};Object.entries(t).forEach(([t,e])=>{this.innerLayer[t]=e})}}}return Promise.resolve(this)}};function ii(t,e){let i=null;switch(e.type){case n.LayerType.IGSVectorTile:case n.LayerType.ArcGISVectorTile:i=new Qt({view:t,layer:e});break;case n.LayerType.WMTS:i=new te({view:t,layer:e});break;case n.LayerType.IGSMapImage:i=new ae({view:t,layer:e});break;case n.LayerType.IGSTile:i=new ee({view:t,layer:e});break;case n.LayerType.WMS:i=new Jt({view:t,layer:e});break;case n.LayerType.ECharts:i=new fe({view:t,layer:e});break;case n.LayerType.MapV:i=new ye({view:t,layer:e});break;case n.LayerType.graphics:i=new ue({view:t,layer:e,render:new ti});break;case n.LayerType.GeoJSON:i=new Te({view:t,layer:e,render:new ti});break;case n.LayerType.IGSFeature:i=new Ae({view:t,layer:e,render:new ti});break;case n.LayerType.group:i=new Re({view:t,layer:e});break;case n.LayerType.WFS:i=new ke({view:t,layer:e,render:new ti});break;case n.LayerType.ArcGISMapImage:i=new De({view:t,layer:e});break;case n.LayerType.ArcGISTile:i=new ze({view:t,layer:e});break;case n.LayerType.webTile:i=new Ve({view:t,layer:e});break;case n.LayerType.IGSImage:i=new le({view:t,layer:e});break;case n.LayerType.IGSImageTile:i=new ei({view:t,layer:e})}return i}class ni extends n.MapView{constructor(t){if(super(t),t=Object(n.defaultValue)(t,{}),this._options=t,this._center=this._getValidCenter(t.center),this._extent=Object(n.isNull)(t.extent)?void 0:n.Extent.fromJSON(t.extent),this.animation=Object(n.defaultValue)(t.animation,!0),this.width=void 0,this.height=void 0,this._zoom=Object(n.defaultValue)(t.zoom,void 0),this._resolution=0,this._scale=Object(n.defaultValue)(t.scale,void 0),this.maxScale=Object(n.defaultValue)(t.maxScale,void 0),this.minScale=Object(n.defaultValue)(t.minScale,void 0),this.minZoom=Object(n.defaultValue)(t.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(t.maxZoom,void 0),this.popup=Object(n.defaultValue)(t.popup,void 0),this.preferCanvas=Object(n.defaultValue)(t.preferCanvas,!1),this.spatialReferenceLocked=Object(n.defaultValue)(t.spatialReferenceLocked,!1),this._rotation=Object(n.defaultValue)(t.rotation,0),this.stationary=!0,this.engineType=n.EngineType.leaflet,this._zoomSnap=Object(n.defaultValue)(t.zoomSnap,1),this._zoomDelta=Object(n.defaultValue)(t.zoomDelta,1),this._isCustomCrs=!1,this._map._initLeafletView=!0,this._screenshot=null,t.fullExtent){let e=n.Extent.fromJSON(t.fullExtent.toJSON());e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._initFullExtent=e}this._fullExtent=this._initFullExtent,this._mapExtent=null,this.extensionOptions=Object(n.defaultValue)(t.extensionOptions,{}),this._fireLoaded=!1,this._initView(!0,this._options)}flyTo(t,e={animate:!0}){t=Object(n.defaultValue)(t,{});const i=Object(n.defaultValue)(t.zoom,1),r=this._getFlyToCenter(t),o=this._getFlyToExtent(t);if(this._innerView){if(this._zoomSnap>B&&(this._innerView.options.zoomSnap=B),this._zoomDelta>B&&(this._innerView.options.zoomDelta=B),r){let t=r.coordinates[1],o=r.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(o>this._fullExtent.xmax||o<this._fullExtent.xmin)&&(o=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(o)){let s=!1;const a=this._innerView.getCenter();if(i===this._zoom&&t===a.lat&&o===a.lng&&(s=!0),!s){let s;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(s=this._innerView._limitCenter({lat:t,lng:o},i,this._innerView.options.maxBounds)),s&&s.lat!==t&&s.lng!==o?n.Log.warning(`中心点${r}、层级${i}的视图,范围超过最大视图范围!`):(this._center=r,this._scale=this._getScaleByZoom(i),this._zoom=void 0,this._innerView.setView([t,o],i,e))}}}else if(o){let t=o.xmin,i=o.xmax,n=o.ymin,r=o.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),i>this._fullExtent.xmax&&(i=this._fullExtent.xmax),n<this._fullExtent.ymin&&(n=this._fullExtent.ymin),r>this._fullExtent.ymax&&(r=this._fullExtent.ymax)),isFinite(t)&&isFinite(i)&&isFinite(n)&&isFinite(r)&&(this._center=void 0,this._scale=void 0,this._zoom=void 0,this._extent=o,this._setViewExtent(o,e))}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}}goTo(t={},e={}){let i=new Promise(t=>{t(!1)});if(this._innerView){let{center:r,zoom:o,extent:s}=this._getValidGoToParams(t,e);Object(n.isNull)(r)||(this._center=r),Object(n.isNull)(o)||(this._scale=this._getScaleByZoom(o),this._zoom=void 0),Object(n.isNull)(t.scale)||(this._scale=t.scale),Object(n.isNull)(s)||(this._center=void 0,this._scale=void 0,this._zoom=void 0,this._extent=s);const a={animate:!0,duration:200};if(!Object(n.isNull)(e)){const t=Object(n.defaultValue)(e.animate,!0);a.animate=t,t?Object(n.isNull)(e.duration)||(a.duration=e.duration/1e3):a.duration=0}if(this._zoomSnap>B&&(this._innerView.options.zoomSnap=B),this._zoomDelta>B&&(this._innerView.options.zoomDelta=B),Object(n.isNull)(r)||Object(n.isNull)(o)){if(!Object(n.isNull)(s)){let t=s.xmin,e=s.xmax,n=s.ymin,r=s.ymax;this._fullExtent&&(t<this._fullExtent.xmin&&(t=this._fullExtent.xmin),e>this._fullExtent.xmax&&(e=this._fullExtent.xmax),n<this._fullExtent.ymin&&(n=this._fullExtent.ymin),r>this._fullExtent.ymax&&(r=this._fullExtent.ymax)),isFinite(t)&&isFinite(e)&&isFinite(n)&&isFinite(r)&&(i=this._setViewExtent(s,a))}}else{let t=r.coordinates[1],e=r.coordinates[0];if(this._fullExtent&&((t>this._fullExtent.ymax||t<this._fullExtent.ymin)&&(t=(this._fullExtent.ymax+this._fullExtent.ymin)/2),(e>this._fullExtent.xmax||e<this._fullExtent.xmin)&&(e=(this._fullExtent.xmax+this._fullExtent.xmin)/2)),isFinite(t)&&isFinite(e)){let s=!1;const l=this._innerView.getCenter();if(o===this._zoom&&t===l.lat&&e===l.lng&&(s=!0),s)return i;let h;this._innerView&&this._innerView.options&&this._innerView.options.maxBounds&&(h=this._innerView._limitCenter({lat:t,lng:e},o,this._innerView.options.maxBounds)),h&&h.lat!==t&&h.lat!==e?n.Log.warning(`中心点${r}、层级${o}的视图,范围超过最大视图范围!`):i=new Promise(i=>{this._innerView.setView([t,e],o,a),this._innerView.once("moveend",()=>{i(!0)})})}}this._zoomSnap!==this._innerView.options.zoomSnap&&(this._innerView.options.zoomSnap=this._zoomSnap),this._zoomDelta!==this._innerView.options.zoomDelta&&(this._innerView.options.zoomDelta=this._zoomDelta)}return i}_getFlyToExtent(t){let e=t.extent;if(!e)return;const i=n.Projection.project(new n.Point({coordinates:[e.xmin,e.ymax],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326")),r=n.Projection.project(new n.Point({coordinates:[e.xmax,e.ymin],spatialReference:e.spatialReference}),new n.SpatialReference("EPSG:4326"));return e=new n.Extent({xmin:i.coordinates[0],ymin:r.coordinates[1],xmax:r.coordinates[0],ymax:i.coordinates[1]})}_setViewExtent(t,e){t.spatialReference&&!t.spatialReference.isGeographic&&(t=n.Projection.project(t,new n.SpatialReference("EPSG:4326")));const i=t.xmin,o=t.ymin,s=t.xmax,a=t.ymax,l=this.getExtent();let h=!1;if(l.ymin===o&&l.xmin===i&&l.ymax===a&&l.xmax===s)h=!0;else{const i=this._innerView.getCenter(),n=this._innerView._getBoundsCenterZoom(r.latLngBounds(r.latLng(t.ymin,t.xmin),r.latLng(t.ymax,t.xmax)));if(n.zoom===this._zoom&&n.center.lat===i.lat&&n.center.lng===i.lng&&(h=!0),!h)return new Promise(t=>{this._innerView.setView([n.center.lat,n.center.lng],n.zoom,e),this._innerView.once("moveend",()=>{t(!0)})})}return new Promise(t=>{t(!1)})}_getLatLngFromExtent(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return{northEastLatlng:new r.latLng(i.ymax,i.xmax),southWestLatlng:new r.latLng(i.ymin,i.xmin)}}_getLatLngFromPoint(t){const e=new n.SpatialReference("EPSG:4326"),i=n.Projection.project(t,e);return new r.latLng(i.coordinates[1],i.coordinates[0])}_initViewEvent(){super._initViewEvent();const t=this;this._clickStore=null,this._dragParams={isDrag:!1,origin:null,action:"",button:null,dragMouseUp:!1},this._innerView.on("click",e=>{t._dragParams.dragMouseUp?t._dragParams.dragMouseUp=!1:(t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,Kt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,Kt.getMouseEvent(e,t)))}),this._innerView.on("contextmenu",e=>{t._clickStore=setTimeout(function(){t._clickStore&&t.fire(n.ViewEventType.click,Kt.getMouseEvent(e,t))},300),t.fire(n.ViewEventType.immediateClick,Kt.getMouseEvent(e,t))}),this._innerView.on("dblclick",e=>{t._clickStore&&(clearTimeout(this._clickStore),t._clickStore=null),t.fire(n.ViewEventType.doubleClick,Kt.getMouseEvent(e,t))}),this._innerView.on("mousedown",e=>{t.fire(n.ViewEventType.pointerDown,Kt.getMouseEvent(e,t)),this._dragParams.isDrag||(this._dragParams.origin={x:e.originalEvent.layerX,y:e.originalEvent.layerY},this._dragParams.button=e.originalEvent.button,this._dragParams.action="mouse-down",this._dragParams.isDrag=!1)}),this._innerView.on("mouseup",e=>{t.fire(n.ViewEventType.pointerUp,Kt.getMouseEvent(e,t)),t._dragParams.isDrag&&"update"===this._dragParams.action&&(this._dragParams.action="end",this._innerView.dragging._enabled||(t._dragParams.dragMouseUp=!0),t.fire(n.ViewEventType.drag,Kt.getDragEvent(e,t,t._dragParams.origin,this._dragParams.action))),t._dragParams.isDrag=!1,t._dragParams.origin=null,t._dragParams.action="",t._dragParams.button=null}),this._innerView.on("mousemove",e=>{t.fire(n.ViewEventType.pointerMove,Kt.getMouseEvent(e,t)),t._dragParams.isDrag?(t.fire(n.ViewEventType.drag,Kt.getDragEvent(e,t,t._dragParams.origin,t._dragParams.action,t._dragParams.button)),t._dragParams.action="update"):"mouse-down"===this._dragParams.action&&(this._dragParams.action="start",t._dragParams.isDrag=!0)}),this._innerView.on("keydown",e=>{t.fire(n.ViewEventType.keyDown,Kt.getKeyEvent(e,t,n.ViewEventType.keyDown))}),this._innerView.on("keyup",e=>{t.fire(n.ViewEventType.keyUp,Kt.getKeyEvent(e,t,n.ViewEventType.keyUp))}),this._innerView.on("movestart",()=>{t.stationary=!1}),this._innerView.on("zoom",e=>{t.fire(n.ViewEventType.zoom,{zoom:e.target._zoom,event:e})}),this._innerView.on("zoomend",e=>{t._zoomEndHandler(),t.fire(n.ViewEventType.viewChange,Kt.getViewChangeEvent(e,t))}),this._innerView.on("moveend",e=>{t._moveEndHandler(),t.fire(n.ViewEventType.viewChange,Kt.getViewChangeEvent(e,t)),t.stationary=!0}),this._innerView.on("resize",e=>{t.fire(n.ViewEventType.resize,{oldWidth:e.oldSize.x,oldHeight:e.oldSize.y,width:e.newSize.x,height:e.newSize.y}),t._initSize()}),this.fire(n.ViewEventType.viewCreated,this._innerView)}_mapActionControl(t,e){this._innerView&&("drag-pan"===t?e?this._innerView.dragging.enable():this._innerView.dragging.disable():"double-click-zoom"===t&&(e?this._innerView.doubleClickZoom.enable():this._innerView.doubleClickZoom.disable()))}_initView(t,e){let i;if(t&&e){let t;i={center:t=Object(n.isNull)(e.center)&&Object(n.isNull)(e.extent)?new n.Point({coordinates:[105.1250000000032,24.427133220306196]}):Object(n.isNull)(e.center)?void 0:this._getValidCenter(e.center),scale:Object(n.isNull)(e.scale)&&Object(n.isNull)(e.zoom)?36978669.4318207:e.scale,zoom:e.zoom,target:Object(n.isNull)(e.extent)?void 0:n.Extent.fromJSON(e.extent)},this.minScale=Object(n.defaultValue)(e.minScale,void 0),this.maxScale=Object(n.defaultValue)(e.maxScale,void 0),this.minZoom=Object(n.defaultValue)(e.minZoom,void 0),this.maxZoom=Object(n.defaultValue)(e.maxZoom,void 0)}else this._zoom=void 0,this._extent=void 0,i={center:this._center,scale:this._scale};let{center:o,zoom:s,extent:a}=this._getValidGoToParams(i);Object(n.isNull)(o)||Object(n.isNull)(s)?Object(n.isNull)(a)||(this._extent=a):(this._center=o,this._zoom=s);const l=this._getMaxBounds();let h={preferCanvas:this.preferCanvas,attributionControl:Object(n.defaultValue)(e.attributionControl,!1),zoomControl:Object(n.defaultValue)(e.zoomControl,!0),doubleClickZoom:Object(n.defaultValue)(e.doubleClickZoom,!0),dragging:Object(n.defaultValue)(e.dragging,!0),zoomSnap:this._zoomSnap,zoomDelta:this._zoomDelta,trackResize:Object(n.defaultValue)(e.trackResize,!0),keyboard:Object(n.defaultValue)(e.keyboard,!0),keyboardPanDelta:Object(n.defaultValue)(e.keyboardPanDelta,80),scrollWheelZoom:Object(n.defaultValue)(e.scrollWheelZoom,!0),wheelDebounceTime:Object(n.defaultValue)(e.wheelDebounceTime,40),wheelPxPerZoomLevel:Object(n.defaultValue)(e.wheelDebounceTime,60),tapHold:Object(n.defaultValue)(e.tapHold,!0),tapTolerance:Object(n.defaultValue)(e.tapTolerance,15),touchZoom:Object(n.defaultValue)(e.touchZoom,!0),bounceAtZoomLimits:Object(n.defaultValue)(e.bounceAtZoomLimits,!0),crs:this.crs,maxBounds:l,zoomAnimation:this.animation,config:n.Config,rotate:!0,bearing:this._rotation};return this.initialGoTo&&(Object(n.isNull)(this._center)||Object(n.isNull)(this._center.coordinates)||(h.center=[this._center.coordinates[1],this._center.coordinates[0]]),Object(n.isNull)(this._zoom)||(h.zoom=this._zoom)),Object(n.defined)(h.center)||(h.center=[0,0]),Object(n.defined)(h.zoom)||(h.zoom=0),h=Object.assign(h,this.extensionOptions),t&&e&&e.innerView?(this._innerView=e.innerView,this._innerView._container&&(this._viewId=this._innerView._container.id)):this._innerView=r.map(this._viewId,h),this.ui=new Wt({view:this}),this._initViewEvent(),this._initSize(),this._initScaleLimit(),this._initPopup(),this._initCursor(),new Promise(i=>{function r(t,e){if(t.initialGoTo&&e&&t._extent){let e=t._extent;t._extent.spatialReference.isGeographic||(e=n.Projection.project(t._extent.clone(),new n.SpatialReference({wkid:4326}))),t._fullExtent&&(e.xmax>t._fullExtent.xmax||e.ymax>t._fullExtent.ymax||e.xmin<t._fullExtent.xmin||e.ymin<t._fullExtent.ymin)&&(e=t._fullExtent),t.goTo({target:t._extent},{animate:!1})}t._fireLoaded||(t._zoomEndHandler(),t.fire(n.ViewEventType.loaded,{}),t._fireLoaded=!0),t.fire(n.ViewEventType.innerViewCreated,{innerView:t._innerView}),i(self)}t&&e&&e.innerView&&(!this.initialGoTo||Object(n.isNull)(this._center)||Object(n.isNull)(this._zoom)?Promise.resolve().then(()=>{r(this,t)}):this.goTo({center:this._center,zoom:this._zoom},{animate:!1}).finally(()=>{r(this,t)})),this._innerView._loaded?Promise.resolve().then(()=>{r(this,t)}):this._innerView.whenReady(()=>{r(this,t)})})}_reCreateView(t){return this._innerView&&(this._innerView._animatingZoom=!1,this._innerView.remove()),t?this._initView(!0,this._options):this._initView(!1,this._options)}_resetExtent(){this._extent&&(this._extent=void 0,this._zoom=Math.max(this.minZoom,0))}_createCrsObject(t){if(t.spatialReference&&t.lods&&t.origin&&t.extent)return new l({wkid:t.spatialReference.wkid,wkt:t.spatialReference.wkt,lods:t.lods,origin:t.origin,unit:t.spatialReference.isGeographic?"degree":void 0,extent:t.extent})}_processEvent(t){super._processEvent(t),t.type===n.MapEventType.layerRemove&&(this._map._isRemoveMany||this._map._isRemoveAll||!this._map._canResetView||this._setSpatialReference()),t.type===n.MapEventType.layerRemoveMany&&this._map._canResetView&&t.layers&&this._setSpatialReference()}_initSize(){const t=this._innerView.getSize();this.width=t.x,this.height=t.y}destroy(){this._innerView.remove()}getCenter(){if(Object(n.isNull)(this._innerView))return;const t=this._innerView.getCenter();let e=new n.Point({coordinates:[t.lng,t.lat]});this._center=e;const i=this._spatialReference;return i.isGeographic||(e=n.Projection.project(e,i)),e}setCenter(t){this._innerView&&(Array.isArray(t)&&t.length>1?(this._center=new n.Point({coordinates:[t[0],t[1]],spatialReference:this._spatialReference}),this.flyTo({zoom:this._zoom,center:this._center})):t instanceof n.Point&&(this._center=t,this.flyTo({zoom:this._zoom,center:this._center})))}getZoom(){if(!Object(n.isNull)(this._innerView))return this._zoom=this._innerView.getZoom(),this._zoom}setZoom(t){if(!this._innerView)return;const e=Math.max(this.minZoom,t);this.flyTo({zoom:e,center:this._center})}getMinZoom(){return this._innerView.getMinZoom()}getSize(){return this._innerView.getSize()}getMaxZoom(){return this._innerView.getMaxZoom()}getPixelExtent(){return this._innerView.getPixelBounds()}getPixelCenter(){return this._innerView.getPixelOrigin()}getPixelWorldExtent(){return this._innerView.getPixelWorldBounds()}toJSON(){const t=super.toJSON();return t.extent=Object(n.toJSON)(this._extent,n.Extent),t.animation=this.animation,t.width=this.width,t.height=this.height,t.preferCanvas=this.preferCanvas,t.spatialReferenceLocked=this.spatialReferenceLocked,t}clone(){return Object(n.cloneObject)(this)}static fromJSON(t){return new ni(t)}toMap(t){const e=this._innerView.containerPointToLatLng(t);let i=new n.Point({coordinates:[e.lng,e.lat]});const r=this._spatialReference;return r.isGeographic?i.spatialReference=r:i=n.Projection.project(i,r),i}toScreen(t){let e=n.Geometry.fromJSON(t);return e.spatialReference.isGeographic||(e=n.Projection.project(e,new n.SpatialReference({wkid:4326}))),this._innerView.latLngToContainerPoint([e.coordinates[1],e.coordinates[0]])}takeScreenshot(t){t.view=this;let e=null;return this._screenshot?e=this._screenshot._addView():(this._screenshot=new se(t),e=this._screenshot._addView()),e}getExtent(){if(!this._innerView)return;const t=this._innerView.getGeoBoundsCoord(),e=new n.Extent({xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax,spatialReference:this._spatialReference});return this._extent=e,e}getZoomByExtent(t){let e=0;if(this._innerView){let i=n.Extent.fromJSON(t.toJSON());i.spatialReference.isGeographic||(i=n.Projection.project(i,new n.SpatialReference("EPSG:4326")));const o=r.latLng(i.ymin,i.xmin),s=r.latLng(i.ymax,i.xmax),a=r.latLngBounds(o,s);e=this._innerView.getBoundsZoom(a)}return e}setExtent(t){this._innerView&&(this._extent=t,this.flyTo({extent:t}))}_zoomEndHandler(){this.getExtent(),this.getZoom(),this.getCenter(),this.getScale(),this.getResolution(),this._updateLayerViewScaleVisible()}_moveEndHandler(){this.getCenter(),this.getExtent()}_initScaleLimit(){if(void 0!==this._options.minScale)if(this.minScale>0){const t=this._getZoomByScale(this.minScale);void 0!==t&&this._innerView.setMinZoom(t),this.minZoom=t}else this.minZoom=void 0,this.minScale=0,this._innerView.setMinZoom(this.minZoom);else if(Object(n.isNull)(this._options.minZoom)){const t=this._innerView.getMinZoom();isFinite(t)?(this.minZoom=t,this.minScale=this._getScaleByZoom(this.minZoom)):(this.minZoom=void 0,this.minScale=void 0)}else this.minZoom=this._options.minZoom,this.minScale=this._getScaleByZoom(this.minZoom),this._innerView.setMinZoom(this.minZoom);if(void 0!==this._options.maxScale)if(this.maxScale>0){const t=this._getZoomByScale(this.maxScale);void 0!==t&&this._innerView.setMaxZoom(t),this.maxZoom=t}else this.maxScale<=0&&(this.maxZoom=void 0,this.maxScale=0,this._innerView.setMaxZoom(this.maxZoom));else if(Object(n.isNull)(this._options.maxZoom)){let t=this._innerView.getMaxZoom();const e=((this.crs||{}).options||{}).lods;e&&Array.isArray(e)&&t>=e.length-1&&(t=e.length-1,this._innerView.setMaxZoom(t)),isFinite(t)?(this.maxZoom=t,this.maxScale=this._getScaleByZoom(this.maxZoom)):(this.maxZoom=void 0,this.maxScale=void 0)}else this.maxZoom=this._options.maxZoom,this.maxScale=this._getScaleByZoom(this.maxZoom),this._innerView.setMaxZoom(this.maxZoom);!this._scale||this._scale<=0?this._scale=this.minScale:this._scale>this.minScale?this._scale=this.minScale:this._scale<this.maxScale&&(this._scale=this.maxScale)}_limitZoomByExtent(t){this._innerView.getBoundsZoom(t);this._innerView.options.minZoom=this.minZoom}_getMaxBounds(){return function(t){if(t){const e=r.latLng(t.ymin,t.xmin),i=r.latLng(t.ymax,t.xmax);return r.latLngBounds(e,i)}return null}(this._fullExtent)}_initPopup(){this.popup=new ie({view:this})}hitTest(t){let e=[];return e=this.preferCanvas?this._hitTestCanvas(t):this._hitTestSVG(t)}_hitTestSVG(t){const e=this,i=[],r=this._innerView._container.getBoundingClientRect();document.elementsFromPoint(r.x+t.x,r.y+t.y).forEach(t=>{t&&t._leaflet_id&&t.classList.contains("leaflet-interactive")&&t._leaflet_id&&i.push(e._innerView._targets[t._leaflet_id])});const o=[];return i.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let s=null;if(r.type===n.LayerType.IGSFeature||r.type===n.LayerType.GeoJSON){s=this._getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(s=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:s&&s.items.length>0?s.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};o.push(a)}),o}_hitTestCanvas(t){const e=[],i=this._innerView._renderer,r={clientX:t.x,clientY:t.y},o=i._map.mouseEventToContainerPoint(r);for(let t=i._dragFirst;t;t=t.next){const n=t.layer;n.options.interactive&&n._containsPoint(o)&&("click"!==r.type&&"preclick"!==r.type||!i._map._draggableMoved(n))&&n.feature&&e.push(n)}const s=[];return e.forEach(e=>{const i=this._getInnerLayerId(e);if(Object(n.isNull)(i.commonLayerId))return;const r=this.getLayer(i.commonLayerId);let o=null;if(r.type===n.LayerType.IGSFeature||r.type===n.LayerType.GeoJSON){o=this.getLayerView(r)._featureSetCache.filter(t=>{if(t.id===i.commonFeatureId)return t})}else r.type===n.LayerType.graphics&&(o=r.graphics.filter(t=>{if(t.id===i.commonFeatureId)return t}));const a={graphic:o.items.length>0?o.items[0]:null,layer:r,mapPoint:this.toMap(t),type:"graphic"};s.push(a)}),s}_getInnerLayerId(t){let e;const i=function(t){let e,n;for(const r in t){if(void 0!==t[r].commonLayerId){e=t[r].commonLayerId,n=t[r].commonFeatureId;break}{const o=i(t[r]._eventParents);e=o.commonLayerId,n=o.commonFeatureId}}return{commonLayerId:e,commonFeatureId:n}};return e=void 0===t.commonLayerId?i(t._eventParents):{commonLayerId:t.commonLayerId,commonFeatureId:t.commonFeatureId}}_initScale(){this._scale&&this._scale>0&&this.minScale>0&&this.maxScale>0&&this._scale<this.minScale&&this._scale>this.maxScale&&this.setScale()}_getZoomByScale(t){let e=void 0;if(this.crs&&this.crs.options&&this.crs.options.lods){let i=-1;for(let n=0;n<this.crs.options.lods.length;n++){const r=this.crs.options.lods[n],o=this.crs.options.lods[n-1];if(r.scale<=0)break;if(i<0&&(i=n),n===i){if(r.scale>0&&t>=r.scale){e=r.level;break}}else{if(t>=r.scale&&t<=o.scale&&o.scale!==r.scale){e=r.level-(t-r.scale)/(o.scale-r.scale);break}if(n===this.crs.options.lods.length-1&&r.scale>0&&t<=r.scale){e=r.level;break}}}}return e}_getScaleExtent(t){return this._getScaleDefaultExtent(t)}_getScaleDefaultExtent(t){const e=this.getSize(),i=e.x/96*.0254*t,r=e.y/96*.0254*t,o=Math.sqrt(i*i+r*r),s=180/Math.PI*Math.atan2(i,r),a=this._center.coordinates,l=(t,e,i)=>{t=n.T.point(t);return n.T.destination(t,e,i,{units:"kilometers"}).geometry.coordinates},h=l(a,o/2e3,-s),u=l(a,o/2e3,180-s);return new n.Extent({xmin:h[0],xmax:u[0],ymin:u[1],ymax:h[1]})}getScale(){const t=this._getScaleByZoom(this._zoom);return this._scale=t,t}_getScaleByZoom(t){let e;if(this.crs&&this.crs.options&&this.crs.options.lods&&!Object(n.isNull)(t))if(t%1==0){const i=this.crs.options.lods[t];e=i?i.scale:void 0}else{const i=Math.floor(t),n=Math.ceil(t),r=this.crs.options.lods[i],o=this.crs.options.lods[n];e=void 0===r&&void 0===o?0:void 0===r?o.scale:void 0===o?r.scale:r.scale-(r.scale-o.scale)*(t-i)}return e}_getScaleByExtent(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=this._getLatLngFromExtent(t),a=n.T.point([s.southWestLatlng.lng,s.southWestLatlng.lat]),l=n.T.point([s.northEastLatlng.lng,s.northEastLatlng.lat]),h=1e3*n.T.distance(a,l,{units:"kilometers"})/o;return this._scale=h,h}_isEqualBounds(t,e){return t.equals(e)}setScale(t){if(!this._innerView)return;const e=this._getZoomByScale(t);e&&this.flyTo({center:this._center,zoom:e})}getExtentScale(t){const e=this.getSize(),i=e.x/96*.0254,r=e.y/96*.0254,o=Math.sqrt(i*i+r*r),s=n.T.point([t.xmin,t.ymax]),a=n.T.point([t.xmax,t.ymin]),l=1e3*n.T.distance(s,a,{units:"kilometers"})/o;return this._scale=l,l}getResolutionByScale(t){return this._resolution=.0254/96*t,this._resolution}getResolution(){const t=this.getSize(),e=Math.sqrt(t.x*t.x+t.y*t.y),i=this._innerView.getBounds(),r=n.T.point([i._southWest.lng,i._southWest.lat]),o=n.T.point([i._northEast.lng,i._northEast.lat]),s=n.T.distance(r,o,{units:"kilometers"});return this._resolution=1e3*s/e,this._resolution}_moveLayerView(t,e){if(this._isImageLayerView(t)||this._isVectorTileLayerView(t)){const t=this.allLayerViews.toArray();for(let e=0;e<t.length;e++){const i=t[e];(this._isImageLayerView(i)||this._isVectorTileLayerView(i))&&i.innerLayer&&i.innerLayer.setZIndex&&i.innerLayer.setZIndex(e)}}else t instanceof ue&&t._updateGraphicsInOrder()}_createLayerViewObj(t){let e=null;return t&&t.autoAddTo2D&&(e=ii(this,t)),e}_isEqualCrs(t,e){let i=!1;if(!t||!e)return i;let r=void 0;t.code.split(":").length>1&&(r=t.code.split(":")[1]);const o=new n.SpatialReference({wkid:r,wkt:t.def});let s=void 0;e.code.split(":").length>1&&(s=e.code.split(":")[1]);const a=new n.SpatialReference({wkid:s,wkt:e.def});return o.equals(a)&&e.options&&t.options&&Object(n.compareObject)(e.options.lods,t.options.lods)&&Object(n.compareObject)(e.options.origin,t.options.origin)&&Object(n.compareObject)(e.options.bounds,t.options.bounds)&&(i=!0),i}_getValidGoToParams(t,e){let i,r,o;if(Object(n.isNull)(t.center)&&Object(n.isNull)(t.zoom)&&Object(n.isNull)(t.scale)||(i=Object(n.isNull)(t.center)?this._center:this._getFlyToCenter({center:t.center}),r=!Object(n.isNull)(t.scale)&&t.scale>0?this._getZoomByScale(t.scale):Object(n.isNull)(t.zoom)?this._zoom:t.zoom),!Object(n.isNull)(t.target)||!Object(n.isNull)(t.layer)&&!Object(n.isNull)(t.layer.extent))if(t.layer&&n.LayerType.isTileLayer(t.layer.type)&&!Object(n.defined)(i)&&!Object(n.defined)(r)&&"fix-level"===t.goToLayerMode){const e=t.layer.type===n.LayerType.wmts?t.layer.getCurrentTileInfo():t.layer.tileInfo,o=Object(n.getTileLayerNearestCenterAndScale)(e,t.layer.extent,this.width,this.height);i=this._getFlyToCenter({center:o.center}),r=this._getZoomByScale(o.scale)}else{const e=this._getTargetExtent(t.target||t.layer.extent);e.xmin!==e.xmax&&e.ymin!==e.ymax?o=e:i=this._getFlyToCenter({center:new n.Point({coordinates:[e.xmin,e.ymin]})})}return{center:i,zoom:r,extent:o}}}ni.fromJSON=function(t){return t=Object(n.defaultValue)(t,{}),new ni(t)},Object.defineProperties(ni.prototype,{scale:{get(){return this.getScale()},set(t){this.setScale(t)}},zoom:{get(){return this.getZoom()},set(t){this.setZoom(t)}},extent:{get(){return this.getExtent()},set(t){this.setExtent(t)}},center:{get(){return this.getCenter()},set(t){this.setCenter(t)}},spatialReference:{get(){return this._spatialReference},set(){}},rotation:{get(){return this._rotation},set(t){this._rotation=t,this._innerView&&this._innerView.setBearing(t)}}});var ri=ni;var oi=class extends n.Evented{constructor(t){super();const e=Object(n.defaultValue)(t,{});if(this._id=Object(n.defaultValue)(e.id,Object(n.getGUID)()),this._container=this._createContainer(e.container),this._visible=Object(n.defaultValue)(e.visible,!0),this._view=Object(n.defaultValue)(e.view,null),!this._view)throw new Error("视图不存在!")}_addView(){}_removeView(){}destroy(){}_createContainer(t){let e=t;return"string"==typeof e&&(e=document.getElementById(e)),t instanceof HTMLElement?e:e=document.createElement("div")}};var si=class extends oi{constructor(t){super(t),t=Object(n.defaultValue)(t,{}),this.drawConfig=Object(n.defaultValue)(t.drawConfig,{polygon:{allowIntersection:!1,showArea:!0},circlemarker:!1}),this._complete=Object(n.defaultValue)(t.complete,function(){}),this._drawHandler=null,this._drawTool=null,this._initHandler(),this._initStyles()}_initHandler(){const t=this._view.getInnerView();this._processEvent=this._processEvent.bind(this),t&&t.on(L.Draw.Event.CREATED,this._processEvent)}_initStyles(){this.styles={circle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},marker:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},polygon:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},polyline:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},rectangle:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0}}}_removeHandler(){const t=this._view.getInnerView();t&&t.off(L.Draw.Event.CREATED,this._processEvent)}_processEvent(t){if(t&&t.layer){let e,i;const r=t.layer.toGeoJSON();switch(e=r.geometry.type){case"LineString":i=new n.Feature({geometry:new n.LineString({coordinates:r.geometry.coordinates})});break;case"Polygon":i=new n.Feature({geometry:new n.Polygon({coordinates:r.geometry.coordinates})});break;case"Point":let o;o=t.layer._mRadius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._mRadius}):t.layer._radius?new n.Circle({center:[r.geometry.coordinates[0],r.geometry.coordinates[1]],radius:t.layer._radius}):new n.Point({coordinates:r.geometry.coordinates}),i=new n.Feature({geometry:o})}this._complete(e,i)}}_addView(){super._addView();const t=this._view.getInnerView();if(t&&this._visible){const e=L.featureGroup().addTo(t);this._drawTool=new L.Control.Draw({edit:{featureGroup:e,poly:{allowIntersection:!1}},draw:this.drawConfig}),t.addControl(this._drawTool)}}_removeView(){super._removeView();const t=this._view.getInnerView();t&&this._visible&&(this._removeHandler(),this._drawTool&&(t.removeControl(this._drawTool),this._print=null))}start(t,e){const i=this._view.getInnerView();if(i)switch(this._drawHandler&&this._drawHandler.disable(),t){case"lineString":this._drawHandler=new L.Draw.Polyline(i,{...this.styles.polyline,...e}),this._drawHandler.enable();break;case"polygon":this._drawHandler=new L.Draw.Polygon(i,{...this.styles.polygon,...e}),this._drawHandler.enable();break;case"rectangle":this._drawHandler=new L.Draw.Rectangle(i,{...this.styles.rectangle,...e}),this._drawHandler.enable();break;case"marker":this._drawHandler=new L.Draw.Marker(i,{...this.styles.marker,...e}),this._drawHandler.enable();break;case"circle":this._drawHandler=new L.Draw.Circle(i,{...this.styles.circle,...e}),this._drawHandler.enable()}}end(){this._drawHandler&&(this._drawHandler.disable(),this._drawHandler=null)}destory(){}};var ai=class extends n.SketchEditor{constructor(t){super(t),this._hitTestSketchHandlers=[]}start(t,e){super.start(t,e)}startCustomDrawTool(t){super.startCustomDrawTool(t)}stop(){super.stop()}remove(){super.remove()}update(t,e){super.updateFeature(t,e)}addVertex(t,e){super.addVertex(t,e)}updateVertex(t,e){super.updateVertex(t,e)}removeVertex(t){super.removeVertex(t)}getSketchDataType(){super.getSketchDataType()}setSketchStyle(t){super.setSketchStyle(t)}getSketchStyle(){return super.getSketchStyle()}getGeometry(){return super.getGeometry()}union(t){return super.union(t)}split(t,e){return super.split(t,e)}drawPolylineToPolygon(t){super.drawPolylineToPolygon(t)}undo(){return super.undo()}redo(){return super.redo()}canUndo(){return super.canUndo()}canRedo(){return super.canRedo()}_hitTestSketchEvent(){const t=this,e=e=>{if(!e||!e.x||!e.y)return;if(t._drawTool&&t._drawTool._editMode===n.SketchEditMode.drawing)return;const i=t._getGraphicsLayer(t._layer),r=t._getGraphicsLayer(t._sketchInnerLayer);if(!i&&!r)return;let o=void 0;const s=this.view.hitTest({x:e.x,y:e.y});if(s&&Array.isArray(s)&&(o=s[0]),o&&(i&&i.id===o.layer.id||r&&r.id===o.layer.id)){const i=this._getCurDrawTool(o.layer.id,o.graphic.id);if(!i||i===t._drawTool&&"drawn"!==i.state)return;if(0===i.editOption._hitTestMode){const r=()=>{if(t._editable&&(void 0===t._drawTool||null===t._drawTool||3!==t._drawTool._editMode)){if(!Object(n.isNull)(i)&&Object(n.isNull)(i._parent)&&i._editMode===n.SketchEditMode.none){t.fire("selected",{isSelected:!0,selectedDrawTool:t._drawTool,selectedGeometry:t._drawTool.sketchStage.entityGraphic.geometry},t);const e=new n.SketchEditorEvent({type:n.SketchEditorEventType.update,target:t,toolEventInfo:null,state:n.SketchEditorState.start,feature:t._drawTool.sketchStage.entityGraphic,geometry:t._drawTool.sketchStage.entityGraphic.geometry});t.fire(n.SketchEditorEventType.update,e)}i._isAddTip&&i._updateTipText(Object(n.getTipTextByEditOption)("edit-graphic",i._tipText,i._editOption),i._sketchInnerLayer,e),i.hitTestFeature(i.sketchStage.entityGraphic,e),t.view.off(n.ViewEventType.mouseUp,r)}};t.view.on(n.ViewEventType.mouseUp,r)}else{if(!t._editable)return;if(void 0!==t._drawTool&&null!==t._drawTool&&3===t._drawTool._editMode)return;i.hitTestFeature(i.sketchStage.entityGraphic,e)}}};this._hitTestSketchHandler||(this.view.on(n.ViewEventType.mouseDown,e),this._hitTestSketchHandler=e)}_getCurDrawTool(t,e){const i=this;let r=i._drawTool?i._drawTool._getDrawToolByFeatureId(e):void 0;if(!r&&(!i._drawTool||i._drawTool.sketchStage.entityGraphic&&"drawn"===i._drawTool.state)){const o=i.view.getLayer(t).graphics.filter(t=>t.id===e),s=o&&o.items.length>0?o.items[0]:void 0;s&&(i._drawTool&&(i._drawTool._clearEditGraphics(i._drawTool._editMode),i._drawTool.fire("selected",{isSelected:!1},i),i._drawTool.view.off(n.ViewEventType.immediateClick,i._drawTool._mapClickEvent),i._drawTool._fireRemoveSelectEvent(i._drawTool.sketchStage.entityGraphic)),this._addFeatureToSketchEditor(s),i._undoRedoManager.reset(),i._drawTools=[i._drawTool],r=i._drawTool)}return r}_removeHitTestSketchEvent(){this.view.off(n.ViewEventType.mouseDown,this._hitTestSketchHandler)}_getCenterCoordinate(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}},li=function(t,e,i){if(t=t||{},e)for(var n in e){var r=!1;if(i&&i.length)for(var o=0,s=i.length;o<s;o++)if(n===i[o]){r=!0;break}if(!0!==r){var a=e[n];void 0!==a&&"CLASS_NAME"!==n&&"function"!=typeof a&&(t[n]=a)}}return t},hi=function(t,e){if(t=t||{},e){for(var i in e){var n=e[i];void 0!==n&&(t[i]=n)}!("function"==typeof window.Event&&e instanceof window.Event)&&e.hasOwnProperty&&e.hasOwnProperty("toString")&&(t.toString=e.toString)}return t},ui=function(...t){class e{constructor(e){for(var i=0;i<t.length;i++)r(this,new t[i](e))}}for(var i=0;i<t.length;i++){var n=t[i];r(e,n),r(e.prototype,n.prototype),r(e.prototype,new n)}return e;function r(t,e){var i=Object.getOwnPropertyNames(e);Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n++){var r=i[n];if("constructor"!==r&&"prototype"!==r&&"name"!==r&&"length"!==r){let i=Object.getOwnPropertyDescriptor(e,r);window.ActiveXObject?Object.defineProperty(t,r,i||{}):Object.defineProperty(t,r,i)}}}},ci=function(t,e){if(null==t)return-1;if("function"==typeof t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},pi=function(){for(var t="",e=1;e<=32;e++){t+=Math.floor(16*Math.random()).toString(16),8!=e&&12!=e&&16!=e&&20!=e||(t+="-")}return t},fi=function(t,e,i){for(var n in e)mergeItem(t,e,n,i);return t},di=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return(e=new Date).setTime(t.getTime()),e;if(t instanceof Array)return e=t.slice(0);if(t instanceof Object){var e={};for(var i in t)t.hasOwnProperty(i)&&(e[i]=di(t[i]));return e}throw new Error("Unable to copy obj! Its type isn't supported.")};class gi{constructor(){this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=!0,this.hoverable=!0,this.style=null,this.highlightStyle={},this.CLASS_NAME="Zondy.Feature.ShapeParameters"}destroy(){this.refOriginalPosition=null,this.refDataID=null,this.isHoverByRefDataID=null,this.refDataHoverGroup=null,this.dataInfo=null,this.clickable=null,this.hoverable=null,this.style=null,this.highlightStyle=null}}class yi extends gi{constructor(t,e){super(t,e),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=6,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Point"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class mi extends gi{constructor(t){super(t),this.pointList=t,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Line"}destroy(){this.pointList=null,super.destroy()}}class _i extends gi{constructor(t){super(t),this.pointList=t,this.holePolygonPointLists=null,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Polygon"}destroy(){this.pointList=null,this.holePolygonPointLists=null,super.destroy()}}class vi extends gi{constructor(t,e,i,n){super(t,e,i,n),this.x=isNaN(t)?0:t,this.y=isNaN(t)?0:e,this.width=isNaN(i)?0:i,this.height=isNaN(n)?0:n,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Rectangle"}destroy(){this.x=null,this.y=null,this.width=null,this.height=null,super.destroy()}}class xi extends gi{constructor(t,e,i,n,r,o,s){super(t,e,i,n,r,o,s),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.startAngle=isNaN(n)?0:n,this.endAngle=isNaN(r)?0:r,this.r0=isNaN(o)?0:o,this.clockWise=s,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Sector"}destroy(){this.x=null,this.y=null,this.r=null,this.startAngle=null,this.endAngle=null,this.r0=null,this.clockWise=null,super.destroy()}}class bi extends gi{constructor(t,e,i){super(t,e,i),this.x=t,this.y=e,this.text=i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Label"}destroy(){this.x=null,this.y=null,this.text=null,super.destroy()}}class wi extends gi{constructor(t,e,i,n,r,o,s,a,l){super(t,e,i,n,r,o,s,a,l),this.x=t,this.y=e,this.image=i,this.width=n,this.height=r,this.sx=o,this.sy=s,this.sWidth=a,this.sHeight=l,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Image"}destroy(){this.x=null,this.y=null,this.image=null,this.width=null,this.height=null,this.sx=null,this.sy=null,this.sWidth=null,this.sHeight=null,super.destroy()}}class Si extends gi{constructor(t,e,i){super(t,e,i),this.x=isNaN(t)?0:t,this.y=isNaN(e)?0:e,this.r=isNaN(i)?0:i,this.CLASS_NAME="Zondy.Feature.ShapeParameters.Circle"}destroy(){this.x=null,this.y=null,this.r=null,super.destroy()}}class Ei{constructor(){this._handlers={},this.CLASS_NAME="Zondy.LevelRenderer.Eventful"}destroy(){this._handlers=null}one(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!0,ctx:i||this}),this):this}bind(t,e,i){var n=this._handlers;return e&&t?(n[t]||(n[t]=[]),n[t].push({h:e,one:!1,ctx:i||this}),this):this}unbind(t,e){var i=this._handlers;if(!t)return this._handlers={},this;if(e){if(i[t]){for(var n=[],r=0,o=i[t].length;r<o;r++)i[t][r].h!==e&&n.push(i[t][r]);i[t]=n}i[t]&&0===i[t].length&&delete i[t]}else delete i[t];return this}dispatch(t){if(this._handlers[t]){var e=arguments,i=e.length;i>3&&(e=Array.prototype.slice.call(e,1));for(var n=this._handlers[t],r=n.length,o=0;o<r;){switch(i){case 1:n[o].h.call(n[o].ctx);break;case 2:n[o].h.call(n[o].ctx,e[1]);break;case 3:n[o].h.call(n[o].ctx,e[1],e[2]);break;default:n[o].h.apply(n[o].ctx,e)}n[o].one?(n.splice(o,1),r--):o++}}return this}dispatchWithContext(t){if(this._handlers[t]){var e=arguments,i=e.length;i>4&&(e=Array.prototype.slice.call(e,1,e.length-1));for(var n=e[e.length-1],r=this._handlers[t],o=r.length,s=0;s<o;){switch(i){case 1:r[s].h.call(n);break;case 2:r[s].h.call(n,e[1]);break;case 3:r[s].h.call(n,e[1],e[2]);break;default:r[s].h.apply(n,e)}r[s].one?(r.splice(s,1),o--):s++}}return this}}class Li{constructor(){this.BUILTIN_OBJECT={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},this._ctx=null,this._canvas=null,this._pixelCtx=null,this._width=null,this._height=null,this._offsetX=0,this._offsetY=0,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Util"}clone(t){var e=this.BUILTIN_OBJECT;if("object"==typeof t&&null!==t){var i=t;if(t instanceof Array){i=[];for(var n=0,r=t.length;n<r;n++)i[n]=this.clone(t[n])}else if(!e[Object.prototype.toString.call(t)])for(var o in i={},t)t.hasOwnProperty(o)&&(i[o]=this.clone(t[o]));return i}return t}mergeItem(t,e,i,n){var r=this.BUILTIN_OBJECT;e.hasOwnProperty(i)&&("object"!=typeof t[i]||r[Object.prototype.toString.call(t[i])]?!n&&i in t||(t[i]=e[i]):this.merge(t[i],e[i],n))}merge(t,e,i){for(var n in e)this.mergeItem(t,e,n,i);return t}getContext(){return this._ctx||(this._ctx=document.createElement("canvas").getContext("2d")),this._ctx}getPixelContext(){return this._pixelCtx||(this._canvas=document.createElement("canvas"),this._width=this._canvas.width,this._height=this._canvas.height,this._pixelCtx=this._canvas.getContext("2d")),this._pixelCtx}adjustCanvasSize(t,e){var i,n=this._canvas,r=this._pixelCtx,o=this._width,s=this._height,a=this._offsetX,l=this._offsetY;t+a>o&&(o=t+a+100,n.width=o,i=!0),e+l>s&&(s=e+l+100,n.height=s,i=!0),t<-a&&(o+=a=100*Math.ceil(-t/100),n.width=o,i=!0),e<-l&&(s+=l=100*Math.ceil(-e/100),n.height=s,i=!0),i&&r.translate(a,l)}getPixelOffset(){return{x:this._offsetX,y:this._offsetY}}indexOf(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}inherits(t,e){var i=t.prototype;function n(){}for(var r in n.prototype=e.prototype,t.prototype=new n,i)t.prototype[r]=i[r];t.constructor=t}}class Ci{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Vector"}create(t,e){var i=new(0,this.ArrayCtor)(2);return i[0]=t||0,i[1]=e||0,i}copy(t,e){return t[0]=e[0],t[1]=e[1],t}set(t,e,i){return t[0]=e,t[1]=i,t}add(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}scaleAndAdd(t,e,i,n){return t[0]=e[0]+i[0]*n,t[1]=e[1]+i[1]*n,t}sub(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}len(t){return Math.sqrt(this.lenSquare(t))}lenSquare(t){return t[0]*t[0]+t[1]*t[1]}mul(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}div(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}dot(t,e){return t[0]*e[0]+t[1]*e[1]}scale(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}normalize(t,e){var i=this.len(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}distance(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}distanceSquare(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}negate(t,e){return t[0]=-e[0],t[1]=-e[1],t}lerp(t,e,i,n){return t[0]=e[0]+n*(i[0]-e[0]),t[1]=e[1]+n*(i[1]-e[1]),t}applyTransform(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}min(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}max(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}length(t){return this.len(t)}lengthSquare(t){return this.lenSquare(t)}dist(t,e){return this.distance(t,e)}distSquare(t,e){return this.distanceSquare(t,e)}}class Pi{constructor(){this.vector=new Ci,this.EPSILON=1e-4,this.THREE_SQRT=Math.sqrt(3),this.ONE_THIRD=1/3,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Curve"}isAroundZero(t){return t>-this.EPSILON&&t<this.EPSILON}isNotAroundZero(t){return t>this.EPSILON||t<-this.EPSILON}cubicAt(t,e,i,n,r){var o=1-r;return o*o*(o*t+3*r*e)+r*r*(r*n+3*o*i)}cubicDerivativeAt(t,e,i,n,r){var o=1-r;return 3*(((e-t)*o+2*(i-e)*r)*o+(n-i)*r*r)}cubicRootAt(t,e,i,n,r,o){var s=n+3*(e-i)-t,a=3*(i-2*e+t),l=3*(e-t),h=t-r,u=a*a-3*s*l,c=a*l-9*s*h,p=l*l-3*a*h,f=0;if(this.isAroundZero(u)&&this.isAroundZero(c))if(this.isAroundZero(a))o[0]=0;else{let t=-l/a;t>=0&&t<=1&&(o[f++]=t)}else{var d=c*c-4*u*p;if(this.isAroundZero(d)){var g=c/u;let t=-a/s+g,e=-g/2;t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e)}else if(d>0){let t=Math.sqrt(d),e=u*a+1.5*s*(-c+t),i=u*a+1.5*s*(-c-t),n=(-a-((e=e<0?-Math.pow(-e,this.ONE_THIRD):Math.pow(e,this.ONE_THIRD))+(i=i<0?-Math.pow(-i,this.ONE_THIRD):Math.pow(i,this.ONE_THIRD))))/(3*s);n>=0&&n<=1&&(o[f++]=n)}else{var y=(2*u*a-3*s*c)/(2*Math.sqrt(u*u*u)),m=Math.acos(y)/3,_=Math.sqrt(u),v=Math.cos(m);let t=(-a-2*_*v)/(3*s),e=(-a+_*(v+this.THREE_SQRT*Math.sin(m)))/(3*s),i=(-a+_*(v-this.THREE_SQRT*Math.sin(m)))/(3*s);t>=0&&t<=1&&(o[f++]=t),e>=0&&e<=1&&(o[f++]=e),i>=0&&i<=1&&(o[f++]=i)}}return f}cubicExtrema(t,e,i,n,r){var o=6*i-12*e+6*t,s=9*e+3*n-3*t-9*i,a=3*e-3*t,l=0;if(this.isAroundZero(s)){if(this.isNotAroundZero(o)){let t=-a/o;t>=0&&t<=1&&(r[l++]=t)}}else{var h=o*o-4*s*a;if(this.isAroundZero(h))r[0]=-o/(2*s);else if(h>0){let t=Math.sqrt(h),e=(-o+t)/(2*s),i=(-o-t)/(2*s);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}cubicSubdivide(t,e,i,n,r,o){var s=(e-t)*r+t,a=(i-e)*r+e,l=(n-i)*r+i,h=(a-s)*r+s,u=(l-a)*r+a,c=(u-h)*r+h;o[0]=t,o[1]=s,o[2]=h,o[3]=c,o[4]=c,o[5]=u,o[6]=l,o[7]=n}cubicProjectPoint(t,e,i,n,r,o,s,a,l,h,u){var c,p=this.vector.create(),f=this.vector.create(),d=this.vector.create(),g=.005,y=1/0;p[0]=l,p[1]=h;for(let l=0;l<1;l+=.05){f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let h=this.vector.distSquare(p,f);h<y&&(c=l,y=h)}y=1/0;for(let l=0;l<32&&!(g<this.EPSILON);l++){let l=c-g,h=c+g;f[0]=this.cubicAt(t,i,r,s,l),f[1]=this.cubicAt(e,n,o,a,l);let u=this.vector.distSquare(f,p);if(l>=0&&u<y)c=l,y=u;else{d[0]=this.cubicAt(t,i,r,s,h),d[1]=this.cubicAt(e,n,o,a,h);let l=this.vector.distSquare(d,p);h<=1&&l<y?(c=h,y=l):g*=.5}}return u&&(u[0]=this.cubicAt(t,i,r,s,c),u[1]=this.cubicAt(e,n,o,a,c)),Math.sqrt(y)}quadraticAt(t,e,i,n){var r=1-n;return r*(r*t+2*n*e)+n*n*i}quadraticDerivativeAt(t,e,i,n){return 2*((1-n)*(e-t)+n*(i-e))}quadraticRootAt(t,e,i,n,r){var o=t-2*e+i,s=2*(e-t),a=t-n,l=0;if(this.isAroundZero(o)){if(this.isNotAroundZero(s)){var h=-a/s;h>=0&&h<=1&&(r[l++]=h)}}else{var u=s*s-4*o*a;if(this.isAroundZero(u)){let t=-s/(2*o);t>=0&&t<=1&&(r[l++]=t)}else if(u>0){let t=Math.sqrt(u),e=(-s+t)/(2*o),i=(-s-t)/(2*o);e>=0&&e<=1&&(r[l++]=e),i>=0&&i<=1&&(r[l++]=i)}}return l}quadraticExtremum(t,e,i){var n=t+i-2*e;return 0===n?.5:(t-e)/n}quadraticProjectPoint(t,e,i,n,r,o,s,a,l){var h,u=this.vector.create(),c=this.vector.create(),p=this.vector.create(),f=.005,d=1/0;u[0]=s,u[1]=a;for(let s=0;s<1;s+=.05){c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let a=this.vector.distSquare(u,c);a<d&&(h=s,d=a)}d=1/0;for(let s=0;s<32&&!(f<this.EPSILON);s++){let s=h-f,a=h+f;c[0]=this.quadraticAt(t,i,r,s),c[1]=this.quadraticAt(e,n,o,s);let l=this.vector.distSquare(c,u);if(s>=0&&l<d)h=s,d=l;else{p[0]=this.quadraticAt(t,i,r,a),p[1]=this.quadraticAt(e,n,o,a);let s=this.vector.distSquare(p,u);a<=1&&s<d?(h=a,d=s):f*=.5}}return l&&(l[0]=this.quadraticAt(t,i,r,h),l[1]=this.quadraticAt(e,n,o,h)),Math.sqrt(d)}}class Ii{constructor(){this.util=new Li,this._ctx=null,this.palette=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],this._palette=this.palette,this.highlightColor="rgba(0,0,255,1)",this._highlightColor=this.highlightColor,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"},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Color"}customPalette(t){this.palette=t}resetPalette(){this.palette=this._palette}getColor(t,e){return t|=0,(e=e||this.palette)[t%e.length]}customHighlight(t){this.highlightColor=t}resetHighlight(){this.highlightColor=this._highlightColor}getHighlightColor(){return this.highlightColor}getRadialGradient(t,e,i,n,r,o,s){var a=this.util;this._ctx||(this._ctx=a.getContext());for(var l=this._ctx.createRadialGradient(t,e,i,n,r,o),h=0,u=s.length;h<u;h++)l.addColorStop(s[h][0],s[h][1]);return l.__nonRecursion=!0,l}getLinearGradient(t,e,i,n,r){var o=this.util;this._ctx||(this._ctx=o.getContext());for(var s=this._ctx.createLinearGradient(t,e,i,n),a=0,l=r.length;a<l;a++)s.addColorStop(r[a][0],r[a][1]);return s.__nonRecursion=!0,s}getStepColors(t,e,i){t=this.toRGBA(t),e=this.toRGBA(e),t=this.getData(t);for(var n=[],r=((e=this.getData(e))[0]-t[0])/i,o=(e[1]-t[1])/i,s=(e[2]-t[2])/i,a=(e[3]-t[3])/i,l=0,h=t[0],u=t[1],c=t[2],p=t[3];l<i;l++)n[l]=this.toColor([this.adjust(Math.floor(h),[0,255]),this.adjust(Math.floor(u),[0,255]),this.adjust(Math.floor(c),[0,255]),p.toFixed(4)-0],"rgba"),h+=r,u+=o,c+=s,p+=a;return h=e[0],u=e[1],c=e[2],p=e[3],n[l]=this.toColor([h,u,c,p],"rgba"),n}getGradientColors(t,e){var i=[],n=t.length;if(void 0===e&&(e=20),1===n)i=this.getStepColors(t[0],t[0],e);else if(n>1)for(var r=0,o=n-1;r<o;r++){var s=this.getStepColors(t[r],t[r+1],e);r<o-1&&s.pop(),i=i.concat(s)}return i}toColor(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 i=this.map(t.slice(1,3),function(t){return t+"%"});t[1]=i[0],t[2]=i[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(",")+")"}}toArray(t){(t=this.trim(t)).indexOf("rgba")<0&&(t=this.toRGBA(t));var e=[],i=0;return t.replace(/[\d.]+/g,function(t){i<3?t|=0:t=+t,e[i++]=t}),e}convert(t,e){if(!this.isCalculableColor(t))return t;var i=this.getData(t),n=i[3];return void 0===n&&(n=1),t.indexOf("hsb")>-1?i=this._HSV_2_RGB(i):t.indexOf("hsl")>-1&&(i=this._HSL_2_RGB(i)),e.indexOf("hsb")>-1||e.indexOf("hsv")>-1?i=this._RGB_2_HSB(i):e.indexOf("hsl")>-1&&(i=this._RGB_2_HSL(i)),i[3]=n,this.toColor(i,e)}toRGBA(t){return this.convert(t,"rgba")}toRGB(t){return this.convert(t,"rgb")}toHex(t){return this.convert(t,"hex")}toHSVA(t){return this.convert(t,"hsva")}toHSV(t){return this.convert(t,"hsv")}toHSBA(t){return this.convert(t,"hsba")}toHSB(t){return this.convert(t,"hsb")}toHSLA(t){return this.convert(t,"hsla")}toHSL(t){return this.convert(t,"hsl")}toName(t){for(var e in this._nameColors)if(this.toHex(this._nameColors[e])===this.toHex(t))return e;return null}trim(t){return String(t).replace(/\s+/g,"")}normalize(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,i=(240&t)<<4,n=15&t;t="#"+((1<<24)+(e<<4)+e+(i<<4)+i+(n<<4)+n).toString(16).slice(1)}return t}lift(t,e){if(!this.isCalculableColor(t))return t;var i=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),r=0;r<3;r++)n[r]=1===i?n[r]*(1-e)|0:(255-n[r])*e+n[r]|0;return"rgb("+n.join(",")+")"}reverse(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")}mix(t,e,i){if(!this.isCalculableColor(t)||!this.isCalculableColor(e))return t;void 0===i&&(i=.5);for(var n=2*(i=1-this.adjust(i,[0,1]))-1,r=this.getData(this.toRGBA(t)),o=this.getData(this.toRGBA(e)),s=r[3]-o[3],a=((n*s==-1?n:(n+s)/(1+n*s))+1)/2,l=1-a,h=[],u=0;u<3;u++)h[u]=r[u]*a+o[u]*l;var c=r[3]*i+o[3]*(1-i);return c=Math.max(0,Math.min(1,c)),1===r[3]&&1===o[3]?this.toColor(h,"rgb"):(h[3]=c,this.toColor(h,"rgba"))}random(){return"#"+Math.random().toString(16).slice(2,8)}getData(t){var e,i,n=(t=this.normalize(t)).match(this.colorRegExp);if(null===n)throw new Error("The color format error");var r,o=[];if(n[2])r=[(e=n[2].replace("#","").split(""))[0]+e[1],e[2]+e[3],e[4]+e[5]],o=this.map(r,function(t){return Ii.prototype.adjust.call(this,parseInt(t,16),[0,255])});else if(n[4]){var s=n[4].split(",");i=s[3],r=s.slice(0,3),o=this.map(r,function(t){return t=Math.floor(t.indexOf("%")>0?2.55*parseInt(t,0):t),Ii.prototype.adjust.call(this,t,[0,255])}),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}else if(n[5]||n[6]){var a=(n[5]||n[6]).split(","),l=parseInt(a[0],0)/360,h=a[1],u=a[2];i=a[3],(o=this.map([h,u],function(t){return Ii.prototype.adjust.call(this,parseFloat(t)/100,[0,1])})).unshift(l),void 0!==i&&o.push(this.adjust(parseFloat(i),[0,1]))}return o}alpha(t,e){if(!this.isCalculableColor(t))return t;null===e&&(e=1);var i=this.getData(this.toRGBA(t));return i[3]=this.adjust(Number(e).toFixed(4),[0,1]),this.toColor(i,"rgba")}map(t,e){if("function"!=typeof e)throw new TypeError;for(var i=t?t.length:0,n=0;n<i;n++)t[n]=e(t[n]);return t}adjust(t,e){return t<=e[0]?t=e[0]:t>=e[1]&&(t=e[1]),t}isCalculableColor(t){return t instanceof Array||"string"==typeof t}_HSV_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a=6*r;6===a&&(a=0);var l=0|a,h=s*(1-o),u=s*(1-o*(a-l)),c=s*(1-o*(1-(a-l))),p=0,f=0,d=0;0===l?(p=s,f=c,d=h):1===l?(p=u,f=s,d=h):2===l?(p=h,f=s,d=c):3===l?(p=h,f=u,d=s):4===l?(p=c,f=h,d=s):(p=s,f=h,d=u),e=255*p,i=255*f,n=255*d}return[e,i,n]}_HSL_2_RGB(t){var e,i,n,r=t[0],o=t[1],s=t[2];if(0===o)e=255*s,i=255*s,n=255*s;else{var a,l=2*s-(a=s<.5?s*(1+o):s+o-o*s);e=255*this._HUE_2_RGB(l,a,r+1/3),i=255*this._HUE_2_RGB(l,a,r),n=255*this._HUE_2_RGB(l,a,r-1/3)}return[e,i,n]}_HUE_2_RGB(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?t+6*(e-t)*i:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}_RGB_2_HSB(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=a;if(0===l)e=0,i=0;else{i=l/a;var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}_RGB_2_HSL(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s,h=(a+s)/2;if(0===l)e=0,i=0;else{i=h<.5?l/(a+s):l/(2-a-s);var u=((a-n)/6+l/2)/l,c=((a-r)/6+l/2)/l,p=((a-o)/6+l/2)/l;n===a?e=p-c:r===a?e=1/3+u-p:o===a&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}return[e*=360,i*=100,h*=100]}}class Mi{static SUtil_smoothBezier(t,e,i,n,r){r&&2===r||(r=[0,0]);var o,s,a=r,l=[],h=[],u=[],c=[],p=!!n;if(p){o=[1/0,1/0],s=[-1/0,-1/0];let e=t.length;for(let i=0;i<e;i++)Mi.Util_vector.min(o,o,[t[i][0]+a[0],t[i][1]+a[1]]),Mi.Util_vector.max(s,s,[t[i][0]+a[0],t[i][1]+a[1]]);Mi.Util_vector.min(o,o,n[0]),Mi.Util_vector.max(s,s,n[1])}let f=t.length;for(let n=0;n<f;n++){let r,d,g=[t[n][0]+a[0],t[n][1]+a[1]];if(i)r=[t[n?n-1:f-1][0]+a[0],t[n?n-1:f-1][1]+a[1]],d=[t[(n+1)%f][0]+a[0],t[(n+1)%f][1]+a[1]];else{if(0===n||n===f-1){l.push([t[n][0]+a[0],t[n][1]+a[1]]);continue}r=[t[n-1][0]+a[0],t[n-1][1]+a[1]],d=[t[n+1][0]+a[0],t[n+1][1]+a[1]]}Mi.Util_vector.sub(h,d,r),Mi.Util_vector.scale(h,h,e);let y=Mi.Util_vector.distance(g,r),m=Mi.Util_vector.distance(g,d),_=y+m;0!==_&&(y/=_,m/=_),Mi.Util_vector.scale(u,h,-y),Mi.Util_vector.scale(c,h,m);let v=Mi.Util_vector.add([],g,u),x=Mi.Util_vector.add([],g,c);p&&(Mi.Util_vector.max(v,v,o),Mi.Util_vector.min(v,v,s),Mi.Util_vector.max(x,x,o),Mi.Util_vector.min(x,x,s)),l.push(v),l.push(x)}return i&&l.push(l.shift()),l}static SUtil_smoothSpline(t,e,i,n){n&&2===n||(n=[0,0]);var r=n,o=t.length,s=[],a=0;for(let e=1;e<o;e++)a+=Mi.Util_vector.distance([t[e-1][0]+r[0],t[e-1][1]+r[1]],[t[e][0]+r[0],t[e][1]+r[1]]);var l=a/5;l=l<o?o:l;for(let i=0;i<l;i++){let n,a,u,c=i/(l-1)*(e?o:o-1),p=Math.floor(c),f=c-p,d=[t[p%o][0]+r[0],t[p%o][1]+r[1]];e?(n=[t[(p-1+o)%o][0]+r[0],t[(p-1+o)%o][1]+r[1]],a=[t[(p+1)%o][0]+r[0],t[(p+1)%o][1]+r[1]],u=[t[(p+2)%o][0]+r[0],t[(p+2)%o][1]+r[1]]):(n=[t[0===p?p:p-1][0]+r[0],t[0===p?p:p-1][1]+r[1]],a=[t[p>o-2?o-1:p+1][0]+r[0],t[p>o-2?o-1:p+1][1]+r[1]],u=[t[p>o-3?o-1:p+2][0]+r[0],t[p>o-3?o-1:p+2][1]+r[1]]);let g=f*f,y=f*g;s.push([h(n[0],d[0],a[0],u[0],f,g,y),h(n[1],d[1],a[1],u[1],f,g,y)])}return s;function h(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}}static SUtil_dashedLineTo(t,e,i,n,r,o,s){var a=[5,5];if(o="number"!=typeof o?5:o,t.setLineDash)return a[0]=o,a[1]=o,s&&s instanceof Array?t.setLineDash(s):t.setLineDash(a),t.moveTo(e,i),void t.lineTo(n,r);var l=n-e,h=r-i,u=Math.floor(Math.sqrt(l*l+h*h)/o);l/=u,h/=u;for(var c=!0,p=0;p<u;++p)c?t.moveTo(e,i):t.lineTo(e,i),c=!c,e+=l,i+=h;t.lineTo(n,r)}}Mi.Util_area=new class{constructor(){this.util=new Li,this.curve=new Pi,this._ctx=null,this._textWidthCache={},this._textHeightCache={},this._textWidthCacheCounter=0,this._textHeightCacheCounter=0,this.TEXT_CACHE_MAX=5e3,this.PI2=2*Math.PI,this.roots=[-1,-1,-1],this.extrema=[-1,-1],this.CLASS_NAME="Zondy.LevelRenderer.Tool.Area"}normalizeRadian(t){return(t%=this.PI2)<0&&(t+=this.PI2),t}isInside(t,e,i,n){if(!e||!t)return!1;var r=t.type;this._ctx=this._ctx||this.util.getContext();var o=this._mathMethod(t,e,i,n);if(void 0!==o)return o;if(t.buildPath&&this._ctx.isPointInPath)return this._buildPathMethod(t,this._ctx,e,i,n);switch(r){case"ellipse":case"smicellipse":return!0;case"trochoid":var s="out"===e.location?e.r1+e.r2+e.d:e.r1-e.r2+e.d;return this.isInsideCircle(e,i,n,s);case"rose":return this.isInsideCircle(e,i,n,e.maxr);default:return!1}}_mathMethod(t,e,i,n){switch(t.type){case"bezier-curve":return void 0===e.cpX2?this.isInsideQuadraticStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.xEnd,e.yEnd,e.lineWidth,i,n):this.isInsideCubicStroke(e.xStart,e.yStart,e.cpX1,e.cpY1,e.cpX2,e.cpY2,e.xEnd,e.yEnd,e.lineWidth,i,n);case"line":return this.isInsideLine(e.xStart,e.yStart,e.xEnd,e.yEnd,e.lineWidth,i,n);case"broken-line":return this.isInsideBrokenLine(e.pointList,e.lineWidth,i,n);case"smicbroken-line":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideBrokenLine(e.pointList,e.lineWidth,r,o)}case"ring":return this.isInsideRing(e.x,e.y,e.r0,e.r,i,n);case"smicring":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRing(r,o,e.r0,e.r,i,n)}case"circle":return this.isInsideCircle(e.x,e.y,e.r,i,n);case"smicpoint":{let r=i,o=n;return t.refOriginalPosition&&(r=i-t.refOriginalPosition[0],o=n-t.refOriginalPosition[1]),this.isInsideCircle(e.x,e.y,e.r,r,o)}case"sector":{let t=e.startAngle*Math.PI/180,r=e.endAngle*Math.PI/180;return e.clockWise||(t=-t,r=-r),this.isInsideSector(e.x,e.y,e.r0,e.r,t,r,!e.clockWise,i,n)}case"smicsector":{let r=e.startAngle*Math.PI/180,o=e.endAngle*Math.PI/180;e.clockWise||(r=-r,o=-o);let s=e.x,a=e.y;return t.refOriginalPosition&&(s=e.x+t.refOriginalPosition[0],a=e.y+t.refOriginalPosition[1]),this.isInsideSector(s,a,e.r0,e.r,r,o,!e.clockWise,i,n)}case"path":return this.isInsidePath(e.pathArray,Math.max(e.lineWidth,5),e.brushType,i,n);case"polygon":case"star":case"smicstar":case"isogon":case"smicisogon":return this.isInsidePolygon(e.pointList,i,n);case"smicpolygon":{let u=i,c=n;if(t.refOriginalPosition&&(u=i-t.refOriginalPosition[0],c=n-t.refOriginalPosition[1]),t.holePolygonPointLists&&t.holePolygonPointLists.length>0){for(var r=this.isInsidePolygon(e.pointList,u,c),o=t.holePolygonPointLists,s=!1,a=0,l=o.length;a<l;a++){var h=o[a];!0===this.isInsidePolygon(h,u,c)&&(s=!0)}return!0===r&&!1===s}return this.isInsidePolygon(e.pointList,u,c)}case"text":var u=e.__rect||t.getRect(e);return this.isInsideRect(u.x,u.y,u.width,u.height,i,n);case"smictext":var c=t.getTextBackground(e);return this.isInsidePolygon(c,i,n);case"rectangle":case"image":return this.isInsideRect(e.x,e.y,e.width,e.height,i,n);case"smicimage":{let r=e.x,o=e.y;return t.refOriginalPosition&&(r=e.x+t.refOriginalPosition[0],o=e.y+t.refOriginalPosition[1]),this.isInsideRect(r,o,e.width,e.height,i,n)}}}_buildPathMethod(t,e,i,n,r){return e.beginPath(),t.buildPath(e,i),e.closePath(),e.isPointInPath(n,r)}isOutside(t,e,i,n){return!this.isInside(t,e,i,n)}isInsideLine(t,e,i,n,r,o,s){if(0===r)return!1;var a=Math.max(r,5),l=0;if(s>e+a&&s>n+a||s<e-a&&s<n-a||o>t+a&&o>i+a||o<t-a&&o<i-a)return!1;if(t===i)return Math.abs(o-t)<=a/2;var h=(l=(e-n)/(t-i))*o-s+(t*n-i*e)/(t-i);return h*h/(l*l+1)<=a/2*a/2}isInsideCubicStroke(t,e,i,n,r,o,s,a,l,h,u){if(0===l)return!1;var c=Math.max(l,5);return!(u>e+c&&u>n+c&&u>o+c&&u>a+c||u<e-c&&u<n-c&&u<o-c&&u<a-c||h>t+c&&h>i+c&&h>r+c&&h>s+c||h<t-c&&h<i-c&&h<r-c&&h<s-c)&&this.curve.cubicProjectPoint(t,e,i,n,r,o,s,a,h,u,null)<=c/2}isInsideQuadraticStroke(t,e,i,n,r,o,s,a,l){if(0===s)return!1;var h=Math.max(s,5);return!(l>e+h&&l>n+h&&l>o+h||l<e-h&&l<n-h&&l<o-h||a>t+h&&a>i+h&&a>r+h||a<t-h&&a<i-h&&a<r-h)&&this.curve.quadraticProjectPoint(t,e,i,n,r,o,a,l,null)<=h/2}isInsideArcStroke(t,e,i,n,r,o,s,a,l){var h=this.PI2;if(0===s)return!1;var u=Math.max(s,5);a-=t,l-=e;var c=Math.sqrt(a*a+l*l);if(c-u>i||c+u<i)return!1;if(Math.abs(n-r)>=h)return!0;if(o){var p=n;n=this.normalizeRadian(r),r=this.normalizeRadian(p)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var f=Math.atan2(l,a);return f<0&&(f+=h),f>=n&&f<=r||f+h>=n&&f+h<=r}isInsideBrokenLine(t,e,i,n){for(var r=Math.max(e,10),o=0,s=t.length-1;o<s;o++){var a=t[o][0],l=t[o][1],h=t[o+1][0],u=t[o+1][1];if(this.isInsideLine(a,l,h,u,r,i,n))return!0}return!1}isInsideRing(t,e,i,n,r,o){var s=(r-t)*(r-t)+(o-e)*(o-e);return s<n*n&&s>i*i}isInsideRect(t,e,i,n,r,o){return r>=t&&r<=t+i&&o>=e&&o<=e+n}isInsideCircle(t,e,i,n,r){return(n-t)*(n-t)+(r-e)*(r-e)<i*i}isInsideSector(t,e,i,n,r,o,s,a,l){return this.isInsideArcStroke(t,e,(i+n)/2,r,o,s,n-i,a,l)}isInsidePolygon(t,e,i){for(var n=t.length,r=0,o=0,s=n-1;o<n;o++){var a=t[s][0],l=t[s][1],h=t[o][0],u=t[o][1];r+=this.windingLine(a,l,h,u,e,i),s=o}return 0!==r}windingLine(t,e,i,n,r,o){return o>e&&o>n||o<e&&o<n?0:n==e?0:(o-e)/(n-e)*(i-t)+t>r?n<e?1:-1:0}swapExtrema(){var t=this.extrema[0];this.extrema[0]=this.extrema[1],this.extrema[1]=t}windingCubic(t,e,i,n,r,o,s,a,l,h){var u=this.curve,c=this.roots,p=this.extrema;if(h>e&&h>n&&h>o&&h>a||h<e&&h<n&&h<o&&h<a)return 0;var f=u.cubicRootAt(e,n,o,a,h,c);if(0===f)return 0;for(var d,g,y=0,m=-1,_=0;_<f;_++){var v=c[_];u.cubicAt(t,i,r,s,v)<l||(m<0&&(m=u.cubicExtrema(e,n,o,a,p),p[1]<p[0]&&m>1&&this.swapExtrema(),d=u.cubicAt(e,n,o,a,p[0]),m>1&&(g=u.cubicAt(e,n,o,a,p[1]))),2===m?v<p[0]?y+=d<e?1:-1:v<p[1]?y+=g<d?1:-1:y+=a<g?1:-1:v<p[0]?y+=d<e?1:-1:y+=a<d?1:-1)}return y}windingQuadratic(t,e,i,n,r,o,s,a){var l=this.curve,h=this.roots;if(a>e&&a>n&&a>o||a<e&&a<n&&a<o)return 0;var u=l.quadraticRootAt(e,n,o,a,h);if(0===u)return 0;var c=l.quadraticExtremum(e,n,o);if(c>=0&&c<=1){var p=0,f=l.quadraticAt(e,n,o,c);for(let n=0;n<u;n++)l.quadraticAt(t,i,r,h[n])>s||(h[n]<c?p+=f<e?1:-1:p+=o<f?1:-1);return p}return l.quadraticAt(t,i,r,h[0])>s?0:o<e?1:-1}windingArc(t,e,i,n,r,o,s,a){var l=this.roots,h=this.PI2;if((a-=e)>i||a<-i)return 0;let u=Math.sqrt(i*i-a*a);if(l[0]=-u,l[1]=u,Math.abs(n-r)>=h){n=0,r=h;var c=o?1:-1;return s>=l[0]+t&&s<=l[1]+t?c:0}if(o){let t=n;n=this.normalizeRadian(r),r=this.normalizeRadian(t)}else n=this.normalizeRadian(n),r=this.normalizeRadian(r);n>r&&(r+=h);var p=0;for(let e=0;e<2;e++){var f=l[e];if(f+t>s){let t=Math.atan2(a,f),e=o?1:-1;t<0&&(t=h+t),(t>=n&&t<=r||t+h>=n&&t+h<=r)&&(t>Math.PI/2&&t<1.5*Math.PI&&(e=-e),p+=e)}}return p}isInsidePath(t,e,i,n,r){for(var o=0,s=0,a=0,l=0,h=0,u=!0,c=!0,p="stroke"===(i=i||"fill")||"both"===i,f="fill"===i||"both"===i,d=0;d<t.length;d++){var g=t[d],y=g.points;if(u||"M"===g.command){if(d>0&&(f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o))return!0;l=y[y.length-2],h=y[y.length-1],u=!1,c&&"A"!==g.command&&(c=!1,s=l,a=h)}switch(g.command){case"M":s=y[0],a=y[1];break;case"L":if(p&&this.isInsideLine(s,a,y[0],y[1],e,n,r))return!0;f&&(o+=this.windingLine(s,a,y[0],y[1],n,r)),s=y[0],a=y[1];break;case"C":if(p&&this.isInsideCubicStroke(s,a,y[0],y[1],y[2],y[3],y[4],y[5],e,n,r))return!0;f&&(o+=this.windingCubic(s,a,y[0],y[1],y[2],y[3],y[4],y[5],n,r)),s=y[4],a=y[5];break;case"Q":if(p&&this.isInsideQuadraticStroke(s,a,y[0],y[1],y[2],y[3],e,n,r))return!0;f&&(o+=this.windingQuadratic(s,a,y[0],y[1],y[2],y[3],n,r)),s=y[2],a=y[3];break;case"A":var m=y[0],_=y[1],v=y[2],x=y[3],b=y[4],w=y[5],S=Math.cos(b)*v+m,E=Math.sin(b)*x+_;c?(c=!1,l=S,h=E):o+=this.windingLine(s,a,S,E);var L=(n-m)*x/v+m;if(p&&this.isInsideArcStroke(m,_,x,b,b+w,1-y[7],e,L,r))return!0;f&&(o+=this.windingArc(m,_,x,b,b+w,1-y[7],L,r)),s=Math.cos(b+w)*v+m,a=Math.sin(b+w)*x+_;break;case"z":if(p&&this.isInsideLine(s,a,l,h,e,n,r))return!0;u=!0}}return f&&(o+=this.windingLine(s,a,l,h,n,r)),0!==o}getTextWidth(t,e){var i=t+":"+e;if(this._textWidthCache[i])return this._textWidthCache[i];this._ctx=this._ctx||this.util.getContext(),this._ctx.save(),e&&(this._ctx.font=e);for(var n=0,r=0,o=(t=(t+"").split("\n")).length;r<o;r++)n=Math.max(this._ctx.measureText(t[r]).width,n);return this._ctx.restore(),this._textWidthCache[i]=n,++this._textWidthCacheCounter>this.TEXT_CACHE_MAX&&(this._textWidthCacheCounter=0,this._textWidthCache={}),n}getTextHeight(t,e){var i=t+":"+e;if(this._textHeightCache[i])return this._textHeightCache[i];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[i]=n,++this._textHeightCacheCounter>this.TEXT_CACHE_MAX&&(this._textHeightCacheCounter=0,this._textHeightCache={}),n}},Mi.Util_color=new Ii,Mi.Util_computeBoundingBox=new class{constructor(){3===arguments.length&&this.computeBoundingBox(arguments),this.CLASS_NAME="Zondy.LevelRenderer.Tool.ComputeBoundingBox"}computeBoundingBox(t,e,i){if(0!==t.length){for(var n=t[0][0],r=t[0][0],o=t[0][1],s=t[0][1],a=1;a<t.length;a++){var l=t[a];l[0]<n&&(n=l[0]),l[0]>r&&(r=l[0]),l[1]<o&&(o=l[1]),l[1]>s&&(s=l[1])}e[0]=n,e[1]=o,i[0]=r,i[1]=s}}cubeBezier(t,e,i,n,r,o){var s=new Pi,a=[];s.cubicExtrema(t[0],e[0],i[0],n[0],a);for(let r=0;r<a.length;r++)a[r]=s.cubicAt(t[0],e[0],i[0],n[0],a[r]);var l=[];s.cubicExtrema(t[1],e[1],i[1],n[1],l);for(let r=0;r<l.length;r++)l[r]=s.cubicAt(t[1],e[1],i[1],n[1],l[r]);a.push(t[0],n[0]),l.push(t[1],n[1]);var h=Math.min.apply(null,a),u=Math.max.apply(null,a),c=Math.min.apply(null,l),p=Math.max.apply(null,l);r[0]=h,r[1]=c,o[0]=u,o[1]=p}quadraticBezier(t,e,i,n,r){var o=new Pi,s=o.quadraticExtremum(t[0],e[0],i[0]),a=o.quadraticExtremum(t[1],e[1],i[1]),l=1-(s=Math.max(Math.min(s,1),0)),h=1-(a=Math.max(Math.min(a,1),0)),u=l*l*t[0]+2*l*s*e[0]+s*s*i[0],c=l*l*t[1]+2*l*s*e[1]+s*s*i[1],p=h*h*t[0]+2*h*a*e[0]+a*a*i[0],f=h*h*t[1]+2*h*a*e[1]+a*a*i[1];n[0]=Math.min(t[0],i[0],u,p),n[1]=Math.min(t[1],i[1],c,f),r[0]=Math.max(t[0],i[0],u,p),r[1]=Math.max(t[1],i[1],c,f)}arc(t,e,i,n,r,o,s,a){var l=new Ci,h=l.create(),u=l.create(),c=l.create();if(h[0]=Math.cos(n)*i+t,h[1]=Math.sin(n)*i+e,u[0]=Math.cos(r)*i+t,u[1]=Math.sin(r)*i+e,l.min(s,h,u),l.max(a,h,u),(n%=2*Math.PI)<0&&(n+=2*Math.PI),(r%=2*Math.PI)<0&&(r+=2*Math.PI),n>r&&!o?r+=2*Math.PI:n<r&&o&&(n+=2*Math.PI),o){var p=r;r=n,n=p}for(var f=0;f<r;f+=Math.PI/2)f>n&&(c[0]=Math.cos(f)*i+t,c[1]=Math.sin(f)*i+e,l.min(s,c,s),l.max(a,c,a))}},Mi.Util_curve=new Pi,Mi.Util_env=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Env";var t=this;return function(e){var i=t.os={},n=t.browser={},r=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),o=e.match(/(Android);?[\s\/]+([\d.]+)?/),s=e.match(/(iPad).*OS\s([\d_]+)/),a=e.match(/(iPod)(.*OS\s([\d_]+))?/),l=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),h=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),u=h&&e.match(/TouchPad/),c=e.match(/Kindle\/([\d.]+)/),p=e.match(/Silk\/([\d._]+)/),f=e.match(/(BlackBerry).*Version\/([\d.]+)/),d=e.match(/(BB10).*Version\/([\d.]+)/),g=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),y=e.match(/PlayBook/),m=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),_=e.match(/Firefox\/([\d.]+)/),v=e.match(/MSIE ([\d.]+)/),x=r&&e.match(/Mobile\//)&&!m,b=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!m;return(n.webkit=!!r)&&(n.version=r[1]),o&&(i.android=!0,i.version=o[2]),l&&!a&&(i.ios=i.iphone=!0,i.version=l[2].replace(/_/g,".")),s&&(i.ios=i.ipad=!0,i.version=s[2].replace(/_/g,".")),a&&(i.ios=i.ipod=!0,i.version=a[3]?a[3].replace(/_/g,"."):null),h&&(i.webos=!0,i.version=h[2]),u&&(i.touchpad=!0),f&&(i.blackberry=!0,i.version=f[2]),d&&(i.bb10=!0,i.version=d[2]),g&&(i.rimtabletos=!0,i.version=g[2]),y&&(n.playbook=!0),c&&(i.kindle=!0,i.version=c[1]),p&&(n.silk=!0,n.version=p[1]),!p&&i.android&&e.match(/Kindle Fire/)&&(n.silk=!0),m&&(n.chrome=!0,n.version=m[1]),_&&(n.firefox=!0,n.version=_[1]),v&&(n.ie=!0,n.version=v[1]),x&&(e.match(/Safari/)||i.ios)&&(n.safari=!0),b&&(n.webview=!0),v&&(n.ie=!0,n.version=v[1]),i.tablet=!!(s||y||o&&!e.match(/Mobile/)||_&&e.match(/Tablet/)||v&&!e.match(/Phone/)&&e.match(/Touch/)),i.phone=!(i.tablet||i.ipod||!(o||l||h||f||d||m&&e.match(/Android/)||m&&e.match(/CriOS\/([\d.]+)/)||_&&e.match(/Mobile/)||v&&e.match(/Touch/))),{browser:n,os:i,canvasSupported:!!document.createElement("canvas").getContext}}(navigator.userAgent)}destory(){return!0}},Mi.Util_event=new class{constructor(){this.stop="function"==typeof window.addEventListener?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0},this.CLASS_NAME="Zondy.LevelRenderer.Tool.Event"}getX(t){return void 0!==t.zrenderX&&t.zrenderX||void 0!==t.offsetX&&t.offsetX||void 0!==t.layerX&&t.layerX||void 0!==t.clientX&&t.clientX}getY(t){return void 0!==t.zrenderY&&t.zrenderY||void 0!==t.offsetY&&t.offsetY||void 0!==t.layerY&&t.layerY||void 0!==t.clientY&&t.clientY}getDelta(t){return void 0!==t.zrenderDelta&&t.zrenderDelta||void 0!==t.wheelDelta&&t.wheelDelta||void 0!==t.detail&&-t.detail}},Mi.Util_http=new class{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Tool.Http"}get(t,e,i){if("object"==typeof t){var n=t;t=n.url,e=n.onsuccess,i=n.onerror}var r=window.XMLHttpRequest?new XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP");r.open("GET",t,!0),r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||304===r.status?e&&e(r.responseText):i&&i(),r.onreadystatechange=new Function,r=null)},r.send(null)}},Mi.Util_math=new class{constructor(){this._radians=window.Math.PI/180,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Math"}sin(t,e){return window.Math.sin(e?t*this._radians:t)}cos(t,e){return window.Math.cos(e?t*this._radians:t)}degreeToRadian(t){return t*this._radians}radianToDegree(t){return t/this._radians}},Mi.Util_matrix=new class{constructor(){this.ArrayCtor="undefined"==typeof Float32Array?Array:Float32Array,this.CLASS_NAME="Zondy.LevelRenderer.Tool.Matrix"}create(){var t=new(0,this.ArrayCtor)(6);return this.identity(t),t}identity(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}copy(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}mul(t,e,i){return t[0]=e[0]*i[0]+e[2]*i[1],t[1]=e[1]*i[0]+e[3]*i[1],t[2]=e[0]*i[2]+e[2]*i[3],t[3]=e[1]*i[2]+e[3]*i[3],t[4]=e[0]*i[4]+e[2]*i[5]+e[4],t[5]=e[1]*i[4]+e[3]*i[5]+e[5],t}translate(t,e,i){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+i[0],t[5]=e[5]+i[1],t}rotate(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5],h=Math.sin(i),u=Math.cos(i);return t[0]=n*u+s*h,t[1]=-n*h+s*u,t[2]=r*u+a*h,t[3]=-r*h+u*a,t[4]=u*o+h*l,t[5]=u*l-h*o,t}scale(t,e,i){var n=i[0],r=i[1];return t[0]=e[0]*n,t[1]=e[1]*r,t[2]=e[2]*n,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*r,t}invert(t,e){var i=e[0],n=e[2],r=e[4],o=e[1],s=e[3],a=e[5],l=i*s-o*n;return l?(l=1/l,t[0]=s*l,t[1]=-o*l,t[2]=-n*l,t[3]=i*l,t[4]=(n*a-s*r)*l,t[5]=(o*r-i*a)*l,t):null}mulVector(t,e,i){var n=e[0],r=e[2],o=e[4],s=e[1],a=e[3],l=e[5];return t[0]=i[0]*n+i[1]*r+o,t[1]=i[0]*s+i[1]*a+l,t}},Mi.Util=new Li,Mi.Util_vector=new Ci;class Ti{constructor(){this.position=[0,0],this.rotation=[0,0,0],this.scale=[1,1,0,0],this.needLocalTransform=!1,this.needTransform=!1,this.CLASS_NAME="Zondy.LevelRenderer.Transformable",this.lookAt=function(){var t=Mi.Util_vector.create();return function(e){this.transform||(this.transform=Mi.Util_matrix.create());var i=this.transform;function n(t){return t>-5e-5&&t<5e-5}Mi.Util_vector.sub(t,e,this.position),n(t[0])&&n(t[1])||(Mi.Util_vector.normalize(t,t),i[2]=t[0]*this.scale[1],i[3]=t[1]*this.scale[1],i[0]=t[1]*this.scale[0],i[1]=-t[0]*this.scale[0],i[4]=this.position[0],i[5]=this.position[1],this.decomposeTransform())}}()}destroy(){this.position=null,this.rotation=null,this.scale=null,this.needLocalTransform=null,this.needTransform=null}updateNeedTransform(){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)}updateTransform(){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||Mi.Util_matrix.create();if(Mi.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;let n=i(t[0])||i(t[1]);n&&Mi.Util_matrix.translate(e,e,t),Mi.Util_matrix.scale(e,e,this.scale),n&&(t[0]=-t[0],t[1]=-t[1],Mi.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;let n=i(t[0])||i(t[1]);n&&Mi.Util_matrix.translate(e,e,t),Mi.Util_matrix.rotate(e,e,this.rotation[0]),n&&(t[0]=-t[0],t[1]=-t[1],Mi.Util_matrix.translate(e,e,t))}}else 0!==this.rotation&&Mi.Util_matrix.rotate(e,e,this.rotation);(i(this.position[0])||i(this.position[1]))&&Mi.Util_matrix.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?Mi.Util_matrix.mul(this.transform,this.parent.transform,this.transform):Mi.Util_matrix.copy(this.transform,this.parent.transform))}function i(t){return t>5e-5||t<-5e-5}}setTransform(t){if(this.needTransform){var e=this.transform;t.transform(e[0],e[1],e[2],e[3],e[4],e[5])}}decomposeTransform(){if(this.transform){var t=this.transform,e=t[0]*t[0]+t[1]*t[1],i=this.position,n=this.scale,r=this.rotation;s(e-1)&&(e=Math.sqrt(e));var o=t[2]*t[2]+t[3]*t[3];s(o-1)&&(o=Math.sqrt(o)),i[0]=t[4],i[1]=t[5],n[0]=e,n[1]=o,n[2]=n[3]=0,r[0]=Math.atan2(-t[1]/o,t[0]/e),r[1]=r[2]=0}function s(t){return t>5e-5||t<-5e-5}}}class Oi extends(ui(Ei,Ti)){constructor(t){super(t),t=t||{},this.id=null,this.style={},this.highlightStyle=null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],this.invisible=!1,this.ignore=!1,this.zlevel=0,this.draggable=!1,this.clickable=!1,this.hoverable=!0,this.z=0,this.refOriginalPosition=[0,0],this.refDataID=null,this.isHoverByRefDataID=!1,this.refDataHoverGroup=null,this.dataInfo=null,hi(this,t),this.id=this.id||pi(),this.CLASS_NAME="Zondy.LevelRenderer.Shape",this.getTansform=function(){var t=[];return function(e,i){var n=[e,i];return this.needTransform&&this.transform&&(Mi.Util_matrix.invert(t,this.transform),Mi.Util_matrix.mulVector(n,t,[e,i,1]),e===n[0]&&i===n[1]&&this.updateNeedTransform()),n}}()}destroy(){this.id=null,this.style=null,this.highlightStyle=null,this.parent=null,this.__dirty=null,this.__clipShapes=null,this.invisible=null,this.ignore=null,this.zlevel=null,this.draggable=null,this.clickable=null,this.hoverable=null,this.z=null,this.refOriginalPosition=null,this.refDataID=null,this.refDataHoverGroup=null,this.isHoverByRefDataID=null,this.dataInfo=null,super.destroy()}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),t.fill(),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}beforeBrush(t,e){var i=this.style;return this.brushTypeOnly&&(i.brushType=this.brushTypeOnly),e&&(i=this.getHighlightStyle(i,this.highlightStyle||{},this.brushTypeOnly)),"stroke"===this.brushTypeOnly&&(i.strokeColor=i.strokeColor||i.color),t.save(),this.doClip(t),this.setContext(t,i),this.setTransform(t),i}afterBrush(t){t.restore()}setContext(t,e){for(var i=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]],n=0,r=i.length;n<r;n++){var o=e[i[n][0]],s=i[n][1];void 0!==o&&(t[s]=o)}}doClip(t){var e=Mi.Util_matrix.create();if(this.__clipShapes)for(var i=0;i<this.__clipShapes.length;i++){var n=this.__clipShapes[i];if(n.needTransform){let i=n.transform;Mi.Util_matrix.invert(e,i),t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}if(t.beginPath(),n.buildPath(t,n.style),t.clip(),n.needTransform){let i=e;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}}}getHighlightStyle(t,e,i){var n={};for(let e in t)n[e]=t[e];var r=Mi.Util_color.getHighlightColor();"stroke"!==t.brushType?(n.strokeColor=r,n.lineWidth=t.lineWidth||1,n.brushType="both"):"stroke"!==i?(n.strokeColor=r,n.lineWidth=t.lineWidth||1):n.strokeColor=e.strokeColor||Mi.Util_color.mix(t.strokeColor,Mi.Util_color.toRGB(r));for(let t in e)void 0!==e[t]&&(n[t]=e[t]);return n}getHighlightZoom(){return"text"!==this.type?6:2}drift(t,e){this.position[0]+=t,this.position[1]+=e}buildPath(t,e){}getRect(t){}isCover(t,e){var i=this.getTansform(t,e);t=i[0],e=i[1];var n=this.style.__rect;return n||(n=this.style.__rect=this.getRect(this.style)),t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height&&Mi.Util_area.isInside(this,this.style,t,e)}drawText(t,e,i){if(void 0!==e.text&&!1!==e.text){var n=e.textColor||e.color||e.strokeColor;t.fillStyle=n;var r,o,s,a,l=10,h=e.textPosition||this.textPosition||"top",u=[];switch(u=this.refOriginalPosition&&2===this.refOriginalPosition.length?this.refOriginalPosition:[0,0],h){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var c=(i||e).__rect||this.getRect(i||e);switch(h){case"inside":s=c.x+c.width/2,a=c.y+c.height/2,r="center",o="middle","stroke"!==e.brushType&&n===e.color&&(t.fillStyle="#fff");break;case"left":s=c.x-l,a=c.y+c.height/2,r="end",o="middle";break;case"right":s=c.x+c.width+l,a=c.y+c.height/2,r="start",o="middle";break;case"top":s=c.x+c.width/2,a=c.y-l,r="center",o="bottom";break;case"bottom":s=c.x+c.width/2,a=c.y+c.height+l,r="center",o="top"}}break;case"start":case"end":var p=0,f=0,d=0,g=0;if(void 0!==e.pointList){var y=e.pointList;if(y.length<2)return;var m=y.length;switch(h){case"start":p=y[0][0]+u[0],f=y[1][0]+u[0],d=y[0][1]+u[1],g=y[1][1]+u[1];break;case"end":p=y[m-2][0]+u[0],f=y[m-1][0]+u[0],d=y[m-2][1]+u[1],g=y[m-1][1]+u[1]}}else p=e.xStart+u[0]||0,f=e.xEnd+u[0]||0,d=e.yStart+u[1]||0,g=e.yEnd+u[1]||0;switch(h){case"start":r=p<f?"end":"start",o=d<g?"bottom":"top",s=p,a=d;break;case"end":r=p<f?"start":"end",o=d<g?"top":"bottom",s=f,a=g}l-=4,p&&f&&p!==f?s-="end"===r?l:-l:r="center",d!==g?a-="bottom"===o?l:-l:o="middle";break;case"specific":s=e.textX||0,a=e.textY||0,r="start",o="middle"}e.labelXOffset&&!isNaN(e.labelXOffset)&&(s+=e.labelXOffset),e.labelYOffset&&!isNaN(e.labelYOffset)&&(a+=e.labelYOffset),null!=s&&null!=a&&Oi._fillText(t,e.text,s,a,e.textFont,e.textAlign||r,e.textBaseline||o)}}modSelf(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)}isSilent(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)}setCtxGlobalAlpha(t,e,i){t.globalAlpha="fill"===e?void 0===i.fillOpacity?void 0===i.opacity?1:i.opacity:i.fillOpacity:"stroke"===e?void 0===i.strokeOpacity?void 0===i.opacity?1:i.opacity:i.strokeOpacity:void 0===i.opacity?1:i.opacity}static _fillText(t,e,i,n,r,o,s){r&&(t.font=r),t.textAlign=o,t.textBaseline=s;var a=Oi._getTextRect(e,i,n,r,o,s);e=(e+"").split("\n");var l=Mi.Util_area.getTextHeight("ZH",r);switch(s){case"top":n=a.y;break;case"bottom":n=a.y+l;break;default:n=a.y+l/2}for(var h=0,u=e.length;h<u;h++)t.fillText(e[h],i,n),n+=l}static _getTextRect(t,e,i,n,r,o){var s=Mi.Util_area.getTextWidth(t,n),a=Mi.Util_area.getTextHeight("ZH",n);switch(t=(t+"").split("\n"),r){case"end":case"right":e-=s;break;case"center":e-=s/2}switch(o){case"top":break;case"bottom":i-=a*t.length;break;default:i-=a*t.length/2}return{x:e,y:i,width:s,height:a*t.length}}}class Ni extends Oi{constructor(t){super(t),this.type="smicpoint",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPoint"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;t.arc(e.x+i[0],e.y+i[1],e.r,0,2*Math.PI,!0)}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=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+i[0]-t.r-e/2),y:Math.round(t.y+i[1]-t.r-e/2),width:2*t.r+e,height:2*t.r+e},t.__rect)}}class Ai extends Oi{constructor(t){super(t),this.type="smictext",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicText"}destroy(){this.type=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=this.style;if(e&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),void 0!==n.text&&!1!==n.text){t.save(),this.doClip(t),this.setContext(t,n),this.setTransform(t),n.textFont&&(t.font=n.textFont),t.textAlign=n.textAlign||"start",t.textBaseline=n.textBaseline||"middle";var r,o=(n.text+"").split("\n"),s=Mi.Util_area.getTextHeight("ZH",n.textFont),a=this.getRectNoRotation(n),l=n.x+i[0];r="top"===n.textBaseline?a.y:"bottom"===n.textBaseline?a.y+s:a.y+s/2;for(var h=n.x+i[0],u=n.y+i[1],c=0,p=o.length;c<p;c++){switch(n.labelRect&&(t.fillRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.strokeColor,t.strokeRect(a.x-2,a.y,a.width+4,a.height),t.fillStyle=n.textColor),n.brushType){case"stroke":this.setCtxGlobalAlpha(t,"stroke",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*c,n.maxWidth):t.strokeText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.strokeText(o[c],l,r,n.maxWidth):t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n);break;case"both":n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*c),this.setCtxGlobalAlpha(t,"reset",n)):"bottom"===n.textBaseline?n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height),this.setCtxGlobalAlpha(t,"reset",n)):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],0,s*(c+1)-a.height/2-s/2),this.setCtxGlobalAlpha(t,"reset",n)),t.restore()):n.maxWidth?(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r,n.maxWidth),this.setCtxGlobalAlpha(t,"reset",n)):(this.setCtxGlobalAlpha(t,"fill",n),t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n),this.setCtxGlobalAlpha(t,"stroke",n),t.strokeText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n));break;default:this.setCtxGlobalAlpha(t,"fill",n),n.textRotation&&0!==n.textRotation?(t.save(),t.translate(h,u),t.rotate(n.textRotation*Math.PI/180),"top"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*c,n.maxWidth):t.fillText(o[c],0,s*c):"bottom"===n.textBaseline?n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height):n.maxWidth?t.fillText(o[c],0,s*(c+1)-a.height/2-s/2,n.maxWidth):t.fillText(o[c],0,s*(c+1)-a.height/2-s/2),t.restore()):n.maxWidth?t.fillText(o[c],l,r,n.maxWidth):t.fillText(o[c],l,r),this.setCtxGlobalAlpha(t,"reset",n)}r+=s}t.restore()}}getRect(t){if(t.__rect)return t.__rect;for(var e,i,n,r,o=this.getTextBackground(t,!0),s=0,a=o.length;s<a;s++){var l=o[s];0===s?(e=l[0],n=l[0],i=l[1],r=l[1]):(l[0]<e&&(e=l[0]),l[0]>n&&(n=l[0]),l[1]<i&&(i=l[1]),l[1]>r&&(r=l[1]))}return t.__rect={x:e,y:i,width:n-e,height:r-i},t.__rect}getRectNoRotation(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=Mi.Util_area.getTextHeight("ZH",t.textFont),r=Mi.Util_area.getTextWidth(t.text,t.textFont),o=Mi.Util_area.getTextHeight(t.text,t.textFont),s=t.x+i[0];"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2),e="top"===t.textBaseline?t.y+i[1]:"bottom"===t.textBaseline?t.y+i[1]-o:t.y+i[1]-o/2;var a,l=!1;if(t.maxWidth){var h=parseInt(t.maxWidth);h<r&&(a=r,l=!0,r=h),s=t.x+i[0],"end"===t.textAlign||"right"===t.textAlign?s-=r:"center"===t.textAlign&&(s-=r/2)}t.textFont&&(t.textFont.toLowerCase().indexOf("italic")>-1&&(r+=a&&!0===l?n/3*(r/a):n/3));return{x:s,y:e,width:r,height:o}}getTextBackground(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;if((!e||!1===e)&&t.__textBackground)return t.__textBackground;var n=this.getRectNoRotation(t),r=t.x+i[0],o=t.y+i[1],s=[];if(t.textRotation&&0!==t.textRotation){let e=t.textRotation,i=this.getRotatedLocation(n.x,n.y,r,o,e),a=this.getRotatedLocation(n.x+n.width,n.y,r,o,e),l=this.getRotatedLocation(n.x+n.width,n.y+n.height,r,o,e),h=this.getRotatedLocation(n.x,n.y+n.height,r,o,e);s.push(i),s.push(a),s.push(l),s.push(h)}else{let t=[n.x,n.y],e=[n.x+n.width,n.y],i=[n.x+n.width,n.y+n.height],r=[n.x,n.y+n.height];s.push(t),s.push(e),s.push(i),s.push(r)}return t.__textBackground=s,t.__textBackground}getRotatedLocation(t,e,i,n,r){var o,s,a=new Array;return e=-e,n=-n,r=-r,o=(t-i)*Math.cos(r/180*Math.PI)-(e-n)*Math.sin(r/180*Math.PI)+i,s=(t-i)*Math.sin(r/180*Math.PI)+(e-n)*Math.cos(r/180*Math.PI)+n,a[0]=o,a[1]=-s,a}}class Ri extends Oi{constructor(t){super(t),this.type="smiccircle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.SmicCircle"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1];return t.moveTo(n+e.r,r),t.arc(n,r,e.r,0,2*Math.PI,!0),!0}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=this.refOriginalPosition,n=t.x+i[0],r=t.y+i[1],o=t.r;return e="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(n-o-e/2),y:Math.round(r-o-e/2),width:2*o+e,height:2*o+e},t.__rect}}class ki extends Oi{constructor(t){super(t),this.type="smicpolygon",this.holePolygonPointLists=null,this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicPolygon"}destroy(){this.type=null,this.holePolygonPointLists=null,super.destroy()}brush(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.style;e&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),t.save(),this.setContext(t,i),this.setTransform(t);var n=!1;"fill"!==i.brushType&&"both"!==i.brushType&&void 0!==i.brushType||(t.beginPath(),"dashed"===i.lineType||"dotted"===i.lineType||"dot"===i.lineType||"dash"===i.lineType||"dashot"===i.lineType||"longdash"===i.lineType||"longdashdot"===i.lineType?this.buildPath(t,{lineType:"solid",lineWidth:i.lineWidth,pointList:i.pointList}):(this.buildPath(t,i),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",i),t.fill(),this.setCtxGlobalAlpha(t,"reset",i)),i.lineWidth>0&&("stroke"===i.brushType||"both"===i.brushType)&&(n||(t.beginPath(),this.buildPath(t,i)),this.setCtxGlobalAlpha(t,"stroke",i),t.stroke(),this.setCtxGlobalAlpha(t,"reset",i)),this.drawText(t,i,this.style);var r=di(i);if(r.pointList&&this.holePolygonPointLists&&this.holePolygonPointLists.length>0)for(var o=this.holePolygonPointLists,s=o.length,a=0;a<s;a++){var l=o[a];r.pointList=l,t.globalCompositeOperation="destination-out",n=!1,"fill"!==r.brushType&&"both"!==r.brushType&&void 0!==r.brushType||(t.beginPath(),"dashed"===r.lineType||"dotted"===r.lineType||"dot"===r.lineType||"dash"===r.lineType||"dashot"===r.lineType||"longdash"===r.lineType||"longdashdot"===r.lineType?this.buildPath(t,{lineType:"solid",lineWidth:r.lineWidth,pointList:r.pointList}):(this.buildPath(t,r),n=!0),t.closePath(),this.setCtxGlobalAlpha(t,"fill",r),t.fill(),this.setCtxGlobalAlpha(t,"reset",r)),r.lineWidth>0&&("stroke"===r.brushType||"both"===r.brushType)?(n||(t.beginPath(),this.buildPath(t,r)),t.globalCompositeOperation="source-over",this.setCtxGlobalAlpha(t,"stroke",r),t.stroke(),this.setCtxGlobalAlpha(t,"reset",r)):t.globalCompositeOperation="source-over"}t.restore()}buildPath(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 i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2))if(e.smooth&&"spline"!==e.smooth){var r,o,s,a=Mi.SUtil_smoothBezier(n,e.smooth,!0,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var l=n.length,h=0;h<l;h++)r=a[2*h],o=a[2*h+1],s=[n[(h+1)%l][0]+i[0],n[(h+1)%l][1]+i[1]],t.bezierCurveTo(r[0],r[1],o[0],o[1],s[0],s[1])}else if("spline"===e.smooth&&(n=Mi.SUtil_smoothSpline(n,!0,null,i)),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Mi.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a]);Mi.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let r=e._dashLength||(e.lineWidth||1)*("dashed"===e.lineType?5:1);e._dashLength=r;let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)Mi.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h]);Mi.SUtil_dashedLineTo(t,n[n.length-1][0]+i[0],n[n.length-1][1]+i[1],n[0][0]+i[0],n[0][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<n.length;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1]);t.lineTo(n[0][0]+i[0],n[0][1]+i[1])}}getRect(t,e){var i;if(e?i=e:(this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),i=this.refOriginalPosition),t.__rect)return t.__rect;for(var n,r=Number.MAX_VALUE,o=Number.MIN_VALUE,s=Number.MAX_VALUE,a=Number.MIN_VALUE,l=t.pointList,h=0,u=l.length;h<u;h++)l[h][0]+i[0]<r&&(r=l[h][0]+i[0]),l[h][0]+i[0]>o&&(o=l[h][0]+i[0]),l[h][1]+i[1]<s&&(s=l[h][1]+i[1]),l[h][1]+i[1]>a&&(a=l[h][1]+i[1]);return n="stroke"===t.brushType||"fill"===t.brushType?t.lineWidth||1:0,t.__rect={x:Math.round(r-n/2),y:Math.round(s-n/2),width:o-r+n,height:a-s+n},t.__rect}}class Di extends Oi{constructor(t){super(t),this.brushTypeOnly="stroke",this.textPosition="end",this.type="smicbroken-line",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicBrokenLine"}destroy(){this.brushTypeOnly=null,this.textPosition=null,this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.pointList;if(!(n.length<2)){var r=Math.min(e.pointList.length,Math.round(e.pointListLength||e.pointList.length));if(e.smooth&&"spline"!==e.smooth){var o,s,a,l=Mi.SUtil_smoothBezier(n,e.smooth,!1,e.smoothConstraint,i);t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=0;e<r-1;e++)o=l[2*e],s=l[2*e+1],a=[n[e+1][0]+i[0],n[e+1][1]+i[1]],t.bezierCurveTo(o[0],o[1],s[0],s[1],a[0],a[1])}else if("spline"===e.smooth&&(r=(n=Mi.SUtil_smoothSpline(n,null,null,i)).length),e.lineType&&"solid"!==e.lineType){if("dashed"===e.lineType||"dotted"===e.lineType||"dot"===e.lineType||"dash"===e.lineType||"longdash"===e.lineType){let o=e.lineWidth||1,s=o,a=o;"dashed"===e.lineType&&(s*=5,a*=5,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"dotted"===e.lineType&&e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o),"dot"===e.lineType&&(a*=4,e.lineCap&&"butt"!==e.lineCap&&(s=1,a+=o)),"dash"===e.lineType&&(s*=4,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),"longdash"===e.lineType&&(s*=8,a*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o)),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(var h=1;h<r;h++)Mi.SUtil_dashedLineTo(t,n[h-1][0]+i[0],n[h-1][1]+i[1],n[h][0]+i[0],n[h][1]+i[1],o,[s,a])}else if("dashot"===e.lineType||"longdashdot"===e.lineType){let o=e.lineWidth||1,s=o,a=o,l=o,h=o;"dashot"===e.lineType&&(s*=4,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),"longdashdot"===e.lineType&&(s*=8,a*=4,h*=4,e.lineCap&&"butt"!==e.lineCap&&(s-=o,a+=o,l=1,h+=o)),o=(e.lineWidth||1)*("dashed"===e.lineType?5:1),t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)Mi.SUtil_dashedLineTo(t,n[e-1][0]+i[0],n[e-1][1]+i[1],n[e][0]+i[0],n[e][1]+i[1],o,[s,a,l,h])}}else{t.moveTo(n[0][0]+i[0],n[0][1]+i[1]);for(let e=1;e<r;e++)t.lineTo(n[e][0]+i[0],n[e][1]+i[1])}}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return ki.prototype.getRect.apply(this,[t,e])}brush(t,e){var i=this.beforeBrush(t,e);switch(t.beginPath(),this.buildPath(t,i),i.brushType){case"both":this.setCtxGlobalAlpha(t,"fill",i),i.lineWidth>0&&(this.setCtxGlobalAlpha(t,"stroke",i),t.stroke()),this.setCtxGlobalAlpha(t,"reset",i);break;case"stroke":this.setCtxGlobalAlpha(t,"stroke",i),i.lineWidth>0&&t.stroke(),this.setCtxGlobalAlpha(t,"reset",i);break;default:this.setCtxGlobalAlpha(t,"fill",i),this.setCtxGlobalAlpha(t,"reset",i)}this.drawText(t,i,this.style),this.afterBrush(t)}}class zi extends Oi{constructor(t){super(t),this.type="smicimage",this._imageCache={},this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicImage"}destroy(){this.type=null,this._imageCache=null,super.destroy()}brush(t,e,i){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var n=this.refOriginalPosition,r=this.style||{};e&&(r=this.getHighlightStyle(r,this.highlightStyle||{}));var o=r.image,s=this;if("string"==typeof o){var a=o;this._imageCache[a]?o=this._imageCache[a]:((o=new Image).onload=function(){o.onload=null,clearTimeout(zi._refreshTimeout),zi._needsRefresh.push(s),zi._refreshTimeout=setTimeout(function(){i&&i(zi._needsRefresh),zi._needsRefresh=[]},10)},o.src=a,this._imageCache[a]=o)}if(o){if("IMG"===o.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!==o.readyState)return}else if(!o.complete)return;var l=r.width||o.width,h=r.height||o.height,u=r.x+n[0],c=r.y+n[1];if(!o.width||!o.height)return;if(t.save(),this.doClip(t),this.setContext(t,r),this.setTransform(t),r.sWidth&&r.sHeight){let e=r.sx+n[0]||0,i=r.sy+n[1]||0;t.drawImage(o,e,i,r.sWidth,r.sHeight,u,c,l,h)}else if(r.sx&&r.sy){let e=r.sx+n[0],i=r.sy+n[1];var p=l-e,f=h-i;t.drawImage(o,e,i,p,f,u,c,l,h)}else t.drawImage(o,u,c,l,h);r.width||(r.width=l),r.height||(r.height=h),this.style.width||(this.style.width=l),this.style.height||(this.style.height=h),this.drawText(t,r,this.style),t.restore()}}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition;return{x:t.x+e[0],y:t.y+e[1],width:t.width,height:t.height}}clearCache(){this._imageCache={}}}zi._needsRefresh=[],zi._refreshTimeout=null;class Vi extends Oi{constructor(t){super(t),this.type="smicrectangle",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicRectangle"}destroy(){this.type=null,super.destroy()}_buildRadiusPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i,n,r,o,s,a=this.refOriginalPosition,l=e.x+a[0],h=e.y+a[1],u=e.width,c=e.height,p=e.radius;"number"==typeof p?i=n=r=o=p:p instanceof Array?1===p.length?i=n=r=o=p[0]:2===p.length?(i=r=p[0],n=o=p[1]):3===p.length?(i=p[0],n=o=p[1],r=p[2]):(i=p[0],n=p[1],r=p[2],o=p[3]):i=n=r=o=0,i+n>u&&(i*=u/(s=i+n),n*=u/s),r+o>u&&(r*=u/(s=r+o),o*=u/s),n+r>c&&(n*=c/(s=n+r),r*=c/s),i+o>c&&(i*=c/(s=i+o),o*=c/s),t.moveTo(l+i,h),t.lineTo(l+u-n,h),0!==n&&t.quadraticCurveTo(l+u,h,l+u,h+n),t.lineTo(l+u,h+c-r),0!==r&&t.quadraticCurveTo(l+u,h+c,l+u-r,h+c),t.lineTo(l+o,h+c),0!==o&&t.quadraticCurveTo(l,h+c,l,h+c-o),t.lineTo(l,h+i),0!==i&&t.quadraticCurveTo(l,h,l+i,h)}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition;e.radius?this._buildRadiusPath(t,e):(t.moveTo(e.x+i[0],e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]),t.lineTo(e.x+i[0]+e.width,e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1]+e.height),t.lineTo(e.x+i[0],e.y+i[1])),t.closePath()}getRect(t){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e,i=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+i[0]-e/2),y:Math.round(t.y+i[1]-e/2),width:t.width+e,height:t.height+e},t.__rect)}}class Fi extends Oi{constructor(t){super(t),this.type="smicsector",this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]),this.CLASS_NAME="Zondy.LevelRenderer.Shape.SmicSector"}destroy(){this.type=null,super.destroy()}buildPath(t,e){this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var i=this.refOriginalPosition,n=e.x+i[0],r=e.y+i[1],o=e.r0||0,s=e.r,a=e.startAngle,l=e.endAngle,h=e.clockWise||!1;a=Mi.Util_math.degreeToRadian(a),l=Mi.Util_math.degreeToRadian(l),h||(a=-a,l=-l);var u=Mi.Util_math.cos(a),c=Mi.Util_math.sin(a);t.moveTo(u*o+n,c*o+r),t.lineTo(u*s+n,c*s+r),t.arc(n,r,s,a,l,!h),t.lineTo(Mi.Util_math.cos(l)*o+n,Mi.Util_math.sin(l)*o+r),0!==o&&t.arc(n,r,o,l,a,h),t.closePath()}getRect(t){if(t.__rect)return t.__rect;this.refOriginalPosition&&2===this.refOriginalPosition.length||(this.refOriginalPosition=[0,0]);var e=this.refOriginalPosition,i=Mi.Util_vector.create(),n=Mi.Util_vector.create(),r=Mi.Util_vector.create(),o=Mi.Util_vector.create(),s=t.x+e[0],a=t.y+e[1],l=t.r0||0,h=t.r,u=Mi.Util_math.degreeToRadian(t.startAngle),c=Mi.Util_math.degreeToRadian(t.endAngle),p=t.clockWise;return p||(u=-u,c=-c),l>1?Mi.Util_computeBoundingBox.arc(s,a,l,u,c,!p,i,r):(i[0]=r[0]=s,i[1]=r[1]=a),Mi.Util_computeBoundingBox.arc(s,a,h,u,c,!p,n,o),Mi.Util_vector.min(i,i,n),Mi.Util_vector.max(r,r,o),t.__rect={x:i[0],y:i[1],width:r[0]-i[0],height:r[1]-i[1]},t.__rect}}class Bi{constructor(t){this.shapeParameters=t,this.CLASS_NAME="Zondy.Feature.ShapeFactory"}destroy(){this.shapeParameters=null}createShape(t){if(t&&(this.shapeParameters=t),!this.shapeParameters)return null;var e=this.shapeParameters;if(e instanceof yi){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t=li(t,e.style,["x","y"]);let i=new Ni;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","style","highlightStyle"]),i}if(e instanceof mi){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=li(t,e.style,["pointList"]);let i=new Di;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof _i){if(!e.pointList)return null;let t=new Object;t.pointList=e.pointList,t=li(t,e.style,["pointList"]);let i=new ki;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["pointList","style","highlightStyle"]),i}if(e instanceof vi){if(!e.x&&!e.y&!e.width&!e.height)return null;let t=new Object;t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t=li(t,e.style,["x","y","width","height"]);let i=new Vi;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","width","height","style","highlightStyle"]),i}if(e instanceof xi){let t=new Object;t.x=e.x,t.y=e.y,t.r=e.r,t.startAngle=e.startAngle,t.endAngle=e.endAngle,e.r0&&(t.r0=e.r0),e.clockWise&&(t.clockWise=e.clockWise),t=li(t,e.style,["x","y","r","startAngle","endAngle","r0","endAngle"]);let i=new Fi;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","r","startAngle","endAngle","r0","endAngle","style","highlightStyle"]),i}if(e instanceof bi){let t=new Object;t.x=e.x,t.y=e.y,t.text=e.text,t=li(t,e.style,["x","y","text"]);let i=new Ai;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","text","style","highlightStyle"]),i}if(e instanceof wi){let t=new Object;t.x=e.x,t.y=e.y,e.image&&(t.image=e.image),e.width&&(t.width=e.width),e.height&&(t.height=e.height),e.sx&&(t.sx=e.sx),e.sy&&(t.sy=e.sy),e.sWidth&&(t.sWidth=e.sWidth),e.sHeight&&(t.sHeight=e.sHeight),t=li(t,e.style,["x","y","image","width","height","sx","sy","sWidth","sHeight"]);let i=new zi;return i.style=Bi.transformStyle(t),i.highlightStyle=Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","image","width","height","style","highlightStyle"]),i}if(e instanceof Si){let t=new Object;t.x=e.x,t.r=e.r,t.y=e.y,t=li(t,e.style,["x","y","r"]);let i=new Ri;return i.style=new Bi.transformStyle(t),i.highlightStyle=new Bi.transformStyle(e.highlightStyle),li(i,e,["x","y","r","style","highlightStyle","lineWidth","text","textPosition"]),i}return null}static transformStyle(t){var e={},i=["normal","normal","normal","12","arial,sans-serif"],n=[!0,!1];for(var r in t)switch(r){case"fill":n[0]=t[r];break;case"fillColor":e.color=t[r];break;case"stroke":n[1]=t[r];break;case"strokeWidth":e.lineWidth=t[r];break;case"strokeLinecap":e.lineCap=t[r];break;case"strokeLineJoin":e.lineJoin=t[r];break;case"strokeDashstyle":e.lineType=t[r];break;case"pointRadius":e.r=t[r];break;case"label":e.text=t[r];break;case"labelRect":e.labelRect=t[r];break;case"fontColor":e.textColor=t[r];break;case"fontStyle":i[0]=t[r];break;case"fontVariant":i[1]=t[r];break;case"fontWeight":i[2]=t[r];break;case"fontSize":var o="";t[r]&&t[r].toString().indexOf("px")<0&&(o="px"),i[3]=t[r]+o;break;case"fontFamily":i[4]=t[r];break;case"fontOpacity":e.opacity=t[r];break;case"labelPosition":e.textPosition=t[r];break;case"labelAlign":e.textAlign=t[r];break;case"labelBaseline":e.textBaseline=t[r];break;case"labelRotation":e.textRotation=t[r];break;default:e[r]=t[r]}return e.textFont=i.join(" "),!0===n[0]&&!1===n[1]?e.brushType="fill":!1===n[0]&&!0===n[1]?e.brushType="stroke":!0===n[0]&&!0===n[1]?e.brushType="both":e.brushType="fill",null==e.lineWidth&&(e.lineWidth=1),e}static Background(t,e,i){var n=i||{},r=new vi(e[0],e[3],Math.abs(e[2]-e[0]),Math.abs(e[3]-e[1]));return r.style={fillColor:"#f3f3f3"},n.backgroundStyle&&li(r.style,n.backgroundStyle),n.backgroundRadius&&(r.style.radius=n.backgroundRadius),r.clickable=!1,r.hoverable=!1,t.createShape(r)}static GraphAxis(t,e,i,n){var r=e,o=i||{},s=[],a=[],l=!!o.useXReferenceLine&&o.useXReferenceLine,h=o.axisYTick&&!isNaN(o.axisYTick)?o.axisYTick:0,u=[],c=[];if(0===h){if(c.push([r[0],r[3]-5]),c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}else{var p=Math.abs(r[1]-r[3])/h,f=r[3];c.push([r[0],f-5]);for(var d=0;d<h;d++){if(c.push([r[0],f]),c.push([r[0]-5,f]),c.push([r[0],f]),l){var g=new mi([[r[0],f],[r[2],f]]);g.style={strokeColor:"#cfcfcf",strokeLinecap:"butt",strokeLineJoin:"round",strokeWidth:1},g.clickable=!1,g.hoverable=!1,o.xReferenceLineStyle&&li(g.style,o.xReferenceLineStyle),s.push(t.createShape(g))}f+=p}if(c.push([r[0],r[1]]),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){let t=parseInt(o.axis3DParameter),e=[r[0]-t,r[1]+t];o.axisUseArrow?(u.push([e[0]+1.5,e[1]-7.5]),u.push([e[0]-1,e[1]+1]),u.push([e[0]+7.5,e[1]-1.5]),c.push([e[0],e[1]])):c.push([e[0],e[1]]),c.push([r[0],r[1]])}c.push([r[2]+5,r[1]])}if(o.axisUseArrow){var y=[[r[2]+5,r[1]+4],[r[2]+13,r[1]],[r[2]+5,r[1]-4]],m=[[r[0]-4,r[3]-5],[r[0],r[3]-13],[r[0]+4,r[3]-5]],_=new _i(y);_.style={fillColor:"#008acd"},li(_.style,o.axisStyle),a.push(t.createShape(_));var v=new _i(m);if(v.style={fillColor:"#008acd"},li(v.style,o.axisStyle),a.push(t.createShape(v)),o.axis3DParameter&&!isNaN(o.axis3DParameter)&&o.axis3DParameter>=15){var x=new _i(u);x.style={fillColor:"#008acd"},li(x.style,o.axisStyle),a.push(t.createShape(x))}}var b=new mi(c);b.style={strokeLinecap:"butt",strokeLineJoin:"round",strokeColor:"#008acd",strokeWidth:1},o.axisStyle&&li(b.style,o.axisStyle),b.clickable=!1,b.hoverable=!1;var w=[t.createShape(b)],S=[];if(o.axisYLabels&&o.axisYLabels.length&&o.axisYLabels.length>0){var E=o.axisYLabels;let e=E.length;var L=[0,0];if(o.axisYLabelsOffset&&o.axisYLabelsOffset.length&&(L=o.axisYLabelsOffset),1===e){let e=new bi(r[0]-5+L[0],r[3]+L[1],E[0]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&li(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,S.push(t.createShape(e))}else for(var C=r[3],P=Math.abs(r[1]-r[3])/(e-1),I=0;I<e;I++){let e=new bi(r[0]-5+L[0],C+L[1],E[I]);e.style={labelAlign:"right"},o.axisYLabelsStyle&&li(e.style,o.axisYLabelsStyle),e.clickable=!1,e.hoverable=!1,S.push(t.createShape(e)),C+=P}}var M=[];if(o.axisXLabels&&o.axisXLabels.length&&o.axisXLabels.length>0){let e=o.axisXLabels,i=e.length,s=[0,0];if(o.axisXLabelsOffset&&o.axisXLabelsOffset.length&&(s=o.axisXLabelsOffset),n&&n.xPositions&&n.xPositions.length&&n.xPositions.length===i){let a=n.xPositions;for(let n=0;n<i;n++){let i=new bi(a[n]+s[0],r[1]+s[1],e[n]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&li(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}}else if(1===i){let i=new bi(r[0]-5+s[0],r[1]+s[0],e[0]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&li(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i))}else{let n=r[0],a=Math.abs(r[2]-r[0])/(i-1);for(let l=0;l<i;l++){let i=new bi(n+s[0],r[1]+s[1],e[l]);i.style={labelAlign:"center",labelBaseline:"top"},o.axisXLabelsStyle&&li(i.style,o.axisXLabelsStyle),i.clickable=!1,i.hoverable=!1,M.push(t.createShape(i)),n+=a}}}return s.concat(w).concat(S).concat(M).concat(a)}static ShapeStyleTool(t,e,i,n,r,o){var s=t||{};if(e&&li(s,e),i&&i.length&&void 0!==r&&!isNaN(r)&&r>=0&&i[r]&&li(s,i[r]),n&&n.length&&void 0!==o)for(var a=n,l=a.length,h=parseFloat(o),u=0;u<l;u++)if(a[u].start<=h&&h<a[u].end){li(s,a[u].style);break}return s}}class ji{constructor(t,e){t&&e&&e.map&&e.renderer&&(this.id=pi(),this.lonlat=null,this.location=[],this.data=t,this.shapes=[],this.layer=e,this.CLASS_NAME="Zondy.Feature.Theme")}destroy(){this.data=null,this.id=null,this.lonlat=null,this.location=null,this.shapes=null,this.layer=null}}class Gi extends ji{constructor(t,e,i,n,r,o){if(super(t,e,i,n,r,o),this.shapeFactory=new Bi,this.shapeParameters=null,this.RelativeCoordinate=!1,this.setting=null,this.origonPoint=null,this.chartBox=null,this.chartBounds=null,this.width=null,this.height=null,this.XOffset=0,this.YOffset=0,this.DVBParameter=null,this.dataViewBox=null,this.DVBCodomain=null,this.DVBCenterPoint=null,this.DVBUnitValue=null,this.DVBOrigonPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.origonPointOffset=null,this.fields=i||[],this.dataValues=null,r)this.lonlat=r;else if(o&&o.calGravity){let t;const e=this.data.geometry;switch(e.type){case"Point":t=e.clone();break;case"MultiPoint":case"LineString":case"MultiLineString":case"MultiPolygon":t=e.extent.center;break;case"Polygon":t=e.centroid;break;case"Extent":case"Circle":t=e.center;break;default:t=e.extent.center}const i=t.coordinates;this.lonlat=[i[0],i[1]]}else{const t=feature.geometry.extent.center.coordinates;this.lonlat=[t[0],t[1]]}n&&n.width&&n.height&&n.codomain&&(this.setting=n),this.CLASS_NAME="Zondy.Feature.Theme.Graph"}destroy(){this.shapeFactory=null,this.shapeParameters=null,this.width=null,this.height=null,this.origonPoint=null,this.chartBox=null,this.dataViewBox=null,this.chartBounds=null,this.DVBParameter=null,this.DVBOrigonPoint=null,this.DVBCenterPoint=null,this.DVBWidth=null,this.DVBHeight=null,this.DVBCodomain=null,this.DVBUnitValue=null,this.origonPointOffset=null,this.XOffset=null,this.YOffset=null,this.fields=null,this.dataValues=null,this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;if(!(t.width&&t.height&&t.codomain))return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=ji.getDataValues(this.data,this.fields,e);this.dataValues=i||[],this.width=parseFloat(t.width),this.height=parseFloat(t.height),this.DVBCodomain=t.codomain,this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var n=this.width,r=this.height,o=this.location;this.origonPoint=[o[0]-n/2,o[1]-r/2];var s=this.origonPoint;this.chartBox=[s[0],s[1]+r,s[0]+n,s[1]];var a=this.chartBox,l=this.DVBParameter;this.dataViewBox=[a[0]+l[0],a[1]-l[1],a[2]-l[2],a[3]+l[3]];var h=this.dataViewBox;return!(h[0]>=h[2]||h[1]<=h[3])&&(this.DVBOrigonPoint=[h[0],h[3]],this.DVBWidth=Math.abs(h[2]-h[0]),this.DVBHeight=Math.abs(h[1]-h[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-s[0],this.DVBOrigonPoint[1]-s[1]],!0)}resetLocation(t){t&&(this.lonlat=t);var e=this.getLocalXY(this.lonlat);e[0]+=this.XOffset,e[1]+=this.YOffset,this.location=e;var i=this.width,n=this.height,r=this.location;return this.chartBounds=[r[0]-i/2,r[1]-n/2,r[0]+i/2,r[1]+n/2],this.chartBounds.xmin=r[0]-i/2,this.chartBounds.ymin=r[1]-n/2,this.chartBounds.xmax=r[0]+i/2,this.chartBounds.ymax=r[1]+n/2,this.resetLinearGradient(),r}resetLinearGradient(){}shapesConvertToRelativeCoordinate(){for(var t=this.shapes,e=this.location,i=0,n=t.length;i<n;i++){t[i].refOriginalPosition=e;var r=t[i].style;for(var o in r)switch(o){case"pointList":for(var s=r[o],a=0,l=s.length;a<l;a++)s[a][0]-=e[0],s[a][1]-=e[1];break;case"x":r[o]-=e[0];break;case"y":r[o]-=e[1]}}this.RelativeCoordinate=!0}assembleShapes(){}getLocalXY(t){return this.layer.getLocalXY(t)}getCenterOfGravityPoint(t){var e=[],i=0,n=0,r=0;if(t.ftype===Zondy.Enum.FeatureType.Reg)for(var o=t.fGeom.RegGeom,s=0;s<o.length;s++){var a=o[s];if(null!=a&&null!=a.Rings)for(var l=a.Rings,h=0;h<l.length;h++){var u=l[h];if(null!=u&&null!=u.Arcs)for(var c=u.Arcs,p=0;p<c.length;p++){var f=c[p];if(null!=f&&null!=f.Dots)for(var d=f.Dots,g=0;g<d.length;g++)e.push(d[g])}}}for(h=1;h<=e.length;h++){var y=e[h%e.length].x,m=e[h%e.length].y,_=e[h-1].x,v=e[h-1].y,x=(y*v-m*_)/2;i+=x,n+=x*(y+_)/3,r+=x*(m+v)/3}return[n/=i,r/=i]}}ji.getDataValues=function(t,e,i){if(!t.attributes)return!1;for(var n=[],r=t.attributes,o=0;o<e.length;o++)for(var s in r)if(s===e[o]&&null!==r[s]&&void 0!==r[s])try{!isNaN(i)&&i>=0?n.push(parseFloat(r[s].toString()).toFixed(i)):n.push(parseFloat(r[s].toString()))}catch(t){throw new Error("not a number")}return n.length===e.length&&n};class Ui extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.setting=null,n&&n.codomain&&(this.setting=n,this.DVBCodomain=this.setting.codomain),this.CLASS_NAME="Zondy.Theme.RankSymbol"}destroy(){this.setting=null,super.destroy()}initBaseParameter(){if(!this.setting)return!1;var t=this.setting;t.XOffset&&(this.XOffset=t.XOffset),t.YOffset&&(this.YOffset=t.YOffset),this.XOffset=t.XOffset?t.XOffset:0,this.YOffset=t.YOffset?t.YOffset:0,this.origonPoint=[],this.chartBox=[],this.dataViewBox=[],this.DVBParameter=t.dataViewBoxParameter?t.dataViewBoxParameter:[0,0,0,0],this.DVBOrigonPoint=[],this.DVBCenterPoint=[],this.origonPointOffset=[],this.resetLocation();var e=this.width,i=this.height,n=this.location;this.origonPoint=[n[0]-e/2,n[1]-i/2];var r=this.origonPoint;this.chartBox=[r[0],r[1]+i,r[0]+e,r[1]];var o=this.chartBox,s=this.DVBParameter;this.dataViewBox=[o[0]+s[0],o[1]-s[1],o[2]-s[2],o[3]+s[3]];var a=this.dataViewBox;return!(a[0]>=a[2]||a[1]<=a[3])&&(this.DVBOrigonPoint=[a[0],a[3]],this.DVBWidth=Math.abs(a[2]-a[0]),this.DVBHeight=Math.abs(a[1]-a[3]),this.DVBCenterPoint=[this.DVBOrigonPoint[0]+this.DVBWidth/2,this.DVBOrigonPoint[1]+this.DVBHeight/2],this.origonPointOffset=[this.DVBOrigonPoint[0]-r[0],this.DVBOrigonPoint[1]-r[1]],!0)}}class qi extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Point"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues,o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Bi.GraphAxis(this.shapeFactory,e,t,o));for(var h=0,u=r.length;h<u;h++){if(r[h]<i[0]||r[h]>i[1])return null;s=l[h],a=e[1]-(r[h]-i[0])/n;var c=new yi(s,a);c.style=Bi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,h,r[h]),c.highlightStyle=Bi.ShapeStyleTool(null,t.pointHoverStyle),void 0!==t.pointHoverAble&&(c.hoverable=t.pointHoverAble),void 0!==t.pointClickAble&&(c.clickable=t.pointClickAble),c.refDataID=this.data.id,c.dataInfo={field:this.fields[h],value:r[h]},this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}}class Hi extends ji{constructor(t,e,i,n,r){if(super(t,e),t.fGeom){this.dataBounds=t.bound,this.nodesClipPixel=2,this.isHoverAble=!0,this.isMultiHover=!0,this.isClickAble=!0,this.highlightStyle=null,this.shapeOptions={},this.style=i||{},this.CLASS_NAME="Zondy.Theme.ThemeVector",this.style=i||{},n&&li(this,n,["shapeOptions","dataBounds"]),r&&li(this.shapeOptions,r);t.fGeom;switch(this.lonlat=[(this.dataBounds.xmin+this.dataBounds.xmax)/2,(this.dataBounds.ymin+this.dataBounds.ymax)/2],this.location=this.getLocalXY(this.lonlat),t.ftype){case 0:break;case 1:this.pointsToTF(t.fGeom.PntGeom);break;case 2:this.linesToTF(t.fGeom.LinGeom);break;case 3:this.regsToTF(t.fGeom.RegGeom)}}}destroy(){this.style=null,this.dataBounds=null,this.nodesClipPixel=null,this.isHoverAble=null,this.isMultiHover=null,this.isClickAble=null,this.highlightStyle=null,this.shapeOptions=null,super.destroy()}pointsToTF(t){if(!(null==t||t.length<=0)){t.components;for(var e=[],i=[],n=this.location,r=[],o=this.nodesClipPixel,s=0;s<t.length;s++){var a=t[s];if(i=[],e=this.getLocalXY([a.Dot.x,a.Dot.y]),i[0]=e[0]-n[0],i[1]=e[1]-n[1],r.length>0){var l=r[r.length-1];if(Math.abs(l[0]-i[0])<=o&&Math.abs(l[1]-i[1])<=o)continue}r.push(i);var h=new Object;h.r=6,(h=li(h,this.style)).x=i[0],h.y=i[1];var u=new Ni({style:h,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(u.highlightStyle=this.highlightStyle),u.refOriginalPosition=n,u.refDataID=this.data.id,u.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&li(u,this.shapeOptions),this.shapes.push(u)}}}linesToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.lineToTF(t[e])}lineToTF(t){var e=[];if(null!=t.Line&&null!=t.Line.Arcs&&t.Line.Arcs.length>0)for(var i=t.Line.Arcs,n=0;n<i.length;n++)for(var r=i[n].Dots,o=0;o<r.length;o++)e.push([r[o].x,r[o].y]);if(!(e.length<=0)){var s=[],a=[],l=this.location,h=[],u=this.nodesClipPixel;for(n=0;n<e.length;n++){var c=e[n];if(a=[],s=this.getLocalXY(c),a[0]=s[0]-l[0],a[1]=s[1]-l[1],h.length>0){var p=h[h.length-1];if(Math.abs(p[0]-a[0])<=u&&Math.abs(p[1]-a[1])<=u)continue}h.push(a)}if(h.length<2)return null;var f=new Object;(f=li(f,this.style,["pointList"])).pointList=h;var d=new Di({style:f,clickable:this.isClickAble,hoverable:this.isHoverAble});this.highlightStyle&&(d.highlightStyle=this.highlightStyle),d.refOriginalPosition=this.location,d.refDataID=this.data.id,d.isHoverByRefDataID=this.isMultiHover,this.shapeOptions&&li(d,this.shapeOptions),this.shapes.push(d)}}regsToTF(t){if(!(null==t||t.length<=0))for(var e=0;e<t.length;e++)this.regToTF(t[e])}regToTF(t){var e=t.Rings;if(!(null==e||e.length<=0)){for(var i=[],n=[],r=this.location,o=[],s=[],a=[],l=this.nodesClipPixel,h=0;h<e.length;h++){if(0===h){if(o=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(var u=e[h].Arcs,c=0;c<u.length;c++)for(var p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],o.length>0){var d=o[o.length-1];if(Math.abs(d[0]-n[0])<=l&&Math.abs(d[1]-n[1])<=l)continue}o.push(n)}}else if(s=[],null!=e[h]&&null!=e[h].Arcs&&e[h].Arcs.length>0)for(u=e[h].Arcs,c=0;c<u.length;c++)for(p=u[c].Dots,f=0;f<p.length;f++){if(n=[],i=this.getLocalXY([p[f].x,p[f].y]),n[0]=i[0]-r[0],n[1]=i[1]-r[1],s.length>0){var g=s[s.length-1];if(Math.abs(g[0]-n[0])<=l&&Math.abs(g[1]-n[1])<=l)continue}s.push(n)}s.length<2||a.push(s)}if(!(o.length<2)){var y={};(y=li(y,this.style,["pointList"])).pointList=o;var m=new ki({style:y,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,a.length>0&&(m.holePolygonPointLists=a),this.shapeOptions&&li(m,this.shapeOptions),this.shapes.push(m)}}}updateAndAddShapes(){var t=this.getLocalXY(this.lonlat);this.location=t;for(var e=this.layer.renderer,i=0,n=this.shapes.length;i<n;i++){var r=this.shapes[i];r.refOriginalPosition=t,e.addShape(r)}}getShapesCount(){return this.shapes.length}getLocalXY(t){return this.layer.getLocalXY(t)}}class Zi extends(ui(Ei,Ti)){constructor(t){super(t),t=t||{},this.id=null,this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,this.ignore=!1,hi(this,t),this.id=this.id||pi(),this.CLASS_NAME="Zondy.LevelRenderer.Group"}destroy(){this.id=null,this.type=null,this.clipShape=null,this._children=null,this._storage=null,this.__dirty=null,this.ignore=null,super.destroy()}children(){return this._children.slice()}childAt(t){return this._children[t]}addChild(t){t!==this&&t.parent!==this&&(t.parent&&t.parent.removeChild(t),this._children.push(t),t.parent=this,this._storage&&this._storage!==t._storage&&(this._storage.addToMap(t),t instanceof Zi&&t.addChildrenToStorage(this._storage)))}removeChild(t){var e=ci(this._children,t);this._children.splice(e,1),t.parent=null,this._storage&&(this._storage.delFromMap(t.id),t instanceof Zi&&t.delChildrenFromStorage(this._storage))}eachChild(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r)}}traverse(t,e){for(var i=!!e,n=0;n<this._children.length;n++){var r=this._children[n];i?t.call(e,r):t(r),"group"===r.type&&r.traverse(t,e)}}addChildrenToStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.addToMap(i),"group"===i.type&&i.addChildrenToStorage(t)}}delChildrenFromStorage(t){for(var e=0;e<this._children.length;e++){var i=this._children[e];t.delFromMap(i.id),"group"===i.type&&i.delChildrenFromStorage(t)}}modSelf(){this.__dirty=!0}}class Xi{constructor(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0,this.CLASS_NAME="Zondy.LevelRenderer.Storage"}destroy(){this.dispose(),this._shapeList=null,this._shapeListOffset=null}iterShape(t,e){if(!e){e={hover:!1,normal:"down",update:!1}}if(e.hover)for(var i=0,n=this._hoverElements.length;i<n;i++){var r=this._hoverElements[i];if(r.updateTransform(),t(r))return this}switch(e.update&&this.updateShapeList(),e.normal){case"down":{let e=this._shapeList.length;for(;e--;)if(t(this._shapeList[e]))return this;break}default:for(let e=0,i=this._shapeList.length;e<i;e++)if(t(this._shapeList[e]))return this}return this}getHoverShapes(t){var e=[],i=this._hoverElements.length;for(let t=0;t<i;t++){e.push(this._hoverElements[t]);var n=this._hoverElements[t].hoverConnect;if(n)for(var r,o=0,s=(n=n instanceof Array?n:[n]).length;o<s;o++)(r=n[o].id?n[o]:this.get(n[o]))&&e.push(r)}if(e.sort(Xi.shapeCompareFunc),t)for(let t=0,i=e.length;t<i;t++)e[t].updateTransform();return e}getShapeList(t){return t&&this.updateShapeList(),this._shapeList}updateShapeList(){this._shapeListOffset=0;var t=this._roots.length;for(let e=0;e<t;e++){let t=this._roots[e];this._updateAndAddShape(t)}this._shapeList.length=this._shapeListOffset;var e=this._shapeList.length;for(let t=0;t<e;t++)this._shapeList[t].__renderidx=t;this._shapeList.sort(Xi.shapeCompareFunc)}_updateAndAddShape(t,e){if(!t.ignore)if(t.updateTransform(),"group"===t.type){t.clipShape&&(t.clipShape.parent=t,t.clipShape.updateTransform(),e?(e=e.slice()).push(t.clipShape):e=[t.clipShape]);for(var i=0;i<t._children.length;i++){var n=t._children[i];n.__dirty=t.__dirty||n.__dirty,this._updateAndAddShape(n,e)}t.__dirty=!1}else t.__clipShapes=e,this._shapeList[this._shapeListOffset++]=t}mod(t,e){var i=this._elements[t];if(i&&(i.modSelf(),e))if(e.parent||e._storage||e.__startClip){var n={};for(var r in e)"parent"!==r&&"_storage"!==r&&"__startClip"!==r&&e.hasOwnProperty(r)&&(n[r]=e[r]);fi(i,n,!0)}else fi(i,e,!0);return this}drift(t,e,i){var n=this._elements[t];return n&&(n.needTransform=!0,"horizontal"===n.draggable?i=0:"vertical"===n.draggable&&(e=0),(!n.ondrift||n.ondrift&&!n.ondrift(e,i))&&n.drift(e,i)),this}addHover(t){return t.updateNeedTransform(),this._hoverElements.push(t),this}delHover(){return this._hoverElements=[],this}hasHoverShape(){return this._hoverElements.length>0}addRoot(t){t instanceof Zi&&t.addChildrenToStorage(this),this.addToMap(t),this._roots.push(t)}delRoot(t){if(void 0===t){for(var e=0;e<this._roots.length;e++){var i=this._roots[e];i instanceof Zi&&i.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],void(this._roots=[])}if(t instanceof Array){var n=t.length;for(let e=0;e<n;e++)this.delRoot(t[e])}else{var r;r="string"==typeof t?this._elements[t]:t;var o=ci(this._roots,r);o>=0&&(this.delFromMap(r.id),this._roots.splice(o,1),r instanceof Zi&&r.delChildrenFromStorage(this))}}addToMap(t){return t instanceof Zi&&(t._storage=this),t.modSelf(),this._elements[t.id]=t,this}get(t){return this._elements[t]}delFromMap(t){var e=this._elements[t];return e&&(delete this._elements[t],e instanceof Zi&&(e._storage=null)),this}dispose(){this._elements=null,this._roots=null,this._hoverElements=null}static shapeCompareFunc(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.__renderidx-e.__renderidx:t.z-e.z:t.zlevel-e.zlevel}}class Yi{}Yi.EVENT={RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},Yi.catchBrushException=!1,Yi.debugMode=0;class Wi{constructor(t,e){this.root=t,this.storage=e,this._domRoot=null,this._layers={},this._zlevelList=[],this._layerConfig={},this._bgDom=null,this.shapeToImage=null,Wi.devicePixelRatio=Math.max(window.devicePixelRatio||1,1),this.CLASS_NAME="Zondy.LevelRenderer.Painter",this.root.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var i=document.createElement("div");this._domRoot=i,i.style.position="relative",i.style.overflow="hidden",i.style.width=this._width+"px",i.style.height=this._height+"px",this.root.appendChild(i),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=Wi.createDom(pi(),"div",this),i.appendChild(this._bgDom),this._bgDom.onselectstart=o,this._bgDom.style["-webkit-user-select"]="none",this._bgDom.style["user-select"]="none",this._bgDom.style["-webkit-touch-callout"]="none";var n=new $i(pi(),this);this._layers.hover=n,i.appendChild(n.dom),n.initContext(),n.dom.onselectstart=o,n.dom.style["-webkit-user-select"]="none",n.dom.style["user-select"]="none",n.dom.style["-webkit-touch-callout"]="none";var r=this;function o(){return!1}this.updatePainter=function(t,e){r.refreshShapes(t,e)}}destroy(){this.dispose(),this._zlevelList=null,this._layerConfig=null,this._bgDom=null,this.shapeToImage=null}render(t){return this.refresh(t,!0),this}refresh(t,e){var i=this.storage.getShapeList(!0);return this._paintList(i,e),"function"==typeof t&&t(),this}_paintList(t,e){var i,n,r;for(var o in void 0===e&&(e=!1),this._updateLayerStatus(t),this._layers)"hover"!==o&&(this._layers[o].unusedCount++,this._layers[o].updateTransform());for(var s=[],a=0,l=t.length;a<l;a++){var h=t[a];if(n!==h.zlevel&&(i&&i.needTransform&&r.restore(),r=(i=this.getLayer(h.zlevel)).ctx,n=h.zlevel,i.unusedCount=0,(i.dirty||e)&&i.clear(),i.needTransform&&(r.save(),i.setTransform(r))),r&&h.__startClip){var u=h.__startClip;if(r.save(),u.needTransform){let t=u.transform;Mi.Util_matrix.invert(s,t),r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}if(r.beginPath(),u.buildPath(r,u.style),r.clip(),u.needTransform){let t=s;r.transform(t[0],t[1],t[2],t[3],t[4],t[5])}}if((i&&i.dirty||e)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(r,!1)))if(Yi.catchBrushException)try{h.brush(r,!1,this.updatePainter)}catch(t){}else h.brush(r,!1,this.updatePainter);r&&h.__stopClip&&r.restore(),h.__dirty=!1}r&&i&&i.needTransform&&r.restore();for(let t in this._layers)if("hover"!==t){var c=this._layers[t];c.dirty=!1,1===c.unusedCount&&c.clear()}}getLayer(t){var e=this._layers[t];if(!e){var i=this._zlevelList.length,n=null,r=-1;if(i>0&&t>this._zlevelList[0]){for(r=0;r<i-1&&!(this._zlevelList[r]<t&&this._zlevelList[r+1]>t);r++);n=this._layers[this._zlevelList[r]]}this._zlevelList.splice(r+1,0,t),e=new $i(pi(),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 Li).merge(e,this._layerConfig[t],!0),e.updateTransform()}return e}getLayers(){return this._layers}_updateLayerStatus(t){var e=this._layers,i={};for(let t in e)"hover"!==t&&(i[t]=e[t].elCount,e[t].elCount=0);for(let i=0;i<t.length;i++){var n=t[i],r=e[n.zlevel];if(r){if(r.elCount++,r.dirty)continue;r.dirty=n.__dirty}}for(let t in e)"hover"!==t&&i[t]!==e[t].elCount&&(e[t].dirty=!0)}refreshShapes(t,e){for(var i=0,n=t.length;i<n;i++){var r=t[i];this.storage.mod(r.id)}return this.refresh(e),this}clear(){for(var t in this._layers)"hover"!==t&&this._layers[t].clear();return this}modLayer(t,e){if(e){this._layerConfig[t]?(new Li).merge(this._layerConfig[t],e,!0):this._layerConfig[t]=e;var i=this._layers[t];i&&(new Li).merge(i,this._layerConfig[t],!0)}}delLayer(t){var e=this._layers[t];e&&(this.modLayer(t,{position:e.position,rotation:e.rotation,scale:e.scale}),e.dom.parentNode.removeChild(e.dom),delete this._layers[t],this._zlevelList.splice((new Li).indexOf(this._zlevelList,t),1))}refreshHover(){this.clearHover();for(var t=this.storage.getHoverShapes(!0),e=0,i=t.length;e<i;e++)this._brushHover(t[e]);return this.storage.delHover(),this}clearHover(){var t=this._layers.hover;return t&&t.clear(),this}resize(){var t=this._domRoot;t.style.display="none";var e=this._getWidth(),i=this._getHeight();if(t.style.display="",this._width!==e||i!==this._height){for(var n in this._width=e,this._height=i,t.style.width=e+"px",t.style.height=i+"px",this._layers)this._layers[n].resize(e,i);this.refresh(null,!0)}return this}clearLayer(t){var e=this._layers[t];e&&e.clear()}dispose(){this.root.innerHTML="",this.root=null,this.storage=null,this._domRoot=null,this._layers=null}getDomHover(){return this._layers.hover.dom}toDataURL(t,e,i){var n=Wi.createDom(pi(),"canvas",this);this._bgDom.appendChild(n);var r=n.getContext("2d");1!==Wi.devicePixelRatio&&r.scale(Wi.devicePixelRatio,Wi.devicePixelRatio),r.fillStyle=e||"#fff",r.rect(0,0,this._width*Wi.devicePixelRatio,this._height*Wi.devicePixelRatio),r.fill();var o=this;this.storage.iterShape(function(t){if(!t.invisible&&(!t.onbrush||t.onbrush&&!t.onbrush(r,!1)))if(Yi.catchBrushException)try{t.brush(r,!1,o.updatePainter)}catch(t){}else t.brush(r,!1,o.updatePainter)},{normal:"up",update:!0});var s=n.toDataURL(t,i);return r=null,this._bgDom.removeChild(n),s}getWidth(){return this._width}getHeight(){return this._height}_getWidth(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientWidth||parseInt(e.width,10))-parseInt(e.paddingLeft,10)-parseInt(e.paddingRight,10)).toFixed(0)-0}_getHeight(){var t=this.root,e=t.currentStyle||document.defaultView.getComputedStyle(t);return((t.clientHeight||parseInt(e.height,10))-parseInt(e.paddingTop,10)-parseInt(e.paddingBottom,10)).toFixed(0)-0}_brushHover(t){var e=this._layers.hover.ctx;if(!t.onbrush||t.onbrush&&!t.onbrush(e,!0)){var i=this.getLayer(t.zlevel);if(i.needTransform&&(e.save(),i.setTransform(e)),Yi.catchBrushException)try{t.brush(e,!0,this.updatePainter)}catch(t){}else t.brush(e,!0,this.updatePainter);i.needTransform&&e.restore()}}_shapeToImage(t,e,i,n,r){var o=document.createElement("canvas"),s=o.getContext("2d"),a=r||window.devicePixelRatio||1;o.style.width=i+"px",o.style.height=n+"px",o.setAttribute("width",i*a),o.setAttribute("height",n*a),s.clearRect(0,0,i*a,n*a);var l={position:e.position,rotation:e.rotation,scale:e.scale};e.position=[0,0,0],e.rotation=0,e.scale=[1,1],e&&e.brush(s,!1);var h=new zi({id:t,style:{x:0,y:0,image:o}});return null!=l.position&&(h.position=e.position=l.position),null!=l.rotation&&(h.rotation=e.rotation=l.rotation),null!=l.scale&&(h.scale=e.scale=l.scale),h}_createShapeToImageProcessor(){var t=this;return function(e,i,n,r){return t._shapeToImage(e,i,n,r,Wi.devicePixelRatio)}}updateHoverLayer(t){if(!(t instanceof Array))return this;this.clearHover(),this.storage.delHover();for(var e=0;e<t.length;e++)this.storage.addHover(t[e]),this._brushHover(t[e])}static createDom(t,e,i){var n=document.createElement(e),r=i._width,o=i._height;return n.style.position="absolute",n.style.left=0,n.style.top=0,n.style.width=r+"px",n.style.height=o+"px",n.setAttribute("width",r*Wi.devicePixelRatio),n.setAttribute("height",o*Wi.devicePixelRatio),n.setAttribute("id",t),n}}class $i extends Ti{constructor(t,e){super(t,e),this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=e,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,this.ctx=null,this.dom=Wi.createDom(pi(),"canvas",e),this.dom.onselectstart=function(){return!1},this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.CLASS_NAME="Zondy.LevelRenderer.Painter.Layer"}destroy(){this.dom=null,this.domBack=null,this.ctxBack=null,this.painter=null,this.unusedCount=null,this.config=null,this.dirty=null,this.elCount=null,this.clearColor=null,this.motionBlur=null,this.lastFrameAlpha=null,this.zoomable=null,this.panable=null,this.maxZoom=null,this.minZoom=null,this.ctx=null,Ti.destroy.apply(this,arguments)}initContext(){this.ctx=this.dom.getContext("2d"),1!==Wi.devicePixelRatio&&this.ctx.scale(Wi.devicePixelRatio,Wi.devicePixelRatio)}createBackBuffer(){this.domBack=Wi.createDom(pi(),"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d"),1!==Wi.devicePixelRatio&&this.ctxBack.scale(Wi.devicePixelRatio,Wi.devicePixelRatio)}resize(t,e){this.dom.style.width=t+"px",this.dom.style.height=e+"px",this.dom.setAttribute("width",t*Wi.devicePixelRatio),this.dom.setAttribute("height",e*Wi.devicePixelRatio),1!==Wi.devicePixelRatio&&this.ctx.scale(Wi.devicePixelRatio,Wi.devicePixelRatio),this.domBack&&(this.domBack.setAttribute("width",t*Wi.devicePixelRatio),this.domBack.setAttribute("height",e*Wi.devicePixelRatio),1!==Wi.devicePixelRatio&&this.ctxBack.scale(Wi.devicePixelRatio,Wi.devicePixelRatio))}clear(){var t=this.dom,e=this.ctx,i=t.width,n=t.height,r=this.clearColor,o=this.motionBlur,s=this.lastFrameAlpha;if(o&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(t,0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio)),r?(e.save(),e.fillStyle=this.config.clearColor,e.fillRect(0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio),e.restore()):e.clearRect(0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio),o){var a=this.domBack;e.save(),e.globalAlpha=s,e.drawImage(a,0,0,i/Wi.devicePixelRatio,n/Wi.devicePixelRatio),e.restore()}}}class Ki extends Ei{constructor(t,e,i){super(t,e,i),this.root=t,this.storage=e,this.painter=i,this._lastX=0,this._lastY=0,this._mouseX=0,this._mouseY=0,this._findHover=null,this._domHover=null,this._findHover=function(t,e){return function(i,n,r){return t.call(e,i,n,r)}}(function(t,e,i){var n=this;if(n._draggingTarget&&n._draggingTarget.id===t.id||t.isSilent())return!1;var r=n._event;if(t.isCover(e,i)){if(t.hoverable)if(t.isHoverByRefDataID&&!0===t.isHoverByRefDataID){if(t.refDataID){var o=t.refDataID,s=null;t.refDataHoverGroup&&(s=t.refDataHoverGroup);for(var a=n.storage._shapeList,l=0,h=a.length;l<h;l++){var u=a[l];u.refDataID&&o===u.refDataID&&(s?u.refDataHoverGroup&&s===u.refDataHoverGroup&&n.storage.addHover(u):n.storage.addHover(u))}}}else n.storage.addHover(t);for(var c=t.parent;c;){if(c.clipShape&&!c.clipShape.isCover(n._mouseX,n._mouseY))return!1;c=c.parent}return n._lastHover!==t&&(n._processOutShape(r),n._processDragLeave(r),n._lastHover=t,n._processDragEnter(r)),n._processOverShape(r),n._processDragOver(r),n._hasfound=1,!0}return!1},this),this._domHover=i.getDomHover(),this.CLASS_NAME="Zondy.LevelRenderer.Handler";var n={resize:function(t){t=t||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(Yi.EVENT.RESIZE,t)},click:function(t){t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<10&&this._dispatchAgency(e,Yi.EVENT.CLICK,t),this._mousemoveHandler(t)},dblclick:function(t){t=t||window.event,t=this._zrenderEventFixed(t);var e=this._lastHover;(e&&e.clickable||!e)&&this._clickThreshold<5&&this._dispatchAgency(e,Yi.EVENT.DBLCLICK,t),this._mousemoveHandler(t)},mousewheel:function(t){var e=((t=this._zrenderEventFixed(t)).wheelDelta||-t.detail)>0?1.1:1/1.1,i=this.painter.getLayers(),n=!1;for(var r in i)if("hover"!==r){var o=i[r],s=o.position;if(o.zoomable){o.__zoom=o.__zoom||1;var a=o.__zoom;a*=e,e=(a=Math.max(Math.min(o.maxZoom,a),o.minZoom))/o.__zoom,o.__zoom=a,s[0]-=(this._mouseX-s[0])*(e-1),s[1]-=(this._mouseY-s[1])*(e-1),o.scale[0]*=e,o.scale[1]*=e,o.dirty=!0,n=!0}}n&&this.painter.refresh(),this._dispatchAgency(this._lastHover,Yi.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=Mi.Util_event.getX(t),this._mouseY=Mi.Util_event.getY(t);var e=this._mouseX-this._lastX,i=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,i),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget);else if(this._isMouseDown){var r=this.painter.getLayers(),o=!1;for(var s in r)if("hover"!==s){var a=r[s];a.panable&&(n="move",a.position[0]+=e,a.position[1]+=i,o=!0,a.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,Yi.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(Yi.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,Yi.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,Yi.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&&Mi.Util_event.stop(t)},touchend:function(t){t=this._zrenderEventFixed(t,!0),this._mouseupHandler(t);var e=new Date;e-this._lastTouchMoment<Yi.EVENT.touchClickDelay&&(this._mobildFindFixed(t),this._clickHandler(t),e-this._lastClickMoment<Yi.EVENT.touchClickDelay/2&&(this._dblclickHandler(t),this._lastHover&&this._lastHover.clickable&&Mi.Util_event.stop(t)),this._lastClickMoment=e),this.painter.clearHover()}};function r(t,e){return function(i){return t.call(e,i)}}!function(t){var e=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],i=e.length;for(;i--;){var o=e[i];t["_"+o+"Handler"]=r(n[o],t)}}(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),Mi.Util_env.os.tablet||Mi.Util_env.os.phone?(t.addEventListener("touchstart",this._touchstartHandler),t.addEventListener("touchmove",this._touchmoveHandler),t.addEventListener("touchend",this._touchendHandler)):(t.addEventListener("click",this._clickHandler),t.addEventListener("dblclick",this._dblclickHandler),t.addEventListener("mousewheel",this._mousewheelHandler),t.addEventListener("mousemove",this._mousemoveHandler),t.addEventListener("mousedown",this._mousedownHandler),t.addEventListener("mouseup",this._mouseupHandler)),t.addEventListener("DOMMouseScroll",this._mousewheelHandler),t.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),t.attachEvent("onclick",this._clickHandler),t.ondblclick=this._dblclickHandler,t.attachEvent("onmousewheel",this._mousewheelHandler),t.attachEvent("onmousemove",this._mousemoveHandler),t.attachEvent("onmouseout",this._mouseoutHandler),t.attachEvent("onmousedown",this._mousedownHandler),t.attachEvent("onmouseup",this._mouseupHandler))}destroy(){this.dispose(),this._lastX=null,this._lastY=null,this._mouseX=null,this._mouseY=null,this._findHover=null,Ei.prototype.destroy.apply(this,arguments)}on(t,e){return this.bind(t,e),this}un(t,e){return this.unbind(t,e),this}trigger(t,e){var i=Yi.EVENT;switch(t){case i.RESIZE:case i.CLICK:case i.DBLCLICK:case i.MOUSEWHEEL:case i.MOUSEMOVE:case i.MOUSEDOWN:case i.MOUSEUP:case i.MOUSEOUT:this["_"+t+"Handler"](e)}}dispose(){var t=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),Mi.Util_env.os.tablet||Mi.Util_env.os.phone?(t.removeEventListener("touchstart",this._touchstartHandler),t.removeEventListener("touchmove",this._touchmoveHandler),t.removeEventListener("touchend",this._touchendHandler)):(t.removeEventListener("click",this._clickHandler),t.removeEventListener("dblclick",this._dblclickHandler),t.removeEventListener("mousewheel",this._mousewheelHandler),t.removeEventListener("mousemove",this._mousemoveHandler),t.removeEventListener("mousedown",this._mousedownHandler),t.removeEventListener("mouseup",this._mouseupHandler)),t.removeEventListener("DOMMouseScroll",this._mousewheelHandler),t.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),t.detachEvent("onclick",this._clickHandler),t.detachEvent("dblclick",this._dblclickHandler),t.detachEvent("onmousewheel",this._mousewheelHandler),t.detachEvent("onmousemove",this._mousemoveHandler),t.detachEvent("onmouseout",this._mouseoutHandler),t.detachEvent("onmousedown",this._mousedownHandler),t.detachEvent("onmouseup",this._mouseupHandler)),this.root=null,this._domHover=null,this.storage=null,this.painter=null,this.un()}_processDragStart(t){var e=this._lastHover;if(this._isMouseDown&&e&&e.draggable&&!this._draggingTarget&&this._mouseDownTarget===e){if(e.dragEnableTime&&new Date-this._lastMouseDownMoment<e.dragEnableTime)return;var i=e;this._draggingTarget=i,this._isDragging=1,i.invisible=!0,this.storage.mod(i.id),this._dispatchAgency(i,Yi.EVENT.DRAGSTART,t),this.painter.refresh()}}_processDragEnter(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,Yi.EVENT.DRAGENTER,t,this._draggingTarget)}_processDragOver(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,Yi.EVENT.DRAGOVER,t,this._draggingTarget)}_processDragLeave(t){this._draggingTarget&&this._dispatchAgency(this._lastHover,Yi.EVENT.DRAGLEAVE,t,this._draggingTarget)}_processDrop(t){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,Yi.EVENT.DROP,t,this._draggingTarget))}_processDragEnd(t){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,Yi.EVENT.DRAGEND,t),this._lastHover=null),this._isDragging=0,this._draggingTarget=null}_processOverShape(t){this._dispatchAgency(this._lastHover,Yi.EVENT.MOUSEOVER,t)}_processOutShape(t){this._dispatchAgency(this._lastHover,Yi.EVENT.MOUSEOUT,t)}_dispatchAgency(t,e,i,n){var r="on"+e,o={type:e,event:i,target:t,cancelBubble:!1},s=t;for(n&&(o.dragged=n);s&&(s[r]&&(o.cancelBubble=s[r](o)),s.dispatch(e,o),s=s.parent,!o.cancelBubble););t?o.cancelBubble||this.dispatch(e,o):n||this.dispatch(e,{type:e,event:i})}_iterateAndFindHover(){for(var t,e=Mi.Util_matrix.create(),i=this.storage.getShapeList(),n=[0,0],r=i.length-1;r>=0;r--){var o=i[r];if(void 0!==o.zlevel&&(t=this.painter.getLayer(o.zlevel,t),n[0]=this._mouseX,n[1]=this._mouseY,t.needTransform&&(Mi.Util_matrix.invert(e,t.transform),Mi.Util_vector.applyTransform(n,n,e))),this._findHover(o,n[0],n[1]))break}}_mobildFindFixed(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 i=0;!this._lastHover&&i<e.length;i++){var n=e[i];n.x&&(this._mouseX+=n.x),n.y&&(this._mouseX+=n.y),this._iterateAndFindHover()}this._lastHover&&(t.zrenderX=this._mouseX,t.zrenderY=this._mouseY)}_zrenderEventFixed(t,e){if(t.zrenderFixed)return t;if(e){var i="touchend"!==t.type?t.targetTouches[0]:t.changedTouches[0];if(i){var n=this.root.getBoundingClientRect();t.zrenderX=i.clientX-n.left,t.zrenderY=i.clientY-n.top}}else{var r=(t=t||window.event).toElement||t.relatedTarget||t.srcElement||t.target;r&&r!==this._domHover&&(t.zrenderX=(void 0!==t.offsetX?t.offsetX:t.layerX)+r.offsetLeft,t.zrenderY=(void 0!==t.offsetY?t.offsetY:t.layerY)+r.offsetTop)}return t.zrenderFixed=1,t}getLastHoverOne(){return this._lastHover?this._lastHover:null}}class Qi{constructor(){this.CLASS_NAME="Zondy.LevelRenderer.Animation.Easing"}destroy(){}Linear(t){return t}QuadraticIn(t){return t*t}QuadraticOut(t){return t*(2-t)}QuadraticInOut(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}CubicIn(t){return t*t*t}CubicOut(t){return--t*t*t+1}CubicInOut(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}QuarticIn(t){return t*t*t*t}QuarticOut(t){return 1- --t*t*t*t}QuarticInOut(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}QuinticIn(t){return t*t*t*t*t}QuinticOut(t){return--t*t*t*t*t+1}QuinticInOut(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}SinusoidalIn(t){return 1-Math.cos(t*Math.PI/2)}SinusoidalOut(t){return Math.sin(t*Math.PI/2)}SinusoidalInOut(t){return.5*(1-Math.cos(Math.PI*t))}ExponentialIn(t){return 0===t?0:Math.pow(1024,t-1)}ExponentialOut(t){return 1===t?1:1-Math.pow(2,-10*t)}ExponentialInOut(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}CircularIn(t){return 1-Math.sqrt(1-t*t)}CircularOut(t){return Math.sqrt(1- --t*t)}CircularInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}ElasticIn(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4))}ElasticOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/.4)+1)}ElasticInOut(t){var e,i=.1;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=.1):e=.4*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/.4)*.5+1)}BackIn(t){var e=1.70158;return t*t*((e+1)*t-e)}BackOut(t){var e=1.70158;return--t*t*((e+1)*t+e)+1}BackInOut(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}BounceIn(t){return 1-this.BounceOut(1-t)}BounceOut(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}BounceInOut(t){return t<.5?.5*this.BounceIn(2*t):.5*this.BounceOut(2*t-1)+.5}}class Ji{constructor(t){this._targetPool=t.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=t.life||1e3,this._delay=t.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop=void 0!==t.loop&&t.loop,this.gap=t.gap||0,this.easing=t.easing||"Linear",this.onframe=t.onframe,this.ondestroy=t.ondestroy,this.onrestart=t.onrestart,this.CLASS_NAME="Zondy.LevelRenderer.Animation.Clip"}destroy(){}step(t){var e=new Qi,i=(t-this._startTime)/this._life;if(!(i<0)){i=Math.min(i,1);var n="string"==typeof this.easing?e[this.easing]:this.easing,r="function"==typeof n?n(i):i;return this.fire("frame",r),1===i?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}}restart(){var t=((new Date).getTime()-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap}fire(t,e){for(var i=0,n=this._targetPool.length;i<n;i++)this["on"+t]&&this["on"+t](this._targetPool[i],e)}}class tn extends Ei{constructor(t){super(t),t=t||{},this.stage={},this.onframe=function(){},this._clips=[],this._running=!1,this._time=0,hi(this,t),this.CLASS_NAME="Zondy.LevelRenderer.Animation"}add(t){this._clips.push(t)}remove(t){var e=(new Li).indexOf(this._clips,t);e>=0&&this._clips.splice(e,1)}_update(){var t=(new Date).getTime(),e=t-this._time,i=this._clips,n=i.length,r=[],o=[];for(let e=0;e<n;e++){var s=i[e],a=s.step(t);a&&(r.push(a),o.push(s))}this.stage.update&&this.stage.update();for(let t=0;t<n;)i[t]._needsRemove?(i[t]=i[n-1],i.pop(),n--):t++;n=r.length;for(let t=0;t<n;t++)o[t].fire(r[t]);this._time=t,this.onframe(e),this.dispatch("frame",e)}start(){var t=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){setTimeout(t,16)},e=this;this._running=!0,this._time=(new Date).getTime(),t(function i(){e._running&&(e._update(),t(i))})}stop(){this._running=!1}clear(){this._clips=[]}animate(t,e){var i=new en(t,(e=e||{}).loop,e.getter,e.setter);return i.animation=this,i}static _interpolateNumber(t,e,i){return(e-t)*i+t}static _interpolateArray(t,e,i,n,r){var o=t.length;if(1===r)for(let r=0;r<o;r++)n[r]=tn._interpolateNumber(t[r],e[r],i);else{var s=t[0].length;for(let r=0;r<o;r++)for(let o=0;o<s;o++)n[r][o]=tn._interpolateNumber(t[r][o],e[r][o],i)}}static _isArrayLike(t){switch(typeof t){case"undefined":case"string":return!1}return void 0!==t.length}static _catmullRomInterpolateArray(t,e,i,n,r,o,s,a,l){var h=t.length;if(1===l)for(let l=0;l<h;l++)a[l]=tn._catmullRomInterpolate(t[l],e[l],i[l],n[l],r,o,s);else{var u=t[0].length;for(let l=0;l<h;l++)for(var c=0;c<u;c++)a[l][c]=tn._catmullRomInterpolate(t[l][c],e[l][c],i[l][c],n[l][c],r,o,s)}}static _catmullRomInterpolate(t,e,i,n,r,o,s){var a=.5*(i-t),l=.5*(n-e);return(2*(e-i)+a+l)*s+(-3*(e-i)-2*a-l)*o+a*r+e}static _cloneValue(t){var e=Array.prototype.slice;if(tn._isArrayLike(t)){var i=t.length;if(tn._isArrayLike(t[0])){for(var n=[],r=0;r<i;r++)n.push(e.call(t[r]));return n}return e.call(t)}return t}static rgba2String(t){return t[0]=Math.floor(t[0]),t[1]=Math.floor(t[1]),t[2]=Math.floor(t[2]),"rgba("+t.join(",")+")"}}class en{constructor(t,e,i,n){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||function(t,e){return t[e]},this._setter=n||function(t,e,i){t[e]=i},this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[],this.CLASS_NAME="Zondy.LevelRenderer.Animation.Animator"}when(t,e){for(var i in e)this._tracks[i]||(this._tracks[i]=[],0!==t&&this._tracks[i].push({time:0,value:tn._cloneValue(this._getter(this._target,i))})),this._tracks[i].push({time:parseInt(t,10),value:e[i]});return this}during(t){return this._onframeList.push(t),this}start(t){var e=this,i=this._setter,n=this._getter,r=e._onframeList.length,o="spline"===t,s=function(){if(e._clipCount--,0===e._clipCount){e._tracks={};for(var t=e._doneList.length,i=0;i<t;i++)e._doneList[i].call(e)}},a=function(a,l){var h=a.length;if(h){var u=a[0].value,c=tn._isArrayLike(u),p=!1,f=c&&tn._isArrayLike(u[0])?2:1;a.sort(function(t,e){return t.time-e.time});var d=a[h-1].time,g=[],y=[];for(let t=0;t<h;t++){g.push(a[t].time/d);var m=a[t].value;"string"==typeof m&&(0===(m=Mi.Util_color.toArray(m)).length&&(m[0]=m[1]=m[2]=0,m[3]=1),p=!0),y.push(m)}var _,v,x,b,w,S,E,L=0,C=0;if(p)var P=[0,0,0,0];var I=new Ji({target:e._target,life:d,loop:e._loop,delay:e._delay,onframe:function(t,s){if(s<C){for(_=Math.min(L+1,h-1),v=_;v>=0&&!(g[v]<=s);v--);v=Math.min(v,h-2)}else{for(v=L;v<h&&!(g[v]>s);v++);v=Math.min(v-1,h-2)}L=v,C=s;var a=g[v+1]-g[v];if(0!==a){if(x=(s-g[v])/a,o)if(w=y[v],b=y[0===v?v:v-1],S=y[v>h-2?h-1:v+1],E=y[v>h-3?h-1:v+2],c)tn._catmullRomInterpolateArray(b,w,S,E,x,x*x,x*x*x,n(t,l),f);else{let e;e=p?tn.rgba2String(P):tn._catmullRomInterpolate(b,w,S,E,x,x*x,x*x*x),i(t,l,e)}else if(c)tn._interpolateArray(y[v],y[v+1],x,n(t,l),f);else{let e;p?(tn._interpolateArray(y[v],y[v+1],x,P,1),e=tn.rgba2String(P)):e=tn._interpolateNumber(y[v],y[v+1],x),i(t,l,e)}for(v=0;v<r;v++)e._onframeList[v](t,s)}},ondestroy:s});t&&"spline"!==t&&(I.easing=t),e._clipList.push(I),e._clipCount++,e.animation.add(I)}};for(var l in this._tracks)a(this._tracks[l],l);return this}stop(){for(var t=0;t<this._clipList.length;t++){var e=this._clipList[t];this.animation.remove(e)}this._clipList=[]}delay(t){return this._delay=t,this}done(t){return t&&this._doneList.push(t),this}}class nn{constructor(t,e){this.id=t,this.storage=new Xi,this.painter=new Wi(e,this.storage),this.handler=new Ki(e,this.storage,this.painter),this.animatingElements=[],this.animation=new tn({stage:{update:nn.getFrameCallback(this)}}),this._needsRefreshNextFrame=!1,this.animation.start(),this.CLASS_NAME="Zondy.LevelRenderer.Render"}destroy(){this.id=null,this.storage=null,this.painter=null,this.handler=null,this.animatingElements=null,this.animation=null,this._needsRefreshNextFrame=null}getId(){return this.id}addShape(t){return this.storage.addRoot(t),this}addGroup(t){return this.storage.addRoot(t),this}delShape(t){return this.storage.delRoot(t),this}delGroup(t){return this.storage.delRoot(t),this}modShape(t,e){return this.storage.mod(t,e),this}modGroup(t,e){return this.storage.mod(t,e),this}modLayer(t,e){return this.painter.modLayer(t,e),this}addHoverShape(t){return this.storage.addHover(t),this}render(t){return this.painter.render(t),this._needsRefreshNextFrame=!1,this}refresh(t){return this.painter.refresh(t),this._needsRefreshNextFrame=!1,this}refreshNextFrame(){return this._needsRefreshNextFrame=!0,this}refreshHover(t){return this.painter.refreshHover(t),this}refreshShapes(t,e){return this.painter.refreshShapes(t,e),this}resize(){return this.painter.resize(),this}animate(t,e,i){if("string"==typeof t&&(t=this.storage.get(t)),t){var n;if(e){for(var r=e.split("."),o=t,s=0,a=r.length;s<a;s++)o&&(o=o[r[s]]);o&&(n=o)}else n=t;if(!n)return;var l=this.animatingElements;return void 0===t.__aniCount&&(t.__aniCount=0),0===t.__aniCount&&l.push(t),t.__aniCount++,this.animation.animate(n,{loop:i}).done(function(){if(t.__aniCount--,0===t.__aniCount){var e=ci(l,t);l.splice(e,1)}})}}clearAnimation(){this.animation.clear()}getWidth(){return this.painter.getWidth()}getHeight(){return this.painter.getHeight()}toDataURL(t,e,i){return this.painter.toDataURL(t,e,i)}shapeToImage(t,e,i){var n=pi();return this.painter.shapeToImage(n,t,e,i)}on(t,e){return this.handler.on(t,e),this}un(t,e){return this.handler.un(t,e),this}trigger(t,e){return this.handler.trigger(t,e),this.handler.dispatch(t,e),this}clear(){return this.storage.delRoot(),this.painter.clear(),this}dispose(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=null,this.animatingElements=null,this.storage=null,this.painter=null,this.handler=null}updateHoverShapes(t){return this.painter.updateHoverLayer(t),this}getAllShapes(){return this.storage._shapeList}clearAll(){return this.clear(),this.painter.clearHover(),this}getHoverOne(){return this.handler.getLastHoverOne()}static getFrameCallback(t){return function(){var e=t.animatingElements;if(e instanceof Array){for(var i=0,n=e.length;i<n;i++)t.storage.mod(e[i].id);(e.length||t._needsRefreshNextFrame)&&t.refresh()}}}}class rn{constructor(){rn._instances={},rn.Tool={},this.CLASS_NAME="Zondy.LevelRenderer"}destroy(){this.dispose()}init(t){var e=new nn(pi(),t);return rn._instances[e.id]=e,e}dispose(t){if(t)t.dispose(),this.delInstance(t.id);else{for(var e in rn._instances)rn._instances[e].dispose();rn._instances={}}return this}getInstance(t){return rn._instances[t]}delInstance(t){return delete rn._instances[t],this}}const on={Bar:class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar"}destroy(){super.destroy()}assembleShapes(){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 i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.dataViewBox,r=this.dataValues;if(!(r.length<1)){for(let t=0,e=r.length;t<e;t++)if(r[t]<i[0]||r[t]>i[1])return;var o=this.calculateXShapeInfo();if(o){var s=o.xPositions,a=o.width;(void 0===e.useBackground||e.useBackground)&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,e)),(void 0===e.useAxis||e.useAxis)&&(this.shapes=this.shapes.concat(Bi.GraphAxis(this.shapeFactory,n,e,o)));for(var l=0;l<r.length;l++){var h=n[1]-(r[l]-i[0])/this.DVBUnitValue,u=[[s[l]-a/2,n[1]-1],[s[l]+a/2,n[1]-1],[s[l]+a/2,h],[s[l]-a/2,h]],c=new _i(u);if(void 0===e.showShadow||e.showShadow){if(e.barShadowStyle){var p=e.barShadowStyle;p.shadowBlur&&(t.shadowBlur=p.shadowBlur),p.shadowColor&&(t.shadowColor=p.shadowColor),p.shadowOffsetX&&(t.shadowOffsetX=p.shadowOffsetX),p.shadowOffsetY&&(t.shadowOffsetY=p.shadowOffsetY)}c.style={},li(c.style,t)}c.refDataID=this.data.id,c.dataInfo={field:this.fields[l],value:r[l]},void 0!==e.barHoverAble&&(c.hoverable=e.barHoverAble),void 0!==e.barClickAble&&(c.clickable=e.barClickAble),this.shapes.push(this.shapeFactory.createShape(c))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}resetLinearGradient(){if(this.RelativeCoordinate)for(var t=this.shapes.length,e=this.setting.barLinearGradient,i=-1,n=0;n<t;n++){var r=this.shapes[n];if("Zondy.LevelRenderer.Shape.SmicPolygon"===r.CLASS_NAME){var o=r.style,s=this.location[0]+o.pointList[0][0],a=this.location[0]+o.pointList[1][0];++i>=e.length&&(i%=e.length);var l=e[i][0],h=e[i][1],u=(new Ii).getLinearGradient(s,0,a,0,[[0,l],[1,h]]);r.style.color=u}}}},Bar3D:class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Bar3D"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,25,20,20]:t.dataViewBoxParameter=[5,5,5,5]),t.axisUseArrow=void 0===t.axisUseArrow||t.axisUseArrow,t.axisXLabelsOffset=void 0!==t.axisXLabelsOffset?t.axisXLabelsOffset:[-10,10],this.initBaseParameter()){var e=this.DVBCodomain;this.DVBUnitValue=(e[1]-e[0])/this.DVBHeight;var i=this.dataViewBox,n=this.dataValues;if(!(n.length<1)){for(let t=0,i=n.length;t<i;t++)if(n[t]<e[0]||n[t]>e[1])return;var r=this.calculateXShapeInfo();if(r){var o=r.xPositions,s=r.width;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Bi.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(Bi.GraphAxis(this.shapeFactory,i,t,r)));var a=t.bar3DParameter&&!isNaN(t.bar3DParameter)?t.bar3DParameter:10;for(let r=0;r<n.length;r++){var l=i[1]-(n[r]-e[0])/this.DVBUnitValue,h=o[r]-s/2,u=o[r]+s/2,c=[[h,l],[u,l],[u-a,l+a],[h-a,l+a]],p=[[u,l],[u-a,l+a],[u-a,i[1]+a],[u,i[1]]],f=[[h-a,i[1]+a],[u-a,i[1]+a],[u-a,l+a],[h-a,l+a]];a<=0&&(f=[[h,i[1]],[u,i[1]],[u,l],[h,l]]);var d=new _i(c),g=new _i(p),y=new _i(f);t.barSideStyle=t.barSideStyle?t.barSideStyle:t.barFaceStyle,t.barSideStyleByFields=t.barSideStyleByFields?t.barSideStyleByFields:t.barFaceStyleByFields,t.barSideStyleByCodomain=t.barSideStyleByCodomain?t.barSideStyleByCodomain:t.barFaceStyleByCodomain,t.barTopStyle=t.barTopStyle?t.barTopStyle:t.barFaceStyle,t.barTopStyleByFields=t.barTopStyleByFields?t.barTopStyleByFields:t.barFaceStyleByFields,t.barTopStyleByCodomain=t.barTopStyleByCodomain?t.barTopStyleByCodomain:t.barFaceStyleByCodomain,y.style=Bi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barFaceStyle,t.barFaceStyleByFields,t.barFaceStyleByCodomain,r,n[r]),g.style=Bi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barSideStyle,t.barSideStyleByFields,t.barSideStyleByCodomain,r,n[r]),d.style=Bi.ShapeStyleTool({stroke:!0,strokeColor:"#ffffff",fillColor:"#ee9900"},t.barTopStyle,t.barTopStyleByFields,t.barTopStyleByCodomain,r,n[r]),t.barSideHoverStyle=t.barSideHoverStyle?t.barSideHoverStyle:t.barFaceHoverStyle,t.barTopHoverStyle=t.barTopHoverStyle?t.barTopHoverStyle:t.barFaceHoverStyle,y.highlightStyle=Bi.ShapeStyleTool({stroke:!0},t.barFaceHoverStyle),g.highlightStyle=Bi.ShapeStyleTool({stroke:!0},t.barSideHoverStyle),d.highlightStyle=Bi.ShapeStyleTool({stroke:!0},t.barTopHoverStyle),d.refDataID=g.refDataID=y.refDataID=this.data.id,d.isHoverByRefDataID=g.isHoverByRefDataID=y.isHoverByRefDataID=!0,d.refDataHoverGroup=g.refDataHoverGroup=y.refDataHoverGroup=pi(),d.dataInfo=g.dataInfo=y.dataInfo={field:this.fields[r],value:n[r]},void 0!==t.barHoverAble&&(d.hoverable=g.hoverable=y.hoverable=t.barHoverAble),void 0!==t.barClickAble&&(d.clickable=g.clickable=y.clickable=t.barClickAble),this.shapes.push(this.shapeFactory.createShape(g)),this.shapes.push(this.shapeFactory.createShape(d)),this.shapes.push(this.shapeFactory.createShape(y))}this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=0,s=this.DVBWidth;if(i.xShapeBlank&&i.xShapeBlank.length&&3===i.xShapeBlank.length){var a=s-((t=i.xShapeBlank)[0]+t[2]+(n-1)*t[1]);if(a<=n)return null;o=a/n}else t=[o=s/(2*n+1),o,o];for(var l=0,h=0;h<n;h++)0===h?l=t[0]+o/2:l+=o+t[1],r.push(e[0]+l);return{xPositions:r,width:o}}},OverlayCircle:class extends Ui{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Circle"}destroy(){super.destroy()}assembleShapes(){if(!this.setting)return!1;var t=this.setting;if(!t.codomain)return!1;var e=void 0===t.decimalNumber||isNaN(t.decimalNumber)?-1:t.decimalNumber,i=ji.getDataValues(this.data,this.fields,e);this.dataValues=i||[];var n=this.dataValues;t.maxR||(t.maxR=100),t.minR||(t.minR=0);var r=this.DVBCodomain;r&&r[1]-r[0]>0?this.DVBUnitValue=t.maxR/(r[1]-r[0]):this.DVBUnitValue=t.maxR;var o=this.DVBUnitValue,s=n[0]*o+t.minR;if(this.width=2*s,this.height=2*s,this.initBaseParameter()&&(!r||!(n[0]<r[0]||n[0]>r[1]))){var a=this.DVBCenterPoint,l=new Si(a[0],a[1],s);l.style=Bi.ShapeStyleTool(null,t.circleStyle,null,null,0),void 0!==t.fillColor?l.style.fillColor=t.fillColor:l.style.fillColor="#ff9277",l.highlightStyle=Bi.ShapeStyleTool(null,t.circleHoverStyle),void 0!==t.circleHoverAble&&(l.hoverable=t.circleHoverAble),void 0!==t.circleClickAble&&(l.clickable=t.circleClickAble),l.refDataID=this.data.id,l.dataInfo={field:this.fields[0],r:s,value:n[0]},this.shapes.push(this.shapeFactory.createShape(l)),this.shapesConvertToRelativeCoordinate()}}}};on.Graph=Gi,on.Line=class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Line"}destroy(){super.destroy()}assembleShapes(){var t=this.setting;if(t.dataViewBoxParameter||(void 0===t.useAxis||t.useAxis?t.dataViewBoxParameter=[45,15,15,15]:t.dataViewBoxParameter=[5,5,5,5]),this.initBaseParameter()){var e=this.dataViewBox,i=this.DVBCodomain;this.DVBUnitValue=(i[1]-i[0])/this.DVBHeight;var n=this.DVBUnitValue,r=this.dataValues;if(!(r.length<1)){var o=this.calculateXShapeInfo();if(o){var s,a,l=o.xPositions;(void 0===t.useBackground||t.useBackground)&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,t)),this.shapes=this.shapes.concat(Bi.GraphAxis(this.shapeFactory,e,t,o));for(var h=[],u=[],c=0,p=r.length;c<p;c++){if(r[c]<i[0]||r[c]>i[1])return null;s=l[c],a=e[1]-(r[c]-i[0])/n;var f=new yi(s,a);f.style=Bi.ShapeStyleTool({fillColor:"#ee9900"},t.pointStyle,t.pointStyleByFields,t.pointStyleByCodomain,c,r[c]),f.highlightStyle=Bi.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[c],value:r[c]},u.push(this.shapeFactory.createShape(f));var d=[s,a];h.push(d)}var g=new mi(h);g.style=Bi.ShapeStyleTool({strokeColor:"#ee9900"},t.lineStyle),g.clickable=!1,g.hoverable=!1;var y=this.shapeFactory.createShape(g);this.shapes.push(y),this.shapes=this.shapes.concat(u),this.shapesConvertToRelativeCoordinate()}}}}calculateXShapeInfo(){var t,e=this.dataViewBox,i=this.setting,n=this.dataValues.length;if(n<1)return null;var r=[],o=this.DVBWidth,s=0;if(i.xShapeBlank&&i.xShapeBlank.length&&2===i.xShapeBlank.length){var a=o-((t=i.xShapeBlank)[0]+t[1]);if(a<=n)return null;s=a/(n-1)}else t=[s=o/(n+1),s,s];for(var l=0,h=0;h<n;h++)0===h?l=t[0]:l+=s,r.push(e[0]+l);return{xPositions:r,width:0}}},on.Pie=class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Pie"}destroy(){super.destroy()}assembleShapes(){var t=this.setting,e=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}];if(this.initBaseParameter()){t.useBackground&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,t));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=0;c<i.length;c++){var p=Math.abs(i[c]);(l=0===c?a+p*o:c===p.length-1?h:a+p*o)-a>=360&&(l=359.9999999);var f=new xi(s[0],s[1],u,a,l);if(void 0===t.sectorStyleByFields){var d=c%e.length;f.style=Bi.ShapeStyleTool(null,t.sectorStyle,e,null,d)}else f.style=Bi.ShapeStyleTool(null,t.sectorStyle,t.sectorStyleByFields,t.sectorStyleByCodomain,c,i[c]);f.highlightStyle=Bi.ShapeStyleTool(null,t.sectorHoverStyle),void 0!==t.sectorHoverAble&&(f.hoverable=t.sectorHoverAble),void 0!==t.sectorClickAble&&(f.clickable=t.sectorClickAble),f.refDataID=this.data.id,f.dataInfo={field:this.fields[c],value:i[c]},this.shapes.push(this.shapeFactory.createShape(f)),a=l}this.shapesConvertToRelativeCoordinate()}}}},on.OverlayPoint=qi,on.RankSymbol=Ui,on.Ring=class extends Gi{constructor(t,e,i,n,r,o){super(t,e,i,n,r,o),this.CLASS_NAME="Zondy.Theme.Ring"}destroy(){super.destroy()}assembleShapes(){if(this.initBaseParameter()){var t=[{fillColor:"#ff9277"},{fillColor:"#dddd00"},{fillColor:"#ffc877"},{fillColor:"#bbe3ff"},{fillColor:"#d5ffbb"},{fillColor:"#bbbbff"},{fillColor:"#ddb000"},{fillColor:"#b0dd00"},{fillColor:"#e2bbff"},{fillColor:"#ffbbe3"},{fillColor:"#ff7777"},{fillColor:"#ff9900"},{fillColor:"#83dd00"},{fillColor:"#77e3ff"},{fillColor:"#778fff"},{fillColor:"#c877ff"},{fillColor:"#ff77ab"},{fillColor:"#ff6600"},{fillColor:"#aa8800"},{fillColor:"#77c7ff"},{fillColor:"#ad77ff"},{fillColor:"#ff77ff"},{fillColor:"#dd0083"},{fillColor:"#777700"},{fillColor:"#00aa00"},{fillColor:"#0088aa"},{fillColor:"#8400dd"},{fillColor:"#aa0088"},{fillColor:"#dd0000"},{fillColor:"#772e00"}],e=this.setting;e.useBackground&&this.shapes.push(Bi.Background(this.shapeFactory,this.chartBox,e));var i=this.dataValues;if(!(i.length<1)){var n=this.DVBCodomain;for(let t=0;t<i.length;t++)if(i[t]<n[0]||i[t]>n[1])return;var r=0;for(let t=0;t<i.length;t++)r+=Math.abs(i[t]);this.DVBUnitValue=360/r;for(var o=this.DVBUnitValue,s=this.DVBCenterPoint,a=0,l=0,h=a,u=this.DVBHeight<this.DVBWidth?this.DVBHeight/2:this.DVBWidth/2,c=e.innerRingRadius>=0&&e.innerRingRadius<u,p=void 0!==e.innerRingRadius&&!isNaN(e.innerRingRadius)&&c?e.innerRingRadius:0,f=0;f<i.length;f++){var d=Math.abs(i[f]);l=0===f?a+d*o:f===d.length-1?h:a+d*o;var g=new xi(s[0],s[1],u,a,l,p);if(void 0===e.sectorStyleByFields){var y=f%t.length;g.style=Bi.ShapeStyleTool(null,e.sectorStyle,t,null,y)}else g.style=Bi.ShapeStyleTool(null,e.sectorStyle,e.sectorStyleByFields,e.sectorStyleByCodomain,f,i[f]);g.highlightStyle=Bi.ShapeStyleTool(null,e.sectorHoverStyle),void 0!==e.sectorHoverAble&&(g.hoverable=e.sectorHoverAble),void 0!==e.sectorClickAble&&(g.clickable=e.sectorClickAble),g.refDataID=this.data.id,g.dataInfo={field:this.fields[f],value:i[f]},this.shapes.push(this.shapeFactory.createShape(g)),a=l}this.shapesConvertToRelativeCoordinate()}}}},on.ThemeVector=Hi,on.Point=qi;var sn=r.Layer.extend({options:{name:null,opacity:1,TFEvents:null},initialize(t,e){r.Util.setOptions(this,e),this.options.name=t,this.features=[],this.TFEvents=e&&e.TFEvents?e.TFEvents:[],this.levelRenderer=new rn,this.movingOffset=[0,0]},getEvents(){const t=this,e={zoomend:t._reset,moveend:t._reset,resize:t._resize};return this._map._zoomAnimated&&(e.zoomanim=t._zoomAnim),e},onRemove(t){r.DomUtil.remove(this.container),t.off("mousemove",this.mouseMoveHandler)},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.update()},addFeatures(t){},redrawThematicFeatures(t){},destroyFeatures(t){if(void 0===t&&(t=this.features),t){this.removeFeatures(t);for(let e=t.length-1;e>=0;e--)t[e].destroy()}},removeFeatures(t){const e=this;if(!t||0===t.length)return;if(t===e.features)return e.removeAllFeatures();r.Util.isArray(t)||(t=[t]);const i=[];for(let o=t.length-1;o>=0;o--){var n=t[o];const s=r.Util.indexOf(e.features,n);-1!==s?e.features.splice(s,1):i.push(n)}const o=[];for(let t=0,i=e.features.length;t<i;t++)n=e.features[t],o.push(n);e.features=[],e.addFeatures(o),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures());const s=0===i.length;e.fire("featuresremoved",{features:i,succeed:s})},removeAllFeatures(){const t=this;t.renderer&&t.renderer.clear(),t.features=[],t.fire("featuresremoved",{features:[],succeed:!0})},getFeatures(){const t=this,e=t.features.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=t.features[n];return i},getFeatureBy(t,e){return this.features.find(i=>{const n=i.attributes;if(i[t]===e||n[t]===e)return i})},getFeatureById(t){return this.getFeatureBy("id",t)},getFeaturesByAttribute(t,e){const i=this;let n;const r=[];for(const o in i.features)(n=i.features[o])&&n.attributes&&n.attributes[t]===e&&r.push(n);return r},update(t){const e=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,e);const i=this;i.renderer&&i.redrawThematicFeatures(t),i.currentMousePosition&&(i.currentMousePosition=r.point(i.currentMousePosition.x-i.movingOffset[0],i.currentMousePosition.y-i.movingOffset[1])),i.movingOffset=[0,0],i._zoom=i._map.getZoom(),i._center=i._map.getCenter()},setOpacity(t){const e=this;t!==e.options.opacity&&(isNaN(t)||(e.options.opacity=t,e._updateOpacity()))},redraw(){const t=this;return!!t.renderer&&(t._map?t.redrawThematicFeatures(t._map.getBounds()):t.redrawThematicFeatures(),!0)},on(t,e,i){return this.renderer?this.renderer.on(t,e):r.Layer.prototype.on.call(this,t,e),this},off(t,e,i){const n=this;return n.renderer?n.renderer.un(t,e):r.Layer.prototype.off.call(this,t,e),this},fire(t,e,i){return this.renderer&&this.renderer.trigger(t,e),r.Layer.prototype.fire.call(this,t,e,i),this},addTFEvents(){const t=this,e=t.TFEvents,i=e.length;for(let n=0;n<i;n++)t.renderer.on(e[n][0],e[n][1])},getLocalXY(t){if(!this._map)return t;let e=t;r.Util.isArray(t)?e=r.point(t[0],t[1]):t instanceof r.Point||(e=t instanceof Zondy.LonLat?r.point(t.lon,t.lat):r.point(t.x,t.y));const i=this._map.latLngToContainerPoint(this._map.options.crs.unproject(e));return[i.x,i.y]},_initContainer(){const t=this.getPane(),e=this._map.options.zoomAnimation&&r.Browser.any3d;let i=this.options.name||"themeLayer";i+=` leaflet-layer leaflet-zoom-${e?"animated":"hide"}`,this.container=r.DomUtil.create("div",i,t);const n=r.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);this.container.style[n]="50% 50%",this.container.style.position="absolute",this.container.style.zIndex=200},_zoomAnim(t){const e=this._map.getZoomScale(t.zoom),i=this._map._getCenterOffset(t.center)._multiplyBy(-e).subtract(this._map._getMapPanePos());r.DomUtil.setTransform?r.DomUtil.setTransform(this.container,i,e):this.container.style[r.DomUtil.TRANSFORM]=`${r.DomUtil.getTranslateString(i)} scale(${e})`},_updateOpacity(){const t=this;!function(t,e,i,n,r,o,s,a){e&&(t.id=e),i&&(t.style.left=i.x+"px",t.style.top=i.y+"px"),n&&(t.style.width=n.w+"px",t.style.height=n.h+"px"),r&&(t.style.position=r),o&&(t.style.border=o),s&&(t.style.overflow=s),parseFloat(a)>=0&&parseFloat(a)<1?(t.style.filter="alpha(opacity="+100*a+")",t.style.opacity=a):1===parseFloat(a)&&(t.style.filter="",t.style.opacity="")}(t.container,null,null,null,null,null,null,t.options.opacity),null!==t._map&&t._map.fire("changelayer",{layer:t,property:"opacity"})},_reset(){const t=this,e=t._map.getBounds();t.update(e);const i=t._map.getSize(),n=this._map.containerPointToLayerPoint([0,0]);r.DomUtil.setPosition(this.container,n),parseFloat(t.container.width)!==parseFloat(i.x)&&(t.container.width=`${i.x}px`),parseFloat(t.container.height)!==parseFloat(i.y)&&(t.container.height=`${i.y}px`),t.redraw()},_resize(){const t=this._map.getSize();this.container.style.width=`${t.x}px`,this.container.style.height=`${t.y}px`,this.renderer.resize()}});var an=sn.extend({options:{nodesClipPixel:2,isHoverAble:!1,isMultiHover:!1,isClickAble:!0,isAllowFeatureStyle:!1},initialize(t,e){sn.prototype.initialize.call(this,t,e),r.Util.setOptions(this,e);this.cache={},this.cacheFields=[],this.style={},this.highlightStyle={}},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=null,n=t.AttStruct,r=t.SFEleArray;if(null!==r&&r.length>0)for(let t=0;t<r.length;t++){const o=r[t];if(null!==o.AttValue&&o.AttValue.length>0){const t={};for(let e=0;e<o.AttValue.length;e++)t[n.FldName[e]]=o.AttValue[e];t.FID=o.FID}o.attributes=i,e.features.push(o)}}e.isCustomSetMaxCacheCount||(e.maxCacheCount=5*e.features.length),e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},removeFeatures(t){this.clearCache(),sn.prototype.removeFeatures.call(this,arguments)},removeAllFeatures(){this.clearCache(),sn.prototype.removeAllFeatures.call(this,arguments)},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;if(i&&i.refDataID&&(o=i.refDataID),t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent(t.min.x,t.min.y,t.max.x,t.max.y)}e.renderer.clearAll();const s=e.features,a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i],r=n.bound;if(t&&!t.intersectsBounds(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},createThematicFeature(t){const e=this,i=e.getStyleByData(t),n={};n.nodesClipPixel=e.options.nodesClipPixel,n.isHoverAble=e.options.isHoverAble,n.isMultiHover=e.options.isMultiHover,n.isClickAble=e.options.isClickAble,n.highlightStyle=Bi.transformStyle(e.highlightStyle);const r=new Hi(t,e,Bi.transformStyle(i),n);for(let t=0;t<r.shapes.length;t++)e.renderer.addShape(r.shapes[t]);return r},getStyleByData(t){},redraw(){return this.clearCache(),sn.prototype.redraw.apply(this,arguments)},clearCache(){this.cache={},this.cacheFields=[]},clear(){this.renderer.clearAll(),this.renderer.refresh(),this.removeAllFeatures(),this.clearCache()},getCacheCount(){return this.cacheFields.length},setMaxCacheCount(t){isNaN(t)||(this.maxCacheCount=t,this.isCustomSetMaxCacheCount=!0)},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=li({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++){if(t===e-1?s>=r[t].start&&s<=r[t].end:s>=r[t].start&&s<r[t].end){const e=r[t].style;n=li(n,e)}}return n}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[],this.themeField=null,this.styleGroups=[]},getStyleByData(t){const e=this,i=t;let n=li({},e.style);const r=e.styleGroups;let o=!1,s=null;const a=e.styleGroups&&e.styleGroups.length>0;if(e.themeField&&a&&i.attributes){const t=e.themeField,n=i.attributes;for(const e in n)if(t===e){o=!0,s=n[e];break}}if(o&&a)for(let t=0,e=r.length;t<e;t++)if(!s&&!r[t].value||s&&r[t].value&&s.toString()===r[t].value.toString()){const e=r[t].style;n=li(n,e);break}return n}});var ln=sn.extend({options:{isOverLay:!0},initialize(t,e,i){const n=[];n.push(t),n.push(i),sn.prototype.initialize.apply(this,n),this.chartsType=e,this.themeFields=i&&i.themeFields?i.themeFields:null,this.charts=i&&i.charts?i.charts:[],this.cache=i&&i.cache?i.cache:{},this.chartsSetting=i&&i.chartsSetting?i.chartsSetting:{}},setChartsType(t){this.chartsType=t,this.redraw()},addFeatures(t){const e=this;if(e.fire("beforefeaturesadded",{features:t}),t instanceof n.FeatureSet){const i=t.features;if(Array.isArray(i)&&i.length>0)for(let t=0;t<i.length;t++){const n=i[t];e.features.push(n)}}e.renderer&&(e._map?e.redrawThematicFeatures(e._map.getBounds()):e.redrawThematicFeatures())},redrawThematicFeatures(t){const e=this;e.renderer.clearAll();const i=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}for(let n=0,r=i.length;n<r;n++){const r=i[n];if(!r||!r.geometry)continue;const o=r.geometry.extent;if(t&&!t.intersects(o))continue;const s=e.cache,a=r.id;if(!s[a]){s[a]=a;const t=e.createThematicFeature(r),i=e.overlayWeightField&&r.attributes[e.overlayWeightField]&&!isNaN(r.attributes[e.overlayWeightField]);t&&i&&(t.__overlayWeight=r.attributes[e.overlayWeightField]),t&&e.charts.push(t)}}e.drawCharts()},createThematicFeature(t){const e=this;let i;return on[e.chartsType]&&e.themeFields&&e.chartsSetting&&(i=new on[e.chartsType](t,e,e.themeFields,e.chartsSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},drawCharts(){const t=this;t.renderer&&(t.overlayWeightField&&t._sortChart(),t.options&&!t.options.isOverLay?t._addOverlayShape():t._addNoOverlayShape(),t.renderer.render())},getShapesByFeatureID(t){const e=[],i=this.renderer.getAllShapes();if(!t)return i;for(let n=0,r=i.length;n<r;n++){const r=i[n];r.refDataID&&t===r.refDataID&&e.push(r)}return e},isQuadrilateralOverLap(t,e){const i=[{x:t.xmin,y:t.ymin},{x:t.xmax,y:t.ymin},{x:t.xmax,y:t.ymax},{x:t.xmin,y:t.ymax}],r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}],o=this,s=i.length,a=r.length;if(4!==s||4!==a)return null;let l=!1;for(let t=0;t<s;t++)if(o.isPointInPoly(i[t],r)){l=!0;break}for(let t=0;t<a;t++)if(o.isPointInPoly(r[t],i)){l=!0;break}for(let t=0;t<s-1&&!l;t++)for(let e=0;e<a-1;e++){const s=o.lineIntersection(i[t],i[t+1],r[e],r[e+1]);if(s&&s.type===n.GeometryType.point){l=!0;break}}return l},lineIntersection(t,e,i,r){let o,s,a=null;const l=(r.x-i.x)*(t.y-i.y)-(r.y-i.y)*(t.x-i.x),h=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),u=(r.y-i.y)*(e.x-t.x)-(r.x-i.x)*(e.y-t.y);if(0!==u)s=h/u,a=(o=l/u)>=0&&s<=1&&o<=1&&s>=0?new n.Point({coordinates:[t.x+o*(e.x-t.x),t.y+o*(e.y-t.y)]}):"No Intersection";else if(0===l&&0===h){const n=Math.max(t.y,e.y),o=Math.min(t.y,e.y),s=Math.max(t.x,e.x),l=Math.min(t.x,e.x);a=(i.y>=o&&i.y<=n||r.y>=o&&r.y<=n)&&i.x>=l&&i.x<=s||r.x>=l&&r.x<=s?"Coincident":"Parallel"}else a="Parallel";return a},isPointInPoly(t,e){for(var i=!1,n=-1,r=e.length,o=r-1;++n<r;o=n)(e[n].y<=t.y&&t.y<e[o].y||e[o].y<=t.y&&t.y<e[n].y)&&t.x<(e[o].x-e[n].x)*(t.y-e[n].y)/(e[o].y-e[n].y)+e[n].x&&(i=!i);return i},isChartInMap(t,e){const i=t;let n=!1;const r=[{x:e.xmin,y:e.ymin},{x:e.xmax,y:e.ymin},{x:e.xmax,y:e.ymax},{x:e.xmin,y:e.ymax}];for(let t=0,e=r.length;t<e;t++){const e=r[t];if(e.x>=i.xmin&&e.x<=i.xmax&&e.y>=i.ymin&&e.y<=i.ymax){n=!0;break}}return n},isSuitableChart:(t,e,i)=>Math.abs(i)<=1,clearCache(){this.cache={},this.charts=[]},removeFeatures(t){this.clearCache(),sn.prototype.removeFeatures.apply(this,arguments)},removeAllFeatures(){this.clearCache(),sn.prototype.removeAllFeatures.apply(this,arguments)},redraw(){return this.clearCache(),sn.prototype.redraw.apply(this,arguments)},clear(){const t=this;t.renderer&&(t.renderer.clearAll(),t.renderer.refresh()),t.removeAllFeatures(),t.clearCache()},getWeightFieldValue(t,e,i){if((void 0===i||isNaN(i))&&(i=0),!t.attributes)return i;let n=t.attributes[e];return(void 0===n||isNaN(n))&&(n=i),n},_sortChart(){this.charts&&this.charts.sort(function(t,e){return void 0===t.__overlayWeight&&void 0===e.__overlayWeight?0:void 0!==t.__overlayWeight&&void 0===e.__overlayWeight?-1:void 0===t.__overlayWeight&&void 0!==e.__overlayWeight?1:void 0!==t.__overlayWeight&&void 0!==e.__overlayWeight?parseFloat(t.__overlayWeight)<parseFloat(e.__overlayWeight)?1:-1:0})},_addOverlayShape(){const t=this,e=t.charts;for(let i=0,n=e.length;i<n;i++){const n=e[i],r=n.resetLocation(),o=n.shapes;for(let e=0,i=o.length;e<i;e++)o[e].refOriginalPosition=r,t.renderer.addShape(o[e])}},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.charts,s=[],a=t.getLocalXY(e.min),l=t.getLocalXY(e.max),h=new n.Extent({xmin:Math.min(parseFloat(a[0]),parseFloat(l[0])),xmax:Math.max(parseFloat(a[0]),parseFloat(l[0])),ymin:Math.min(parseFloat(a[1]),parseFloat(l[1])),ymax:Math.max(parseFloat(a[1]),parseFloat(l[1]))});for(let e=0,i=o.length;e<i;e++){const i=o[e],n=i.resetLocation(),r=i.chartBounds;if(h&&!t.isChartInMap(h,r))continue;const a=t._map.getZoom()-t.options.fitZoom;if(h&&t.options.fitZoom>-1&&!t.isSuitableChart(h,r,a))continue;let l=!1;for(let e=0;e<s.length;e++)if(t.isQuadrilateralOverLap(r,s[e])){l=!0;break}if(l)continue;s.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[],this.keepStyle=!0},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=li({},this.style);return t.fillColor=this.getColor(),t},onAdd(t){const e=this;if(e.map=e._map=t,e._initContainer(),!e.levelRenderer)return void t.removeLayer(e);const i=t.getSize();e.container.style.width=`${i.x}px`,e.container.style.height=`${i.y}px`,e._updateOpacity(),e.renderer=e.levelRenderer.init(e.container),e.renderer.clear(),e.features&&e.features.length>0&&e._reset(),e.addTFEvents(),e.mouseMoveHandler=function(t){const i=t.layerPoint;e.currentMousePosition=r.point(i.x+e.movingOffset[0],i.y+e.movingOffset[1])},t.on("mousemove",e.mouseMoveHandler),e.zoomstartHandler=function(t){e.keepStyle=!1},t.on("zoomstart ",e.zoomstartHandler),e.zoomendHandler=function(t){e.keepStyle=!0},t.on("zoomend",e.zoomendHandler),e.update()},redrawThematicFeatures(t){const e=this,i=e.renderer.getHoverOne();let o=null;i&&i.refDataID&&(o=i.refDataID);const s=e.features;if(t&&t instanceof r.LatLngBounds){const e=this._map.options.crs;t=r.bounds(e.project(t.getSouthWest()),e.project(t.getNorthEast())),t=new n.Extent({xmin:t.min.x,ymin:t.min.y,xmax:t.max.x,ymax:t.max.y})}e.renderer.clearAll();const a=e.cache,l=e.cacheFields,h=e._map.getZoom(),u=e.maxCacheCount;for(let i=0,n=s.length;i<n;i++){const n=s[i];if(!n||!n.geometry)continue;const r=n.geometry.extent;if(t&&!t.intersects(r))continue;const o=`${n.FID}_zoom_${h.toString()}`;if(a[o]&&e.keepStyle){a[o].updateAndAddShapes();continue}const c=e.createThematicFeature(s[i]);if(!(c.getShapesCount()<1)&&(a[o]=c,l.push(o),l.length>u)){const t=l[0];l.splice(0,1),delete a[t]}}if(e.renderer.render(),o&&e.options.isHoverAble&&e.options.isMultiHover){const t=this.getShapesByFeatureID(o);this.renderer.updateHoverShapes(t)}},redraw(){return this.keepStyle||this.clearCache(),sn.prototype.redraw.apply(this,arguments)}});an.extend({initialize(t,e){an.prototype.initialize.call(this,t,e),this.style=[]},getColor(){const t="0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f".split(",");let e="#";for(let i=0;i<6;i++)e+=t[Math.floor(16*Math.random())];return e},getStyleByData(){const t=this,e=li({},t.style);return null===e.fillColor&&(e.fillColor=t.getColor()),t.style=e,e},redraw(){return sn.prototype.redraw.apply(this,arguments)}});ln.extend({initialize(t,e,i){ln.prototype.initialize.apply(this,arguments),this.symbolType=e,this.symbolSetting={}},setSymbolType(t){this.symbolType=t,this.redraw()},createThematicFeature(t){const e=this;let i;return ji[e.symbolType]&&e.themeField&&e.symbolSetting&&(i=new ji[e.symbolType](t,e,[e.themeField],e.symbolSetting,null,e.options)),!!i&&(i.assembleShapes(),i)},_addNoOverlayShape(){const t=this;let e=t._map.getBounds();const i=this._map.options.crs;e=r.bounds(i.project(e.getSouthWest()),i.project(e.getNorthEast()));const o=t.getLocalXY(e.min),s=t.getLocalXY(e.max),a=new n.Extent({xmin:Math.min(parseFloat(o[0]),parseFloat(s[0])),xmax:Math.max(parseFloat(o[0]),parseFloat(s[0])),ymin:Math.min(parseFloat(o[1]),parseFloat(s[1])),ymax:Math.max(parseFloat(o[1]),parseFloat(s[1]))}),l=t.charts,h=[];for(let e=0,i=l.length;e<i;e++){const i=l[e],n=i.resetLocation(),r=i.chartBounds;if(a&&!t.isChartInMap(a,r))continue;const o=t._map.getZoom();t.options.fitZoom;if(a&&t.options.fitZoom>-1&&Math.abs(o-t.options.fitZoom)>1)continue;let s=!1;for(let e=0;e<h.length;e++)if(t.isQuadrilateralOverLap(r,h[e])){s=!0;break}if(s)continue;h.push(r);const u=i.shapes;for(let e=0,i=u.length;e<i;e++)u[e].refOriginalPosition=n,t.renderer.addShape(u[e])}}});var hn=class{constructor(t){t=t||{},this.fill=!0,this.fillColor="#000000",this.fillOpacity=1,this.stroke=!1,this.strokeColor="#000000",this.strokeOpacity=1,this.strokeWidth=1,this.strokeLinecap="butt",this.strokeLineJoin="miter",this.strokeDashstyle="solid",this.pointRadius=6,this.shadowBlur=0,this.shadowColor="#000000",this.shadowOffsetX=0,this.shadowOffsetY=0,this.label="",this.labelRect=!1,this.fontColor="",this.fontSize=12,this.fontStyle="normal",this.fontVariant="normal",this.fontWeight="normal",this.fontFamily="arial,sans-serif",this.labelPosition="top",this.labelAlign="center",this.labelBaseline="middle",this.labelXOffset=0,this.labelYOffset=0,hi(this,t)}};class un{}un.convertFeature=Qe;var cn=un;i.d(e,"MapViewLeaflet",function(){return ri}),i.d(e,"MapView",function(){return ri}),i.d(e,"Popup",function(){return ie}),i.d(e,"Screenshot",function(){return se}),i.d(e,"DrawControl",function(){return si}),i.d(e,"SketchEditorLeaflet",function(){return ai}),i.d(e,"SketchEditor",function(){return ai}),i.d(e,"GraphThemeLayer",function(){return ln}),i.d(e,"ThemeStyle",function(){return hn}),i.d(e,"getLayerView",function(){return ii}),i.d(e,"initializeOptions",function(){return dt}),i.d(e,"initializeCRS",function(){return ft}),i.d(e,"IGSTileLayer",function(){return wt}),i.d(e,"IGSMapImageLayer",function(){return Lt}),i.d(e,"IGSImageryLayer",function(){return Xt}),i.d(e,"IGSImageryTileLayer",function(){return qt}),i.d(e,"ArcGISMapImageLayer",function(){return It}),i.d(e,"WebMapServiceLayer",function(){return Tt}),i.d(e,"WebMapTileServiceLayer",function(){return Ot}),i.d(e,"WebTileLayer",function(){return Nt}),i.d(e,"ArcGISTileLayer",function(){return At}),i.d(e,"VectorTileLayer",function(){return Rt}),i.d(e,"FeatureLayer",function(){return kt}),i.d(e,"MapVLayer",function(){return Vt}),i.d(e,"EchartsLayer",function(){return Ut}),i.d(e,"FeatureLayerUtil",function(){return cn}),i.d(e,"SwipeControl",function(){return F}),i.d(e,"SwipeTool",function(){return Yt}),i.d(e,"L",function(){return r}),window.L=r,n.zondy.leaflet={},n.zondy.leaflet.layer={},n.zondy.leaflet.layer.IGSTileLayer=wt,n.zondy.leaflet.layer.IGSMapImageLayer=Lt,n.zondy.leaflet.layer.IGSImageryLayer=Xt,n.zondy.leaflet.layer.IGSImageryTileLayer=qt,n.zondy.leaflet.layer.ArcGISMapImageLayer=It,n.zondy.leaflet.layer.WebMapServiceLayer=Tt,n.zondy.leaflet.layer.WebMapTileServiceLayer=Ot,n.zondy.leaflet.layer.WebTileLayer=Nt,n.zondy.leaflet.layer.ArcGISTileLayer=At,n.zondy.leaflet.layer.VectorTileLayer=Rt,n.zondy.leaflet.layer.FeatureLayer=kt,n.zondy.leaflet.layer.MapVLayer=Vt,n.zondy.leaflet.layer.EchartsLayer=Ut,n.zondy.leaflet.GraphThemeLayer=ln,n.zondy.leaflet.tool={},n.zondy.leaflet.tool.sketch={},n.zondy.leaflet.tool.sketch.SketchEditor=ai,n.zondy.leaflet.tool.Screenshot=se,n.zondy.leaflet.tool.SwipeTool=Yt,n.zondy.leaflet.SwipeControl=F,n.zondy.leaflet.widget={},n.zondy.leaflet.widget.DrawControl=si,n.zondy.leaflet.widget.Popup=ie,n.zondy.leaflet.util={},n.zondy.leaflet.util.getLayerView=ii,n.zondy.leaflet.util.initializeOptions=dt,n.zondy.leaflet.util.initializeCRS=ft,n.zondy.leaflet.util.FeatureLayerUtil=cn,n.zondy.leaflet.MapView=ri,n.zondy.leaflet.object={},n.zondy.leaflet.object.theme={},n.zondy.leaflet.object.theme.ThemeStyle=hn,n.zondy.leaflet.VERSION="17.6.21",n.Zondy.SketchEditorLeaflet=ai,n.Zondy.PluginVersion=n.zondy.leaflet.VERSION,window.MapGISLeafletPlugin={MapViewLeaflet:ri,MapView:ri,Popup:ie,Screenshot:se,DrawControl:si,SketchEditorLeaflet:ai,SketchEditor:ai,GraphThemeLayer:ln,ThemeStyle:hn,getLayerView:ii,initializeOptions:dt,initializeCRS:ft,IGSTileLayer:wt,IGSMapImageLayer:Lt,IGSImageryLayer:Xt,IGSImageryTileLayer:qt,ArcGISMapImageLayer:It,WebMapServiceLayer:Tt,WebMapTileServiceLayer:Ot,WebTileLayer:Nt,ArcGISTileLayer:At,VectorTileLayer:Rt,FeatureLayer:kt,MapVLayer:Vt,EchartsLayer:Ut,FeatureLayerUtil:cn,SwipeControl:F,SwipeTool:Yt,L:r}}])});