!function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={exports:{},id:o,loaded:!1};return t[o].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){window.CordovaAppLoader=n(1),window.CordovaFileCache=n(2),window.CordovaPromiseFS=n(4),window.Promise=n(5),window.setImmediate=window.setTimeout},function(t,e,n){function o(t){var e=Object.keys(t);e.sort();var n="";return e.forEach(function(e){t[e]&&t[e].version,n+="@"+t[e].version}),i.hash(n)+""}function r(t){if(!t)throw new Error("CordovaAppLoader has no options!");if(!t.fs)throw new Error('CordovaAppLoader has no "fs" option (cordova-promise-fs)');if(!t.serverRoot)throw new Error('CordovaAppLoader has no "serverRoot" option.');if(!window.pegasus||!window.Manifest)throw new Error("CordovaAppLoader bootstrap.js is missing.");this.allowServerRootFromManifest=t.allowServerRootFromManifest===!0,a=t.fs.Promise,this.manifest=window.Manifest,this.newManifest=null,this.bundledManifest=null,this.preventAutoUpdateLoop=t.preventAutoUpdateLoop===!0,this._lastUpdateFiles=localStorage.getItem("last_update_files");1*localStorage.getItem("last_update_time");Date.now()-this._lastUpdateTime>6e4&&(this.preventAutoUpdateLoop=!1),t.serverRoot=t.serverRoot||"",t.serverRoot&&"/"!==t.serverRoot[t.serverRoot.length-1]&&(t.serverRoot+="/"),this.newManifestUrl=t.manifestUrl||t.serverRoot+(t.manifest||"manifest.json"),t.mode&&(t.mode="mirror"),this.cache=new i(t),this.corruptNewManifest=!1,this._toBeCopied=[],this._toBeDeleted=[],this._toBeDownloaded=[],this._updateReady=!1,this._checkTimeout=t.checkTimeout||1e4}var i=n(2),a=(n(4),null),s=location.href.replace(location.hash,"");s=s.substr(0,s.lastIndexOf("/")+1),/ip(hone|ad|od)/i.test(navigator.userAgent)&&(s=location.pathname.substr(location.pathname.indexOf("/www/")),s=s.substr(0,s.lastIndexOf("/")+1),s="cdvfile://localhost/bundle"+s),r.prototype._createFilemap=function(t){var e={},n=this.cache._fs.normalize;return Object.keys(t||[]).forEach(function(o){t[o].filename=n(t[o].filename),e[t[o].filename]=t[o]}),e},r.prototype.copyFromBundle=function(t){var e=s+t;return this.cache._fs.download(e,this.cache.localRoot+t)},r.prototype.getBundledManifest=function(){var t=this,e=document.querySelector("script[manifest]"),n=(e?e.getAttribute("manifest"):null)||"manifest.json";return new a(function(e,o){t.bundledManifest?e(t.bundledManifest):(pegasus(n).then(function(n){t.bundledManifest=n,e(n)},o),setTimeout(function(){o(new Error("bundled manifest timeout"))},t._checkTimeout))})},r.prototype.check=function(t){var e=this,n=this.manifest;"string"==typeof t&&(e.newManifestUrl=t,t=void 0);var r=new a(function(n,o){if("object"==typeof t)n(t);else{var r=e.cache._cacheBuster?e.newManifestUrl+"?"+Date.now():e.newManifestUrl;pegasus(r).then(n,o),setTimeout(function(){o(new Error("new manifest timeout"))},e._checkTimeout)}});return new a(function(t,i){a.all([r,e.getBundledManifest(),e.cache.list()]).then(function(r){var a=r[0],s=r[1],u=o(a.files);if(e.preventAutoUpdateLoop===!0&&u===e._lastUpdateFiles){var c=o(Manifest.files);return e._lastUpdateFiles!==c&&(console.warn("New manifest available, but an earlier update attempt failed. Will not download."),e.corruptNewManifest=!0,t(null)),void t(!1)}if(!a.files)return void i(new Error('Downloaded Manifest has no "files" attribute.'));var f=r[2],l=e._createFilemap(n.files),u=e._createFilemap(a.files),d=e._createFilemap(s.files);e._toBeDownloaded=[],e._toBeCopied=[],e._toBeDeleted=[];var h=e.cache._fs.isCordova,p=0;Object.keys(u).filter(function(t){return!l[t]||l[t].version!==u[t].version||!e.cache.isCached(t)}).forEach(function(t){h&&d[t]&&d[t].version===u[t].version?e._toBeCopied.push(t):e._toBeDownloaded.push(t),d[t]&&d[t].version===u[t].version||p++}),e._toBeDeleted=f.map(function(t){return t.substr(e.cache.localRoot.length)}).filter(function(t){return!u[t]||e._toBeDownloaded.indexOf(t)>=0||e._toBeCopied.indexOf(t)>=0}),p+=e._toBeDeleted.length,p>0?(e.newManifest=a,e.newManifest.root=e.cache.localUrl,t(!0)):t(!1)},function(t){i(t)})})},r.prototype.canDownload=function(){return!!this.newManifest&&!this._updateReady},r.prototype.canUpdate=function(){return this._updateReady},r.prototype.download=function(t,e){var n=this;return n.canDownload()?(localStorage.removeItem("manifest"),this.manifest.files=Manifest.files={},n.cache.remove(n._toBeDeleted,!0).then(function(){return a.all(n._toBeCopied.map(function(t){return n.cache._fs.download(s+t,n.cache.localRoot+t)}))}).then(function(){return n.allowServerRootFromManifest&&n.newManifest.serverRoot&&(n.cache.serverRoot=n.newManifest.serverRoot),n.cache.add(n._toBeDownloaded),n.cache.download(t,e)}).then(function(){return n._toBeDeleted=[],n._toBeDownloaded=[],n._updateReady=!0,n.newManifest})):new a(function(t){t(null)})},r.prototype.update=function(t){return this._updateReady?(localStorage.setItem("manifest",JSON.stringify(this.newManifest)),localStorage.setItem("last_update_files",o(this.newManifest.files)),localStorage.setItem("last_update_time",Date.now()),t!==!1&&location.reload(),!0):!1},r.prototype.clear=function(){return localStorage.removeItem("last_update_files"),localStorage.removeItem("manifest"),this.cache.clear()},r.prototype.reset=function(){return this.clear().then(function(){location.reload()},function(){location.reload()})},t.exports=r},function(t,e,n){function o(t){var e=this;if(this._fs=t.fs,!this._fs)throw new Error('Missing required option "fs". Add an instance of cordova-promise-fs.');i=this._fs.Promise,this._mirrorMode="hash"!==t.mode,this._retry=t.retry||[500,1500,8e3],this._cacheBuster=!!t.cacheBuster,this.localRoot=this._fs.normalize(t.localRoot||"data"),this.serverRoot=this._fs.normalize(t.serverRoot||""),this._downloading=[],this._added=[],this._cached={},this.ready=this._fs.ensure(this.localRoot).then(function(t){return e.localInternalURL=t.toInternalURL?t.toInternalURL():t.toURL(),e.localUrl=t.toURL(),e.list()})}var r=n(3),i=null;o.hash=r,o.prototype.list=function(){var t=this;return new i(function(e){t._fs.list(t.localRoot,"rfe").then(function(n){t._cached={},n=n.map(function(e){var n=t._fs.normalize(e.fullPath);return t._cached[n]={toInternalURL:e.toInternalURL?e.toInternalURL():e.toURL(),toURL:e.toURL()},n}),e(n)},function(){e([])})})},o.prototype.add=function(t){t||(t=[]),"string"==typeof t&&(t=[t]);var e=this;return t.forEach(function(t){t=e.toServerURL(t),-1===e._added.indexOf(t)&&e._added.push(t)}),e.isDirty()},o.prototype.remove=function(t,e){t||(t=[]);var n=[];"string"==typeof t&&(t=[t]);var o=this;return t.forEach(function(t){var e=o._added.indexOf(o.toServerURL(t));e>=0&&o._added.splice(e,1);var r=o.toPath(t);n.push(o._fs.remove(r)),delete o._cached[r]}),e?i.all(n):o.isDirty()},o.prototype.getDownloadQueue=function(){var t=this,e=t._added.filter(function(e){return!t.isCached(e)});return e},o.prototype.getAdded=function(){return this._added},o.prototype.isDirty=function(){return this.getDownloadQueue().length>0},o.prototype.download=function(t,e){var n=this._fs,o=this;return e=e||!1,o.abort(),new i(function(r,i){n.ensure(o.localRoot).then(function(){return o.list()}).then(function(){if(!o.isDirty())return void r(o);var a=o.getDownloadQueue(),s=o._downloading.length,u=o._downloading.length+a.length,c=0,f=[];a.forEach(function(a){var l,d=o.toPath(a);"function"==typeof t&&(l=function(e){e.queueIndex=s,e.queueSize=u,e.url=a,e.path=d,e.percentage=s/u,e.loaded>0&&e.total>0&&s!==u&&(e.percentage+=e.loaded/e.total/u),e.percentage=Math.max(c,e.percentage),c=e.percentage,t(e)});var h=function(){s++,l(new ProgressEvent),s===u&&(o._downloading=[],o.list().then(function(){l&&l(new ProgressEvent),o.isDirty()?i(f):r(o)},i))},p=function(t){t&&t.target&&t.target.error&&(t=t.target.error),f.push(t),h()},w=a;o._cacheBuster&&(w+="?"+Date.now());var v=n.download(w,d,{retry:o._retry},e?l:void 0);v.then(h,p),o._downloading.push(v)})},i)})},o.prototype.abort=function(){this._downloading.forEach(function(t){t.abort()}),this._downloading=[]},o.prototype.isCached=function(t){return t=this.toPath(t),!!this._cached[t]},o.prototype.clear=function(){var t=this;return this._cached={},this._fs.removeDir(this.localRoot).then(function(){return t._fs.ensure(t.localRoot)})},o.prototype.toInternalURL=function(t){var e=this.toPath(t);return this._cached[e]?this._cached[e].toInternalURL:t},o.prototype.get=function(t){var e=this.toPath(t);return this._cached[e]?this._cached[e].toURL:this.toServerURL(t)},o.prototype.toDataURL=function(t){return this._fs.toDataURL(this.toPath(t))},o.prototype.toURL=function(t){var e=this.toPath(t);return this._cached[e]?this._cached[e].toURL:t},o.prototype.toServerURL=function(t){var t=this._fs.normalize(t);return t.indexOf("://")<0?this.serverRoot+t:t},o.prototype.toPath=function(t){if(this._mirrorMode){var e=t.indexOf("?");e>-1&&(t=t.substr(0,e)),t=this._fs.normalize(t||"");var n=this.serverRoot.length;return t.substr(0,n)!==this.serverRoot?this.localRoot+t:this.localRoot+t.substr(n)}var o=t.substr(t.lastIndexOf("."));return(o.indexOf("?")>0||o.indexOf("/")>0)&&(o=".txt"),this.localRoot+r(t)+o},t.exports=o},function(t){function e(t,e){var n,o,r,i,a,s,u,c;for(n=3&t.length,o=t.length-n,r=e,a=3432918353,s=461845907,c=0;o>c;)u=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u,r=r<<13|r>>>19,i=5*(65535&r)+((5*(r>>>16)&65535)<<16)&4294967295,r=(65535&i)+27492+(((i>>>16)+58964&65535)<<16);switch(u=0,n){case 3:u^=(255&t.charCodeAt(c+2))<<16;case 2:u^=(255&t.charCodeAt(c+1))<<8;case 1:u^=255&t.charCodeAt(c),u=(65535&u)*a+(((u>>>16)*a&65535)<<16)&4294967295,u=u<<15|u>>>17,u=(65535&u)*s+(((u>>>16)*s&65535)<<16)&4294967295,r^=u}return r^=t.length,r^=r>>>16,r=2246822507*(65535&r)+((2246822507*(r>>>16)&65535)<<16)&4294967295,r^=r>>>13,r=3266489909*(65535&r)+((3266489909*(r>>>16)&65535)<<16)&4294967295,r^=r>>>16,r>>>0}t.exports=e},function(t){function e(t,n,o,r){t.getDirectory(n[0],{create:!0},function(t){n.length>1?e(t,n.slice(1),o,r):o(t)},r)}function n(t){return t=t.substr(0,t.lastIndexOf("/")+1),"/"===t[0]&&(t=t.substr(1)),t}function o(t){return t.substr(t.lastIndexOf("/")+1)}function r(t){t=t||"","/"===t[0]&&(t=t.substr(1));for(var e=t.split("/"),n=e[0],o=1;o0&&"."!==t&&".."!==t}),e(r.root,t,n,o)):n(r.root)},o)})}function c(t,e){return new E(function(n,o){return"object"==typeof t?n(t):(t=r(t),e=e||{},C.then(function(r){r.root.getFile(t,e,n,o)},o))})}function f(t,e){return t=r(t),e=e||{},new E(function(n,o){return C.then(function(r){t&&"/"!==t?r.root.getDirectory(t,e,n,o):n(r.root)},o)})}function l(t,e){e=e||"";var n=e.indexOf("r")>-1,o=e.indexOf("e")>-1,r=e.indexOf("f")>-1,i=e.indexOf("d")>-1;return r&&i&&(r=!1,i=!1),new E(function(e,a){return f(t).then(function(t){var u=t.createReader();u.readEntries(function(t){var u=[s(t)];n&&t.filter(function(t){return t.isDirectory}).forEach(function(t){u.push(l(t.fullPath,"re"))}),E.all(u).then(function(t){var n=[];n=n.concat.apply(n,t),r&&(n=n.filter(function(t){return t.isFile})),i&&(n=n.filter(function(t){return t.isDirectory})),o||(n=n.map(function(t){return t.fullPath})),e(n)},a)},a)},a)})}function d(t){return new E(function(e,n){c(t).then(function(t){e(t)},function(t){1===t.code?e(!1):n(t)})})}function h(t){return new E(function(e,n){f(t).then(function(t){e(t)},function(t){1===t.code?e(!1):n(t)})})}function p(t){return u(n(t)).then(function(){return c(t,{create:!0})})}function w(t){return c(t).then(function(t){return t.toURL()})}function v(t,e){return e=e||"readAsText",c(t).then(function(t){return new E(function(n,o){t.file(function(t){var o=new FileReader;o.onloadend=function(){n(this.result)},o[e](t)},o)})})}function m(t){return v(t,"readAsDataURL")}function _(t){return v(t).then(JSON.parse)}function y(t,e,o){return u(n(t)).then(function(){return c(t,{create:!0})}).then(function(t){return new E(function(n,r){t.createWriter(function(t){t.onwriteend=n,t.onerror=r,"string"==typeof e?e=g([e],o||"text/plain"):e instanceof Blob!=!0&&(e=g([JSON.stringify(e,null,4)],o||"application/json")),t.write(e)},r)})})}function g(t,e){var n,o;try{return new Blob(t,{type:e})}catch(r){if(n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)return o=new n,o.append(t),o.getBlob(e);throw new Error("Unable to create blob")}}function R(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new E(function(r,i){t.moveTo(n,o(e),r,i)})})})}function b(t,e){return t=t.replace(/\/$/,""),e=e.replace(/\/$/,""),u(n(e)).then(function(n){return f(t).then(function(t){return new E(function(r,i){t.moveTo(n,o(e),r,i)})})})}function U(t,e){return u(n(e)).then(function(n){return c(t).then(function(t){return new E(function(r,i){t.copyTo(n,o(e),r,i)})})})}function L(t,e){var n=e?c:d;return new E(function(e,o){n(t).then(function(t){t!==!1?t.remove(e,o):e(1)},o)}).then(function(t){return 1===t?!1:!0})}function T(t){return f(t).then(function(t){return new E(function(e,n){t.removeRecursively(e,n)})})}function D(){for(;i.length>0&&a0?setTimeout(O,d):O()}};s.retry.unshift(0),a++,f()});return f.then(O,O),f.progress=function(t){return c.onprogress=t,f},f.abort=function(){return c._aborted=!0,c.abort(),f},f}function S(t,e,n,o){return I(!0,t,e,n,o)}function x(t,e,n,o){return I(!1,e,t,n,o)}var E=t.Promise||window.Promise;if(!E)throw new Error("No Promise library given in options.Promise");t=t||{},t.persistent=void 0!==t.persistent?t.persistent:!0,t.storageSize=t.storageSize||20971520,t.concurrency=t.concurrency||3,t.retry=t.retry||[],t.debug=!!t.debug;var M,B="undefined"!=typeof cordova;B?M=new E(function(t,e){document.addEventListener("deviceready",t,!1),setTimeout(function(){e(new Error("deviceready has not fired after 5 seconds."))},5100)}):(M=s(!0),"undefined"!=typeof webkitRequestFileSystem?(window.requestFileSystem=webkitRequestFileSystem,window.FileTransfer=function(){},FileTransfer.prototype.download=function(t,e,n,o){var r=new XMLHttpRequest;return r.open("GET",t),r.responseType="blob",r.onreadystatechange=function(){4==r.readyState&&(200!==r.status||this._aborted?o(r.status):y(e,r.response).then(n,o))},r.send(),r},FileTransfer.prototype.abort=function(){this._aborted=!0},window.ProgressEvent=function(){},window.FileEntry=function(){}):window.requestFileSystem=function(t,e,n,o){o(new Error("requestFileSystem not supported!"))});var C=new E(function(e,n){M.then(function(){var o=t.persistent?1:0;t.fileSystem&&B&&(o=t.fileSystem),!B&&1===o&&navigator.webkitPersistentStorage?navigator.webkitPersistentStorage.requestQuota(t.storageSize,function(t){window.requestFileSystem(o,t,e,n)},n):isNaN(o)?window.resolveLocalFileSystemURL(o,function(t){e(t.filesystem)},n):window.requestFileSystem(o,t.storageSize,e,n),setTimeout(function(){n(new Error("Could not retrieve FileSystem after 5 seconds."))},5100)},n)});C.then(function(t){CDV_URL_ROOT=t.root.toURL(),CDV_INTERNAL_URL_ROOT=B?t.root.toInternalURL():CDV_URL_ROOT,window.__fs=t},function(t){console.error("Could not get Cordova FileSystem:",t)});var F,A,P;return CDV_INTERNAL_URL_ROOT="cdvfile://localhost/"+(t.persistent?"persistent/":"temporary/"),CDV_URL_ROOT="",B?(A=function(t){return t=r(t),t.indexOf("://")<0?CDV_INTERNAL_URL_ROOT+t:t},P=function(t){return t=r(t),t.indexOf("://")<0?CDV_URL_ROOT+t:t},F=function(t){return c(t).then(function(t){return t.toInternalURL()})}):(A=function(e){return e=r(e),"filesystem:"+location.origin+(t.persistent?"/persistent/":"/temporary/")+e},F=function(t){return c(t).then(function(t){return t.toURL()})},P=A),{fs:C,normalize:r,file:c,filename:o,dir:f,dirname:n,create:p,read:v,readJSON:_,write:y,move:R,moveDir:b,copy:U,remove:L,removeDir:T,list:l,ensure:u,exists:d,existsDir:h,download:S,upload:x,toURL:w,isCordova:B,toInternalURLSync:A,toInternalURL:F,toDataURL:m,deviceready:M,options:t,Promise:E}}},function(t,e,n){(function(e){!function(n,o){function r(t,e){return(typeof e)[0]==t}function i(t,e){return e=function s(u,c,f,l,d,h){function p(t){return function(e){d&&(d=0,s(r,t,e))}}if(l=s.q,u!=r)return i(function(t,e){l.push({p:this,r:t,j:e,1:u,0:c})});if(f&&r(n,f)|r(o,f))try{d=f.then}catch(t){c=0,f=t}if(r(n,d))try{d.call(f,p(1),c=p(0))}catch(t){c(t)}else for(e=function(e,o){return r(n,e=c?e:o)?i(function(t,n){a(this,t,n,f,e)}):t},h=0;h=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var n=c++,o=arguments.length<2?!1:s.call(arguments,1);return u[n]=!0,i(function(){u[n]&&(o?t.apply(null,o):t.call(null),e.clearImmediate(n))}),n},e.clearImmediate="function"==typeof o?o:function(t){delete u[t]}}).call(e,n(6).setImmediate,n(6).clearImmediate)},function(t){function e(){u=!1,i.length?s=i.concat(s):c=-1,s.length&&n()}function n(){if(!u){var t=setTimeout(e);u=!0;for(var n=s.length;n;){for(i=s,s=[];++c1)for(var r=1;r