diff --git a/.env.example b/.env.example new file mode 100644 index 0000000000000000000000000000000000000000..b2583f29ee76d5e2d71ef6ab7b2a496c534b1d07 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# Telegram Bot Token +BOT_TOKEN=7844002660:AAH8N_0z6qZ9vW... # Replace with your actual token + +# App URL (usually your Hugging Face space URL) +APP_URL=https://alexainc-aurudu-krida.hf.space + +# Port (optional, defaults to 7860) +PORT=7860 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..ebf8c50f515a6bbda512399e88f15f64c934ce02 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +*.apk filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.ogg filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..20866d75fe643069b54aa0c91b9286d852982666 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +node_modules/ +.env +.env.local +db.json +*.log +.DS_Store +dist/ +build/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..7b73434d81878d41f077c7a634bbe878dd28458f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Use Node.js latest LTS +FROM node:20-slim + +# Create and define the application's working directory +WORKDIR /app + +# Copy package files and install dependencies +COPY package*.json ./ +RUN npm install --production + +# Copy the rest of the application code +COPY . . + +# Expose the default Hugging Face Spaces port +EXPOSE 7860 + +# Start the application +CMD ["node", "server/index.js"] diff --git a/apk_tree.txt b/apk_tree.txt new file mode 100644 index 0000000000000000000000000000000000000000..a179d29349ff481862c141da3ede34375653f73f Binary files /dev/null and b/apk_tree.txt differ diff --git a/assets/www/c2runtime.js b/assets/www/c2runtime.js new file mode 100644 index 0000000000000000000000000000000000000000..4707489618bd3e681133bcdb151c66d0563b8d8d --- /dev/null +++ b/assets/www/c2runtime.js @@ -0,0 +1,652 @@ +// Generated by Construct 2, the HTML5 game and app creator :: https://www.construct.net +'use strict';var y,aa,ba,ea,ga,ia,ka,ma,na,oa,pa,qa,sa,ta,ua,va,xa,ya,za,Aa,Ca,Fa,Ga,Ja,La,Ma,I,Na,Oa,Pa,Qa,Ra,Ua,Va,Wa,cb,db,fb,gb,hb,ib,pb,tb,vb,wb,xb,yb,zb,Ab,Ib,Ob,Pb,Qb,Rb,Sb,Xb,Yb,Zb,$b,ac,bc,cc,dc,ec,fc,gc,hc,ic,jc,kc,lc,mc,nc,oc,pc,qc,rc,sc,tc,uc,vc,wc,zc,Hc,Ic,Jc,Kc,Lc,Mc,Nc,Oc,Pc,Qc,Rc,Wc,Xc,Yc,Zc,$c,ad,bd,cd,dd,ed={},fd={};"function"!==typeof Object.getPrototypeOf&&(Object.getPrototypeOf="object"===typeof"test".__proto__?function(a){return a.__proto__}:function(a){return a.constructor.prototype}); +(function(){function a(a,g,b,c){this.set(a,g,b,c)}function c(){this.fd=this.ed=this.hd=this.gd=this.sd=this.rd=this.Fc=this.Ec=0}function b(a,g,b,c){ac?g:c):(u=ab?g:b):bc?a:c):(u=gb?a:b)}function d(){this.items=this.Uf=null;this.xk=0;D&&(this.Uf=new Set);this.Gj=[];this.Zg=!0}function f(a){F[B++]=a}function h(){this.Da=this.$n=this.y=this.F=0}function e(a){this.hc=[];this.Ql=this.Sl=this.Tl=this.Rl=0;this.cm=null;this.kl(a)}function g(a, +g){this.Po=a;this.Oo=g;this.cells={}}function l(a,g){this.Po=a;this.Oo=g;this.cells={}}function m(a,g,b){var c;return E.length?(c=E.pop(),c.sp=a,c.x=g,c.y=b,c):new aa(a,g,b)}function k(a,g,b){this.sp=a;this.x=g;this.y=b;this.Nc=new ba}function n(a,g,b){var c;return w.length?(c=w.pop(),c.sp=a,c.x=g,c.y=b,c):new ea(a,g,b)}function p(a,g,b){this.sp=a;this.x=g;this.y=b;this.Nc=[];this.dj=!0;this.Qf=new ba;this.Pj=!1}function q(a,g){return a.uf-g.uf}ga=function(a){window.console&&window.console.log&&window.console.log(a)}; +ia=function(a){window.console&&window.console.error&&window.console.error(a)};ka=function(a){return"undefined"===typeof a};ma=function(a){return"number"===typeof a};na=function(a){return"string"===typeof a};oa=function(a){return 0g;g<<=1)a=a|a>>g;return a+1};qa=function(a){return 0>a?-a:a};sa=function(a,g){return am)return!1;gm)return!1;f=k-a+e-b;n=d-g+l-c;a=b-a;g=c-g;k=e-k;d=l-d;l=qa(g*k-d*a);return qa(k*n-d*f)>l?!1:qa(a*n-g*f)<=l};a.prototype.set=function(a,g,b,c){this.left=a;this.top=g;this.right=b;this.bottom=c};a.prototype.Oi=function(a){this.left=a.left;this.top=a.top;this.right=a.right;this.bottom=a.bottom};a.prototype.width=function(){return this.right-this.left};a.prototype.height= +function(){return this.bottom-this.top};a.prototype.offset=function(a,g){this.left+=a;this.top+=g;this.right+=a;this.bottom+=g;return this};a.prototype.normalize=function(){var a=0;this.left>this.right&&(a=this.left,this.left=this.right,this.right=a);this.top>this.bottom&&(a=this.top,this.top=this.bottom,this.bottom=a)};a.prototype.iz=function(a){return!(a.rightthis.right||a.top>this.bottom)};a.prototype.jz=function(a,g,b){return!(a.right+gthis.right||a.top+b>this.bottom)};a.prototype.vd=function(a,g){return a>=this.left&&a<=this.right&&g>=this.top&&g<=this.bottom};a.prototype.Xj=function(a){return this.left===a.left&&this.top===a.top&&this.right===a.right&&this.bottom===a.bottom};ya=a;c.prototype.jl=function(a){this.Ec=a.left;this.Fc=a.top;this.rd=a.right;this.sd=a.top;this.gd=a.right;this.hd=a.bottom;this.ed=a.left;this.fd=a.bottom};c.prototype.ou=function(a,g){if(0===g)this.jl(a);else{var b=Math.sin(g),c=Math.cos(g), +k=a.left*b,d=a.top*b,e=a.right*b,b=a.bottom*b,l=a.left*c,f=a.top*c,n=a.right*c,c=a.bottom*c;this.Ec=l-d;this.Fc=f+k;this.rd=n-d;this.sd=f+e;this.gd=n-b;this.hd=c+e;this.ed=l-b;this.fd=c+k}};c.prototype.offset=function(a,g){this.Ec+=a;this.Fc+=g;this.rd+=a;this.sd+=g;this.gd+=a;this.hd+=g;this.ed+=a;this.fd+=g;return this};var u=0,t=0;c.prototype.Mr=function(a){b(this.Ec,this.rd,this.gd,this.ed);a.left=u;a.right=t;b(this.Fc,this.sd,this.hd,this.fd);a.top=u;a.bottom=t};c.prototype.vd=function(a,g){var b= +this.Ec,c=this.Fc,k=this.rd-b,d=this.sd-c,e=this.gd-b,l=this.hd-c,f=a-b,n=g-c,m=k*k+d*d,h=k*e+d*l,d=k*f+d*n,q=e*e+l*l,p=e*f+l*n,r=1/(m*q-h*h),k=(q*d-h*p)*r,m=(m*p-h*d)*r;if(0<=k&&0k+m)return!0;k=this.ed-b;d=this.fd-c;m=k*k+d*d;h=k*e+d*l;d=k*f+d*n;r=1/(m*q-h*h);k=(q*d-h*p)*r;m=(m*p-h*d)*r;return 0<=k&&0k+m};c.prototype.Xg=function(a,g){if(g)switch(a){case 0:return this.Ec;case 1:return this.rd;case 2:return this.gd;case 3:return this.ed;case 4:return this.Ec;default:return this.Ec}else switch(a){case 0:return this.Fc; +case 1:return this.sd;case 2:return this.hd;case 3:return this.fd;case 4:return this.Fc;default:return this.Fc}};c.prototype.wh=function(){return(this.Ec+this.rd+this.gd+this.ed)/4};c.prototype.xh=function(){return(this.Fc+this.sd+this.hd+this.fd)/4};c.prototype.Es=function(a){var g=a.wh(),b=a.xh();if(this.vd(g,b))return!0;g=this.wh();b=this.xh();if(a.vd(g,b))return!0;var c,k,d,e,l,f,n,m;for(n=0;4>n;n++)for(m=0;4>m;m++)if(g=this.Xg(n,!0),b=this.Xg(n,!1),c=this.Xg(n+1,!0),k=this.Xg(n+1,!1),d=a.Xg(m, +!0),e=a.Xg(m,!1),l=a.Xg(m+1,!0),f=a.Xg(m+1,!1),xa(g,b,c,k,d,e,l,f))return!0;return!1};za=c;Aa=function(a,g,b){return Math.max(Math.min(a,255),0)|Math.max(Math.min(g,255),0)<<8|Math.max(Math.min(b,255),0)<<16};Ca=function(a){return a&255};Fa=function(a){return(a&65280)>>8};Ga=function(a){return(a&16711680)>>16};Ja=function(a,g){for(var b in g)g.hasOwnProperty(b)&&(a[b]=g[b]);return a};La=function(a,g){var b,c;g=ua(g);if(!(0>g||g>=a.length)){b=g;for(c=a.length-1;bb?b:a};Ua=function(a){return a/(180/ta)};Va=function(a){return 180/ta*a};Wa=function(a){a%=360;0>a&&(a+=360);return a};cb=function(a){a%=2*ta;0>a&&(a+=2*ta);return a};db=function(a){return Wa(Va(a))}; +fb=function(a){return cb(Ua(a))};gb=function(a,g,b,c){return Math.atan2(c-g,b-a)};hb=function(a,g){if(a===g)return 0;var b=Math.sin(a),c=Math.cos(a),k=Math.sin(g),d=Math.cos(g),b=b*k+c*d;return 1<=b?0:-1>=b?ta:Math.acos(b)};ib=function(a,g,b){var c=Math.sin(a),k=Math.cos(a),d=Math.sin(g),e=Math.cos(g);return Math.acos(c*d+k*e)>b?0=c*k-b*d};tb=function(a,g,b,c,k,d){if(0===b)return d? +a:g;var e=Math.sin(b);b=Math.cos(b);a-=c;g-=k;var l=a*e;a=a*b-g*e;g=g*b+l;return d?a+c:g+k};vb=function(a,g,b,c){a=b-a;g=c-g;return Math.sqrt(a*a+g*g)};wb=function(a,g){return!a!==!g};xb=function(a){for(var g in a)if(a.hasOwnProperty(g))return!0;return!1};yb=function(a){for(var g in a)a.hasOwnProperty(g)&&delete a[g]};var v=+new Date;zb=function(){if("undefined"!==typeof window.performance){var a=window.performance;if("undefined"!==typeof a.now)return a.now();if("undefined"!==typeof a.webkitNow)return a.webkitNow(); +if("undefined"!==typeof a.mozNow)return a.mozNow();if("undefined"!==typeof a.msNow)return a.msNow()}return Date.now()-v};var r=!1,x=r=!1,A=!1;"undefined"!==typeof window&&(r=/chrome/i.test(navigator.userAgent)||/chromium/i.test(navigator.userAgent),r=!r&&/safari/i.test(navigator.userAgent),x=/(iphone|ipod|ipad)/i.test(navigator.userAgent),A=window.c2ejecta);var D=!r&&!A&&!x&&"undefined"!==typeof Set&&"undefined"!==typeof Set.prototype.forEach;d.prototype.contains=function(a){return this.pg()?!1:D? +this.Uf.has(a):this.items&&this.items.hasOwnProperty(a)};d.prototype.add=function(a){if(D)this.Uf.has(a)||(this.Uf.add(a),this.Zg=!1);else{var g=a.toString(),b=this.items;b?b.hasOwnProperty(g)||(b[g]=a,this.xk++,this.Zg=!1):(this.items={},this.items[g]=a,this.xk=1,this.Zg=!1)}};d.prototype.remove=function(a){if(!this.pg())if(D)this.Uf.has(a)&&(this.Uf["delete"](a),this.Zg=!1);else if(this.items){a=a.toString();var g=this.items;g.hasOwnProperty(a)&&(delete g[a],this.xk--,this.Zg=!1)}};d.prototype.clear= +function(){this.pg()||(D?this.Uf.clear():(this.items=null,this.xk=0),I(this.Gj),this.Zg=!0)};d.prototype.pg=function(){return 0===this.count()};d.prototype.count=function(){return D?this.Uf.size:this.xk};var F=null,B=0;d.prototype.MA=function(){if(!this.Zg){if(D)I(this.Gj),F=this.Gj,B=0,this.Uf.forEach(f),F=null,B=0;else{var a=this.Gj;I(a);var g,b=0,c=this.items;if(c)for(g in c)c.hasOwnProperty(g)&&(a[b++]=c[g])}this.Zg=!0}};d.prototype.tf=function(){this.MA();return this.Gj};ba=d;new ba;Ab=function(a, +g){D?Ib(a,g.Uf):Ob(a,g.tf())};Ib=function(a,g){var b,c,k,d;c=b=0;for(k=a.length;bb&&(b=d),ek&&(k=e);this.Rl=g;this.Sl=b;this.Tl=c;this.Ql=k};e.prototype.jl=function(a,g,b){this.hc.length=8;this.Ae=4;var c=this.hc;c[0]=a.left-g;c[1]=a.top-b;c[2]=a.right-g;c[3]=a.top-b;c[4]=a.right-g;c[5]=a.bottom-b;c[6]=a.left-g;c[7]=a.bottom- +b;this.Yl=a.right-a.left;this.Xl=a.bottom-a.top;this.kb()};e.prototype.Aj=function(a,g,b,c,k){this.hc.length=8;this.Ae=4;var d=this.hc;d[0]=a.Ec-g;d[1]=a.Fc-b;d[2]=a.rd-g;d[3]=a.sd-b;d[4]=a.gd-g;d[5]=a.hd-b;d[6]=a.ed-g;d[7]=a.fd-b;this.Yl=c;this.Xl=k;this.kb()};e.prototype.nu=function(a){this.Ae=a.Ae;Na(this.hc,a.hc);this.Rl=a.Rl;this.Tl=a.Tl;this.Sl=a.Sl;this.Ql=a.Ql};e.prototype.Qh=function(a,g,b){if(this.Yl!==a||this.Xl!==g||this.Pr!==b){this.Yl=a;this.Xl=g;this.Pr=b;var c,k,d,e,l,f=0,n=1,m=this.Yt, +h=this.hc;0!==b&&(f=Math.sin(b),n=Math.cos(b));b=0;for(d=this.Ae;bE.length&&E.push(l),this.cells[c][d]=null);if(b)for(c=b.left,k=b.right;c<=k;++c)for(d=b.top,e=b.bottom;d<=e;++d)g&&g.vd(c,d)||this.jh(c,d,!0).zp(a)};g.prototype.In=function(a,g){var b,c,k,d,e,l;b=this.Fd(a.left);k=this.Gd(a.top);c=this.Fd(a.right);for(e=this.Gd(a.bottom);b<= +c;++b)for(d=k;d<=e;++d)(l=this.jh(b,d,!1))&&l.dump(g)};Sb=g;l.prototype.jh=function(a,g,b){var c;c=this.cells[a];return c?(c=c[g])?c:b?(c=n(this,a,g),this.cells[a][g]=c):null:b?(c=n(this,a,g),this.cells[a]={},this.cells[a][g]=c):null};l.prototype.Fd=function(a){return ua(a/this.Po)};l.prototype.Gd=function(a){return ua(a/this.Oo)};l.prototype.update=function(a,g,b){var c,k,d,e,l;if(g)for(c=g.left,k=g.right;c<=k;++c)for(d=g.top,e=g.bottom;d<=e;++d)if(!b||!b.vd(c,d))if(l=this.jh(c,d,!1))l.remove(a), +l.pg()&&(l.reset(),1E3>w.length&&w.push(l),this.cells[c][d]=null);if(b)for(c=b.left,k=b.right;c<=k;++c)for(d=b.top,e=b.bottom;d<=e;++d)g&&g.vd(c,d)||this.jh(c,d,!0).zp(a)};l.prototype.In=function(a,g,b,c,k){var d,e;a=this.Fd(a);g=this.Gd(g);b=this.Fd(b);for(d=this.Gd(c);a<=b;++a)for(c=g;c<=d;++c)(e=this.jh(a,c,!1))&&e.dump(k)};l.prototype.Bz=function(a){var g,b,c,k,d;g=a.left;c=a.top;b=a.right;for(k=a.bottom;g<=b;++g)for(a=c;a<=k;++a)if(d=this.jh(g,a,!1))d.dj=!1};Xb=l;var E=[];k.prototype.pg=function(){return this.Nc.pg()}; +k.prototype.zp=function(a){this.Nc.add(a)};k.prototype.remove=function(a){this.Nc.remove(a)};k.prototype.dump=function(a){Oa(a,this.Nc.tf())};aa=k;var w=[];p.prototype.pg=function(){if(!this.Nc.length)return!0;if(this.Nc.length>this.Qf.count())return!1;this.fp();return!0};p.prototype.zp=function(a){this.Qf.contains(a)?(this.Qf.remove(a),this.Qf.pg()&&(this.Pj=!1)):this.Nc.length?(this.Nc[this.Nc.length-1].Jf()>a.Jf()&&(this.dj=!1),this.Nc.push(a)):(this.Nc.push(a),this.dj=!0)};p.prototype.remove= +function(a){this.Qf.add(a);this.Pj=!0;30<=this.Qf.count()&&this.fp()};p.prototype.fp=function(){this.Pj&&(this.Qf.count()===this.Nc.length?this.reset():(Ab(this.Nc,this.Qf),this.Qf.clear(),this.Pj=!1))};p.prototype.Qx=function(){this.dj||(this.Nc.sort(q),this.dj=!0)};p.prototype.reset=function(){I(this.Nc);this.dj=!0;this.Qf.clear();this.Pj=!1};p.prototype.dump=function(a){this.fp();this.Qx();this.Nc.length&&a.push(this.Nc)};ea=p;var z="lighter xor copy destination-over source-in destination-in source-out destination-out source-atop destination-atop".split(" "); +Yb=function(a){return 0>=a||11<=a?"source-over":z[a-1]};Zb=function(a,g,b){if(b)switch(a.od=b.ONE,a.jd=b.ONE_MINUS_SRC_ALPHA,g){case 1:a.od=b.ONE;a.jd=b.ONE;break;case 3:a.od=b.ONE;a.jd=b.ZERO;break;case 4:a.od=b.ONE_MINUS_DST_ALPHA;a.jd=b.ONE;break;case 5:a.od=b.DST_ALPHA;a.jd=b.ZERO;break;case 6:a.od=b.ZERO;a.jd=b.SRC_ALPHA;break;case 7:a.od=b.ONE_MINUS_DST_ALPHA;a.jd=b.ZERO;break;case 8:a.od=b.ZERO;a.jd=b.ONE_MINUS_SRC_ALPHA;break;case 9:a.od=b.DST_ALPHA;a.jd=b.ONE_MINUS_SRC_ALPHA;break;case 10:a.od= +b.ONE_MINUS_DST_ALPHA,a.jd=b.SRC_ALPHA}};$b=function(a){return Math.round(1E6*a)/1E6};ac=function(a,g){return"string"!==typeof a||"string"!==typeof g||a.length!==g.length?!1:a===g?!0:a.toLowerCase()===g.toLowerCase()};bc=function(a){a=a.target;return!a||a===document||a===window||document&&document.body&&a===document.body||ac(a.tagName,"canvas")?!0:!1}})();var qd="undefined"!==typeof Float32Array?Float32Array:Array;function rd(a){var c=new qd(3);a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2]);return c} +function sd(a){var c=new qd(16);a&&(c[0]=a[0],c[1]=a[1],c[2]=a[2],c[3]=a[3],c[4]=a[4],c[5]=a[5],c[6]=a[6],c[7]=a[7],c[8]=a[8],c[9]=a[9],c[10]=a[10],c[11]=a[11],c[12]=a[12],c[13]=a[13],c[14]=a[14],c[15]=a[15]);return c}function td(a,c){c[0]=a[0];c[1]=a[1];c[2]=a[2];c[3]=a[3];c[4]=a[4];c[5]=a[5];c[6]=a[6];c[7]=a[7];c[8]=a[8];c[9]=a[9];c[10]=a[10];c[11]=a[11];c[12]=a[12];c[13]=a[13];c[14]=a[14];c[15]=a[15]} +function ud(a,c){var b=c[0],d=c[1];c=c[2];a[0]*=b;a[1]*=b;a[2]*=b;a[3]*=b;a[4]*=d;a[5]*=d;a[6]*=d;a[7]*=d;a[8]*=c;a[9]*=c;a[10]*=c;a[11]*=c} +function vd(a,c,b,d){d||(d=sd());var f,h,e,g,l,m,k,n,p=a[0],q=a[1];a=a[2];h=b[0];e=b[1];f=b[2];b=c[1];m=c[2];p===c[0]&&q===b&&a===m?(a=d,a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1):(b=p-c[0],m=q-c[1],k=a-c[2],n=1/Math.sqrt(b*b+m*m+k*k),b*=n,m*=n,k*=n,c=e*k-f*m,f=f*b-h*k,h=h*m-e*b,(n=Math.sqrt(c*c+f*f+h*h))?(n=1/n,c*=n,f*=n,h*=n):h=f=c=0,e=m*h-k*f,g=k*c-b*h,l=b*f-m*c,(n=Math.sqrt(e*e+g*g+l*l))?(n=1/n,e*=n,g*=n,l*=n):l=g=e=0, +d[0]=c,d[1]=e,d[2]=b,d[3]=0,d[4]=f,d[5]=g,d[6]=m,d[7]=0,d[8]=h,d[9]=l,d[10]=k,d[11]=0,d[12]=-(c*p+f*q+h*a),d[13]=-(e*p+g*q+l*a),d[14]=-(b*p+m*q+k*a),d[15]=1)} +(function(){function a(a,b,c){this.qg=/msie/i.test(navigator.userAgent)||/trident/i.test(navigator.userAgent);this.height=this.width=0;this.Gb=!!c;this.Om=this.pk=!1;this.Uo=0;this.so=1;this.dr=1E3;this.TA=(this.dr-this.so)/32768;this.Mo=rd([0,0,100]);this.Us=rd([0,0,0]);this.Nu=rd([0,1,0]);this.Bl=rd([1,1,1]);this.cs=!0;this.ln=sd();this.xe=sd();this.Op=sd();this.To=sd();this.la=a;this.version=0===this.la.getParameter(this.la.VERSION).indexOf("WebGL 2")?2:1;this.As()}function c(a,b,c){this.la=a; +this.ll=b;this.name=c;this.Me=a.getAttribLocation(b,"aPos");this.uh=a.getAttribLocation(b,"aTex");this.Ss=a.getUniformLocation(b,"matP");this.gn=a.getUniformLocation(b,"matMV");this.mj=a.getUniformLocation(b,"opacity");this.Vp=a.getUniformLocation(b,"colorFill");this.Ts=a.getUniformLocation(b,"samplerFront");this.Ok=a.getUniformLocation(b,"samplerBack");this.mi=a.getUniformLocation(b,"destStart");this.li=a.getUniformLocation(b,"destEnd");this.Qk=a.getUniformLocation(b,"seconds");this.Xp=a.getUniformLocation(b, +"pixelWidth");this.Wp=a.getUniformLocation(b,"pixelHeight");this.Nk=a.getUniformLocation(b,"layerScale");this.Mk=a.getUniformLocation(b,"layerAngle");this.Rk=a.getUniformLocation(b,"viewOrigin");this.Pk=a.getUniformLocation(b,"scrollPos");this.dz=!!(this.Xp||this.Wp||this.Qk||this.Ok||this.mi||this.li||this.Nk||this.Mk||this.Rk||this.Pk);this.ct=this.dt=-999;this.kn=1;this.Ys=this.Xs=0;this.$s=this.Ws=this.Vs=1;this.gt=this.ft=this.et=this.it=this.ht=this.Zs=0;this.Mp=[];this.bt=sd();this.mj&&a.uniform1f(this.mj, +1);this.Vp&&a.uniform4f(this.Vp,1,1,1,1);this.Ts&&a.uniform1i(this.Ts,0);this.Ok&&a.uniform1i(this.Ok,1);this.mi&&a.uniform2f(this.mi,0,0);this.li&&a.uniform2f(this.li,1,1);this.Nk&&a.uniform1f(this.Nk,1);this.Mk&&a.uniform1f(this.Mk,0);this.Rk&&a.uniform2f(this.Rk,0,0);this.Pk&&a.uniform2f(this.Pk,0,0);this.Qk&&a.uniform1f(this.Qk,0);this.bi=!1}function b(a,b){return a[0]===b[0]&&a[1]===b[1]&&a[2]===b[2]&&a[3]===b[3]&&a[4]===b[4]&&a[5]===b[5]&&a[6]===b[6]&&a[7]===b[7]&&a[8]===b[8]&&a[9]===b[9]&& +a[10]===b[10]&&a[11]===b[11]&&a[12]===b[12]&&a[13]===b[13]&&a[14]===b[14]&&a[15]===b[15]}function d(a,b){this.type=a;this.ga=b;this.la=b.la;this.Kf=this.Dd=this.Ht=0;this.Pa=this.We=null;this.pu=[]}var f=sd();a.prototype.As=function(){var a=this.la,b;this.Ns=1;this.ii=this.ph=null;this.hm=1;a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT);a.enable(a.BLEND);a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA);a.disable(a.CULL_FACE);a.disable(a.STENCIL_TEST);a.disable(a.DITHER);this.Gb?(a.enable(a.DEPTH_TEST), +a.depthFunc(a.LEQUAL)):a.disable(a.DEPTH_TEST);this.Os=a.ONE;this.Ms=a.ONE_MINUS_SRC_ALPHA;this.po=new Float32Array(8E3*(this.Gb?3:2));this.bo=new Float32Array(16E3);this.Tt=new Float32Array(32E3);this.oq=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,this.oq);a.bufferData(a.ARRAY_BUFFER,this.Tt.byteLength,a.DYNAMIC_DRAW);this.zl=Array(4);this.ql=Array(4);for(b=0;4>b;b++)this.zl[b]=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,this.zl[b]),a.bufferData(a.ARRAY_BUFFER,this.po.byteLength,a.DYNAMIC_DRAW), +this.ql[b]=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,this.ql[b]),a.bufferData(a.ARRAY_BUFFER,this.bo.byteLength,a.DYNAMIC_DRAW);this.hg=0;this.gz=a.createBuffer();a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.gz);for(var c=new Uint16Array(12E3),k=b=0;12E3>b;)c[b++]=k,c[b++]=k+1,c[b++]=k+2,c[b++]=k,c[b++]=k+2,c[b++]=k+3,k+=4;a.bufferData(a.ELEMENT_ARRAY_BUFFER,c,a.STATIC_DRAW);this.pq=this.Dj=this.Lg=0;this.Yb=[];b=this.Gb?"attribute highp vec3 aPos;\nattribute mediump vec2 aTex;\nvarying mediump vec2 vTex;\nuniform highp mat4 matP;\nuniform highp mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPos.x, aPos.y, aPos.z, 1.0);\n\tvTex = aTex;\n}": +"attribute highp vec2 aPos;\nattribute mediump vec2 aTex;\nvarying mediump vec2 vTex;\nuniform highp mat4 matP;\nuniform highp mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPos.x, aPos.y, 0.0, 1.0);\n\tvTex = aTex;\n}";c=this.Uj({src:"varying mediump vec2 vTex;\nuniform lowp float opacity;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, vTex);\n\tgl_FragColor *= opacity;\n}"},b,"");this.Yb.push(c);c=this.Uj({src:"uniform mediump sampler2D samplerFront;\nvarying lowp float opacity;\nvoid main(void) {\n\tgl_FragColor = texture2D(samplerFront, gl_PointCoord);\n\tgl_FragColor *= opacity;\n}"}, +"attribute vec4 aPos;\nvarying float opacity;\nuniform mat4 matP;\nuniform mat4 matMV;\nvoid main(void) {\n\tgl_Position = matP * matMV * vec4(aPos.x, aPos.y, 0.0, 1.0);\n\tgl_PointSize = aPos.z;\n\topacity = aPos.w;\n}","");this.Yb.push(c);c=this.Uj({src:"varying mediump vec2 vTex;\nuniform lowp sampler2D samplerFront;\nvoid main(void) {\n\tif (texture2D(samplerFront, vTex).a < 1.0)\n\t\tdiscard;\n}"},b,"");this.Yb.push(c);c=this.Uj({src:"uniform lowp vec4 colorFill;\nvoid main(void) {\n\tgl_FragColor = colorFill;\n}"}, +b,"");this.Yb.push(c);for(var d in wd)wd.hasOwnProperty(d)&&this.Yb.push(this.Uj(wd[d],b,d));a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,null);this.Yg=[];this.fg=0;this.kd=!1;this.Yr=this.Ek=-1;this.Qi=null;this.ep=a.createFramebuffer();this.mm=this.Jn=null;this.Jr=!1;this.Gb&&(this.mm=a.createRenderbuffer());this.Eh=rd([0,0,0]);this.kt=a.getParameter(a.ALIASED_POINT_SIZE_RANGE)[1];2048"===b.name&&a.vertexAttribPointer(b.Me,4,a.FLOAT,!1,0,0));if(0"!== +b.name&&a.vertexAttribPointer(b.Me,this.Gb?3:2,a.FLOAT,!1,0,0);a.bindBuffer(a.ARRAY_BUFFER,this.ql[this.hg]);a.bufferSubData(a.ARRAY_BUFFER,0,this.bo.subarray(0,this.Dj));b&&0<=b.uh&&""!==b.name&&a.vertexAttribPointer(b.uh,2,a.FLOAT,!1,0,0)}for(var c,a=0,b=this.fg;ac||0>d)){var e=this.ke();e.type=7;e.Dd=1;e.Pa||(e.Pa=sd());e.Pa[0]=a;e.Pa[1]=b;e.Pa[2]=c;e.Pa[3]=d;this.kd=!1}};a.prototype.ju=function(a){if(this.Gb&&(a=!!a,this.pk!==a)){var b=this.ke();b.type=14;b.Dd=a?1:0;this.kd=!1;this.pk= +a;this.Jn=null;this.pk?this.Td(2):this.Td(0)}};a.prototype.iu=function(a){if(this.Gb){var b=this.ke();b.type=13;b.Dd=a?1:0;this.kd=!1}};a.prototype.ms=function(){td(this.Op,f);this.Se();this.De();var a=this.width/2,b=this.height/2;this.fl(-a,b,a,b,a,-b,-a,-b);td(f,this.xe);this.De()};a.prototype.hu=function(a,b,c){this.Td(3);var d=this.ke();d.type=12;d.Pa||(d.Pa=sd());d.Pa[0]=a;d.Pa[1]=b;d.Pa[2]=c;d.Pa[3]=1;this.kd=!1};a.prototype.uA=function(){this.Td(0)};a.prototype.fA=function(){this.Td(2)};a.prototype.Wz= +function(){this.fh();this.la.flush()};var h=[],e={};a.prototype.cx=function(){I(h);e={}};a.prototype.cn=function(a,b,c,d){b=!!b;c=!!c;var f=a.src+","+b+","+c+(b?",undefined":""),p=null;if("undefined"!==typeof a.src&&e.hasOwnProperty(f))return p=e[f],p.Wl++,p;this.fh();var q=this.la,u=oa(a.width)&&oa(a.height),p=q.createTexture();q.bindTexture(q.TEXTURE_2D,p);q.pixelStorei(q.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);var t=q.RGBA,v=q.RGBA,r=q.UNSIGNED_BYTE;if(d&&!this.qg)switch(d){case 1:v=t=q.RGB;break;case 2:r= +q.UNSIGNED_SHORT_4_4_4_4;break;case 3:r=q.UNSIGNED_SHORT_5_5_5_1;break;case 4:v=t=q.RGB,r=q.UNSIGNED_SHORT_5_6_5}if(1===this.version&&!u&&b){d=document.createElement("canvas");d.width=pa(a.width);d.height=pa(a.height);var x=d.getContext("2d");"undefined"!==typeof x.imageSmoothingEnabled?x.imageSmoothingEnabled=c:(x.webkitImageSmoothingEnabled=c,x.mozImageSmoothingEnabled=c,x.msImageSmoothingEnabled=c);x.drawImage(a,0,0,a.width,a.height,0,0,d.width,d.height);q.texImage2D(q.TEXTURE_2D,0,t,v,r,d)}else q.texImage2D(q.TEXTURE_2D, +0,t,v,r,a);b?(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_S,q.REPEAT),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_T,q.REPEAT)):(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_S,q.CLAMP_TO_EDGE),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_WRAP_T,q.CLAMP_TO_EDGE));c?(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MAG_FILTER,q.LINEAR),(u||2<=this.version)&&this.cs?(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MIN_FILTER,q.LINEAR_MIPMAP_LINEAR),q.generateMipmap(q.TEXTURE_2D)):q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MIN_FILTER, +q.LINEAR)):(q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MAG_FILTER,q.NEAREST),q.texParameteri(q.TEXTURE_2D,q.TEXTURE_MIN_FILTER,q.NEAREST));q.bindTexture(q.TEXTURE_2D,null);this.ph=null;p.Ph=a.width;p.Oh=a.height;p.Wl=1;p.Or=f;h.push(p);return e[f]=p};a.prototype.oe=function(a,b,c,d){this.fh();var e=this.la;this.qg&&(d=!1);var f=e.createTexture();e.bindTexture(e.TEXTURE_2D,f);e.texImage2D(e.TEXTURE_2D,0,e.RGBA,a,b,0,e.RGBA,d?e.UNSIGNED_SHORT_4_4_4_4:e.UNSIGNED_BYTE,null);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S, +e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,c?e.LINEAR:e.NEAREST);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,c?e.LINEAR:e.NEAREST);e.bindTexture(e.TEXTURE_2D,null);this.ph=null;f.Ph=a;f.Oh=b;h.push(f);return f};a.prototype.RA=function(a,b,c){this.fh();var e=this.la;this.qg&&(c=!1);e.bindTexture(e.TEXTURE_2D,b);e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0);try{e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA, +c?e.UNSIGNED_SHORT_4_4_4_4:e.UNSIGNED_BYTE,a)}catch(d){console&&console.error&&console.error("Error updating WebGL texture: ",d)}e.bindTexture(e.TEXTURE_2D,null);this.ph=null};a.prototype.deleteTexture=function(a){a&&("undefined"!==typeof a.Wl&&1=b?a[3]:256>=b?a[2]:512>=b?a[1]:a[0]}function b(){try{return!!window.indexedDB}catch(a){return!1}} +function d(a){a.target.result.createObjectStore("saves",{keyPath:"slot"})}function f(a,b,c,e){try{var k=indexedDB.open("_C2SaveStates");k.onupgradeneeded=d;k.onerror=e;k.onsuccess=function(d){d=d.target.result;d.onerror=e;d.transaction(["saves"],"readwrite").objectStore("saves").put({slot:a,data:b}).onsuccess=c}}catch(g){e(g)}}function h(a,b,c){try{var e=indexedDB.open("_C2SaveStates");e.onupgradeneeded=d;e.onerror=c;e.onsuccess=function(e){e=e.target.result;e.onerror=c;var d=e.transaction(["saves"]).objectStore("saves").get(a); +d.onsuccess=function(){d.result?b(d.result.data):b(null)}}}catch(k){c(k)}}function e(){ga("Reloading for continuous preview");window.c2cocoonjs?CocoonJS.App.reload():-1k?(k*=b,5===f?(g=k*c/this.Bc,1g&&(g=1/Math.ceil(1/g)),k=this.Bc*g/c,g=this.Ac*g/c,e=(a-k)/2,d=(b-g)/2,a=k,b=g):(e=(a-k)/2,a=k)):(g=a/k,5===f?(g=g*c/this.Ac,1g&&(g=1/Math.ceil(1/g)),k=this.Bc*g/c,g=this.Ac*g/c,e=(a-k)/2,d=(b-g)/2,a=k):d=(b-g)/2,b=g)):k&&0===f&&(e=Math.floor((a-this.Bc)/2),d=Math.floor((b-this.Ac)/2),a=this.Bc,b=this.Ac),2>f&&(this.Rj=c),this.fm=Math.round(a),this.Wj=Math.round(b),this.width=Math.round(a*c),this.height=Math.round(b*c),this.La=!0,this.Vu?(this.xa=this.width, +this.wa=this.height,this.pe=!0):this.widthk&&(this.wa=this.xa/f)):3===f&&(k=this.Bc/this.Ac,f=this.ij/this.hj,f>k?this.xa=this.wa*f:fn;)n++,a=p.shift(),this.ku(a[0],a[1])};a.prototype.Uu=function(a,b){a.cocoonLazyLoad=!0;a.onerror=function(b){k=a.Nr=!0;console&&console.error&&console.error("Error loading image '"+a.src+"': ", +b)};this.Le?a.src=b:a.src||("undefined"!==typeof XAPKReader?XAPKReader.get(b,function(b){a.src=b},function(c){k=a.Nr=!0;console&&console.error&&console.error("Error extracting image '"+b+"' from expansion file: ",c)}):(a.crossOrigin="anonymous",this.Zz(a,b)));this.Ij.push(a)};a.prototype.Ay=function(a){var b,c;b=0;for(c=this.Ij.length;b=g)g=5E4;a+=g;k.src&&(k.complete||k.loaded)&&!k.Nr?b+=g:e=!1}e&&this.Uz&&this.Li&&(u||(this.Li.yA(),u=!0),c=this.Li.Ly(),b+=c,cthis.sh&&(this.ve||500<=c&&this.Ps!=this.nf)){a.clearRect(0,0,d,g);var c=d/2,g=g/2,d=0===this.sh&&this.rh.jn.complete,f=40*b,h=0,n=80*b,m;if(d){var q=this.rh.jn,n=q.width*b;m=q.height*b;f=n/2;h=m/2;a.drawImage(q,ua(c-f),ua(g-h),n,m)}1>=this.sh?(c=ua(c-f)+.5,g=ua(g+(h+(d?12*b:0)))+.5,a.fillStyle=k?"red":"DodgerBlue",a.fillRect(c,g,Math.floor(n*this.nf),6*b),a.strokeStyle="black",a.strokeRect(c, +g,n,6*b),a.strokeStyle="white",a.strokeRect(c-1*b,g-1*b,n+2*b,8*b)):2===this.sh&&(a.font=this.Le?"12pt ArialMT":"12pt Arial",a.fillStyle=k?"#f00":"#999",a.fC="middle",b=Math.round(100*this.nf)+"%",d=a.measureText?a.measureText(b):null,a.fillText(b,c-(d?d.width:0)/2,g));this.Ps=this.nf}else if(4===this.sh){this.Mx(a);l?l(function(){e.go()}):setTimeout(function(){e.go()},16);return}}setTimeout(function(){e.go()},this.ve?10:100)}}};var v=-1,r="undefined"===typeof cr_is_preview?200:0,x=!0,A=!1,D=0,F= +0,B="undefined"===typeof cr_is_preview?3E3:0,E=null,w=null,z=0;a.prototype.Mx=function(a){if(!t){for(var b=Math.ceil(this.width),e=Math.ceil(this.height),d=this.rh.jn,g=this.rh.Tz,f=this.rh.SA,h=0;4>h;++h)if(!d[h].complete||!g[h].complete||!f[h].complete)return;0===z&&(v=Date.now());var h=Date.now(),n=!1,l=a,m,q;x||A?(a.clearRect(0,0,b,e),E&&E.width===b&&E.height===e||(E=document.createElement("canvas"),E.width=b,E.height=e,w=E.getContext("2d")),l=w,n=!0,x&&1===z&&(v=Date.now())):a.globalAlpha=1; +l.fillStyle="#333333";l.fillRect(0,0,b,e);256=B&&!A&&1<=this.nf&&(A=!0,F=h);if(A&&h-F>=300+r||"undefined"!==typeof cr_is_preview&&1<=this.nf&&500>Date.now()-v)t=!0,A=x=!1,this.rh=w=E=null;++z}};a.prototype.bz=function(){this.Yc&&(this.canvas.parentNode.removeChild(this.Yc), +this.Yc=this.nq=null);this.Xn=Date.now();this.ki=zb();var a,b,c;if(this.Yq)for(a=0,b=this.ja.length;aa||2===this.Jd&&bb&&(b=0),this.Vh=b/=1E3,.51/this.nt&&(this.Vh=1/this.nt));this.Wm=a;this.Fa=this.Vh*this.Jg;this.Kc.add(this.Fa);this.Mg.add(b);a=(document.mozFullScreen||document.webkitIsFullScreen||document.fullScreen||!!document.msFullscreenElement||this.Qm)&&!this.be;2<=this.Jd||a&&0 +b||2===e&&ca++;)this.bs(this.Rh);a=0;for(b=this.lg.length;ab.km.length&&b.km.push(a)};a.prototype.Vr=function(a,b,c,e){if(a.za){var d=ua(Math.random()*a.ri.length);return this.Vr(a.ri[d],b,c,e)}return a.Ie?this.bh(a.Ie,b,!1,c,e,!1):null};var O=[];a.prototype.bh=function(a, +b,c,e,d,g){var k,f,h,n;if(!a)return null;var l=this.ja[a[1]],m=l.tb.oh;if(this.gj&&m&&!l.Fp||m&&!this.ga&&11===a[0][11])return null;var q=b;m||(b=null);var r;l.km.length?(r=l.km.pop(),r.Pd=!0,l.tb.Ya.call(r,l)):(r=new l.tb.Ya(l),r.Pd=!1);!c||g||this.xg.hasOwnProperty(a[2].toString())?r.uid=this.Wk++:r.uid=a[2];this.xg[r.uid.toString()]=r;r.Zt=this.qt++;r.di=l.G.length;k=0;for(f=this.gf.length;ka&&(a=0);a>=this.zb.Ka.length&&(a=this.zb.Ka.length-1);return this.zb.Ka[a]};a.prototype.Qo=function(a){var b,c;b=0;for(c=a.length;b=this.Yp.length&&this.Yp.push([])};a.prototype.Rz=function(){this.hn--};a.prototype.qs=function(){return this.Yp[this.hn]};a.prototype.Hn=function(a){this.rm++;this.rm>=this.$o.length&&this.$o.push(new Nc);var b=this.wc();b.reset(a);return b};a.prototype.Cn= +function(){this.rm--};a.prototype.wc=function(){return this.$o[this.rm]};a.prototype.rs=function(a,b){for(var c,e,d,k,g,f;b;){c=0;for(e=b.Ve.length;ck||k>=a.xc.length||(g=d[e],null===g&&(g=NaN),a.xc[k]=g));if(h.oh){k=b.w;a.T.Xa!==k.l&&(d=a.T,a.T=this.zb.Hm(k.l),a.T?(d.xj(a,!0),a.T.Qj(a,!0),a.Ab(),a.T.il(0)):(a.T=d,c||this.Qg(a)));a.x=k.x;a.y=k.y;a.width=k.w;a.height=k.h;a.uf=k.zi;a.R=k.hasOwnProperty("a")?k.a:0;a.opacity=k.hasOwnProperty("o")?k.o:1;a.Kd=k.hasOwnProperty("hX")?k.hX:.5;a.Ld=k.hasOwnProperty("hY")?k.hY:.5;a.visible=k.hasOwnProperty("v")?k.v:!0;a.gg=k.hasOwnProperty("ce")?k.ce:!0;a.Vk=k.hasOwnProperty("mts")? +k.mts:-1;a.dd=k.hasOwnProperty("bm")?k.bm:0;a.Tj=Yb(a.dd);this.la&&Zb(a,a.dd,this.la);a.Ab();if(k.hasOwnProperty("fx"))for(c=0,d=k.fx.length;cg||(a.Vg[g]=k.fx[c].active,a.Qb[g]=k.fx[c].params);a.sf()}if(f=b.behs)for(e in f)f.hasOwnProperty(e)&&(c=this.Fy(a,parseInt(e,10)),0>c||a.Oa[c].md(f[e]));b.data&&a.md(b.data)};a.prototype.hs=function(a,b,c){window.resolveLocalFileSystemURL(cordova.file.applicationDirectory+"www/"+a,function(a){a.file(b,c)},c)};a.prototype.yy=function(a, +b){this.hs("data.js",function(c){var e=new FileReader;e.onload=function(b){a(b.target.result)};e.onerror=b;e.readAsText(c)},b)};var H=[],ca=0;a.prototype.bq=function(){if(H.length&&!(8<=ca)){ca++;var a=H.shift();this.rx(a.filename,a.CA,a.Sx)}};a.prototype.js=function(a,b,c){var e=this;H.push({filename:a,CA:function(a){ca--;e.bq();b(a)},Sx:function(a){ca--;e.bq();c(a)}});this.bq()};a.prototype.rx=function(a,b,c){this.hs(a,function(a){var c=new FileReader;c.onload=function(a){b(a.target.result)};c.readAsArrayBuffer(a)}, +c)};a.prototype.zy=function(a,b,c){var e="",d=a.toLowerCase(),k=d.substr(d.length-4),d=d.substr(d.length-5);".mp4"===k?e="video/mp4":".webm"===d?e="video/webm":".m4a"===k?e="audio/mp4":".mp3"===k&&(e="audio/mpeg");this.js(a,function(a){a=URL.createObjectURL(new Blob([a],{type:e}));b(a)},c)};a.prototype.kz=function(a){return/^(?:[a-z]+:)?\/\//.test(a)||"data:"===a.substr(0,5)||"blob:"===a.substr(0,5)};a.prototype.ku=function(a,b){this.Rm&&!this.kz(b)?this.zy(b,function(b){a.src=b},function(a){alert("Failed to load image: "+ +a)}):a.src=b};a.prototype.Qn=function(a,b){"undefined"!==typeof a.imageSmoothingEnabled?a.imageSmoothingEnabled=b:(a.webkitImageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b)};Pc=function(b){return new a(document.getElementById(b))};Qc=function(b,c){return new a({dc:!0,width:b,height:c})};window.cr_createRuntime=Pc;window.cr_createDCRuntime=Qc;window.createCocoonJSRuntime=function(){window.c2cocoonjs=!0;var b=document.createElement("screencanvas")||document.createElement("canvas"); +b.j=!0;document.body.appendChild(b);b=new a(b);window.c2runtime=b;window.addEventListener("orientationchange",function(){window.c2runtime.setSize(window.innerWidth,window.innerHeight)});window.c2runtime.setSize(window.innerWidth,window.innerHeight);return b};window.createEjectaRuntime=function(){var b=new a(document.getElementById("canvas"));window.c2runtime=b;window.c2runtime.setSize(window.innerWidth,window.innerHeight);return b}})(); +window.cr_getC2Runtime=function(){var a=document.getElementById("c2canvas");return a?a.c2runtime:window.c2runtime?window.c2runtime:null};window.cr_getSnapshot=function(a,c){var b=window.cr_getC2Runtime();b&&b.lx(a,c)};window.cr_sizeCanvas=function(a,c){if(0!==a&&0!==c){var b=window.cr_getC2Runtime();b&&b.setSize(a,c)}};window.cr_setSuspended=function(a){var c=window.cr_getC2Runtime();c&&c.setSuspended(a)}; +(function(){function a(a,b){this.g=a;this.Xh=null;this.scrollX=this.g.Bc/2;this.scrollY=this.g.Ac/2;this.scale=1;this.R=0;this.Ti=!0;this.name=b[0];this.Nz=b[1];this.Mz=b[2];this.width=b[1];this.height=b[2];this.Mu=b[3];this.qu=b[4];this.Xa=b[5];var c=b[6],e,d;this.Ka=[];this.mk=[];e=0;for(d=c.length;e=this.Ka.length&&(r=this.Ka.length-1);l.T=this.Ka[r];-1===l.T.G.indexOf(l)&&l.T.G.push(l);l.T.Di=!0}if(!e)for(a=0,d=this.Ka.length;ad?l.siblings.push(m.G[d]):m.Ie&&(f=this.g.bh(m.Ie,l.T,!0,l.x,l.y,!0),this.g.bd(),m.ko(), +l.siblings.push(f),h.push(f)));a=0;for(d=this.mh.length;athis.width-b&&(a=this.width-b);athis.height-b&&(a=this.height-b);aC&&(C=0);0>G&&(G=0);X>P&&(X=P);Q>H&&(Q=H);0>V&&(V=0);0>M&&(M=0);Da>P&&(Da=P);ja>H&&(ja=H);R.left=C/P;R.top=1-G/H;R.right=X/P;R.bottom=1-Q/H}else R.left=L.left=0,R.top=L.top= +0,R.right=L.right=1,R.bottom=L.bottom=1;la=c&&(a.cl(d[0].qc)||0!==w||0!==la||1!==c.opacity||c.type.tb.ot)||b&&!c&&1!==b.opacity;a.gu();if(la){F[K]||(F[K]=a.oe(P,H,this.g.Nb));if(F[K].Ph!==P||F[K].Oh!==H)a.deleteTexture(F[K]),F[K]=a.oe(P,H,this.g.Nb);a.Td(0);a.Te(F[K]);W=ja-M;a.clearRect(V,H-M-W,Da-V,W);c?c.xd(a):(a.le(this.g.yc),a.xi(b.opacity),a.Se(),a.translate(-ca,-ra),a.De(),a.Sf(C,Q,X,Q,X,G,C,G,R));L.left=L.top=0;L.right=L.bottom=1;c&&(z=R.top,R.top=R.bottom,R.bottom=z);K=1;O=0}a.xi(1);w=d.length- +1;var Xa=a.tq(d[w].qc)||!b&&!c&&!this.g.pe;B=z=0;for(E=d.length;Bc||(b&&this.Ee&&a.Qd&&a.Qd.right>=a.Qd.left&&(a.kb(),this.Zc.update(a,a.Qd, +null),a.Qd.set(0,0,-1,-1)),c===this.G.length-1?this.G.pop():(La(this.G,c),this.il(c)),this.of=!0)};b.prototype.Qj=function(a,b){a.uf=this.G.length;this.G.push(a);b&&this.Ee&&a.Qd&&a.Ab();this.of=!0};b.prototype.Vz=function(a){this.G.unshift(a);this.il(0)};b.prototype.Ez=function(a,b,c){var e=a.Jf();b=b.Jf();La(this.G,e);ethis.Fb||c.top>this.Eb||(b.globalCompositeOperation=a.Tj,a.Ke(b))}}; +b.prototype.no=function(){this.kg=!0;var a=this.td(0,0,!0,!0),b=this.td(0,0,!1,!0);this.kg=!1;this.g.lf&&(a=Math.round(a),b=Math.round(b));this.Kn(a,b,null)};b.prototype.Kn=function(a,b,c){var e=this.yd();this.ub=a;this.wb=b;this.Fb=a+1/e*this.g.xa;this.Eb=b+1/e*this.g.wa;this.ub>this.Fb&&(a=this.ub,this.ub=this.Fb,this.Fb=a);this.wb>this.Eb&&(a=this.wb,this.wb=this.Eb,this.Eb=a);a=this.vc();0!==a&&(c&&(c.translate(this.g.xa/2,this.g.wa/2),c.rotate(-a),c.translate(this.g.xa/-2,this.g.wa/-2)),this.Kg.set(this.ub, +this.wb,this.Fb,this.Eb),this.Kg.offset((this.ub+this.Fb)/-2,(this.wb+this.Eb)/-2),this.Hu.ou(this.Kg,a),this.Hu.Mr(this.Kg),this.Kg.offset((this.ub+this.Fb)/2,(this.wb+this.Eb)/2),this.ub=this.Kg.left,this.wb=this.Kg.top,this.Fb=this.Kg.right,this.Eb=this.Kg.bottom)};b.prototype.Uh=function(a){if(this.Tf=this.Am){this.g.yc||(this.g.yc=a.oe(this.g.xa,this.g.wa,this.g.Nb));if(this.g.yc.Ph!==this.g.xa||this.g.yc.Oh!==this.g.wa)a.deleteTexture(this.g.yc),this.g.yc=a.oe(this.g.xa,this.g.wa,this.g.Nb); +a.Te(this.g.yc)}this.kg=!0;var b=this.td(0,0,!0,!0),c=this.td(0,0,!1,!0);this.kg=!1;this.g.lf&&(b=Math.round(b),c=Math.round(c));this.Kn(b,c,null);b=this.yd();a.Se();a.scale(b,b);a.Ln(-this.vc());a.translate((this.ub+this.Fb)/-2,(this.wb+this.Eb)/-2);a.De();this.Ee?(this.Uc.left=this.Zc.Fd(this.ub),this.Uc.top=this.Zc.Gd(this.wb),this.Uc.right=this.Zc.Fd(this.Fb),this.Uc.bottom=this.Zc.Gd(this.Eb),this.of||!this.Uc.Xj(this.jj)?(f(this.ug),b=this.pp(),this.of=!1,this.jj.Oi(this.Uc)):b=this.ug):b=this.G; +for(var e,d=null,c=b.length-1;0<=c;--c)e=b[c],e!==d&&(this.Kx(b[c],a),d=e);this.Ee&&(this.ug=b);this.rf||(this.Ro=this.g.Wh++,a.Rn(this.Ro),a.hu(1,1,1),a.ms(),a.fA())};b.prototype.xd=function(a){var b=0,c=0;if(this.Tf=this.Am||1!==this.opacity||0this.Fb||c.top>this.Eb||(b.Rn(a.Wh),a.Su?this.Lx(a,b):(b.Td(0),b.Bh(a.od,a.jd),a.xd(b)))}}; +b.prototype.Kx=function(a,b){if(a.visible&&0!==a.width&&0!==a.height){a.kb();var c=a.Ob;c.rightthis.Fb||c.top>this.Eb||(a.Wh=this.g.Wh++,0===a.dd&&1===a.opacity&&a.Gg&&a.Uh&&(b.Rn(a.Wh),a.Uh(b)))}};b.prototype.Lx=function(a,b){var c=a.lb[0].qc,e=a.lb[0].index,d=this.yd();if(1!==a.lb.length||b.tq(c)||b.Xz(c)||(a.R||a.T.vc())&&b.cl(c)||1!==a.opacity||a.type.tb.ot)this.Lc.yq(b,this,a,this.Tf?this.g.yc:this.Lc.gk()),b.Se(),b.scale(d,d),b.Ln(-this.vc()),b.translate((this.ub+ +this.Fb)/-2,(this.wb+this.Eb)/-2),b.De();else{b.Td(c);b.Bh(a.od,a.jd);b.Fn(c)&&(this.g.La=!0);var g=0,f=0,h=0,l=0;b.cl(c)&&(l=a.Ob,g=this.mb(l.left,l.top,!0,!0),f=this.mb(l.left,l.top,!1,!0),h=this.mb(l.right,l.bottom,!0,!0),l=this.mb(l.right,l.bottom,!1,!0),g=g/windowWidth,f=1-f/windowHeight,h=h/windowWidth,l=1-l/windowHeight);var m;a.Tc&&a.Tc.Wa?(m=a.Tc.Wa,c=1/m.width,m=1/m.height):(c=1/a.width,m=1/a.height);b.zj(this.Tf?this.g.yc:this.Lc.gk(),c,m,g,f,h,l,d,this.vc(),this.ub,this.wb,(this.ub+this.Fb)/ +2,(this.wb+this.Eb)/2,this.g.Kc.Da,a.Qb[e]);a.xd(b)}};b.prototype.td=function(a,b,c,e){var d=this.g.devicePixelRatio;this.g.fi&&(a*=d,b*=d);var d=this.g.Ot,g=this.g.Pt,d=(this.Lc.scrollX-d)*this.Qe+d,g=(this.Lc.scrollY-g)*this.Re+g,f=d,h=g,l=1/this.yd(!e);e?(f-=this.g.xa*l/2,h-=this.g.wa*l/2):(f-=this.g.width*l/2,h-=this.g.height*l/2);f+=a*l;h+=b*l;b=this.vc();0!==b&&(f-=d,h-=g,a=Math.cos(b),b=Math.sin(b),e=f*a-h*b,h=h*a+f*b,f=e+d,h+=g);return c?f:h};b.prototype.mb=function(a,b,c,e){var d=this.g.Ot, +g=this.g.Pt,f=(this.Lc.scrollX-d)*this.Qe+d,h=(this.Lc.scrollY-g)*this.Re+g,g=f,d=h,l=this.vc();if(0!==l){a-=f;b-=h;var m=Math.cos(-l),l=Math.sin(-l),D=a*m-b*l;b=b*m+a*l;a=D+f;b+=h}f=1/this.yd(!e);e?(g-=this.g.xa*f/2,d-=this.g.wa*f/2):(g-=this.g.width*f/2,d-=this.g.height*f/2);g=(a-g)/f;d=(b-d)/f;a=this.g.devicePixelRatio;this.g.fi&&!e&&(g/=a,d/=a);return c?g:d};b.prototype.Pc=function(){var a,b,c,e={s:this.scale,a:this.R,vl:this.ub,vt:this.wb,vr:this.Fb,vb:this.Eb,v:this.visible,bc:this.ef,t:this.rf, +px:this.Qe,py:this.Re,o:this.opacity,zr:this.vf,fx:[],cg:this.Vj,instances:[]};a=0;for(b=this.Ga.length;ab[1].index&&(e=b[0],b[0]=b[1],b[1]=e):2=u.length&&(u.length=b.length+1);u[b.length]||(u[b.length]=[]);f=u[b.length];e=0;for(d=f.length;e=b.length&&(b.length=this.ni+1),b[this.ni]=a):this.data=a};n.prototype.$h=function(){var a=this.g.qs();return!this.parent||this.wk||!a||this.Tm?this.data:this.ni>=a.length||"undefined"===typeof a[this.ni]?this.Lm:a[this.ni]};n.prototype.pc=function(){!this.parent||this.wk||this.Tm||this.Fg(this.Lm)};Oc= +n;p.prototype.toString=function(){return"include:"+this.lk.toString()};p.prototype.gc=function(){this.lk=this.g.bp[this.fz];this.sheet.zs.add(this);this.Db=b(this.Db);for(var a=this.parent;a;)a.group&&a.am.push(this),a=a.parent;this.Ou()};p.prototype.pc=function(){this.parent&&this.g.el(this.g.ja);this.lk.up||this.lk.pc(!0);this.parent&&this.g.vi(this.g.ja)};p.prototype.Ou=function(){for(var a=this.parent;a;){if(a.group&&!a.ai){this.ic=!1;return}a=a.parent}this.ic=!0};bd=p;q.prototype.reset=function(a){this.wd= +a;this.Xd=this.tc=0;I(this.Au);this.Zo=this.ji=!1};Nc=q})(); +(function(){function a(a,b){this.Pe=a;this.g=a.g;this.type=b[0];this.get=[this.hy,this.dy,this.ry,this.wy,this.Tx,this.ty,this.ly,this.ay,this.ky,this.qy,this.Ux,this.oy,this.by,this.my,this.iy,this.jy,this.ey,this.fy,this.$x,this.uy,this.ny,this.gy,this.Zx,this.cy][this.type];var c=null;this.wg=this.Qa=this.Wb=this.Vc=this.eo=this.second=this.first=this.value=null;this.ff=-1;this.hf=null;this.Tu=-1;this.Yh=this.ul=null;this.yj=!1;switch(this.type){case 0:case 1:case 2:this.value=b[1];break;case 3:this.first= +new $c(a,b[1]);break;case 18:this.first=new $c(a,b[1]);this.second=new $c(a,b[2]);this.eo=new $c(a,b[3]);break;case 19:this.Vc=this.g.Sg(b[1]);this.Vc!==J.prototype.Ja.random&&this.Vc!==J.prototype.Ja.bx||this.Pe.mu();this.Wb=[];this.Qa=[];3===b.length?(c=b[2],this.Wb.length=c.length+1):this.Wb.length=1;break;case 20:this.wg=this.g.ja[b[1]];this.ff=-1;this.Vc=this.g.Sg(b[2]);this.yj=b[3];ed.Function&&this.Vc===ed.Function.prototype.Ja.$A&&this.Pe.mu();b[4]?this.hf=new $c(a,b[4]):this.hf=null;this.Wb= +[];this.Qa=[];6===b.length?(c=b[5],this.Wb.length=c.length+1):this.Wb.length=1;break;case 21:this.wg=this.g.ja[b[1]];this.yj=b[2];b[3]?this.hf=new $c(a,b[3]):this.hf=null;this.Tu=b[4];break;case 22:this.wg=this.g.ja[b[1]];this.wg.Dm(b[2]);this.ff=this.wg.jp(b[2]);this.Vc=this.g.Sg(b[3]);this.yj=b[4];b[5]?this.hf=new $c(a,b[5]):this.hf=null;this.Wb=[];this.Qa=[];7===b.length?(c=b[6],this.Wb.length=c.length+1):this.Wb.length=1;break;case 23:this.ul=b[1],this.Yh=null}this.Pe.Dz(this.wg);4<=this.type&& +17>=this.type&&(this.first=new $c(a,b[1]),this.second=new $c(a,b[2]));if(c){var d,f;d=0;for(f=c.length;d=d||p<=-d)p%=d;0>p&&(p+=d);n.apply(u[p],f)};a.prototype.Zx=function(a){var d=this.wg,f=this.Wb,m=this.Qa,k=this.hf,n=this.ff,p=this.Vc,q=this.Pe.Hg,u=d.Za(),t=u.se();if(!t.length)if(u.Ua.length)t=u.Ua;else{this.yj?a.Xb(""):a.Cb(0);return}f[0]=a;a.ti=d;a=c();b(m,f,a);k&&(k.get(a),a.Jc()&&(q=a.data,t=d.G));--h;m=t.length;if(q>=m||q<=-m)q%=m;0>q&&(q+=m);q=t[q];t=0;d.za&&(t=q.type.Si[d.mg]);p.apply(q.Oa[n+t],f)};a.prototype.gy=function(a){var b=this.hf,d=this.wg,f=this.Tu, +k=this.Pe.Hg,n=d.Za(),p=n.se();if(!p.length)if(n.Ua.length)p=n.Ua;else{this.yj?a.Xb(""):a.Cb(0);return}if(b){n=c();b.get(n);if(n.Jc()){k=n.data;p=d.G;0!==p.length&&(k%=p.length,0>k&&(k+=p.length));k=d.mp(k);d=k.xc[f];na(d)?a.Xb(d):a.ua(d);--h;return}--h}b=p.length;if(k>=b||k<=-b)k%=b;0>k&&(k+=b);k=p[k];p=0;d.za&&(p=k.type.vm[d.mg]);d=k.xc[f+p];na(d)?a.Xb(d):a.ua(d)};a.prototype.hy=function(a){a.type=cd.Gi;a.data=this.value};a.prototype.dy=function(a){a.type=cd.Fi;a.data=this.value};a.prototype.ry= +function(a){a.type=cd.String;a.data=this.value};a.prototype.wy=function(a){this.first.get(a);a.Jc()&&(a.data=-a.data)};a.prototype.Tx=function(a){this.first.get(a);var b=c();this.second.get(b);a.Jc()&&b.Jc()&&(a.data+=b.data,b.bj()&&a.oj());--h};a.prototype.ty=function(a){this.first.get(a);var b=c();this.second.get(b);a.Jc()&&b.Jc()&&(a.data-=b.data,b.bj()&&a.oj());--h};a.prototype.ly=function(a){this.first.get(a);var b=c();this.second.get(b);a.Jc()&&b.Jc()&&(a.data*=b.data,b.bj()&&a.oj());--h};a.prototype.ay= +function(a){this.first.get(a);var b=c();this.second.get(b);a.Jc()&&b.Jc()&&(a.data/=b.data,a.oj());--h};a.prototype.ky=function(a){this.first.get(a);var b=c();this.second.get(b);a.Jc()&&b.Jc()&&(a.data%=b.data,b.bj()&&a.oj());--h};a.prototype.qy=function(a){this.first.get(a);var b=c();this.second.get(b);a.Jc()&&b.Jc()&&(a.data=Math.pow(a.data,b.data),b.bj()&&a.oj());--h};a.prototype.Ux=function(a){this.first.get(a);var b=c();this.second.get(b);b.ej()||a.ej()?this.Wx(a,b):this.Vx(a,b);--h};a.prototype.Wx= +function(a,b){a.ej()&&b.ej()?this.Yx(a,b):this.Xx(a,b)};a.prototype.Yx=function(a,b){a.data+=b.data};a.prototype.Xx=function(a,b){a.ej()?a.data+=(Math.round(1E10*b.data)/1E10).toString():a.Xb(a.data.toString()+b.data)};a.prototype.Vx=function(a,b){a.Cb(a.data&&b.data?1:0)};a.prototype.oy=function(a){this.first.get(a);var b=c();this.second.get(b);a.Jc()&&b.Jc()&&(a.data||b.data?a.Cb(1):a.Cb(0));--h};a.prototype.$x=function(a){this.first.get(a);a.data?this.second.get(a):this.eo.get(a)};a.prototype.by= +function(a){this.first.get(a);var b=c();this.second.get(b);a.Cb(a.data===b.data?1:0);--h};a.prototype.my=function(a){this.first.get(a);var b=c();this.second.get(b);a.Cb(a.data!==b.data?1:0);--h};a.prototype.iy=function(a){this.first.get(a);var b=c();this.second.get(b);a.Cb(a.datab.data?1:0);--h}; +a.prototype.fy=function(a){this.first.get(a);var b=c();this.second.get(b);a.Cb(a.data>=b.data?1:0);--h};a.prototype.cy=function(a){var b=this.Yh.$h();ma(b)?a.ua(b):a.Xb(b)};$c=a;d.prototype.bj=function(){return this.type===cd.Fi};d.prototype.Jc=function(){return this.type===cd.Gi||this.type===cd.Fi};d.prototype.ej=function(){return this.type===cd.String};d.prototype.oj=function(){this.bj()||(this.ej()&&(this.data=parseFloat(this.data)),this.type=cd.Fi)};d.prototype.Cb=function(a){this.type=cd.Gi; +this.data=Math.floor(a)};d.prototype.ua=function(a){this.type=cd.Fi;this.data=a};d.prototype.Xb=function(a){this.type=cd.String;this.data=a};d.prototype.vA=function(a){ma(a)?(this.type=cd.Fi,this.data=a):na(a)?(this.type=cd.String,this.data=a.toString()):(this.type=cd.Gi,this.data=0)};Zc=d;cd={Gi:0,Fi:1,String:2}})();function J(a){this.g=a;this.Ud=[]} +J.prototype.Pc=function(){var a={},c,b,d,f,h,e,g,l;a.waits=[];var m=a.waits,k;c=0;for(b=this.Ud.length;c=c+f)return b.ma.Every_lastTime=c+f,d>=b.ma.Every_lastTime+.04&&(b.ma.Every_lastTime=d),b.ma.Every_seconds= +a,!0;d=b&&a<=c};a.prototype.ir=function(){var a=this.g.wc();return a.Zo?!1:!a.ji};a.prototype.vo=function(){return!0};a.prototype.Ev=function(){return!0};a.prototype.wo=function(){return!0};a.prototype.nr=function(){return!0};a.prototype.Qv=function(){return!0};a.prototype.Hl=function(){return!0}; +a.prototype.Yu=function(a,b,c){return hb(Ua(a),Ua(c))<=Ua(b)};a.prototype.sv=function(a,b){return pb(Ua(a),Ua(b))};a.prototype.rv=function(a,b,c){a=fb(a);b=fb(b);c=fb(c);return pb(c,b)?pb(a,b)&&!pb(a,c):!(!pb(a,b)&&pb(a,c))};d.M=new a;c.prototype.nv=function(a){this.g.gj||this.g.Rh||(this.g.Rh=a)};c.prototype.hv=function(a,b,c,d){if(b&&a&&(b=this.g.Vr(a,b,c,d))){this.g.jf++;var f;this.g.trigger(Object.getPrototypeOf(a.tb).M.Fl,b);if(b.Nd)for(c=0,d=b.siblings.length;ca&&(a=0);this.g.Jg=a};var f=[],h=[];c.prototype.Kw=function(a){if(!(0>a)){var b,c,d,k=this.g.wc(),n;f.length?n=f.pop():n={Cd:{},Db:[]};n.Xo=!1;n.time=this.g.Kc.Da+a;n.tu="";n.Hq=!1;n.Ri=k.wd;n.Xd=k.Xd+1;a=0;for(b=this.g.ja.length;af&&(b=f);a.ua(b)};b.prototype.Fa=function(a){a.ua(this.g.Fa)};b.prototype.Jg=function(a){a.ua(this.g.Jg)};b.prototype.time=function(a){a.ua(this.g.Kc.Da)};b.prototype.Ce=function(a){a.Cb(this.g.Ce)};b.prototype.qn=function(a){a.Cb(this.g.qn)};b.prototype.gp=function(a){a.Cb(this.g.gp)}; +b.prototype.R=function(a,b,c,d,f){a.ua(Va(gb(b,c,d,f)))};b.prototype.left=function(a,b,c){a.Xb(na(b)?b.substr(0,c):"")};b.prototype.right=function(a,b,c){a.Xb(na(b)?b.substr(b.length-c):"")};b.prototype.replace=function(a,b,c,d){na(b)&&na(c)&&na(d)?a.Xb(b.replace(new RegExp(Qb(c),"gi"),d)):a.Xb(na(b)?b:"")};b.prototype.trim=function(a,b){a.Xb(na(b)?b.trim():"")};b.prototype.bx=function(a){var b=ua(Math.random()*(arguments.length-1));a.vA(arguments[b+1])};b.prototype.jA=function(a,b,c,d){a.Cb(Aa(b, +c,d))};b.prototype.So=function(a){a.ua(this.g.So/1E3)};b.prototype.en=function(a){a.ua(this.g.en)};d.Ja=new b;d.kA=function(){var a,b,c,d,k,n,p=this.g.wc();a=0;for(c=this.Ud.length;athis.g.Kc.Da)continue;p.wd=d.Ri;p.Xd=d.Xd;p.tc=0;for(b in d.Cd)d.Cd.hasOwnProperty(b)&&(k=this.g.ja[parseInt(b,10)].Za(),n=d.Cd[b],k.qb=n.Nn,Na(k.G,n.ng),k=n,I(k.ng),h.push(k));d.Ri.hA();this.g.Qo(d.Db);d.Xo=!0}b=a=0;for(c=this.Ud.length;aa.Fb||b.top>a.Eb)},k.jB=function(){this.kb();var a=this.Ob,b=this.g.zb;return 0>a.right||0>a.bottom||a.left>b.width||a.top>b.height},k.tB=function(a,b,c){var d=this.Za(), +e=d.se();if(!e.length)return!1;var f=e[0],g=f,h=vb(f.x,f.y,b,c),k,l,m;k=1;for(l=e.length;kh)h=m,g=f;d.$k(g);return!0},n.ur=function(a){this.x!==a&&(this.x=a,this.Ab())},n.Aw=function(a){this.y!==a&&(this.y=a,this.Ab())},n.rw=function(a,b){if(this.x!==a||this.y!==b)this.x=a,this.y=b,this.Ab()},n.sw=function(a,b){var c=a.Ky(this);if(c){var d;c.If?(d=c.If(b,!0),c=c.If(b,!1)):(d=c.x,c=c.y);if(this.x!==d||this.y!==c)this.x=d,this.y=c,this.Ab()}}, +n.nB=function(a){0!==a&&(this.x+=Math.cos(this.R)*a,this.y+=Math.sin(this.R)*a,this.Ab())},n.mB=function(a,b){0!==b&&(this.x+=Math.cos(Ua(a))*b,this.y+=Math.sin(Ua(a))*b,this.Ab())},p.Eo=function(a){a.ua(this.x)},p.Fo=function(a){a.ua(this.y)},p.Fa=function(a){a.ua(this.g.Wi(this))});h&&(k.cB=function(a,b){return dd(this.width,a,b)},k.aB=function(a,b){return dd(this.height,a,b)},n.tr=function(a){this.width!==a&&(this.width=a,this.Ab())},n.EB=function(a){this.height!==a&&(this.height=a,this.Ab())}, +n.vw=function(a,b){if(this.width!==a||this.height!==b)this.width=a,this.height=b,this.Ab()},p.Lw=function(a){a.ua(this.width)},p.qv=function(a){a.ua(this.height)},p.XA=function(a){this.kb();a.ua(this.Ob.left)},p.ZA=function(a){this.kb();a.ua(this.Ob.top)},p.YA=function(a){this.kb();a.ua(this.Ob.right)},p.WA=function(a){this.kb();a.ua(this.Ob.bottom)});e&&(k.Yu=function(a,b){return hb(this.R,Ua(b))<=Ua(a)},k.sv=function(a){return pb(this.R,Ua(a))},k.rv=function(a,b){var c=fb(a),d=fb(b),e=cb(this.R); +return pb(d,c)?pb(e,c)&&!pb(e,d):!(!pb(e,c)&&pb(e,d))},n.rr=function(a){a=Ua(Wa(a));isNaN(a)||this.R===a||(this.R=a,this.Ab())},n.xB=function(a){0===a||isNaN(a)||(this.R+=Ua(a),this.R=cb(this.R),this.Ab())},n.yB=function(a){0===a||isNaN(a)||(this.R-=Ua(a),this.R=cb(this.R),this.Ab())},n.zB=function(a,b){var c=ib(this.R,Ua(b),Ua(a));isNaN(c)||this.R===c||(this.R=c,this.Ab())},n.AB=function(a,b,c){a=ib(this.R,Math.atan2(c-this.y,b-this.x),Ua(a));isNaN(a)||this.R===a||(this.R=a,this.Ab())},n.HB=function(a, +b){var c=Math.atan2(b-this.y,a-this.x);isNaN(c)||this.R===c||(this.R=c,this.Ab())},p.VA=function(a){a.ua(db(this.R))});d||(k.bB=function(a,b,c){return dd(this.xc[a],b,c)},k.gB=function(a){return this.xc[a]},k.uB=function(a,b){var c=this.Za(),d=c.se();if(!d.length)return!1;var e=d[0],f=e,g=e.xc[b],h,k,l;h=1;for(k=d.length;hg)g=l,f=e;c.$k(f);return!0},k.sB=function(a){var b,c,d,e,f;if(this.g.Em().Mm){f=this.Za();if(f.qb)for(f.qb=!1,I(f.G),I(f.Ua),d=this.G, +b=0,c=d.length;ba?a=0:1e.T.index||d.T.index===e.T.index&&d.Jf()>e.Jf())e=d}else if(d.T.indexc)){var d=1===a;this.Vg[c]!==d&&(this.Vg[c]=d,this.sf(),this.g.La=!0)}}},n.DB=function(a,b,c){if(this.g.ga){var d=this.type.lp(a);0>d||(a=this.type.Ga[d],d=this.Qb[d],b=Math.floor(b),0>b||b>=d.length||(1===this.g.ga.Oy(a.qc,b)&&(c/=100),d[b]!==c&&(d[b]=c,a.ic&&(this.g.La=!0))))}})};wc=function(){this.No=this.Ko= +!0;this.type.Ol=!0;this.g.La=!0;var a,b,d=this.Lo;a=0;for(b=d.length;ad;case 5:return a>=d;default:return!1}}})();var wd={};function yd(a){this.g=a} +(function(){function a(a){-1===Gb.indexOf(a)&&Gb.push(a)}function c(b){var c=b.W,d;try{d=c.play()}catch(e){a(b);return}d?d.catch(function(){a(b)}):Tc&&!H.Md&&a(b)}function b(){var b,c,e,f;Uc||Sc||!C||(d(),"running"===C.state&&(Uc=!0));var g=Gb.slice(0);I(Gb);if(!Q)for(b=0,c=g.length;ba&&(a=0);1a&&(a=0);1a&&(a=.01);this.En.gain.value=a;this.Dn.gain.value=Math.pow(1/a,.6)*b};D.prototype.shape=function(a,b,c){var d=1.05*c*b-b;c=0>a?-1:1;a=0>a?-a:a;b=af;++f)e=f/32768,e=this.shape(e,c,d),this.jm[32768+f]=e,this.jm[32768-f-1]=-e};D.prototype.He=function(a){this.Ea.disconnect();this.Ea.connect(a);this.Aa.disconnect(); +this.Aa.connect(a)};D.prototype.remove=function(){this.ab.disconnect();this.En.disconnect();this.qo.disconnect();this.Dn.disconnect();this.Ea.disconnect();this.Aa.disconnect()};D.prototype.qe=function(){return this.ab};F.prototype.He=function(a){this.jb.disconnect();this.jb.connect(a)};F.prototype.remove=function(){this.jb.disconnect()};F.prototype.qe=function(){return this.jb};B.prototype.Zb=function(){this.jb.getFloatFrequencyData(this.By);this.jb.getByteTimeDomainData(this.ru);for(var a=this.jb.fftSize, +b=0,c=this.Zk=0,d=0;bd&&(d=-d),this.Zkb&&(c=b);return c};z.prototype.sk=function(){return!this.de&&!this.Hf&&!this.Sd&&!this.ci()};z.prototype.wA=function(){return!this.Hf&&!this.Sd&&!this.ci()};z.prototype.LA=function(){var a=this.volume*ja;isFinite(a)||(a=0);switch(this.Va){case 0:"undefined"!==typeof this.W.volume&&this.W.volume!==a&&(this.W.volume=a);break;case 1:1===this.buffer.Va?this.uc.gain.value=a*this.rj:"undefined"!== +typeof this.W.volume&&this.W.volume!==a&&(this.W.volume=a)}};z.prototype.qm=function(a){switch(this.Va){case 0:this.W.muted!==!!a&&(this.W.muted=!!a);break;case 1:1===this.buffer.Va?(this.rj=a?0:1,this.uc.gain.value=ja*this.volume*this.rj):this.W.muted!==!!a&&(this.W.muted=!!a)}};z.prototype.lu=function(a){this.cj=!!a;this.qm(this.cj||this.vk)};z.prototype.Un=function(a){this.vk=!!a;this.qm(this.cj||this.vk)};z.prototype.lo=function(){var a=this.playbackRate;this.aj&&(a*=H.Jg);switch(this.Va){case 0:this.W.playbackRate!== +a&&(this.W.playbackRate=a);break;case 1:1===this.buffer.Va?this.W.playbackRate.value!==a&&(this.W.playbackRate.value=a):this.W.playbackRate!==a&&(this.W.playbackRate=a)}};z.prototype.tA=function(a){switch(this.Va){case 0:a?this.sk()?(this.Be=!0,this.W.pause()):this.Be=!1:this.Be&&(this.W.play(),this.Be=!1);break;case 1:a?this.sk()?(this.Be=!0,1===this.buffer.Va?(this.Rd=this.op(!0),this.Nf&&(this.Rd=this.Rd%this.Zh()),n(this.W)):this.W.pause()):this.Be=!1:this.Be&&(1===this.buffer.Va?(this.W=C.createBufferSource(), +this.W.buffer=this.buffer.hb,this.W.connect(this.uc),this.W.onended=this.lq,this.Ll=this.W,this.W.loop=this.Nf,this.uc.gain.value=ja*this.volume*this.rj,this.lo(),this.startTime=(this.aj?H.Kc.Da:H.Mg.Da)-this.Rd/(this.playbackRate||.001),k(this.W,this.Rd,this.Zh())):this.W.play(),this.Be=!1);break;case 2:a?this.sk()?(this.W.pause(),this.Be=!0):this.Be=!1:this.Be&&(this.Be=!1,this.W.play())}};P.Ya=function(a){this.type=a;H=this.g=a.g;ca=this;this.fe=null;this.Kk=-600;this.g.Rm&&(Tb=!0);!(this.g.fj|| +this.g.ok&&(this.g.Bp||this.g.Nm))||this.g.Pm||this.g.bb||this.g.Fs||Tb||(Tc=!0);C=null;"undefined"!==typeof AudioContext?(L=1,C=new AudioContext):"undefined"!==typeof webkitAudioContext&&(L=1,C=new webkitAudioContext);this.g.fj&&C&&(C.close&&C.close(),"undefined"!==typeof AudioContext?C=new AudioContext:"undefined"!==typeof webkitAudioContext&&(C=new webkitAudioContext));1!==L&&(this.g.be&&"undefined"!==typeof window.Media?L=2:this.g.Gs&&(L=3));2===L&&(R=location.href,a=R.lastIndexOf("/"),-1"!==b&&(a.An=b,a.Zp=d,a.Zq=e),null;h=new z(a,b);G.push(h);return h};var Ya=[];Z.prototype.Gl=function(a){return ac(ra,a)};P.M=new Z;W.prototype.Play=function(a,b,c,d){!Q&&(c=f(c),M=this.ip(this.g.xm+a[0]+(X?".ogg":".m4a"),d,a[1],0!==b,c))&&(M.Tn(!1),M.play(0!==b,c,0,this.nn),this.nn=0)};W.prototype.gw=function(a,b,c,d,e){!Q&&(d=f(d),M=this.ip(this.g.xm+ +b.toLowerCase()+(X?".ogg":".m4a"),e,1===a,0!==c,d))&&(M.Tn(!1),M.play(0!==c,d,0,this.nn),this.nn=0)};W.prototype.qw=function(a,b){K(a);var c,d;c=0;for(d=Ya.length;c=d||0>=l||b>=m||c>=k?(this.Id||jQuery(this.X).hide(),this.Id=!0):(1>b&&(b=1),1>c&&(c=1),d>=m&&(d=m-1),l>=k&&(l=k-1),m=window.innerWidth,k=window.innerHeight, +a||this.Dk!==b||this.Gk!==c||this.Fk!==d||this.zk!==l||this.Ik!==m||this.Hk!==k?(this.Dk=b,this.Gk=c,this.Fk=d,this.zk=l,this.Ik=m,this.Hk=k,this.Id&&(jQuery(this.X).show(),this.Id=!1),a=Math.round(b)+jQuery(this.g.canvas).offset().left,m=Math.round(c)+jQuery(this.g.canvas).offset().top,jQuery(this.X).css("position","absolute"),jQuery(this.X).offset({left:a,top:m}),jQuery(this.X).width(Math.round(d-b)),jQuery(this.X).height(Math.round(l-c)),this.Jo&&jQuery(this.X).css("font-size",this.T.yd(!0)/this.g.devicePixelRatio- +.2+"em")):this.Id&&(jQuery(this.X).show(),this.Id=!1))}};d.Ke=function(){};d.xd=function(){};a.prototype.uo=function(){return!0};b.M=new a;c.prototype.Bo=function(a){this.g.bb||(this.$i?this.yk.nodeValue=a:this.X.value=a)};c.prototype.Ii=function(a){this.g.bb||(this.visible=0!==a)};c.prototype.Kl=function(a){this.g.bb||(this.ue.disabled=0===a)};b.ea=new c;b.Ja=new function(){}})();function N(a){this.g=a} +(function(){function a(){if(0===this.Vo.length){var a=document.createElement("canvas");a.width=this.width;a.height=this.height;var b=a.getContext("2d");this.Bj?b.drawImage(this.Wa,this.tj,this.uj,this.width,this.height,0,0,this.width,this.height):b.drawImage(this.Wa,0,0,this.width,this.height);this.Vo=a.toDataURL("image/png")}return this.Vo}function c(){}function b(a){a[0]=0;a[1]=0;a[2]=0;p.push(a)}function d(a,b){return athis.na&&(this.na=0);this.na>=this.yb.frames.length&&(this.na=this.yb.frames.length-1);var a=this.yb.frames[this.na];this.Ta.kl(a.Bn);this.Kd=a.Kd;this.Ld=a.Ld;this.Pi=this.yb.speed;this.dh=this.yb.Aq;1===this.type.Yd.length&&1===this.type.Yd[0].frames.length||0===this.Pi||(this.g.Dh(this),this.gi=!0);this.Pd?this.cf.reset():this.cf=new Pb;this.Gf=this.cf.Da;this.bg=!0;this.dg=0;this.Mh=!0;this.Zl=this.Gr="";this.Qr=0;this.Sj=-1;this.type.Up(); +var b,c,d,e,f,g,h,a=0;for(b=this.type.Yd.length;athis.na&&(this.na=0);this.na>=this.yb.frames.length&&(this.na=this.yb.frames.length-1);this.Pi=a.cas;this.Gf=a.fs;this.dg=a.ar;this.cf.reset();this.cf.Da=a.at;this.bg=a.hasOwnProperty("ap")?a.ap:!0;this.Mh=a.hasOwnProperty("af")?a.af:!0;a.hasOwnProperty("rt")?this.dh=a.rt:this.dh=this.yb.Aq;this.Tc=this.yb.frames[this.na];this.gm=this.Tc.Hb;this.Ta.kl(this.Tc.Bn); +this.Kd=this.Tc.Kd;this.Ld=this.Tc.Ld};n.Io=function(a){this.na=a?0:this.yb.frames.length-1;this.bg=!1;this.Gr=this.yb.name;this.kk=!0;this.g.trigger(N.prototype.M.Bv,this);this.g.trigger(N.prototype.M.Av,this);this.kk=!1;this.dg=0};n.j=function(){return this.cf.Da};n.Zb=function(){this.cf.add(this.g.Wi(this));this.Zl.length&&this.as();0<=this.Sj&&this.Yo();var a=this.cf.Da,b=this.yb,c=b.frames[this.na],d=c.duration/this.Pi;this.bg&&a>=this.Gf+d&&(this.Mh?this.na++:this.na--,this.Gf+=d,this.na>=b.frames.length&& +(b.Rt?(this.Mh=!1,this.na=b.frames.length-2):b.loop?this.na=this.dh:(this.dg++,this.dg>=b.zq?this.Io(!1):this.na=this.dh)),0>this.na&&(b.Rt?(this.na=1,this.Mh=!0,b.loop||(this.dg++,this.dg>=b.zq&&this.Io(!0))):b.loop?this.na=this.dh:(this.dg++,this.dg>=b.zq?this.Io(!0):this.na=this.dh)),0>this.na?this.na=0:this.na>=b.frames.length&&(this.na=b.frames.length-1),a>this.Gf+b.frames[this.na].duration/this.Pi&&(this.Gf=a),a=b.frames[this.na],this.Hi(c,a),this.g.La=!0)};n.ns=function(a){var b,c,d;b=0;for(c= +this.type.Yd.length;bthis.na&&(this.na=0),this.na>=this.yb.frames.length&&(this.na=this.yb.frames.length-1),1===this.Qr&&(this.na=0),this.bg=!0,this.Gf=this.cf.Da,this.Mh= +!0,this.Hi(a,this.yb.frames[this.na]),this.g.La=!0)};n.Yo=function(){var a=this.yb.frames[this.na],b=this.na;this.na=ua(this.Sj);0>this.na&&(this.na=0);this.na>=this.yb.frames.length&&(this.na=this.yb.frames.length-1);b!==this.na&&(this.Hi(a,this.yb.frames[this.na]),this.Gf=this.cf.Da,this.g.La=!0);this.Sj=-1};n.Hi=function(a,b){var c=a.width,d=a.height,e=b.width,f=b.height;c!=e&&(this.width*=e/c);d!=f&&(this.height*=f/d);this.Kd=b.Kd;this.Ld=b.Ld;this.Ta.kl(b.Bn);this.Ab();this.Tc=b;this.gm=b.Hb; +c=0;for(d=this.Oa.length;ce||e>=d.length)return b?this.x:this.y;var f=(d[e][1]-c.Kd)*this.width,d=d[e][2],d=(d-c.Ld)*this.height,c=Math.cos(this.R);e=Math.sin(this.R);var g=f*c-d*e,d=d*c+f*e,f=g+this.x,d=d+this.y;return b?f:d};var p=[],q=-2,u=[];c.prototype.Fv= +function(a){if(!a)return!1;var c=this.g,d=c.Em(),g=d.type,k=null;d.ma.collmemory?k=d.ma.collmemory:(k={},d.ma.collmemory=k);d.ma.spriteCreatedDestroyCallback||(d.ma.spriteCreatedDestroyCallback=!0,c.Ml(function(a){var c=d.ma.collmemory;a=a.uid;var e,f;for(e in c)c.hasOwnProperty(e)&&(f=c[e],f[0]===a||f[1]===a)&&(b(c[e]),delete c[e])}));var l=g.Za(),m=a.Za(),l=l.se(),n,p,v,r,t,x,A,R=this.g.Ce,L=R-1,C=c.wc().wd;for(p=0;pa.Fb||b.top>a.Eb)this.g.ga.deleteTexture(this.ie),this.Of=this.si=this.ie=null}};e.yg= +function(){this.Of=this.si=null;this.g.ga&&this.ie&&this.g.ga.deleteTexture(this.ie);this.ie=null};e.JA=function(){this.font=this.Ui+" "+this.dl.toString()+"pt "+this.hh;this.Bi=!0;this.g.La=!0};e.Ke=function(a,b){a.font=this.font;a.textBaseline="top";a.fillStyle=this.color;a.globalAlpha=b?1:this.opacity;var c=1;b&&(c=Math.abs(this.T.yd()),a.save(),a.scale(c,c));if(this.Bi||this.width!==this.Sp)this.type.tb.Mw(this.text,this.qh,a,this.width,this.cr),this.Bi=!1,this.Sp=this.width;this.kb();var c=b? +0:this.xb.Ec,d=b?0:this.xb.Fc;this.g.lf&&(c=c+.5|0,d=d+.5|0);0===this.R||b||(a.save(),a.translate(c,d),a.rotate(this.R),d=c=0);var e=d+this.height,f=this.uq,f=f+this.Tp,g,h;1===this.oo?d+=Math.max(this.height/2-this.qh.length*f/2,0):2===this.oo&&(d+=Math.max(this.height-this.qh.length*f-2,0));for(h=0;h=e-f);h++);(0!==this.R||b)&&a.restore(); +this.Jk=this.g.Ce};e.xd=function(a){if(!(1>this.width||1>this.height)){var b=this.Bi||this.dq;this.dq=!1;var c=this.T.yd(),d=this.T.vc(),e=this.zh,f=c*this.width,g=c*this.height,h=Math.ceil(f),l=Math.ceil(g),x=Math.abs(h),A=Math.abs(l),D=this.g.xa/2,F=this.g.wa/2;this.si||(this.Of=document.createElement("canvas"),this.Of.width=x,this.Of.height=A,this.Ym=x,this.Xm=A,b=!0,this.si=this.Of.getContext("2d"));if(x!==this.Ym||A!==this.Xm)this.Of.width=x,this.Of.height=A,this.ie&&(a.deleteTexture(this.ie), +this.ie=null),b=!0;b&&(this.si.clearRect(0,0,x,A),this.Ke(this.si,!0),this.ie||(this.ie=a.oe(x,A,this.g.Nb,this.g.nh)),a.RA(this.Of,this.ie,this.g.nh));this.Ym=x;this.Xm=A;a.le(this.ie);a.xi(this.opacity);a.Se();a.translate(-D,-F);a.De();var B=this.xb,b=this.T.mb(B.Ec,B.Fc,!0,!0),x=this.T.mb(B.Ec,B.Fc,!1,!0),A=this.T.mb(B.rd,B.sd,!0,!0),D=this.T.mb(B.rd,B.sd,!1,!0),F=this.T.mb(B.gd,B.hd,!0,!0),E=this.T.mb(B.gd,B.hd,!1,!0),w=this.T.mb(B.ed,B.fd,!0,!0),B=this.T.mb(B.ed,B.fd,!1,!0);if(this.g.lf||0=== +this.R&&0===d)var z=(b+.5|0)-b,K=(x+.5|0)-x,b=b+z,x=x+K,A=A+z,D=D+K,F=F+z,E=E+K,w=w+z,B=B+K;0===this.R&&0===d?(A=b+h,D=x,F=A,E=x+l,w=b,B=E,e.right=1,e.bottom=1):(e.right=f/h,e.bottom=g/l);a.Sf(b,x,A,D,F,E,w,B,e);a.Se();a.scale(c,c);a.Ln(-this.T.vc());a.translate((this.T.ub+this.T.Fb)/-2,(this.T.wb+this.T.Eb)/-2);a.De();this.Jk=this.g.Ce}};var g=[];h.Hw=function(a){I(g);for(var b="",c,d=0;d=f)c(d);else{if(100>=b.length&&-1===b.indexOf("\n")){var h=e.measureText(b).width;if(h<=f){c(d);d.push(a());d[0].text=b;d[0].width=h;return}}this.Nw(b,d,e,f,g)}else c(d)};h.Nw=function(c,d,e,f,h){h&&(this.Hw(c),c=g);var u="",t,v,r,x=0;for(r=0;r=d.length&&d.push(a()),u=b(u), +v=d[x],v.text=u,v.width=e.measureText(u).width,x++,u=""):(t=u,u+=c[r],v=e.measureText(u).width,v>=f&&(x>=d.length&&d.push(a()),t=b(t),v=d[x],v.text=t,v.width=e.measureText(t).width,x++,u=c[r],h||" "!==u||(u="")));u.length&&(x>=d.length&&d.push(a()),u=b(u),v=d[x],v.text=u,v.width=e.measureText(u).width,x++);for(r=x;ra&&(a=Math.round(1E10*a)/1E10);a=a.toString();this.text!==a&&(this.text=a,this.Bi=!0,this.g.La= +!0)};d.prototype.lw=function(a,b){var c="";switch(b){case 1:c="bold";break;case 2:c="italic";break;case 3:c="bold italic"}if(a!==this.hh||c!==this.Ui)this.hh=a,this.Ui=c,this.JA()};d.prototype.kw=function(a){a="rgb("+Ca(a).toString()+","+Fa(a).toString()+","+Ga(a).toString()+")";a!==this.color&&(this.color=a,this.dq=!0,this.g.La=!0)};h.ea=new d;f.prototype.Text=function(a){a.Xb(this.text)};h.Ja=new f})();function Cd(a){this.g=a} +(function(){function a(){}function c(){}function b(){}var d=Cd.prototype;d.nb=function(a){this.tb=a;this.g=a.g};d.nb.prototype.Ca=function(){};d.Ya=function(a){this.type=a;this.g=a.g};var f=d.Ya.prototype,h="text password email number tel url".split(" ");-1=d||0>=f||b>=h||c>=p?(this.Id||jQuery(this.X).hide(),this.Id=!0):(1>b&&(b=1),1>c&&(c=1),d>=h&&(d=h-1),f>=p&&(f=p-1),h=window.innerWidth,p=window.innerHeight,a||this.Dk!==b||this.Gk!==c||this.Fk!==d||this.zk!==f||this.Ik!==h||this.Hk!==p?(this.Dk=b,this.Gk=c,this.Fk=d,this.zk=f, +this.Ik=h,this.Hk=p,this.Id&&(jQuery(this.X).show(),this.Id=!1),a=Math.round(b)+jQuery(this.g.canvas).offset().left,h=Math.round(c)+jQuery(this.g.canvas).offset().top,jQuery(this.X).css("position","absolute"),jQuery(this.X).offset({left:a,top:h}),jQuery(this.X).width(Math.round(d-b)),jQuery(this.X).height(Math.round(f-c)),this.Jo&&jQuery(this.X).css("font-size",this.T.yd(!0)/this.g.devicePixelRatio-.2+"em")):this.Id&&(jQuery(this.X).show(),this.Id=!1))}};f.Ke=function(){};f.xd=function(){};a.prototype.cw= +function(){return!0};a.prototype.uo=function(){return!0};a.prototype.Hv=function(){return!0};d.M=new a;c.prototype.Bo=function(a){this.g.bb||(this.X.value=a)};c.prototype.Ii=function(a){this.g.bb||(this.visible=0!==a)};c.prototype.Kl=function(a){this.g.bb||(this.X.disabled=0===a)};d.ea=new c;b.prototype.Text=function(a){this.g.bb?a.Xb(""):a.Xb(this.X.value)};d.Ja=new b})();function Dd(a){this.g=a} +(function(){var a=Dd.prototype;a.nb=function(a){this.tb=a;this.g=a.g};var c=a.nb.prototype;c.Ca=function(){this.za||(this.Wa=new Image,this.Wa.Ur=this.Mq,this.g.Uu(this.Wa,this.Lq),this.Hb=this.pattern=null)};c.sn=function(){this.za||(this.Hb=null)};c.jq=function(){if(!this.za&&this.G.length){this.Hb||(this.Hb=this.g.ga.cn(this.Wa,!0,this.g.Nb,this.Nq));var a,c;a=0;for(c=this.G.length;ag&&(g+=this.Wa.width);0>l&&(l+=this.Wa.height);a.translate(c,f);a.rotate(this.R);a.translate(g,l);a.fillRect(h-g,e-l,this.width,this.height);a.restore()}; +c.Uh=function(a){this.xd(a)};c.xd=function(a){a.le(this.Hb);a.xi(this.opacity);var c=this.zh;c.right=this.width/this.Wa.width;c.bottom=this.height/this.Wa.height;var f=this.xb;if(this.g.lf){var h=Math.round(this.x)-this.x,e=Math.round(this.y)-this.y;a.Sf(f.Ec+h,f.Fc+e,f.rd+h,f.sd+e,f.gd+h,f.hd+e,f.ed+h,f.fd+e,c)}else a.Sf(f.Ec,f.Fc,f.rd,f.sd,f.gd,f.hd,f.ed,f.fd,c)};a.M=new function(){};a.ea=new function(){};a.Ja=new function(){}})();function Ed(a){this.g=a} +(function(){function a(a){m=a.x;k=a.y;n=a.z}function c(a,c,d,e){var f;f=p.length?p.pop():new b;f.init(a,c,d,e);return f}function b(){this.nl=this.id=this.y=this.x=this.Zn=this.Yn=this.Rp=this.time=this.Jq=0;this.rl=this.io=!1}function d(a){return a.sourceCapabilities&&a.sourceCapabilities.firesTouchEvents||a.originalEvent&&a.originalEvent.sourceCapabilities&&a.originalEvent.sourceCapabilities.firesTouchEvents}function f(){}function h(){}var e=Ed.prototype;e.nb=function(a){this.tb=a;this.g=a.g};e.nb.prototype.Ca= +function(){};e.Ya=function(a){this.type=a;this.g=a.g;this.touches=[];this.cq=!1};var g=e.Ya.prototype,l={left:0,top:0};g.ck=function(a){var b,c;b=0;for(c=this.touches.length;bvb(this.Yn,this.Zn,this.x,this.y)&&(this.io=!0,a.Zf=this.nl,a.Ej=this.id,a.Xi=b,a.g.trigger(Ed.prototype.M.Nv,a),a.ig=this.x,a.jg=this.y,a.g.trigger(Ed.prototype.M.Ov,a),a.Xi=0)};var q=-1E3,u=-1E3,t=-1E4;b.prototype.mt=function(a,b){if(!this.io){var c=zb();333>=c-this.Jq&&!this.rl&&15>vb(this.Yn,this.Zn, +this.x,this.y)&&(a.Zf=this.nl,a.Ej=this.id,a.Xi=b,666>=c-t&&25>vb(q,u,this.x,this.y)?(a.g.trigger(Ed.prototype.M.Iv,a),a.ig=this.x,a.jg=this.y,a.g.trigger(Ed.prototype.M.Jv,a),u=q=-1E3,t=-1E4):(a.g.trigger(Ed.prototype.M.aw,a),a.ig=this.x,a.jg=this.y,a.g.trigger(Ed.prototype.M.bw,a),q=this.x,u=this.y,t=c),a.Xi=0)}};g.Ca=function(){this.sz=!("undefined"===typeof window.c2isWindows8||!window.c2isWindows8);this.Xi=this.Ej=this.Zf=this.jg=this.ig=this.Br=this.Ar=this.yr=this.Qw=this.Pw=this.Ow=this.xn= +this.wn=this.vn=0;this.PA=0!==this.da[0];var b=0c-b.time||b.update(c,a.pageX-d.left,a.pageY-d.top,a.width||0,a.height||0,a.pressure||0)}}};g.Dt=function(a){if(a.pointerType!==a.MSPOINTER_TYPE_MOUSE&&"mouse"!==a.pointerType){a.preventDefault&&bc(a)&&a.preventDefault();var b=this.g.bb?l:jQuery(this.g.canvas).offset(),d=a.pageX-b.left,b=a.pageY-b.top;zb();this.Zf=this.touches.length; +this.Ej=a.pointerId;this.touches.push(c(d,b,a.pointerId,this.Zf));this.g.Md=!0;this.g.trigger(Ed.prototype.M.mr,this);this.g.trigger(Ed.prototype.M.or,this);this.ig=d;this.jg=b;this.g.trigger(Ed.prototype.M.yo,this);this.g.Md=!1}};g.tn=function(a,b){if(a.pointerType!==a.MSPOINTER_TYPE_MOUSE&&"mouse"!==a.pointerType){a.preventDefault&&bc(a)&&a.preventDefault();var c=this.ck(a.pointerId);this.Zf=0<=c?this.touches[c].nl:-1;this.Ej=0<=c?this.touches[c].id:-1;this.g.Md=!0;this.g.trigger(Ed.prototype.M.lr, +this);this.g.trigger(Ed.prototype.M.xo,this);0<=c&&(b||this.touches[c].mt(this,c),100>p.length&&p.push(this.touches[c]),this.touches.splice(c,1));this.g.Md=!1}};g.Ft=function(a){a.preventDefault&&a.preventDefault();var b=zb(),c,d,e,f;c=0;for(d=a.changedTouches.length;cb-f.time||f.update(b,e.pageX-g.left,e.pageY-g.top,2*(e.bC||e.iC||e.VB||e.YB||0),2*(e.cC||e.jC||e.WB|| +e.ZB||0),e.OB||e.hC||e.UB||e.XB||0)}};g.Gt=function(a){a.preventDefault&&bc(a)&&a.preventDefault();var b=this.g.bb?l:jQuery(this.g.canvas).offset();zb();this.g.Md=!0;var d,e,f,g;d=0;for(e=a.changedTouches.length;dp.length&&p.push(this.touches[e]),this.touches.splice(e,1));this.g.Md=!1};g.j=function(){return this.g.be&& +0===this.vn&&0!==n?90*n:this.vn};g.k=function(){return this.g.be&&0===this.wn&&0!==k?90*k:this.wn};g.A=function(){return this.g.be&&0===this.xn&&0!==m?90*m:this.xn};g.Hz=function(a){d(a)||(this.Gt({changedTouches:[{pageX:a.pageX,pageY:a.pageY,identifier:0}]}),this.cq=!0)};g.Iz=function(a){this.cq&&!d(a)&&this.Ft({changedTouches:[{pageX:a.pageX,pageY:a.pageY,identifier:0}]})};g.Jz=function(a){a.preventDefault&&this.g.vs&&!this.g.nh&&a.preventDefault();this.g.vs=!0;d(a)||(this.kq({changedTouches:[{pageX:a.pageX, +pageY:a.pageY,identifier:0}]}),this.cq=!1)};g.fo=function(){var a,b,c,d=zb();a=0;for(b=this.touches.length;ac||c>=this.touches.length)a.ua(0);else{var d,e,f,g,h;ka(b)?(d=this.g.fk(0),e=d.scale,f=d.vf,g=d.Qe,h=d.R,d.scale=1,d.vf=1,d.Qe=1,d.R=0,a.ua(d.td(this.touches[c].x,this.touches[c].y, +!0)),d.scale=e,d.vf=f,d.Qe=g,d.R=h):(d=ma(b)?this.g.fk(b):this.g.np(b))?a.ua(d.td(this.touches[c].x,this.touches[c].y,!0)):a.ua(0)}};h.prototype.Fo=function(a,b){var c=this.Xi;if(0>c||c>=this.touches.length)a.ua(0);else{var d,e,f,g,h;ka(b)?(d=this.g.fk(0),e=d.scale,f=d.vf,g=d.Re,h=d.R,d.scale=1,d.vf=1,d.Re=1,d.R=0,a.ua(d.td(this.touches[c].x,this.touches[c].y,!1)),d.scale=e,d.vf=f,d.Re=g,d.R=h):(d=ma(b)?this.g.fk(b):this.g.np(b))?a.ua(d.td(this.touches[c].x,this.touches[c].y,!1)):a.ua(0)}};e.Ja=new h})(); +function Fd(a){this.g=a} +(function(){function a(){}function c(){}function b(){}var d=Fd.prototype;d.nb=function(a){this.tb=a;this.g=a.g};d.nb.prototype.Ca=function(){};d.Ya=function(a){this.type=a;this.g=a.g};var f=d.Ya.prototype,h="",e="undefined"!==typeof window.is_scirra_arcade;e&&(h="arcade"+window.scirra_arcade_id);var g=!1;try{localStorage.getItem("test"),g=!0}catch(l){g=!1}f.Ca=function(){g||ga("[Construct 2] Webstorage plugin: local storage is not supported on this platform.")};a.prototype.Wv=function(){return!0}; +d.M=new a;c.prototype.Fw=function(a,b){if(g)try{localStorage.setItem(h+a,b)}catch(c){this.g.trigger(Fd.prototype.M.Wv,this)}};c.prototype.av=function(){g&&(e||localStorage.clear())};d.ea=new c;b.prototype.yv=function(a,b){g?a.Xb(localStorage.getItem(h+b)||""):a.Xb("")};b.prototype.er=function(a){if(g){var b={},c,d,f;c=0;for(d=localStorage.length;c=this.qi&&(this.K.opacity=this.qi,this.Dc=1,this.Ue.reset(),this.g.trigger(Hd.prototype.M.Kv,this.K)));1===this.Dc&&this.Ue.Da>=this.Al&&(this.Dc= +2,this.Ue.reset(),this.g.trigger(Hd.prototype.M.ew,this.K));2===this.Dc&&0!==this.tm&&(this.K.opacity=this.qi-this.Ue.Da/this.tm*this.qi,this.g.La=!0,0>this.K.opacity&&(this.K.opacity=0,this.Dc=3,this.Ue.reset(),this.g.trigger(Hd.prototype.M.Lv,this.K),1===this.kx&&this.g.Qg(this.K)))};b.j=function(){this.Dc=0;this.Ue.reset();0===this.$j?(this.Dc=1,0===this.Al&&(this.Dc=2)):(this.K.opacity=0,this.g.La=!0)};a.prototype.Lv=function(){return!0};a.prototype.Kv=function(){return!0};a.prototype.ew=function(){return!0}; +c.M=new a;c.ea=new function(){};c.Ja=new function(){}})();function Id(a){this.g=a} +(function(){function a(){}function c(){}var b=Id.prototype;b.nb=function(a){this.behavior=a;this.g=a.g};b.nb.prototype.Ca=function(){};b.Ya=function(a,b){this.type=a;this.behavior=a.behavior;this.K=b;this.g=a.g};var d=b.Ya.prototype;d.Ca=function(){this.qf=this.Vf=this.Dc=this.rn=this.un=0};d.Pc=function(){return{ontime:this.un,offtime:this.rn,stage:this.Dc,stagetimeleft:this.Vf,timeleft:this.qf}};d.md=function(a){this.un=a.ontime;this.rn=a.offtime;this.Dc=a.stage;this.Vf=a.stagetimeleft;this.qf= +a.timeleft;null===this.qf&&(this.qf=Infinity)};d.Zb=function(){if(!(0>=this.qf)){var a=this.g.Wi(this.K);this.qf-=a;0>=this.qf?(this.qf=0,this.K.visible=!0,this.g.La=!0,this.g.trigger(Id.prototype.M.Mv,this.K)):(this.Vf-=a,0>=this.Vf&&(0===this.Dc?(this.K.visible=!1,this.Dc=1,this.Vf+=this.rn):(this.K.visible=!0,this.Dc=0,this.Vf+=this.un),this.g.La=!0))}};a.prototype.Mv=function(){return!0};b.M=new a;c.prototype.lv=function(a,b,c){this.un=a;this.rn=b;this.Dc=1;this.Vf=b;this.qf=c;this.K.visible= +!1;this.g.La=!0};c.prototype.Ew=function(){this.qf=0;this.K.visible=!0;this.g.La=!0};b.ea=new c;b.Ja=new function(){}})();function Jd(a,c){for(var b in c.prototype)c.prototype.hasOwnProperty(b)&&(a.prototype[b]=c.prototype[b])}var Kd=2/180*Math.PI,Ld=8/180*Math.PI,Md=.5*Math.PI,Nd=Md*Md,Od=2/180*Math.PI,Pd=Number.MIN_VALUE*Number.MIN_VALUE;function Qd(a,c){return a.x*c.x+a.y*c.y}function Rd(a,c){return a.x*c.y-a.y*c.x}function Sd(a){return Y(1*a.y,-1*a.x)} +function Td(a,c){return Y(a.q.x*c.x+a.u.x*c.y,a.q.y*c.x+a.u.y*c.y)}function Ud(a,c){return Y(Qd(c,a.q),Qd(c,a.u))}function Vd(a,c){var b=Td(a.C,c);b.x+=a.position.x;b.y+=a.position.y;return b}function Wd(a,c){var b=Xd(c,a.position),d=b.x*a.C.q.x+b.y*a.C.q.y;b.y=b.x*a.C.u.x+b.y*a.C.u.y;b.x=d;return b}function Xd(a,c){return Y(a.x-c.x,a.y-c.y)}function Yd(a,c,b){return ab?b:a}function Zd(){this.q=Y(0,0);this.u=Y(0,0);this.q.Set(1,0);this.u.Set(0,1)} +function $d(a){var c=new Zd;c.Set(a);return c}Zd.prototype.Set=function(a){var c=Math.cos(a);a=Math.sin(a);this.q.Set(c,a);this.u.Set(-a,c)};Zd.prototype.rc=function(){var a=new Zd;ae(a,this);return a};function ae(a,c){a.q.P(c.q);a.u.P(c.u)}Zd.prototype.ya=function(){this.q.Set(0,0);this.u.Set(0,0)};Zd.prototype.Ih=function(){return Math.atan2(this.q.y,this.q.x)};function re(a,c){var b=a.q.x*a.u.y-a.u.x*a.q.y;0!==b&&(b=1/b);c.q.x=b*a.u.y;c.u.x=-b*a.u.x;c.q.y=-b*a.q.y;c.u.y=b*a.q.x} +function se(a,c,b,d){var f=a.q.x*a.u.y-a.u.x*a.q.y;0!==f&&(f=1/f);c.x=f*(a.u.y*b-a.u.x*d);c.y=f*(a.q.x*d-a.q.y*b);return c}function te(a,c,b){this.q=new ue(0,0,0);this.u=new ue(0,0,0);this.j=new ue(0,0,0);a&&this.q.P(a);c&&this.u.P(c);b&&this.j.P(b)}te.prototype.rc=function(){return new te(this.q,this.u,this.j)};te.prototype.ya=function(){this.q.Set(0,0,0);this.u.Set(0,0,0);this.j.Set(0,0,0)}; +function ve(a,c,b,d){var f=a.q.x,h=a.u.x,e=a.q.y;a=a.u.y;var g=f*a-h*e;0!=g&&(g=1/g);c.x=g*(a*b-h*d);c.y=g*(f*d-e*b);return c}function we(a,c,b,d,f){var h=a.q.x,e=a.q.y,g=a.q.z,l=a.u.x,m=a.u.y,k=a.u.z,n=a.j.x,p=a.j.y;a=a.j.z;var q=h*(m*a-k*p)+e*(k*n-l*a)+g*(l*p-m*n);0!=q&&(q=1/q);c.x=q*(b*(m*a-k*p)+d*(k*n-l*a)+f*(l*p-m*n));c.y=q*(h*(d*a-f*p)+e*(f*n-b*a)+g*(b*p-d*n));c.z=q*(h*(m*f-k*d)+e*(k*b-l*f)+g*(l*d-m*b));return c}function xe(){this.U=Y(0,0);this.Hc=Y(0,0);this.F=Y(0,0)} +xe.prototype.Set=function(a){this.U.P(a.U);this.Hc.P(a.Hc);this.F.P(a.F);this.Ge=a.Ge;this.S=a.S;this.qd=a.qd};xe.prototype.rc=function(){var a=new xe;a.U.P(this.U);a.Hc.P(this.Hc);a.F.P(this.F);a.Ge=this.Ge;a.S=this.S;a.qd=this.qd;return a};xe.prototype.Vd=function(a,c){void 0===c&&(c=0);a.position.x=(1-c)*this.Hc.x+c*this.F.x;a.position.y=(1-c)*this.Hc.y+c*this.F.y;a.C.Set((1-c)*this.Ge+c*this.S);var b=a.C;a.position.x-=b.q.x*this.U.x+b.u.x*this.U.y;a.position.y-=b.q.y*this.U.x+b.u.y*this.U.y}; +xe.prototype.Pg=function(a){void 0===a&&(a=0);if(this.qdNumber.MIN_VALUE){var c=(a-this.qd)/(1-this.qd);this.Hc.x=(1-c)*this.Hc.x+c*this.F.x;this.Hc.y=(1-c)*this.Hc.y+c*this.F.y;this.Ge=(1-c)*this.Ge+c*this.S;this.qd=a}};function ye(a,c){this.position=Y(0,0);this.C=new Zd;a&&this.position.P(a);c&&ae(this.C,c)}ye.prototype.Set=function(a){this.position.P(a.position);ae(this.C,a.C)};ye.prototype.Ih=function(){return Math.atan2(this.C.q.y,this.C.q.x)}; +function ze(a,c){this.x=a;this.y=c}var Ae=[];function Y(a,c){if(0this.cb)return d.P(b),Math.PI*this.j;c=f*f;f=this.j*(Math.asin(f/this.cb)+Math.PI/2)+f*Math.sqrt(this.j-c);c=-2/3*Math.pow(this.j-c,1.5)/f;d.x=b.x+a.x*c;d.y=b.y+a.y*c;return f};y.Ao=function(a){a.V=[this.ob];a.j=1;a.cb=this.cb}; +function He(a,c){this.cb=.005;this.j=a;this.k=c;this.A=Y(this.k.x-this.j.x,this.k.y-this.j.y);Ee(this.A);this.D=Y(this.A.y,-this.A.x);Y(-.04*(this.D.x-this.A.x)+this.j.x,-.04*(this.D.y-this.A.y)+this.j.y);Y(-.04*(this.D.x+this.A.x)+this.k.x,-.04*(this.D.y+this.A.y)+this.k.y);Y(-this.D.x,-this.D.y)}Jd(He,Fe);He.prototype.Kh=function(){return"b2EdgeShape"}; +He.prototype.Hh=function(a,c){var b=c.C,d=c.position.x+(b.q.x*this.j.x+b.u.x*this.j.y),f=c.position.y+(b.q.y*this.j.x+b.u.y*this.j.y),h=c.position.x+(b.q.x*this.k.x+b.u.x*this.k.y),b=c.position.y+(b.q.y*this.k.x+b.u.y*this.k.y);dm?e:m,g=g>d?g:d;a.j.x=f-this.cb;a.j.y=h-this.cb;a.k.x=e+this.cb;a.k.y=g+this.cb}; +y.Jj=function(a,c){if(2==this.ib)a.k.x=.5*(this.V[0].x+this.V[1].x),a.k.y=.5*(this.V[0].y+this.V[1].y),a.j=0,a.A=0;else{for(var b=0,d=0,f=0,h=0,e=1/3,g=0;gb&&(c=d,b=f)}return c}; +y.Lj=function(a){for(var c=0,b=this.V[0].x*a.x+this.V[0].y*a.y,d=1;db&&(c=d,b=f)}return this.V[c]};function Ke(a,c){a.V=[];a.sb=[];for(var b=a.V.length;b>8&255;a.k=(a.$b&16711680)>>16&255;a.D=(a.$b&4278190080)>>24&255}Ne.prototype.Set=function(a){Oe(this,a.$b)}; +Ne.prototype.rc=function(){var a=new Ne;a.Set(this);return a};function Pe(){this.Fe=Y(0,0);this.id=new Ne}Pe.prototype.Set=function(a){this.Fe.P(a.Fe);this.id.Set(a.id)};function Ue(){this.j=Y(0,0);this.k=Y(0,0)}var Ve=[];function We(){if(0=g&&a[f++].Set(c[0]);0>=b&&a[f++].Set(c[1]);0>g*b&&(b=g/(g-b),d=a[f].Fe,d.x=h.x+b*(e.x-h.x),d.y=h.y+b*(e.y-h.y),a[f].id=0g&&(g=m,f=l)}e=$e(a,c,f,b,d);h=f-1;0>h&&(h=a.ib-1);g=$e(a,c,h,b,d);l=f+1;l>=a.ib&&(l=0);var m=$e(a,c,l,b,d),k=0,n=0;if(g>e&&g>m)for(k=h,n=g;;)if(f=k-1,0>f&&(f=a.ib-1),e= +$e(a,c,f,b,d),e>n)k=f,n=e;else break;else if(m>e)for(k=l,n=m;;)if(f=k+1,f>=a.ib&&(f=0),e=$e(a,c,f,b,d),e>n)k=f,n=e;else break;else k=f,n=e;return{Kr:k,Pn:n}} +function bf(a,c,b){var d=new cf,f=b.Bg,h=b.j,e=b.Cg,g=b.k,l,m;d.j=c.count;for(var k=d.V,n=0;nf;){h=[];for(e=0;e=g?(e.k.S=1,e.j=1):(k=k.x*l.x+k.y*l.y,0>=k?(e.A.S=1,e.j=1,e.k.Set(e.A)):(l=1/(k+g),e.k.S=k*l,e.A.S=g*l,e.j=2));else if(3==d.j){var e=d,q=e.k.Qc,u=e.A.Qc,t=e.D.Qc,v=Xd(u,q),g=Qd(u,v),k=-Qd(q,v),r=Xd(t,q);l=Qd(t,r);m=-Qd(q,r);p=Xd(t,u);n=Qd(t,p);p=-Qd(u,p);r=Rd(v,r);v=r*Rd(u,t);t=r*Rd(t,q);q=r*Rd(q,u);0>=k&&0>=m?(e.k.S=1,e.j=1):0=q?(l=1/(g+k),e.k.S=g*l,e.A.S=k*l,e.j=2):0=t?(g=1/(l+m),e.k.S=l*g,e.D.S=m*g,e.j=2,e.A.Set(e.D)):0>=g&&0>=p?(e.A.S=1,e.j= +1,e.k.Set(e.A)):0>=l&&0>=n?(e.D.S=1,e.j=1,e.k.Set(e.D)):0=v?(g=1/(n+p),e.A.S=n*g,e.D.S=p*g,e.j=2,e.k.Set(e.D)):(g=1/(v+t+q),e.k.S=v*g,e.A.S=t*g,e.D.S=q*g,e.j=3)}if(3==d.j)break;e=d;1==e.j?e=e.k.Qc.Rg():2==e.j?(g=Xd(e.A.Qc,e.k.Qc),e=0c+b&&a.A>Number.MIN_VALUE?(a.A-=c+b,d=Xd(a.k,a.j),Ee(d),a.j.x+=c*d.x,a.j.y+=c*d.y,a.k.x-=b*d.x,a.k.y-=b*d.y,Be(d)):(b=Y(0,0),b.x=.5*(a.j.x+a.k.x),b.y=.5*(a.j.y+a.k.y),a.j.x=a.k.x=b.x,a.j.y=a.k.y=b.y,a.A=0,Be(b)))}function ff(){}function gf(){this.j=Y(0,0);this.k=Y(0,0);this.A=0}function hf(){}hf.prototype.Set=function(a){a.Ao(this)}; +hf.prototype.Dl=function(a){for(var c=0,b=this.V[0].x*a.x+this.V[0].y*a.y,d=1;db&&(c=d,b=f)}return c};hf.prototype.Lj=function(a){return this.V[this.Dl(a)]};function df(a,c){void 0===c&&(c=0);return a.V[c]}function jf(){this.j=null}jf.prototype.Ei=function(a){kf(this,a);a.cd()};function lf(a,c,b){if(null!==a.j){var d=[];for(d.push(a.j);0a;a++)this.ta[a]=new vf;this.Mc=Y(0,0);this.Ba=Y(0,0)}uf.prototype.Gc=function(){for(var a=0;2>a;a++)this.ta[a].Gc();this.Mc.ya();this.Ba.ya();this.Tb=this.eb=0}; +uf.prototype.Set=function(a){this.Tb=a.Tb;for(var c=0;2>c;c++)this.ta[c].Set(a.ta[c]);this.Mc.P(a.Mc);this.Ba.P(a.Ba);this.eb=a.eb};uf.prototype.rc=function(){var a=new uf;a.Set(this);return a};function vf(){this.Ba=Y(0,0);this.Ne=new Ne;this.Gc()}vf.prototype.Gc=function(){this.Ba.ya();this.pi=this.oi=0;Oe(this.Ne,0)};vf.prototype.Set=function(a){this.Ba.P(a.Ba);this.oi=a.oi;this.pi=a.pi;this.Ne.Set(a.Ne)}; +function wf(){var a=Af,c=Ff,b=Mf,d,f,h=0;switch(a.eb){case Nf:d=Ud(c.C,a.j);f=Ud(b.C,a.j.Rg());d=a.k.Lj(d);f=a.A.Lj(f);c=Vd(c,d);b=Vd(b,f);h=(b.x-c.x)*a.j.x+(b.y-c.y)*a.j.y;break;case Of:h=Td(c.C,a.j);c=Vd(c,a.Ba);f=Ud(b.C,h.Rg());f=a.A.Lj(f);b=Vd(b,f);h=(b.x-c.x)*h.x+(b.y-c.y)*h.y;break;case Pf:h=Td(b.C,a.j),b=Vd(b,a.Ba),d=Ud(c.C,h.Rg()),d=a.k.Lj(d),c=Vd(c,d),h=(c.x-b.x)*h.x+(c.y-b.y)*h.y}return h}var Nf=1,Of=2,Pf=4; +function cf(){this.k=new Qf;this.A=new Qf;this.D=new Qf;this.V=[this.k,this.A,this.D]}function ef(a){return 1==a.j?0:2==a.j?Ce(Xd(a.k.Qc,a.A.Qc)):3==a.j?Rd(Xd(a.A.Qc,a.k.Qc),Xd(a.D.Qc,a.k.Qc)):0}function Rf(){this.ac=[0,0,0];this.cc=[0,0,0]}function Qf(){}Qf.prototype.Set=function(a){this.$c.P(a.$c);this.Ye.P(a.Ye);this.Qc.P(a.Qc);this.S=a.S;this.ac=a.ac;this.cc=a.cc};function Sf(){this.Bg=new hf;this.Cg=new hf;this.yu=new xe;this.zu=new xe} +function Tf(a,c){this.ka="Body"+Uf++;this.H=new ye;this.H.position.P(a.position);this.H.C.Set(a.R);this.n=new xe;this.n.U.ya();this.n.qd=1;this.n.Ge=this.n.S=a.R;this.n.F.x=this.H.C.q.x*this.n.U.x+this.H.C.u.x*this.n.U.y;this.n.F.y=this.H.C.q.y*this.n.U.x+this.H.C.u.y*this.n.U.y;this.n.F.x+=this.H.position.x;this.n.F.y+=this.H.position.y;this.n.Hc.P(this.n.F);this.B=a.N.rc();this.A=Y(0,0);this.N=a.Mi;this.rb=a.j;this.Ha=a.k;this.ge=a.D;this.I=a.ic;this.nd=c;this.Ib=null;this.ud=new Vf;this.fa=new Wf; +this.J=a.A;this.gb=a.lj;this.Ma=a.Ki;this.aa=this.D=0;this.eb=a.type;this.Z=2==this.eb?1:0;this.O=2==this.eb?1:0;this.Y=this.j=0;this.Na=a.I;this.k=new Xf;this.L=[]}function Yf(a,c){var b=new Zf(a,0,c);if(a.I){var d=a.nd.j.j;b.fc.Hh(b.j,a.H);b.k=pf(d,b.j,b)}var d=a.k,f=b.gr;if(null==d.j[f]){var h=new $f(b),e=d.A;null!=e?e.next=h:d.k=h;h.ag(e);d.A=h;d.j[f]=h}b.$p=a;0Nd&&(fa.J=0>fa.J?-Md*qb.j:Md*qb.j);fa.n.Hc.P(fa.n.F);fa.n.Ge=fa.n.S;fa.n.F.x+=qb.Fa*fa.B.x;fa.n.F.y+=qb.Fa*fa.B.y;fa.n.S+=qb.Fa*fa.J;lg(fa)}for(var Re=w,Ai=z,bh=0;bhOd||1E-4=lh.A){kb=1;break}var Ui=Cf, +S=Af,Ba=jh,lb=Ff,mb=Mf;S.k=Bf;S.A=Ui;var Kb=void 0,nb=void 0,Bb=void 0,Lb=void 0,ob=void 0,Cb=void 0,Ac=0,Bc=0,Cc=0,Dc=0,ie=0,je=0,T=void 0,U=void 0,$a=0;if(1==Ba.count)S.eb=Nf,Kb=df(S.k,Ba.ac[0]),Lb=df(S.A,Ba.cc[0]),U=Kb,T=lb.C,Ac=lb.position.x+(T.q.x*U.x+T.u.x*U.y),Bc=lb.position.y+(T.q.y*U.x+T.u.y*U.y),U=Lb,T=mb.C,Cc=mb.position.x+(T.q.x*U.x+T.u.x*U.y),Dc=mb.position.y+(T.q.y*U.x+T.u.y*U.y),S.j.x=Cc-Ac,S.j.y=Dc-Bc,Ee(S.j);else{if(Ba.cc[0]==Ba.cc[1])S.eb=Of,nb=df(S.k,Ba.ac[0]),Bb=df(S.k,Ba.ac[1]), +Lb=df(S.A,Ba.cc[0]),S.Ba.x=.5*(nb.x+Bb.x),S.Ba.y=.5*(nb.y+Bb.y),S.j=Sd(Xd(Bb,nb)),Ee(S.j),U=S.j,T=lb.C,ie=T.q.x*U.x+T.u.x*U.y,je=T.q.y*U.x+T.u.y*U.y,U=S.Ba,T=lb.C,Ac=lb.position.x+(T.q.x*U.x+T.u.x*U.y),Bc=lb.position.y+(T.q.y*U.x+T.u.y*U.y),U=Lb,T=mb.C,Cc=mb.position.x+(T.q.x*U.x+T.u.x*U.y),Dc=mb.position.y+(T.q.y*U.x+T.u.y*U.y),$a=(Cc-Ac)*ie+(Dc-Bc)*je;else if(Ba.ac[0]==Ba.ac[0])S.eb=Pf,ob=df(S.A,Ba.cc[0]),Cb=df(S.A,Ba.cc[1]),Kb=df(S.k,Ba.ac[0]),S.Ba.x=.5*(ob.x+Cb.x),S.Ba.y=.5*(ob.y+Cb.y),S.j=Sd(Xd(Cb, +ob)),Ee(S.j),U=S.j,T=mb.C,ie=T.q.x*U.x+T.u.x*U.y,je=T.q.y*U.x+T.u.y*U.y,U=S.Ba,T=mb.C,Cc=mb.position.x+(T.q.x*U.x+T.u.x*U.y),Dc=mb.position.y+(T.q.y*U.x+T.u.y*U.y),U=Kb,T=lb.C,Ac=lb.position.x+(T.q.x*U.x+T.u.x*U.y),Bc=lb.position.y+(T.q.y*U.x+T.u.y*U.y),$a=(Ac-Cc)*ie+(Bc-Dc)*je;else{var nb=df(S.k,Ba.ac[0]),Bb=df(S.k,Ba.ac[1]),ob=df(S.A,Ba.cc[0]),Cb=df(S.A,Ba.cc[1]),Db=Td(lb.C,Xd(Bb,nb)),Eb=Td(mb.C,Xd(Cb,ob)),Vh=Db.x*Db.x+Db.y*Db.y,Gf=Eb.x*Eb.x+Eb.y*Eb.y,ke=Xd(Eb,Db),Wh=Db.x*ke.x+Db.y*ke.y,Xh=Eb.x* +ke.x+Eb.y*ke.y,kd=Db.x*Eb.x+Db.y*Eb.y,Yh=Vh*Gf-kd*kd,$a=0;0!=Yh&&($a=Yd((kd*Xh-Wh*Gf)/Yh,0,1));0>(kd*$a+Xh)/Gf&&($a=Yd((kd-Wh)/Vh,0,1));Kb=Y(0,0);Kb.x=nb.x+$a*(Bb.x-nb.x);Kb.y=nb.y+$a*(Bb.y-nb.y);Lb=Y(0,0);Lb.x=ob.x+$a*(Cb.x-ob.x);Lb.y=ob.y+$a*(Cb.y-ob.y);0==$a||1==$a?(S.eb=Pf,S.j=Sd(Xd(Cb,ob)),Ee(S.j),S.Ba=Lb):(S.eb=Of,S.j=Sd(Xd(Bb,nb)),S.Ba=Kb)}if(0>$a){var le=S.j;le.x=-le.x;le.y=-le.y}}var ld=wf();if(0>=ld){kb=1;break}0==jd&&(yc=ld>ge?Math.max(ge-he,.75*ge):Math.max(ld-he,.02*ge));if(ld-yc<.5* +he){if(0==jd){kb=1;break}break}var Hf=kb,me=kb,md=1,If=ld;Df.Vd(Ff,md);Ef.Vd(Mf,md);var Jf=wf();if(Jf>=yc){kb=1;break}for(var ne=0;;){var Ec=0,Ec=ne&1?me+(yc-If)*(md-me)/(Jf-If):.5*(me+md);Df.Vd(Ff,Ec);Ef.Vd(Mf,Ec);var oe=wf();if(Math.abs(oe-yc)<.025*he){Hf=Ec;break}oe>yc?(me=Ec,If=oe):(md=Ec,Jf=oe);ne++;mh++;if(50==ne)break}nh=Math.max(nh,ne);if(Hf<(1+100*Number.MIN_VALUE)*kb)break;kb=Hf;jd++;oh++;if(1E3==jd)break}ph=Math.max(ph,jd);Za=kb;0Za&&(Za=(1-Za)*hd+Za);jb.j=Za}Number.MIN_VALUENd&&(ha.J=0>ha.J?-Md*Sa.j:Md*Sa.j);ha.n.Hc.P(ha.n.F);ha.n.Ge=ha.n.S;ha.n.F.x+=Sa.Fa*ha.B.x;ha.n.F.y+=Sa.Fa*ha.B.y;ha.n.S+=Sa.Fa*ha.J;lg(ha)}for(Ta=0;Taf*f||(a.eb=1,a.Ba.P(c.ob),a.Mc.ya(),a.Tb=1,a.ta[0].Ba.P(d.ob),Oe(a.ta[0].Ne,0))}; +function zh(){this.N=Y(0,0);this.Rb=Y(0,0);this.D=Y(0,0);this.vg=new Zd;this.L=new Zd;this.A=[];for(var a=0;2>a;a++)this.A[a]=new Ah}function Ah(){this.Rb=Y(0,0);this.Jb=Y(0,0);this.Kb=Y(0,0)}Ah.prototype.Gc=function(){this.Rb.Set(0,0);this.Jb.Set(0,0);this.Kb.Set(0,0)}; +function Eg(){this.j={};this.k={};Bh(this,yh,"b2CircleShape","b2CircleShape");Bh(this,Ch,"b2PolygonShape","b2CircleShape");Bh(this,Dh,"b2PolygonShape","b2PolygonShape");Bh(this,Eh,"b2EdgeShape","b2CircleShape");Bh(this,Fh,"b2PolygonShape","b2EdgeShape")}function Bh(a,c,b,d){a.k[b]=a.k[b]||{};a.k[b][d]=a.k[b][d]||[];a.j[b]=a.j[b]||{};a.j[b][d]=new Gh;a.j[b][d].Xr=c;a.j[b][d].Wt=!0;b!=d&&(a.j[d]=a.j[d]||{},a.j[d][b]=new Gh,a.j[d][b].Xr=c,a.j[d][b].Wt=!1)} +Eg.prototype.A=function(a,c){var b=a.fc.Kh(),d=c.fc.Kh(),f=this.j[b][d],h=f.Xr;return null!=h?f.Wt?0e?h:e;var e=m.B.x,h=m.B.y,q=k.B.x,u=k.B.y,t=m.J,v=k.J,r=f,x=m.H,A=g,D=k.H,F=l,B=Lh;if(0!=r.Tb){var E=0,w=void 0,z=void 0,K=0,O=0,Z=0,W=0,P=0,w=0;switch(r.eb){case 1:z=x.C;w=r.Ba;E=x.position.x+z.q.x*w.x+z.u.x*w.y;x=x.position.y+z.q.y*w.x+z.u.y*w.y;z=D.C;w=r.ta[0].Ba;r=D.position.x+z.q.x*w.x+z.u.x*w.y;D= +D.position.y+z.q.y*w.x+z.u.y*w.y;w=r-E;z=D-x;K=w*w+z*z;K>Pd?(K=Math.sqrt(K),B.j.x=w/K,B.j.y=z/K):(B.j.x=1,B.j.y=0);w=x+A*B.j.y;D=D-F*B.j.y;B.ta[0].x=.5*(E+A*B.j.x+(r-F*B.j.x));B.ta[0].y=.5*(w+D);break;case 2:z=x.C;w=r.Mc;K=z.q.x*w.x+z.u.x*w.y;O=z.q.y*w.x+z.u.y*w.y;z=x.C;w=r.Ba;Z=x.position.x+z.q.x*w.x+z.u.x*w.y;W=x.position.y+z.q.y*w.x+z.u.y*w.y;B.j.x=K;B.j.y=O;for(E=0;En&&(l.xl+=-A.Ah*n);2==A.I&& +(u=A.A[0],q=A.A[1],f=m.O,m=m.Y,e=k.O,k=k.Y,h=u.Jb.x*B-u.Jb.y*F,u=u.Kb.x*B-u.Kb.y*F,t=q.Jb.x*B-q.Jb.y*F,g=q.Kb.x*B-q.Kb.y*F,q=f+e+m*h*h+k*u*u,v=f+e+m*t*t+k*g*g,k=f+e+m*h*t+k*u*g,q*q<100*(q*v-k*k)?(A.L.q.Set(q,k),A.L.u.Set(k,v),re(A.L,A.vg)):A.I=1)}} +function eh(a){for(var c=0;cPd?(A=Math.sqrt(A),p.j.x=u/A,p.j.y=x/A):(p.j.x=1,p.j.y=0);p.ta[0].x=.5*(t+r);p.ta[0].y=.5*(v+q);p.k[0]=u*p.j.x+x* +p.j.y-n.aa;break;case 2:p.j.x=n.j.H.C.q.x*n.N.x+n.j.H.C.u.x*n.N.y;p.j.y=n.j.H.C.q.y*n.N.x+n.j.H.C.u.y*n.N.y;t=n.j.H.position.x+(n.j.H.C.q.x*n.Rb.x+n.j.H.C.u.x*n.Rb.y);v=n.j.H.position.y+(n.j.H.C.q.y*n.Rb.x+n.j.H.C.u.y*n.Rb.y);for(r=0;rg)break a;m>e&&(e=m,h=l)}m=h+1;m>=c.ib&&(m=0);var l=c.V[h],k=c.V[m];e=(f-l.x)*(k.x-l.x)+(b-l.y)*(k.y-l.y)?(f-l.x)*(f-l.x)+(b-l.y)*(b-l.y)>g*g||(a.Tb=1,a.eb=2,a.Mc.x=f-l.x,a.Mc.y=b-l.y,Ee(a.Mc),a.Ba.P(l),a.ta[0].Ba.P(d.ob),Oe(a.ta[0].Ne,0)):0>=(f-k.x)*(l.x-k.x)+(b-k.y)*(l.y-k.y)?(f-k.x)*(f-k.x)+(b-k.y)*(b-k.y)>g*g||(a.Tb=1,a.eb=2,a.Mc.x=f-k.x,a.Mc.y=b-k.y,Ee(a.Mc),a.Ba.P(k),a.ta[0].Ba.P(d.ob),Oe(a.ta[0].Ne,0)):(m=.5*(l.x+k.x),l=.5*(l.y+k.y),e=(f-m)*c.sb[h].x+(b-l)*c.sb[h].y,e>g||(a.Tb=1, +a.eb=2,a.Mc.x=c.sb[h].x,a.Mc.y=c.sb[h].y,Ee(a.Mc),a.Ba.Set(m,l),a.ta[0].Ba.P(d.ob),Oe(a.ta[0].Ne,0)))}};function Fh(a,c){sh.call(this,a,c)}Jd(Fh,sh);Fh.prototype.Gc=function(a,c){sh.prototype.Gc.call(this,a,c)};Fh.prototype.A=function(){};function Dh(a,c){sh.call(this,a,c)}Jd(Dh,sh);Dh.prototype.Gc=function(a,c){sh.prototype.Gc.call(this,a,c)}; +Dh.prototype.A=function(){var a=this.we,c=this.ec.fc,b=this.ec.fb().H,d=this.Sb.fc,f=this.Sb.fb().H;a.Tb=0;var h=c.cb+d.cb,e=af(c,b,d,f),g=e.Kr;if(!(e.Pn>h)){var l=af(d,f,c,b);if(!(l.Pn>h)){var m=c,k=d,n=b,p=f,q=0;a.eb=2;l.Pn>.98*e.Pn+.001&&(m=d,k=c,n=f,p=b,g=l.Kr,a.eb=4,q=1);c=g;b=k;d=p;k=Oh;void 0===c&&(c=0);for(var e=n.C.q.x*m.sb[c].x+n.C.u.x*m.sb[c].y,l=n.C.q.y*m.sb[c].x+n.C.u.y*m.sb[c].y,f=d.C.q.x*e+d.C.q.y*l,l=d.C.u.x*e+d.C.u.y*l,e=f,f=0,u=Number.MAX_VALUE,t=0;t=b.ib&&(e=0);k[0].Fe.x=d.position.x+(d.C.q.x*b.V[f].x+d.C.u.x*b.V[f].y);k[0].Fe.y=d.position.y+(d.C.q.y*b.V[f].x+d.C.u.y*b.V[f].y);l=k[0].id;l.A=c;l.$b=l.$b&4294967040|l.A&255;l=k[0].id;l.j=f;l.$b=l.$b&4294902015|l.j<<8&65280;f=k[0].id;f.k=0;f.$b=f.$b&4278255615|f.k<<16&16711680;k[1].Fe.x=d.position.x+(d.C.q.x*b.V[e].x+d.C.u.x*b.V[e].y);k[1].Fe.y=d.position.y+(d.C.q.y*b.V[e].x+d.C.u.y*b.V[e].y);b=k[1].id;b.A=c;b.$b=b.$b&4294967040|b.A&255;c=k[1].id;c.j=e;c.$b=c.$b& +4294902015|c.j<<8&65280;c=k[1].id;c.k=1;c.$b=c.$b&4278255615|c.k<<16&16711680;c=m.V[g];g=g+1Ze(hi,Oh,ai,-$h.x* +fi.x-$h.y*fi.y+h)||2>Ze(ii,hi,$h,$h.x*gi.x+$h.y*gi.y+h))){a.Mc.P(Uh);a.Ba.P(Zh);n=bi.x*fi.x+bi.y*fi.y;for(m=g=0;2>m;++m)bi.x*ii[m].Fe.x+bi.y*ii[m].Fe.y-n<=h&&(c=ii[m].Fe.x-p.position.x,k=ii[m].Fe.y-p.position.y,a.ta[g].Ba.x=c*p.C.q.x+k*p.C.q.y,a.ta[g].Ba.y=c*p.C.u.x+k*p.C.u.y,a.ta[g].Ne.Set(ii[m].id),c=a.ta[g].Ne,c.D=q,c.$b=c.$b&16777215|c.D<<24&4278190080,g++);a.Tb=g}}}};function ji(){this.I="Controller"+ki++;this.nd=null;this.j=new og}ji.prototype.Ug=function(){}; +ji.prototype.Il=function(a){this.j.Il(a);a=a.fa;var c=this.I,b=a.k[c];if(null!=b){var d=b.j(),b=b.Ia();null==d?a.j=b:d.k(b);null==b||b.ag(d);delete a.k[c]}};var ki=0;function li(){ji.call(this);this.A=Y(0,-1);this.eh=this.offset=0;this.D=Y(0,0);this.k=null}Jd(li,ji); +li.prototype.Ug=function(){this.k=this.nd.aq.rc();for(var a=this.j.Ra(vg);a;a=a.Ia()){for(var c=a.body,b=Y(0,0),d=Y(0,0),f=0,h=0,e=c.k.Ra();e;e=e.Ia()){var g=Y(0,0),l=e.ae.fc.Cl(this.A,this.offset,c.Vd(),g),f=f+l;b.x+=l*g.x;b.y+=l*g.y;var m=0,m=1,h=h+l*m;d.x+=l*g.x*m;d.y+=l*g.y*m}fthis.k&&0Math.abs(b)};function ui(){si.call(this);this.L=Y(0,0);this.aa=Y(0,0);this.type=3;this.length=1;this.D=this.I=0}Jd(ui,si);ui.prototype.A=function(){return new ti(this)}; +function vi(a){qi.call(this,a);this.A=Y(0,0);this.D=Y(0,0);this.N=new Zd;this.j=Y(0,0);this.A.P(a.D);this.D.P(a.I);this.N.ya();this.I=0;this.j.ya();this.k=0;this.L=a.L;this.aa=a.aa}Jd(vi,qi); +vi.prototype.xf=function(a){var c,b=0,d=this.ba,f=this.ca;c=d.H.C;var h=this.A.x-d.n.U.x,e=this.A.y-d.n.U.y,b=c.q.x*h+c.u.x*e,e=c.q.y*h+c.u.y*e,h=b;c=f.H.C;var g=this.D.x-f.n.U.x,l=this.D.y-f.n.U.y,b=c.q.x*g+c.u.x*l,l=c.q.y*g+c.u.y*l,g=b;c=d.O;var b=f.O,m=d.Y,k=f.Y,n=new Zd;n.q.x=c+b;n.u.x=0;n.q.y=0;n.u.y=c+b;n.q.x+=m*e*e;n.u.x+=-m*h*e;n.q.y+=-m*h*e;n.u.y+=m*h*h;n.q.x+=k*l*l;n.u.x+=-k*g*l;n.q.y+=-k*g*l;n.u.y+=k*g*g;re(n,this.N);this.I=m+k;0c*c&&(Ee(this.j), +this.j.me(c));c=Xd(this.j,b);h.x-=m*c.x;h.y-=m*c.y;e-=n*(q*c.y-u*c.x);g.x+=k*c.x;g.y+=k*c.y;l+=p*(t*c.y-v*c.x);d.J=e;f.J=l};vi.prototype.yf=function(){return!0};function wi(){si.call(this);this.D=Y(0,0);this.I=Y(0,0);this.type=9;this.aa=this.L=0}Jd(wi,si);wi.prototype.A=function(){return new vi(this)}; +function xi(a){qi.call(this,a);this.aa=Y(0,0);this.ka=Y(0,0);this.qa=Y(0,0);this.ra=Y(0,0);this.j=new yi;var c=a.D.eb,b=a.I.eb;this.L=this.I=this.N=this.D=null;var d=0,f=0;this.Ha=a.D.ba;this.ba=a.D.ca;1==c?(this.D=a.D,this.aa.P(this.D.qa),this.qa.P(this.D.ra),d=zi(this.D)):(this.N=a.D,this.aa.P(this.N.qa),this.qa.P(this.N.ra),d=this.N.Kj());this.Ma=a.I.ba;this.ca=a.I.ca;1==b?(this.I=a.I,this.ka.P(this.I.qa),this.ra.P(this.I.ra),f=zi(this.I)):(this.L=a.I,this.ka.P(this.L.qa),this.ra.P(this.L.ra), +f=this.L.Kj());this.k=a.Dg;this.fa=d+this.k*f;this.A=0}Jd(xi,qi); +xi.prototype.xf=function(a){var c=this.Ha,b=this.Ma,d=this.ba,f=this.ca,h=0,e=0,g=0,l=0,m=g=0,k=0;this.j.ya();this.D?(this.j.A=-1,k+=d.Y):(c=c.H.C,e=this.N.Od,h=c.q.x*e.x+c.u.x*e.y,e=c.q.y*e.x+c.u.y*e.y,c=d.H.C,g=this.qa.x-d.n.U.x,l=this.qa.y-d.n.U.y,m=c.q.x*g+c.u.x*l,l=c.q.y*g+c.u.y*l,g=m*e-l*h,this.j.j.Set(-h,-e),this.j.A=-g,k+=d.O+d.Y*g*g);this.I?(this.j.D=-this.k,k+=this.k*this.k*f.Y):(c=b.H.C,e=this.L.Od,h=c.q.x*e.x+c.u.x*e.y,e=c.q.y*e.x+c.u.y*e.y,c=f.H.C,g=this.ra.x-f.n.U.x,l=this.ra.y-f.n.U.y, +m=c.q.x*g+c.u.x*l,l=c.q.y*g+c.u.y*l,g=m*e-l*h,this.j.k.Set(-this.k*h,-this.k*e),this.j.D=-this.k*g,k+=this.k*this.k*(f.O+f.Y*g*g));this.Z=0Number.MIN_VALUE?1/this.rb:0;this.L.P(Td(h.C,this.Wd));this.I=(d+e)*this.L.y-(f+g)*this.L.x;this.N=l*this.L.y-m*this.L.x;h=this.aa;e=this.ka;g=this.Ha;l=this.Ma;this.fa.q.x=h+e+g*this.I*this.I+l*this.N*this.N;this.fa.q.y=g*this.I*this.A+l*this.N*this.D;this.fa.u.x=this.fa.q.y;this.fa.u.y=h+e+g*this.A*this.A+l*this.D*this.D;this.Lh?(d=this.k.x*d+this.k.y*f,.01>Math.abs(this.Sc-this.sc)?this.gb=3:d<=this.sc?1!=this.gb&&(this.gb=1,this.j.y= +0):d>=this.Sc?2!=this.gb&&(this.gb=2,this.j.y=0):(this.gb=0,this.j.y=0)):this.gb=0;0==this.Mj&&(this.Na=0);a.Ng?(this.j.x*=a.kc,this.j.y*=a.kc,this.Na*=a.kc,a=this.j.x*this.L.x+(this.Na+this.j.y)*this.k.x,d=this.j.x*this.L.y+(this.Na+this.j.y)*this.k.y,f=this.j.x*this.I+(this.Na+this.j.y)*this.A,h=this.j.x*this.N+(this.Na+this.j.y)*this.D,c.B.x-=this.aa*a,c.B.y-=this.aa*d,c.J-=this.Ha*f,b.B.x+=this.ka*a,b.B.y+=this.ka*d,b.J+=this.Ma*h):(this.j.ya(),this.Na=0)}; +Ei.prototype.zf=function(a){var c=this.ba,b=this.ca,d=c.B,f=c.J,h=b.B,e=b.J,g=0,l=0,m=0,k=0;this.Mj&&3!=this.gb&&(k=this.rb*(this.Do-(this.k.x*(h.x-d.x)+this.k.y*(h.y-d.y)+this.D*e-this.A*f)),g=this.Na,l=a.Fa*this.Co,this.Na=Yd(this.Na+k,-l,l),k=this.Na-g,g=k*this.k.x,l=k*this.k.y,m=k*this.A,k*=this.D,d.x-=this.aa*g,d.y-=this.aa*l,f-=this.Ha*m,h.x+=this.ka*g,h.y+=this.ka*l,e+=this.Ma*k);l=this.L.x*(h.x-d.x)+this.L.y*(h.y-d.y)+this.N*e-this.I*f;this.Lh&&0!=this.gb?(m=this.k.x*(h.x-d.x)+this.k.y*(h.y- +d.y)+this.D*e-this.A*f,g=this.j.rc(),a=se(this.fa,Y(0,0),-l,-m),this.j.wf(a),1==this.gb?this.j.y=Math.max(this.j.y,0):2==this.gb&&(this.j.y=Math.min(this.j.y,0)),l=-l-(this.j.y-g.y)*this.fa.u.x,m=0,m=0!=this.fa.q.x?l/this.fa.q.x+g.x:g.x,this.j.x=m,a.x=this.j.x-g.x,a.y=this.j.y-g.y,g=a.x*this.L.x+a.y*this.k.x,l=a.x*this.L.y+a.y*this.k.y,m=a.x*this.I+a.y*this.A,k=a.x*this.N+a.y*this.D):(a=0,a=0!=this.fa.q.x?-l/this.fa.q.x:0,this.j.x+=a,g=a*this.L.x,l=a*this.L.y,m=a*this.I,k=a*this.N);d.x-=this.aa*g; +d.y-=this.aa*l;f-=this.Ha*m;h.x+=this.ka*g;h.y+=this.ka*l;e+=this.Ma*k;c.B.P(d);c.J=f;b.B.P(h);b.J=e}; +Ei.prototype.yf=function(){var a=this.ba,c=this.ca,b=a.n.F,d=a.n.S,f=c.n.F,h=c.n.S,e,g=0,l=0,m=0,k=0,n=e=0,p=0,l=!1,q=0,u=$d(d),m=$d(h);e=u;var p=this.qa.x-this.Af.x,t=this.qa.y-this.Af.y,g=e.q.x*p+e.u.x*t,t=e.q.y*p+e.u.y*t,p=g;e=m;m=this.ra.x-this.Bf.x;k=this.ra.y-this.Bf.y;g=e.q.x*m+e.u.x*k;k=e.q.y*m+e.u.y*k;m=g;e=f.x+m-b.x-p;g=f.y+k-b.y-t;if(this.Lh){this.k=Td(u,this.Od);this.A=(e+p)*this.k.y-(g+t)*this.k.x;this.D=m*this.k.y-k*this.k.x;var v=this.k.x*e+this.k.y*g;.01>Math.abs(this.Sc-this.sc)? +(q=Yd(v,-.2,.2),n=Math.abs(v),l=!0):v<=this.sc?(q=Yd(v-this.sc+.005,-.2,0),n=this.sc-v,l=!0):v>=this.Sc&&(q=Yd(v-this.Sc+.005,0,.2),n=v-this.Sc,l=!0)}this.L=Td(u,this.Wd);this.I=(e+p)*this.L.y-(g+t)*this.L.x;this.N=m*this.L.y-k*this.L.x;u=Y(0,0);t=this.L.x*e+this.L.y*g;n=Math.max(n,Math.abs(t));p=0;l?(l=this.aa,m=this.ka,k=this.Ha,e=this.Ma,this.fa.q.x=l+m+k*this.I*this.I+e*this.N*this.N,this.fa.q.y=k*this.I*this.A+e*this.N*this.D,this.fa.u.x=this.fa.q.y,this.fa.u.y=l+m+k*this.A*this.A+e*this.D*this.D, +se(this.fa,u,-t,-q)):(l=this.aa,m=this.ka,k=this.Ha,e=this.Ma,q=l+m+k*this.I*this.I+e*this.N*this.N,u.x=0!=q?-t/q:0,u.y=0);q=u.x*this.L.x+u.y*this.k.x;l=u.x*this.L.y+u.y*this.k.y;t=u.x*this.I+u.y*this.A;u=u.x*this.N+u.y*this.D;b.x-=this.aa*q;b.y-=this.aa*l;d-=this.Ha*t;f.x+=this.ka*q;f.y+=this.ka*l;h+=this.Ma*u;a.n.S=d;c.n.S=h;lg(a);lg(c);return.005>=n&&p<=Kd}; +function Fi(){si.call(this);this.aa=Y(0,0);this.ka=Y(0,0);this.D=Y(0,0);this.type=7;this.D.Set(1,0);this.I=!1;this.rb=this.fa=0;this.L=!1;this.Ma=this.Ha=0}Jd(Fi,si);Fi.prototype.A=function(){return new Ei(this)}; +function Gi(a){qi.call(this,a);this.qa=Y(0,0);this.ra=Y(0,0);this.Od=Y(0,0);this.Wd=Y(0,0);this.L=Y(0,0);this.fa=Y(0,0);this.k=new te;this.j=new ue(0,0,0);this.qa.P(a.aa);this.ra.P(a.ka);this.Od.P(a.D);this.Wd.x=-this.Od.y;this.Wd.y=this.Od.x;this.Iw=a.rb;this.j.ya();this.Na=this.rb=0;this.sc=a.fa;this.Sc=a.Na;this.Co=a.Ha;this.Do=a.Ma;this.Lh=a.I;this.Mj=a.L;this.gb=0;this.L.ya();this.fa.ya()}Jd(Gi,qi); +Gi.prototype.Kj=function(){var a=this.ba,c=this.ca,b=gg(a,this.qa),d=gg(c,this.ra),c=d.x-b.x,b=d.y-b.y,a=Td(a.H.C,this.Od);return a.x*c+a.y*b}; +Gi.prototype.xf=function(a){var c=this.ba,b=this.ca,d,f=0;this.Af.P(c.n.U);this.Bf.P(b.n.U);var h=c.Vd();b.Vd();d=c.H.C;var e=this.qa.x-this.Af.x,g=this.qa.y-this.Af.y,f=d.q.x*e+d.u.x*g,g=d.q.y*e+d.u.y*g,e=f;d=b.H.C;var l=this.ra.x-this.Bf.x,m=this.ra.y-this.Bf.y,f=d.q.x*l+d.u.x*m,m=d.q.y*l+d.u.y*m,l=f;d=b.n.F.x+l-c.n.F.x-e;f=b.n.F.y+m-c.n.F.y-g;this.aa=c.O;this.ka=b.O;this.Ha=c.Y;this.Ma=b.Y;this.L.P(Td(h.C,this.Od));this.A=(d+e)*this.L.y-(f+g)*this.L.x;this.D=l*this.L.y-m*this.L.x;this.rb=this.aa+ +this.ka+this.Ha*this.A*this.A+this.Ma*this.D*this.D;this.rb>Number.MIN_VALUE&&(this.rb=1/this.rb);this.fa.P(Td(h.C,this.Wd));this.I=(d+e)*this.fa.y-(f+g)*this.fa.x;this.N=l*this.fa.y-m*this.fa.x;h=this.aa;e=this.ka;g=this.Ha;l=this.Ma;this.k.q.x=h+e+g*this.I*this.I+l*this.N*this.N;this.k.q.y=g*this.I+l*this.N;this.k.q.z=g*this.I*this.A+l*this.N*this.D;this.k.u.x=this.k.q.y;this.k.u.y=g+l;this.k.u.z=g*this.A+l*this.D;this.k.j.x=this.k.q.z;this.k.j.y=this.k.u.z;this.k.j.z=h+e+g*this.A*this.A+l*this.D* +this.D;this.Lh?(d=this.L.x*d+this.L.y*f,.01>Math.abs(this.Sc-this.sc)?this.gb=3:d<=this.sc?1!=this.gb&&(this.gb=1,this.j.z=0):d>=this.Sc?2!=this.gb&&(this.gb=2,this.j.z=0):(this.gb=0,this.j.z=0)):this.gb=0;0==this.Mj&&(this.Na=0);a.Ng?(this.j.x*=a.kc,this.j.y*=a.kc,this.Na*=a.kc,a=this.j.x*this.fa.x+(this.Na+this.j.z)*this.L.x,d=this.j.x*this.fa.y+(this.Na+this.j.z)*this.L.y,f=this.j.x*this.I+this.j.y+(this.Na+this.j.z)*this.A,h=this.j.x*this.N+this.j.y+(this.Na+this.j.z)*this.D,c.B.x-=this.aa*a, +c.B.y-=this.aa*d,c.J-=this.Ha*f,b.B.x+=this.ka*a,b.B.y+=this.ka*d,b.J+=this.Ma*h):(this.j.ya(),this.Na=0)}; +Gi.prototype.zf=function(a){var c=this.ba,b=this.ca,d=c.B,f=c.J,h=b.B,e=b.J,g=0,l=0,m=0,k=0;this.Mj&&3!=this.gb&&(k=this.rb*(this.Do-(this.L.x*(h.x-d.x)+this.L.y*(h.y-d.y)+this.D*e-this.A*f)),g=this.Na,a=a.Fa*this.Co,this.Na=Yd(this.Na+k,-a,a),k=this.Na-g,g=k*this.L.x,l=k*this.L.y,m=k*this.A,k*=this.D,d.x-=this.aa*g,d.y-=this.aa*l,f-=this.Ha*m,h.x+=this.ka*g,h.y+=this.ka*l,e+=this.Ma*k);m=this.fa.x*(h.x-d.x)+this.fa.y*(h.y-d.y)+this.N*e-this.I*f;l=e-f;this.Lh&&0!=this.gb?(a=this.L.x*(h.x-d.x)+this.L.y* +(h.y-d.y)+this.D*e-this.A*f,g=this.j.rc(),a=we(this.k,new ue(0,0,0),-m,-l,-a),this.j.wf(a),1==this.gb?this.j.z=Math.max(this.j.z,0):2==this.gb&&(this.j.z=Math.min(this.j.z,0)),m=-m-(this.j.z-g.z)*this.k.j.x,l=-l-(this.j.z-g.z)*this.k.j.y,l=ve(this.k,Y(0,0),m,l),l.x+=g.x,l.y+=g.y,this.j.x=l.x,this.j.y=l.y,a.x=this.j.x-g.x,a.y=this.j.y-g.y,a.z=this.j.z-g.z,g=a.x*this.fa.x+a.z*this.L.x,l=a.x*this.fa.y+a.z*this.L.y,m=a.x*this.I+a.y+a.z*this.A,k=a.x*this.N+a.y+a.z*this.D,d.x-=this.aa*g,d.y-=this.aa*l, +f-=this.Ha*m,h.x+=this.ka*g,h.y+=this.ka*l,e+=this.Ma*k):(a=ve(this.k,Y(0,0),-m,-l),this.j.x+=a.x,this.j.y+=a.y,g=a.x*this.fa.x,l=a.x*this.fa.y,m=a.x*this.I+a.y,k=a.x*this.N+a.y,d.x-=this.aa*g,d.y-=this.aa*l,f-=this.Ha*m,h.x+=this.ka*g,h.y+=this.ka*l,e+=this.Ma*k);c.B.P(d);c.J=f;b.B.P(h);b.J=e}; +Gi.prototype.yf=function(){var a=this.ba,c=this.ca,b=a.n.F,d=a.n.S,f=c.n.F,h=c.n.S,e,g=0,l=0,m=0,k=g=e=0,n=0,l=!1,p=0,q=$d(d),u=$d(h);e=q;var n=this.qa.x-this.Af.x,t=this.qa.y-this.Af.y,g=e.q.x*n+e.u.x*t,t=e.q.y*n+e.u.y*t,n=g;e=u;u=this.ra.x-this.Bf.x;m=this.ra.y-this.Bf.y;g=e.q.x*u+e.u.x*m;m=e.q.y*u+e.u.y*m;u=g;e=f.x+u-b.x-n;g=f.y+m-b.y-t;if(this.Lh){this.L=Td(q,this.Od);this.A=(e+n)*this.L.y-(g+t)*this.L.x;this.D=u*this.L.y-m*this.L.x;var v=this.L.x*e+this.L.y*g;.01>Math.abs(this.Sc-this.sc)?(p= +Yd(v,-.2,.2),k=Math.abs(v),l=!0):v<=this.sc?(p=Yd(v-this.sc+.005,-.2,0),k=this.sc-v,l=!0):v>=this.Sc&&(p=Yd(v-this.Sc+.005,0,.2),k=v-this.Sc,l=!0)}this.fa=Td(q,this.Wd);this.I=(e+n)*this.fa.y-(g+t)*this.fa.x;this.N=u*this.fa.y-m*this.fa.x;q=new ue(0,0,0);t=this.fa.x*e+this.fa.y*g;u=h-d-this.Iw;k=Math.max(k,Math.abs(t));n=Math.abs(u);l?(l=this.aa,m=this.ka,e=this.Ha,g=this.Ma,this.k.q.x=l+m+e*this.I*this.I+g*this.N*this.N,this.k.q.y=e*this.I+g*this.N,this.k.q.z=e*this.I*this.A+g*this.N*this.D,this.k.u.x= +this.k.q.y,this.k.u.y=e+g,this.k.u.z=e*this.A+g*this.D,this.k.j.x=this.k.q.z,this.k.j.y=this.k.u.z,this.k.j.z=l+m+e*this.A*this.A+g*this.D*this.D,we(this.k,q,-t,-u,-p)):(l=this.aa,m=this.ka,e=this.Ha,g=this.Ma,p=e*this.I+g*this.N,v=e+g,this.k.q.Set(l+m+e*this.I*this.I+g*this.N*this.N,p,0),this.k.u.Set(p,v,0),p=ve(this.k,Y(0,0),-t,-u),q.x=p.x,q.y=p.y,q.z=0);p=q.x*this.fa.x+q.z*this.L.x;l=q.x*this.fa.y+q.z*this.L.y;t=q.x*this.I+q.y+q.z*this.A;q=q.x*this.N+q.y+q.z*this.D;b.x-=this.aa*p;b.y-=this.aa* +l;d-=this.Ha*t;f.x+=this.ka*p;f.y+=this.ka*l;h+=this.Ma*q;a.n.S=d;c.n.S=h;lg(a);lg(c);return.005>=k&&n<=Kd};function Hi(){si.call(this);this.aa=Y(0,0);this.ka=Y(0,0);this.D=Y(0,0);this.type=2;this.D.Set(1,0);this.rb=0;this.I=!1;this.Na=this.fa=0;this.L=!1;this.Ma=this.Ha=0}Jd(Hi,si);Hi.prototype.A=function(){return new Gi(this)}; +function Ii(a){qi.call(this,a);this.aa=Y(0,0);this.ka=Y(0,0);this.qa=Y(0,0);this.ra=Y(0,0);this.j=Y(0,0);this.k=Y(0,0);this.I=this.ba.nd.Az;this.aa.x=a.D.x-this.I.H.position.x;this.aa.y=a.D.y-this.I.H.position.y;this.ka.x=a.I.x-this.I.H.position.x;this.ka.y=a.I.y-this.I.H.position.y;this.qa.P(a.L);this.ra.P(a.aa);this.A=a.Dg;this.Ma=0+0*this.A;this.Sc=Math.min(0,this.Ma-this.A*Ji);this.Wd=Math.min(0,(this.Ma-Ji)/this.A);this.L=this.N=this.D=0}Jd(Ii,qi); +Ii.prototype.xf=function(a){var c=this.ba,b=this.ca,d;d=c.H.C;var f=this.qa.x-c.n.U.x,h=this.qa.y-c.n.U.y,e=d.q.x*f+d.u.x*h,h=d.q.y*f+d.u.y*h,f=e;d=b.H.C;var g=this.ra.x-b.n.U.x,l=this.ra.y-b.n.U.y,e=d.q.x*g+d.u.x*l,l=d.q.y*g+d.u.y*l,g=e;d=b.n.F.x+g;var e=b.n.F.y+l,m=this.I.H.position.x+this.ka.x,k=this.I.H.position.y+this.ka.y;this.j.Set(c.n.F.x+f-(this.I.H.position.x+this.aa.x),c.n.F.y+h-(this.I.H.position.y+this.aa.y));this.k.Set(d-m,e-k);d=Ce(this.j);e=Ce(this.k);.005u};var Ji=1;function Ki(){si.call(this);this.D=Y(0,0);this.I=Y(0,0);this.L=Y(0,0);this.aa=Y(0,0);this.type=4;this.D.Set(-1,1);this.I.Set(1,1);this.L.Set(-1,0);this.aa.Set(1,0);this.Dg=1;this.N=!0}Jd(Ki,si);Ki.prototype.A=function(){return new Ii(this)}; +function Li(a){qi.call(this,a);this.fa=new Zd;this.L=new Zd;this.aa=new Zd;this.ka=new Zd;this.k=new ue(0,0,0);this.D=Y(0,0);this.N=Y(0,0);this.qa=Y(0,0);this.ra=Y(0,0);this.j=new ue(0,0,0);this.Z=new te;this.qa.P(a.D);this.ra.P(a.I);this.Na=a.aa;this.j.ya();this.I=0;this.Ha=a.ka;this.gb=a.fa;this.Wd=a.rb;this.Sc=a.Ma;this.Ma=a.L;this.sc=a.Ha;this.A=0}Jd(Li,qi);function zi(a){return a.ca.n.S-a.ba.n.S-a.Na} +Li.prototype.xf=function(a){var c=this.ba,b=this.ca,d,f=0;d=c.H.C;var h=this.qa.x-c.n.U.x,e=this.qa.y-c.n.U.y,f=d.q.x*h+d.u.x*e,e=d.q.y*h+d.u.y*e,h=f;d=b.H.C;var g=this.ra.x-b.n.U.x,l=this.ra.y-b.n.U.y,f=d.q.x*g+d.u.x*l,l=d.q.y*g+d.u.y*l,g=f;d=c.O;var f=b.O,m=c.Y,k=b.Y;this.Z.q.x=d+f+e*e*m+l*l*k;this.Z.u.x=-e*h*m-l*g*k;this.Z.j.x=-e*m-l*k;this.Z.q.y=this.Z.u.x;this.Z.u.y=d+f+h*h*m+g*g*k;this.Z.j.y=h*m+g*k;this.Z.q.z=this.Z.j.x;this.Z.u.z=this.Z.j.y;this.Z.j.z=m+k;this.rb=1/(m+k);this.sc||(this.I= +0);if(this.Ma){var n=b.n.S-c.n.S-this.Na;Math.abs(this.gb-this.Ha)<2*Kd?this.A=3:n<=this.Ha?(1!=this.A&&(this.j.z=0),this.A=1):n>=this.gb?(2!=this.A&&(this.j.z=0),this.A=2):(this.A=0,this.j.z=0)}else this.A=0;a.Ng?(this.j.x*=a.kc,this.j.y*=a.kc,this.I*=a.kc,a=this.j.x,n=this.j.y,c.B.x-=d*a,c.B.y-=d*n,c.J-=m*(h*n-e*a+this.I+this.j.z),b.B.x+=f*a,b.B.y+=f*n,b.J+=k*(g*n-l*a+this.I+this.j.z)):(this.j.ya(),this.I=0)}; +Li.prototype.zf=function(a){var c=this.ba,b=this.ca,d=0,f=d=0,h=0,e=0,g=0,l=c.B,m=c.J,k=b.B,n=b.J,p=c.O,q=b.O,u=c.Y,t=b.Y;this.sc&&3!=this.A&&(f=this.rb*-(n-m-this.Sc),h=this.I,e=a.Fa*this.Wd,this.I=Yd(this.I+f,-e,e),f=this.I-h,m-=u*f,n+=t*f);if(this.Ma&&0!=this.A){a=c.H.C;f=this.qa.x-c.n.U.x;h=this.qa.y-c.n.U.y;d=a.q.x*f+a.u.x*h;h=a.q.y*f+a.u.y*h;f=d;a=b.H.C;e=this.ra.x-b.n.U.x;g=this.ra.y-b.n.U.y;d=a.q.x*e+a.u.x*g;g=a.q.y*e+a.u.y*g;e=d;a=k.x+-n*g-l.x- -m*h;var v=k.y+n*e-l.y-m*f;we(this.Z,this.k, +-a,-v,-(n-m));3==this.A?this.j.wf(this.k):1==this.A?(d=this.j.z+this.k.z,0>d&&(ve(this.Z,this.N,-a,-v),this.k.x=this.N.x,this.k.y=this.N.y,this.k.z=-this.j.z,this.j.x+=this.N.x,this.j.y+=this.N.y,this.j.z=0)):2==this.A&&(d=this.j.z+this.k.z,0.05*.05&&(k=1/(n+p),e=k*-e,h=k*-h,b.n.F.x-=.5*n*e,b.n.F.y-=.5*n*h,d.n.F.x+=.5*p*e,d.n.F.y+=.5*p*h,e=d.n.F.x+l-b.n.F.x-g,h=d.n.F.y+m-b.n.F.y-a);this.L.q.x=n+p;this.L.u.x=0;this.L.q.y=0;this.L.u.y=n+p;this.aa.q.x=q*a*a;this.aa.u.x=-q*g*a;this.aa.q.y=-q*g*a;this.aa.u.y=q*g*g;this.ka.q.x=u*m*m;this.ka.u.x=-u*l*m;this.ka.q.y=-u*l*m;this.ka.u.y=u*l*l;ae(this.fa,this.L);n=this.fa;p=this.aa; +n.q.wf(p.q);n.u.wf(p.u);n=this.fa;p=this.ka;n.q.wf(p.q);n.u.wf(p.u);se(this.fa,Mi,-e,-h);e=Mi.x;h=Mi.y;b.n.F.x-=b.O*e;b.n.F.y-=b.O*h;b.n.S-=b.Y*(g*h-a*e);d.n.F.x+=d.O*e;d.n.F.y+=d.O*h;d.n.S+=d.Y*(l*h-m*e);lg(b);lg(d);return.005>=c&&f<=Kd};var Mi=Y(0,0);function Ni(){si.call(this);this.D=Y(0,0);this.I=Y(0,0);this.type=1;this.D.ya();this.I.ya();this.Ma=this.rb=this.fa=this.ka=this.aa=0;this.Ha=this.L=!1}Jd(Ni,si); +function Oi(a,c,b,d){a.j=c;a.k=b;a.D=Wd(a.j.H,d);a.I=Wd(a.k.H,d);a.aa=a.k.Ih()-a.j.Ih()}Ni.prototype.A=function(){return new Li(this)};function Pi(a){qi.call(this,a);this.k=Y(0,0);this.A=Y(0,0);this.j=new ue(0,0,0);this.Z=new te;this.k.P(a.D);this.A.P(a.I);this.D=a.L}Jd(Pi,qi); +Pi.prototype.xf=function(a){var c,b=0,d=this.ba,f=this.ca;c=d.H.C;var h=this.k.x-d.n.U.x,e=this.k.y-d.n.U.y,b=c.q.x*h+c.u.x*e,e=c.q.y*h+c.u.y*e,h=b;c=f.H.C;var g=this.A.x-f.n.U.x,l=this.A.y-f.n.U.y,b=c.q.x*g+c.u.x*l,l=c.q.y*g+c.u.y*l,g=b;c=d.O;var b=f.O,m=d.Y,k=f.Y;this.Z.q.x=c+b+e*e*m+l*l*k;this.Z.u.x=-e*h*m-l*g*k;this.Z.j.x=-e*m-l*k;this.Z.q.y=this.Z.u.x;this.Z.u.y=c+b+h*h*m+g*g*k;this.Z.j.y=h*m+g*k;this.Z.q.z=this.Z.j.x;this.Z.u.z=this.Z.j.y;this.Z.j.z=m+k;a.Ng?(this.j.x*=a.kc,this.j.y*=a.kc,this.j.z*= +a.kc,d.B.x-=c*this.j.x,d.B.y-=c*this.j.y,d.J-=m*(h*this.j.y-e*this.j.x+this.j.z),f.B.x+=b*this.j.x,f.B.y+=b*this.j.y,f.J+=k*(g*this.j.y-l*this.j.x+this.j.z)):this.j.ya()}; +Pi.prototype.zf=function(){var a,c=0,b=this.ba,d=this.ca,f=b.B,h=b.J,e=d.B,g=d.J,l=b.O,m=d.O,k=b.Y,n=d.Y;a=b.H.C;var p=this.k.x-b.n.U.x,q=this.k.y-b.n.U.y,c=a.q.x*p+a.u.x*q,q=a.q.y*p+a.u.y*q,p=c;a=d.H.C;var u=this.A.x-d.n.U.x,t=this.A.y-d.n.U.y,c=a.q.x*u+a.u.x*t,t=a.q.y*u+a.u.y*t,u=c;a=new ue(0,0,0);we(this.Z,a,-(e.x-g*t-f.x+h*q),-(e.y+g*u-f.y-h*p),-(g-h));this.j.wf(a);f.x-=l*a.x;f.y-=l*a.y;h-=k*(p*a.y-q*a.x+a.z);e.x+=m*a.x;e.y+=m*a.y;g+=n*(u*a.y-t*a.x+a.z);b.J=h;d.J=g}; +Pi.prototype.yf=function(){var a,c=0,b=this.ba,d=this.ca;a=b.H.C;var f=this.k.x-b.n.U.x,h=this.k.y-b.n.U.y,c=a.q.x*f+a.u.x*h,h=a.q.y*f+a.u.y*h,f=c;a=d.H.C;var e=this.A.x-d.n.U.x,g=this.A.y-d.n.U.y,c=a.q.x*e+a.u.x*g,g=a.q.y*e+a.u.y*g,e=c;a=b.O;var c=d.O,l=b.Y,m=d.Y,k=d.n.F.x+e-b.n.F.x-f,n=d.n.F.y+g-b.n.F.y-h,p=d.n.S-b.n.S-this.D,q=Math.sqrt(k*k+n*n),u=Math.abs(p);.05=q&&u<=Kd};function Ti(){si.call(this);this.D=Y(0,0);this.I=Y(0,0);this.type=8;this.L=0}Jd(Ti,si);Ti.prototype.A=function(){return new Pi(this)}; +var Oh=[new Pe,new Pe],hi=[new Pe,new Pe],ii=[new Pe,new Pe],Ph=Y(0,0),Uh=Y(0,0),Zh=Y(0,0),bi=Y(0,0),$h=Y(0,0),ai=Y(0,0),fi=Y(0,0),gi=Y(0,0),ih=0,oh=0,ph=0,mh=0,nh=0,jh=new Rf,kh=new ff,Ff=new ye,Mf=new ye,Af=new function(){this.Ba=Y(0,0);this.j=Y(0,0)},lh=new gf,kg=new ye,Dg=new Bg;new function(){this.position=Y(0,0);Y(0,0);Y(0,0);this.id=new Ne};new ye; +var qh=new xe,rh=new xe,hh=new Sf,Lh=new function(){this.j=Y(0,0);this.ta=[];for(var a=this.Tb=0;2>a;a++)this.ta[a]=Y(0,0)},Nh=new function(){this.j=Y(0,0);this.k=[];this.ta=[];for(var a=0;2>a;a++)this.ta[a]=Y(0,0)};function Vi(a,c,b,d,f,h){var e;if(e=(b+.1>=a&&a>=f-.1||b-.1<=a&&a<=f+.1)&&(d+.1>=c&&c>=h-.1||d-.1<=c&&c<=h+.1))e=.1Math.abs((h-d)/(f-b)*(a-b)+d-c):.1>Math.abs(a-b);return e} +function Wi(a,c){var b=Zi(a),d=[],f,h,e,g,l,m,k,n,p;l=0;for(m=b.length;l=.001*c&&d.push(f)}return d} +function Zi(a){var c=[],b=0,d=0,f=0,h=0,e=0,g=e=0,l=0,m=0,k=0,h=0,n,p,q,u,t,v=h=b=0,r=0,f=[],l=[],x=!1,A=[],D=[];for(D.push(a);D.length;){c=D[0];d=c.length;x=!0;for(b=0;bh){x=!1;l=1E9;for(f=0;fMath.abs(u.x-t.x)&&.1>Math.abs(r-v)||f.push(t);v=t.y;r=q.y;.1>Math.abs(q.x-t.x)&&.1>Math.abs(r-v)||l.push(t);r=-1;for(v=m;;){if(v!==h)f.push(c[v]);else{if(0>r||r>=d)return[];Vi(u.x,u.y,c[r].x,c[r].y,a.x,a.y)||f.push(c[v]);break}r=v;0>v-1?v=d-1:v--}f.reverse();r=-1;for(v=k;;){if(v!==b)l.push(c[v]);else{if(0>r|| +r>=d)return[];v!==b||Vi(q.x,q.y,c[r].x,c[r].y,n.x,n.y)||l.push(c[v]);break}r=v;v+1>d-1?v=0:v++}D.push(f,l);D.shift();break}x&&A.push(D.shift())}return A} +function $i(a){for(var c=0;4E3>c;c++)Ae.push(new ze(0,0));this.g=a;this.Ed=new Og(Y(0,10),!0);this.Wu=10;this.Pp=-1;a=new Bg;a.behavior=this;a.BeginContact=function(a){this.behavior.g.bA(a.ec.fb().Cf.K,a.Sb.fb().Cf.K)};this.Ed.j.k=a;a=new yg;a.behavior=this;a.j=function(a,c){if(this.behavior.Tw)return!0;var f=a.fb().Cf.K.type,h=c.fb().Cf.K.type,e=f.ma.Physics_DisabledCollisions;return e&&e.contains(h)?!1:(e=h.ma.Physics_DisabledCollisions)&&e.contains(f)?!1:!0};this.Ed.j.A=a;this.zA=0;this.yl=8;this.bl= +3;this.Tw=!0} +(function(){function a(){}var c=$i.prototype;c.nb=function(a){this.behavior=a;this.g=a.g};c.nb.prototype.Ca=function(){};c.Ya=function(a,b){this.type=a;this.behavior=a.behavior;this.K=b;this.g=a.g;this.Ed=this.behavior.Ed};var b=c.Ya.prototype;b.Ca=function(){this.xp=0!==this.da[0];this.Sr=this.da[1];this.rq=0!==this.da[2];this.eh=this.da[3];this.ih=this.da[4];this.Ah=this.da[5];this.lj=this.da[6];this.Ki=this.da[7];this.Mi=0!==this.da[8];this.enabled=0!==this.da[9];this.body=null;this.K.kb();this.Bk= +this.K.x;this.Ck=this.K.y;this.Mf=this.K.R;this.Np=this.Qp=0;this.$t=this.Vm=!1;this.Kp=null;this.Lp=-1;this.he?(this.he.length=0,this.Oe.length=0,this.rg.clear()):(this.he=[],this.Oe=[],this.rg=new ba);var a=this;this.Pd||(this.Uk=function(b){a.Yk(b)});this.g.Ml(this.Uk)};b.Vt=function(){this.K.kb();this.em();this.Kp=this.K.yb;this.Lp=this.K.na};b.yg=function(){this.nm();this.Oe.length=0;this.rg.clear();this.body&&(Sg(this.Ed,this.body),this.body=null);this.g.bu(this.Uk)};b.Pc=function(){var a={e:this.enabled, +im:this.xp,pr:this.rq,d:this.eh,fr:this.ih,re:this.Ah,ld:this.lj,ad:this.Ki,b:this.Mi,mcj:this.Oe};if(this.enabled){var b=Y(0,0);b.P(this.body.B);a.vx=b.x;a.vy=b.y;a.om=this.body.J}return a};b.md=function(a){this.nm();this.Oe.length=0;this.rg.clear();this.body&&(Sg(this.Ed,this.body),this.body=null);this.enabled=a.e;this.xp=a.im;this.rq=a.pr;this.eh=a.d;this.ih=a.fr;this.Ah=a.re;this.lj=a.ld;this.Ki=a.ad;this.Mi=a.b;this.Bk=this.K.x;this.Ck=this.K.y;this.Mf=this.K.R;this.Qp=this.K.width;this.Np=this.K.height; +this.enabled&&(this.em(),eg(this.body,Y(a.vx,a.vy)),this.body.Jl(a.om),0===a.vx&&0===a.vy&&0===a.om||fg(this.body,!0),this.Oe=a.mcj)};b.$e=function(){this.enabled&&this.xq();this.behavior.Pp=this.g.Ce-1};b.Yk=function(a){var b,c,d,l=a.uid;d=b=0;for(c=this.Oe.length;ba.width;x=0>a.height; +if(0===l)if(a.Yf)for(A=a.xb.wh()-a.x,u=a.xb.xh()-a.y,a.PB(d),t=[],l=0,m=d.length;l1/30&&(b=1/30));if(this.g.Ce>this.behavior.Pp&&0this.Ag||4===this.mode&&cthis.K.opacity?this.K.opacity=0:1Native bridge. + POLLING: 0, + // For LOAD_URL to be viable, it would need to have a work-around for + // the bug where the soft-keyboard gets dismissed when a message is sent. + LOAD_URL: 1, + // For the ONLINE_EVENT to be viable, it would need to intercept all event + // listeners (both through addEventListener and window.ononline) as well + // as set the navigator property itself. + ONLINE_EVENT: 2, + EVAL_BRIDGE: 3 + }, + jsToNativeBridgeMode, // Set lazily. + nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE, + pollEnabled = false, + bridgeSecret = -1; + +var messagesFromNative = []; +var isProcessing = false; +var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve(); +var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); }; + +function androidExec(success, fail, service, action, args) { + if (bridgeSecret < 0) { + // If we ever catch this firing, we'll need to queue up exec()s + // and fire them once we get a secret. For now, I don't think + // it's possible for exec() to be called since plugins are parsed but + // not run until until after onNativeReady. + throw new Error('exec() called without bridgeSecret'); + } + // Set default bridge modes if they have not already been set. + // By default, we use the failsafe, since addJavascriptInterface breaks too often + if (jsToNativeBridgeMode === undefined) { + androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); + } + + // If args is not provided, default to an empty array + args = args || []; + + // Process any ArrayBuffers in the args into a string. + for (var i = 0; i < args.length; i++) { + if (utils.typeName(args[i]) == 'ArrayBuffer') { + args[i] = base64.fromArrayBuffer(args[i]); + } + } + + var callbackId = service + cordova.callbackId++, + argsJson = JSON.stringify(args); + if (success || fail) { + cordova.callbacks[callbackId] = {success:success, fail:fail}; + } + + var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson); + // If argsJson was received by Java as null, try again with the PROMPT bridge mode. + // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666. + if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") { + androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT); + androidExec(success, fail, service, action, args); + androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); + } else if (msgs) { + messagesFromNative.push(msgs); + // Always process async to avoid exceptions messing up stack. + nextTick(processMessages); + } +} + +androidExec.init = function() { + bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); + channel.onNativeReady.fire(); +}; + +function pollOnceFromOnlineEvent() { + pollOnce(true); +} + +function pollOnce(opt_fromOnlineEvent) { + if (bridgeSecret < 0) { + // This can happen when the NativeToJsMessageQueue resets the online state on page transitions. + // We know there's nothing to retrieve, so no need to poll. + return; + } + var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent); + if (msgs) { + messagesFromNative.push(msgs); + // Process sync since we know we're already top-of-stack. + processMessages(); + } +} + +function pollingTimerFunc() { + if (pollEnabled) { + pollOnce(); + setTimeout(pollingTimerFunc, 50); + } +} + +function hookOnlineApis() { + function proxyEvent(e) { + cordova.fireWindowEvent(e.type); + } + // The network module takes care of firing online and offline events. + // It currently fires them only on document though, so we bridge them + // to window here (while first listening for exec()-releated online/offline + // events). + window.addEventListener('online', pollOnceFromOnlineEvent, false); + window.addEventListener('offline', pollOnceFromOnlineEvent, false); + cordova.addWindowEventHandler('online'); + cordova.addWindowEventHandler('offline'); + document.addEventListener('online', proxyEvent, false); + document.addEventListener('offline', proxyEvent, false); +} + +hookOnlineApis(); + +androidExec.jsToNativeModes = jsToNativeModes; +androidExec.nativeToJsModes = nativeToJsModes; + +androidExec.setJsToNativeBridgeMode = function(mode) { + if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) { + mode = jsToNativeModes.PROMPT; + } + nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT); + jsToNativeBridgeMode = mode; +}; + +androidExec.setNativeToJsBridgeMode = function(mode) { + if (mode == nativeToJsBridgeMode) { + return; + } + if (nativeToJsBridgeMode == nativeToJsModes.POLLING) { + pollEnabled = false; + } + + nativeToJsBridgeMode = mode; + // Tell the native side to switch modes. + // Otherwise, it will be set by androidExec.init() + if (bridgeSecret >= 0) { + nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode); + } + + if (mode == nativeToJsModes.POLLING) { + pollEnabled = true; + setTimeout(pollingTimerFunc, 1); + } +}; + +function buildPayload(payload, message) { + var payloadKind = message.charAt(0); + if (payloadKind == 's') { + payload.push(message.slice(1)); + } else if (payloadKind == 't') { + payload.push(true); + } else if (payloadKind == 'f') { + payload.push(false); + } else if (payloadKind == 'N') { + payload.push(null); + } else if (payloadKind == 'n') { + payload.push(+message.slice(1)); + } else if (payloadKind == 'A') { + var data = message.slice(1); + payload.push(base64.toArrayBuffer(data)); + } else if (payloadKind == 'S') { + payload.push(window.atob(message.slice(1))); + } else if (payloadKind == 'M') { + var multipartMessages = message.slice(1); + while (multipartMessages !== "") { + var spaceIdx = multipartMessages.indexOf(' '); + var msgLen = +multipartMessages.slice(0, spaceIdx); + var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen); + multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1); + buildPayload(payload, multipartMessage); + } + } else { + payload.push(JSON.parse(message)); + } +} + +// Processes a single message, as encoded by NativeToJsMessageQueue.java. +function processMessage(message) { + var firstChar = message.charAt(0); + if (firstChar == 'J') { + // This is deprecated on the .java side. It doesn't work with CSP enabled. + eval(message.slice(1)); + } else if (firstChar == 'S' || firstChar == 'F') { + var success = firstChar == 'S'; + var keepCallback = message.charAt(1) == '1'; + var spaceIdx = message.indexOf(' ', 2); + var status = +message.slice(2, spaceIdx); + var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1); + var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx); + var payloadMessage = message.slice(nextSpaceIdx + 1); + var payload = []; + buildPayload(payload, payloadMessage); + cordova.callbackFromNative(callbackId, success, status, payload, keepCallback); + } else { + console.log("processMessage failed: invalid message: " + JSON.stringify(message)); + } +} + +function processMessages() { + // Check for the reentrant case. + if (isProcessing) { + return; + } + if (messagesFromNative.length === 0) { + return; + } + isProcessing = true; + try { + var msg = popMessageFromQueue(); + // The Java side can send a * message to indicate that it + // still has messages waiting to be retrieved. + if (msg == '*' && messagesFromNative.length === 0) { + nextTick(pollOnce); + return; + } + processMessage(msg); + } finally { + isProcessing = false; + if (messagesFromNative.length > 0) { + nextTick(processMessages); + } + } +} + +function popMessageFromQueue() { + var messageBatch = messagesFromNative.shift(); + if (messageBatch == '*') { + return '*'; + } + + var spaceIdx = messageBatch.indexOf(' '); + var msgLen = +messageBatch.slice(0, spaceIdx); + var message = messageBatch.substr(spaceIdx + 1, msgLen); + messageBatch = messageBatch.slice(spaceIdx + msgLen + 1); + if (messageBatch) { + messagesFromNative.unshift(messageBatch); + } + return message; +} + +module.exports = androidExec; diff --git a/assets/www/cordova-js-src/platform.js b/assets/www/cordova-js-src/platform.js new file mode 100644 index 0000000000000000000000000000000000000000..2bfd024712de32b7e58b98a044af8fb8a3df1f0d --- /dev/null +++ b/assets/www/cordova-js-src/platform.js @@ -0,0 +1,125 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +// The last resume event that was received that had the result of a plugin call. +var lastResumeEvent = null; + +module.exports = { + id: 'android', + bootstrap: function() { + var channel = require('cordova/channel'), + cordova = require('cordova'), + exec = require('cordova/exec'), + modulemapper = require('cordova/modulemapper'); + + // Get the shared secret needed to use the bridge. + exec.init(); + + // TODO: Extract this as a proper plugin. + modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app'); + + var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; + + // Inject a listener for the backbutton on the document. + var backButtonChannel = cordova.addDocumentEventHandler('backbutton'); + backButtonChannel.onHasSubscribersChange = function() { + // If we just attached the first handler or detached the last handler, + // let native know we need to override the back button. + exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]); + }; + + // Add hardware MENU and SEARCH button handlers + cordova.addDocumentEventHandler('menubutton'); + cordova.addDocumentEventHandler('searchbutton'); + + function bindButtonChannel(buttonName) { + // generic button bind used for volumeup/volumedown buttons + var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button'); + volumeButtonChannel.onHasSubscribersChange = function() { + exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]); + }; + } + // Inject a listener for the volume buttons on the document. + bindButtonChannel('volumeup'); + bindButtonChannel('volumedown'); + + // The resume event is not "sticky", but it is possible that the event + // will contain the result of a plugin call. We need to ensure that the + // plugin result is delivered even after the event is fired (CB-10498) + var cordovaAddEventListener = document.addEventListener; + + document.addEventListener = function(evt, handler, capture) { + cordovaAddEventListener(evt, handler, capture); + + if (evt === 'resume' && lastResumeEvent) { + handler(lastResumeEvent); + } + }; + + // Let native code know we are all done on the JS side. + // Native code will then un-hide the WebView. + channel.onCordovaReady.subscribe(function() { + exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []); + exec(null, null, APP_PLUGIN_NAME, "show", []); + }); + } +}; + +function onMessageFromNative(msg) { + var cordova = require('cordova'); + var action = msg.action; + + switch (action) + { + // Button events + case 'backbutton': + case 'menubutton': + case 'searchbutton': + // App life cycle events + case 'pause': + // Volume events + case 'volumedownbutton': + case 'volumeupbutton': + cordova.fireDocumentEvent(action); + break; + case 'resume': + if(arguments.length > 1 && msg.pendingResult) { + if(arguments.length === 2) { + msg.pendingResult.result = arguments[1]; + } else { + // The plugin returned a multipart message + var res = []; + for(var i = 1; i < arguments.length; i++) { + res.push(arguments[i]); + } + msg.pendingResult.result = res; + } + + // Save the plugin result so that it can be delivered to the js + // even if they miss the initial firing of the event + lastResumeEvent = msg; + } + cordova.fireDocumentEvent(action, msg); + break; + default: + throw new Error('Unknown event action ' + action); + } +} diff --git a/assets/www/cordova-js-src/plugin/android/app.js b/assets/www/cordova-js-src/plugin/android/app.js new file mode 100644 index 0000000000000000000000000000000000000000..22cf96e81e2fc918413659aae493412e24d0fbdc --- /dev/null +++ b/assets/www/cordova-js-src/plugin/android/app.js @@ -0,0 +1,108 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * +*/ + +var exec = require('cordova/exec'); +var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; + +module.exports = { + /** + * Clear the resource cache. + */ + clearCache:function() { + exec(null, null, APP_PLUGIN_NAME, "clearCache", []); + }, + + /** + * Load the url into the webview or into new browser instance. + * + * @param url The URL to load + * @param props Properties that can be passed in to the activity: + * wait: int => wait msec before loading URL + * loadingDialog: "Title,Message" => display a native loading dialog + * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error + * clearHistory: boolean => clear webview history (default=false) + * openExternal: boolean => open in a new browser (default=false) + * + * Example: + * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000}); + */ + loadUrl:function(url, props) { + exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]); + }, + + /** + * Cancel loadUrl that is waiting to be loaded. + */ + cancelLoadUrl:function() { + exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []); + }, + + /** + * Clear web history in this web view. + * Instead of BACK button loading the previous web page, it will exit the app. + */ + clearHistory:function() { + exec(null, null, APP_PLUGIN_NAME, "clearHistory", []); + }, + + /** + * Go to previous page displayed. + * This is the same as pressing the backbutton on Android device. + */ + backHistory:function() { + exec(null, null, APP_PLUGIN_NAME, "backHistory", []); + }, + + /** + * Override the default behavior of the Android back button. + * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired. + * + * Note: The user should not have to call this method. Instead, when the user + * registers for the "backbutton" event, this is automatically done. + * + * @param override T=override, F=cancel override + */ + overrideBackbutton:function(override) { + exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]); + }, + + /** + * Override the default behavior of the Android volume button. + * If overridden, when the volume button is pressed, the "volume[up|down]button" + * JavaScript event will be fired. + * + * Note: The user should not have to call this method. Instead, when the user + * registers for the "volume[up|down]button" event, this is automatically done. + * + * @param button volumeup, volumedown + * @param override T=override, F=cancel override + */ + overrideButton:function(button, override) { + exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]); + }, + + /** + * Exit and terminate the application. + */ + exitApp:function() { + return exec(null, null, APP_PLUGIN_NAME, "exitApp", []); + } +}; diff --git a/assets/www/cordova.js b/assets/www/cordova.js new file mode 100644 index 0000000000000000000000000000000000000000..8f6d6e89a9b45b67d81b721bd38b61ea11722d20 --- /dev/null +++ b/assets/www/cordova.js @@ -0,0 +1,1935 @@ +// Platform: android +// 74fdba8b327b2a13b4366dd141b52def96d4cb56 +/* + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +*/ +;(function() { +var PLATFORM_VERSION_BUILD_LABEL = '8.1.0'; +// file: src/scripts/require.js +var require; +var define; + +(function () { + var modules = {}; + // Stack of moduleIds currently being built. + var requireStack = []; + // Map of module ID -> index into requireStack of modules currently being built. + var inProgressModules = {}; + var SEPARATOR = '.'; + + function build (module) { + var factory = module.factory; + var localRequire = function (id) { + var resultantId = id; + // Its a relative path, so lop off the last portion and add the id (minus "./") + if (id.charAt(0) === '.') { + resultantId = module.id.slice(0, module.id.lastIndexOf(SEPARATOR)) + SEPARATOR + id.slice(2); + } + return require(resultantId); + }; + module.exports = {}; + delete module.factory; + factory(localRequire, module.exports, module); + return module.exports; + } + + require = function (id) { + if (!modules[id]) { + throw 'module ' + id + ' not found'; + } else if (id in inProgressModules) { + var cycle = requireStack.slice(inProgressModules[id]).join('->') + '->' + id; + throw 'Cycle in require graph: ' + cycle; + } + if (modules[id].factory) { + try { + inProgressModules[id] = requireStack.length; + requireStack.push(id); + return build(modules[id]); + } finally { + delete inProgressModules[id]; + requireStack.pop(); + } + } + return modules[id].exports; + }; + + define = function (id, factory) { + if (Object.prototype.hasOwnProperty.call(modules, id)) { + throw 'module ' + id + ' already defined'; + } + + modules[id] = { + id: id, + factory: factory + }; + }; + + define.remove = function (id) { + delete modules[id]; + }; + + define.moduleMap = modules; +})(); + +// Export for use in node +if (typeof module === 'object' && typeof require === 'function') { + module.exports.require = require; + module.exports.define = define; +} + +// file: src/cordova.js +define("cordova", function(require, exports, module) { + +// Workaround for Windows 10 in hosted environment case +// http://www.w3.org/html/wg/drafts/html/master/browsers.html#named-access-on-the-window-object +if (window.cordova && !(window.cordova instanceof HTMLElement)) { // eslint-disable-line no-undef + throw new Error('cordova already defined'); +} + +var channel = require('cordova/channel'); +var platform = require('cordova/platform'); + +/** + * Intercept calls to addEventListener + removeEventListener and handle deviceready, + * resume, and pause events. + */ +var m_document_addEventListener = document.addEventListener; +var m_document_removeEventListener = document.removeEventListener; +var m_window_addEventListener = window.addEventListener; +var m_window_removeEventListener = window.removeEventListener; + +/** + * Houses custom event handlers to intercept on document + window event listeners. + */ +var documentEventHandlers = {}; +var windowEventHandlers = {}; + +document.addEventListener = function (evt, handler, capture) { + var e = evt.toLowerCase(); + if (typeof documentEventHandlers[e] !== 'undefined') { + documentEventHandlers[e].subscribe(handler); + } else { + m_document_addEventListener.call(document, evt, handler, capture); + } +}; + +window.addEventListener = function (evt, handler, capture) { + var e = evt.toLowerCase(); + if (typeof windowEventHandlers[e] !== 'undefined') { + windowEventHandlers[e].subscribe(handler); + } else { + m_window_addEventListener.call(window, evt, handler, capture); + } +}; + +document.removeEventListener = function (evt, handler, capture) { + var e = evt.toLowerCase(); + // If unsubscribing from an event that is handled by a plugin + if (typeof documentEventHandlers[e] !== 'undefined') { + documentEventHandlers[e].unsubscribe(handler); + } else { + m_document_removeEventListener.call(document, evt, handler, capture); + } +}; + +window.removeEventListener = function (evt, handler, capture) { + var e = evt.toLowerCase(); + // If unsubscribing from an event that is handled by a plugin + if (typeof windowEventHandlers[e] !== 'undefined') { + windowEventHandlers[e].unsubscribe(handler); + } else { + m_window_removeEventListener.call(window, evt, handler, capture); + } +}; + +function createEvent (type, data) { + var event = document.createEvent('Events'); + event.initEvent(type, false, false); + if (data) { + for (var i in data) { + if (data.hasOwnProperty(i)) { + event[i] = data[i]; + } + } + } + return event; +} + +/* eslint-disable no-undef */ +var cordova = { + define: define, + require: require, + version: PLATFORM_VERSION_BUILD_LABEL, + platformVersion: PLATFORM_VERSION_BUILD_LABEL, + platformId: platform.id, + + /* eslint-enable no-undef */ + + /** + * Methods to add/remove your own addEventListener hijacking on document + window. + */ + addWindowEventHandler: function (event) { + return (windowEventHandlers[event] = channel.create(event)); + }, + addStickyDocumentEventHandler: function (event) { + return (documentEventHandlers[event] = channel.createSticky(event)); + }, + addDocumentEventHandler: function (event) { + return (documentEventHandlers[event] = channel.create(event)); + }, + removeWindowEventHandler: function (event) { + delete windowEventHandlers[event]; + }, + removeDocumentEventHandler: function (event) { + delete documentEventHandlers[event]; + }, + /** + * Retrieve original event handlers that were replaced by Cordova + * + * @return object + */ + getOriginalHandlers: function () { + return { 'document': { 'addEventListener': m_document_addEventListener, 'removeEventListener': m_document_removeEventListener }, + 'window': { 'addEventListener': m_window_addEventListener, 'removeEventListener': m_window_removeEventListener } }; + }, + /** + * Method to fire event from native code + * bNoDetach is required for events which cause an exception which needs to be caught in native code + */ + fireDocumentEvent: function (type, data, bNoDetach) { + var evt = createEvent(type, data); + if (typeof documentEventHandlers[type] !== 'undefined') { + if (bNoDetach) { + documentEventHandlers[type].fire(evt); + } else { + setTimeout(function () { + // Fire deviceready on listeners that were registered before cordova.js was loaded. + if (type === 'deviceready') { + document.dispatchEvent(evt); + } + documentEventHandlers[type].fire(evt); + }, 0); + } + } else { + document.dispatchEvent(evt); + } + }, + fireWindowEvent: function (type, data) { + var evt = createEvent(type, data); + if (typeof windowEventHandlers[type] !== 'undefined') { + setTimeout(function () { + windowEventHandlers[type].fire(evt); + }, 0); + } else { + window.dispatchEvent(evt); + } + }, + + /** + * Plugin callback mechanism. + */ + // Randomize the starting callbackId to avoid collisions after refreshing or navigating. + // This way, it's very unlikely that any new callback would get the same callbackId as an old callback. + callbackId: Math.floor(Math.random() * 2000000000), + callbacks: {}, + callbackStatus: { + NO_RESULT: 0, + OK: 1, + CLASS_NOT_FOUND_EXCEPTION: 2, + ILLEGAL_ACCESS_EXCEPTION: 3, + INSTANTIATION_EXCEPTION: 4, + MALFORMED_URL_EXCEPTION: 5, + IO_EXCEPTION: 6, + INVALID_ACTION: 7, + JSON_EXCEPTION: 8, + ERROR: 9 + }, + + /** + * Called by native code when returning successful result from an action. + */ + callbackSuccess: function (callbackId, args) { + cordova.callbackFromNative(callbackId, true, args.status, [args.message], args.keepCallback); + }, + + /** + * Called by native code when returning error result from an action. + */ + callbackError: function (callbackId, args) { + // TODO: Deprecate callbackSuccess and callbackError in favour of callbackFromNative. + // Derive success from status. + cordova.callbackFromNative(callbackId, false, args.status, [args.message], args.keepCallback); + }, + + /** + * Called by native code when returning the result from an action. + */ + callbackFromNative: function (callbackId, isSuccess, status, args, keepCallback) { + try { + var callback = cordova.callbacks[callbackId]; + if (callback) { + if (isSuccess && status === cordova.callbackStatus.OK) { + callback.success && callback.success.apply(null, args); + } else if (!isSuccess) { + callback.fail && callback.fail.apply(null, args); + } + /* + else + Note, this case is intentionally not caught. + this can happen if isSuccess is true, but callbackStatus is NO_RESULT + which is used to remove a callback from the list without calling the callbacks + typically keepCallback is false in this case + */ + // Clear callback if not expecting any more results + if (!keepCallback) { + delete cordova.callbacks[callbackId]; + } + } + } catch (err) { + var msg = 'Error in ' + (isSuccess ? 'Success' : 'Error') + ' callbackId: ' + callbackId + ' : ' + err; + console && console.log && console.log(msg); + console && console.log && err.stack && console.log(err.stack); + cordova.fireWindowEvent('cordovacallbackerror', { 'message': msg }); + throw err; + } + }, + addConstructor: function (func) { + channel.onCordovaReady.subscribe(function () { + try { + func(); + } catch (e) { + console.log('Failed to run constructor: ' + e); + } + }); + } +}; + +module.exports = cordova; + +}); + +// file: ../cordova-android/cordova-js-src/android/nativeapiprovider.js +define("cordova/android/nativeapiprovider", function(require, exports, module) { + +/** + * Exports the ExposedJsApi.java object if available, otherwise exports the PromptBasedNativeApi. + */ + +var nativeApi = this._cordovaNative || require('cordova/android/promptbasednativeapi'); +var currentApi = nativeApi; + +module.exports = { + get: function() { return currentApi; }, + setPreferPrompt: function(value) { + currentApi = value ? require('cordova/android/promptbasednativeapi') : nativeApi; + }, + // Used only by tests. + set: function(value) { + currentApi = value; + } +}; + +}); + +// file: ../cordova-android/cordova-js-src/android/promptbasednativeapi.js +define("cordova/android/promptbasednativeapi", function(require, exports, module) { + +/** + * Implements the API of ExposedJsApi.java, but uses prompt() to communicate. + * This is used pre-JellyBean, where addJavascriptInterface() is disabled. + */ + +module.exports = { + exec: function(bridgeSecret, service, action, callbackId, argsJson) { + return prompt(argsJson, 'gap:'+JSON.stringify([bridgeSecret, service, action, callbackId])); + }, + setNativeToJsBridgeMode: function(bridgeSecret, value) { + prompt(value, 'gap_bridge_mode:' + bridgeSecret); + }, + retrieveJsMessages: function(bridgeSecret, fromOnlineEvent) { + return prompt(+fromOnlineEvent, 'gap_poll:' + bridgeSecret); + } +}; + +}); + +// file: src/common/argscheck.js +define("cordova/argscheck", function(require, exports, module) { + +var utils = require('cordova/utils'); + +var moduleExports = module.exports; + +var typeMap = { + 'A': 'Array', + 'D': 'Date', + 'N': 'Number', + 'S': 'String', + 'F': 'Function', + 'O': 'Object' +}; + +function extractParamName (callee, argIndex) { + return (/\(\s*([^)]*?)\s*\)/).exec(callee)[1].split(/\s*,\s*/)[argIndex]; +} + +/** + * Checks the given arguments' types and throws if they are not as expected. + * + * `spec` is a string where each character stands for the required type of the + * argument at the same position. In other words: the character at `spec[i]` + * specifies the required type for `args[i]`. The characters in `spec` are the + * first letter of the required type's name. The supported types are: + * + * Array, Date, Number, String, Function, Object + * + * Lowercase characters specify arguments that must not be `null` or `undefined` + * while uppercase characters allow those values to be passed. + * + * Finally, `*` can be used to allow any type at the corresponding position. + * + * @example + * function foo (arr, opts) { + * // require `arr` to be an Array and `opts` an Object, null or undefined + * checkArgs('aO', 'my.package.foo', arguments); + * // ... + * } + * @param {String} spec - the type specification for `args` as described above + * @param {String} functionName - full name of the callee. + * Used in the error message + * @param {Array|arguments} args - the arguments to be checked against `spec` + * @param {Function} [opt_callee=args.callee] - the recipient of `args`. + * Used to extract parameter names for the error message + * @throws {TypeError} if args do not satisfy spec + */ +function checkArgs (spec, functionName, args, opt_callee) { + if (!moduleExports.enableChecks) { + return; + } + var errMsg = null; + var typeName; + for (var i = 0; i < spec.length; ++i) { + var c = spec.charAt(i); + var cUpper = c.toUpperCase(); + var arg = args[i]; + // Asterix means allow anything. + if (c === '*') { + continue; + } + typeName = utils.typeName(arg); + if ((arg === null || arg === undefined) && c === cUpper) { + continue; + } + if (typeName !== typeMap[cUpper]) { + errMsg = 'Expected ' + typeMap[cUpper]; + break; + } + } + if (errMsg) { + errMsg += ', but got ' + typeName + '.'; + errMsg = 'Wrong type for parameter "' + extractParamName(opt_callee || args.callee, i) + '" of ' + functionName + ': ' + errMsg; + // Don't log when running unit tests. + if (typeof jasmine === 'undefined') { + console.error(errMsg); + } + throw TypeError(errMsg); + } +} + +function getValue (value, defaultValue) { + return value === undefined ? defaultValue : value; +} + +moduleExports.checkArgs = checkArgs; +moduleExports.getValue = getValue; +moduleExports.enableChecks = true; + +}); + +// file: src/common/base64.js +define("cordova/base64", function(require, exports, module) { + +var base64 = exports; + +base64.fromArrayBuffer = function (arrayBuffer) { + var array = new Uint8Array(arrayBuffer); + return uint8ToBase64(array); +}; + +base64.toArrayBuffer = function (str) { + var decodedStr = typeof atob !== 'undefined' ? atob(str) : Buffer.from(str, 'base64').toString('binary'); // eslint-disable-line no-undef + var arrayBuffer = new ArrayBuffer(decodedStr.length); + var array = new Uint8Array(arrayBuffer); + for (var i = 0, len = decodedStr.length; i < len; i++) { + array[i] = decodedStr.charCodeAt(i); + } + return arrayBuffer; +}; + +// ------------------------------------------------------------------------------ + +/* This code is based on the performance tests at http://jsperf.com/b64tests + * This 12-bit-at-a-time algorithm was the best performing version on all + * platforms tested. + */ + +var b64_6bit = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; +var b64_12bit; + +var b64_12bitTable = function () { + b64_12bit = []; + for (var i = 0; i < 64; i++) { + for (var j = 0; j < 64; j++) { + b64_12bit[i * 64 + j] = b64_6bit[i] + b64_6bit[j]; + } + } + b64_12bitTable = function () { return b64_12bit; }; + return b64_12bit; +}; + +function uint8ToBase64 (rawData) { + var numBytes = rawData.byteLength; + var output = ''; + var segment; + var table = b64_12bitTable(); + for (var i = 0; i < numBytes - 2; i += 3) { + segment = (rawData[i] << 16) + (rawData[i + 1] << 8) + rawData[i + 2]; + output += table[segment >> 12]; + output += table[segment & 0xfff]; + } + if (numBytes - i === 2) { + segment = (rawData[i] << 16) + (rawData[i + 1] << 8); + output += table[segment >> 12]; + output += b64_6bit[(segment & 0xfff) >> 6]; + output += '='; + } else if (numBytes - i === 1) { + segment = (rawData[i] << 16); + output += table[segment >> 12]; + output += '=='; + } + return output; +} + +}); + +// file: src/common/builder.js +define("cordova/builder", function(require, exports, module) { + +var utils = require('cordova/utils'); + +function each (objects, func, context) { + for (var prop in objects) { + if (objects.hasOwnProperty(prop)) { + func.apply(context, [objects[prop], prop]); + } + } +} + +function clobber (obj, key, value) { + exports.replaceHookForTesting(obj, key); + var needsProperty = false; + try { + obj[key] = value; + } catch (e) { + needsProperty = true; + } + // Getters can only be overridden by getters. + if (needsProperty || obj[key] !== value) { + utils.defineGetter(obj, key, function () { + return value; + }); + } +} + +function assignOrWrapInDeprecateGetter (obj, key, value, message) { + if (message) { + utils.defineGetter(obj, key, function () { + console.log(message); + delete obj[key]; + clobber(obj, key, value); + return value; + }); + } else { + clobber(obj, key, value); + } +} + +function include (parent, objects, clobber, merge) { + each(objects, function (obj, key) { + try { + var result = obj.path ? require(obj.path) : {}; + + if (clobber) { + // Clobber if it doesn't exist. + if (typeof parent[key] === 'undefined') { + assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); + } else if (typeof obj.path !== 'undefined') { + // If merging, merge properties onto parent, otherwise, clobber. + if (merge) { + recursiveMerge(parent[key], result); + } else { + assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); + } + } + result = parent[key]; + } else { + // Overwrite if not currently defined. + if (typeof parent[key] === 'undefined') { + assignOrWrapInDeprecateGetter(parent, key, result, obj.deprecated); + } else { + // Set result to what already exists, so we can build children into it if they exist. + result = parent[key]; + } + } + + if (obj.children) { + include(result, obj.children, clobber, merge); + } + } catch (e) { + utils.alert('Exception building Cordova JS globals: ' + e + ' for key "' + key + '"'); + } + }); +} + +/** + * Merge properties from one object onto another recursively. Properties from + * the src object will overwrite existing target property. + * + * @param target Object to merge properties into. + * @param src Object to merge properties from. + */ +function recursiveMerge (target, src) { + for (var prop in src) { + if (src.hasOwnProperty(prop)) { + if (target.prototype && target.prototype.constructor === target) { + // If the target object is a constructor override off prototype. + clobber(target.prototype, prop, src[prop]); + } else { + if (typeof src[prop] === 'object' && typeof target[prop] === 'object') { + recursiveMerge(target[prop], src[prop]); + } else { + clobber(target, prop, src[prop]); + } + } + } + } +} + +exports.buildIntoButDoNotClobber = function (objects, target) { + include(target, objects, false, false); +}; +exports.buildIntoAndClobber = function (objects, target) { + include(target, objects, true, false); +}; +exports.buildIntoAndMerge = function (objects, target) { + include(target, objects, true, true); +}; +exports.recursiveMerge = recursiveMerge; +exports.assignOrWrapInDeprecateGetter = assignOrWrapInDeprecateGetter; +exports.replaceHookForTesting = function () {}; + +}); + +// file: src/common/channel.js +define("cordova/channel", function(require, exports, module) { + +var utils = require('cordova/utils'); +var nextGuid = 1; + +/** + * Custom pub-sub "channel" that can have functions subscribed to it + * This object is used to define and control firing of events for + * cordova initialization, as well as for custom events thereafter. + * + * The order of events during page load and Cordova startup is as follows: + * + * onDOMContentLoaded* Internal event that is received when the web page is loaded and parsed. + * onNativeReady* Internal event that indicates the Cordova native side is ready. + * onCordovaReady* Internal event fired when all Cordova JavaScript objects have been created. + * onDeviceReady* User event fired to indicate that Cordova is ready + * onResume User event fired to indicate a start/resume lifecycle event + * onPause User event fired to indicate a pause lifecycle event + * + * The events marked with an * are sticky. Once they have fired, they will stay in the fired state. + * All listeners that subscribe after the event is fired will be executed right away. + * + * The only Cordova events that user code should register for are: + * deviceready Cordova native code is initialized and Cordova APIs can be called from JavaScript + * pause App has moved to background + * resume App has returned to foreground + * + * Listeners can be registered as: + * document.addEventListener("deviceready", myDeviceReadyListener, false); + * document.addEventListener("resume", myResumeListener, false); + * document.addEventListener("pause", myPauseListener, false); + * + * The DOM lifecycle events should be used for saving and restoring state + * window.onload + * window.onunload + * + */ + +/** + * Channel + * @constructor + * @param type String the channel name + */ +var Channel = function (type, sticky) { + this.type = type; + // Map of guid -> function. + this.handlers = {}; + // 0 = Non-sticky, 1 = Sticky non-fired, 2 = Sticky fired. + this.state = sticky ? 1 : 0; + // Used in sticky mode to remember args passed to fire(). + this.fireArgs = null; + // Used by onHasSubscribersChange to know if there are any listeners. + this.numHandlers = 0; + // Function that is called when the first listener is subscribed, or when + // the last listener is unsubscribed. + this.onHasSubscribersChange = null; +}; +var channel = { + /** + * Calls the provided function only after all of the channels specified + * have been fired. All channels must be sticky channels. + */ + join: function (h, c) { + var len = c.length; + var i = len; + var f = function () { + if (!(--i)) h(); + }; + for (var j = 0; j < len; j++) { + if (c[j].state === 0) { + throw Error('Can only use join with sticky channels.'); + } + c[j].subscribe(f); + } + if (!len) h(); + }, + /* eslint-disable no-return-assign */ + create: function (type) { + return channel[type] = new Channel(type, false); + }, + createSticky: function (type) { + return channel[type] = new Channel(type, true); + }, + /* eslint-enable no-return-assign */ + /** + * cordova Channels that must fire before "deviceready" is fired. + */ + deviceReadyChannelsArray: [], + deviceReadyChannelsMap: {}, + + /** + * Indicate that a feature needs to be initialized before it is ready to be used. + * This holds up Cordova's "deviceready" event until the feature has been initialized + * and Cordova.initComplete(feature) is called. + * + * @param feature {String} The unique feature name + */ + waitForInitialization: function (feature) { + if (feature) { + var c = channel[feature] || this.createSticky(feature); + this.deviceReadyChannelsMap[feature] = c; + this.deviceReadyChannelsArray.push(c); + } + }, + + /** + * Indicate that initialization code has completed and the feature is ready to be used. + * + * @param feature {String} The unique feature name + */ + initializationComplete: function (feature) { + var c = this.deviceReadyChannelsMap[feature]; + if (c) { + c.fire(); + } + } +}; + +function checkSubscriptionArgument (argument) { + if (typeof argument !== 'function' && typeof argument.handleEvent !== 'function') { + throw new Error( + 'Must provide a function or an EventListener object ' + + 'implementing the handleEvent interface.' + ); + } +} + +/** + * Subscribes the given function to the channel. Any time that + * Channel.fire is called so too will the function. + * Optionally specify an execution context for the function + * and a guid that can be used to stop subscribing to the channel. + * Returns the guid. + */ +Channel.prototype.subscribe = function (eventListenerOrFunction, eventListener) { + checkSubscriptionArgument(eventListenerOrFunction); + var handleEvent, guid; + + if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') { + // Received an EventListener object implementing the handleEvent interface + handleEvent = eventListenerOrFunction.handleEvent; + eventListener = eventListenerOrFunction; + } else { + // Received a function to handle event + handleEvent = eventListenerOrFunction; + } + + if (this.state === 2) { + handleEvent.apply(eventListener || this, this.fireArgs); + return; + } + + guid = eventListenerOrFunction.observer_guid; + if (typeof eventListener === 'object') { + handleEvent = utils.close(eventListener, handleEvent); + } + + if (!guid) { + // First time any channel has seen this subscriber + guid = '' + nextGuid++; + } + handleEvent.observer_guid = guid; + eventListenerOrFunction.observer_guid = guid; + + // Don't add the same handler more than once. + if (!this.handlers[guid]) { + this.handlers[guid] = handleEvent; + this.numHandlers++; + if (this.numHandlers === 1) { + this.onHasSubscribersChange && this.onHasSubscribersChange(); + } + } +}; + +/** + * Unsubscribes the function with the given guid from the channel. + */ +Channel.prototype.unsubscribe = function (eventListenerOrFunction) { + checkSubscriptionArgument(eventListenerOrFunction); + var handleEvent, guid, handler; + + if (eventListenerOrFunction && typeof eventListenerOrFunction === 'object') { + // Received an EventListener object implementing the handleEvent interface + handleEvent = eventListenerOrFunction.handleEvent; + } else { + // Received a function to handle event + handleEvent = eventListenerOrFunction; + } + + guid = handleEvent.observer_guid; + handler = this.handlers[guid]; + if (handler) { + delete this.handlers[guid]; + this.numHandlers--; + if (this.numHandlers === 0) { + this.onHasSubscribersChange && this.onHasSubscribersChange(); + } + } +}; + +/** + * Calls all functions subscribed to this channel. + */ +Channel.prototype.fire = function (e) { + var fail = false; // eslint-disable-line no-unused-vars + var fireArgs = Array.prototype.slice.call(arguments); + // Apply stickiness. + if (this.state === 1) { + this.state = 2; + this.fireArgs = fireArgs; + } + if (this.numHandlers) { + // Copy the values first so that it is safe to modify it from within + // callbacks. + var toCall = []; + for (var item in this.handlers) { + toCall.push(this.handlers[item]); + } + for (var i = 0; i < toCall.length; ++i) { + toCall[i].apply(this, fireArgs); + } + if (this.state === 2 && this.numHandlers) { + this.numHandlers = 0; + this.handlers = {}; + this.onHasSubscribersChange && this.onHasSubscribersChange(); + } + } +}; + +// defining them here so they are ready super fast! +// DOM event that is received when the web page is loaded and parsed. +channel.createSticky('onDOMContentLoaded'); + +// Event to indicate the Cordova native side is ready. +channel.createSticky('onNativeReady'); + +// Event to indicate that all Cordova JavaScript objects have been created +// and it's time to run plugin constructors. +channel.createSticky('onCordovaReady'); + +// Event to indicate that all automatically loaded JS plugins are loaded and ready. +// FIXME remove this +channel.createSticky('onPluginsReady'); + +// Event to indicate that Cordova is ready +channel.createSticky('onDeviceReady'); + +// Event to indicate a resume lifecycle event +channel.create('onResume'); + +// Event to indicate a pause lifecycle event +channel.create('onPause'); + +// Channels that must fire before "deviceready" is fired. +channel.waitForInitialization('onCordovaReady'); +channel.waitForInitialization('onDOMContentLoaded'); + +module.exports = channel; + +}); + +// file: ../cordova-android/cordova-js-src/exec.js +define("cordova/exec", function(require, exports, module) { + +/** + * Execute a cordova command. It is up to the native side whether this action + * is synchronous or asynchronous. The native side can return: + * Synchronous: PluginResult object as a JSON string + * Asynchronous: Empty string "" + * If async, the native side will cordova.callbackSuccess or cordova.callbackError, + * depending upon the result of the action. + * + * @param {Function} success The success callback + * @param {Function} fail The fail callback + * @param {String} service The name of the service to use + * @param {String} action Action to be run in cordova + * @param {String[]} [args] Zero or more arguments to pass to the method + */ +var cordova = require('cordova'), + nativeApiProvider = require('cordova/android/nativeapiprovider'), + utils = require('cordova/utils'), + base64 = require('cordova/base64'), + channel = require('cordova/channel'), + jsToNativeModes = { + PROMPT: 0, + JS_OBJECT: 1 + }, + nativeToJsModes = { + // Polls for messages using the JS->Native bridge. + POLLING: 0, + // For LOAD_URL to be viable, it would need to have a work-around for + // the bug where the soft-keyboard gets dismissed when a message is sent. + LOAD_URL: 1, + // For the ONLINE_EVENT to be viable, it would need to intercept all event + // listeners (both through addEventListener and window.ononline) as well + // as set the navigator property itself. + ONLINE_EVENT: 2, + EVAL_BRIDGE: 3 + }, + jsToNativeBridgeMode, // Set lazily. + nativeToJsBridgeMode = nativeToJsModes.EVAL_BRIDGE, + pollEnabled = false, + bridgeSecret = -1; + +var messagesFromNative = []; +var isProcessing = false; +var resolvedPromise = typeof Promise == 'undefined' ? null : Promise.resolve(); +var nextTick = resolvedPromise ? function(fn) { resolvedPromise.then(fn); } : function(fn) { setTimeout(fn); }; + +function androidExec(success, fail, service, action, args) { + if (bridgeSecret < 0) { + // If we ever catch this firing, we'll need to queue up exec()s + // and fire them once we get a secret. For now, I don't think + // it's possible for exec() to be called since plugins are parsed but + // not run until until after onNativeReady. + throw new Error('exec() called without bridgeSecret'); + } + // Set default bridge modes if they have not already been set. + // By default, we use the failsafe, since addJavascriptInterface breaks too often + if (jsToNativeBridgeMode === undefined) { + androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); + } + + // If args is not provided, default to an empty array + args = args || []; + + // Process any ArrayBuffers in the args into a string. + for (var i = 0; i < args.length; i++) { + if (utils.typeName(args[i]) == 'ArrayBuffer') { + args[i] = base64.fromArrayBuffer(args[i]); + } + } + + var callbackId = service + cordova.callbackId++, + argsJson = JSON.stringify(args); + if (success || fail) { + cordova.callbacks[callbackId] = {success:success, fail:fail}; + } + + var msgs = nativeApiProvider.get().exec(bridgeSecret, service, action, callbackId, argsJson); + // If argsJson was received by Java as null, try again with the PROMPT bridge mode. + // This happens in rare circumstances, such as when certain Unicode characters are passed over the bridge on a Galaxy S2. See CB-2666. + if (jsToNativeBridgeMode == jsToNativeModes.JS_OBJECT && msgs === "@Null arguments.") { + androidExec.setJsToNativeBridgeMode(jsToNativeModes.PROMPT); + androidExec(success, fail, service, action, args); + androidExec.setJsToNativeBridgeMode(jsToNativeModes.JS_OBJECT); + } else if (msgs) { + messagesFromNative.push(msgs); + // Always process async to avoid exceptions messing up stack. + nextTick(processMessages); + } +} + +androidExec.init = function() { + bridgeSecret = +prompt('', 'gap_init:' + nativeToJsBridgeMode); + channel.onNativeReady.fire(); +}; + +function pollOnceFromOnlineEvent() { + pollOnce(true); +} + +function pollOnce(opt_fromOnlineEvent) { + if (bridgeSecret < 0) { + // This can happen when the NativeToJsMessageQueue resets the online state on page transitions. + // We know there's nothing to retrieve, so no need to poll. + return; + } + var msgs = nativeApiProvider.get().retrieveJsMessages(bridgeSecret, !!opt_fromOnlineEvent); + if (msgs) { + messagesFromNative.push(msgs); + // Process sync since we know we're already top-of-stack. + processMessages(); + } +} + +function pollingTimerFunc() { + if (pollEnabled) { + pollOnce(); + setTimeout(pollingTimerFunc, 50); + } +} + +function hookOnlineApis() { + function proxyEvent(e) { + cordova.fireWindowEvent(e.type); + } + // The network module takes care of firing online and offline events. + // It currently fires them only on document though, so we bridge them + // to window here (while first listening for exec()-releated online/offline + // events). + window.addEventListener('online', pollOnceFromOnlineEvent, false); + window.addEventListener('offline', pollOnceFromOnlineEvent, false); + cordova.addWindowEventHandler('online'); + cordova.addWindowEventHandler('offline'); + document.addEventListener('online', proxyEvent, false); + document.addEventListener('offline', proxyEvent, false); +} + +hookOnlineApis(); + +androidExec.jsToNativeModes = jsToNativeModes; +androidExec.nativeToJsModes = nativeToJsModes; + +androidExec.setJsToNativeBridgeMode = function(mode) { + if (mode == jsToNativeModes.JS_OBJECT && !window._cordovaNative) { + mode = jsToNativeModes.PROMPT; + } + nativeApiProvider.setPreferPrompt(mode == jsToNativeModes.PROMPT); + jsToNativeBridgeMode = mode; +}; + +androidExec.setNativeToJsBridgeMode = function(mode) { + if (mode == nativeToJsBridgeMode) { + return; + } + if (nativeToJsBridgeMode == nativeToJsModes.POLLING) { + pollEnabled = false; + } + + nativeToJsBridgeMode = mode; + // Tell the native side to switch modes. + // Otherwise, it will be set by androidExec.init() + if (bridgeSecret >= 0) { + nativeApiProvider.get().setNativeToJsBridgeMode(bridgeSecret, mode); + } + + if (mode == nativeToJsModes.POLLING) { + pollEnabled = true; + setTimeout(pollingTimerFunc, 1); + } +}; + +function buildPayload(payload, message) { + var payloadKind = message.charAt(0); + if (payloadKind == 's') { + payload.push(message.slice(1)); + } else if (payloadKind == 't') { + payload.push(true); + } else if (payloadKind == 'f') { + payload.push(false); + } else if (payloadKind == 'N') { + payload.push(null); + } else if (payloadKind == 'n') { + payload.push(+message.slice(1)); + } else if (payloadKind == 'A') { + var data = message.slice(1); + payload.push(base64.toArrayBuffer(data)); + } else if (payloadKind == 'S') { + payload.push(window.atob(message.slice(1))); + } else if (payloadKind == 'M') { + var multipartMessages = message.slice(1); + while (multipartMessages !== "") { + var spaceIdx = multipartMessages.indexOf(' '); + var msgLen = +multipartMessages.slice(0, spaceIdx); + var multipartMessage = multipartMessages.substr(spaceIdx + 1, msgLen); + multipartMessages = multipartMessages.slice(spaceIdx + msgLen + 1); + buildPayload(payload, multipartMessage); + } + } else { + payload.push(JSON.parse(message)); + } +} + +// Processes a single message, as encoded by NativeToJsMessageQueue.java. +function processMessage(message) { + var firstChar = message.charAt(0); + if (firstChar == 'J') { + // This is deprecated on the .java side. It doesn't work with CSP enabled. + eval(message.slice(1)); + } else if (firstChar == 'S' || firstChar == 'F') { + var success = firstChar == 'S'; + var keepCallback = message.charAt(1) == '1'; + var spaceIdx = message.indexOf(' ', 2); + var status = +message.slice(2, spaceIdx); + var nextSpaceIdx = message.indexOf(' ', spaceIdx + 1); + var callbackId = message.slice(spaceIdx + 1, nextSpaceIdx); + var payloadMessage = message.slice(nextSpaceIdx + 1); + var payload = []; + buildPayload(payload, payloadMessage); + cordova.callbackFromNative(callbackId, success, status, payload, keepCallback); + } else { + console.log("processMessage failed: invalid message: " + JSON.stringify(message)); + } +} + +function processMessages() { + // Check for the reentrant case. + if (isProcessing) { + return; + } + if (messagesFromNative.length === 0) { + return; + } + isProcessing = true; + try { + var msg = popMessageFromQueue(); + // The Java side can send a * message to indicate that it + // still has messages waiting to be retrieved. + if (msg == '*' && messagesFromNative.length === 0) { + nextTick(pollOnce); + return; + } + processMessage(msg); + } finally { + isProcessing = false; + if (messagesFromNative.length > 0) { + nextTick(processMessages); + } + } +} + +function popMessageFromQueue() { + var messageBatch = messagesFromNative.shift(); + if (messageBatch == '*') { + return '*'; + } + + var spaceIdx = messageBatch.indexOf(' '); + var msgLen = +messageBatch.slice(0, spaceIdx); + var message = messageBatch.substr(spaceIdx + 1, msgLen); + messageBatch = messageBatch.slice(spaceIdx + msgLen + 1); + if (messageBatch) { + messagesFromNative.unshift(messageBatch); + } + return message; +} + +module.exports = androidExec; + +}); + +// file: src/common/exec/proxy.js +define("cordova/exec/proxy", function(require, exports, module) { + +// internal map of proxy function +var CommandProxyMap = {}; + +module.exports = { + + // example: cordova.commandProxy.add("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...); + add: function (id, proxyObj) { + console.log('adding proxy for ' + id); + CommandProxyMap[id] = proxyObj; + return proxyObj; + }, + + // cordova.commandProxy.remove("Accelerometer"); + remove: function (id) { + var proxy = CommandProxyMap[id]; + delete CommandProxyMap[id]; + CommandProxyMap[id] = null; + return proxy; + }, + + get: function (service, action) { + return (CommandProxyMap[service] ? CommandProxyMap[service][action] : null); + } +}; + +}); + +// file: src/common/init.js +define("cordova/init", function(require, exports, module) { + +var channel = require('cordova/channel'); +var cordova = require('cordova'); +var modulemapper = require('cordova/modulemapper'); +var platform = require('cordova/platform'); +var pluginloader = require('cordova/pluginloader'); +var utils = require('cordova/utils'); + +var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady]; + +function logUnfiredChannels (arr) { + for (var i = 0; i < arr.length; ++i) { + if (arr[i].state !== 2) { + console.log('Channel not fired: ' + arr[i].type); + } + } +} + +window.setTimeout(function () { + if (channel.onDeviceReady.state !== 2) { + console.log('deviceready has not fired after 5 seconds.'); + logUnfiredChannels(platformInitChannelsArray); + logUnfiredChannels(channel.deviceReadyChannelsArray); + } +}, 5000); + +// Replace navigator before any modules are required(), to ensure it happens as soon as possible. +// We replace it so that properties that can't be clobbered can instead be overridden. +function replaceNavigator (origNavigator) { + var CordovaNavigator = function () {}; + CordovaNavigator.prototype = origNavigator; + var newNavigator = new CordovaNavigator(); + // This work-around really only applies to new APIs that are newer than Function.bind. + // Without it, APIs such as getGamepads() break. + if (CordovaNavigator.bind) { + for (var key in origNavigator) { + if (typeof origNavigator[key] === 'function') { + newNavigator[key] = origNavigator[key].bind(origNavigator); + } else { + (function (k) { + utils.defineGetterSetter(newNavigator, key, function () { + return origNavigator[k]; + }); + })(key); + } + } + } + return newNavigator; +} + +if (window.navigator) { + window.navigator = replaceNavigator(window.navigator); +} + +if (!window.console) { + window.console = { + log: function () {} + }; +} +if (!window.console.warn) { + window.console.warn = function (msg) { + this.log('warn: ' + msg); + }; +} + +// Register pause, resume and deviceready channels as events on document. +channel.onPause = cordova.addDocumentEventHandler('pause'); +channel.onResume = cordova.addDocumentEventHandler('resume'); +channel.onActivated = cordova.addDocumentEventHandler('activated'); +channel.onDeviceReady = cordova.addStickyDocumentEventHandler('deviceready'); + +// Listen for DOMContentLoaded and notify our channel subscribers. +if (document.readyState === 'complete' || document.readyState === 'interactive') { + channel.onDOMContentLoaded.fire(); +} else { + document.addEventListener('DOMContentLoaded', function () { + channel.onDOMContentLoaded.fire(); + }, false); +} + +// _nativeReady is global variable that the native side can set +// to signify that the native code is ready. It is a global since +// it may be called before any cordova JS is ready. +if (window._nativeReady) { + channel.onNativeReady.fire(); +} + +modulemapper.clobbers('cordova', 'cordova'); +modulemapper.clobbers('cordova/exec', 'cordova.exec'); +modulemapper.clobbers('cordova/exec', 'Cordova.exec'); + +// Call the platform-specific initialization. +platform.bootstrap && platform.bootstrap(); + +// Wrap in a setTimeout to support the use-case of having plugin JS appended to cordova.js. +// The delay allows the attached modules to be defined before the plugin loader looks for them. +setTimeout(function () { + pluginloader.load(function () { + channel.onPluginsReady.fire(); + }); +}, 0); + +/** + * Create all cordova objects once native side is ready. + */ +channel.join(function () { + modulemapper.mapModules(window); + + platform.initialize && platform.initialize(); + + // Fire event to notify that all objects are created + channel.onCordovaReady.fire(); + + // Fire onDeviceReady event once page has fully loaded, all + // constructors have run and cordova info has been received from native + // side. + channel.join(function () { + require('cordova').fireDocumentEvent('deviceready'); + }, channel.deviceReadyChannelsArray); + +}, platformInitChannelsArray); + +}); + +// file: src/common/modulemapper.js +define("cordova/modulemapper", function(require, exports, module) { + +var builder = require('cordova/builder'); +var moduleMap = define.moduleMap; // eslint-disable-line no-undef +var symbolList; +var deprecationMap; + +exports.reset = function () { + symbolList = []; + deprecationMap = {}; +}; + +function addEntry (strategy, moduleName, symbolPath, opt_deprecationMessage) { + if (!(moduleName in moduleMap)) { + throw new Error('Module ' + moduleName + ' does not exist.'); + } + symbolList.push(strategy, moduleName, symbolPath); + if (opt_deprecationMessage) { + deprecationMap[symbolPath] = opt_deprecationMessage; + } +} + +// Note: Android 2.3 does have Function.bind(). +exports.clobbers = function (moduleName, symbolPath, opt_deprecationMessage) { + addEntry('c', moduleName, symbolPath, opt_deprecationMessage); +}; + +exports.merges = function (moduleName, symbolPath, opt_deprecationMessage) { + addEntry('m', moduleName, symbolPath, opt_deprecationMessage); +}; + +exports.defaults = function (moduleName, symbolPath, opt_deprecationMessage) { + addEntry('d', moduleName, symbolPath, opt_deprecationMessage); +}; + +exports.runs = function (moduleName) { + addEntry('r', moduleName, null); +}; + +function prepareNamespace (symbolPath, context) { + if (!symbolPath) { + return context; + } + var parts = symbolPath.split('.'); + var cur = context; + for (var i = 0, part; part = parts[i]; ++i) { // eslint-disable-line no-cond-assign + cur = cur[part] = cur[part] || {}; + } + return cur; +} + +exports.mapModules = function (context) { + var origSymbols = {}; + context.CDV_origSymbols = origSymbols; + for (var i = 0, len = symbolList.length; i < len; i += 3) { + var strategy = symbolList[i]; + var moduleName = symbolList[i + 1]; + var module = require(moduleName); + // + if (strategy === 'r') { + continue; + } + var symbolPath = symbolList[i + 2]; + var lastDot = symbolPath.lastIndexOf('.'); + var namespace = symbolPath.substr(0, lastDot); + var lastName = symbolPath.substr(lastDot + 1); + + var deprecationMsg = symbolPath in deprecationMap ? 'Access made to deprecated symbol: ' + symbolPath + '. ' + deprecationMsg : null; + var parentObj = prepareNamespace(namespace, context); + var target = parentObj[lastName]; + + if (strategy === 'm' && target) { + builder.recursiveMerge(target, module); + } else if ((strategy === 'd' && !target) || (strategy !== 'd')) { + if (!(symbolPath in origSymbols)) { + origSymbols[symbolPath] = target; + } + builder.assignOrWrapInDeprecateGetter(parentObj, lastName, module, deprecationMsg); + } + } +}; + +exports.getOriginalSymbol = function (context, symbolPath) { + var origSymbols = context.CDV_origSymbols; + if (origSymbols && (symbolPath in origSymbols)) { + return origSymbols[symbolPath]; + } + var parts = symbolPath.split('.'); + var obj = context; + for (var i = 0; i < parts.length; ++i) { + obj = obj && obj[parts[i]]; + } + return obj; +}; + +exports.reset(); + +}); + +// file: ../cordova-android/cordova-js-src/platform.js +define("cordova/platform", function(require, exports, module) { + +// The last resume event that was received that had the result of a plugin call. +var lastResumeEvent = null; + +module.exports = { + id: 'android', + bootstrap: function() { + var channel = require('cordova/channel'), + cordova = require('cordova'), + exec = require('cordova/exec'), + modulemapper = require('cordova/modulemapper'); + + // Get the shared secret needed to use the bridge. + exec.init(); + + // TODO: Extract this as a proper plugin. + modulemapper.clobbers('cordova/plugin/android/app', 'navigator.app'); + + var APP_PLUGIN_NAME = Number(cordova.platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; + + // Inject a listener for the backbutton on the document. + var backButtonChannel = cordova.addDocumentEventHandler('backbutton'); + backButtonChannel.onHasSubscribersChange = function() { + // If we just attached the first handler or detached the last handler, + // let native know we need to override the back button. + exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [this.numHandlers == 1]); + }; + + // Add hardware MENU and SEARCH button handlers + cordova.addDocumentEventHandler('menubutton'); + cordova.addDocumentEventHandler('searchbutton'); + + function bindButtonChannel(buttonName) { + // generic button bind used for volumeup/volumedown buttons + var volumeButtonChannel = cordova.addDocumentEventHandler(buttonName + 'button'); + volumeButtonChannel.onHasSubscribersChange = function() { + exec(null, null, APP_PLUGIN_NAME, "overrideButton", [buttonName, this.numHandlers == 1]); + }; + } + // Inject a listener for the volume buttons on the document. + bindButtonChannel('volumeup'); + bindButtonChannel('volumedown'); + + // The resume event is not "sticky", but it is possible that the event + // will contain the result of a plugin call. We need to ensure that the + // plugin result is delivered even after the event is fired (CB-10498) + var cordovaAddEventListener = document.addEventListener; + + document.addEventListener = function(evt, handler, capture) { + cordovaAddEventListener(evt, handler, capture); + + if (evt === 'resume' && lastResumeEvent) { + handler(lastResumeEvent); + } + }; + + // Let native code know we are all done on the JS side. + // Native code will then un-hide the WebView. + channel.onCordovaReady.subscribe(function() { + exec(onMessageFromNative, null, APP_PLUGIN_NAME, 'messageChannel', []); + exec(null, null, APP_PLUGIN_NAME, "show", []); + }); + } +}; + +function onMessageFromNative(msg) { + var cordova = require('cordova'); + var action = msg.action; + + switch (action) + { + // Button events + case 'backbutton': + case 'menubutton': + case 'searchbutton': + // App life cycle events + case 'pause': + // Volume events + case 'volumedownbutton': + case 'volumeupbutton': + cordova.fireDocumentEvent(action); + break; + case 'resume': + if(arguments.length > 1 && msg.pendingResult) { + if(arguments.length === 2) { + msg.pendingResult.result = arguments[1]; + } else { + // The plugin returned a multipart message + var res = []; + for(var i = 1; i < arguments.length; i++) { + res.push(arguments[i]); + } + msg.pendingResult.result = res; + } + + // Save the plugin result so that it can be delivered to the js + // even if they miss the initial firing of the event + lastResumeEvent = msg; + } + cordova.fireDocumentEvent(action, msg); + break; + default: + throw new Error('Unknown event action ' + action); + } +} + +}); + +// file: ../cordova-android/cordova-js-src/plugin/android/app.js +define("cordova/plugin/android/app", function(require, exports, module) { + +var exec = require('cordova/exec'); +var APP_PLUGIN_NAME = Number(require('cordova').platformVersion.split('.')[0]) >= 4 ? 'CoreAndroid' : 'App'; + +module.exports = { + /** + * Clear the resource cache. + */ + clearCache:function() { + exec(null, null, APP_PLUGIN_NAME, "clearCache", []); + }, + + /** + * Load the url into the webview or into new browser instance. + * + * @param url The URL to load + * @param props Properties that can be passed in to the activity: + * wait: int => wait msec before loading URL + * loadingDialog: "Title,Message" => display a native loading dialog + * loadUrlTimeoutValue: int => time in msec to wait before triggering a timeout error + * clearHistory: boolean => clear webview history (default=false) + * openExternal: boolean => open in a new browser (default=false) + * + * Example: + * navigator.app.loadUrl("http://server/myapp/index.html", {wait:2000, loadingDialog:"Wait,Loading App", loadUrlTimeoutValue: 60000}); + */ + loadUrl:function(url, props) { + exec(null, null, APP_PLUGIN_NAME, "loadUrl", [url, props]); + }, + + /** + * Cancel loadUrl that is waiting to be loaded. + */ + cancelLoadUrl:function() { + exec(null, null, APP_PLUGIN_NAME, "cancelLoadUrl", []); + }, + + /** + * Clear web history in this web view. + * Instead of BACK button loading the previous web page, it will exit the app. + */ + clearHistory:function() { + exec(null, null, APP_PLUGIN_NAME, "clearHistory", []); + }, + + /** + * Go to previous page displayed. + * This is the same as pressing the backbutton on Android device. + */ + backHistory:function() { + exec(null, null, APP_PLUGIN_NAME, "backHistory", []); + }, + + /** + * Override the default behavior of the Android back button. + * If overridden, when the back button is pressed, the "backKeyDown" JavaScript event will be fired. + * + * Note: The user should not have to call this method. Instead, when the user + * registers for the "backbutton" event, this is automatically done. + * + * @param override T=override, F=cancel override + */ + overrideBackbutton:function(override) { + exec(null, null, APP_PLUGIN_NAME, "overrideBackbutton", [override]); + }, + + /** + * Override the default behavior of the Android volume button. + * If overridden, when the volume button is pressed, the "volume[up|down]button" + * JavaScript event will be fired. + * + * Note: The user should not have to call this method. Instead, when the user + * registers for the "volume[up|down]button" event, this is automatically done. + * + * @param button volumeup, volumedown + * @param override T=override, F=cancel override + */ + overrideButton:function(button, override) { + exec(null, null, APP_PLUGIN_NAME, "overrideButton", [button, override]); + }, + + /** + * Exit and terminate the application. + */ + exitApp:function() { + return exec(null, null, APP_PLUGIN_NAME, "exitApp", []); + } +}; + +}); + +// file: src/common/pluginloader.js +define("cordova/pluginloader", function(require, exports, module) { + +var modulemapper = require('cordova/modulemapper'); + +// Helper function to inject a + + + + + + + + + + + \ No newline at end of file diff --git a/assets/www/jquery-3.4.1.min.js b/assets/www/jquery-3.4.1.min.js new file mode 100644 index 0000000000000000000000000000000000000000..a1c07fd803b5fc9c54f44e31123ae4fa11e134b0 --- /dev/null +++ b/assets/www/jquery-3.4.1.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0 or + *