text: window.tbMiniGame=function(e,t){"use strict";class i{static isLocalNativeFile(e){for(var t=0,i=l.nativefiles.length;t<i;t++)if(-1!=e.indexOf(l.nativefiles[t]))return!0;return!1}static getFileInfo(e){var t=e,n=i.fakeObj[t];return null==n?null:n}static read(e,n="utf8",a=null,s="",o=!1,r=""){var l;l=""==s||-1==s.indexOf("http://")&&-1==s.indexOf("https://")?e:i.getFileNativePath(e),l=t.URL.getAdptedFilePath(l),i.fs.readFile({filePath:l,encoding:n,success:function(e){null!=a&&a.runWith([0,e])},fail:function(e){e&&""!=s?i.downFiles(s,n,a,s,o,r):null!=a&&a.runWith([1])}})}static downFiles(e,t="utf8",n=null,a="",s=!1,o="",r=!0){i.wxdown({url:e,success:function(l){l.hasOwnProperty("statusCode")||(l.statusCode=200),200===l.statusCode?i.readFile(l.apFilePath,t,n,a,s,o,r):403===l.statusCode?null!=n&&n.runWith([0,e]):null!=n&&n.runWith([1,l])},fail:function(e){null!=n&&n.runWith([1,e])}}).onProgressUpdate((function(e){null!=n&&n.runWith([2,e.progress])}))}static readFile(e,n="utf8",a=null,s="",o=!1,r="",d=!0){e=t.URL.getAdptedFilePath(e),i.fs.readFile({filePath:e,encoding:n,success:function(t){!e.indexOf(l.window.my.env.USER_DATA_PATH)||-1==e.indexOf("http://")&&-1==e.indexOf("https://")?null!=a&&a.runWith([0,t]):o?(null!=a&&a.runWith([0,t]),i.copyFile(e,s,null,n,d)):null!=a&&a.runWith([0,t])},fail:function(e){e&&null!=a&&a.runWith([1,e])}})}static downOtherFiles(e,t=null,n="",a=!1,s=!0){i.wxdown({url:e,success:function(e){e.hasOwnProperty("statusCode")||(e.statusCode=200),200===e.statusCode?a&&-1==n.indexOf("qlogo.cn")&&-1==n.indexOf(".php")?(null!=t&&t.runWith([0,e.apFilePath]),i.copyFile(e.apFilePath,n,null,"",s)):null!=t&&t.runWith([0,e.apFilePath]):null!=t&&t.runWith([1,e])},fail:function(e){null!=t&&t.runWith([1,e])}})}static downLoadFile(e,n="",a=null,s="utf8",o=!1){window.navigator.userAgent.indexOf("AlipayMiniGame")<0?t.Laya.loader.load(e,a):n==t.Loader.IMAGE||n==t.Loader.SOUND?i.downOtherFiles(e,a,e,o,!1):i.downFiles(e,s,a,e,!0,n,o)}static copyFile(e,n,a,s="",o=!0){var r=e.split("/"),d=r[r.length-1],u=n,c=i.getFileInfo(n),h=i.getFileNativePath(d);i.fakeObj[u]={md5:d,readyUrl:n,size:0,times:t.Browser.now(),encoding:s};var f=i.getCacheUseSize();c?c.readyUrl!=n?i.fs.getFileInfo({filePath:e,success:function(t){o&&f+4194304+t.size>=52428800&&(t.size>l.minClearSize&&(l.minClearSize=t.size),i.onClearCacheRes()),i.deleteFile(e,n,a,s,t.size)},fail:function(e){null!=a&&a.runWith([1,e])}}):null!=a&&a.runWith([0]):i.fs.getFileInfo({filePath:e,success:function(t){o&&f+4194304+t.size>=52428800&&(t.size>l.minClearSize&&(l.minClearSize=t.size),i.onClearCacheRes()),i.fs.copyFile({srcPath:e,destPath:h,success:function(e){i.onSaveFile(n,d,!0,s,a,t.size)},fail:function(e){null!=a&&a.runWith([1,e])}})},fail:function(e){null!=a&&a.runWith([1,e])}})}static onClearCacheRes(){var e=l.minClearSize,t=[];for(var n in i.filesListObj)"fileUsedSize"!=n&&t.push(i.filesListObj[n]);i.sortOn(t,"times",i.NUMERIC);for(var a=0,s=1,o=t.length;s<o;s++){var r=t[s];if(a>=e)break;a+=r.size,i.deleteFile("",r.readyUrl)}}static sortOn(e,t,n=0){return n==i.NUMERIC?e.sort((function(e,i){return e[t]-i[t]})):n==(i.NUMERIC|i.DESCENDING)?e.sort((function(e,i){return i[t]-e[t]})):e.sort((function(e,i){return e[t]-i[t]}))}static getFileNativePath(e){return i.fileNativeDir+"/"+e}static deleteFile(e,t="",n=null,a="",s=0){var o=i.getFileInfo(t),r=i.getFileNativePath(o.md5),l=""!=e;i.onSaveFile(t,e,l,a,n,s),i.fs.unlink({filePath:r,success:function(t){if(""!=e){var a=i.getFileNativePath(e);i.fs.copyFile({srcPath:e,destPath:a,success:function(e){},fail:function(e){null!=n&&n.runWith([1,e])}})}},fail:function(e){}})}static deleteAll(){var e=[];for(var t in i.filesListObj)"fileUsedSize"!=t&&e.push(i.filesListObj[t]);for(var n=1,a=e.length;n<a;n++){var s=e[n];i.deleteFile("",s.readyUrl)}i.filesListObj&&i.filesListObj.fileUsedSize&&(i.filesListObj.fileUsedSize=0),i.writeFilesList("",JSON.stringify({}),!1)}static onSaveFile(e,n,a=!0,s="",o=null,r=0){var l=e;if(null==i.filesListObj.fileUsedSize&&(i.filesListObj.fileUsedSize=0),a){i.getFileNativePath(n);i.filesListObj[l]={md5:n,readyUrl:e,size:r,times:t.Browser.now(),encoding:s},i.filesListObj.fileUsedSize=parseInt(i.filesListObj.fileUsedSize)+r,i.writeFilesList(l,JSON.stringify(i.filesListObj),!0),null!=o&&o.runWith([0])}else if(i.filesListObj[l]){var d=parseInt(i.filesListObj[l].size);i.filesListObj.fileUsedSize=parseInt(i.filesListObj.fileUsedSize)-d,delete i.filesListObj[l],i.writeFilesList(l,JSON.stringify(i.filesListObj),!1),null!=o&&o.runWith([0])}}static writeFilesList(e,t,n){var a=i.fileNativeDir+"/"+i.fileListName;i.fs.writeFile({filePath:a,encoding:"utf8",data:t,success:function(e){},fail:function(e){}}),!l.isZiYu&&l.isPosMsgYu&&l.window.my.postMessage&&l.window.my.postMessage({url:e,data:i.filesListObj[e],isLoad:"filenative",isAdd:n})}static getCacheUseSize(){return i.filesListObj&&i.filesListObj.fileUsedSize?i.filesListObj.fileUsedSize:0}static existDir(e,t){i.fs.mkdir({dirPath:e,success:function(e){null!=t&&t.runWith([0,{data:JSON.stringify({})}])},fail:function(e){10025==e.error?i.readSync(i.fileListName,"utf8",t):null!=t&&t.runWith([1,e])}})}static readSync(e,t="utf8",n=null,a=""){var s,o=i.getFileNativePath(e);try{i.fs.readFile({filePath:o,encoding:t,success:function(e){s=e.data,null!=n&&n.runWith([0,{data:s}])},fail:function(){null!=n&&n.runWith([1])}})}catch(e){null!=n&&n.runWith([1])}}static setNativeFileDir(e){i.fileNativeDir=l.window.my.env.USER_DATA_PATH+e}}i.fs=window.my.getFileSystemManager(),i.wxdown=window.my.downloadFile,i.filesListObj={},i.fakeObj={},i.fileListName="layaairfiles.txt",i.ziyuFileData={},i.ziyuFileTextureData={},i.loadPath="",i.DESCENDING=2,i.NUMERIC=16;class n extends t.SoundChannel{constructor(e){super(),this._sound=e,this._audio=e._sound,this._onCanplay=this.onCanPlay.bind(this),this._onError=this.onError.bind(this),this._onEnd=this.__onEnd.bind(this),this.addEventListener()}addEventListener(){this._audio.onError(this._onError),this._audio.onCanplay(this._onCanplay)}offEventListener(){this._audio.offError(this._onError),this._audio.offCanplay(this._onCanplay),this._audio.offEnded(this._onEnd)}onError(e){console.log("-----1---------------minisound-----url:",this.url),console.log(e),this.event(t.Event.ERROR),this._audio&&(this._sound.dispose(),this.offEventListener(),this._sound=this._audio=null)}onCanPlay(){this._audio&&(this.event(t.Event.COMPLETE),this.offEventListener(),this._audio.onEnded(this._onEnd),this.isStopped?this.stop():this.play())}__onEnd(){if(1==this.loops)return this.completeHandler&&(t.Laya.systemTimer.once(10,this,this.__runComplete,[this.completeHandler],!1),this.completeHandler=null),this.stop(),void this.event(t.Event.COMPLETE);this.loops>0&&this.loops--,this.startTime=0,this.play()}play(){this.isStopped=!1,t.SoundManager.addChannel(this),this._audio&&this._audio.play()}set startTime(e){this._audio&&(this._audio.startTime=e)}set autoplay(e){this._audio&&(this._audio.autoplay=e)}get autoplay(){return!!this._audio&&this._audio.autoplay}get position(){return this._audio?this._audio.currentTime:0}get duration(){return this._audio?this._audio.duration:0}stop(){super.stop(),this.isStopped=!0,t.SoundManager.removeChannel(this),this.completeHandler=null,this._audio&&(this._audio.stop(),this.loop||(this.offEventListener(),this._sound.dispose(),this._sound=null,this._audio=null))}pause(){this.isStopped=!0,this._audio&&this._audio.pause()}get loop(){return!!this._audio&&this._audio.loop}set loop(e){this._audio&&(this._audio.loop=e)}resume(){this.isStopped=!1,t.SoundManager.addChannel(this),this._audio&&this._audio.play()}set volume(e){this._audio&&(this._audio.volume=e)}get volume(){return this._audio?this._audio.volume:0}}class a extends t.EventDispatcher{constructor(){super(),this.loaded=!1,this._sound=a._createSound()}static __init__(){for(let e=0;e<10;e++){let e=l.window.my.createInnerAudioContext();a.cachePool.push(e)}}static _createSound(){return a.cachePool.length?a.cachePool.pop():l.window.my.createInnerAudioContext()}load(e){if(i.isLocalNativeFile(e)){if(-1==e.indexOf(l.window.my.env.USER_DATA_PATH)&&(-1!=e.indexOf("http://")||-1!=e.indexOf("https://")))if(""!=i.loadPath)e=e.split(i.loadPath)[1];else{var n=""!=t.URL.rootPath?t.URL.rootPath:t.URL._basePath;""!=n&&(e=e.split(n)[1])}}else e=t.URL.formatURL(e);if(this.url=e,this.readyUrl=e,l.autoCacheFile&&i.getFileInfo(e))this.onDownLoadCallBack(e,0);else if(l.autoCacheFile)if(i.isLocalNativeFile(e)){if(l.subNativeFiles&&0==l.subNativeheads.length)for(var a in l.subNativeFiles){var s=l.subNativeFiles[a];l.subNativeheads=l.subNativeheads.concat(s);for(let e=0;e<s.length;e++)l.subMaps[s[e]]=a+"/"+s[e]}if(l.subNativeFiles&&-1!=e.indexOf("/")){var o=e.split("/")[0]+"/";if(o&&-1!=l.subNativeheads.indexOf(o)){var r=l.subMaps[o];e=e.replace(o,r)}}this.onDownLoadCallBack(e,0)}else-1==e.indexOf("http://")&&-1==e.indexOf("https://")||-1!=e.indexOf(l.window.my.env.USER_DATA_PATH)?this.onDownLoadCallBack(e,0):i.downOtherFiles(e,t.Handler.create(this,this.onDownLoadCallBack,[e]),e,l.autoCacheFile);else this.onDownLoadCallBack(e,0)}onDownLoadCallBack(e,n,a=null){var s;if(n)this.event(t.Event.ERROR);else if(l.autoCacheFile){if(a)s=a;else if(i.isLocalNativeFile(e)){var o=""!=t.URL.rootPath?t.URL.rootPath:t.URL._basePath,r=e;""==o||-1==e.indexOf("http://")&&-1==e.indexOf("https://")||(s=e.split(o)[1]),s||(s=r),s=l.baseDir+s}else{var d=i.getFileInfo(e);if(d&&d.md5){var u=d.md5;s=i.getFileNativePath(u)}else s=-1==e.indexOf("http://")&&-1==e.indexOf("https://")&&-1==e.indexOf(l.window.my.env.USER_DATA_PATH)?l.baseDir+e:e}this._sound.src=this.readyUrl=s}else(i.isLocalNativeFile(e)||-1==e.indexOf("http://")&&-1==e.indexOf("https://")&&-1==e.indexOf(l.window.my.env.USER_DATA_PATH))&&(e=l.baseDir+e),this._sound.src=this.readyUrl=e}play(e=0,i=0){if(this.isPlaying=!0,!this.url)return null;var a=new n(this);return a.url=this.url,a.loops=i,a.loop=0===i,a.startTime=e,a.play(),t.SoundManager.addChannel(a),a}get duration(){return this._sound.duration}dispose(){this._sound&&(a.cachePool.push(this._sound),this._sound=null,this.readyUrl=this.url=null)}}a.cachePool=[];class s{constructor(){}static _createInputElement(){t.Input._initInput(t.Input.area=t.Browser.createElement("textarea")),t.Input._initInput(t.Input.input=t.Browser.createElement("input")),t.Input.inputContainer=t.Browser.createElement("div"),t.Input.inputContainer.style.position="absolute",t.Input.inputContainer.style.zIndex=1e5,t.Browser.container.appendChild(t.Input.inputContainer),t.SoundManager._soundClass=a,t.SoundManager._musicClass=a;var e=l.systemInfo.model,i=l.systemInfo.system;-1!=e.indexOf("iPhone")&&(t.Browser.onIPhone=!0,t.Browser.onIOS=!0,t.Browser.onIPad=!0,t.Browser.onAndroid=!1),-1==i.indexOf("Android")&&-1==i.indexOf("Adr")||(t.Browser.onAndroid=!0,t.Browser.onIPhone=!1,t.Browser.onIOS=!1,t.Browser.onIPad=!1)}static _onStageResize(){t.Laya.stage._canvasTransform.identity().scale(t.Browser.width/t.Render.canvas.width/t.Browser.pixelRatio,t.Browser.height/t.Render.canvas.height/t.Browser.pixelRatio)}static wxinputFocus(e){}static inputEnter(){t.Input.inputElement.target.focus=!1}static wxinputblur(){s.hideKeyboard()}static hideKeyboard(){}}class o extends t.EventDispatcher{constructor(){super()}_loadResourceFilter(e,n){if(this.sourceUrl=t.URL.formatURL(n),-1==n.indexOf(l.window.my.env.USER_DATA_PATH)&&(-1!=n.indexOf("http://")||-1!=n.indexOf("https://")))if(""!=i.loadPath)n=n.split(i.loadPath)[1];else{var a=""!=t.URL.rootPath?t.URL.rootPath:t.URL._basePath,s=n;""!=a&&(n=n.split(a)[1]),n||(n=s)}if(l.subNativeFiles&&0==l.subNativeheads.length)for(var r in l.subNativeFiles){var d=l.subNativeFiles[r];l.subNativeheads=l.subNativeheads.concat(d);for(var u=0;u<d.length;u++)l.subMaps[d[u]]=r+"/"+d[u]}if(l.subNativeFiles&&-1!=n.indexOf("/")){var c=n.split("/")[0]+"/";if(c&&-1!=l.subNativeheads.indexOf(c)){var h=l.subMaps[c];n=n.replace(c,h)}}switch(e){case t.Loader.IMAGE:case"htmlimage":case"nativeimage":o._transformImgUrl(n,e,this);break;case t.Loader.SOUND:this._loadSound(n);break;default:this._loadResource(e,n)}}_loadSound(e){var n=t.URL.formatURL(e);i.isLocalNativeFile(e)||-1==n.indexOf("http://")&&-1==n.indexOf("https://")?o.onDownLoadCallBack(l.baseDir+e,this,0):-1!=n.indexOf(l.window.my.env.USER_DATA_PATH)?o.onDownLoadCallBack(e,this,0):i.downOtherFiles(l.safeEncodeURI(n),t.Handler.create(o,o.onDownLoadCallBack,[n,this]),n,l.autoCacheFile)}static onDownLoadCallBack(e,n,a,s=null){if(a)n.event(t.Event.ERROR,"Load sound failed");else{var o;if(l.autoCacheFile)if(s)o=s;else if(i.isLocalNativeFile(e))o=e;else{var r=i.getFileInfo(e);if(r&&r.md5){var d=r.md5;o=i.getFileNativePath(d)}else o=e}else o=s||e;e=o;var u=new t.SoundManager._soundClass;u.load(e),n.onLoaded(u)}}static bindToThis(e,t){return e.bind(t)}complete(e){e instanceof t.Resource?e._setCreateURL(this.sourceUrl):e instanceof t.Texture&&e.bitmap instanceof t.Resource&&e.bitmap._setCreateURL(this.sourceUrl),this.originComplete(e)}_loadHttpRequestWhat(e,n){var a=l.getUrlEncode(e,n);if(t.Loader.preLoadedMap[e])this.onLoaded(t.Loader.preLoadedMap[e]);else{var s=t.URL.formatURL(e),r=i.getFileInfo(s);r?(r.encoding=null==r.encoding?"utf8":r.encoding,i.readFile(i.getFileNativePath(r.md5),a,new t.Handler(o,o.onReadNativeCallBack,[e,n,this]),e)):-1==s.indexOf("http://")&&-1==s.indexOf("https://")||i.isLocalNativeFile(e)?-1==s.indexOf(l.window.my.env.USER_DATA_PATH)?i.readFile(l.baseDir+e,a,new t.Handler(o,o.onReadNativeCallBack,[e,n,this]),e):i.readFile(e,a,new t.Handler(o,o.onReadNativeCallBack,[e,n,this]),e):i.downFiles(l.safeEncodeURI(s),a,new t.Handler(o,o.onReadNativeCallBack,[e,n,this]),s,l.AutoCacheDownFile)}}static onReadNativeCallBack(e,i=null,n=null,a=0,s=null){var o;a?1==a&&n.onError&&n.onError(s):(o=i==t.Loader.JSON||i==t.Loader.ATLAS||i==t.Loader.PREFAB||i==t.Loader.PLF?l.getJson(s.data):i==t.Loader.XML?t.Utils.parseXMLFromString(s.data):s.data,n.onLoaded(o))}static _transformImgUrl(e,n,a){let s=t.URL.formatURL(e);i.isLocalNativeFile(e)||-1==s.indexOf("http://")&&-1==s.indexOf("https://")?-1==s.indexOf(l.window.my.env.USER_DATA_PATH)?o.onCreateImage(e,a,!0):o.onCreateImage(e,a,!1,e):o.onCreateImage(e,a,!1,s)}static onCreateImage(e,t,i=!1,n=""){var a;a=i?l.baseDir+e:""!=n?n:e,t._loadImage(l.safeEncodeURI(a),!1)}}class r{constructor(){}static __init__(){r.items=r}static setItem(e,t){l.window.my.setStorageSync({key:e,value:t})}static getItem(e){return l.window.my.getStorageSync({key:e})}static setJSON(e,t){try{r.setItem(e,JSON.stringify(t))}catch(e){console.warn("set localStorage failed",e)}}static getJSON(e){return JSON.parse(r.getItem(e))}static removeItem(e){l.window.my.removeStorageSync(e)}static clear(){l.window.my.clearStorageSync()}static getStorageInfoSync(){try{var e=l.window.my.getStorageInfoSync();return console.log(e.keys),console.log(e.currentSize),console.log(e.limitSize),e}catch(e){}return null}}r.support=!0;class l{static getJson(e){return JSON.parse(e)}static enable(){l.init(t.Laya.isWXPosMsg,t.Laya.isWXOpenDataContext)}static init(e=!1,n=!1){l._inited||(l._inited=!0,l.window=window,l.window.hasOwnProperty("my")&&(l.isZiYu=n,l.isPosMsgYu=e,l.EnvConfig={},l.isZiYu||(i.setNativeFileDir("/layaairGame"),i.existDir(i.fileNativeDir,t.Handler.create(l,l.onMkdirCallBack))),l.systemInfo=l.window.my.getSystemInfoSync(),l.window.focus=function(){},t.Laya._getUrlPath=function(){return""},l.window.logtime=function(e){},l.window.alertTimeLog=function(e){},l.window.resetShareInfo=function(){},l.window.CanvasRenderingContext2D=function(){},t.HttpRequest._urlEncode=l.safeEncodeURI,l._preCreateElement=t.Browser.createElement,l.window.CanvasRenderingContext2D.prototype=l._preCreateElement("canvas").getContext("2d").__proto__,l.window.document.body.appendChild=function(){},t.Browser.createElement=l.createElement,t.RunDriver.createShaderCondition=l.createShaderCondition,t.Utils.parseXMLFromString=l.parseXMLFromString,t.Input._createInputElement=s._createInputElement,t.Loader.prototype._loadResourceFilter=o.prototype._loadResourceFilter,t.Loader.prototype._loadSound=o.prototype._loadSound,t.Loader.prototype.originComplete=t.Loader.prototype.complete,t.Loader.prototype.complete=o.prototype.complete,t.Loader.prototype._loadHttpRequestWhat=o.prototype._loadHttpRequestWhat,t.Config.useRetinalCanvas=!0,t.LocalStorage._baseClass=r,r.__init__(),a.__init__(),l.window.my.onMessage&&l.window.my.onMessage(l._onMessage)))}static _onMessage(e){switch(e.type){case"changeMatrix":t.Laya.stage.transform.identity(),t.Laya.stage._width=e.w,t.Laya.stage._height=e.h,t.Laya.stage._canvasTransform=new t.Matrix(e.a,e.b,e.c,e.d,e.tx,e.ty);break;case"display":t.Laya.stage.frameRate=e.rate||t.Stage.FRAME_FAST;break;case"undisplay":t.Laya.stage.frameRate=t.Stage.FRAME_SLEEP}"opendatacontext"==e.isLoad?e.url&&(i.ziyuFileData[e.url]=e.atlasdata,i.ziyuFileTextureData[e.imgReadyUrl]=e.imgNativeUrl):"openJsondatacontext"==e.isLoad?e.url&&(i.ziyuFileData[e.url]=e.atlasdata):"openJsondatacontextPic"==e.isLoad&&(i.ziyuFileTextureData[e.imgReadyUrl]=e.imgNativeUrl)}static getUrlEncode(e,t){return"arraybuffer"==t?"":"utf8"}static downLoadFile(e,t="",n=null,a="utf8"){i.getFileInfo(e)?null!=n&&n.runWith([0]):i.downLoadFile(e,t,n,a)}static remove(e,t=null){i.deleteFile("",e,t,"",0)}static removeAll(){i.deleteAll()}static hasNativeFile(e){return i.isLocalNativeFile(e)}static getFileInfo(e){return i.getFileInfo(e)}static getFileList(){return i.filesListObj}static exitMiniProgram(){l.window.my.exitMiniProgram()}static onMkdirCallBack(e,t){e?(i.fakeObj={},i.filesListObj={}):(i.filesListObj=JSON.parse(t.data),i.fakeObj=JSON.parse(t.data)||{}),i.fs.readdir({dirPath:i.fileNativeDir,success:function(e){var t={};for(let e in i.filesListObj)"fileUsedSize"!=e&&(t[i.filesListObj[e].md5]=!0);var n,a=e.files;for(let e=0,o=a.length;e<o;e++)if((n=a[e])!=i.fileListName){var s=i.getFileNativePath(n);t[s]||t[n]||i.fs.unlink({filePath:s,success:function(e){console.log("删除无引用的磁盘文件:"+n)}})}}})}static pixelRatio(){if(!l.EnvConfig.pixelRatioInt)try{return l.EnvConfig.pixelRatioInt=l.systemInfo.pixelRatio,l.systemInfo.pixelRatio}catch(e){}return l.EnvConfig.pixelRatioInt}static createElement(e){var t;if("canvas"==e)return!(t=1==l.idx?l.window.canvas.getRealCanvas():l._preCreateElement(e)).style&&(t.style={}),l.idx++,t;if("textarea"==e||"input"==e)return l.onCreateInput(e);if("div"==e){var i=l._preCreateElement(e);return i.contains=function(e){return null},i.removeChild=function(e){},i}return l._preCreateElement(e)}static onCreateInput(e){var t=l._preCreateElement(e);return t.focus=s.wxinputFocus,t.blur=s.wxinputblur,t.value=0,t.placeholder={},t.type={},t.setColor=function(e){},t.setType=function(e){},t.setFontFace=function(e){},t.contains=function(e){return null},t}static createShaderCondition(e){return function(){return this[e.replace("this.","")]}}}l.IGNORE=new RegExp("[-_.!~*'();/?:@&=+$,#%]|[0-9|A-Z|a-z]"),l.safeEncodeURI=function(e){for(var t="",i=e.length,n=0;n<i;n++){var a=e[n];if(l.IGNORE.test(a))t+=a;else try{t+=encodeURI(a)}catch(e){console.log("errorInfo",">>>"+a)}}return t},l._inited=!1,l.autoCacheFile=!0,l.minClearSize=5242880,l.nativefiles=["layaNativeDir"],l.subNativeFiles=[],l.subNativeheads=[],l.subMaps=[],l.AutoCacheDownFile=!1,l.baseDir="pages/index/",l.parseXMLFromString=function(e){var t;e=e.replace(/>\s+</g,"><");try{t=(new l.window.Parser.DOMParser).parseFromString(e,"text/xml")}catch(e){throw"需要引入xml解析库文件"}return t},l.idx=1;class d extends t.EventDispatcher{constructor(){super()}static __init__(){try{var e;if(!(e=t.Accelerator))return;e.prototype.on=d.prototype.on,e.prototype.off=d.prototype.off}catch(e){}}static startListen(e){if(d._callBack=e,!d._isListening){d._isListening=!0;try{l.window.my.onAccelerometerChange(d.onAccelerometerChange)}catch(e){}}}static stopListen(){d._isListening=!1;try{l.window.my.stopAccelerometer({})}catch(e){}}static onAccelerometerChange(e){var t;(t={}).acceleration=e,t.accelerationIncludingGravity=e,t.rotationRate={},null!=d._callBack&&d._callBack(t)}on(e,t,i,n=null){return super.on(e,t,i,n),d.startListen(this.onDeviceOrientationChange),this}off(e,t,i,n=!1){return this.hasListener(e)||d.stopListen(),super.off(e,t,i,n)}}d._isListening=!1;class u{constructor(){}static __init__(){l.window.navigator.geolocation.getCurrentPosition=u.getCurrentPosition,l.window.navigator.geolocation.watchPosition=u.watchPosition,l.window.navigator.geolocation.clearWatch=u.clearWatch}static getCurrentPosition(e=null,t=null,i=null){var n;(n={}).success=function(t){null!=e&&e(t)},n.fail=t,l.window.my.getLocation(n)}static watchPosition(e=null,i=null,n=null){var a;return u._curID++,(a={}).success=e,a.error=i,u._watchDic[u._curID]=a,t.Laya.systemTimer.loop(1e3,null,u._myLoop),u._curID}static clearWatch(e){delete u._watchDic[e],u._hasWatch()||t.Laya.systemTimer.clear(null,u._myLoop)}static _hasWatch(){var e;for(e in u._watchDic)if(u._watchDic[e])return!0;return!1}static _myLoop(){u.getCurrentPosition(u._mySuccess,u._myError)}static _mySuccess(e){var i,n={};for(i in n.coords=e,n.timestamp=t.Browser.now(),u._watchDic)u._watchDic[i].success&&u._watchDic[i].success(n)}static _myError(e){var t;for(t in u._watchDic)u._watchDic[t].error&&u._watchDic[t].error(e)}}u._watchDic={},u._curID=0;e.MiniAccelerator=d,e.MiniFileMgr=i,e.MiniInput=s,e.MiniLoader=o,e.MiniLocalStorage=r,e.MiniLocation=u,e.MiniSound=a,e.MiniSoundChannel=n,e.MiniVideo=class{constructor(e=320,t=240){this.videoend=!1,this.videourl="",this.videoElement=l.window.my.createVideo({width:e,height:t,autoplay:!0})}static __init__(){}on(e,t,i){"loadedmetadata"==e?(this.onPlayFunc=i.bind(t),this.videoElement.onPlay=this.onPlayFunction.bind(this)):"ended"==e&&(this.onEndedFunC=i.bind(t),this.videoElement.onEnded=this.onEndedFunction.bind(this)),this.videoElement.onTimeUpdate=this.onTimeUpdateFunc.bind(this)}onTimeUpdateFunc(e){this.position=e.position,this._duration=e.duration}get duration(){return this._duration}onPlayFunction(){this.videoElement&&(this.videoElement.readyState=200),console.log("=====视频加载完成========"),null!=this.onPlayFunc&&this.onPlayFunc()}onEndedFunction(){this.videoElement&&(this.videoend=!0,console.log("=====视频播放完毕========"),null!=this.onEndedFunC&&this.onEndedFunC())}off(e,t,i){"loadedmetadata"==e?(this.onPlayFunc=i.bind(t),this.videoElement.offPlay=this.onPlayFunction.bind(this)):"ended"==e&&(this.onEndedFunC=i.bind(t),this.videoElement.offEnded=this.onEndedFunction.bind(this))}load(e){this.videoElement&&(this.videoElement.src=e)}play(){this.videoElement&&(this.videoend=!1,this.videoElement.play())}pause(){this.videoElement&&(this.videoend=!0,this.videoElement.pause())}get currentTime(){return this.videoElement?this.videoElement.initialTime:0}set currentTime(e){this.videoElement&&(this.videoElement.initialTime=e)}get videoWidth(){return this.videoElement?this.videoElement.width:0}get videoHeight(){return this.videoElement?this.videoElement.height:0}get ended(){return this.videoend}get loop(){return!!this.videoElement&&this.videoElement.loop}set loop(e){this.videoElement&&(this.videoElement.loop=e)}get playbackRate(){return this.videoElement?this.videoElement.playbackRate:0}set playbackRate(e){this.videoElement&&(this.videoElement.playbackRate=e)}get muted(){return!!this.videoElement&&this.videoElement.muted}set muted(e){this.videoElement&&(this.videoElement.muted=e)}get paused(){return!!this.videoElement&&this.videoElement.paused}size(e,t){this.videoElement&&(this.videoElement.width=e,this.videoElement.height=t)}get x(){return this.videoElement?this.videoElement.x:0}set x(e){this.videoElement&&(this.videoElement.x=e)}get y(){return this.videoElement?this.videoElement.y:0}set y(e){this.videoElement&&(this.videoElement.y=e)}get currentSrc(){return this.videoElement.src}destroy(){this.videoElement&&this.videoElement.destroy(),this.videoElement=null,this.onEndedFunC=null,this.onPlayFunc=null,this.videoend=!1,this.videourl=null}reload(){this.videoElement&&(this.videoElement.src=this.videourl)}},e.TBMiniAdapter=l};