!function(t,o){o.un,o.uns;var i=o.static,n=o.class,a=o.getset,d=(o.__newvec,laya.utils.Browser),s=(laya.events.Event,laya.events.EventDispatcher),r=laya.resource.HTMLImage,m=laya.utils.Handler,l=laya.display.Input,p=laya.net.Loader,u=laya.net.LocalStorage,e=(laya.maths.Matrix,laya.renders.Render),c=laya.utils.RunDriver,f=(laya.media.Sound,laya.media.SoundChannel),h=laya.media.SoundManager,w=laya.net.URL,g=laya.utils.Utils,y=(n(v,"laya.wx.mini.MiniAdpter"),v.getJson=function(e){return JSON.parse(e)},v.init=function(e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),!v._inited&&(v._inited=!0,(v.window=t).hasOwnProperty("wx")&&!(v.window.navigator.userAgent.indexOf("MiniGame")<0))){v.isZiYu=i,v.isPosMsgYu=e,v.EnvConfig={};try{laya.webgl.resource.WebGLCanvas.premulAlpha=!0}catch(e){}if(v.isZiYu||(_.setNativeFileDir("/layaairGame"),_.existDir(_.fileNativeDir,m.create(v,v.onMkdirCallBack))),"ios 10.1.1"===(v.systemInfo=v.window.wx.getSystemInfoSync()).system.toLowerCase())try{laya.webgl.resource.WebGLCharImage.canUseCanvas=!1}catch(e){}v.window.focus=function(){},o._getUrlPath=function(){},o.getUrlPath=function(){},v.window.logtime=function(e){},v.window.alertTimeLog=function(e){},v.window.resetShareInfo=function(){},v.window.CanvasRenderingContext2D=function(){},v.window.CanvasRenderingContext2D.prototype=v.window.wx.createCanvas().getContext("2d").__proto__,v.window.document.body.appendChild=function(){},v.EnvConfig.pixelRatioInt=0,c.getPixelRatio=v.pixelRatio,v._preCreateElement=d.createElement,d.createElement=v.createElement,c.createShaderCondition=v.createShaderCondition,g.parseXMLFromString=v.parseXMLFromString,l._createInputElement=E._createInputElement,v.EnvConfig.load=p.prototype.load,p.prototype.load=S.prototype.load,p.prototype._loadImage=F.prototype._loadImage,(u._baseClass=b).__init__(),v.onReciveData()}},v.onReciveData=function(){laya.wx.mini.MiniAdpter.isZiYu&&v.window.wx.onMessage(function(e){"opendatacontext"==e.isLoad?e.url&&(_.ziyuFileData[e.url]=e.atlasdata,_.ziyuFileTextureData[e.imgReadyUrl]=e.imgNativeUrl):"openJsondatacontext"==e.isLoad?e.url&&(_.ziyuFileData[e.url]=e.atlasdata):"openJsondatacontextPic"==e.isLoad&&(_.ziyuFileTextureData[e.imgReadyUrl]=e.imgNativeUrl)})},v.measureText=function(e){e=v._measureText(e);return e||(e={width:16},console.warn("-------微信获取文字宽度失败----等待修复---------")),e},v.getUrlEncode=function(e,i){return"arraybuffer"==i?"":"utf8"},v.downLoadFile=function(e,i,t,n){void 0===i&&(i=""),void 0===n&&(n="utf8"),_.getFileInfo(e)?null!=t&&t.runWith([0]):_.downLoadFile(e,i,t,n)},v.remove=function(e,i){_.deleteFile("",e,i,"",0)},v.removeAll=function(){_.deleteAll()},v.hasNativeFile=function(e){return _.isLocalNativeFile(e)},v.getFileInfo=function(e){return _.getFileInfo(e)},v.getFileList=function(){return _.filesListObj},v.exitMiniProgram=function(){v.window.wx.exitMiniProgram()},v.onMkdirCallBack=function(e,i){e||(_.filesListObj=JSON.parse(i.data),_.fakeObj=JSON.parse(i.data))},v.pixelRatio=function(){if(!v.EnvConfig.pixelRatioInt)try{return v.EnvConfig.pixelRatioInt=v.systemInfo.pixelRatio,v.systemInfo.pixelRatio}catch(e){}return v.EnvConfig.pixelRatioInt},v.createElement=function(e){var i;if("canvas"==e)return 1==v.idx?v.isZiYu?(i=v.window.sharedCanvas).style={}:i=v.window.canvas:i=v.window.wx.createCanvas(),v.idx++,i;if("textarea"==e||"input"==e)return v.onCreateInput(e);if("div"!=e)return v._preCreateElement(e);e=v._preCreateElement(e);return e.contains=function(e){return null},e.removeChild=function(e){},e},v.onCreateInput=function(e){e=v._preCreateElement(e);return e.focus=E.wxinputFocus,e.blur=E.wxinputblur,e.style={},e.value=0,e.parentElement={},e.placeholder={},e.type={},e.setColor=function(e){},e.setType=function(e){},e.setFontFace=function(e){},e.addEventListener=function(e){},e.contains=function(e){return null},e.removeChild=function(e){},e},v.createShaderCondition=function(e){var i=this;return function(){return i[e.replace("this.","")]}},v.sendAtlasToOpenDataContext=function(e){if(!laya.wx.mini.MiniAdpter.isZiYu){var i=p.getRes(w.formatURL(e));if(!i)throw"传递的url没有获取到对应的图集数据信息,请确保图集已经过!";i.meta.image.split(",");if(i.meta&&i.meta.image)for(var t=i.meta.image.split(","),n=0<=e.indexOf("/")?"/":"\\",n=e.lastIndexOf(n),o=0<=n?e.substr(0,n+1):"",a=0,l=t.length;a\s+<");try{i=(new t.Parser.DOMParser).parseFromString(e,"text/xml")}catch(e){throw"需要引入xml解析库文件"}return i},v.idx=1,i(v,["nativefiles",function(){return this.nativefiles=["layaNativeDir","wxlocal"]}]),v);function v(){}var _=(n(x,"laya.wx.mini.MiniFileMgr"),x.isLocalNativeFile=function(e){for(var i=0,t=y.nativefiles.length;iy.minClearSize&&(y.minClearSize=e.size),x.onClearCacheRes()),x.deleteFile(t,n,o,a,e.size)},fail:function(e){null!=o&&o.runWith([1,e])}}):null!=o&&o.runWith([0]):x.fs.getFileInfo({filePath:t,success:function(i){l&&52428800<=u+4194304+i.size&&(i.size>y.minClearSize&&(y.minClearSize=i.size),x.onClearCacheRes()),x.fs.copyFile({srcPath:t,destPath:r,success:function(e){x.onSaveFile(n,s,!0,a,o,i.size)},fail:function(e){null!=o&&o.runWith([1,e])}})},fail:function(e){null!=o&&o.runWith([1,e])}})},x.onClearCacheRes=function(){var e,i=y.minClearSize,t=[];for(e in x.filesListObj)"fileUsedSize"!=e&&t.push(x.filesListObj[e]);x.sortOn(t,"times",16);for(var n=0,o=1,a=t.length;o