Files
lifeRestart/public/libs/laya/min/laya.Alipaymini.min.js
Vick Scarlet 150c991648 Squashed commit of the following:
commit b421082374
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Dec 31 20:26:20 2021 +0800

    update specialthanks

commit 765a69294b
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 19:10:03 2021 +0800

    fix ios goto

commit 8eb8c3ca72
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 19:03:37 2021 +0800

    add event grade

commit ab705dd46c
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:48:42 2021 +0800

    build version

commit a1e4232369
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:47:05 2021 +0800

    change talent replace before property allocate

commit f4d7b3ae3c
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:06:18 2021 +0800

    add event grade

commit 0567e40ddc
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 21:28:10 2021 +0800

    add particle

commit f17003925e
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 20:14:26 2021 +0800

    change ui

commit f8beda1d8f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 19:08:30 2021 +0800

    change popup message ui

commit 915a2aa17d
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 18:34:29 2021 +0800

    new build

commit b5edabc104
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 18:18:46 2021 +0800

    add hint message

commit a143feadaf
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 17:57:31 2021 +0800

    fix copy bug

commit eab1975791
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 17:56:28 2021 +0800

    add save/load

commit acf9b92134
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 14:35:33 2021 +0800

    add theme switch

commit 488a6054ab
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Dec 1 18:30:36 2021 +0800

    fix uiManager bug

commit f0317eaf14
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Dec 1 16:07:03 2021 +0800

    add message popup

commit eb02d1ee6f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 21:22:54 2021 +0800

    change relocation

commit 60503eae47
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:27:16 2021 +0800

    change ScaleButton -> Laya.runtime.ScaleButton

commit 52ef5909c1
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:26:31 2021 +0800

    change ScaleButton -> Laya.runtime.ScaleButton

commit 0284f6aa71
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:05:24 2021 +0800

    config webpack

commit 0e272ffd99
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 13:17:41 2021 +0800

    add thanks

commit e1e2ab4701
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 11:40:21 2021 +0800

    add light theme

commit 4f55c00f86
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 27 22:27:39 2021 +0800

    fix bug

commit 1d07bdfc46
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 27 21:48:47 2021 +0800

    daily update

commit 52d6a0ca8f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Nov 24 23:10:04 2021 +0800

    daily update

commit f8dd720d4d
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Nov 24 19:08:13 2021 +0800

    daily update

commit d088c1a862
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 21 21:41:46 2021 +0800

    remove useless

commit a711fcf3ed
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Nov 16 00:53:05 2021 +0800

    add achievement popup
    add page adaptive
    add talent extends

commit 05e02de3db
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 13 01:24:04 2021 +0800

    add github and discord

commit bff0109cc5
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 13 00:30:01 2021 +0800

    add trajectory auto mode

commit 54c04f65c2
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Nov 12 19:54:31 2021 +0800

    fix property judge negative number bug

commit 660739530b
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Nov 12 19:48:58 2021 +0800

    update achievement

commit c94e9e7433
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Nov 11 21:37:45 2021 +0800

    update daily

commit c06cd9ea62
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Nov 9 00:08:05 2021 +0800

    update daily

commit 2666983f89
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 7 23:00:22 2021 +0800

    add uiManager auto scan and load skin resource

commit 22fa5d755a
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 7 22:17:04 2021 +0800

    update framework

commit f40698d63e
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Oct 31 00:13:22 2021 +0800

    add laya
2021-12-31 20:31:26 +08:00

1 line
28 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t,o){o.un,o.uns;var i=o.static,n=o.class,a=o.getset,d=(o.__newvec,laya.utils.Browser),l=o.Config,e=(laya.events.Event,laya.events.EventDispatcher),r=laya.resource.HTMLImage,m=laya.utils.Handler,s=laya.display.Input,v=laya.net.Loader,u=laya.net.LocalStorage,c=(laya.maths.Matrix,laya.renders.Render),f=laya.utils.RunDriver,h=laya.media.SoundChannel,p=laya.media.SoundManager,y=laya.net.URL,g=laya.utils.Utils,w=(n(_,"laya.ali.mini.ALIMiniAdapter"),_.getJson=function(i){return JSON.parse(i)},_.init=function(i,e){void 0===i&&(i=!1),void 0===e&&(e=!1),_._inited||(_._inited=!0,(_.window=t).hasOwnProperty("my")&&(_.window.navigator.userAgent.indexOf("AlipayMiniGame")<0||(_.isZiYu=e,_.isPosMsgYu=i,_.EnvConfig={},_.isZiYu||(F.setNativeFileDir("/layaairGame"),F.existDir(F.fileNativeDir,m.create(_,_.onMkdirCallBack))),_.systemInfo=_.window.my.getSystemInfoSync(),_.window.focus=function(){},o._getUrlPath=function(){},o.getUrlPath=function(){},_.window.logtime=function(i){},_.window.alertTimeLog=function(i){},_.window.resetShareInfo=function(){},_.window.CanvasRenderingContext2D=function(){},_.window.CanvasRenderingContext2D.prototype=_.window.my.createCanvas().getContext("2d").__proto__,_.window.document.body.appendChild=function(){},_.EnvConfig.pixelRatioInt=0,f.getPixelRatio=_.pixelRatio,_._preCreateElement=d.createElement,d.createElement=_.createElement,f.createShaderCondition=_.createShaderCondition,g.parseXMLFromString=_.parseXMLFromString,s._createInputElement=L._createInputElement,_.EnvConfig.load=v.prototype.load,v.prototype.load=O.prototype.load,v.prototype._loadImage=E.prototype._loadImage,(u._baseClass=S).__init__(),_.onReciveData(),l.useRetinalCanvas=!0)))},_.onReciveData=function(){laya.ali.mini.ALIMiniAdapter.isZiYu&&_.window.my.onMessage(function(i){"opendatacontext"==i.isLoad?i.url&&(F.ziyuFileData[i.url]=i.atlasdata,F.ziyuFileTextureData[i.imgReadyUrl]=i.imgNativeUrl):"openJsondatacontext"==i.isLoad?i.url&&(F.ziyuFileData[i.url]=i.atlasdata):"openJsondatacontextPic"==i.isLoad&&(F.ziyuFileTextureData[i.imgReadyUrl]=i.imgNativeUrl)})},_.measureText=function(i){i=_._measureText(i);return i||(i={width:16},console.warn("-------微信获取文字宽度失败----等待修复---------")),i},_.getUrlEncode=function(i,e){return"arraybuffer"==e?"":"utf8"},_.downLoadFile=function(i,e,t,n){void 0===e&&(e=""),void 0===n&&(n="utf8"),F.getFileInfo(i)?null!=t&&t.runWith([0]):F.downLoadFile(i,e,t,n)},_.remove=function(i,e){F.deleteFile("",i,e,"",0)},_.removeAll=function(){F.deleteAll()},_.hasNativeFile=function(i){return F.isLocalNativeFile(i)},_.getFileInfo=function(i){return F.getFileInfo(i)},_.getFileList=function(){return F.filesListObj},_.exitMiniProgram=function(){_.window.my.exitMiniProgram()},_.onMkdirCallBack=function(i,e){i||(F.filesListObj=JSON.parse(e.data),F.fakeObj=JSON.parse(e.data))},_.pixelRatio=function(){if(!_.EnvConfig.pixelRatioInt)try{return _.EnvConfig.pixelRatioInt=_.systemInfo.pixelRatio,_.systemInfo.pixelRatio}catch(i){}return _.EnvConfig.pixelRatioInt},_.createElement=function(i){var e;if("canvas"==i)return 1==_.idx?_.isZiYu?(e=_.window.sharedCanvas).style={}:(e=_.window.canvas).style={}:(e=_.window.my.createCanvas()).style={},_.idx++,e;if("textarea"==i||"input"==i)return _.onCreateInput(i);if("div"!=i)return _._preCreateElement(i);i=_._preCreateElement(i);return i.contains=function(i){return null},i.removeChild=function(i){},i},_.onCreateInput=function(i){i=_._preCreateElement(i);return i.focus=L.wxinputFocus,i.blur=L.wxinputblur,i.style={},i.value=0,i.parentElement={},i.placeholder={},i.type={},i.setColor=function(i){},i.setType=function(i){},i.setFontFace=function(i){},i.addEventListener=function(i){},i.contains=function(i){return null},i.removeChild=function(i){},i},_.createShaderCondition=function(i){var e=this;return function(){return e[i.replace("this.","")]}},_.sendAtlasToOpenDataContext=function(i){if(!laya.ali.mini.ALIMiniAdapter.isZiYu){var e=v.getRes(y.formatURL(i));if(!e)throw"传递的url没有获取到对应的图集数据信息请确保图集已经过";e.meta.image.split(",");if(e.meta&&e.meta.image)for(var t=e.meta.image.split(","),n=0<=i.indexOf("/")?"/":"\\",n=i.lastIndexOf(n),o=0<=n?i.substr(0,n+1):"",a=0,l=t.length;a<l;a++)t[a]=o+t[a];else t=[i.replace(".json",".png")];for(a=0;a<t.length;a++){var s=t[a];_.postInfoToContext(i,s,e)}}},_.postInfoToContext=function(i,e,t){var n={frames:t.frames,meta:t.meta},t=e,e=F.getFileInfo(y.formatURL(e)),o=e?(o=e.md5,F.getFileNativePath(o)):t;if(!o)throw"获取图集的磁盘url路径不存在";_.window.my.postMessage({url:i,atlasdata:n,imgNativeUrl:o,imgReadyUrl:t,isLoad:"opendatacontext"})},_.sendSinglePicToOpenDataContext=function(i){var e,t=y.formatURL(i),n=F.getFileInfo(t);if(n?(e=n.md5,e=F.getFileNativePath(e),i=t):e=i,!e)throw"获取图集的磁盘url路径不存在";_.window.my.postMessage({url:i,imgNativeUrl:e,imgReadyUrl:i,isLoad:"openJsondatacontextPic"})},_.sendJsonDataToDataContext=function(i){if(!laya.ali.mini.ALIMiniAdapter.isZiYu){var e=v.getRes(i);if(!e)throw"传递的url没有获取到对应的图集数据信息请确保图集已经过";_.window.my.postMessage({url:i,atlasdata:e,isLoad:"openJsondatacontext"})}},_.EnvConfig=null,_.window=null,_._preCreateElement=null,_._inited=!1,_.systemInfo=null,_.isZiYu=!1,_.isPosMsgYu=!1,_.autoCacheFile=!0,_.minClearSize=5242880,_.subNativeFiles=null,_.subNativeheads=[],_.subMaps=[],_.AutoCacheDownFile=!1,_._measureText=null,_.parseXMLFromString=function(i){var e;i=i.replace(/>\s+</g,"><");try{e=(new t.Parser.DOMParser).parseFromString(i,"text/xml")}catch(i){throw"需要引入xml解析库文件"}return e},_.idx=1,i(_,["nativefiles",function(){return this.nativefiles=["layaNativeDir"]}]),_);function _(){}var F=(n(C,"laya.ali.mini.MiniFileMgr",null,"MiniFileMgr$6"),C.isLocalNativeFile=function(i){for(var e=0,t=w.nativefiles.length;e<t;e++)if(-1!=i.indexOf(w.nativefiles[e]))return!0;return!1},C.getFileInfo=function(i){i=C.fakeObj[i];return null==i?null:i},C.read=function(i,e,t,n,o,a){void 0===e&&(e="utf8"),void 0===o&&(o=!1),void 0===a&&(a=""),i=""==(n=void 0===n?"":n)||-1==n.indexOf("http://")&&-1==n.indexOf("https://")?i:C.getFileNativePath(i),C.fs.readFile({filePath:i,encoding:e,success:function(i){null!=t&&t.runWith([0,i])},fail:function(i){i&&""!=n?C.downFiles(n,e,t,n,o,a):null!=t&&t.runWith([1])}})},C.downFiles=function(e,t,n,o,a,l,s){void 0===t&&(t="utf8"),void 0===o&&(o=""),void 0===a&&(a=!1),void 0===l&&(l=""),void 0===s&&(s=!0),C.wxdown({url:e,success:function(i){i.hasOwnProperty("statusCode")||(i.statusCode=200),200===i.statusCode?C.readFile(i.tempFilePath,t,n,o,a,l,s):403===i.statusCode?null!=n&&n.runWith([0,e]):null!=n&&n.runWith([1,i])},fail:function(i){null!=n&&n.runWith([1,i])}}).onProgressUpdate(function(i){null!=n&&n.runWith([2,i.progress])})},C.readFile=function(e,t,n,o,a,i,l){void 0===o&&(o=""),void 0===a&&(a=!1),void 0===i&&(i=""),void 0===l&&(l=!0),C.fs.readFile({filePath:e,encoding:t=void 0===t?"utf8":t,success:function(i){-1!=e.indexOf("http://")||-1!=e.indexOf("https://")?(w.autoCacheFile||a)&&(null!=n&&n.runWith([0,i]),C.copyFile(e,o,null,t,l)):null!=n&&n.runWith([0,i])},fail:function(i){i&&null!=n&&n.runWith([1,i])}})},C.downOtherFiles=function(i,e,t,n,o){void 0===t&&(t=""),void 0===n&&(n=!1),void 0===o&&(o=!0),C.wxdown({url:i,success:function(i){i.hasOwnProperty("statusCode")||(i.statusCode=200),200===i.statusCode?(w.autoCacheFile||n)&&-1==t.indexOf(".php")?(null!=e&&e.runWith([0,i.apFilePath]),C.copyFile(i.apFilePath,t,null,"",o)):null!=e&&e.runWith([0,i.apFilePath]):null!=e&&e.runWith([1,i])},fail:function(i){null!=e&&e.runWith([1,i])}})},C.downLoadFile=function(i,e,t,n){void 0===e&&(e=""),void 0===n&&(n="utf8"),w.window.navigator.userAgent.indexOf("AlipayMiniGame")<0?o.loader.load(i,t):"image"==e||"sound"==e?C.downOtherFiles(i,t,i,!0,!1):C.downFiles(i,n,t,i,!0,e,!1)},C.copyFile=function(t,n,o,a,l){void 0===a&&(a=""),void 0===l&&(l=!0);var i=t.split("/"),s=i[i.length-1],i=C.getFileInfo(n),r=C.getFileNativePath(s);C.fakeObj[n]={md5:s,readyUrl:n,size:0,times:d.now(),encoding:a};var u=C.getCacheUseSize();i?i.readyUrl!=n?C.fs.getFileInfo({filePath:t,success:function(i){l&&52428800<=u+4194304+i.size&&(i.size>w.minClearSize&&(w.minClearSize=i.size),C.onClearCacheRes()),C.deleteFile(t,n,o,a,i.size)},fail:function(i){null!=o&&o.runWith([1,i])}}):null!=o&&o.runWith([0]):C.fs.getFileInfo({filePath:t,success:function(e){l&&52428800<=u+4194304+e.size&&(e.size>w.minClearSize&&(w.minClearSize=e.size),C.onClearCacheRes()),C.fs.copyFile({srcPath:t,destPath:r,success:function(i){C.onSaveFile(n,s,!0,a,o,e.size)},fail:function(i){null!=o&&o.runWith([1,i])}})},fail:function(i){null!=o&&o.runWith([1,i])}})},C.onClearCacheRes=function(){var i,e=w.minClearSize,t=[];for(i in C.filesListObj)"fileUsedSize"!=i&&t.push(C.filesListObj[i]);C.sortOn(t,"times",16);for(var n=0,o=1,a=t.length;o<a;o++){var l=t[o];if(e<=n)break;n+=l.size,C.deleteFile("",l.readyUrl)}},C.sortOn=function(i,t,e){return 16==(e=void 0===e?0:e)?i.sort(function(i,e){return i[t]-e[t]}):18==e?i.sort(function(i,e){return e[t]-i[t]}):i.sort(function(i,e){return i[t]-e[t]})},C.getFileNativePath=function(i){return laya.ali.mini.MiniFileMgr.fileNativeDir+"/"+i},C.deleteFile=function(n,o,a,l,s){void 0===l&&(l=""),void 0===s&&(s=0);var i=C.getFileInfo(o=void 0===o?"":o),i=C.getFileNativePath(i.md5);C.fs.unlink({filePath:i,success:function(i){var e,t=""!=n;""!=n?(e=C.getFileNativePath(n),C.fs.copyFile({srcPath:n,destPath:e,success:function(i){C.onSaveFile(o,n,t,l,a,i.size)},fail:function(i){null!=a&&a.runWith([1,i])}})):C.onSaveFile(o,n,t,l,a,s)},fail:function(i){}})},C.deleteAll=function(){var i,e=[];for(i in C.filesListObj)"fileUsedSize"!=i&&e.push(C.filesListObj[i]);for(var t=1,n=e.length;t<n;t++){var o=e[t];C.deleteFile("",o.readyUrl)}laya.ali.mini.MiniFileMgr.filesListObj&&laya.ali.mini.MiniFileMgr.filesListObj.fileUsedSize&&(laya.ali.mini.MiniFileMgr.filesListObj.fileUsedSize=0),laya.ali.mini.MiniFileMgr.writeFilesList("",JSON.stringify({}),!1)},C.onSaveFile=function(i,e,t,n,o,a){void 0===t&&(t=!0),void 0===n&&(n=""),void 0===a&&(a=0);var l=i;null==C.filesListObj.fileUsedSize&&(C.filesListObj.fileUsedSize=0),t?(C.getFileNativePath(e),C.filesListObj[l]={md5:e,readyUrl:i,size:a,times:d.now(),encoding:n},C.filesListObj.fileUsedSize=parseInt(C.filesListObj.fileUsedSize)+a,C.writeFilesList(l,JSON.stringify(C.filesListObj),!0),null!=o&&o.runWith([0])):C.filesListObj[l]&&(a=parseInt(C.filesListObj[l].size),C.filesListObj.fileUsedSize=parseInt(C.filesListObj.fileUsedSize)-a,C.filesListObj[l].md5==C.fakeObj[l].md5&&delete C.fakeObj[l],delete C.filesListObj[l],C.writeFilesList(l,JSON.stringify(C.filesListObj),!1),null!=o&&o.runWith([0]))},C.writeFilesList=function(i,e,t){C.fs.writeFile({filePath:C.fileNativeDir+"/"+C.fileListName,encoding:"utf8",data:e,success:function(i){},fail:function(i){}}),!w.isZiYu&&w.isPosMsgYu&&w.window.my.postMessage&&w.window.my.postMessage({url:i,data:C.filesListObj[i],isLoad:"filenative",isAdd:t})},C.getCacheUseSize=function(){return C.filesListObj&&C.filesListObj.fileUsedSize?C.filesListObj.fileUsedSize:0},C.existDir=function(i,e){C.fs.mkdir({dirPath:i,success:function(i){null!=e&&e.runWith([0,{data:JSON.stringify({})}])},fail:function(i){10025==i.error?C.readSync(C.fileListName,"utf8",e):null!=e&&e.runWith([1,i])}})},C.readSync=function(i,e,t,n){void 0===e&&(e="utf8"),void 0===n&&(n="");var o,i=C.getFileNativePath(i);try{C.fs.readFile({filePath:i,encoding:e,success:function(i){o=i.data,null!=t&&t.runWith([0,{data:o}])},fail:function(){null!=t&&t.runWith([1])}})}catch(i){null!=t&&t.runWith([1])}},C.setNativeFileDir=function(i){C.fileNativeDir=w.window.my.env.USER_DATA_PATH+i},C.filesListObj={},C.fakeObj={},C.fileNativeDir=null,C.fileListName="layaairfiles.txt",C.ziyuFileData={},C.ziyuFileTextureData={},C.loadPath="",C.DESCENDING=2,C.NUMERIC=16,i(C,["fs",function(){return this.fs=w.window.my.getFileSystemManager()},"wxdown",function(){return this.wxdown=w.window.my.downloadFile}]),C);function C(){}var E=(n(b,"laya.ali.mini.MiniImage",null,"MiniImage$6"),b.prototype._loadImage=function(i){var e=this;if(w.isZiYu)b.onCreateImage(i,e,!0);else{var t,n,o=!1;if(F.isLocalNativeFile(i)){if(-1==i.indexOf("http://")&&-1==i.indexOf("https://")||(i=""!=F.loadPath?i.split(F.loadPath)[1]:(n=i,(i=""!=(t=""!=y.rootPath?y.rootPath:y.basePath)?i.split(t)[1]:i)||n)),w.subNativeFiles&&0==w.subNativeheads.length)for(var a in w.subNativeFiles){var l=w.subNativeFiles[a];w.subNativeheads=w.subNativeheads.concat(l);for(var s=0;s<l.length;s++)w.subMaps[l[s]]=a+"/"+l[s]}!w.subNativeFiles||-1==i.indexOf("/")||(t=i.split("/")[0]+"/")&&-1!=w.subNativeheads.indexOf(t)&&(n=w.subMaps[t],i=i.replace(t,n))}else o=!0,i=y.formatURL(i);F.getFileInfo(i)?b.onCreateImage(i,e,!o):-1==i.indexOf("http://")&&-1==i.indexOf("https://")||w.isZiYu?b.onCreateImage(i,e,!0):F.downOtherFiles(encodeURI(i),new m(b,b.onDownImgCallBack,[i,e]),i)}},b.onDownImgCallBack=function(i,e,t,n){void 0===n&&(n=""),t?e.onError(null):b.onCreateImage(i,e,!1,n)},b.onCreateImage=function(e,t,i,n){var o,a,l;function s(){l.onload=null,l.onerror=null,delete t.imgCache[e]}void 0===i&&(i=!1),void 0===n&&(n=""),a=w.autoCacheFile?i?w.isZiYu?(o=y.formatURL(e),F.ziyuFileTextureData[o]||e):e:""!=n?n:(a=F.getFileInfo(e).md5,F.getFileNativePath(a)):i?e:n,null==t.imgCache&&(t.imgCache={});i=function(){s(),t.onLoaded(l)},n=function(){s(),delete F.filesListObj[e],delete F.fakeObj[e],t.event("error","Load image failed")};"nativeimage"==t._type?((l=new d.window.Image).crossOrigin="",l.onload=i,l.onerror=n,l.src=a,t.imgCache[e]=l):new r.create(a,{onload:i,onerror:n,onCreate:function(i){l=i,t.imgCache[e]=i}})},b);function b(){}var L=(n(x,"laya.ali.mini.MiniInput",null,"MiniInput$6"),x._createInputElement=function(){s._initInput(s.area=d.createElement("textarea")),s._initInput(s.input=d.createElement("input")),s.inputContainer=d.createElement("div"),s.inputContainer.style.position="absolute",s.inputContainer.style.zIndex=1e5,d.container.appendChild(s.inputContainer),s.inputContainer.setPos=function(i,e){s.inputContainer.style.left=i+"px",s.inputContainer.style.top=e+"px"},o.stage.on("resize",null,x._onStageResize),w.window.my.onWindowResize&&w.window.my.onWindowResize(function(i){w.window.dispatchEvent&&w.window.dispatchEvent("resize")}),p._soundClass=M,p._musicClass=M;var i=w.systemInfo.model,e=w.systemInfo.system;-1!=i.indexOf("iPhone")&&(d.onIPhone=!0,d.onIOS=!0,d.onIPad=!0,d.onAndroid=!1),-1==e.indexOf("Android")&&-1==e.indexOf("Adr")||(d.onAndroid=!0,d.onIPhone=!1,d.onIOS=!1,d.onIPad=!1)},x._onStageResize=function(){o.stage._canvasTransform.identity().scale(d.width/c.canvas.width/f.getPixelRatio(),d.height/c.canvas.height/f.getPixelRatio())},x.wxinputFocus=function(i){var e=s.inputElement.target;e&&!e.editable||(w.window.my.offKeyboardConfirm(),w.window.my.offKeyboardInput(),w.window.my.showKeyboard({defaultValue:e.text,maxLength:e.maxChars,multiple:e.multiline,confirmHold:!0,confirmType:"done",success:function(i){},fail:function(i){}}),w.window.my.onKeyboardConfirm(function(i){i=i?i.value:"";e.text=i,e.event("input"),laya.ali.mini.MiniInput.inputEnter(!0)}),w.window.my.onKeyboardInput(function(i){i=i?i.value:"";e.multiline||-1==i.indexOf("\n")?(e.text=i,e.event("input")):laya.ali.mini.MiniInput.inputEnter(!1)}))},x.inputEnter=function(i){i&&x.hideKeyboard(),s.inputElement.target&&(s.inputElement.target.focus=!1)},x.wxinputblur=function(){},x.hideKeyboard=function(){w.window.my.offKeyboardConfirm(),w.window.my.offKeyboardInput(),w.window.my.hideKeyboard({success:function(i){console.log("隐藏键盘")},fail:function(i){console.log("隐藏键盘出错:"+(i?i.errMsg:""))}})},x);function x(){}var S=(n(P,"laya.ali.mini.MiniLocalStorage",null,"MiniLocalStorage$6"),P.__init__=function(){P.items=P},P.setItem=function(e,t){try{w.window.my.setStorageSync({key:e,data:t})}catch(i){w.window.my.setStorage({key:e,data:t})}},P.getItem=function(i){i=w.window.my.getStorageSync({key:i});return i.success?i.data:null},P.setJSON=function(i,e){P.setItem(i,e)},P.getJSON=function(i){return P.getItem(i)},P.removeItem=function(i){w.window.my.removeStorageSync(i)},P.clear=function(){w.window.my.clearStorageSync()},P.getStorageInfoSync=function(){try{var i=w.window.my.getStorageInfoSync();return console.log(i.keys),console.log(i.currentSize),console.log(i.limitSize),i}catch(i){}return null},P.support=!0,P.items=null,P);function P(){}n(I,"laya.ali.mini.MiniLocation",null,"MiniLocation$6"),I.__init__=function(){w.window.navigator.geolocation.getCurrentPosition=I.getCurrentPosition,w.window.navigator.geolocation.watchPosition=I.watchPosition,w.window.navigator.geolocation.clearWatch=I.clearWatch},I.getCurrentPosition=function(e,i,t){var n;(n={success:function(i){null!=e&&e(i)}}).fail=i,w.window.my.getLocation(n)},I.watchPosition=function(i,e,t){var n;return I._curID++,(n={}).success=i,n.error=e,I._watchDic[I._curID]=n,o.timer.loop(1e3,null,I._myLoop),I._curID},I.clearWatch=function(i){delete I._watchDic[i],I._hasWatch()||o.timer.clear(null,I._myLoop)},I._hasWatch=function(){for(var i in I._watchDic)if(I._watchDic[i])return!0;return!1},I._myLoop=function(){I.getCurrentPosition(I._mySuccess,I._myError)},I._mySuccess=function(i){var e,t={};for(e in t.coords=i,t.timestamp=d.now(),I._watchDic)I._watchDic[e].success&&I._watchDic[e].success(t)},I._myError=function(i){for(var e in I._watchDic)I._watchDic[e].error&&I._watchDic[e].error(i)},I._watchDic={},I._curID=0;function I(){}(function(){function i(i,e){this.videoend=!1,this.videourl="",this.videoElement=null,this.onPlayFunc=null,this.onEndedFunC=null,this._duration=NaN,this.position=NaN,this.videoElement=w.window.my.createVideo({width:i=void 0===i?320:i,height:e=void 0===e?240:e,autoplay:!0})}n(i,"laya.ali.mini.MiniVideo",null,"MiniVideo$4");var e=i.prototype;e.on=function(i,e,t){"loadedmetadata"==i?(this.onPlayFunc=t.bind(e),this.videoElement.onPlay=this.onPlayFunction.bind(this)):"ended"==i&&(this.onEndedFunC=t.bind(e),this.videoElement.onEnded=this.onEndedFunction.bind(this)),this.videoElement.onTimeUpdate=this.onTimeUpdateFunc.bind(this)},e.onTimeUpdateFunc=function(i){this.position=i.position,this._duration=i.duration},e.onPlayFunction=function(){this.videoElement&&(this.videoElement.readyState=200),console.log("=====视频加载完成========"),null!=this.onPlayFunc&&this.onPlayFunc()},e.onEndedFunction=function(){this.videoElement&&(this.videoend=!0,console.log("=====视频播放完毕========"),null!=this.onEndedFunC&&this.onEndedFunC())},e.off=function(i,e,t){"loadedmetadata"==i?(this.onPlayFunc=t.bind(e),this.videoElement.offPlay=this.onPlayFunction.bind(this)):"ended"==i&&(this.onEndedFunC=t.bind(e),this.videoElement.offEnded=this.onEndedFunction.bind(this))},e.load=function(i){this.videoElement&&(this.videoElement.src=i)},e.play=function(){this.videoElement&&(this.videoend=!1,this.videoElement.play())},e.pause=function(){this.videoElement&&(this.videoend=!0,this.videoElement.pause())},e.size=function(i,e){this.videoElement&&(this.videoElement.width=i,this.videoElement.height=e)},e.destroy=function(){this.videoElement&&this.videoElement.destroy(),this.videoElement=null,this.onEndedFunC=null,this.onPlayFunc=null,this.videoend=!1,this.videourl=null},e.reload=function(){this.videoElement&&(this.videoElement.src=this.videourl)},a(0,e,"duration",function(){return this._duration}),a(0,e,"paused",function(){return!!this.videoElement&&this.videoElement.paused}),a(0,e,"loop",function(){return!!this.videoElement&&this.videoElement.loop},function(i){this.videoElement&&(this.videoElement.loop=i)}),a(0,e,"currentTime",function(){return this.videoElement?this.videoElement.initialTime:0},function(i){this.videoElement&&(this.videoElement.initialTime=i)}),a(0,e,"ended",function(){return this.videoend}),a(0,e,"muted",function(){return!!this.videoElement&&this.videoElement.muted},function(i){this.videoElement&&(this.videoElement.muted=i)}),a(0,e,"videoWidth",function(){return this.videoElement?this.videoElement.width:0}),a(0,e,"videoHeight",function(){return this.videoElement?this.videoElement.height:0}),a(0,e,"playbackRate",function(){return this.videoElement?this.videoElement.playbackRate:0},function(i){this.videoElement&&(this.videoElement.playbackRate=i)}),a(0,e,"x",function(){return this.videoElement?this.videoElement.x:0},function(i){this.videoElement&&(this.videoElement.x=i)}),a(0,e,"y",function(){return this.videoElement?this.videoElement.y:0},function(i){this.videoElement&&(this.videoElement.y=i)}),a(0,e,"currentSrc",function(){return this.videoElement.src}),i.__init__=function(){laya.device.media.Video=i}})(),function(o){function a(){a.__super.call(this)}n(a,"laya.ali.mini.MiniAccelerator",o,"MiniAccelerator$6");var i=a.prototype;i.on=function(i,e,t,n){return o.prototype.on.call(this,i,e,t,n),a.startListen(this.onDeviceOrientationChange),this},i.off=function(i,e,t,n){return void 0===n&&(n=!1),this.hasListener(i)||a.stopListen(),o.prototype.off.call(this,i,e,t,n)},a.__init__=function(){try{var i=laya.device.motion.Accelerator;if(!i)return;i.prototype.on=a.prototype.on,i.prototype.off=a.prototype.off}catch(i){}},a.startListen=function(i){if(a._callBack=i,!a._isListening){a._isListening=!0;try{w.window.my.onAccelerometerChange(laya.ali.mini.MiniAccelerator.onAccelerometerChange)}catch(i){}}},a.stopListen=function(){a._isListening=!1;try{w.window.my.stopAccelerometer({})}catch(i){}},a.onAccelerometerChange=function(i){var e={};e.acceleration=i,e.accelerationIncludingGravity=i,e.rotationRate={},null!=a._callBack&&a._callBack(e)},a._isListening=!1,a._callBack=null}(e);var O=(n(N,"laya.ali.mini.MiniLoader",e,"MiniLoader$6"),N.prototype.load=function(i,e,t,n,o){void 0===t&&(t=!0),void 0===o&&(o=!1);var a=this;if(0===(a._url=i).indexOf("data:image")?a._type=e="image":a._type=e=e||a.getTypeFromUrl(i),a._cache=t,a._data=null,!o&&v.loadedMap[y.formatURL(i)])return a._data=v.loadedMap[y.formatURL(i)],this.event("progress",1),void this.event("complete",a._data);if(null!=v.parserMap[e])return a._customParse=!0,void(v.parserMap[e]instanceof laya.utils.Handler?v.parserMap[e].runWith(this):v.parserMap[e].call(null,this));var l=w.getUrlEncode(i,e),s=g.getFileExtension(i);if(-1!=N._fileTypeArr.indexOf(s)||"image"==e)w.EnvConfig.load.call(this,i,e,t,n,o);else if(w.isZiYu&&!F.ziyuFileData[i]&&(i=y.formatURL(i)),w.isZiYu&&F.ziyuFileData[i]){s=F.ziyuFileData[i];a.onLoaded(s)}else if(F.getFileInfo(i)){var r=F.getFileInfo(y.formatURL(i));r.encoding=null==r.encoding?"utf8":r.encoding;var u=F.getFileNativePath(r.md5);F.readFile(u,r.encoding,new m(N,N.onReadNativeCallBack,[l,i,e,t,n,o,a]),i)}else{if(F.isLocalNativeFile(i)){if(w.subNativeFiles&&0==w.subNativeheads.length)for(var d in w.subNativeFiles){var c=w.subNativeFiles[d];w.subNativeheads=w.subNativeheads.concat(c);for(var f=0;f<c.length;f++)w.subMaps[c[f]]=d+"/"+c[f]}return!w.subNativeFiles||-1==i.indexOf("/")||(u=i.split("/")[0]+"/")&&-1!=w.subNativeheads.indexOf(u)&&(h=w.subMaps[u],i=i.replace(u,h)),void F.read(i,l,new m(N,N.onReadNativeCallBack,[l,i,e,t,n,o,a]))}var h=i;-1!=y.formatURL(i).indexOf(w.window.my.env.USER_DATA_PATH)||-1==i.indexOf("http://")&&-1==i.indexOf("https://")||w.AutoCacheDownFile?(r=F.getFileInfo(i))?(r.encoding=null==r.encoding?"utf8":r.encoding,F.readFile(r.url,l,new m(N,N.onReadNativeCallBack,[l,i,e,t,n,o,a]),i)):"image"==a.type||"htmlimage"==a.type?w.EnvConfig.load.call(a,i,e,t,n,o):(i=y.formatURL(i),"image"!=e&&(-1==i.indexOf("http://")&&-1==i.indexOf("https://")||F.isLocalNativeFile(i))?F.readFile(i,l,new m(N,N.onReadNativeCallBack,[l,i,e,t,n,o,a]),i):F.downFiles(encodeURI(i),l,new m(N,N.onReadNativeCallBack,[l,i,e,t,n,o,a]),i,!0)):w.EnvConfig.load.call(a,h,e,t,n,o)}},N.onReadNativeCallBack=function(i,e,t,n,o,a,l,s,r){void 0===n&&(n=!0),void 0===a&&(a=!1),(s=void 0===s?0:s)?1==s&&(console.log("-----------本地加载失败,尝试外网加载----"),w.EnvConfig.load.call(l,e,t,n,o,a)):(r="json"==t||"atlas"==t?w.getJson(r.data):"xml"==t?g.parseXMLFromString(r.data):r.data,!w.isZiYu&&w.isPosMsgYu&&"arraybuffer"!=t&&w.window.wx&&w.window.my.postMessage({url:e,data:r,isLoad:"filedata"}),l.onLoaded(r))},i(N,["_fileTypeArr",function(){return this._fileTypeArr=["png","jpg","bmp","jpeg","gif"]}]),N);function N(){N.__super.call(this)}var M=function(){function l(){this._sound=null,this.url=null,this.loaded=!1,this.readyUrl=null,l.__super.call(this)}n(l,"laya.ali.mini.MiniSound",e,"MiniSound$6");var i=l.prototype;return i.load=function(i){if(F.isLocalNativeFile(i)?-1==i.indexOf("http://")&&-1==i.indexOf("https://")||(""!=F.loadPath?i=i.split(F.loadPath)[1]:""!=(e=""!=y.rootPath?y.rootPath:y.basePath)&&(i=i.split(e)[1])):i=y.formatURL(i),this.url=i,this.readyUrl=i,l._audioCache[this.readyUrl])this.event("complete");else if(w.autoCacheFile&&F.getFileInfo(i))this.onDownLoadCallBack(i,0);else if(w.autoCacheFile)if(F.isLocalNativeFile(i)){var e,t=i;if(i=(i=""!=(e=""!=y.rootPath?y.rootPath:y.basePath)?i.split(e)[1]:i)||t,w.subNativeFiles&&0==w.subNativeheads.length)for(var n in w.subNativeFiles){var o=w.subNativeFiles[n];w.subNativeheads=w.subNativeheads.concat(o);for(var a=0;a<o.length;a++)w.subMaps[o[a]]=n+"/"+o[a]}!w.subNativeFiles||-1==i.indexOf("/")||(e=i.split("/")[0]+"/")&&-1!=w.subNativeheads.indexOf(e)&&(t=w.subMaps[e],i=i.replace(e,t)),this.onDownLoadCallBack(i,0)}else F.downOtherFiles(i,m.create(this,this.onDownLoadCallBack,[i]),i);else this.onDownLoadCallBack(i,0)},i.onDownLoadCallBack=function(i,e,t){var n;void 0===t&&(t=""),e?this.event("error"):(w.autoCacheFile?(n=""!=t?t:(t=F.getFileInfo(i))&&t.md5?(n=t.md5,F.getFileNativePath(n)):i,this._sound=l._createSound(),this._sound.src=this.url=n):(this._sound=l._createSound(),this._sound.src=i),this._sound.onCanPlay(l.bindToThis(this.onCanPlay,this)),this._sound.onError(l.bindToThis(this.onError,this)))},i.onError=function(i){try{console.log("sound error:"+i)}catch(i){}this.event("error"),this._sound.offError(null)},i.onCanPlay=function(){this.loaded=!0,this.event("complete"),this._sound.offCanPlay(null)},i.play=function(i,e){var t;void 0===i&&(i=0),void 0===e&&(e=0),n=this.url==p._tMusic?(l._musicAudio||(l._musicAudio=l._createSound()),l._musicAudio):l._audioCache[this.readyUrl]?l._audioCache[this.readyUrl]._sound:l._createSound(),w.autoCacheFile&&F.getFileInfo(this.url)?(t=F.getFileInfo(this.url).md5,n.src=this.url=F.getFileNativePath(t)):n.src=this.url;var n=new U(n,this);return n.url=this.url,n.loops=e,n.loop=0===e,n.startTime=i,n.play(),p.addChannel(n),n},i.dispose=function(){var i=l._audioCache[this.readyUrl];i&&(i.src="",i._sound&&(i._sound.destroy(),i._sound=null,i=null),delete l._audioCache[this.readyUrl])},a(0,i,"duration",function(){return this._sound.duration}),l._createSound=function(){return l._id++,w.window.my.createInnerAudioContext()},l.bindToThis=function(i,e){return i.bind(e)},l._musicAudio=null,l._id=0,l._audioCache={},l}(),U=function(){function t(i,e){this._audio=null,this._onEnd=null,this._miniSound=null,t.__super.call(this),this._audio=i,this._miniSound=e,this._onEnd=t.bindToThis(this.__onEnd,this),i.onEnded(this._onEnd)}n(t,"laya.ali.mini.MiniSoundChannel",h,"MiniSoundChannel$6");var i=t.prototype;return i.__onEnd=function(){if(1==this.loops)return this.completeHandler&&(o.timer.once(10,this,this.__runComplete,[this.completeHandler],!1),this.completeHandler=null),this.stop(),void this.event("complete");0<this.loops&&this.loops--,this.startTime=0,this.play()},i.play=function(){this.isStopped=!1,p.addChannel(this),this._audio.play()},i.stop=function(){this.isStopped=!0,p.removeChannel(this),this.completeHandler=null,this._audio&&(this._audio.stop(),this._audio.offEnded(null),this._miniSound.dispose(),this._audio=null,this._miniSound=null,this._onEnd=null)},i.pause=function(){this.isStopped=!0,this._audio.pause()},i.resume=function(){this._audio&&(this.isStopped=!1,p.addChannel(this),this._audio.play())},a(0,i,"startTime",null,function(i){this._audio&&(this._audio.startTime=i)}),a(0,i,"autoplay",function(){return this._audio.autoplay},function(i){this._audio.autoplay=i}),a(0,i,"position",function(){return this._audio?this._audio.currentTime:0}),a(0,i,"duration",function(){return this._audio?this._audio.duration:0}),a(0,i,"loop",function(){return this._audio.loop},function(i){this._audio.loop=i}),a(0,i,"volume",function(){return this._audio?this._audio.volume:1},function(i){this._audio&&(this._audio.volume=i)}),t.bindToThis=function(i,e){return i.bind(e)},t}()}(window,(document,Laya)),"function"==typeof define&&define.amd&&define("laya.core",["require","exports"],function(i,e){"use strict";for(var t in Object.defineProperty(e,"__esModule",{value:!0}),Laya){var n=Laya[t];n&&n.__isclass&&(e[t]=n)}});