text: /*
   ZWeb.js v0.0.1
   (c) 2017 Zyao89
   Released under the MIT License.
  */
  (function(c,e){if("undefined"===typeof c)throw"not find window...";"undefined"===typeof c.__ZWeb__?(e=new (e(c,"ZWeb")),c.__ZWeb__=e.__ROOT__,"object"===typeof exports&&"undefined"!==typeof module?module.exports=e:"function"===typeof define&&define.amd?define("ZWebSDK",e):c.ZWebSDK=e):console.error("ZWeb already loaded...")})(window,function(c,e){function l(){var a=0,b=0;c.innerWidth?a=c.innerWidth:document.body&&document.body.clientWidth&&(a=document.body.clientWidth);c.innerHeight?b=c.innerHeight:
  document.body&&document.body.clientHeight&&(b=document.body.clientHeight);document.documentElement&&document.documentElement.clientHeight&&document.documentElement.clientWidth&&(b=document.documentElement.clientHeight,a=document.documentElement.clientWidth);return{Width:a,Height:b}}var g={UUID:void 0,Promise:void 0};(function(a){function b(){this.id=this.createUUID()}b.prototype.valueOf=function(){return this.id};b.prototype.toString=function(){return this.id};b.prototype.createUUID=function(){var a=
  new Date(1582,10,15,0,0,0,0),c=(new Date).getTime()-a.getTime(),a=b.getIntegerBits(c,0,31),m=b.getIntegerBits(c,32,47),c=b.getIntegerBits(c,48,59)+"1",n=b.getIntegerBits(b.rand(4095),0,7),e=b.getIntegerBits(b.rand(4095),0,7),f=b.getIntegerBits(b.rand(8191),0,7)+b.getIntegerBits(b.rand(8191),8,15)+b.getIntegerBits(b.rand(8191),0,7)+b.getIntegerBits(b.rand(8191),8,15)+b.getIntegerBits(b.rand(8191),0,15);return a+"-"+m+"-"+c+"-"+n+e+"-"+f};b.getIntegerBits=function(a,c,e){a=b.returnBase(a,16);var d=
  [],h="",f;for(f=0;f<a.length;f++)d.push(a.substring(f,f+1));for(f=Math.floor(c/4);f<=Math.floor(e/4);f++)h=d[f]&&""!=d[f]?h+d[f]:h+"0";return h};b.returnBase=function(a,b){var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");if(a<b)b=c[a];else{var d=""+Math.floor(a/b);a-=d*b;b=d>=b?this.returnBase(d,b)+c[a]:c[d]+c[a]}return b};b.rand=function(a){return Math.floor(Math.random()*a)};a.UUID=b})(g);(function(a){var b=function(){this.callbacks=[]};b.prototype={construct:b,resolve:function(a){this.complete("resolve",
  a)},reject:function(a){this.complete("reject",a)},complete:function(a,b){for(;this.callbacks[0];){var c=this.callbacks.shift()[a];c&&c(b)}},then:function(a,b){this.callbacks.push({resolve:a,reject:b});return this}};a.Promise=b})(g);e=function(){this.mapRequireQueue={};this.mapMessageQueue={};this.mapDatabaseQueue={};this.__onFuncCallBackMap__={};this.author="Zyao89";this.version="1.0.0";this.__ROOT__=new k(this)};var p="_init_ extends createUUID saveData loadData databaseCallback showLoading hideLoading tip require requireCallback message messageCallback destroy callInterOS callOS exceptionOS print on dispatchCallback".split(" ");
  e.prototype={_init_:function(a,b){this.FrameworkUUID=a;this.OS=b.OS;this.Version=b.Version;this.InternalName=b.InternalName;this.ExposedName=b.ExposedName;this.print("Info",JSON.stringify(b))},extends:function(a,b){if(0<=p.indexOf(a))throw"Not allowed to use name...";this.__ROOT__[a]=b},createUUID:function(){return(new g.UUID).id},saveData:function(a,b){a={Sequence:this.createUUID(),Data:{Key:a,Value:b}};b=new g.Promise;this.mapDatabaseQueue[a.Sequence]=b;this.callInterOS("saveData",a);return b},
  loadData:function(a){a={Sequence:this.createUUID(),Data:a};var b=new g.Promise;this.mapDatabaseQueue[a.Sequence]=b;this.callInterOS("loadData",a);return b},databaseCallback:function(a){var b=a.Sequence,c=this.mapDatabaseQueue[b];"undefined"!==typeof c&&(delete this.mapDatabaseQueue[b],"success"===a.Result?c.resolve(a.Data):c.reject(a.Data))},showLoading:function(){this.callInterOS("showLoading")},hideLoading:function(){this.callInterOS("hideLoading")},tip:function(a){this.callInterOS("tip",a)},require:function(a,
  b,c,e){a={Sequence:this.createUUID(),Url:a,Method:b,Data:c,Type:e||"json"};b=new g.Promise;this.mapRequireQueue[a.Sequence]=b;this.callInterOS("onRequire",a);return b},requireCallback:function(a){var b=a.Sequence,c=this.mapRequireQueue[b];"undefined"!==typeof c&&(delete this.mapRequireQueue[b],"success"===a.Result?c.resolve(a.Data):c.reject(a.Data))},message:function(a,b){a={Sequence:this.createUUID(),Cmd:a,Data:b};b=new g.Promise;this.mapMessageQueue[a.Sequence]=b;this.callInterOS("onMessage",a);
  return b},messageCallback:function(a){var b=a.Sequence,c=this.mapMessageQueue[b];"undefined"!==typeof c&&(delete this.mapMessageQueue[b],"success"===a.Result?c.resolve(a.Data):c.reject(a.Data))},destroy:function(){this.callInterOS("onDestroy")},callInterOS:function(a,b){this.callOS(a,b,this.InternalName)},callOS:function(a,b,d){"undefined"===typeof d&&(d=this.ExposedName);switch(this.OS){case "ANDROID":if(c[d]&&c[d][a])if("undefined"===typeof b)c[d][a](this.FrameworkUUID);else if("object"===typeof b)c[d][a](this.FrameworkUUID,
  JSON.stringify(b));else c[d][a](this.FrameworkUUID,b);else this.print(a+" : "+this.FrameworkUUID+"\uff1a Android \u63a5\u53e3\u8c03\u7528\u5f02\u5e38...");break;case "IOS":c.webkit&&c.webkit.messageHandlers&&c.webkit.messageHandlers[d]?(a={Method:a,FrameworkID:this.FrameworkUUID,Data:JSON.stringify(b)},"undefined"===typeof b&&delete a.Data,c.webkit.messageHandlers[d].postMessage(a)):this.print(a+" : "+this.FrameworkUUID+"\uff1a IOS \u63a5\u53e3\u8c03\u7528\u5f02\u5e38...");break;case "WEB":this.print(a+
  " : "+this.FrameworkUUID+"\uff1a Web \u63a5\u53e3\u8c03\u7528...");break;default:this.print("error","You must be initFramework(); , \u56de\u8c03\u5931\u8d25\u3002")}},exceptionOS:function(a,b){switch(this.OS){case "ANDROID":if(c[this.InternalName]&&c[this.InternalName].onException)if("undefined"===typeof b)c[this.InternalName].onException(this.FrameworkUUID,a,"");else if("object"===typeof oData)c[this.InternalName].onException(this.FrameworkUUID,a,JSON.stringify(b));else c[this.InternalName].onException(this.FrameworkUUID,
  a,b);else this.print("onException : "+this.FrameworkUUID+"\uff1a Android \u63a5\u53e3\u8c03\u7528\u5f02\u5e38...");break;case "IOS":c.webkit&&c.webkit.messageHandlers&&c.webkit.messageHandlers[this.InternalName]?(a={Method:"onException",FrameworkID:this.FrameworkUUID,ErrorCode:a,Data:JSON.stringify(b)},c.webkit.messageHandlers[this.InternalName].postMessage(a)):this.print("onException : "+this.FrameworkUUID+"\uff1a IOS \u63a5\u53e3\u8c03\u7528\u5f02\u5e38...");break;case "WEB":this.print("onException : "+
  this.FrameworkUUID+"\uff1a Web \u63a5\u53e3\u8c03\u7528...");break;default:this.print("error","You must be initFramework(); , \u56de\u8c03\u5931\u8d25\u3002")}},print:function(){var a="Debug",b=arguments[0];2===arguments.length&&(a=arguments[0],b=arguments[1]);a={Type:a,Msg:b};console.info(a);switch(this.OS){case "ANDROID":if(c[this.InternalName]&&c[this.InternalName].onLog)c[this.InternalName].onLog(this.FrameworkUUID,JSON.stringify(a));else console.error("onLog : "+this.FrameworkUUID+"\uff1a Android \u63a5\u53e3\u8c03\u7528\u5f02\u5e38...");
  break;case "IOS":c.webkit&&c.webkit.messageHandlers&&c.webkit.messageHandlers[this.InternalName]?(b={Method:"onLog",FrameworkID:this.FrameworkUUID,Data:JSON.stringify(a)},c.webkit.messageHandlers[this.InternalName].postMessage(b)):console.error("onException : "+this.FrameworkUUID+"\uff1a IOS \u63a5\u53e3\u8c03\u7528\u5f02\u5e38...");break;case "WEB":console.error("onLog : "+this.FrameworkUUID+"\uff1a Web \u63a5\u53e3\u8c03\u7528...");break;default:console.error("Call print error...")}},on:function(a,
  b){this.__onFuncCallBackMap__[a]=b},dispatchCallback:function(a,b){(a=this.__onFuncCallBackMap__[a])&&"function"===typeof a&&a(b)}};var k=function(a){this.FrameworkUUID=0;this.OS="WEB";this.author="Zyao89";this.version="1.0.0";this.__ZWebSDK__=a;this._isInitFinish=!1};k.prototype={initFramework:function(a,b){this._isInitFinish||(this._isInitFinish=!0,this.FrameworkUUID=a,this.OS=b.OS,this.Version=b.Version,this.InternalName=b.InternalName,this.ExposedName=b.ExposedName,this.__ZWebSDK__._init_(a,b),
  this.__ZWebSDK__.callInterOS("onCreated",l()));a=void 0;c.Vue&&(a=c.Vue.__VueZWeb_Dispatch_Ready__);a&&"function"===typeof a||(a=c.__VueZWeb_Dispatch_Ready__);a&&"function"===typeof a&&a()},requireCallback:function(a,b){this.__ZWebSDK__.requireCallback(b)},messageCallback:function(a,b){this.__ZWebSDK__.messageCallback(b)},databaseCallback:function(a,b){this.__ZWebSDK__.databaseCallback(b)},callReceiver:function(a,b,c){this.__ZWebSDK__.dispatchCallback(b,c)},goBack:function(a){this.__ZWebSDK__.print("goBack \u88ab\u8c03\u7528\u4e86...");
  c.history.go(-1)},goForward:function(a){this.__ZWebSDK__.print("goForward \u88ab\u8c03\u7528\u4e86...");c.history.go(1)},refresh:function(a){this.__ZWebSDK__.print("refresh \u88ab\u8c03\u7528\u4e86...");c.location.reload()}};return e});