UNPKG

diandi-ele-form-tmap

Version:
11 lines 52.1 kB
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["diandi-ele-form-bmap"]=e(require("vue")):t["diandi-ele-form-bmap"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));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="",n(n.s="fb15")}({"0637":function(t,e,n){},"165e":function(t,e,n){"use strict";(function(t){var r=n("2da4"),o=n("4fab"),i=n("76f3");e["a"]={name:"bm-marker",mixins:[Object(r["a"])("overlay")],props:{position:{},offset:{},icon:{},massClear:{type:Boolean,default:!0},dragging:{type:Boolean,default:!1},clicking:{type:Boolean,default:!0},raiseOnDrag:{type:Boolean,default:!1},draggingCursor:{type:String},rotation:{type:Number},shadow:{type:Object},title:{type:String},label:{type:Object},animation:{type:String},top:{type:Boolean,default:!1},zIndex:{type:Number,default:0}},watch:{"position.lng"(t,e){const{BMap:n,originInstance:r,position:o,renderByParent:a,$parent:s}=this;t!==e&&t>=-180&&t<=180&&r.setPosition(Object(i["d"])(n,{lng:t,lat:o.lat})),a&&s.reload()},"position.lat"(t,e){const{BMap:n,originInstance:r,position:o,renderByParent:a,$parent:s}=this;t!==e&&t>=-74&&t<=74&&r.setPosition(Object(i["d"])(n,{lng:o.lng,lat:t})),a&&s.reload()},"offset.width"(t,e){const{BMap:n,originInstance:r}=this;t!==e&&r.setOffset(new n.Size(t,this.offset.height))},"offset.height"(t,e){const{BMap:n,originInstance:r}=this;t!==e&&r.setOffset(new n.Size(this.offset.width,t))},icon:{deep:!0,handler(t){const{BMap:e,originInstance:n,rotation:r}=this;n&&n.setIcon(Object(i["b"])(e,t)),r&&n&&n.setRotation(r)}},massClear(t){t?this.originInstance.enableMassClear():this.originInstance.disableMassClear()},dragging(t){t?this.originInstance.enableDragging():this.originInstance.disableDragging()},clicking(){this.reload()},raiseOnDrag(){this.reload()},draggingCursor(t){this.originInstance.setDraggingCursor(t)},rotation(t){this.originInstance.setRotation(t)},shadow(t){this.originInstance.setShadow(t)},title(t){this.originInstance.setTitle(t)},label(t){this.reload()},animation(e){this.originInstance.setAnimation(t[e])},top(t){this.originInstance.setTop(t)},zIndex(t){this.originInstance.setZIndex(t)}},methods:{load(){const{BMap:e,map:n,position:r,offset:a,icon:s,massClear:l,dragging:c,clicking:u,raiseOnDrag:h,draggingCursor:f,rotation:p,shadow:d,title:g,label:m,animation:y,top:b,renderByParent:w,$parent:v,zIndex:_}=this,A=new e.Marker(new e.Point(r.lng,r.lat),{offset:a,icon:s&&Object(i["b"])(e,s),enableMassClear:l,enableDragging:c,enableClicking:u,raiseOnDrag:h,draggingCursor:f,rotation:p,shadow:d,title:g});this.originInstance=A,m&&A&&A.setLabel(Object(i["c"])(e,m)),A.setTop(b),A.setZIndex(_),o["a"].call(this,A),w?v.reload():n.addOverlay(A),A.setAnimation(t[y])}}}}).call(this,n("c8ba"))},"1fb5":function(t,e,n){"use strict";e.byteLength=u,e.toByteArray=f,e.fromByteArray=g;for(var r=[],o=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");-1===n&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function u(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r}function h(t,e,n){return 3*(e+n)/4-n}function f(t){var e,n,r=c(t),a=r[0],s=r[1],l=new i(h(t,a,s)),u=0,f=s>0?a-4:a;for(n=0;n<f;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],l[u++]=e>>16&255,l[u++]=e>>8&255,l[u++]=255&e;return 2===s&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,l[u++]=255&e),1===s&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,l[u++]=e>>8&255,l[u++]=255&e),l}function p(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function d(t,e,n){for(var r,o=[],i=e;i<n;i+=3)r=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(p(r));return o.join("")}function g(t){for(var e,n=t.length,o=n%3,i=[],a=16383,s=0,l=n-o;s<l;s+=a)i.push(d(t,s,s+a>l?l:s+a));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},"2da4":function(t,e,n){"use strict";const r={control:{unload:"removeControl"},layer:{unload:"removeTileLayer"},overlay:{unload:"removeOverlay"},contextMenu:{unload:"removeContextMenu"}},o=t=>t.abstract||t.$el===t.$children[0].$el?o(t.$parent):t;function i(){const{unload:t,renderByParent:e,$parent:n}=this;e&&n.reload(),t()}class a{constructor(t){this.methods={ready(){const t=o(this.$parent),e=this.BMap=t.BMap,n=this.map=t.map;this.load(),this.$emit("ready",{BMap:e,map:n})},transmitEvent(t){this.$emit(t.type.replace(/^on/,""),t)},reload(){this&&this.BMap&&this.$nextTick(()=>{this.unload(),this.$nextTick(this.load)})},unload(){const{map:e,originInstance:n}=this;try{switch(t.type){case"search":return n.clearResults();case"autoComplete":case"lushu":return n.dispose();case"markerClusterer":return n.clearMarkers();default:e[r[t.type].unload](n)}}catch(o){}}},this.computed={renderByParent(){return this.$parent.preventChildrenRender}},this.mounted=function(){const t=o(this.$parent),e=t.map,{ready:n}=this;e?n():t.$on("ready",n)},this.destroyed=i,this.beforeDestroy=i}}e["a"]=t=>new a({type:t})},"33d3":function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}));n("76f3");const r=t=>t.lng&&t.lat,o=t=>Object.prototype.toString.call(t).slice(8,-1)},"3c4e":function(t,e,n){"use strict";var r=function(t){return o(t)&&!i(t)};function o(t){return!!t&&"object"===typeof t}function i(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||l(t)}var a="function"===typeof Symbol&&Symbol.for,s=a?Symbol.for("react.element"):60103;function l(t){return t.$$typeof===s}function c(t){return Array.isArray(t)?[]:{}}function u(t,e){var n=e&&!0===e.clone;return n&&r(t)?p(c(t),t,e):t}function h(t,e,n){var o=t.slice();return e.forEach((function(e,i){"undefined"===typeof o[i]?o[i]=u(e,n):r(e)?o[i]=p(t[i],e,n):-1===t.indexOf(e)&&o.push(u(e,n))})),o}function f(t,e,n){var o={};return r(t)&&Object.keys(t).forEach((function(e){o[e]=u(t[e],n)})),Object.keys(e).forEach((function(i){r(e[i])&&t[i]?o[i]=p(t[i],e[i],n):o[i]=u(e[i],n)})),o}function p(t,e,n){var r=Array.isArray(e),o=Array.isArray(t),i=n||{arrayMerge:h},a=r===o;if(a){if(r){var s=i.arrayMerge||h;return s(t,e,n)}return f(t,e,n)}return u(e,n)}p.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce((function(t,n){return p(t,n,e)}))};var d=p;t.exports=d},4757:function(t,e,n){"use strict";(function(t){var r=n("2da4"),o=n("4fab"),i=n("76f3");e["a"]={name:"bm-geolocation",render(){},mixins:[Object(r["a"])("control")],props:{anchor:{type:String},offset:{type:Object},showAddressBar:{type:Boolean},autoLocation:{type:Boolean},locationIcon:{type:Object}},watch:{anchor(){this.reload()},offset(){this.reload()},showAddressBar(){this.reload()},autoLocation(){this.reload()},locationIcon(){this.reload()}},methods:{load(){const{BMap:e,map:n,anchor:r,showAddressBar:a,autoLocation:s,locationIcon:l,offset:c}=this;this.originInstance=new e.GeolocationControl({anchor:t[r],showAddressBar:a,enableAutoLocation:s,offset:c&&Object(i["e"])(e,c),locationIcon:l&&Object(i["b"])(e,l)}),o["a"].call(this,this.originInstance),n.addControl(this.originInstance)}}}}).call(this,n("c8ba"))},"4fab":function(t,e,n){"use strict";var r={"bm-map":["click","dblclick","rightclick","rightdblclick","maptypechange","mousemove","mouseover","mouseout","movestart","moving","moveend","zoomstart","zoomend","addoverlay","addcontrol","removecontrol","removeoverlay","clearoverlays","dragstart","dragging","dragend","addtilelayer","removetilelayer","load","resize","hotspotclick","hotspotover","hotspotout","tilesloaded","touchstart","touchmove","touchend","longpress"],"bm-geolocation":["locationSuccess","locationError"],"bm-overview-map":["viewchanged","viewchanging"],"bm-marker":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","infowindowclose","infowindowopen","dragstart","dragging","dragend","rightclick"],"bm-polyline":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"],"bm-polygon":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"],"bm-circle":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","lineupdate"],"bm-label":["click","dblclick","mousedown","mouseup","mouseout","mouseover","remove","rightclick"],"bm-info-window":["close","open","maximize","restore","clickclose"],"bm-ground":["click","dblclick"],"bm-autocomplete":["onconfirm","onhighlight"],"bm-point-collection":["click","mouseover","mouseout"]};e["a"]=function(t,e){const n=e||r[this.$options.name];n&&n.forEach(e=>{const n="on"===e.slice(0,2),r=n?e.slice(2):e,o=this.$listeners[r];o&&t.addEventListener(e,o.fns)})}},"67a0":function(t,e,n){"use strict";n("0637")},"76f3":function(t,e,n){"use strict";function r(t,e={}){const{lng:n,lat:r}=e;return new t.Point(n,r)}function o(t,e={}){const{sw:n,ne:o}=e;return new t.Bounds(r(t,n),r(t,o))}function i(t,e={}){const{width:n,height:r}=e;return new t.Size(n,r)}function a(t,e={}){const{url:n,size:r,opts:o={}}=e;return new t.Icon(n,i(t,r),{anchor:o.anchor&&i(t,o.anchor),imageSize:o.imageSize&&i(t,o.imageSize),imageOffset:o.imageOffset&&i(t,o.imageOffset),infoWindowAnchor:o.infoWindowAnchor&&i(t,o.infoWindowAnchor),printImageUrl:o.printImageUrl})}function s(t,e={}){const{content:n,opts:o}=e;return new t.Label(n,{offset:o.offset&&i(t,o.offset),position:o.position&&r(t,o.position),enableMassClear:o.enableMassClear})}n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return o})),n.d(e,"e",(function(){return i})),n.d(e,"b",(function(){return a})),n.d(e,"c",(function(){return s}))},"7f25":function(t,e,n){"use strict";(function(t){var r=n("4fab"),o=n("33d3");e["a"]={name:"bm-map",props:{ak:{type:String},center:{type:[Object,String]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},highResolution:{type:Boolean,default:!0},mapClick:{type:Boolean,default:!0},mapType:{type:String},dragging:{type:Boolean,default:!0},scrollWheelZoom:{type:Boolean,default:!1},doubleClickZoom:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},inertialDragging:{type:Boolean,default:!0},continuousZoom:{type:Boolean,default:!0},pinchToZoom:{type:Boolean,default:!0},autoResize:{type:Boolean,default:!0},theme:{type:Array},mapStyle:{type:Object}},watch:{center(t,e){const{map:n,zoom:r}=this;"String"===Object(o["a"])(t)&&t!==e&&n.centerAndZoom(t,r)},"center.lng"(t,e){const{BMap:n,map:r,zoom:o,center:i}=this;t!==e&&t>=-180&&t<=180&&r.centerAndZoom(new n.Point(t,i.lat),o)},"center.lat"(t,e){const{BMap:n,map:r,zoom:o,center:i}=this;t!==e&&t>=-74&&t<=74&&r.centerAndZoom(new n.Point(i.lng,t),o)},zoom(t,e){const{map:n}=this;t!==e&&t>=3&&t<=19&&n.setZoom(t)},minZoom(t){const{map:e}=this;e.setMinZoom(t)},maxZoom(t){const{map:e}=this;e.setMaxZoom(t)},highResolution(){this.reset()},mapClick(){this.reset()},mapType(e){const{map:n}=this;n.setMapType(t[e])},dragging(t){const{map:e}=this;t?e.enableDragging():e.disableDragging()},scrollWheelZoom(t){const{map:e}=this;t?e.enableScrollWheelZoom():e.disableScrollWheelZoom()},doubleClickZoom(t){const{map:e}=this;t?e.enableDoubleClickZoom():e.disableDoubleClickZoom()},keyboard(t){const{map:e}=this;t?e.enableKeyboard():e.disableKeyboard()},inertialDragging(t){const{map:e}=this;t?e.enableInertialDragging():e.disableInertialDragging()},continuousZoom(t){const{map:e}=this;t?e.enableContinuousZoom():e.disableContinuousZoom()},pinchToZoom(t){const{map:e}=this;t?e.enablePinchToZoom():e.disablePinchToZoom()},autoResize(t){const{map:e}=this;t?e.enableAutoResize():e.disableAutoResize()},theme(t){const{map:e}=this;e.setMapStyle({styleJson:t})},"mapStyle.features":{handler(t,e){const{map:n,mapStyle:r}=this,{style:o,styleJson:i}=r;n.setMapStyle({styleJson:i,features:t,style:o})},deep:!0},"mapStyle.style"(t,e){const{map:n,mapStyle:r}=this,{features:o,styleJson:i}=r;n.setMapStyle({styleJson:i,features:o,style:t})},"mapStyle.styleJson":{handler(t,e){const{map:n,mapStyle:r}=this,{features:o,style:i}=r;n.setMapStyle({styleJson:t,features:o,style:i})},deep:!0},mapStyle(t){const{map:e,theme:n}=this;!n&&e.setMapStyle(t)}},methods:{setMapOptions(){const{map:e,minZoom:n,maxZoom:r,mapType:o,dragging:i,scrollWheelZoom:a,doubleClickZoom:s,keyboard:l,inertialDragging:c,continuousZoom:u,pinchToZoom:h,autoResize:f}=this;n&&e.setMinZoom(n),r&&e.setMaxZoom(r),o&&e.setMapType(t[o]),i?e.enableDragging():e.disableDragging(),a?e.enableScrollWheelZoom():e.disableScrollWheelZoom(),s?e.enableDoubleClickZoom():e.disableDoubleClickZoom(),l?e.enableKeyboard():e.disableKeyboard(),c?e.enableInertialDragging():e.disableInertialDragging(),u?e.enableContinuousZoom():e.disableContinuousZoom(),h?e.enablePinchToZoom():e.disablePinchToZoom(),f?e.enableAutoResize():e.disableAutoResize()},init(t){if(this.map)return;let e=this.$refs.view;for(let r of this.$slots.default||[])r.componentOptions&&"bm-view"===r.componentOptions.tag&&(this.hasBmView=!0,e=r.elm);const n=new t.Map(e,{enableHighResolution:this.highResolution,enableMapClick:this.mapClick});this.map=n;const{setMapOptions:o,zoom:i,getCenterPoint:a,theme:s,mapStyle:l}=this;s?n.setMapStyle({styleJson:s}):n.setMapStyle(l),o(),r["a"].call(this,n),n.reset(),n.centerAndZoom(a(),i),this.$emit("ready",{BMap:t,map:n})},getCenterPoint(){const{center:t,BMap:e}=this;switch(Object(o["a"])(t)){case"String":return t;case"Object":return new e.Point(t.lng,t.lat);default:return new e.Point}},initMap(t){this.BMap=t,this.init(t)},getMapScript(){if(t.BMap)return t.BMap._preloader?t.BMap._preloader:Promise.resolve(t.BMap);{const e=this.ak||this._BMap().ak;return t.BMap={},t.BMap._preloader=new Promise((n,r)=>{t._initBaiduMap=function(){n(t.BMap),t.document.body.removeChild(o),t.BMap._preloader=null,t._initBaiduMap=null};const o=document.createElement("script");t.document.body.appendChild(o),o.src=`https://api.map.baidu.com/api?v=2.0&ak=${e}&callback=_initBaiduMap`}),t.BMap._preloader}},reset(){const{getMapScript:t,initMap:e}=this;t().then(e)}},mounted(){this.reset()},data(){return{hasBmView:!1}}}}).call(this,n("c8ba"))},"8bbf":function(e,n){e.exports=t},9152:function(t,e){
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
e.read=function(t,e,n,r,o){var i,a,s=8*o-r-1,l=(1<<s)-1,c=l>>1,u=-7,h=n?o-1:0,f=n?-1:1,p=t[e+h];for(h+=f,i=p&(1<<-u)-1,p>>=-u,u+=s;u>0;i=256*i+t[e+h],h+=f,u-=8);for(a=i&(1<<-u)-1,i>>=-u,u+=r;u>0;a=256*a+t[e+h],h+=f,u-=8);if(0===i)i=1-c;else{if(i===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},e.write=function(t,e,n,r,o,i){var a,s,l,c=8*i-o-1,u=(1<<c)-1,h=u>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),e+=a+h>=1?f/l:f*Math.pow(2,1-h),e*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(e*l-1)*Math.pow(2,o),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,o),a=0));o>=8;t[n+p]=255&s,p+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*g}},b5c1:function(t,e,n){"use strict";(function(t){var r=n("2da4"),o=n("76f3");e["a"]={name:"bm-navigation",render(){},mixins:[Object(r["a"])("control")],props:{anchor:{type:String},offset:{type:Object},type:{type:String},showZoomInfo:{type:Boolean},enableGeolocation:{type:Boolean,default:!1}},watch:{anchor(){this.reload()},offset(){this.reload()},type(){this.reload()},showZoomInfo(){this.reload()}},methods:{load(){const{BMap:e,map:n,anchor:r,offset:i,type:a,showZoomInfo:s,enableGeolocation:l}=this;this.originInstance=new e.NavigationControl({anchor:t[r],offset:i&&Object(o["e"])(e,i),type:t[a],showZoomInfo:s,enableGeolocation:l}),n.addControl(this.originInstance)}}}}).call(this,n("c8ba"))},b639:function(t,e,n){"use strict";(function(t){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <http://feross.org>
 * @license  MIT
 */
var r=n("1fb5"),o=n("9152"),i=n("e3db");function a(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function l(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=c.prototype):(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,n){if(!c.TYPED_ARRAY_SUPPORT&&!(this instanceof c))return new c(t,e,n);if("number"===typeof t){if("string"===typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return u(this,t,e,n)}function u(t,e,n,r){if("number"===typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer?m(t,e,n,r):"string"===typeof e?d(t,e,n):y(t,e)}function h(t){if("number"!==typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t,e,n,r){return h(e),e<=0?l(t,e):void 0!==n?"string"===typeof r?l(t,e).fill(n,r):l(t,e).fill(n):l(t,e)}function p(t,e){if(h(e),t=l(t,e<0?0:0|b(e)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function d(t,e,n){if("string"===typeof n&&""!==n||(n="utf8"),!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|v(e,n);t=l(t,r);var o=t.write(e,n);return o!==r&&(t=t.slice(0,o)),t}function g(t,e){var n=e.length<0?0:0|b(e.length);t=l(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function m(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");return e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r),c.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=c.prototype):t=g(t,e),t}function y(t,e){if(c.isBuffer(e)){var n=0|b(e.length);return t=l(t,n),0===t.length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!==typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!==typeof e.length||et(e.length)?l(t,0):g(t,e);if("Buffer"===e.type&&i(e.data))return g(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function b(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function w(t){return+t!=t&&(t=0),c.alloc(+t)}function v(t,e){if(c.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Q(t).length;default:if(r)return q(t).length;e=(""+e).toLowerCase(),r=!0}}function _(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,e>>>=0,n<=e)return"";t||(t="utf8");while(1)switch(t){case"hex":return U(this,e,n);case"utf8":case"utf-8":return I(this,e,n);case"ascii":return j(this,e,n);case"latin1":case"binary":return D(this,e,n);case"base64":return P(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function A(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function B(t,e,n,r,o){if(0===t.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"===typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:S(t,e,n,r,o);if("number"===typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):S(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function S(t,e,n,r,o){var i,a=1,s=t.length,l=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(o){var u=-1;for(i=n;i<s;i++)if(c(t,i)===c(e,-1===u?0:i-u)){if(-1===u&&(u=i),i-u+1===l)return u*a}else-1!==u&&(i-=i-u),u=-1}else for(n+l>s&&(n=s-l),i=n;i>=0;i--){for(var h=!0,f=0;f<l;f++)if(c(t,i+f)!==c(e,f)){h=!1;break}if(h)return i}return-1}function E(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;var i=e.length;if(i%2!==0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function R(t,e,n,r){return tt(q(e,t.length-n),t,n,r)}function O(t,e,n,r){return tt(K(e),t,n,r)}function k(t,e,n,r){return O(t,e,n,r)}function C(t,e,n,r){return tt(Q(e),t,n,r)}function M(t,e,n,r){return tt(X(e,t.length-n),t,n,r)}function P(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function I(t,e,n){n=Math.min(t.length,n);var r=[],o=e;while(o<n){var i,a,s,l,c=t[o],u=null,h=c>239?4:c>223?3:c>191?2:1;if(o+h<=n)switch(h){case 1:c<128&&(u=c);break;case 2:i=t[o+1],128===(192&i)&&(l=(31&c)<<6|63&i,l>127&&(u=l));break;case 3:i=t[o+1],a=t[o+2],128===(192&i)&&128===(192&a)&&(l=(15&c)<<12|(63&i)<<6|63&a,l>2047&&(l<55296||l>57343)&&(u=l));break;case 4:i=t[o+1],a=t[o+2],s=t[o+3],128===(192&i)&&128===(192&a)&&128===(192&s)&&(l=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s,l>65535&&l<1114112&&(u=l))}null===u?(u=65533,h=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),o+=h}return x(r)}e.Buffer=c,e.SlowBuffer=w,e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:a(),e.kMaxLength=s(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,n){return u(null,t,e,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,n){return f(null,t,e,n)},c.allocUnsafe=function(t){return p(null,t)},c.allocUnsafeSlow=function(t){return p(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,i=Math.min(n,r);o<i;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=c.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var a=t[n];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)A(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)A(this,e,e+3),A(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)A(this,e,e+7),A(this,e+1,e+6),A(this,e+2,e+5),A(this,e+3,e+4);return this},c.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?I(this,0,t):_.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,n,r,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var i=o-r,a=n-e,s=Math.min(i,a),l=this.slice(r,o),u=t.slice(e,n),h=0;h<s;++h)if(l[h]!==u[h]){i=l[h],a=u[h];break}return i<a?-1:a<i?1:0},c.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},c.prototype.indexOf=function(t,e,n){return B(this,t,e,n,!0)},c.prototype.lastIndexOf=function(t,e,n){return B(this,t,e,n,!1)},c.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"===typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return E(this,t,e,n);case"utf8":case"utf-8":return R(this,t,e,n);case"ascii":return O(this,t,e,n);case"latin1":case"binary":return k(this,t,e,n);case"base64":return C(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function x(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var n="",r=0;while(r<e)n+=String.fromCharCode.apply(String,t.slice(r,r+=T));return n}function j(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function D(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function U(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=e;i<n;++i)o+=G(t[i]);return o}function Z(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function $(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function N(t,e,n,r){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);o<i;++o)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function Y(t,e,n,r){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);o<i;++o)t[n+o]=e>>>8*(r?o:3-o)&255}function z(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function V(t,e,n,r,i){return i||z(t,e,n,4,34028234663852886e22,-34028234663852886e22),o.write(t,e,n,r,23,4),n+4}function F(t,e,n,r,i){return i||z(t,e,n,8,17976931348623157e292,-17976931348623157e292),o.write(t,e,n,r,52,8),n+8}c.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e<t&&(e=t),c.TYPED_ARRAY_SUPPORT)n=this.subarray(t,e),n.__proto__=c.prototype;else{var o=e-t;n=new c(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+t]}return n},c.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||$(t,e,this.length);var r=this[t],o=1,i=0;while(++i<e&&(o*=256))r+=this[t+i]*o;return r},c.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||$(t,e,this.length);var r=this[t+--e],o=1;while(e>0&&(o*=256))r+=this[t+--e]*o;return r},c.prototype.readUInt8=function(t,e){return e||$(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||$(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||$(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||$(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||$(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||$(t,e,this.length);var r=this[t],o=1,i=0;while(++i<e&&(o*=256))r+=this[t+i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||$(t,e,this.length);var r=e,o=1,i=this[t+--r];while(r>0&&(o*=256))i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return e||$(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||$(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(t,e){e||$(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(t,e){return e||$(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||$(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||$(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||$(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||$(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||$(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var o=Math.pow(2,8*n)-1;L(this,t,e,n,o,0)}var i=1,a=0;this[e]=255&t;while(++a<n&&(i*=256))this[e+a]=t/i&255;return e+n},c.prototype.writeUIntBE=function(t,e,n,r){if(t=+t,e|=0,n|=0,!r){var o=Math.pow(2,8*n)-1;L(this,t,e,n,o,0)}var i=n-1,a=1;this[e+i]=255&t;while(--i>=0&&(a*=256))this[e+i]=t/a&255;return e+n},c.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Y(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Y(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);L(this,t,e,n,o-1,-o)}var i=0,a=1,s=0;this[e]=255&t;while(++i<n&&(a*=256))t<0&&0===s&&0!==this[e+i-1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+n},c.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var o=Math.pow(2,8*n-1);L(this,t,e,n,o-1,-o)}var i=n-1,a=1,s=0;this[e+i]=255&t;while(--i>=0&&(a*=256))t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/a>>0)-s&255;return e+n},c.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Y(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Y(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,n){return V(this,t,e,!0,n)},c.prototype.writeFloatBE=function(t,e,n){return V(this,t,e,!1,n)},c.prototype.writeDoubleLE=function(t,e,n){return F(this,t,e,!0,n)},c.prototype.writeDoubleBE=function(t,e,n){return F(this,t,e,!1,n)},c.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o,i=r-n;if(this===t&&n<e&&e<r)for(o=i-1;o>=0;--o)t[o+e]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+i),e);return i},c.prototype.fill=function(t,e,n,r){if("string"===typeof t){if("string"===typeof e?(r=e,e=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var i;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"===typeof t)for(i=e;i<n;++i)this[i]=t;else{var a=c.isBuffer(t)?t:q(new c(t,r).toString()),s=a.length;for(i=0;i<n-e;++i)this[i+e]=a[i%s]}return this};var W=/[^+\/0-9A-Za-z-_]/g;function H(t){if(t=J(t).replace(W,""),t.length<2)return"";while(t.length%4!==0)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function G(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],a=0;a<r;++a){if(n=t.charCodeAt(a),n>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function K(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}function X(t,e){for(var n,r,o,i=[],a=0;a<t.length;++a){if((e-=2)<0)break;n=t.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r)}return i}function Q(t){return r.toByteArray(H(t))}function tt(t,e,n,r){for(var o=0;o<r;++o){if(o+n>=e.length||o>=t.length)break;e[o+n]=t[o]}return o}function et(t){return t!==t}}).call(this,n("c8ba"))},c1c3:function(t,e,n){(function(e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}var n,r,o;try{n=Map}catch(h){n=function(){}}try{r=Set}catch(h){r=function(){}}try{o=Promise}catch(h){o=function(){}}function i(a,s,l,c,h){"object"===typeof s&&(l=s.depth,c=s.prototype,h=s.includeNonEnumerable,s=s.circular);var f=[],p=[],d="undefined"!=typeof e;function g(a,l){if(null===a)return null;if(0===l)return a;var m,y;if("object"!=typeof a)return a;if(t(a,n))m=new n;else if(t(a,r))m=new r;else if(t(a,o))m=new o((function(t,e){a.then((function(e){t(g(e,l-1))}),(function(t){e(g(t,l-1))}))}));else if(i.__isArray(a))m=[];else if(i.__isRegExp(a))m=new RegExp(a.source,u(a)),a.lastIndex&&(m.lastIndex=a.lastIndex);else if(i.__isDate(a))m=new Date(a.getTime());else{if(d&&e.isBuffer(a))return m=e.allocUnsafe?e.allocUnsafe(a.length):new e(a.length),a.copy(m),m;t(a,Error)?m=Object.create(a):"undefined"==typeof c?(y=Object.getPrototypeOf(a),m=Object.create(y)):(m=Object.create(c),y=c)}if(s){var b=f.indexOf(a);if(-1!=b)return p[b];f.push(a),p.push(m)}for(var w in t(a,n)&&a.forEach((function(t,e){var n=g(e,l-1),r=g(t,l-1);m.set(n,r)})),t(a,r)&&a.forEach((function(t){var e=g(t,l-1);m.add(e)})),a){var v;y&&(v=Object.getOwnPropertyDescriptor(y,w)),v&&null==v.set||(m[w]=g(a[w],l-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(a);for(w=0;w<_.length;w++){var A=_[w],B=Object.getOwnPropertyDescriptor(a,A);(!B||B.enumerable||h)&&(m[A]=g(a[A],l-1),B.enumerable||Object.defineProperty(m,A,{enumerable:!1}))}}if(h){var S=Object.getOwnPropertyNames(a);for(w=0;w<S.length;w++){var E=S[w];B=Object.getOwnPropertyDescriptor(a,E);B&&B.enumerable||(m[E]=g(a[E],l-1),Object.defineProperty(m,E,{enumerable:!1}))}}return m}return"undefined"==typeof s&&(s=!0),"undefined"==typeof l&&(l=1/0),g(a,l)}function a(t){return Object.prototype.toString.call(t)}function s(t){return"object"===typeof t&&"[object Date]"===a(t)}function l(t){return"object"===typeof t&&"[object Array]"===a(t)}function c(t){return"object"===typeof t&&"[object RegExp]"===a(t)}function u(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return i.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},i.__objToStr=a,i.__isDate=s,i.__isArray=l,i.__isRegExp=c,i.__getRegExpFlags=u,i}();t.exports&&(t.exports=n)}).call(this,n("b639").Buffer)},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},e3db:function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},f6fd:function(t,e){(function(t){var e="currentScript",n=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(r){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(r.stack)||[!1])[1];for(t in n)if(n[t].src==e||"interactive"==n[t].readyState)return n[t];return null}}})})(document)},fb15:function(t,e,n){"use strict";var r;(n.r(e),"undefined"!==typeof window)&&(n("f6fd"),(r=window.document.currentScript)&&(r=r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(n.p=r[1]));var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ele-form-bmap",t._g(t._b({class:t.desc.class,style:t.desc.style,on:{input:t.handleChange},model:{value:t.newValue,callback:function(e){t.newValue=e},expression:"newValue"}},"ele-form-bmap",t.attrs,!1),t.desc.on))},i=[],a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-autocomplete",{staticStyle:{width:"100%"},attrs:{"fetch-suggestions":t.querySearch,placeholder:t.placeholder},on:{select:t.handleChange},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.item;return[n("div",{staticStyle:{"line-height":"20px",display:"flex","align-items":"center"}},[n("i",{staticClass:"el-icon-search el-input__icon",staticStyle:{"font-size":"20px","margin-right":"10px"},attrs:{slot:"suffix"},slot:"suffix"}),n("span",{staticClass:"ele-form-search-keywords"},[t._v(t._s(r.value)+"  ")]),n("span",{staticClass:"ele-form-search-location"},[t._v(t._s(r.address))])])]}}]),model:{value:t.searchValue,callback:function(e){t.searchValue=e},expression:"searchValue"}}),n("baidu-map",{staticClass:"ele-form-bmap",style:{height:t.mapHeight+"px"},attrs:{ak:t.ak,center:t.center,"scroll-wheel-zoom":t.isScrollWheelZoom,zoom:t.zoom},on:{click:t.handleChange,load:t.handleMapLoaded}},[t.isShowGeolocation?n("bm-geolocation",{attrs:{autoLocation:!0,showAddressBar:!0,anchor:"BMAP_ANCHOR_BOTTOM_RIGHT"},on:{locationSuccess:t.handleChange}}):t._e(),t.isShowNavigation?n("bm-navigation",{attrs:{anchor:"BMAP_ANCHOR_TOP_LEFT"}}):t._e(),t.isSearching?n("bm-local-search",{attrs:{"auto-viewport":!1,keyword:t.searchValue,pageCapacity:10,panel:!1},on:{searchcomplete:t.handleSearchEnd}}):t._e(),n("bm-marker",{attrs:{dragging:!0,position:t.center,animation:"BMAP_ANIMATION_BOUNCE"},on:{dragend:t.handleChange}}),n("bm-view",{staticStyle:{width:"100%"},style:{height:t.mapHeight+"px"}})],1)],1)},s=[],l=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t.hasBmView?t._e():n("div",{ref:"view",staticStyle:{width:"100%",height:"100%"}}),t._t("default")],2)},c=[],u=n("7f25"),h=u["a"];function f(t,e,n,r,o,i,a,s){var l,c="function"===typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),a?(l=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=l):o&&(l=s?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:t,options:c}}var p,d,g,m,y=f(h,l,c,!1,null,null,null),b=y.exports,w=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div")},v=[],_={name:"bm-view"},A=_,B=f(A,w,v,!1,null,null,null),S=B.exports,E=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.panel,expression:"panel"}]},[t._t("default")],2)},R=[],O=n("76f3"),k=n("33d3"),C=n("2da4"),M={name:"bm-local-search",mixins:[Object(C["a"])("search")],props:{location:{type:[Object,String]},keyword:{type:[Array,String]},panel:{type:Boolean,default:!0},forceLocal:{type:Boolean},customData:{type:Object},bounds:{type:Object},nearby:{type:Object},pageCapacity:{type:Number},autoViewport:{type:Boolean},selectFirstResult:{type:Boolean}},watch:{location:{handler(t){const{originInstance:e,search:n}=this;e.setLocation(t||this.map),n()},deep:!0},keyword(){this.search()},bounds:{handler(t){const{searchInBounds:e}=this;e(t)},deep:!0},nearby:{handler(t){const{searchNearby:e}=this;e(t)},deep:!0},forceLocal(){this.reload()},customData:{deep:!0,handler(){this.reload()}},pageCapacity(t){this.originInstance&&this.originInstance.setPageCapacity(t)},autoViewport(t){this.originInstance&&(t?this.originInstance.enableAutoViewport():this.originInstance.disableAutoViewport())},selectFirstResult(t){this.originInstance&&(t?this.originInstance.enableFirstResultSelection():this.originInstance.disableFirstResultSelection())},highlightMode(){this.reload()}},methods:{searchNearby(t){const{originInstance:e,keyword:n,customData:r,BMap:o}=this;e.searchNearby(n,Object(O["d"])(o,t.center),t.radius,r)},searchInBounds(t){const{originInstance:e,keyword:n,customData:r,BMap:o}=this;e.searchInBounds(n,Object(O["a"])(o,t),r)},search(){const{originInstance:t,keyword:e,forceLocal:n,customData:r,nearby:o,bounds:i,searchNearby:a,searchInBounds:s}=this;o?a(o):i?s(i):t.search(e,{forceLocal:n,customData:r})},load(){const t=this,{map:e,BMap:n,search:r,pageCapacity:o,autoViewport:i,selectFirstResult:a,highlightMode:s,location:l,originInstance:c}=this,u=l?Object(k["b"])(l)?Object(O["d"])(n,l):l:e,h=this.originInstance=new n.LocalSearch(u,{onMarkersSet(e){t.$emit("markersset",e)},onInfoHtmlSet(e){t.$emit("infohtmlset",e)},onResultsHtmlSet(e){t.$emit("resultshtmlset",e)},onSearchComplete(e){c&&c!==h&&c.clearResults(),t.$emit("searchcomplete",e)},pageCapacity:o,renderOptions:{map:e,panel:this.$el,selectFirstResult:a,autoViewport:i,highlightMode:s}});r()}}},P=M,I=f(P,E,R,!1,null,null,null),T=I.exports,x=n("b5c1"),j=x["a"],D=f(j,p,d,!1,null,null,null),U=D.exports,Z=n("4757"),$=Z["a"],L=f($,g,m,!1,null,null,null),N=L.exports,Y=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._t("default")],2)},z=[],V=n("165e"),F=V["a"],W=f(F,Y,z,!1,null,null,null),H=W.exports,J={name:"ele-form-bmap",props:{value:{type:[String,Object]},ak:{type:String,required:!0},zoom:{type:Number,default:12},isScrollWheelZoom:{type:Boolean,default:!1},mapHeight:{type:Number,default:400},isShowNavigation:{type:Boolean,default:!0},isShowGeolocation:{type:Boolean,default:!0},placeholder:{type:String,default:"请搜索位置"}},components:{BaiduMap:b,BmView:S,BmNavigation:U,BmLocalSearch:T,BmGeolocation:N,BmMarker:H},data(){return{center:"北京",isSearching:!1,searchList:[],searchValue:""}},methods:{handleMapLoaded(){this.value&&(this.center=this.value,"string"===typeof this.value?this.searchValue=this.value:"object"===typeof this.value&&this.value.address&&(this.searchValue=this.value.address))},querySearch(t,e){t&&(this.isSearching=!0,this.cb=e)},handleSearchEnd(t){if(t&&t.Hr&&this.cb){const e=t.Hr.map(t=>({address:t.address,point:t.point,value:t.title}));this.cb(e),this.cb=null,this.isSearching=!1}},handleChange(t){t&&t.point&&(this.center=t.point,this.$emit("input",{address:this.searchValue,lat:t.point.lat,lng:t.point.lng}))}}},G=J,q=(n("67a0"),f(G,a,s,!1,null,null,null)),K=q.exports,X={name:"ExtendSlot",functional:!0,props:{render:Function,data:Object},render:(t,e)=>e.props.render(t,e.props.data)};const Q=n("c1c3");var tt={computed:{componentName(){let t=this.$options.name;return t=t.replace("EleForm","").replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,"-$&").toLowerCase(),t.startsWith("-")&&(t=t.slice(1)),t},globalAttrs(){return this.$EleFormParams||{}},globalUploadAttrs(){return this.globalAttrs.upload||{}},globalComponentAttrs(){return this.isUploadComponent?Object.assign({},this.globalUploadAttrs,this.globalAttrs[this.componentName]):this.globalAttrs[this.componentName]},customAttrs(){const t=Q(this.desc._attrs||{});return t.placeholder||delete t.placeholder,t},attrs(){return Object.assign({},this.defaultAttrs,this.globalComponentAttrs,this.customAttrs,{disabled:this.disabled||this.customAttrs.disabled},{readonly:this.readonly||this.customAttrs.readonly})}}};function et(t){return!nt(t)}function nt(t){return null===t||void 0===t}function rt(t,e){const n=Array.isArray(e)?e:[e],r=Object.prototype.toString.call(t);return n.some(t=>`[object ${t}]`===r)}var ot={"ele-form":{required:"必填",backBtnText:"返回",resetBtnText:"重置",submitBtnText:"提交",cancelBtnText:"取消",mockBtnText:"模拟数据",select:"请选择",submitBtnTextInline:"查询",formError:"表单填写错误",input:"请输入",time:"请选择时间",date:"选择日期",week:"请选择周",year:"请选择年",weekFormat:"yyyy 第 WW 周",startDate:"开始日期",endDate:"结束日期",startTime:"开始时间",endTime:"结束时间",dates:"选择一个或多个日期",month:"选择月",tagError:"已存在",upload:{error:"上传出错了, 请重试!",size:"上传图片大小不能超过",action:"请传入请求地址 action 属性!",imageType:"上传文件格式不正确, 请上传图片文件!"}}},it=n("8bbf"),at=n.n(it),st=n("3c4e"),lt=n.n(st);const ct=/(%|)\{([0-9a-zA-Z_]+)\}/g;var ut=function(t){function e(t,...e){return 1===e.length&&"object"===typeof e[0]&&(e=e[0]),e&&e.hasOwnProperty||(e={}),t.replace(ct,(n,r,o,i)=>{let a;return"{"===t[i-1]&&"}"===t[i+n.length]?o:(a=Object.prototype.hasOwnProperty.call(e,o)?e[o]:null,null===a||void 0===a?"":a)})}return e};const ht=ut(at.a);let ft=ot,pt=!1,dt=function(){const t=Object.getPrototypeOf(this||at.a).$t;if("function"===typeof t&&at.a.locale)return pt||(pt=!0,at.a.locale(at.a.config.lang,lt()(ft,at.a.locale(at.a.config.lang)||{},{clone:!0}))),t.apply(this,arguments)};const gt=function(t,e){let n=dt.apply(this,arguments);if(null!==n&&void 0!==n)return n;const r=t.split(".");let o=ft;for(let i=0,a=r.length;i<a;i++){const t=r[i];if(n=o[t],i===a-1)return ht(n,e);if(!n)return"";o=n}return""};var mt={methods:{t(...t){return gt.apply(this,t)}}};function yt(){const t=window.Mock;return window.Mock&&t.Random.extend({multiple(e){const n=t.Random.integer(0,e.length);return[...new Set(Array.from({length:n},()=>t.Random.pick(e)))]},checkbox(e,n="value"){if(Array.isArray(e)){const r=e.map(t=>t[n]),o=t.Random.integer(0,e.length);return[...new Set(Array.from({length:o},()=>t.Random.pick(r)))]}return[]},radio(e,n="value"){if(Array.isArray(e)){const r=e.map(t=>t[n]);return t.Random.pick(r)}return null}}),t}var bt={inheritAttrs:!1,components:{ExtendSlot:X},mixins:[tt,mt],props:{value:{},disabled:Boolean,readonly:Boolean,options:{type:Array,default(){return[]}},formData:Object,desc:{type:Object,default(){return{}}}},computed:{slots(){return this.desc.slots||{}},scopedSlots(){return this.desc.scopedSlots||{}},onEvents(){return Object.assign({},this.defaultOn,this.desc.on)}},watch:{value:{handler(t){this.handleValueChanged(t)},immediate:!0}},data(){return{defaultOn:{input:this.handleChange},newValue:this.value}},methods:{mockData(){const t=yt();t&&(!0===this.desc.mock&&!1!==this.mockRule?"custom"===this.mockRule?this.handleChange(this.getCustomMockData()):"checkbox"===this.mockRule||"radio"===this.mockRule?this.handleChange(t.Random[this.mockRule](this.options)):this.mockRule?this.handleChange(t.mock(this.mockRule)):console.error(this.componentName+" 类型组件没有mock规则, 请手动配置mock规则, 例如: mock: '@float', 详细参考: http://mockjs.com/examples.html#DPD"):"string"===typeof this.desc.mock?this.handleChange(t.mock(this.desc.mock)):"function"===typeof this.desc.mock&&this.handleChange(this.desc.mock(t.mock,t.Random)))},handleChange(t){this.$emit("input",t)},checkType(t,e=!1){if(this.type&&et(t)){const n=rt(t,this.type);return n||console.error(`[vue-ele-form warn]: ${this.desc._label} 的${e?"默认":""}值类型错误, 期望 [${this.type}] 类型, 但`,t,"不是该类型, 请检查"),n}return!0},handleValueChanged(t){this.desc.displayFormatter&&(t=this.desc.displayFormatter(t)),this.checkType(t)&&(this.customInit&&(t=this.customInit(t)),this.newValue=t)}}},wt={name:"bmap",mixins:[bt],components:{EleFormBmap:K}},vt=wt,_t=f(vt,o,i,!1,null,null,null),At=_t.exports;"undefined"!==typeof window&&window.Vue&&window.Vue.component(At.name,At);var Bt=At;e["default"]=Bt}})}));
//# sourceMappingURL=diandi-ele-form-bmap.umd.min.js.map