gis-common 2.2.16 → 2.2.18
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.
- package/dist/resource.min.js +1 -1
- package/package.json +1 -1
package/dist/resource.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Gis",[],e):"object"==typeof exports?exports.Gis=e():t.Gis=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"AnimateUtils",(function(){return r})),n.d(e,"ArrayUtils",(function(){return h})),n.d(e,"BrowserUtils",(function(){return f})),n.d(e,"Cookie",(function(){return d})),n.d(e,"CoordsUtils",(function(){return p})),n.d(e,"DateUtils",(function(){return v})),n.d(e,"DomUtils",(function(){return m})),n.d(e,"GeoUtils",(function(){return M})),n.d(e,"FileUtils",(function(){return b})),n.d(e,"MathUtils",(function(){return w})),n.d(e,"OptimizeUtils",(function(){return R})),n.d(e,"StringUtils",(function(){return O})),n.d(e,"AssertUtils",(function(){return S})),n.d(e,"Utils",(function(){return u})),n.d(e,"EventType",(function(){return a})),n.d(e,"ErrorType",(function(){return i})),n.d(e,"LayerType",(function(){return o})),n.d(e,"GraphicType",(function(){return s})),n.d(e,"MeasureMode",(function(){return c})),n.d(e,"AudioPlayer",(function(){return D})),n.d(e,"CanvasDrawer",(function(){return x})),n.d(e,"ElQuery",(function(){return k})),n.d(e,"EventDispatcher",(function(){return N})),n.d(e,"HashMap",(function(){return F})),n.d(e,"WebSocketClient",(function(){return W})),n.d(e,"WebStorage",(function(){return q})),n.d(e,"DevicePixelRatio",(function(){return H}));var r={animate:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"swing",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;for(var i in e)e[i]={target:"opacity"===i?parseInt(100*e[i]):e[i],iNow:"opacity"===i?parseInt(100*getComputedStyle(t)[i]):parseInt(getComputedStyle(t)[i])};"liner"===r&&(a=e[i].iNow<e[i].target?Math.abs(a):-Math.abs(a)),clearInterval(t.timer),t.timer=setInterval((function(){for(var i in e){var o=e[i].target,s=e[i].iNow;if("swing"===r&&(a=(a=(o-s)/20)>0?Math.ceil(a):Math.floor(a)),Math.abs(o-s)<=Math.abs(a)){for(var c in t.style[i]="opacity"===i?o/100:o+"px",delete e[i],e)return!1;clearInterval(t.timer),"function"==typeof n&&n()}else e[i].iNow+=a,t.style[i]="opacity"===i?e[i].iNow/100:e[i].iNow+"px"}}),30)}},a={MAP_RENDER:"mapRender",MAP_READY:"mapReady",MOUSE_CLICK:"click",MOUSE_DOUBLE_CLICK:"dblclick",MOUSE_MOVE:"mousemove",MOUSE_IN:"mousein",MOUSE_OUT:"mouseout",MOUSE_RIGHT_CLICK:"mouseRightClick",KEY_DOWN:"keyDown",KEY_UP:"keyUp",DRAW_ACTIVE:"drawActive",DRAW_MOVE:"drawMove",DRAW_COMPLETE:"drawComplete",MQTT_CONNECT:"mqttConnect",MQTT_ERROR:"mqttError",MQTT_MESSAGE:"mqttMessage",MQTT_CLOSE:"mqttClose",WEB_SOCKET_CONNECT:"webSocketConnect",WEB_SOCKET_ERROR:"webSocketError",WEB_SOCKET_MESSAGE:"webSocketMessage",WEB_SOCKET_CLOSE:"webSocketClose"},i={LOGIN_EXPIRED:"登录信息过期,请重新登录",CROSS_ERROR:"跨域访问",UNEXIST_RESOURCE:"资源不存在",TIMEOUT:"请求超时",INTERNAL_ERROR:"内部错误",NETWORK_ERROR:"请求失败,请检查网络是否已连接",PROCESS_FAIL:"处理失败",AUTH_VERIFY_ERROR:"权限验证失败",NO_DATA_FOUND:"未找到数据",DUPLICATE_INSTANCE:"实例为单例模式,不允许重复构建",COORDINATE_ERROR:"坐标验证失败",JSON_PARSE_ERROR:"JSON解析失败,格式有误",JSON_VALUE_ERROR:"JSON无此键",PARAMETER_ERROR:"验证数据类型失败",PARAMETER_ERROR_ARRAY:"格式类型验证失败:必须是数组",PARAMETER_ERROR_STRING:"格式类型验证失败:必须是字符",PARAMETER_ERROR_FUNCTION:"格式类型验证失败:必须是函数",PARAMETER_ERROR_OBJECT:"格式类型验证失败:必须是对象",PARAMETER_ERROR_LACK:"参数缺失"},o={SUPER_MAP_IMAGES:"SuperMapImages",SUPER_MAP_DATA:"SuperMapData",ARC_GIS_MAP_IMAGES:"ArcGisMapImages",ARC_GIS_MAP_DATA:"ArcGisMapData",OSGB_LAYER:"OSGBLayer",S3M_GROUP:"S3MGroup",TERRAIN_LAYER:"TerrainFileLayer"},s={POINT:"point",POLYLINE:"polyline",POLYGON:"polygon",BILLBOARD:"billboard",CYLINDER:"cylinder",ELLIPSOID:"ellipsoid",LABEL:"label",MODEL:"model",WALL:"wall"},c={DISTANCE:"distance",AREA:"area",HEIGHT:"height"},u={getDataType:function(t){return Object.prototype.toString.call(t).slice(8,-1)},isEmpty:function(t){if(null==t)return!0;switch(this.getDataType(t)){case"String":return""===t.trim();case"Array":return!t.length;case"Object":return!Object.keys(t).length;case"Boolean":return!t;default:return!1}},isNotEmpty:function(t){return!this.isEmpty(t)},json2form:function(t){var e=new FormData;return Object.keys(t).forEach((function(n){e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])})),e},json2Query:function(t){var e=[];for(var n in t){var r=n,a=t[n];e.push(r+"="+a)}return e.join("&")},generateGuid:function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict:function(){for(var t="",e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(n.length>1){for(var a=n.slice(1,n.length%2==0?n.length-1:n.length),i=0;i<a.length;i+=2){var o=a[i];n[0]===o&&(t=a[i+1])}t||n.length%2!=0||(t=n[n.length-1])}else t=n[0];return t},extend:function(t){for(var e=void 0,n=void 0,r=void 0,a=void 0,i=arguments.length,o=Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];for(n=0,r=o.length;n<r;n++)for(e in a=o[n])t[e]=a[e];return t},rgb2hex:function(t){return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1)},convertToTree2:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"parentId",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",a=[];function i(a){var o=a[e],s=t.filter((function(t){return t.hasOwnProperty(n)&&t[n]===o}));s.length>0&&(s.forEach(i),a[r]=s)}var o=function(r){-1===t.findIndex((function(t){return t[e]===r[n]}))&&(i(r),a.push(r))},s=!0,c=!1,u=void 0;try{for(var l,h=t[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var f=l.value;o(f)}}catch(t){c=!0,u=t}finally{try{!s&&h.return&&h.return()}finally{if(c)throw u}}return a},asyncLoadScript:function(t){return new Promise((function(e,n){try{var r=document.createElement("script");r.readyState?r.onreadystatechange=function(){"complete"!==r.readyState&&"loaded"!==r.readyState||e(r)}:r.onload=function(){e(r)},r.type="text/javascript",r.src=t,document.body.appendChild(r)}catch(t){n(t)}}))},loadStyle:function(t){t.forEach((function(t){var e=document.createElement("link");e.href=t,e.rel="stylesheet",e.type="text/css",document.head.appendChild(e)}))},template:function(t,e){return t.replace(/\{ *([\w_-]+) *\}/g,(function(t,n){var r=e[n];if(void 0===r)throw new Error(i.JSON_VALUE_ERROR+t);return"function"==typeof r&&(r=r(e)),r}))},deleteEmptyProperty:function(t){var e=this;return Object.fromEntries(Object.keys(t).filter((function(n){return!e.isEmpty(t[n])})).map((function(e){return[e,t[e]]})))},deepAssign:function(){var t=arguments.length,e=arguments[0];"Object"!==this.getDataType(e)&&(e={});for(var n=1;n<t;n++){var r=arguments[n];if("Object"===this.getDataType(r))for(var a in r)"__proto__"!==a&&e!==r[a]&&("Object"===this.getDataType(r[a])?e[a]=this.deepAssign(e[a],r[a]):e[a]=r[a])}return e},handleCopyValue:function(t){if(!navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t);var e=document.createElement("textarea");return e.style.position="fixed",e.style.top=e.style.left="-100vh",e.style.opacity="0",e.value=t,document.body.appendChild(e),e.focus(),e.select(),new Promise((function(t,n){document.execCommand("copy")?t():n(new Error("copy failed")),e.remove()}))}};function l(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}Array.prototype.groupBy=function(t){var e={};return this.forEach((function(n){var r=JSON.stringify(t(n));e[r]=e[r]||[],e[r].push(n)})),Object.keys(e).map((function(t){return e[t]}))},Array.prototype.distinct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t},e=[],n={};return this.forEach((function(r){var a=t(r);!n[a]&&(n[a]=e.push(r))})),e},Array.prototype.max=function(){return Math.max.apply({},this)},Array.prototype.min=function(){return Math.min.apply({},this)},Array.prototype.sum=function(){return this.length>0?this.reduce((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t+e})):0},Array.prototype.avg=function(){return this.length?this.sum()/this.length:0},Array.prototype.desc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return this.sort((function(e,n){return t(n)-t(e)}))},Array.prototype.asc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return this.sort((function(e,n){return t(e)-t(n)}))},Array.prototype.clear=function(){return this.length=0,this};var h={asArray:function(t){return u.isEmpty(t)?[]:Array.isArray(t)?t:[t]},generateArray:function(t){return[].concat(l(new Array(t).keys()))},union:function(){for(var t=[],e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){Array.isArray(e)&&(t=t.concat(e.filter((function(e){return!t.includes(e)}))))})),t},intersection:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0]||[];return e.forEach((function(t){Array.isArray(t)&&(r=r.filter((function(e){return t.includes(e)})))})),r},unionAll:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return[].concat(l(e)).flat().filter((function(t){return!!t}))},difference:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.union.apply(this,l(n)).filter((function(e){return!t.intersection.apply(t,l(n)).includes(e)}))}},f={getUrlParams:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,r=new URL(t),a=r.search,i=r.hash,o=[a,i],s={},c=0;c<o.length;c++){var u=o[c];if(u){var l=u.replace(/#|\//g,""),h=l.split("?");if(h.length>1)for(var f=1;f<h.length;f++)for(var d=void 0;d=n.exec(h[f]);)s[d[1]]=e?decodeURIComponent(d[2]):d[2]}}return s},getExplorer:function(){var t=window.navigator.userAgent;return t.indexOf("MSIE")>=0||window.ActiveXObject||"ActiveXObject"in window?"IE":t.indexOf("Firefox")>=0?"Firefox":t.indexOf("Chrome")>=0?"Chrome":t.indexOf("Opera")>=0?"Opera":t.indexOf("Safari")>=0?"Safari":void 0},detectOS:function(){var t="",e=-1!=navigator.userAgent.indexOf("Windows",0)?1:0,n=-1!=navigator.userAgent.indexOf("mac",0)?1:0,r=-1!=navigator.userAgent.indexOf("Linux",0)?1:0,a=-1!=navigator.userAgent.indexOf("X11",0)?1:0;return e?t="MS Windows":n?t="Apple mac":r?t="Linux":a&&(t="Unix"),t},switchFullScreen:function(t){if(t){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},refreshScale:function(){var t=document.documentElement.clientWidth,e=document.documentElement.clientHeight,n=document.getElementById("app").style,r=t/1920;t/e>16/9&&(r=e/1080),n.transformOrigin="left top",n.transform="scale("+r+") translateX(-49.99%)",n.width=t/r+"px"},getHtmlFontSize:function(){var t=document.documentElement.clientWidth||document.body.clientWidth;document.querySelector("html").style.fontSize=t/192+"px"}},d={set:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),document.cookie=t+"="+escape(e)+";expires="+r.toGMTString()},remove:function(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.get(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},get:function(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return null!=e?e[2]:""}},p={PI:3.141592653589793,XPI:52.35987755982988,delta:function(t,e){var n=6378245,r=.006693421622965943,a=this.transformLat(e-105,t-35),i=this.transformLon(e-105,t-35),o=t/180*this.PI,s=Math.sin(o);s=1-r*s*s;var c=Math.sqrt(s);return{lat:a=180*a/(n*(1-r)/(s*c)*this.PI),lng:i=180*i/(n/c*Math.cos(o)*this.PI)}},gcjEncrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};var n=this.delta(t,e);return{lat:t+n.lat,lng:e+n.lng}},gcjDecrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};var n=this.delta(t,e);return{lat:t-n.lat,lng:e-n.lng}},gcjDecryptExact:function(t,e){for(var n=.01,r=.01,a=t-n,i=e-r,o=t+n,s=e+r,c=void 0,u=void 0,l=0;;){c=(a+o)/2,u=(i+s)/2;var h=this.gcj_encrypt(c,u);if(n=h.lat-t,r=h.lng-e,Math.abs(n)<1e-9&&Math.abs(r)<1e-9)break;if(n>0?o=c:a=c,r>0?s=u:i=u,++l>1e4)break}return{lat:c,lng:u}},bdEncrypt:function(t,e){var n=e,r=t,a=Math.sqrt(n*n+r*r)+2e-5*Math.sin(r*this.XPI),i=Math.atan2(r,n)+3e-6*Math.cos(n*this.XPI),o=a*Math.cos(i)+.0065;return{lat:a*Math.sin(i)+.006,lng:o}},bdDecrypt:function(t,e){var n=e-.0065,r=t-.006,a=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.XPI),i=Math.atan2(r,n)-3e-6*Math.cos(n*this.XPI),o=a*Math.cos(i);return{lat:a*Math.sin(i),lng:o}},mercatorEncrypt:function(t,e){var n=20037508.34*e/180,r=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return{lat:r=20037508.34*r/180,lng:n}},mercatorDecrypt:function(t,e){var n=e/20037508.34*180,r=t/20037508.34*180;return{lat:r=180/this.PI*(2*Math.atan(Math.exp(r*this.PI/180))-this.PI/2),lng:n}},distance:function(t,e,n,r){var a=Math.cos(t*this.PI/180)*Math.cos(n*this.PI/180)*Math.cos((e-r)*this.PI/180)+Math.sin(t*this.PI/180)*Math.sin(n*this.PI/180);a>1&&(a=1),a<-1&&(a=-1);var i=6371e3*Math.acos(a);return i},outOfChina:function(t,e){return e<72.004||e>137.8347||(t<.8293||t>55.8271)},transformLat:function(t,e){var n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3},transformLon:function(t,e){var n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3}};Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t},Date.prototype.addDate=function(t,e){var n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+3*e);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+7*e);break;case"d":n.setDate(this.getDate()+e);break;case"h":n.setHours(this.getHours()+e);break;case"m":n.setMinutes(this.getMinutes()+e);break;case"s":n.setSeconds(this.getSeconds()+e);break;default:n.setDate(this.getDate()+e)}return n};var v={lastMonthDate:new Date((new Date).getFullYear(),(new Date).getMonth()-1,1),thisMonthDate:new Date((new Date).getFullYear(),(new Date).getMonth(),1),nextMonthDate:new Date((new Date).getFullYear(),(new Date).getMonth()+1,1),lastWeekDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-7-(new Date).getDay()),thisWeekDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-(new Date).getDay()),nextWeekDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1+7-(new Date).getDay()),lastDayDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),thisDayDate:new Date((new Date).setHours(0,0,0,0)),nextDayDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),parseDate:function(t){if("string"==typeof t){var e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);if(e&&e.length>3)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/))&&e.length>6)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/))&&e.length>7)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]),parseInt(e[7]))}return null},formatDateInterval:function(t,e){var n=new Date(t),r=new Date(e).getTime()-n.getTime(),a=Math.floor(r/864e5),i=r%864e5,o=Math.floor(i/36e5),s=i%36e5,c=Math.floor(s/6e4),u=s%6e4,l=Math.round(u/1e3),h="";return a>0&&(h+=a+"天"),o>0&&(h+=o+"时"),c>0&&(h+=c+"分"),l>0&&(h+=l+"秒"),0===a&&0===o&&0===c&&0===l&&(h="少于1秒"),h},formatterCounter:function(t){var e=function(t){return(t>10?"":"0")+(t||0)},n=t%3600,r=n%60;return e(Math.floor(t/3600))+":"+e(Math.floor(n/60))+":"+e(Math.round(r))},sleep:function(t){for(var e=Date.now();Date.now()-e<=t;);}};function y(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function g(t){return y(t).split(/\s+/)}var m={getStyle:function(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return"auto"===n?null:n},create:function(t,e,n){var r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r},remove:function(t){var e=t.parentNode;e&&e.removeChild(t)},empty:function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront:function(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack:function(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass:function(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal},hasClass:function(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=this.getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(void 0!==t.classList)for(var n=g(e),r=0,a=n.length;r<a;r++)t.classList.add(n[r]);else if(!this.hasClass(t,e)){var i=this.getClass(t);this.setClass(t,(i?i+" ":"")+e)}},removeClass:function(t,e){void 0!==t.classList?g(e).forEach((function(e){return t.classList.remove(e)})):this.setClass(t,y((" "+this.getClass(t)+" ").replace(" "+e+" "," ")))},setClass:function(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e},parseFromString:function(t){return(new DOMParser).parseFromString(t,"text/xml").children[0]}},w={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},degreesToRadians:function(t){return t*this.DEG2RAD},toRadians:function(t){return t*this.DEG2RAD},radiansToDegrees:function(t){return t*this.RAD2DEG},toDegrees:function(t){return t*this.RAD2DEG},formatFloat:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}},M={toRadian:Math.PI/180,R:6371393,isLnglat:function(t,e){return!!(+e>-90&&+e<90&&+t>-180&&+t<180)},formatLnglat:function(t,e){var n="";function r(t){var e=parseFloat(t),n=parseInt(e),r=parseInt(60*(e-n));return n+"°"+r+"′"+(3600*(e-n)-60*r).toFixed(2)+"″"}return t&&e&&(n=r(t)+","+r(e)),n},transformLnglat:function(t,e){function n(t){for(var e=/[sw]/i.test(t)?-1:1,n=t.match(/[\d.]+/g),r=0,a=0,i=n.length;a<i;a++)r+=n[a]/e,e*=60;return r}if(t&&e)return{lng:n(t),lat:n(e)}},rayCasting:function(t,e){for(var n=t.x,r=t.y,a=!1,i=0,o=e.length,s=o-1;i<o;s=i,i++){var c=e[i].x,u=e[i].y,l=e[s].x,h=e[s].y;if(c===n&&u===r||l===n&&h===r)return"on";if(u<r&&h>=r||u>=r&&h<r){var f=c+(r-u)*(l-c)/(h-u);if(f===n)return"on";f>n&&(a=!a)}}return a?"in":"out"},wgs84PointsDistance:function(t,e){var n=Math.PI;function r(t){return t*n/180}if(2!=arguments.length)return 0;lon1=t.x,lat1=t.y,lon2=e.x,lat2=e.y;var a,i=6378137,o=6356752.3142,s=1/298.257223563,c=r(lon2-lon1),u=Math.atan((1-s)*Math.tan(r(lat1))),l=Math.atan((1-s)*Math.tan(r(lat2))),h=Math.sin(u),f=Math.cos(u),d=Math.sin(l),p=Math.cos(l),v=c,y=100;do{var g=Math.sin(v),m=Math.cos(v),w=Math.sqrt(p*g*(p*g)+(f*d-h*p*m)*(f*d-h*p*m));if(0==w)return 0;var M=h*d+f*p*m,E=Math.atan2(w,M),b=f*p*g/w,R=1-b*b,O=M-2*h*d/R;isNaN(O)&&(O=0);var S=s/16*R*(4+s*(4-3*R));a=v,v=c+(1-S)*s*b*(E+S*w*(O+S*M*(2*O*O-1)))}while(Math.abs(v-a)>1e-12&&--y>0);if(0==y)return NaN;var A=R*(i*i-o*o)/(o*o),D=1+A/16384*(4096+A*(A*(320-175*A)-768)),_=A/1024*(256+A*(A*(74-47*A)-128)),x=_*w*(O+_/4*(M*(2*O*O-1)-_/6*O*(4*w*w-3)*(4*O*O-3))),T=o*D*(E-x);Math.atan2(p*g,f*d-h*p*m),Math.atan2(f*g,-h*p+f*d*m);return T},rotatePoint:function(t,e,n){return{x:(t.x-e.x)*Math.cos(Math.PI/180*-n)-(t.y-e.y)*Math.sin(Math.PI/180*-n)+e.x,y:(t.x-e.x)*Math.sin(Math.PI/180*-n)+(t.y-e.y)*Math.cos(Math.PI/180*-n)+e.y}},calcBearAndDisByPoints:function(t,e){var n=parseFloat(t.lat),r=parseFloat(t.lng),a=parseFloat(e.lat),i=parseFloat(e.lng),o=Math.sin((i-r)*this.toRadian)*Math.cos(a*this.toRadian),s=Math.cos(n*this.toRadian)*Math.sin(a*this.toRadian)-Math.sin(n*this.toRadian)*Math.cos(a*this.toRadian)*Math.cos((i-r)*this.toRadian),c=Math.atan2(o,s)*(180/Math.PI),u=(a-n)*this.toRadian,l=(i-r)*this.toRadian,h=Math.sin(u/2)*Math.sin(u/2)+Math.cos(n*this.toRadian)*Math.cos(a*this.toRadian)*Math.sin(l/2)*Math.sin(l/2),f=2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h));return{angle:c,distance:this.R*f}},calcPointByBearAndDis:function(t,e,n){var r=w.toRadians(parseFloat(t.lat)),a=w.toRadians(parseFloat(t.lng));e=parseFloat(e);var i=(n=parseFloat(n))/this.R;e=w.toRadians(e);var o=Math.asin(Math.sin(r)*Math.cos(i)+Math.cos(r)*Math.sin(i)*Math.cos(e)),s=a+Math.atan2(Math.sin(e)*Math.sin(i)*Math.cos(r),Math.cos(i)-Math.sin(r)*Math.sin(o));return{lat:w.toDegrees(o),lng:w.toDegrees(s)}},mercatorTolonlat:function(t,e){var n=e/20037508.34*180;return{lng:t/20037508.34*180,lat:180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2)}},lonlatToMercator:function(t,e){var n=t*Math.PI/180*6378137,r=e*Math.PI/180;return{x:n,y:3189068.5*Math.log((1+Math.sin(r))/(1-Math.sin(r)))}}},E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b={convertBase64ToBlob:function(t){for(var e=t.split(",")[0].split(":")[1].split(";")[0],n=window.atob(t.split(",")[1]),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;return o?((o=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder)).append(r),o.getBlob(e)):o=new Blob([r],{type:e})},convertUrlToBase64:function(t,e,n){return new Promise((function(r,a){var i=new Image;i.crossOrigin="Anonymous",i.src=t,i.onload=function(){var t=document.createElement("canvas");t.width=e||i.width,t.height=n||i.height,t.getContext("2d").drawImage(i,0,0,i.width,i.height);var a=i.src.substring(i.src.lastIndexOf(".")+1).toLowerCase(),o=t.toDataURL("image/"+a);r({dataURL:o,type:"image/"+a,ext:a})}}))},convertBase64ToFile:function(t,e){for(var n=t.split(","),r=n[0].match(/:(.*?);/)[1],a=atob(n[1]),i=a.length,o=new Uint8Array(i);i--;)o[i]=a.charCodeAt(i);return new File([o],e,{type:r})},downloadFromFile:function(t,e){if("object"==(void 0===t?"undefined":E(t)))if(t instanceof Blob)t=URL.createObjectURL(t);else{var n=JSON.stringify(t),r=new Blob([n],{type:"text/json"});t=window.URL.createObjectURL(r)}else if("string"==typeof t&&-1===t.indexOf("http")){var a=new Blob([t],{type:"text/json"});t=window.URL.createObjectURL(a)}var i=document.createElement("a");i.href=t,i.download=e||"",i.click(),window.URL.revokeObjectURL(i.href)}},R={debounce:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=void 0,a=void 0,i=void 0,o=void 0,s=void 0,c=function c(){var u=+new Date-o;u<e&&u>0?r=setTimeout(c,e-u):(r=null,n||(s=t.apply(i,a),r||(i=a=null)))};return function(){for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];i=this,o=+new Date;var h=n&&!r;return r||(r=setTimeout(c,e)),h&&(s=t.apply(i,u),i=u=null),s}},throttle:function(t,e,n){if(1===n)var r=0;else if(2===n)var a;return function(){var i=this,o=arguments;if(1===n){var s=Date.now();s-r>e&&(t.apply(i,o),r=s)}else 2===n&&(a||(a=setTimeout((function(){a=null,t.apply(i,o)}),e)))}},recurve:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=0;setTimeout((function a(){++r<Math.floor(n/e)&&(t.call(this),setTimeout(a,e))}))}},O={checkStr:function(t,e){switch(e){case"phone":return/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(t);case"tel":return/^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/.test(t);case"card":return/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t);case"pwd":return/^[a-zA-Z]\w{5,17}$/.test(t);case"postal":return/[1-9]\d{5}(?!\d)/.test(t);case"QQ":return/^[1-9][0-9]{4,9}$/.test(t);case"email":return/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(t);case"money":return/^\d*(?:\.\d{0,2})?$/.test(t);case"URL":return/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(t);case"IP":return/((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))/.test(t);case"date":return/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})(?:\:\d{2}|:(\d{2}):(\d{2}))$/.test(t)||/^(\d{4})\-(\d{2})\-(\d{2})$/.test(t);case"number":return/^[0-9]$/.test(t);case"english":return/^[a-zA-Z]+$/.test(t);case"chinese":return/^[\u4E00-\u9FA5]+$/.test(t);case"lower":return/^[a-z]+$/.test(t);case"upper":return/^[A-Z]+$/.test(t);case"HTML":return/<("[^"]*"|'[^']*'|[^'">])*>/.test(t);default:return!0}},changeCase:function(t,e){switch(e=e||4){case 1:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toUpperCase()+t.substring(1).toLowerCase()}));case 2:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toLowerCase()+t.substring(1).toUpperCase()}));case 3:return t.split("").map((function(t){return/[a-z]/.test(t)?t.toUpperCase():t.toLowerCase()})).join("");case 4:return t.toUpperCase();case 5:return t.toLowerCase();default:return t}},tag:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n=n.map((function(t){switch(u.getDataType(t)){case"Object":return t||"{}";case"Array":return t||"[]";default:return t||""}})),t.reduce((function(t,e,r){return""+t+n[r-1]+e}))},getByteLength:function(t){return t.replace(/[\u0391-\uFFE5]/g,"aa").length},subStringByte:function(t,e,n){var r=/[^\x00-\xff]/g;if(t.replace(r,"mm").length<=n)return t;for(var a=Math.floor(n/2);a<t.length;a++){var i=t.substring(e,a);if(i.replace(r,"mm").length>=n)return i}return t},asString:function(t){if(u.isEmpty(t))return"";switch(u.getDataType()){case"Object":case"Array":return JSON.stringify(t);default:return t}}},S={notNull:function(t){if(u.isEmpty())throw Error("不能为空:>>>"+t)},legalLnglat:function(t,e){if(!M.isLnglat(t,e))throw Error(i.COORDINATE_ERROR)},verify:{array:function(t){if("Array"!==u.getDataType(t))throw Error(i.PARAMETER_ERROR_ARRAY+":>>>"+t)},function:function(t){if("Function"!==u.getDataType(t))throw Error(i.PARAMETER_ERROR_FUNCTION+":>>>"+t)},object:function(t){if("Object"!==u.getDataType(t))throw Error(i.PARAMETER_ERROR_OBJECT+":>>>"+t)}},legalJSON:function(t){try{JSON.parse(t)}catch(e){throw Error(i.JSON_PARSE_ERROR+":>>>"+t)}},legalData:function(t,e){var n=O.checkStr(t,e),r="";switch(e){case"phone":r="电话";break;case"tel":r="座机";break;case"card":r="身份证";break;case"pwd":r="密码";break;case"postal":r="邮政编码";break;case"QQ":r="QQ";break;case"email":r="邮箱";break;case"money":r="金额";break;case"URL":r="网址";break;case"IP":r="IP";break;case"date":r="日期时间";break;case"number":r="数字";break;case"english":r="英文";break;case"chinese":r="中文";break;case"lower":r="小写";break;case"upper":r="大写";break;case"HTML":r="HTML标记"}if(!n)throw Error(i.PARAMETER_ERROR+":>>>不是"+r)}},A=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var D=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.audio=new Audio,this.audio.src=e}return A(t,[{key:"play",value:function(){!this.muted&&this.audio.play()}},{key:"pause",value:function(){this.audio.pause()}},{key:"muted",get:function(){return this.audio.muted},set:function(t){this.audio.muted=t}}]),t}(),_=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var x=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"String"===u.getDataType(e)&&(e=document.querySelector("#"+e)),this.ctx=e.getContext("2d")}return _(t,[{key:"drawLine",value:function(t,e,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};this.cxt.beginPath();var i=a.width||1,o=a.color||"#000";this.cxt.lineWidth=i,this.cxt.fillStyle=o,this.cxt.moveTo(t,e),this.cxt.lineTo(n,r),this.cxt.closePath(),this.cxt.fill()}},{key:"drawArc",value:function(t,e,n,r,a,i,o,s){o?(this.cxt.fillStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,w.degreesToRadians(r),w.degreesToRadians(a),i),this.cxt.closePath(),this.cxt.fill()):(this.cxt.strokeStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,w.degreesToRadians(r),w.degreesToRadians(a),i),this.cxt.stroke())}}]),t}(),T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var P=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(C(this,t),"string"==typeof e)if("<"==e.charAt(0)&&">"==e.slice(-1)){var r=e.slice(1,-1);this[0]=document.createElement(r),this.length=1}else{for(var a=n.querySelectorAll(e),i=0;i<a.length;i++)this[i]=a[i];this.length=a.length}else{if(void 0===e)return this;"function"==typeof e?this.ready(e):1==e.nodeType&&(this[0]=e,this.length=1)}}return I(t,[{key:"each",value:function(t){for(var e=0;e<this.length;e++)t(this[e],e)}},{key:"html",value:function(t){return this.each((function(e){e.innerHTML=t})),this}},{key:"css",value:function(t,e){return this.each((function(n){if("object"==(void 0===t?"undefined":T(t)))for(var r in t)"width"!=r&&"height"!=r&&"margin"!=r&&"fontSize"!=r||(n.style[r]=parseInt(t[r])+"px"),n.style[r]=t[r];else n.style[t]=e})),this}},{key:"ready",value:function(t){var e=this;document.addEventListener("DOMContentLoaded",(function(n){t.call(e,n)}))}},{key:"click",value:function(t){return this.each((function(e){var n=this;e.onclick=function(r){t.call(n,r,e)}})),this}},{key:"on",value:function(t,e){var n=this;this.each((function(r){r.removeEventListener(t,(function(t){e.call(n,t)})),r.addEventListener(t,(function(t){e.call(n,t)}))}))}},{key:"appendTo",value:function(t){if("string"==typeof t)for(var e=document.querySelectorAll(t),n=this[0],r=0;r<e.length;r++)this[r]=n.cloneNode(!0),e[r].appendChild(this[r]),this.length=e.length;else t.appendChild(this[0]);return this}}]),t}(),k=P;function L(){}window.$=function(t,e){return new P(t,e)},Object.assign(L.prototype,{addEventListener:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];void 0===this._listeners&&(this._listeners={}),this._mutex=this._mutex||{},this._context=n;var a=this._mutex,i=this._listeners;return void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&(r&&(a[t]=e),i[t].push(e)),this},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),void 0!==n){var r=n.map((function(t){return t.toString()})).indexOf(e.toString());-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){var e=this;if(void 0!==this._listeners){var n=this._listeners[t.type];if(void 0!==n){t.target=this;var r=n.slice(0);if(this._mutex[t.type])return void r.find((function(n){return n===e._mutex[t.type]})).call(this._context||this,t);for(var a=0,i=r.length;a<i;a++)r[a].call(this._context||this,t)}}},removeAllListener:function(){for(var t in this._mutex={},this._listeners)this._listeners[t]=[]}});var N=L;function F(){return new Map}Object.assign(Map.prototype,{isEmpty:function(){return 0===this.size},_values:function(){return Array.from(Map.prototype.values.call(this))},_keys:function(){return Array.from(Map.prototype.keys.call(this))},_entries:function(){return Array.from(Map.prototype.entries.call(this))}}),F.fromEntries=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=new F;return t.forEach((function(t){Array.isArray(t)&&2===t.length&&e.set(t[0],t[1])})),e};var U=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var W=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ws://127.0.0.1:10088";j(this,e);var n=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.maxCheckTimes=10,n.url=t,n.checkTimes=0,n.connectStatus=!1,n.connect(),n.connCheckStatus(n.maxCheckTimes),e.instance=n,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),U(e,[{key:"connect",value:function(){if(this.disconnect(),this.url)try{if(console.info("创建ws连接>>>"+this.url),this.client=new WebSocket(this.url),this.client){var t=this;this.client.onopen=function(e){t.dispatchEvent({type:a.WEB_SOCKET_CONNECT,message:e})},this.client.onmessage=function(e){t.connectStatus=!0,t.dispatchEvent({type:a.WEB_SOCKET_MESSAGE,message:e})},this.client.onclose=function(e){t.dispatchEvent({type:a.WEB_SOCKET_CLOSE,message:e})},this.checkTimes===this.maxCheckTimes&&(this.client.onerror=function(e){t.dispatchEvent({type:a.WEB_SOCKET_ERROR,message:e})})}}catch(t){console.error("创建ws连接失败"+this.url+":"+t)}}},{key:"disconnect",value:function(){if(this.client)try{console.log("ws断开连接"+this.url),this.client.close(),this.client=null}catch(t){this.client=null}}},{key:"connCheckStatus",value:function(t){var e=this;this.checkTimes>t||setTimeout((function(){e.checkTimes++,e.client&&0!==e.client.readyState&&1!==e.client.readyState&&e.connect(),e.connCheckStatus(t)}),2e3)}},{key:"send",value:function(t){return this.client&&1===this.client.readyState?(this.client.send(t),!0):(console.error(this.url+"消息发送失败:"+t),!1)}},{key:"heartbeat",value:function(){var t=this;setTimeout((function(){t.client&&1===t.client.readyState&&t.send("HeartBeat"),console.log("HeartBeat,"+t.url),setTimeout(t.heartbeat,3e4)}),1e3)}}],[{key:"getInstance",value:function(){return e.instance?e.instance:Object.freeze(new e)}},{key:"_instance",get:function(){return this.getInstance()}}]),e}(N),G=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var q=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if($(this,t),this.cacheType=e,1===e)this.storage=window.localStorage;else{if(2!==e)throw new Error(i.PARAMETER_ERROR);this.storage=window.sessionStorage}}return G(t,[{key:"setItem",value:function(t,e,n){var r={key:t,value:e};if(1===this.cacheType){var a=Date.now();n&&(r.expired=a+1e3*n)}return this.storage[t]=JSON.stringify(r),r}},{key:"getItem",value:function(t){var e=this.storage.getItem(t)||null,n=JSON.parse(e)||{};if(1===this.cacheType){var r=n.expired||Date.now();if(Date.now()>r)return this.remove(t),null}return n.value}},{key:"remove",value:function(t){var e=this;t&&(t.indexOf(",")>-1?t.split(",").forEach((function(t){e.storage.removeItem(t)})):this.storage.removeItem(t))}},{key:"clear",value:function(){this.storage.clear()}}]),t}(),Y=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var H=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;z(this,t),this.magnification=e}return Y(t,[{key:"_getSystem",value:function(){if(navigator.userAgent.toLowerCase().indexOf("windows")>=0)return!0}},{key:"_addHandler",value:function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}},{key:"_correct",value:function(){var t=window.innerWidth;if("number"!=typeof t&&(t="CSS1Compat"==document.compatMode?document.documentElement.clientWidth:document.body.clientWidth),t<=750){var e=document.documentElement.clientWidth/t;document.documentElement.style.fontSize=75*this.magnification*Math.min(e,2)+"px"}else if(t>750&&t<=1200){var n=document.documentElement.clientWidth/t;document.documentElement.style.fontSize=85*this.magnification*Math.min(n,2)+"px"}else{var r=document.documentElement.clientWidth/1920;document.documentElement.style.fontSize=100*this.magnification*Math.min(r,2)+"px"}}},{key:"_watch",value:function(){var t=this;t._addHandler(window,"resize",(function(){t._correct()}))}},{key:"init",value:function(){var t=this;t._getSystem()&&(t._correct(),t._watch())}}]),t}()}])}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Gis",[],e):"object"==typeof exports?exports.Gis=e():t.Gis=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist/",n(n.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"AnimateUtils",(function(){return r})),n.d(e,"ArrayUtils",(function(){return h})),n.d(e,"BrowserUtils",(function(){return f})),n.d(e,"Cookie",(function(){return d})),n.d(e,"CoordsUtils",(function(){return p})),n.d(e,"DateUtils",(function(){return v})),n.d(e,"DomUtils",(function(){return m})),n.d(e,"GeoUtils",(function(){return E})),n.d(e,"FileUtils",(function(){return b})),n.d(e,"MathUtils",(function(){return w})),n.d(e,"OptimizeUtils",(function(){return R})),n.d(e,"StringUtils",(function(){return O})),n.d(e,"AssertUtils",(function(){return S})),n.d(e,"Utils",(function(){return u})),n.d(e,"EventType",(function(){return a})),n.d(e,"ErrorType",(function(){return i})),n.d(e,"LayerType",(function(){return o})),n.d(e,"GraphicType",(function(){return s})),n.d(e,"MeasureMode",(function(){return c})),n.d(e,"AudioPlayer",(function(){return D})),n.d(e,"CanvasDrawer",(function(){return x})),n.d(e,"ElQuery",(function(){return k})),n.d(e,"EventDispatcher",(function(){return N})),n.d(e,"HashMap",(function(){return F})),n.d(e,"WebSocketClient",(function(){return W})),n.d(e,"WebStorage",(function(){return q})),n.d(e,"DevicePixelRatio",(function(){return z}));var r={animate:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"swing",a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:5;for(var i in e)e[i]={target:"opacity"===i?parseInt(100*e[i]):e[i],iNow:"opacity"===i?parseInt(100*getComputedStyle(t)[i]):parseInt(getComputedStyle(t)[i])};"liner"===r&&(a=e[i].iNow<e[i].target?Math.abs(a):-Math.abs(a)),clearInterval(t.timer),t.timer=setInterval((function(){for(var i in e){var o=e[i].target,s=e[i].iNow;if("swing"===r&&(a=(a=(o-s)/20)>0?Math.ceil(a):Math.floor(a)),Math.abs(o-s)<=Math.abs(a)){for(var c in t.style[i]="opacity"===i?o/100:o+"px",delete e[i],e)return!1;clearInterval(t.timer),"function"==typeof n&&n()}else e[i].iNow+=a,t.style[i]="opacity"===i?e[i].iNow/100:e[i].iNow+"px"}}),30)}},a={MAP_RENDER:"mapRender",MAP_READY:"mapReady",MOUSE_CLICK:"click",MOUSE_DOUBLE_CLICK:"dblclick",MOUSE_MOVE:"mousemove",MOUSE_IN:"mousein",MOUSE_OUT:"mouseout",MOUSE_RIGHT_CLICK:"mouseRightClick",KEY_DOWN:"keyDown",KEY_UP:"keyUp",DRAW_ACTIVE:"drawActive",DRAW_MOVE:"drawMove",DRAW_COMPLETE:"drawComplete",MQTT_CONNECT:"mqttConnect",MQTT_ERROR:"mqttError",MQTT_MESSAGE:"mqttMessage",MQTT_CLOSE:"mqttClose",WEB_SOCKET_CONNECT:"webSocketConnect",WEB_SOCKET_ERROR:"webSocketError",WEB_SOCKET_MESSAGE:"webSocketMessage",WEB_SOCKET_CLOSE:"webSocketClose"},i={LOGIN_EXPIRED:"登录信息过期,请重新登录",CROSS_ERROR:"跨域访问",UNEXIST_RESOURCE:"资源不存在",TIMEOUT:"请求超时",INTERNAL_ERROR:"内部错误",NETWORK_ERROR:"请求失败,请检查网络是否已连接",PROCESS_FAIL:"处理失败",AUTH_VERIFY_ERROR:"权限验证失败",NO_DATA_FOUND:"未找到数据",DUPLICATE_INSTANCE:"实例为单例模式,不允许重复构建",COORDINATE_ERROR:"坐标验证失败",JSON_PARSE_ERROR:"JSON解析失败,格式有误",JSON_VALUE_ERROR:"JSON无此键",PARAMETER_ERROR:"验证数据类型失败",PARAMETER_ERROR_ARRAY:"格式类型验证失败:必须是数组",PARAMETER_ERROR_STRING:"格式类型验证失败:必须是字符",PARAMETER_ERROR_FUNCTION:"格式类型验证失败:必须是函数",PARAMETER_ERROR_OBJECT:"格式类型验证失败:必须是对象",PARAMETER_ERROR_LACK:"参数缺失",STRING_CHECK_LOSS:"字符缺少关键字"},o={SUPER_MAP_IMAGES:"SuperMapImages",SUPER_MAP_DATA:"SuperMapData",ARC_GIS_MAP_IMAGES:"ArcGisMapImages",ARC_GIS_MAP_DATA:"ArcGisMapData",OSGB_LAYER:"OSGBLayer",S3M_GROUP:"S3MGroup",TERRAIN_LAYER:"TerrainFileLayer"},s={POINT:"point",POLYLINE:"polyline",POLYGON:"polygon",BILLBOARD:"billboard",CYLINDER:"cylinder",ELLIPSOID:"ellipsoid",LABEL:"label",MODEL:"model",WALL:"wall"},c={DISTANCE:"distance",AREA:"area",HEIGHT:"height"},u={getDataType:function(t){return Object.prototype.toString.call(t).slice(8,-1)},isEmpty:function(t){if(null==t)return!0;switch(this.getDataType(t)){case"String":return""===t.trim();case"Array":return!t.length;case"Object":return!Object.keys(t).length;case"Boolean":return!t;default:return!1}},isNotEmpty:function(t){return!this.isEmpty(t)},json2form:function(t){var e=new FormData;return Object.keys(t).forEach((function(n){e.append(n,t[n]instanceof Object?JSON.stringify(t[n]):t[n])})),e},json2Query:function(t){var e=[];for(var n in t){var r=n,a=t[n];e.push(r+"="+a)}return e.join("&")},generateGuid:function(){var t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+t()+t()+t()+t()+t()+t()+t()},decodeDict:function(){for(var t="",e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];if(n.length>1){for(var a=n.slice(1,n.length%2==0?n.length-1:n.length),i=0;i<a.length;i+=2){var o=a[i];n[0]===o&&(t=a[i+1])}t||n.length%2!=0||(t=n[n.length-1])}else t=n[0];return t},extend:function(t){for(var e=void 0,n=void 0,r=void 0,a=void 0,i=arguments.length,o=Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];for(n=0,r=o.length;n<r;n++)for(e in a=o[n])t[e]=a[e];return t},rgb2hex:function(t){return"#"+((1<<24)+(t[0]<<16)+(t[1]<<8)+t[2]).toString(16).slice(1)},convertToTree2:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"parentId",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"children",a=[];function i(a){var o=a[e],s=t.filter((function(t){return t.hasOwnProperty(n)&&t[n]===o}));s.length>0&&(s.forEach(i),a[r]=s)}var o=function(r){-1===t.findIndex((function(t){return t[e]===r[n]}))&&(i(r),a.push(r))},s=!0,c=!1,u=void 0;try{for(var l,h=t[Symbol.iterator]();!(s=(l=h.next()).done);s=!0){var f=l.value;o(f)}}catch(t){c=!0,u=t}finally{try{!s&&h.return&&h.return()}finally{if(c)throw u}}return a},asyncLoadScript:function(t){return new Promise((function(e,n){try{var r=document.createElement("script");r.readyState?r.onreadystatechange=function(){"complete"!==r.readyState&&"loaded"!==r.readyState||e(r)}:r.onload=function(){e(r)},r.type="text/javascript",r.src=t,document.body.appendChild(r)}catch(t){n(t)}}))},loadStyle:function(t){t.forEach((function(t){var e=document.createElement("link");e.href=t,e.rel="stylesheet",e.type="text/css",document.head.appendChild(e)}))},template:function(t,e){return t.replace(/\{ *([\w_-]+) *\}/g,(function(t,n){var r=e[n];if(void 0===r)throw new Error(i.JSON_VALUE_ERROR+t);return"function"==typeof r&&(r=r(e)),r}))},deleteEmptyProperty:function(t){var e=this;return Object.fromEntries(Object.keys(t).filter((function(n){return!e.isEmpty(t[n])})).map((function(e){return[e,t[e]]})))},deepAssign:function(){var t=arguments.length,e=arguments[0];"Object"!==this.getDataType(e)&&(e={});for(var n=1;n<t;n++){var r=arguments[n];if("Object"===this.getDataType(r))for(var a in r)"__proto__"!==a&&e!==r[a]&&("Object"===this.getDataType(r[a])?e[a]=this.deepAssign(e[a],r[a]):e[a]=r[a])}return e},handleCopyValue:function(t){if(!navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(t);var e=document.createElement("textarea");return e.style.position="fixed",e.style.top=e.style.left="-100vh",e.style.opacity="0",e.value=t,document.body.appendChild(e),e.focus(),e.select(),new Promise((function(t,n){document.execCommand("copy")?t():n(new Error("copy failed")),e.remove()}))}};function l(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}Array.prototype.groupBy=function(t){var e={};return this.forEach((function(n){var r=JSON.stringify(t(n));e[r]=e[r]||[],e[r].push(n)})),Object.keys(e).map((function(t){return e[t]}))},Array.prototype.distinct=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t},e=[],n={};return this.forEach((function(r){var a=t(r);!n[a]&&(n[a]=e.push(r))})),e},Array.prototype.max=function(){return Math.max.apply({},this)},Array.prototype.min=function(){return Math.min.apply({},this)},Array.prototype.sum=function(){return this.length>0?this.reduce((function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t+e})):0},Array.prototype.avg=function(){return this.length?this.sum()/this.length:0},Array.prototype.desc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return this.sort((function(e,n){return t(n)-t(e)}))},Array.prototype.asc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(t){return t};return this.sort((function(e,n){return t(e)-t(n)}))},Array.prototype.clear=function(){return this.length=0,this};var h={asArray:function(t){return u.isEmpty(t)?[]:Array.isArray(t)?t:[t]},generateArray:function(t){return[].concat(l(new Array(t).keys()))},union:function(){for(var t=[],e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach((function(e){Array.isArray(e)&&(t=t.concat(e.filter((function(e){return!t.includes(e)}))))})),t},intersection:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=e[0]||[];return e.forEach((function(t){Array.isArray(t)&&(r=r.filter((function(e){return t.includes(e)})))})),r},unionAll:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return[].concat(l(e)).flat().filter((function(t){return!!t}))},difference:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return this.union.apply(this,l(n)).filter((function(e){return!t.intersection.apply(t,l(n)).includes(e)}))}},f={getUrlParams:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.href,e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=/([^&=]+)=([\w\W]*?)(&|$|#)/g,r=new URL(t),a=r.search,i=r.hash,o=[a,i],s={},c=0;c<o.length;c++){var u=o[c];if(u){var l=u.replace(/#|\//g,""),h=l.split("?");if(h.length>1)for(var f=1;f<h.length;f++)for(var d=void 0;d=n.exec(h[f]);)s[d[1]]=e?decodeURIComponent(d[2]):d[2]}}return s},getExplorer:function(){var t=window.navigator.userAgent;return t.indexOf("MSIE")>=0||window.ActiveXObject||"ActiveXObject"in window?"IE":t.indexOf("Firefox")>=0?"Firefox":t.indexOf("Chrome")>=0?"Chrome":t.indexOf("Opera")>=0?"Opera":t.indexOf("Safari")>=0?"Safari":void 0},detectOS:function(){var t="",e=-1!=navigator.userAgent.indexOf("Windows",0)?1:0,n=-1!=navigator.userAgent.indexOf("mac",0)?1:0,r=-1!=navigator.userAgent.indexOf("Linux",0)?1:0,a=-1!=navigator.userAgent.indexOf("X11",0)?1:0;return e?t="MS Windows":n?t="Apple mac":r?t="Linux":a&&(t="Unix"),t},switchFullScreen:function(t){if(t){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.msRequestFullscreen?e.msRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()}else document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},refreshScale:function(){var t=document.documentElement.clientWidth,e=document.documentElement.clientHeight,n=document.getElementById("app").style,r=t/1920;t/e>16/9&&(r=e/1080),n.transformOrigin="left top",n.transform="scale("+r+") translateX(-49.99%)",n.width=t/r+"px"},getHtmlFontSize:function(){var t=document.documentElement.clientWidth||document.body.clientWidth;document.querySelector("html").style.fontSize=t/192+"px"}},d={set:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,r=new Date;r.setTime(r.getTime()+24*n*60*60*1e3),document.cookie=t+"="+escape(e)+";expires="+r.toGMTString()},remove:function(t){var e=new Date;e.setTime(e.getTime()-1);var n=this.get(t);null!=n&&(document.cookie=t+"="+n+";expires="+e.toGMTString())},get:function(t){var e=document.cookie.match(new RegExp("(^| )"+t+"=([^;]*)(;|$)"));return null!=e?e[2]:""}},p={PI:3.141592653589793,XPI:52.35987755982988,delta:function(t,e){var n=6378245,r=.006693421622965943,a=this.transformLat(e-105,t-35),i=this.transformLon(e-105,t-35),o=t/180*this.PI,s=Math.sin(o);s=1-r*s*s;var c=Math.sqrt(s);return{lat:a=180*a/(n*(1-r)/(s*c)*this.PI),lng:i=180*i/(n/c*Math.cos(o)*this.PI)}},gcjEncrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};var n=this.delta(t,e);return{lat:t+n.lat,lng:e+n.lng}},gcjDecrypt:function(t,e){if(this.outOfChina(t,e))return{lat:t,lng:e};var n=this.delta(t,e);return{lat:t-n.lat,lng:e-n.lng}},gcjDecryptExact:function(t,e){for(var n=.01,r=.01,a=t-n,i=e-r,o=t+n,s=e+r,c=void 0,u=void 0,l=0;;){c=(a+o)/2,u=(i+s)/2;var h=this.gcj_encrypt(c,u);if(n=h.lat-t,r=h.lng-e,Math.abs(n)<1e-9&&Math.abs(r)<1e-9)break;if(n>0?o=c:a=c,r>0?s=u:i=u,++l>1e4)break}return{lat:c,lng:u}},bdEncrypt:function(t,e){var n=e,r=t,a=Math.sqrt(n*n+r*r)+2e-5*Math.sin(r*this.XPI),i=Math.atan2(r,n)+3e-6*Math.cos(n*this.XPI),o=a*Math.cos(i)+.0065;return{lat:a*Math.sin(i)+.006,lng:o}},bdDecrypt:function(t,e){var n=e-.0065,r=t-.006,a=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.XPI),i=Math.atan2(r,n)-3e-6*Math.cos(n*this.XPI),o=a*Math.cos(i);return{lat:a*Math.sin(i),lng:o}},mercatorEncrypt:function(t,e){var n=20037508.34*e/180,r=Math.log(Math.tan((90+t)*this.PI/360))/(this.PI/180);return{lat:r=20037508.34*r/180,lng:n}},mercatorDecrypt:function(t,e){var n=e/20037508.34*180,r=t/20037508.34*180;return{lat:r=180/this.PI*(2*Math.atan(Math.exp(r*this.PI/180))-this.PI/2),lng:n}},distance:function(t,e,n,r){var a=Math.cos(t*this.PI/180)*Math.cos(n*this.PI/180)*Math.cos((e-r)*this.PI/180)+Math.sin(t*this.PI/180)*Math.sin(n*this.PI/180);a>1&&(a=1),a<-1&&(a=-1);var i=6371e3*Math.acos(a);return i},outOfChina:function(t,e){return e<72.004||e>137.8347||(t<.8293||t>55.8271)},transformLat:function(t,e){var n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3},transformLon:function(t,e){var n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3}};Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1===RegExp.$1.length?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t},Date.prototype.addDate=function(t,e){var n=new Date(this);switch(t){case"y":n.setFullYear(this.getFullYear()+e);break;case"q":n.setMonth(this.getMonth()+3*e);break;case"M":n.setMonth(this.getMonth()+e);break;case"w":n.setDate(this.getDate()+7*e);break;case"d":n.setDate(this.getDate()+e);break;case"h":n.setHours(this.getHours()+e);break;case"m":n.setMinutes(this.getMinutes()+e);break;case"s":n.setSeconds(this.getSeconds()+e);break;default:n.setDate(this.getDate()+e)}return n};var v={lastMonthDate:new Date((new Date).getFullYear(),(new Date).getMonth()-1,1),thisMonthDate:new Date((new Date).getFullYear(),(new Date).getMonth(),1),nextMonthDate:new Date((new Date).getFullYear(),(new Date).getMonth()+1,1),lastWeekDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-7-(new Date).getDay()),thisWeekDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1-(new Date).getDay()),nextWeekDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1+7-(new Date).getDay()),lastDayDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),thisDayDate:new Date((new Date).setHours(0,0,0,0)),nextDayDate:new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),parseDate:function(t){if("string"==typeof t){var e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);if(e&&e.length>3)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/))&&e.length>6)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]));if((e=t.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/))&&e.length>7)return new Date(parseInt(e[1]),parseInt(e[2])-1,parseInt(e[3]),parseInt(e[4]),parseInt(e[5]),parseInt(e[6]),parseInt(e[7]))}return null},formatDateInterval:function(t,e){var n=new Date(t),r=new Date(e).getTime()-n.getTime(),a=Math.floor(r/864e5),i=r%864e5,o=Math.floor(i/36e5),s=i%36e5,c=Math.floor(s/6e4),u=s%6e4,l=Math.round(u/1e3),h="";return a>0&&(h+=a+"天"),o>0&&(h+=o+"时"),c>0&&(h+=c+"分"),l>0&&(h+=l+"秒"),0===a&&0===o&&0===c&&0===l&&(h="少于1秒"),h},formatterCounter:function(t){var e=function(t){return(t>10?"":"0")+(t||0)},n=t%3600,r=n%60;return e(Math.floor(t/3600))+":"+e(Math.floor(n/60))+":"+e(Math.round(r))},sleep:function(t){for(var e=Date.now();Date.now()-e<=t;);}};function g(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function y(t){return g(t).split(/\s+/)}var m={getStyle:function(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return"auto"===n?null:n},create:function(t,e,n){var r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r},remove:function(t){var e=t.parentNode;e&&e.removeChild(t)},empty:function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},toFront:function(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)},toBack:function(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)},getClass:function(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal},hasClass:function(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=this.getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(void 0!==t.classList)for(var n=y(e),r=0,a=n.length;r<a;r++)t.classList.add(n[r]);else if(!this.hasClass(t,e)){var i=this.getClass(t);this.setClass(t,(i?i+" ":"")+e)}},removeClass:function(t,e){void 0!==t.classList?y(e).forEach((function(e){return t.classList.remove(e)})):this.setClass(t,g((" "+this.getClass(t)+" ").replace(" "+e+" "," ")))},setClass:function(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e},parseFromString:function(t){return(new DOMParser).parseFromString(t,"text/xml").children[0]}},w={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},degreesToRadians:function(t){return t*this.DEG2RAD},toRadians:function(t){return t*this.DEG2RAD},radiansToDegrees:function(t){return t*this.RAD2DEG},toDegrees:function(t){return t*this.RAD2DEG},formatFloat:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Math.round(t*Math.pow(10,e))/Math.pow(10,e)}},E={toRadian:Math.PI/180,R:6371393,isLnglat:function(t,e){return t&&e&&!!(+e>-90&&+e<90&&+t>-180&&+t<180)},formatLnglat:function(t,e){var n="";function r(t){var e=parseFloat(t),n=parseInt(e),r=parseInt(60*(e-n));return n+"°"+r+"′"+(3600*(e-n)-60*r).toFixed(2)+"″"}return t&&e&&(n=r(t)+","+r(e)),n},transformLnglat:function(t,e){function n(t){for(var e=/[sw]/i.test(t)?-1:1,n=t.match(/[\d.]+/g),r=0,a=0,i=n.length;a<i;a++)r+=n[a]/e,e*=60;return r}if(t&&e)return{lng:n(t),lat:n(e)}},rayCasting:function(t,e){for(var n=t.x,r=t.y,a=!1,i=0,o=e.length,s=o-1;i<o;s=i,i++){var c=e[i].x,u=e[i].y,l=e[s].x,h=e[s].y;if(c===n&&u===r||l===n&&h===r)return"on";if(u<r&&h>=r||u>=r&&h<r){var f=c+(r-u)*(l-c)/(h-u);if(f===n)return"on";f>n&&(a=!a)}}return a?"in":"out"},wgs84PointsDistance:function(t,e){var n=Math.PI;function r(t){return t*n/180}if(2!=arguments.length)return 0;lon1=t.x,lat1=t.y,lon2=e.x,lat2=e.y;var a,i=6378137,o=6356752.3142,s=1/298.257223563,c=r(lon2-lon1),u=Math.atan((1-s)*Math.tan(r(lat1))),l=Math.atan((1-s)*Math.tan(r(lat2))),h=Math.sin(u),f=Math.cos(u),d=Math.sin(l),p=Math.cos(l),v=c,g=100;do{var y=Math.sin(v),m=Math.cos(v),w=Math.sqrt(p*y*(p*y)+(f*d-h*p*m)*(f*d-h*p*m));if(0==w)return 0;var E=h*d+f*p*m,M=Math.atan2(w,E),b=f*p*y/w,R=1-b*b,O=E-2*h*d/R;isNaN(O)&&(O=0);var S=s/16*R*(4+s*(4-3*R));a=v,v=c+(1-S)*s*b*(M+S*w*(O+S*E*(2*O*O-1)))}while(Math.abs(v-a)>1e-12&&--g>0);if(0==g)return NaN;var A=R*(i*i-o*o)/(o*o),D=1+A/16384*(4096+A*(A*(320-175*A)-768)),_=A/1024*(256+A*(A*(74-47*A)-128)),x=_*w*(O+_/4*(E*(2*O*O-1)-_/6*O*(4*w*w-3)*(4*O*O-3))),T=o*D*(M-x);Math.atan2(p*y,f*d-h*p*m),Math.atan2(f*y,-h*p+f*d*m);return T},rotatePoint:function(t,e,n){return{x:(t.x-e.x)*Math.cos(Math.PI/180*-n)-(t.y-e.y)*Math.sin(Math.PI/180*-n)+e.x,y:(t.x-e.x)*Math.sin(Math.PI/180*-n)+(t.y-e.y)*Math.cos(Math.PI/180*-n)+e.y}},calcBearAndDisByPoints:function(t,e){var n=parseFloat(t.lat),r=parseFloat(t.lng),a=parseFloat(e.lat),i=parseFloat(e.lng),o=Math.sin((i-r)*this.toRadian)*Math.cos(a*this.toRadian),s=Math.cos(n*this.toRadian)*Math.sin(a*this.toRadian)-Math.sin(n*this.toRadian)*Math.cos(a*this.toRadian)*Math.cos((i-r)*this.toRadian),c=Math.atan2(o,s)*(180/Math.PI),u=(a-n)*this.toRadian,l=(i-r)*this.toRadian,h=Math.sin(u/2)*Math.sin(u/2)+Math.cos(n*this.toRadian)*Math.cos(a*this.toRadian)*Math.sin(l/2)*Math.sin(l/2),f=2*Math.atan2(Math.sqrt(h),Math.sqrt(1-h));return{angle:c,distance:this.R*f}},calcPointByBearAndDis:function(t,e,n){var r=w.toRadians(parseFloat(t.lat)),a=w.toRadians(parseFloat(t.lng));e=parseFloat(e);var i=(n=parseFloat(n))/this.R;e=w.toRadians(e);var o=Math.asin(Math.sin(r)*Math.cos(i)+Math.cos(r)*Math.sin(i)*Math.cos(e)),s=a+Math.atan2(Math.sin(e)*Math.sin(i)*Math.cos(r),Math.cos(i)-Math.sin(r)*Math.sin(o));return{lat:w.toDegrees(o),lng:w.toDegrees(s)}},mercatorTolonlat:function(t,e){var n=e/20037508.34*180;return{lng:t/20037508.34*180,lat:180/Math.PI*(2*Math.atan(Math.exp(n*Math.PI/180))-Math.PI/2)}},lonlatToMercator:function(t,e){var n=t*Math.PI/180*6378137,r=e*Math.PI/180;return{x:n,y:3189068.5*Math.log((1+Math.sin(r))/(1-Math.sin(r)))}}},M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b={convertBase64ToBlob:function(t){for(var e=t.split(",")[0].split(":")[1].split(";")[0],n=window.atob(t.split(",")[1]),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder;return o?((o=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder)).append(r),o.getBlob(e)):o=new Blob([r],{type:e})},convertUrlToBase64:function(t,e,n){return new Promise((function(r,a){var i=new Image;i.crossOrigin="Anonymous",i.src=t,i.onload=function(){var t=document.createElement("canvas");t.width=e||i.width,t.height=n||i.height,t.getContext("2d").drawImage(i,0,0,i.width,i.height);var a=i.src.substring(i.src.lastIndexOf(".")+1).toLowerCase(),o=t.toDataURL("image/"+a);r({dataURL:o,type:"image/"+a,ext:a})}}))},convertBase64ToFile:function(t,e){for(var n=t.split(","),r=n[0].match(/:(.*?);/)[1],a=atob(n[1]),i=a.length,o=new Uint8Array(i);i--;)o[i]=a.charCodeAt(i);return new File([o],e,{type:r})},downloadFromFile:function(t,e){if("object"==(void 0===t?"undefined":M(t)))if(t instanceof Blob)t=URL.createObjectURL(t);else{var n=JSON.stringify(t),r=new Blob([n],{type:"text/json"});t=window.URL.createObjectURL(r)}else if("string"==typeof t&&-1===t.indexOf("http")){var a=new Blob([t],{type:"text/json"});t=window.URL.createObjectURL(a)}var i=document.createElement("a");i.href=t,i.download=e||"",i.click(),window.URL.revokeObjectURL(i.href)}},R={debounce:function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=void 0,a=void 0,i=void 0,o=void 0,s=void 0,c=function c(){var u=+new Date-o;u<e&&u>0?r=setTimeout(c,e-u):(r=null,n||(s=t.apply(i,a),r||(i=a=null)))};return function(){for(var a=arguments.length,u=Array(a),l=0;l<a;l++)u[l]=arguments[l];i=this,o=+new Date;var h=n&&!r;return r||(r=setTimeout(c,e)),h&&(s=t.apply(i,u),i=u=null),s}},throttle:function(t,e,n){if(1===n)var r=0;else if(2===n)var a;return function(){var i=this,o=arguments;if(1===n){var s=Date.now();s-r>e&&(t.apply(i,o),r=s)}else 2===n&&(a||(a=setTimeout((function(){a=null,t.apply(i,o)}),e)))}},recurve:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,r=0;setTimeout((function a(){++r<Math.floor(n/e)&&(t.call(this),setTimeout(a,e))}))}},O={checkStr:function(t,e){switch(e){case"phone":return/^1[3|4|5|6|7|8|9][0-9]{9}$/.test(t);case"tel":return/^(0\d{2,3}-\d{7,8})(-\d{1,4})?$/.test(t);case"card":return/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t);case"pwd":return/^[a-zA-Z]\w{5,17}$/.test(t);case"postal":return/[1-9]\d{5}(?!\d)/.test(t);case"QQ":return/^[1-9][0-9]{4,9}$/.test(t);case"email":return/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(t);case"money":return/^\d*(?:\.\d{0,2})?$/.test(t);case"URL":return/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/.test(t);case"IP":return/((?:(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d?\\d))/.test(t);case"date":return/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2})(?:\:\d{2}|:(\d{2}):(\d{2}))$/.test(t)||/^(\d{4})\-(\d{2})\-(\d{2})$/.test(t);case"number":return/^[0-9]$/.test(t);case"english":return/^[a-zA-Z]+$/.test(t);case"chinese":return/^[\u4E00-\u9FA5]+$/.test(t);case"lower":return/^[a-z]+$/.test(t);case"upper":return/^[A-Z]+$/.test(t);case"HTML":return/<("[^"]*"|'[^']*'|[^'">])*>/.test(t);default:return!0}},changeCase:function(t,e){switch(e=e||4){case 1:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toUpperCase()+t.substring(1).toLowerCase()}));case 2:return t.replace(/\b\w+\b/g,(function(t){return t.substring(0,1).toLowerCase()+t.substring(1).toUpperCase()}));case 3:return t.split("").map((function(t){return/[a-z]/.test(t)?t.toUpperCase():t.toLowerCase()})).join("");case 4:return t.toUpperCase();case 5:return t.toLowerCase();default:return t}},tag:function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n=n.map((function(t){switch(u.getDataType(t)){case"Object":return t||"{}";case"Array":return t||"[]";default:return t||""}})),t.reduce((function(t,e,r){return""+t+n[r-1]+e}))},getByteLength:function(t){return t.replace(/[\u0391-\uFFE5]/g,"aa").length},subStringByte:function(t,e,n){var r=/[^\x00-\xff]/g;if(t.replace(r,"mm").length<=n)return t;for(var a=Math.floor(n/2);a<t.length;a++){var i=t.substring(e,a);if(i.replace(r,"mm").length>=n)return i}return t},asString:function(t){if(u.isEmpty(t))return"";switch(u.getDataType()){case"Object":case"Array":return JSON.stringify(t);default:return t}}},S={notNull:function(t){if(u.isEmpty(t))throw Error("不能为空:>>>"+t)},legalLnglat:function(t,e){if(!E.isLnglat(t,e))throw Error(i.COORDINATE_ERROR)},contain:function(t){for(var e=!1,n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];for(var o=r.length||0,s=0,c=o;s<c;s++)e=t.indexOf(r[s])>=0;if(e)throw Error(i.STRING_CHECK_LOSS)},verify:{array:function(t){if("Array"!==u.getDataType(t))throw Error(i.PARAMETER_ERROR_ARRAY+":>>>"+t)},function:function(t){if("Function"!==u.getDataType(t))throw Error(i.PARAMETER_ERROR_FUNCTION+":>>>"+t)},object:function(t){if("Object"!==u.getDataType(t))throw Error(i.PARAMETER_ERROR_OBJECT+":>>>"+t)}},legalJSON:function(t){try{JSON.parse(t)}catch(e){throw Error(i.JSON_PARSE_ERROR+":>>>"+t)}},legalData:function(t,e){var n=O.checkStr(t,e),r="";switch(e){case"phone":r="电话";break;case"tel":r="座机";break;case"card":r="身份证";break;case"pwd":r="密码";break;case"postal":r="邮政编码";break;case"QQ":r="QQ";break;case"email":r="邮箱";break;case"money":r="金额";break;case"URL":r="网址";break;case"IP":r="IP";break;case"date":r="日期时间";break;case"number":r="数字";break;case"english":r="英文";break;case"chinese":r="中文";break;case"lower":r="小写";break;case"upper":r="大写";break;case"HTML":r="HTML标记"}if(!n)throw Error(i.PARAMETER_ERROR+":>>>不是"+r)}},A=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var D=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.audio=new Audio,this.audio.src=e}return A(t,[{key:"play",value:function(){!this.muted&&this.audio.play()}},{key:"pause",value:function(){this.audio.pause()}},{key:"muted",get:function(){return this.audio.muted},set:function(t){this.audio.muted=t}}]),t}(),_=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var x=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),"String"===u.getDataType(e)&&(e=document.querySelector("#"+e)),this.ctx=e.getContext("2d")}return _(t,[{key:"drawLine",value:function(t,e,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};this.cxt.beginPath();var i=a.width||1,o=a.color||"#000";this.cxt.lineWidth=i,this.cxt.fillStyle=o,this.cxt.moveTo(t,e),this.cxt.lineTo(n,r),this.cxt.closePath(),this.cxt.fill()}},{key:"drawArc",value:function(t,e,n,r,a,i,o,s){o?(this.cxt.fillStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,w.degreesToRadians(r),w.degreesToRadians(a),i),this.cxt.closePath(),this.cxt.fill()):(this.cxt.strokeStyle=s,this.cxt.beginPath(),this.cxt.arc(t,e,n,w.degreesToRadians(r),w.degreesToRadians(a),i),this.cxt.stroke())}}]),t}(),T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},I=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var P=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(C(this,t),"string"==typeof e)if("<"==e.charAt(0)&&">"==e.slice(-1)){var r=e.slice(1,-1);this[0]=document.createElement(r),this.length=1}else{for(var a=n.querySelectorAll(e),i=0;i<a.length;i++)this[i]=a[i];this.length=a.length}else{if(void 0===e)return this;"function"==typeof e?this.ready(e):1==e.nodeType&&(this[0]=e,this.length=1)}}return I(t,[{key:"each",value:function(t){for(var e=0;e<this.length;e++)t(this[e],e)}},{key:"html",value:function(t){return this.each((function(e){e.innerHTML=t})),this}},{key:"css",value:function(t,e){return this.each((function(n){if("object"==(void 0===t?"undefined":T(t)))for(var r in t)"width"!=r&&"height"!=r&&"margin"!=r&&"fontSize"!=r||(n.style[r]=parseInt(t[r])+"px"),n.style[r]=t[r];else n.style[t]=e})),this}},{key:"ready",value:function(t){var e=this;document.addEventListener("DOMContentLoaded",(function(n){t.call(e,n)}))}},{key:"click",value:function(t){return this.each((function(e){var n=this;e.onclick=function(r){t.call(n,r,e)}})),this}},{key:"on",value:function(t,e){var n=this;this.each((function(r){r.removeEventListener(t,(function(t){e.call(n,t)})),r.addEventListener(t,(function(t){e.call(n,t)}))}))}},{key:"appendTo",value:function(t){if("string"==typeof t)for(var e=document.querySelectorAll(t),n=this[0],r=0;r<e.length;r++)this[r]=n.cloneNode(!0),e[r].appendChild(this[r]),this.length=e.length;else t.appendChild(this[0]);return this}}]),t}(),k=P;function L(){}window.$=function(t,e){return new P(t,e)},Object.assign(L.prototype,{addEventListener:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];void 0===this._listeners&&(this._listeners={}),this._mutex=this._mutex||{},this._context=n;var a=this._mutex,i=this._listeners;return void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&(r&&(a[t]=e),i[t].push(e)),this},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var n=this._listeners[t];if(this._mutex[t]===e&&(this._mutex[t]=null),void 0!==n){var r=n.map((function(t){return t.toString()})).indexOf(e.toString());-1!==r&&n.splice(r,1)}}},dispatchEvent:function(t){var e=this;if(void 0!==this._listeners){var n=this._listeners[t.type];if(void 0!==n){t.target=this;var r=n.slice(0);if(this._mutex[t.type])return void r.find((function(n){return n===e._mutex[t.type]})).call(this._context||this,t);for(var a=0,i=r.length;a<i;a++)r[a].call(this._context||this,t)}}},removeAllListener:function(){for(var t in this._mutex={},this._listeners)this._listeners[t]=[]}});var N=L;function F(){return new Map}Object.assign(Map.prototype,{isEmpty:function(){return 0===this.size},_values:function(){return Array.from(Map.prototype.values.call(this))},_keys:function(){return Array.from(Map.prototype.keys.call(this))},_entries:function(){return Array.from(Map.prototype.entries.call(this))}}),F.fromEntries=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=new F;return t.forEach((function(t){Array.isArray(t)&&2===t.length&&e.set(t[0],t[1])})),e};var U=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function j(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var W=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ws://127.0.0.1:10088";j(this,e);var n=B(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.maxCheckTimes=10,n.url=t,n.checkTimes=0,n.connectStatus=!1,n.connect(),n.connCheckStatus(n.maxCheckTimes),e.instance=n,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),U(e,[{key:"connect",value:function(){if(this.disconnect(),this.url)try{if(console.info("创建ws连接>>>"+this.url),this.client=new WebSocket(this.url),this.client){var t=this;this.client.onopen=function(e){t.dispatchEvent({type:a.WEB_SOCKET_CONNECT,message:e})},this.client.onmessage=function(e){t.connectStatus=!0,t.dispatchEvent({type:a.WEB_SOCKET_MESSAGE,message:e})},this.client.onclose=function(e){t.dispatchEvent({type:a.WEB_SOCKET_CLOSE,message:e})},this.checkTimes===this.maxCheckTimes&&(this.client.onerror=function(e){t.dispatchEvent({type:a.WEB_SOCKET_ERROR,message:e})})}}catch(t){console.error("创建ws连接失败"+this.url+":"+t)}}},{key:"disconnect",value:function(){if(this.client)try{console.log("ws断开连接"+this.url),this.client.close(),this.client=null}catch(t){this.client=null}}},{key:"connCheckStatus",value:function(t){var e=this;this.checkTimes>t||setTimeout((function(){e.checkTimes++,e.client&&0!==e.client.readyState&&1!==e.client.readyState&&e.connect(),e.connCheckStatus(t)}),2e3)}},{key:"send",value:function(t){return this.client&&1===this.client.readyState?(this.client.send(t),!0):(console.error(this.url+"消息发送失败:"+t),!1)}},{key:"heartbeat",value:function(){var t=this;setTimeout((function(){t.client&&1===t.client.readyState&&t.send("HeartBeat"),console.log("HeartBeat,"+t.url),setTimeout(t.heartbeat,3e4)}),1e3)}}],[{key:"getInstance",value:function(){return e.instance?e.instance:Object.freeze(new e)}},{key:"_instance",get:function(){return this.getInstance()}}]),e}(N),G=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function $(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var q=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;if($(this,t),this.cacheType=e,1===e)this.storage=window.localStorage;else{if(2!==e)throw new Error(i.PARAMETER_ERROR);this.storage=window.sessionStorage}}return G(t,[{key:"setItem",value:function(t,e,n){var r={key:t,value:e};if(1===this.cacheType){var a=Date.now();n&&(r.expired=a+1e3*n)}return this.storage[t]=JSON.stringify(r),r}},{key:"getItem",value:function(t){var e=this.storage.getItem(t)||null,n=JSON.parse(e)||{};if(1===this.cacheType){var r=n.expired||Date.now();if(Date.now()>r)return this.remove(t),null}return n.value}},{key:"remove",value:function(t){var e=this;t&&(t.indexOf(",")>-1?t.split(",").forEach((function(t){e.storage.removeItem(t)})):this.storage.removeItem(t))}},{key:"clear",value:function(){this.storage.clear()}}]),t}(),Y=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function H(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var z=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;H(this,t),this.magnification=e}return Y(t,[{key:"_getSystem",value:function(){if(navigator.userAgent.toLowerCase().indexOf("windows")>=0)return!0}},{key:"_addHandler",value:function(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}},{key:"_correct",value:function(){var t=window.innerWidth;if("number"!=typeof t&&(t="CSS1Compat"==document.compatMode?document.documentElement.clientWidth:document.body.clientWidth),t<=750){var e=document.documentElement.clientWidth/t;document.documentElement.style.fontSize=75*this.magnification*Math.min(e,2)+"px"}else if(t>750&&t<=1200){var n=document.documentElement.clientWidth/t;document.documentElement.style.fontSize=85*this.magnification*Math.min(n,2)+"px"}else{var r=document.documentElement.clientWidth/1920;document.documentElement.style.fontSize=100*this.magnification*Math.min(r,2)+"px"}}},{key:"_watch",value:function(){var t=this;t._addHandler(window,"resize",(function(){t._correct()}))}},{key:"init",value:function(){var t=this;t._getSystem()&&(t._correct(),t._watch())}}]),t}()}])}));
|