var PlusObject=function(plusContext,param){plusContext.__param__=param;var dc_plusobjects={},dc_plusMouldes={};function PlusObject(e,t){for(var n in this.weex=t,this.__HtMl_Id__,this.weexBridge=t.requireModule("plus"),this.globalEvent=t.requireModule("globalEvent"),dc_plusMouldes)if(!this[n]){var i=dc_plusMouldes[n](plusContext,this,this.require,param[n]);i&&(this[n]=i)}}return PlusObject.prototype.updateConfigInfo=function(){var e=this.weexBridge.getConfigInfo();if(e)for(var t in"string"==typeof e&&(e=JSON.parse(e)),this.__WebVieW_Id__=e.__WebVieW_Id__,this.__HtMl_Id__=e.__HtMl_Id__,e){var n=this[t];if("object"==typeof n&&e[t])if(n.updateInfo)n.updateInfo(e[t]);else{var i=e[t];for(var o in i)n[o]=n[o]||i[o]}}},PlusObject.prototype.require=function(e){if(!this[e]){var t=dc_plusMouldes[e](plusContext,this,this.require,param[e]);t&&(this[e]=t)}return this[e]},PlusObject.prototype.importMoudle=function(name){if(this[name])return this[name];var script=this.weexBridge.importMoudle(name);return eval(script),this.require(name)},PlusObject.register=function(e,t){dc_plusMouldes[e]=t},PlusObject.newPlus=function(e,t){var n=dc_plusobjects[e];return n||((n=new PlusObject(e,t)).updateConfigInfo(),dc_plusobjects[e]=n),n},PlusObject.deletePlus=function(e){dc_plusobjects[e]&&delete dc_plusobjects[e]},PlusObject}(plusContext,param);function WebviewGroupMoudle(e,t,n){t=t;var i="WebviewGroup";function o(e,n){t.webview.NView.prototype.constructor.apply(this,[i]),this.__children=[];var o=[];if(Array.isArray(e))for(var r=0;r0){for(var o=0;o-1&&(u.splice(t,1),0===u.length&&(o.exec(s,"stop",[]),a=!1))}return{getCurrentAcceleration:function(e,t,n){var i=d(function(t){h(i),e(t)},function(e){h(i),t&&t(e)});u.push(i),a||f(-1)},watchAcceleration:function(n,i,o){var s=o&&o.frequency&&"number"==typeof o.frequency?o.frequency:500,_=r.UUID("watch"),p=d(function(){},function(e){h(p),i&&i(e)});return u.push(p),c[_]={timer:(e.setInterval?e:t).setInterval(function(){l&&n(l)},s),listeners:p},a?l&&n(l):f(s),_},clearWatch:function(n){n&&c[n]&&((e.clearInterval?e:t).clearInterval(c[n].timer),h(c[n].listeners),delete c[n])}}}),PlusObject.register("audio",function(e,t,n,i){var o=t.bridge,r=t.tools;t.audio={getRecorder:function(){var e={_Audio_UUID__:r.UUID("Record"),supportedFormats:["amr","3gp","aac"],supportedSamplerates:[44100,16e3,8e3],record:function(e,t,n){var i=o.callbackId(t,n);o.exec("Audio","RecorderExecMethod",["record",[this._Audio_UUID__,i,e]])},stop:function(){o.exec("Audio","RecorderExecMethod",["stop",[this._Audio_UUID__]])},pause:function(){o.exec("Audio","RecorderExecMethod",["pause",[this._Audio_UUID__]])},resume:function(){o.exec("Audio","RecorderExecMethod",["resume",[this._Audio_UUID__]])}};return r.IOS==r.platform&&(e.supportedFormats=["wav","aac","amr","mp3"]),e},createPlayer:function(e){var t={_Player_Param:e,_Audio_Player_UUID_:r.UUID("Player"),play:function(e,t){var n=o.callbackId(e,t);o.exec("Audio","AudioExecMethod",["play",[this._Audio_Player_UUID_,n]])},pause:function(){o.exec("Audio","AudioExecMethod",["pause",[this._Audio_Player_UUID_]])},resume:function(){o.exec("Audio","AudioExecMethod",["resume",[this._Audio_Player_UUID_]])},stop:function(){o.exec("Audio","AudioExecMethod",["stop",[this._Audio_Player_UUID_]])},seekTo:function(e){o.exec("Audio","AudioExecMethod",["seekTo",[this._Audio_Player_UUID_,e]])},getDuration:function(){return o.execSync2("Audio","AudioSyncExecMethod",["getDuration",[this._Audio_Player_UUID_]])},getPosition:function(){return o.execSync2("Audio","AudioSyncExecMethod",["getPosition",[this._Audio_Player_UUID_]])},setRoute:function(e){o.exec("Audio","AudioExecMethod",["setRoute",[this._Audio_Player_UUID_,e]])},setSessionCategory:function(e){o.exec("Audio","AudioExecMethod",["setSessionCategory",[this._Audio_Player_UUID_,e]])},isPaused:function(){return o.execSync2("Audio","AudioSyncExecMethod",["getPaused",[this._Audio_Player_UUID_]])},getBuffered:function(){return o.execSync2("Audio","AudioSyncExecMethod",["getBuffered",[this._Audio_Player_UUID_]])},getStyles:function(e){return o.execSync2("Audio","AudioSyncExecMethod",["getStyles",[this._Audio_Player_UUID_,e]])},setStyles:function(e){o.exec("Audio","AudioExecMethod",["setStyles",[this._Audio_Player_UUID_,e]])},addEventListener:function(e,t){var n=o.callbackId(t);o.exec("Audio","AudioExecMethod",["addEventListener",[this._Audio_Player_UUID_,e,n]])},removeEventListener:function(e){o.exec("Audio","AudioExecMethod",["removeEventListener",[this._Audio_Player_UUID_,e]])},close:function(){o.exec("Audio","AudioExecMethod",["close",[this._Audio_Player_UUID_]])}},n={};return"string"==typeof t._Player_Param?n.src=t._Player_Param:n=t._Player_Param,o.execSync("Audio","AudioSyncExecMethod",["CreatePlayer",[t._Audio_Player_UUID_,n]]),t},ROUTE_SPEAKER:0,ROUTE_EARPIECE:1}}),PlusObject.register("barcode",function(e,t,n,i){var o="barcode",r=(t=t).tools,s=t.bridge,a={};function c(t,n,i,a,c,u){var l=this;l.IDENTITY=o,l.onmarked=null,l.onerror=null,l.isClose=!1,l.__uuid__=r.UUID("bc"),l.callbackId=null;var _=null;c||(c=l.__uuid__),this.callbackId=s.callbackId(function(e){"function"==typeof l.onmarked&&l.onmarked(e.type,e.message,e.file)},function(e){"function"==typeof l.onerror&&l.onerror(e)}),e.document&&(div=document.getElementById(t),null!=div&&void 0!=div&&(div.addEventListener("resize",function(){var e=[div.offsetLeft,div.offsetTop,div.offsetWidth,div.offsetHeight];s.exec(o,"resize",[e])},!1),_=[div.offsetLeft,div.offsetTop,div.offsetWidth,div.offsetHeight]));var f=!0;void 0==u||null==u||u||(f=!1),f&&s.exec(o,"Barcode",[this.__uuid__,this.callbackId,c,_,n,i,a])}var u=c.prototype;u.setStyle=function(e){this.isClose||s.exec(o,"setStyle",[this.__uuid__,e])},u.start=function(e){this.isClose||s.exec(o,"start",[this.__uuid__,e])},u.setFlash=function(e){this.isClose||s.exec(o,"setFlash",[this.__uuid__,e])},u.cancel=function(){this.isClose||s.exec(o,"cancel",[this.__uuid__])},u.close=function(){this.isClose||(s.exec(o,"close",[this.__uuid__]),this.isClose=!0)};var l={Barcode:c,create:function(e,n,i,o){var r=new t.barcode.Barcode(null,n,i,o,e,!0);return a[r.__uuid__]=r,a[r.__uuid__]},getBarcodeById:function(e){if(e&&"string"==typeof e){var n=s.execSync(o,"getBarcodeById",[e]);if(null!=n&&null!=n.uuid){if(a[n.uuid])return a[n.uuid];if(null!=n&&void 0!=n){var i=new t.barcode.Barcode(null,n.filters,n.options,n.autoDecodeCharset,e,!1);return i.__uuid__=n.uuid,s.exec(o,"addCallBack",[i.__uuid__,i.callbackId]),a[i.__uuid__]=i,i}return null}}},scan:function(e,t,n,i,r){var a="function"!=typeof t?null:function(e){t(e.type,e.message,e.file,e.charSet)},c="function"!=typeof n?null:function(e){n(e)},u=s.callbackId(a,c);s.exec(o,"scan",[u,e,i,r])},QR:0,EAN13:1,EAN8:2,AZTEC:3,DATAMATRIX:4,UPCA:5,UPCE:6,CODABAR:7,CODE39:8,CODE93:9,CODE128:10,ITF:11,MAXICODE:12,PDF417:13,RSS14:14,RSSEXPANDED:15};return l}),PlusObject.register("cache",function(e,t,n,i){var o=t.bridge,r="Cache";t.cache={clear:function(e){var t=o.callbackId(function(t){e&&e()},null);o.exec(r,"clear",[t])},calculate:function(e){var t=o.callbackId(function(t){e&&e(t)},null);o.exec(r,"calculate",[t])},setMaxSize:function(e){o.exec(r,"setMaxSize",[e])}}}),PlusObject.register("camera",function(e,t){var n,i=t.require("bridge");function o(){this.index=1,this.__busy__=!1,this.supportedImageResolutions=[],this.supportedVideoResolutions=[],this.supportedImageFormats=[],this.supportedVideoFormats=[]}var r=o.prototype;return r.captureImage=function(e,t,n){var o=this;if(!o.__busy__){var r="function"!=typeof e?null:function(t){o.__busy__=!1,e(t)},s="function"!=typeof t?null:function(e){o.__busy__=!1,t(e)},a=i.callbackId(r,s);n||(n={}),n.index||(n.index=this.index),i.exec("Camera","captureImage",[a,n])}},r.startVideoCapture=function(e,t,n){var o=this;if(!o.__busy__){var r="function"!=typeof e?null:function(t){o.__busy__=!1,e(t)},s="function"!=typeof t?null:function(e){o.__busy__=!1,t(e)},a=i.callbackId(r,s);n||(n={}),n.index||(n.index=this.index),i.exec("Camera","startVideoCapture",[a,n])}},r.stopVideoCapture=function(){i.exec("Camera","stopVideoCapture",[])},{getCamera:function(e){if(n)return n;(n=new o).index=e;var t=i.execSync("Camera","getCamera",[n.__UUID__,e]);return t?(n.supportedImageFormats=t.supportedImageFormats,n.supportedVideoFormats=t.supportedVideoFormats,n.supportedImageResolutions=t.supportedImageResolutions,n.supportedVideoResolutions=t.supportedVideoResolutions):(n.supportedImageFormats=["png","jpg"],n.supportedImageResolutions=["640*480","1280*720","960*540","high","medium","low"],n.supportedVideoFormats=["mp4"],n.supportedVideoResolutions=["640*480","1280*720","960*540"]),n}}}),PlusObject.register("contacts",function(e,t,n,i){var o,r,s=(t=t).bridge,a=t.tools,c=function(e){this.code=e||null};function u(e,t,n,i,o,r,s,a,c,u,l,_,f,d,h){this.id=e||null,this.rawId=h||null,this.target=0,this.displayName=t||null,this.name=n||null,this.nickname=i||null,this.phoneNumbers=o||null,this.emails=r||null,this.addresses=s||null,this.ims=a||null,this.organizations=c||null,this.birthday=u||null,this.note=l||null,this.photos=_||null,this.categories=f||null,this.urls=d||null}c.UNKNOWN_ERROR=0,c.INVALID_ARGUMENT_ERROR=1,c.TIMEOUT_ERROR=2,c.PENDING_OPERATION_ERROR=3,c.IO_ERROR=4,c.NOT_SUPPORTED_ERROR=5,c.PERMISSION_DENIED_ERROR=20;var l=u.prototype;function _(e){this.type=e}l.remove=function(e,t){var n=t&&function(e){t(new c(e))};if(null===this.id)n(c.UNKNOWN_ERROR);else{var i=s.callbackId(e,n);s.exec("Contacts","remove",[i,this.id,this.target],{cbid:i})}},l.clone=function(){var e=a.clone(this);function t(e){if(e)for(var t=e.length,n=0;n0&&(t.maximumAge=e.maximumAge),void 0!==e.enableHighAccuracy&&(t.enableHighAccuracy=e.enableHighAccuracy),void 0===e.timeout||isNaN(e.timeout)||(e.timeout<0?t.timeout=0:t.timeout=e.timeout),e.coordsType&&(t.coordsType=e.coordsType),e.provider&&(t.provider=e.provider),void 0!==e.geocode&&(t.geocode=e.geocode)),t}function _(i,o){return e.setTimeout,n.setTimeout(function(){f(t),t=null,i(new u(u.TIMEOUT,"Position retrieval timed out."))},o)}function f(t){e.clearTimeout?!0!==t&&e.clearTimeout(t):!0!==t&&n.clearTimeout(t)}u.PERMISSION_DENIED=1,u.POSITION_UNAVAILABLE=2,u.TIMEOUT=3,u.UNKNOWN_ERROR=4;var d=n.geolocation={lastPosition:null,getCurrentPosition:function(e,t,n){h(e,t,n,!0)},watchPosition:function(t,a,p){p=l(p);var y=r.UUID("timer");s[y]=h(t,a,p,!1);var v=function(e){f(s[y].timer);var t=new u(e.code,e.message);a&&a(t)},g=o.callbackId(function(e){f(s[y].timer),p.timeout!==1/0&&(s[y].timer=_(v,p.timeout));var n=new c({latitude:e.latitude,longitude:e.longitude,altitude:e.altitude,accuracy:e.accuracy,heading:e.heading,velocity:e.velocity,coordsType:e.coordsType,address:e.address,addresses:e.addresses,altitudeAccuracy:e.altitudeAccuracy},void 0===e.timestamp?(new Date).getTime():e.timestamp instanceof Date?e.timestamp.getTime():e.timestamp);d.lastPosition=n,t(n)},v);return o.exec(i,"watchPosition",[g,y,p.enableHighAccuracy,p.coordsType,p.provider,p.geocode,p.timeout,p.maximumAge],{cbid:g,l:e.getLocationHerf(n)}),y},clearWatch:function(e){e&&void 0!==s[e]&&(f(s[e].timer),s[e].timer=!1,o.exec(i,"clearWatch",[e]))}};function h(t,r,s,a){s=l(s);var h={timer:null},p=function(e){f(h.timer),h.timer=null;var t=new u(e.code,e.message);r&&r(t)};if(d.lastPosition&&s.maximumAge&&(new Date).getTime()-d.lastPosition.timestamp<=s.maximumAge)t(d.lastPosition);else if(0===s.timeout)p(new u(u.TIMEOUT,"timeout value in PositionOptions set to 0 and no cached Position object available, or cached Position object's age exceeds provided PositionOptions' maximumAge parameter."));else if(s.timeout!==1/0?h.timer=_(p,s.timeout):h.timer=!0,a){var y=o.callbackId(function(e){if(f(h.timer),h.timer){var n=new c({latitude:e.latitude,longitude:e.longitude,altitude:e.altitude,accuracy:e.accuracy,heading:e.heading,velocity:e.velocity,coordsType:e.coordsType,address:e.address,addresses:e.addresses,altitudeAccuracy:e.altitudeAccuracy},void 0===e.timestamp?(new Date).getTime():e.timestamp instanceof Date?e.timestamp.getTime():e.timestamp);d.lastPosition=n,t(n)}},p);o.exec(i,"getCurrentPosition",[y,s.enableHighAccuracy,s.maximumAge,s.coordsType,s.provider,s.geocode,s.timeout],{cbid:y,l:e.getLocationHerf(n)})}return h}return d}),PlusObject.register("io",function(e,t,n,i){var o=t.bridge,r=(t.tools,[]),s={NATIVEF:"File",exec:function(e,t,n,i){var r=o.callbackId(e,t);o.exec(s.NATIVEF,n,[r,i])}};function a(e){this.code=e.code||null,this.message=e.message||""}function c(e){var t="未知错误";switch(e){case a.NOT_FOUND_ERR:t="文件没有发现";break;case a.SECURITY_ERR:t="没有获得授权";break;case a.ABORT_ERR:t="取消";break;case a.NOT_READABLE_ERR:t="不允许读";break;case a.ENCODING_ERR:t="编码错误";break;case a.NO_MODIFICATION_ALLOWED_ERR:t="不允许修改";break;case a.INVALID_STATE_ERR:t="无效的状态";break;case a.SYNTAX_ERR:t="语法错误";break;case a.INVALID_MODIFICATION_ERR:t="无效的修改";break;case a.QUOTA_EXCEEDED_ERR:t="执行出错";break;case a.TYPE_MISMATCH_ERR:t="类型不匹配";break;case a.PATH_EXISTS_ERR:t="路径存在"}return{code:e,message:t}}function u(e,t){t=t||{},this.type=e,this.bubbles=!1,this.cancelBubble=!1,this.cancelable=!1,this.lengthComputable=!1,this.loaded=t.loaded||0,this.total=t.total||0,this.target=t.target||null}function l(e,t,n,i,o){this.size=o||0,this.type=n||null,this.name=e||"",this.lastModifiedDate=new Date(i)||null,this.fullPath=t||null}a.NOT_FOUND_ERR=1,a.SECURITY_ERR=2,a.ABORT_ERR=3,a.NOT_READABLE_ERR=4,a.ENCODING_ERR=5,a.NO_MODIFICATION_ALLOWED_ERR=6,a.INVALID_STATE_ERR=7,a.SYNTAX_ERR=8,a.INVALID_MODIFICATION_ERR=9,a.QUOTA_EXCEEDED_ERR=10,a.TYPE_MISMATCH_ERR=11,a.PATH_EXISTS_ERR=12;var _=l.prototype;function f(e,t,n,i,o,r){this.isFile=void 0!==e&&e,this.isDirectory=void 0!==t&&t,this.name=n||"",this.fullPath=i||"",this.fileSystem=o||null,this.__PURL__=r||"",this.__remoteURL__=r?"http://localhost:13131/"+r:""}_.slice=function(e,t,n){var i=this.size>0?this.size-1:0,o=0,r=i;if(arguments.length&&(o=e<0?Math.max(i+e,0):Math.min(i,e)),arguments.length>=2&&(r=t<0?Math.max(i+t,0):Math.min(t,i)),rthis.length?this.position=this.length:this.position=e)},m.truncate=function(e){if(this.readyState===I.WRITING)throw new a(a.INVALID_STATE_ERR);this.readyState=I.WRITING;var t=this;"function"==typeof t.onwritestart&&t.onwritestart(new u("writestart",{target:this})),s.exec(function(e){t.readyState!==I.DONE&&(t.readyState=I.DONE,t.length=e,t.position=Math.min(t.position,e),"function"==typeof t.onwrite&&t.onwrite(new u("write",{target:t})),"function"==typeof t.onwriteend&&t.onwriteend(new u("writeend",{target:t})))},function(e){t.readyState!==I.DONE&&(t.readyState=I.DONE,t.error=new a(e),"function"==typeof t.onerror&&t.onerror(new u("error",{target:t})),"function"==typeof t.onwriteend&&t.onwriteend(new u("writeend",{target:t})))},"truncate",[this.fileName,e,this.position])},{FileSystem:x,DirectoryEntry:p,DirectoryReader:v,FileReader:g,FileWriter:I,requestFileSystem:function(n,i,o){var u=function(e){"function"==typeof o&&o(new a(e))};if(n<1||n>4)u(c(a.SYNTAX_ERR));else{var l=r[n],_=function(e){e?"function"==typeof i&&(l||(l=new x(e.name,e.root),r[n]=l),i(l)):u(c(a.NOT_FOUND_ERR))};l?e.setTimeout?e.setTimeout(_(l),0):t.setTimeout(_(l),0):s.exec(_,u,"requestFileSystem",[n])}},resolveLocalFileSystemURL:function(e,t,n){var i=function(e){n&&n(new a(e))};"string"==typeof e?s.exec(function(e){var n;if(e){if(t){var o=r[e.type];o||(o=new x(e.fsName,e.fsRoot),r[e.type]=o),n=e.isDirectory?new p(e.name,e.fullPath,o,e.remoteURL):new h(e.name,e.fullPath,o,e.remoteURL),t(n)}}else i(c(a.NOT_FOUND_ERR))},i,"resolveLocalFileSystemURL",[e]):setTimeout(function(){i(c(a.ENCODING_ERR))},0)},convertLocalFileSystemURL:function(e){return o.execSync(s.NATIVEF,"convertLocalFileSystemURL",[e])},convertAbsoluteFileSystem:function(e){return o.execSync(s.NATIVEF,"convertAbsoluteFileSystem",[e])},getImageInfo:function(e){var t="function"!=typeof e.complete?function(){}:e.complete,n="function"!=typeof e.success?t:function(n){e.success(n),t(n)},i="function"!=typeof e.fail?t:function(n){e.fail(n),t(n)},r="string"!=typeof e.savePath?"":e.savePath;callbackID=o.callbackId(n,i),o.exec(s.NATIVEF,"getImageInfo",[callbackID,e.src,r])},getFileInfo:function(e){S(e,"getFileInfo",function(){return{filePath:e.filePath,digestAlgorithm:e.digestAlgorithm}})},getAudioInfo:function(e){S(e,"getAudioInfo",function(){return{filePath:e.filePath}})},getVideoInfo:function(e){S(e,"getVideoInfo",function(){return{filePath:e.filePath}})},PRIVATE_WWW:1,PRIVATE_DOC:2,PUBLIC_DOCUMENTS:3,PUBLIC_DOWNLOADS:4}}),PlusObject.register("maps",function(e,t,n,i){var o=t.bridge,r=t.tools,s="Maps",a="createObject",c="updateObject",u="updateObjectSYNC",l="execMethod",_={callback:[],pushCallback:function(e,t,n){this.callback[e]={fun:t,nokeep:n}},execCallback:function(e,t){this.callback[e]&&(this.callback[e].fun&&this.callback[e].fun(e,t),this.callback[e].nokeep&&delete this.callback[e])}},f={};function d(e,t,n,i){return r.ANDROID==r.platform?o.exec(s,a,[r.stringify([e,t,n,i])],null):o.exec(s,a,[e,t,n,i],null)}function h(e,t,n){return r.ANDROID==r.platform?o.exec(s,c,[r.stringify([e,[t,n]])],null):o.exec(s,c,[e,[t,n]],null)}function p(e,t,n){return r.ANDROID==r.platform?o.exec(s,l,[r.stringify([e,[t,n]])],null):o.exec(s,l,[e,[t,n]],null)}function y(n,i,o,a,c){i=function(e){var t={zoom:12,type:"MAPTYPE_NORMAL",traffic:!1,zoomControls:!1};return e&&e.center instanceof m&&(t.center=e.center),e&&"number"==typeof e.zoom&&e.zoom<=22&&e.zoom>=1&&(t.zoom=e.zoom),!e||"MAPTYPE_NORMAL"!=e.type&&"MAPTYPE_SATELLITE"!=e.type||(t.type=e.type),e&&"boolean"==typeof e.traffic&&(t.traffic=e.traffic),e&&"boolean"==typeof e.zoomControls&&(t.zoomControls=e.zoomControls),e&&"string"==typeof e.position&&(t.position=e.position),e&&(t.top=e.top,t.left=e.left,t.width=e.width,t.height=e.height),t}(i);var u=this;if(this.IDENTITY=s,this._UUID_=c||r.UUID("map"),this._map_id_=o,this._ui_div_id_=n,this.__showUserLocationVisable__=!1,this.center=i.center?i.center:new t.maps.Point(116.39716,39.91669),this.zoom=i.zoom,this.userLocation=null,this.mapType=i.type,this.zoomControlsVisable=i.zoomControls,this.trafficVisable=i.traffic,this.visable=!0,this.onclick=function(e){},this.onstatuschanged=function(){},_.pushCallback(this._UUID_,function(e,t){if("click"==t.callbackType)u.onclick&&u.onclick(t.payload);else if("change"==t.callbackType&&(u&&(u.zoom=t.zoom),u.onstatuschanged)){var n={};n.target=u,n.zoom=t.zoom,n.center=new m(t.center.long,t.center.lat),t.northease&&(n.bounds=new I(new m(t.northease.long,t.northease.lat),new m(t.southwest.long,t.southwest.lat))),u.onstatuschanged(n)}}),!a){var l=e.document&&e.document.getElementById(this._ui_div_id_),p=[i];l&&(t.tools.platform==t.tools.ANDROID?document.addEventListener("plusorientationchange",function(){setTimeout(function(){var e=[l.offsetLeft,l.offsetTop,l.offsetWidth,l.offsetHeight];h(u._UUID_,"resize",e)},200)},!1):l.addEventListener("resize",function(){var e=[l.offsetLeft,l.offsetTop,l.offsetWidth,l.offsetHeight];h(u._UUID_,"resize",e)},!1),p=[i,l.offsetLeft,l.offsetTop,l.offsetWidth,l.offsetHeight]),f[this._UUID_]=d(this._UUID_,"mapview",p,this._map_id_)}}var v=y.prototype;function g(e){this._UUID_=r.UUID("Bubble"),this.label="string"==typeof e?e:"",this.icon=null,this.marker=null,this.__contentImage=null,this.__contentImageAsDataURL=null,this.onclick=function(e){}}v.close=function(){p("map","close",this._UUID_),f[this._UUID_]&&delete f[this._UUID_]},v.centerAndZoom=function(e,t){if(e instanceof m&&"number"==typeof t){this.center=e,this.zoom=t;var n=[e,t];h(this._UUID_,"centerAndZoom",n)}},v.setCenter=function(e){if(e instanceof m){this.center=e;var t=[e];h(this._UUID_,"setCenter",t)}},v.getCenter=function(){return this.center},v.setZoom=function(e){"number"==typeof e&&(this.zoom=e,h(this._UUID_,"setZoom",[e]))},v.resize=function(){var t=e.document&&e.document.getElementById(this._ui_div_id_),n=[null];t?(n=[t.offsetLeft,t.offsetTop,t.offsetWidth,t.offsetHeight],h(this._UUID_,"resize",n)):console.log("map 在自定义组件模式下不支持'resize'方法,请使用'setStyles'方法")},v.getZoom=function(){return this.zoom},v.setMapType=function(e){"MAPTYPE_NORMAL"!=e&&"MAPTYPE_SATELLITE"!=e||(this.mapType=e,h(this._UUID_,"setMapType",[e]))},v.getMapType=function(){return this.mapType},v.showUserLocation=function(e){if("boolean"==typeof e&&this.__showUserLocationVisable__!=e){this.__showUserLocationVisable__=e;var t=[e];h(this._UUID_,"showUserLocation",t)}},v.isShowUserLocation=function(){return this.__showUserLocationVisable__},v.getUserLocation=function(e){if("function"==typeof e){var n=r.UUID("callback");_.pushCallback(n,function(t,n){e&&e(n.state,n.point)},!0);var i=[n,t.__HtMl_Id__];return h(this._UUID_,"getUserLocation",i),!0}return!1},v.getCurrentCenter=function(e){if("function"==typeof e){function n(t,n){e&&e(n.state,n.point)}var i=o.callbackId(n);_.pushCallback(i,n,!0);var r=[i,t.__HtMl_Id__];return h(this._UUID_,"getCurrentCenter",r),!0}return!1},v.setTraffic=function(e){if("boolean"==typeof e&&e!=this.trafficVisable){this.trafficVisable=e;var t=[e];h(this._UUID_,"setTraffic",t)}},v.isTraffic=function(){return this.trafficVisable},v.showZoomControls=function(e){if("boolean"==typeof e&&e!=this.zoomControlsVisable){this.zoomControlsVisable=e;var t=[e];h(this._UUID_,"showZoomControls",t)}},v.isShowZoomControls=function(){return this.zoomControlsVisable},v.getBounds=function(){var e,t,n,i=(e=this._UUID_,t="getBounds",n=[],r.ANDROID==r.platform?o.execSync(s,u,[r.stringify([e,[t,n]])],null):o.execSync(s,u,[e,[t,n]],null));return new I(new m(i.northease.longitude,i.northease.latitude),new m(i.southwest.longitude,i.southwest.latitude))},v.reset=function(){h(this._UUID_,"reset",[null])},v.show=function(){if(1!=this.visable){this.visable=!0;var t=e.document&&e.document.getElementById(this._ui_div_id_),n=[null];t&&(t.style.display="",n=[t.offsetLeft,t.offsetTop,t.offsetWidth,t.offsetHeight]),h(this._UUID_,"show",n)}},v.hide=function(){0!=this.visable&&(this.visable=!1,e.document&&e.document.getElementById(this._ui_div_id_)&&(document.getElementById(this._ui_div_id_).style.display="none"),h(this._UUID_,"hide",[null]))},v.addOverlay=function(e){if(e instanceof E||e instanceof C||e instanceof R||e instanceof P||e instanceof D){var t=[e._UUID_];return h(this._UUID_,"addOverlay",t),!0}return!1},v.removeOverlay=function(e){if(e instanceof E||e instanceof C||e instanceof R||e instanceof P||e instanceof D){var t=[e._UUID_];return h(this._UUID_,"removeOverlay",t),!0}return!1},v.clearOverlays=function(){h(this._UUID_,"clearOverlays",[null])},y.calculateDistance=function(e,t,n,i){var r=o.callbackId(function(e){"function"==typeof n&&n({distance:e})},function(e){"function"==typeof i&&i(e)});o.exec(s,"calculateDistance",[e,t,r])},y.calculateArea=function(e,t,n){var i=o.callbackId(function(e){"function"==typeof t&&t({area:e})},function(e){"function"==typeof n&&n(e)});o.exec(s,"calculateArea",[e,i])},y.convertCoordinates=function(e,t,n,i){var r=o.callbackId(function(e){if("function"==typeof n){var t={};t.coord=new m(e.long,e.lat),t.coordType=e.type,n(t)}},function(e){"function"==typeof i&&i(e)});o.exec(s,"convertCoordinates",[e,t,r])},y.geocode=function(e,t,n,i){var r=o.callbackId(function(e){if("function"==typeof n){var t={};t.coord=new m(e.long,e.lat),t.address=e.addr,t.coordType=e.type,n(t)}},function(e){"function"==typeof i&&i(e)});o.exec(s,"geocode",[e,t,r])},y.reverseGeocode=function(e,t,n,i){var r=o.callbackId(function(e){if("function"==typeof n){var t={};t.coord=new m(e.long,e.lat),t.address=e.addr,t.coordType=e.type,n(t)}},function(e){"function"==typeof i&&i(e)});o.exec(s,"reverseGeocode",[e,t,r])};var b=g.prototype;function I(e,t,n,i){"number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof i?(this.northease=new m(e,t),this.northeast=new m(e,t),this.southwest=new m(n,i)):e instanceof m&&t instanceof m&&(this.northease=e,this.northeast=e,this.southwest=t)}function m(e,t){this.longitude=e,this.latitude=t}b.setIcon=function(e){"string"==typeof e&&(this.icon=e,this.marker&&h(this.marker._UUID_,"setBubbleIcon",[this.icon]))},b.loadImage=function(e){this.__contentImage=e,this.__contentImageAsDataURL=null,this.marker&&h(this.marker._UUID_,"loadImage",[e])},b.loadImageDataURL=function(e){this.__contentImage=null,this.__contentImageAsDataURL=e,this.marker&&h(this.marker._UUID_,"loadImageDataURL",[e])},b.getLabel=function(){return this.label},b.setLabel=function(e){"string"==typeof e&&(this.label=e,this.marker&&h(this.marker._UUID_,"setBubbleLabel",[this.label]))},b.belongMarker=function(){return this.marker},I.prototype.setNorthEase=function(e){e instanceof m&&(this.northease=e,this.northeast=e)},I.prototype.setNorthEast=function(e){e instanceof m&&(this.northease=e,this.northeast=e)},I.prototype.getNorthEase=function(){return this.northease},I.prototype.getNorthEast=function(){return this.northeast},I.prototype.setSouthWest=function(e){e instanceof m&&(this.southwest=e)},I.prototype.getSouthWest=function(){return this.southwest},I.prototype.contains=function(e){return e instanceof m&&(e.longitude<=this.northease.longitude&&e.longitude>=this.southwest.longitude&&e.latitude<=this.northease.latitude&&e.latitude>=this.southwest.latitude)},I.prototype.equals=function(e){return e instanceof I&&(this.northease.equals(e.northease)&&this.southwest.equals(e.southwest))},I.prototype.getCenter=function(){var e=(this.northease.longitude-this.southwest.longitude)/2,t=(this.northease.latitude-this.southwest.latitude)/2;return new m(e+this.southwest.longitude,t+this.southwest.latitude)};var x=m.prototype;function S(){this._UUID_=null,this.visable=!0}x.setLng=function(e){this.longitude=e},x.getLng=function(){return this.longitude},x.setLat=function(e){this.latitude=e},x.getLat=function(){return this.latitude},x.equals=function(e){return this.longitude==e.longitude&&this.latitude==e.latitude};var w=S.prototype;function D(e){var t=this;this._UUID_=r.UUID("marker"),this.point=e,this.icon="",this.caption="",this.bubble=null,this.canDraggable=!1,this.onclick=function(e){},this.onDrag=function(e){},_.pushCallback(this._UUID_,function(e,n){"bubbleclick"==n.type?t.bubble&&t.bubble.onclick&&t.bubble.onclick(t.bubble):"markerclick"==n.type?t.onclick&&t.onclick(t):"onDrag"==n.type&&(t.point=n.pt,t.onDrag(t))}),d(this._UUID_,"marker",[e])}w.show=function(){1!=this.visable&&(this.visable=!0,h(this._UUID_,"show",["true"]))},w.hide=function(){0!=this.visable&&(this.visable=!1,h(this._UUID_,"hide",["false"]))},w.isVisible=function(){return this.visable},w.bringToTop=function(){h(this._UUID_,"bringToTop",[])},D.prototype=new S;var k=D.prototype;function U(){this.strokeColor="#FFFFFF",this.strokeOpacity=1,this.fillColor="#FFFFFF",this.fillOpacity=1,this.lineWidth=5,this.visable=!0}k.constructor=D,k.setPoint=function(e){if(e instanceof m){this.point=e;var t=[e];h(this._UUID_,"setPoint",t)}},k.getPoint=function(){return this.point},k.setIcon=function(e){"string"==typeof e&&(this.icon=e,h(this._UUID_,"setIcon",[e]))},k.setLabel=function(e){"string"==typeof e&&(this.caption=e,h(this._UUID_,"setLabel",[e]))},k.getLabel=function(){return this.caption},k.setBubble=function(e,t){if(e instanceof g){var n=e.marker;if(n&&n!=this){n.bubble=null;var i=[null,null,null,null,!1];h(n._UUID_,"setBubble",i)}e.marker=this,this.bubble=e;i=[this.bubble.label,this.bubble.icon,this.bubble.__contentImageAsDataURL,this.bubble.__contentImage,t];h(this._UUID_,"setBubble",i)}else null==e&&h(this._UUID_,"setBubble",[null,null,null,null,t])},k.hideBubble=function(){this.bubble&&h(this._UUID_,"hideBubble",[])},k.getBubble=function(){return this.bubble},k.setDraggable=function(e){e!=this.canDraggable&&(this.canDraggable=!this.canDraggable,h(this._UUID_,"setDraggable",[this.canDraggable]))},k.isDraggable=function(){return this.canDraggable},k.setIcons=function(e,t){h(this._UUID_,"setIcons",[e,t])},U.prototype=new S;var T=U.prototype;function E(e,t){this.center=e,this.radius=t,this._UUID_=r.UUID("circle"),d(this._UUID_,"circle",[e,t])}T.constructor=U,T.setStrokeColor=function(e){"string"==typeof e&&(this.strokeColor=e,h(this._UUID_,"setStrokeColor",[e]))},T.getStrokeColor=function(){return this.strokeColor},T.setStrokeOpacity=function(e){"number"==typeof e&&(e<0?e=0:e>1&&(e=1),this.strokeOpacity=e,h(this._UUID_,"setStrokeOpacity",[e]))},T.getStrokeOpacity=function(){return this.strokeOpacity},T.setFillColor=function(e){"string"==typeof e&&(this.fillColor=e,h(this._UUID_,"setFillColor",[e]))},T.getFillColor=function(){return this.fillColor},T.setFillOpacity=function(e){"number"==typeof e&&(e<0?e=0:e>1&&(e=1),this.fillOpacity=e,h(this._UUID_,"setFillOpacity",[e]))},T.getFillOpacity=function(){return this.fillOpacity},T.setLineWidth=function(e){"number"==typeof e&&(e<0&&(e=0),this.lineWidth=e,h(this._UUID_,"setLineWidth",[e]))},T.getLineWidth=function(){return this.lineWidth},E.prototype=new U;var N=E.prototype;function C(e){this.path=e,this._UUID_=r.UUID("polygon"),d(this._UUID_,"polygon",[e])}N.constructor=E,N.setCenter=function(e){e instanceof m&&(this.center=e,h(this._UUID_,"setCenter",[e]))},N.getCenter=function(){return this.center},N.setRadius=function(e){"number"==typeof e&&e>=0&&(this.radius=e,h(this._UUID_,"setRadius",[e]))},N.getRadius=function(){return this.radius},C.prototype=new U;var A=C.prototype;function R(e){this.path=e,this._UUID_=r.UUID("polyline"),d(this._UUID_,"polyline",[e])}A.constructor=C,A.setPath=function(e){this.path=e,h(this._UUID_,"setPath",[e])},A.getPath=function(){return this.path},R.prototype=new U;var O=R.prototype;function P(e,t,n){this._UUID_=r.UUID("route"),this.startPoint=e,this.endPoint=t,this.pointCount=0,this.pointList=[],this.distance=0,this.routeTip="",void 0===n&&d(this._UUID_,"route",[e,t,n])}function B(){this.__state__=0,this.__type__=1,this.startPosition=null,this.endPosition=null,this.routeNumber=0,this.routeList=[]}function L(){this.__state__=0,this.__type__=0,this.totalNumber=0,this.currentNumber=0,this.pageNumber=0,this.pageIndex=0,this.poiList=[]}function V(e){var t=this;this._UUID_=r.UUID("search"),this.pageCapacity=10,this.map=e,this.onPoiSearchComplete=function(e,t){},this.onRouteSearchComplete=function(e,t){},_.pushCallback(this._UUID_,function(e,n){0==n.__type__?t.onPoiSearchComplete&&t.onPoiSearchComplete(n.__state__,n):1==n.__type__&&t.onRouteSearchComplete&&t.onRouteSearchComplete(n.__state__,n)}),d(this._UUID_,"search",[null])}O.constructor=R,O.setPath=function(e){this.path=e,h(this._UUID_,"setPath",[e])},O.getPath=function(){return this.path},P.prototype=new S,P.prototype.constructor=P,B.prototype.getRoute=function(e){return e>=0&&e=0&&e-1&&(u.splice(t,1),0===u.length&&(o.exec(s,"stop",[]),a=!1))}var b={getCurrentOrientation:function(e,t){var n;n=v(function(t){g(n),e(t)},function(e){g(n),t&&t(e)}),u.push(n),a||y()},watchOrientation:function(n,i,o){var s=o&&o.frequency&&("number"==typeof o.frequency||o.frequency instanceof Number)?o.frequency:500,_=r.UUID("watch"),f=v(function(){},function(e){g(f),i&&i(e)});return u.push(f),c[_]={timer:(e.setInterval?e:t).setInterval(function(){l&&n(l)},s),listeners:f},a?l&&n(l):y(),_},clearWatch:function(n){n&&c[n]&&((e.clearInterval?e:t).clearInterval(c[n].timer),g(c[n].listeners),delete c[n])}};t.orientation=b}),PlusObject.register("payment",function(e,t,n,i){var o="Payment",r=t.bridge;function s(){this.id="",this.description="",this.serviceReady=!0,this.installService=function(){r.exec(o,"installService",[this.id])},this.appStoreReceipt=function(){return r.execSync(o,"appStoreReceipt",[this.id])},this.restoreComplateRequest=function(e,t,n){if("appleiap"!==this.id){n({errorcode:"-3"})}var i="function"!=typeof t?null:function(e){t(e)},s="function"!=typeof n?null:function(e){n(e)},a=r.callbackId(i,s);r.exec(o,"restoreComplateRequest",[this.id,a,e])},this.requestOrder=function(e,t,n){if("appleiap"===this.id){var i="function"!=typeof t?null:function(e){t(e)},s="function"!=typeof n?null:function(e){n(e)},a=r.callbackId(i,s);r.exec(o,"requestOrder",[this.id,a,e])}else{n({errorcode:"-3"})}}}var a={Channel:s,getChannels:function(e,t){var n="function"!=typeof e?null:function(t){for(var n=[],i=t.length,o=0;o10&&"blob:file:"==e.url.substring(0,10)){var i=new XMLHttpRequest;i.open("GET",e.url,!0),i.setRequestHeader("Content-type","application/x-www-form-urlencoded"),i.responseType="blob",i.onload=function(i){if(200==this.status){var r=this.response;try{const i=new FileReader;i.onload=function(i){var r=o.callbackId(t,n);o.exec("Runtime","downloadBlob",[i.target.result,e.fileName,r])},i.readAsDataURL(r),i.onerror=function(){n({code:-1,message:"blob error"})}}catch(e){n(s={code:-1,message:e})}}else{var s={code:-1,message:this.status};n(s)}},i.onerror=function(e){n({code:-1,message:"data error"})},i.send()}else{var r=document.createElement("a");r.href=e.url+"&DCLOUD_DOWNLOAD_BLOB:"+e.fileName,r.download=e.fileName,r.click()}else try{const i=new FileReader;i.onload=function(i){var r=o.callbackId(t,n);o.exec("Runtime","downloadBlob",[i.target.result,e.fileName,r])},i.readAsDataURL(e.url),i.onerror=function(){n({code:-1,message:"blob error"})}}catch(e){n({code:-1,message:e})}}}}),PlusObject.register("share",function(e,t,n,i){var o=t.bridge,r=t.tools,s="Share",a={};function c(e,t,n,i){this.id=e,this.description=t,this.authenticated=n,this.accessToken=i,this.nativeClient=!1}var u=c.prototype;function l(n,i){var a=this;a.__UUID__=r.UUID("Authorize"),a.__componentid__=n,a.display=i,a.onloaded=null,a.onauthenticated=null,a.onerror=null,a.__top__=0,a.__left__=0,a.__width__=0,a.__height__=0;var c=e.document&&e.document.getElementById(a.__componentid__);c&&(a.__left__=c.offsetLeft,a.__top__=c.offsetTop,a.__width__=c.offsetWidth,a.__height__=c.offsetHeight);var u=function(e){"function"==typeof a.onerror&&a.onerror(e)},l=o.callbackId(function(e){"load"==e.evt?"function"==typeof a.onloaded&&a.onloaded():"auth"==e.evt&&"function"==typeof a.onauthenticated&&t.share.getServices(function(t){for(var n=0;na.Uninitialized&&("function"==typeof this.onabort&&this.onabort(this.__progessEvent__),this.__init__(),o.exec(a.__F__,"abort",[this.__UUID__]))},c.getAllResponseHeaders=function(){if(this.readyState>=a.Receiving){if(this.__noParseResponseHeader__)return this.__noParseResponseHeader__;var e="";for(var t in this.__responseHeaders__)e=e+t+": "+this.__responseHeaders__[t]+"\r\n";return this.__noParseResponseHeader__=e,this.__noParseResponseHeader__}return null},c.getResponseHeader=function(e){if("string"==typeof e&&this.readyState>=a.Receiving){var t=null;if(e=e.toLowerCase(),t=this.__cacheReponseHeaders__[e])return t;for(var n in this.__responseHeaders__){var i=this.__responseHeaders__[n];e===(n=n.toLowerCase())&&(t=t?t+", "+i:i)}return this.__cacheReponseHeaders__[e]=t,t}return null},c.setRequestHeader=function(e,t){if("string"==typeof e&&"string"==typeof t&&a.Open==this.readyState){var n=this.__requestHeaders__[e];this.__requestHeaders__[e]=n?n+", "+t:t}},c.open=function(e,t,n,i){a.Open!=this.readyState&&a.Loaded!=this.readyState||this.__init__(),a.Uninitialized==this.readyState&&(this.readyState=a.Open,o.exec(a.__F__,"open",[this.__UUID__,e,function(e){return"string"==typeof e?0==(e=e.replace(/(^\s*)|(\s*$)/g,"")).indexOf("http://")||0==e.indexOf("https://")?e:e=0==e.indexOf("/")?location.origin+e:location.origin+location.pathname+e:""}(t),n,i,this.timeout]),"function"==typeof this.onreadystatechange&&this.onreadystatechange())},c.overrideMimeType=function(e){o.exec(a.__F__,"overrideMimeType",[this.__UUID__,e])},c.send=function(e){var t=this;if(a.Open==this.readyState){this.readyState=a.Sent,"function"==typeof this.onloadstart&&this.onloadstart(t.__progessEvent__);var n=o.callbackId(function(e){if(a.Receiving==e.readyState)a.Sent==t.readyState?(t.readyState=a.Receiving,t.status=e.status,t.statusText=e.statusText,t.__responseHeaders__=e.header,t.__progessEvent__.lengthComputable=e.lengthComputable,t.__progessEvent__.total=e.totalSize):a.Receiving==t.readyState&&(t.responseText=e.responseText,t.__progessEvent__.loaded=e.revSize),"function"==typeof t.onreadystatechange&&t.onreadystatechange(),"function"==typeof t.onprogress&&t.onprogress(t.__progessEvent__);else if(a.Loaded==e.readyState){t.readyState=a.Loaded,e.status&&(t.status=e.status);try{if(t.responseText){var n=new DOMParser;t.responseXML=n.parseFromString(t.responseText,"text/xml")}}catch(e){t.responseXML=null}try{if("document"==t.responseType){n=new DOMParser;t.response=t.responseXML}else"json"==t.responseType&&(t.response=JSON.parse(t.responseText))}catch(e){t.response=null}"function"==typeof t.onreadystatechange&&t.onreadystatechange(),e.error==s.Timeout?"function"==typeof t.ontimeout&&t.ontimeout(t.__progessEvent__):e.error==s.Other?"function"==typeof t.onerror&&t.onerror(t.__progessEvent__):"function"==typeof t.onload&&t.onload(t.__progessEvent__),"function"==typeof t.onloadend&&t.onloadend(t.__progessEvent__)}});return o.exec(a.__F__,"send",[this.__UUID__,n,e,this.__requestHeaders__]),void("function"==typeof this.onreadystatechange&&this.onreadystatechange())}throw new Error("XMLHttpRequest not open")},{XMLHttpRequest:a}}),PlusObject.register("zip",function(e,t,n,i){var o=t.bridge;return{decompress:function(e,t,n,i){var r=o.callbackId(n,i);o.exec("Zip","decompress",[e,t,r])},compress:function(e,t,n,i){var r=o.callbackId(n,i);o.exec("Zip","compress",[e,t,r])},compressImage:function(e,t,n){var i=o.callbackId(function(e){if(t){var n={target:e.path,width:e.w,height:e.h,size:e.size};t(n)}},n);o.exec("Zip","compressImage",[e,i])}}}),PlusObject.register("proximity",function(e,t){var n=t.bridge,i=t.tools,o="Proximity",r=!1,s={},a=[];function c(e){var t=a.indexOf(e);t>-1&&(a.splice(t,1),0===a.length&&(n.exec(o,"stop",[]),r=!1))}var u={getCurrentProximity:function(e,t){var r=n.callbackId(function(t){i.IOS==i.platform&&(t=0==t?0:1/0),e&&e(t)},function(e){t&&t(e)});n.exec(o,"getCurrentProximity",[r])},watchProximity:function(e,t){var u,l=i.UUID("watch"),_={win:function(t){i.IOS==i.platform&&(t=0==t?0:1/0),e&&e(t)},fail:function(e){c(_),t&&t(e)}};return a.push(_),s[l]={listeners:_},r||(u=n.callbackId(function(e){for(var t=a.slice(0),n=0,i=t.length;n0)for(var c=0;c=0;s--)i=s==r-1?classTemplate.importClass(o[s],null):classTemplate.importClass(o[s],o[s+1]);return t&&(t.__proto__=i.prototype),i}return null},JSBridge.prototype.invoke=function(e,t){for(var n=null,i=[],o=2;o