code_text
stringlengths 604
999k
| repo_name
stringlengths 4
100
| file_path
stringlengths 4
873
| language
stringclasses 23
values | license
stringclasses 15
values | size
int32 1.02k
999k
|
---|---|---|---|---|---|
(function(nacl) {
'use strict';
// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
// Public domain.
//
// Implementation derived from TweetNaCl version 20140427.
// See for details: http://tweetnacl.cr.yp.to/
var u64 = function(h, l) { this.hi = h|0 >>> 0; this.lo = l|0 >>> 0; };
var gf = function(init) {
var i, r = new Float64Array(16);
if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
return r;
};
// Pluggable, initialized in high-level API below.
var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
var _0 = new Uint8Array(16);
var _9 = new Uint8Array(32); _9[0] = 9;
var gf0 = gf(),
gf1 = gf([1]),
_121665 = gf([0xdb41, 1]),
D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),
D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),
X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),
Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),
I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);
function L32(x, c) { return (x << c) | (x >>> (32 - c)); }
function ld32(x, i) {
var u = x[i+3] & 0xff;
u = (u<<8)|(x[i+2] & 0xff);
u = (u<<8)|(x[i+1] & 0xff);
return (u<<8)|(x[i+0] & 0xff);
}
function dl64(x, i) {
var h = (x[i] << 24) | (x[i+1] << 16) | (x[i+2] << 8) | x[i+3];
var l = (x[i+4] << 24) | (x[i+5] << 16) | (x[i+6] << 8) | x[i+7];
return new u64(h, l);
}
function st32(x, j, u) {
var i;
for (i = 0; i < 4; i++) { x[j+i] = u & 255; u >>>= 8; }
}
function ts64(x, i, u) {
x[i] = (u.hi >> 24) & 0xff;
x[i+1] = (u.hi >> 16) & 0xff;
x[i+2] = (u.hi >> 8) & 0xff;
x[i+3] = u.hi & 0xff;
x[i+4] = (u.lo >> 24) & 0xff;
x[i+5] = (u.lo >> 16) & 0xff;
x[i+6] = (u.lo >> 8) & 0xff;
x[i+7] = u.lo & 0xff;
}
function vn(x, xi, y, yi, n) {
var i,d = 0;
for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];
return (1 & ((d - 1) >>> 8)) - 1;
}
function crypto_verify_16(x, xi, y, yi) {
return vn(x,xi,y,yi,16);
}
function crypto_verify_32(x, xi, y, yi) {
return vn(x,xi,y,yi,32);
}
function core(out,inp,k,c,h) {
var w = new Uint32Array(16), x = new Uint32Array(16),
y = new Uint32Array(16), t = new Uint32Array(4);
var i, j, m;
for (i = 0; i < 4; i++) {
x[5*i] = ld32(c, 4*i);
x[1+i] = ld32(k, 4*i);
x[6+i] = ld32(inp, 4*i);
x[11+i] = ld32(k, 16+4*i);
}
for (i = 0; i < 16; i++) y[i] = x[i];
for (i = 0; i < 20; i++) {
for (j = 0; j < 4; j++) {
for (m = 0; m < 4; m++) t[m] = x[(5*j+4*m)%16];
t[1] ^= L32((t[0]+t[3])|0, 7);
t[2] ^= L32((t[1]+t[0])|0, 9);
t[3] ^= L32((t[2]+t[1])|0,13);
t[0] ^= L32((t[3]+t[2])|0,18);
for (m = 0; m < 4; m++) w[4*j+(j+m)%4] = t[m];
}
for (m = 0; m < 16; m++) x[m] = w[m];
}
if (h) {
for (i = 0; i < 16; i++) x[i] = (x[i] + y[i]) | 0;
for (i = 0; i < 4; i++) {
x[5*i] = (x[5*i] - ld32(c, 4*i)) | 0;
x[6+i] = (x[6+i] - ld32(inp, 4*i)) | 0;
}
for (i = 0; i < 4; i++) {
st32(out,4*i,x[5*i]);
st32(out,16+4*i,x[6+i]);
}
} else {
for (i = 0; i < 16; i++) st32(out, 4 * i, (x[i] + y[i]) | 0);
}
}
function crypto_core_salsa20(out,inp,k,c) {
core(out,inp,k,c,false);
return 0;
}
function crypto_core_hsalsa20(out,inp,k,c) {
core(out,inp,k,c,true);
return 0;
}
var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
// "expand 32-byte k"
function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {
var z = new Uint8Array(16), x = new Uint8Array(64);
var u, i;
if (!b) return 0;
for (i = 0; i < 16; i++) z[i] = 0;
for (i = 0; i < 8; i++) z[i] = n[i];
while (b >= 64) {
crypto_core_salsa20(x,z,k,sigma);
for (i = 0; i < 64; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i];
u = 1;
for (i = 8; i < 16; i++) {
u = u + (z[i] & 0xff) | 0;
z[i] = u & 0xff;
u >>>= 8;
}
b -= 64;
cpos += 64;
if (m) mpos += 64;
}
if (b > 0) {
crypto_core_salsa20(x,z,k,sigma);
for (i = 0; i < b; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i];
}
return 0;
}
function crypto_stream_salsa20(c,cpos,d,n,k) {
return crypto_stream_salsa20_xor(c,cpos,null,0,d,n,k);
}
function crypto_stream(c,cpos,d,n,k) {
var s = new Uint8Array(32);
crypto_core_hsalsa20(s,n,k,sigma);
return crypto_stream_salsa20(c,cpos,d,n.subarray(16),s);
}
function crypto_stream_xor(c,cpos,m,mpos,d,n,k) {
var s = new Uint8Array(32);
crypto_core_hsalsa20(s,n,k,sigma);
return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,n.subarray(16),s);
}
function add1305(h, c) {
var j, u = 0;
for (j = 0; j < 17; j++) {
u = (u + ((h[j] + c[j]) | 0)) | 0;
h[j] = u & 255;
u >>>= 8;
}
}
var minusp = new Uint32Array([
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252
]);
function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
var s, i, j, u;
var x = new Uint32Array(17), r = new Uint32Array(17),
h = new Uint32Array(17), c = new Uint32Array(17),
g = new Uint32Array(17);
for (j = 0; j < 17; j++) r[j]=h[j]=0;
for (j = 0; j < 16; j++) r[j]=k[j];
r[3]&=15;
r[4]&=252;
r[7]&=15;
r[8]&=252;
r[11]&=15;
r[12]&=252;
r[15]&=15;
while (n > 0) {
for (j = 0; j < 17; j++) c[j] = 0;
for (j = 0; (j < 16) && (j < n); ++j) c[j] = m[mpos+j];
c[j] = 1;
mpos += j; n -= j;
add1305(h,c);
for (i = 0; i < 17; i++) {
x[i] = 0;
for (j = 0; j < 17; j++) x[i] = (x[i] + (h[j] * ((j <= i) ? r[i - j] : ((320 * r[i + 17 - j])|0))) | 0) | 0;
}
for (i = 0; i < 17; i++) h[i] = x[i];
u = 0;
for (j = 0; j < 16; j++) {
u = (u + h[j]) | 0;
h[j] = u & 255;
u >>>= 8;
}
u = (u + h[16]) | 0; h[16] = u & 3;
u = (5 * (u >>> 2)) | 0;
for (j = 0; j < 16; j++) {
u = (u + h[j]) | 0;
h[j] = u & 255;
u >>>= 8;
}
u = (u + h[16]) | 0; h[16] = u;
}
for (j = 0; j < 17; j++) g[j] = h[j];
add1305(h,minusp);
s = (-(h[16] >>> 7) | 0);
for (j = 0; j < 17; j++) h[j] ^= s & (g[j] ^ h[j]);
for (j = 0; j < 16; j++) c[j] = k[j + 16];
c[16] = 0;
add1305(h,c);
for (j = 0; j < 16; j++) out[outpos+j] = h[j];
return 0;
}
function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
var x = new Uint8Array(16);
crypto_onetimeauth(x,0,m,mpos,n,k);
return crypto_verify_16(h,hpos,x,0);
}
function crypto_secretbox(c,m,d,n,k) {
var i;
if (d < 32) return -1;
crypto_stream_xor(c,0,m,0,d,n,k);
crypto_onetimeauth(c, 16, c, 32, d - 32, c);
for (i = 0; i < 16; i++) c[i] = 0;
return 0;
}
function crypto_secretbox_open(m,c,d,n,k) {
var i;
var x = new Uint8Array(32);
if (d < 32) return -1;
crypto_stream(x,0,32,n,k);
if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;
crypto_stream_xor(m,0,c,0,d,n,k);
for (i = 0; i < 32; i++) m[i] = 0;
return 0;
}
function set25519(r, a) {
var i;
for (i = 0; i < 16; i++) r[i] = a[i]|0;
}
function car25519(o) {
var c;
var i;
for (i = 0; i < 16; i++) {
o[i] += 65536;
c = Math.floor(o[i] / 65536);
o[(i+1)*(i<15?1:0)] += c - 1 + 37 * (c-1) * (i===15?1:0);
o[i] -= (c * 65536);
}
}
function sel25519(p, q, b) {
var t, c = ~(b-1);
for (var i = 0; i < 16; i++) {
t = c & (p[i] ^ q[i]);
p[i] ^= t;
q[i] ^= t;
}
}
function pack25519(o, n) {
var i, j, b;
var m = gf(), t = gf();
for (i = 0; i < 16; i++) t[i] = n[i];
car25519(t);
car25519(t);
car25519(t);
for (j = 0; j < 2; j++) {
m[0] = t[0] - 0xffed;
for (i = 1; i < 15; i++) {
m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);
m[i-1] &= 0xffff;
}
m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);
b = (m[15]>>16) & 1;
m[14] &= 0xffff;
sel25519(t, m, 1-b);
}
for (i = 0; i < 16; i++) {
o[2*i] = t[i] & 0xff;
o[2*i+1] = t[i]>>8;
}
}
function neq25519(a, b) {
var c = new Uint8Array(32), d = new Uint8Array(32);
pack25519(c, a);
pack25519(d, b);
return crypto_verify_32(c, 0, d, 0);
}
function par25519(a) {
var d = new Uint8Array(32);
pack25519(d, a);
return d[0] & 1;
}
function unpack25519(o, n) {
var i;
for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);
o[15] &= 0x7fff;
}
function A(o, a, b) {
var i;
for (i = 0; i < 16; i++) o[i] = (a[i] + b[i])|0;
}
function Z(o, a, b) {
var i;
for (i = 0; i < 16; i++) o[i] = (a[i] - b[i])|0;
}
function M(o, a, b) {
var i, j, t = new Float64Array(31);
for (i = 0; i < 31; i++) t[i] = 0;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
t[i+j] += a[i] * b[j];
}
}
for (i = 0; i < 15; i++) {
t[i] += 38 * t[i+16];
}
for (i = 0; i < 16; i++) o[i] = t[i];
car25519(o);
car25519(o);
}
function S(o, a) {
M(o, a, a);
}
function inv25519(o, i) {
var c = gf();
var a;
for (a = 0; a < 16; a++) c[a] = i[a];
for (a = 253; a >= 0; a--) {
S(c, c);
if(a !== 2 && a !== 4) M(c, c, i);
}
for (a = 0; a < 16; a++) o[a] = c[a];
}
function pow2523(o, i) {
var c = gf();
var a;
for (a = 0; a < 16; a++) c[a] = i[a];
for (a = 250; a >= 0; a--) {
S(c, c);
if(a !== 1) M(c, c, i);
}
for (a = 0; a < 16; a++) o[a] = c[a];
}
function crypto_scalarmult(q, n, p) {
var z = new Uint8Array(32);
var x = new Float64Array(80), r, i;
var a = gf(), b = gf(), c = gf(),
d = gf(), e = gf(), f = gf();
for (i = 0; i < 31; i++) z[i] = n[i];
z[31]=(n[31]&127)|64;
z[0]&=248;
unpack25519(x,p);
for (i = 0; i < 16; i++) {
b[i]=x[i];
d[i]=a[i]=c[i]=0;
}
a[0]=d[0]=1;
for (i=254; i>=0; --i) {
r=(z[i>>>3]>>>(i&7))&1;
sel25519(a,b,r);
sel25519(c,d,r);
A(e,a,c);
Z(a,a,c);
A(c,b,d);
Z(b,b,d);
S(d,e);
S(f,a);
M(a,c,a);
M(c,b,e);
A(e,a,c);
Z(a,a,c);
S(b,a);
Z(c,d,f);
M(a,c,_121665);
A(a,a,d);
M(c,c,a);
M(a,d,f);
M(d,b,x);
S(b,e);
sel25519(a,b,r);
sel25519(c,d,r);
}
for (i = 0; i < 16; i++) {
x[i+16]=a[i];
x[i+32]=c[i];
x[i+48]=b[i];
x[i+64]=d[i];
}
var x32 = x.subarray(32);
var x16 = x.subarray(16);
inv25519(x32,x32);
M(x16,x16,x32);
pack25519(q,x16);
return 0;
}
function crypto_scalarmult_base(q, n) {
return crypto_scalarmult(q, n, _9);
}
function crypto_box_keypair(y, x) {
randombytes(x, 32);
return crypto_scalarmult_base(y, x);
}
function crypto_box_beforenm(k, y, x) {
var s = new Uint8Array(32);
crypto_scalarmult(s, x, y);
return crypto_core_hsalsa20(k, _0, s, sigma);
}
var crypto_box_afternm = crypto_secretbox;
var crypto_box_open_afternm = crypto_secretbox_open;
function crypto_box(c, m, d, n, y, x) {
var k = new Uint8Array(32);
crypto_box_beforenm(k, y, x);
return crypto_box_afternm(c, m, d, n, k);
}
function crypto_box_open(m, c, d, n, y, x) {
var k = new Uint8Array(32);
crypto_box_beforenm(k, y, x);
return crypto_box_open_afternm(m, c, d, n, k);
}
function add64() {
var a = 0, b = 0, c = 0, d = 0, m16 = 65535, l, h, i;
for (i = 0; i < arguments.length; i++) {
l = arguments[i].lo;
h = arguments[i].hi;
a += (l & m16); b += (l >>> 16);
c += (h & m16); d += (h >>> 16);
}
b += (a >>> 16);
c += (b >>> 16);
d += (c >>> 16);
return new u64((c & m16) | (d << 16), (a & m16) | (b << 16));
}
function shr64(x, c) {
return new u64((x.hi >>> c), (x.lo >>> c) | (x.hi << (32 - c)));
}
function xor64() {
var l = 0, h = 0, i;
for (i = 0; i < arguments.length; i++) {
l ^= arguments[i].lo;
h ^= arguments[i].hi;
}
return new u64(h, l);
}
function R(x, c) {
var h, l, c1 = 32 - c;
if (c < 32) {
h = (x.hi >>> c) | (x.lo << c1);
l = (x.lo >>> c) | (x.hi << c1);
} else if (c < 64) {
h = (x.lo >>> c) | (x.hi << c1);
l = (x.hi >>> c) | (x.lo << c1);
}
return new u64(h, l);
}
function Ch(x, y, z) {
var h = (x.hi & y.hi) ^ (~x.hi & z.hi),
l = (x.lo & y.lo) ^ (~x.lo & z.lo);
return new u64(h, l);
}
function Maj(x, y, z) {
var h = (x.hi & y.hi) ^ (x.hi & z.hi) ^ (y.hi & z.hi),
l = (x.lo & y.lo) ^ (x.lo & z.lo) ^ (y.lo & z.lo);
return new u64(h, l);
}
function Sigma0(x) { return xor64(R(x,28), R(x,34), R(x,39)); }
function Sigma1(x) { return xor64(R(x,14), R(x,18), R(x,41)); }
function sigma0(x) { return xor64(R(x, 1), R(x, 8), shr64(x,7)); }
function sigma1(x) { return xor64(R(x,19), R(x,61), shr64(x,6)); }
var K = [
new u64(0x428a2f98, 0xd728ae22), new u64(0x71374491, 0x23ef65cd),
new u64(0xb5c0fbcf, 0xec4d3b2f), new u64(0xe9b5dba5, 0x8189dbbc),
new u64(0x3956c25b, 0xf348b538), new u64(0x59f111f1, 0xb605d019),
new u64(0x923f82a4, 0xaf194f9b), new u64(0xab1c5ed5, 0xda6d8118),
new u64(0xd807aa98, 0xa3030242), new u64(0x12835b01, 0x45706fbe),
new u64(0x243185be, 0x4ee4b28c), new u64(0x550c7dc3, 0xd5ffb4e2),
new u64(0x72be5d74, 0xf27b896f), new u64(0x80deb1fe, 0x3b1696b1),
new u64(0x9bdc06a7, 0x25c71235), new u64(0xc19bf174, 0xcf692694),
new u64(0xe49b69c1, 0x9ef14ad2), new u64(0xefbe4786, 0x384f25e3),
new u64(0x0fc19dc6, 0x8b8cd5b5), new u64(0x240ca1cc, 0x77ac9c65),
new u64(0x2de92c6f, 0x592b0275), new u64(0x4a7484aa, 0x6ea6e483),
new u64(0x5cb0a9dc, 0xbd41fbd4), new u64(0x76f988da, 0x831153b5),
new u64(0x983e5152, 0xee66dfab), new u64(0xa831c66d, 0x2db43210),
new u64(0xb00327c8, 0x98fb213f), new u64(0xbf597fc7, 0xbeef0ee4),
new u64(0xc6e00bf3, 0x3da88fc2), new u64(0xd5a79147, 0x930aa725),
new u64(0x06ca6351, 0xe003826f), new u64(0x14292967, 0x0a0e6e70),
new u64(0x27b70a85, 0x46d22ffc), new u64(0x2e1b2138, 0x5c26c926),
new u64(0x4d2c6dfc, 0x5ac42aed), new u64(0x53380d13, 0x9d95b3df),
new u64(0x650a7354, 0x8baf63de), new u64(0x766a0abb, 0x3c77b2a8),
new u64(0x81c2c92e, 0x47edaee6), new u64(0x92722c85, 0x1482353b),
new u64(0xa2bfe8a1, 0x4cf10364), new u64(0xa81a664b, 0xbc423001),
new u64(0xc24b8b70, 0xd0f89791), new u64(0xc76c51a3, 0x0654be30),
new u64(0xd192e819, 0xd6ef5218), new u64(0xd6990624, 0x5565a910),
new u64(0xf40e3585, 0x5771202a), new u64(0x106aa070, 0x32bbd1b8),
new u64(0x19a4c116, 0xb8d2d0c8), new u64(0x1e376c08, 0x5141ab53),
new u64(0x2748774c, 0xdf8eeb99), new u64(0x34b0bcb5, 0xe19b48a8),
new u64(0x391c0cb3, 0xc5c95a63), new u64(0x4ed8aa4a, 0xe3418acb),
new u64(0x5b9cca4f, 0x7763e373), new u64(0x682e6ff3, 0xd6b2b8a3),
new u64(0x748f82ee, 0x5defb2fc), new u64(0x78a5636f, 0x43172f60),
new u64(0x84c87814, 0xa1f0ab72), new u64(0x8cc70208, 0x1a6439ec),
new u64(0x90befffa, 0x23631e28), new u64(0xa4506ceb, 0xde82bde9),
new u64(0xbef9a3f7, 0xb2c67915), new u64(0xc67178f2, 0xe372532b),
new u64(0xca273ece, 0xea26619c), new u64(0xd186b8c7, 0x21c0c207),
new u64(0xeada7dd6, 0xcde0eb1e), new u64(0xf57d4f7f, 0xee6ed178),
new u64(0x06f067aa, 0x72176fba), new u64(0x0a637dc5, 0xa2c898a6),
new u64(0x113f9804, 0xbef90dae), new u64(0x1b710b35, 0x131c471b),
new u64(0x28db77f5, 0x23047d84), new u64(0x32caab7b, 0x40c72493),
new u64(0x3c9ebe0a, 0x15c9bebc), new u64(0x431d67c4, 0x9c100d4c),
new u64(0x4cc5d4be, 0xcb3e42b6), new u64(0x597f299c, 0xfc657e2a),
new u64(0x5fcb6fab, 0x3ad6faec), new u64(0x6c44198c, 0x4a475817)
];
function crypto_hashblocks(x, m, n) {
var z = [], b = [], a = [], w = [], t, i, j;
for (i = 0; i < 8; i++) z[i] = a[i] = dl64(x, 8*i);
var pos = 0;
while (n >= 128) {
for (i = 0; i < 16; i++) w[i] = dl64(m, 8*i+pos);
for (i = 0; i < 80; i++) {
for (j = 0; j < 8; j++) b[j] = a[j];
t = add64(a[7], Sigma1(a[4]), Ch(a[4], a[5], a[6]), K[i], w[i%16]);
b[7] = add64(t, Sigma0(a[0]), Maj(a[0], a[1], a[2]));
b[3] = add64(b[3], t);
for (j = 0; j < 8; j++) a[(j+1)%8] = b[j];
if (i%16 === 15) {
for (j = 0; j < 16; j++) {
w[j] = add64(w[j], w[(j+9)%16], sigma0(w[(j+1)%16]), sigma1(w[(j+14)%16]));
}
}
}
for (i = 0; i < 8; i++) {
a[i] = add64(a[i], z[i]);
z[i] = a[i];
}
pos += 128;
n -= 128;
}
for (i = 0; i < 8; i++) ts64(x, 8*i, z[i]);
return n;
}
var iv = new Uint8Array([
0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08,
0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b,
0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b,
0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1,
0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1,
0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f,
0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b,
0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79
]);
function crypto_hash(out, m, n) {
var h = new Uint8Array(64), x = new Uint8Array(256);
var i, b = n;
for (i = 0; i < 64; i++) h[i] = iv[i];
crypto_hashblocks(h, m, n);
n %= 128;
for (i = 0; i < 256; i++) x[i] = 0;
for (i = 0; i < n; i++) x[i] = m[b-n+i];
x[n] = 128;
n = 256-128*(n<112?1:0);
x[n-9] = 0;
ts64(x, n-8, new u64((b / 0x20000000) | 0, b << 3));
crypto_hashblocks(h, x, n);
for (i = 0; i < 64; i++) out[i] = h[i];
return 0;
}
function add(p, q) {
var a = gf(), b = gf(), c = gf(),
d = gf(), e = gf(), f = gf(),
g = gf(), h = gf(), t = gf();
Z(a, p[1], p[0]);
Z(t, q[1], q[0]);
M(a, a, t);
A(b, p[0], p[1]);
A(t, q[0], q[1]);
M(b, b, t);
M(c, p[3], q[3]);
M(c, c, D2);
M(d, p[2], q[2]);
A(d, d, d);
Z(e, b, a);
Z(f, d, c);
A(g, d, c);
A(h, b, a);
M(p[0], e, f);
M(p[1], h, g);
M(p[2], g, f);
M(p[3], e, h);
}
function cswap(p, q, b) {
var i;
for (i = 0; i < 4; i++) {
sel25519(p[i], q[i], b);
}
}
function pack(r, p) {
var tx = gf(), ty = gf(), zi = gf();
inv25519(zi, p[2]);
M(tx, p[0], zi);
M(ty, p[1], zi);
pack25519(r, ty);
r[31] ^= par25519(tx) << 7;
}
function scalarmult(p, q, s) {
var b, i;
set25519(p[0], gf0);
set25519(p[1], gf1);
set25519(p[2], gf1);
set25519(p[3], gf0);
for (i = 255; i >= 0; --i) {
b = (s[(i/8)|0] >> (i&7)) & 1;
cswap(p, q, b);
add(q, p);
add(p, p);
cswap(p, q, b);
}
}
function scalarbase(p, s) {
var q = [gf(), gf(), gf(), gf()];
set25519(q[0], X);
set25519(q[1], Y);
set25519(q[2], gf1);
M(q[3], X, Y);
scalarmult(p, q, s);
}
function crypto_sign_keypair(pk, sk, seeded) {
var d = new Uint8Array(64);
var p = [gf(), gf(), gf(), gf()];
var i;
if (!seeded) randombytes(sk, 32);
crypto_hash(d, sk, 32);
d[0] &= 248;
d[31] &= 127;
d[31] |= 64;
scalarbase(p, d);
pack(pk, p);
for (i = 0; i < 32; i++) sk[i+32] = pk[i];
return 0;
}
var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);
function modL(r, x) {
var carry, i, j, k;
for (i = 63; i >= 32; --i) {
carry = 0;
for (j = i - 32, k = i - 12; j < k; ++j) {
x[j] += carry - 16 * x[i] * L[j - (i - 32)];
carry = (x[j] + 128) >> 8;
x[j] -= carry * 256;
}
x[j] += carry;
x[i] = 0;
}
carry = 0;
for (j = 0; j < 32; j++) {
x[j] += carry - (x[31] >> 4) * L[j];
carry = x[j] >> 8;
x[j] &= 255;
}
for (j = 0; j < 32; j++) x[j] -= carry * L[j];
for (i = 0; i < 32; i++) {
x[i+1] += x[i] >> 8;
r[i] = x[i] & 255;
}
}
function reduce(r) {
var x = new Float64Array(64), i;
for (i = 0; i < 64; i++) x[i] = r[i];
for (i = 0; i < 64; i++) r[i] = 0;
modL(r, x);
}
// Note: difference from C - smlen returned, not passed as argument.
function crypto_sign(sm, m, n, sk) {
var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
var i, j, x = new Float64Array(64);
var p = [gf(), gf(), gf(), gf()];
crypto_hash(d, sk, 32);
d[0] &= 248;
d[31] &= 127;
d[31] |= 64;
var smlen = n + 64;
for (i = 0; i < n; i++) sm[64 + i] = m[i];
for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];
crypto_hash(r, sm.subarray(32), n+32);
reduce(r);
scalarbase(p, r);
pack(sm, p);
for (i = 32; i < 64; i++) sm[i] = sk[i];
crypto_hash(h, sm, n + 64);
reduce(h);
for (i = 0; i < 64; i++) x[i] = 0;
for (i = 0; i < 32; i++) x[i] = r[i];
for (i = 0; i < 32; i++) {
for (j = 0; j < 32; j++) {
x[i+j] += h[i] * d[j];
}
}
modL(sm.subarray(32), x);
return smlen;
}
function unpackneg(r, p) {
var t = gf(), chk = gf(), num = gf(),
den = gf(), den2 = gf(), den4 = gf(),
den6 = gf();
set25519(r[2], gf1);
unpack25519(r[1], p);
S(num, r[1]);
M(den, num, D);
Z(num, num, r[2]);
A(den, r[2], den);
S(den2, den);
S(den4, den2);
M(den6, den4, den2);
M(t, den6, num);
M(t, t, den);
pow2523(t, t);
M(t, t, num);
M(t, t, den);
M(t, t, den);
M(r[0], t, den);
S(chk, r[0]);
M(chk, chk, den);
if (neq25519(chk, num)) M(r[0], r[0], I);
S(chk, r[0]);
M(chk, chk, den);
if (neq25519(chk, num)) return -1;
if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);
M(r[3], r[0], r[1]);
return 0;
}
function crypto_sign_open(m, sm, n, pk) {
var i, mlen;
var t = new Uint8Array(32), h = new Uint8Array(64);
var p = [gf(), gf(), gf(), gf()],
q = [gf(), gf(), gf(), gf()];
mlen = -1;
if (n < 64) return -1;
if (unpackneg(q, pk)) return -1;
for (i = 0; i < n; i++) m[i] = sm[i];
for (i = 0; i < 32; i++) m[i+32] = pk[i];
crypto_hash(h, m, n);
reduce(h);
scalarmult(p, q, h);
scalarbase(q, sm.subarray(32));
add(p, q);
pack(t, p);
n -= 64;
if (crypto_verify_32(sm, 0, t, 0)) {
for (i = 0; i < n; i++) m[i] = 0;
return -1;
}
for (i = 0; i < n; i++) m[i] = sm[i + 64];
mlen = n;
return mlen;
}
var crypto_secretbox_KEYBYTES = 32,
crypto_secretbox_NONCEBYTES = 24,
crypto_secretbox_ZEROBYTES = 32,
crypto_secretbox_BOXZEROBYTES = 16,
crypto_scalarmult_BYTES = 32,
crypto_scalarmult_SCALARBYTES = 32,
crypto_box_PUBLICKEYBYTES = 32,
crypto_box_SECRETKEYBYTES = 32,
crypto_box_BEFORENMBYTES = 32,
crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,
crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,
crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,
crypto_sign_BYTES = 64,
crypto_sign_PUBLICKEYBYTES = 32,
crypto_sign_SECRETKEYBYTES = 64,
crypto_sign_SEEDBYTES = 32,
crypto_hash_BYTES = 64;
nacl.lowlevel = {
crypto_core_hsalsa20: crypto_core_hsalsa20,
crypto_stream_xor: crypto_stream_xor,
crypto_stream: crypto_stream,
crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,
crypto_stream_salsa20: crypto_stream_salsa20,
crypto_onetimeauth: crypto_onetimeauth,
crypto_onetimeauth_verify: crypto_onetimeauth_verify,
crypto_verify_16: crypto_verify_16,
crypto_verify_32: crypto_verify_32,
crypto_secretbox: crypto_secretbox,
crypto_secretbox_open: crypto_secretbox_open,
crypto_scalarmult: crypto_scalarmult,
crypto_scalarmult_base: crypto_scalarmult_base,
crypto_box_beforenm: crypto_box_beforenm,
crypto_box_afternm: crypto_box_afternm,
crypto_box: crypto_box,
crypto_box_open: crypto_box_open,
crypto_box_keypair: crypto_box_keypair,
crypto_hash: crypto_hash,
crypto_sign: crypto_sign,
crypto_sign_keypair: crypto_sign_keypair,
crypto_sign_open: crypto_sign_open,
crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,
crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,
crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,
crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,
crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,
crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,
crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,
crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,
crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,
crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,
crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,
crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,
crypto_sign_BYTES: crypto_sign_BYTES,
crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,
crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,
crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,
crypto_hash_BYTES: crypto_hash_BYTES
};
/* High-level API */
function checkLengths(k, n) {
if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
}
function checkBoxLengths(pk, sk) {
if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');
if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');
}
function checkArrayTypes() {
var t, i;
for (i = 0; i < arguments.length; i++) {
if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')
throw new TypeError('unexpected type ' + t + ', use Uint8Array');
}
}
function cleanup(arr) {
for (var i = 0; i < arr.length; i++) arr[i] = 0;
}
// TODO: Completely remove this in v0.15.
if (!nacl.util) {
nacl.util = {};
nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');
};
}
nacl.randomBytes = function(n) {
var b = new Uint8Array(n);
randombytes(b, n);
return b;
};
nacl.secretbox = function(msg, nonce, key) {
checkArrayTypes(msg, nonce, key);
checkLengths(key, nonce);
var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
var c = new Uint8Array(m.length);
for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];
crypto_secretbox(c, m, m.length, nonce, key);
return c.subarray(crypto_secretbox_BOXZEROBYTES);
};
nacl.secretbox.open = function(box, nonce, key) {
checkArrayTypes(box, nonce, key);
checkLengths(key, nonce);
var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
var m = new Uint8Array(c.length);
for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];
if (c.length < 32) return false;
if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;
return m.subarray(crypto_secretbox_ZEROBYTES);
};
nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
nacl.scalarMult = function(n, p) {
checkArrayTypes(n, p);
if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');
var q = new Uint8Array(crypto_scalarmult_BYTES);
crypto_scalarmult(q, n, p);
return q;
};
nacl.scalarMult.base = function(n) {
checkArrayTypes(n);
if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
var q = new Uint8Array(crypto_scalarmult_BYTES);
crypto_scalarmult_base(q, n);
return q;
};
nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
nacl.box = function(msg, nonce, publicKey, secretKey) {
var k = nacl.box.before(publicKey, secretKey);
return nacl.secretbox(msg, nonce, k);
};
nacl.box.before = function(publicKey, secretKey) {
checkArrayTypes(publicKey, secretKey);
checkBoxLengths(publicKey, secretKey);
var k = new Uint8Array(crypto_box_BEFORENMBYTES);
crypto_box_beforenm(k, publicKey, secretKey);
return k;
};
nacl.box.after = nacl.secretbox;
nacl.box.open = function(msg, nonce, publicKey, secretKey) {
var k = nacl.box.before(publicKey, secretKey);
return nacl.secretbox.open(msg, nonce, k);
};
nacl.box.open.after = nacl.secretbox.open;
nacl.box.keyPair = function() {
var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
crypto_box_keypair(pk, sk);
return {publicKey: pk, secretKey: sk};
};
nacl.box.keyPair.fromSecretKey = function(secretKey) {
checkArrayTypes(secretKey);
if (secretKey.length !== crypto_box_SECRETKEYBYTES)
throw new Error('bad secret key size');
var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
crypto_scalarmult_base(pk, secretKey);
return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
};
nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
nacl.box.nonceLength = crypto_box_NONCEBYTES;
nacl.box.overheadLength = nacl.secretbox.overheadLength;
nacl.sign = function(msg, secretKey) {
checkArrayTypes(msg, secretKey);
if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
throw new Error('bad secret key size');
var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);
crypto_sign(signedMsg, msg, msg.length, secretKey);
return signedMsg;
};
nacl.sign.open = function(signedMsg, publicKey) {
if (arguments.length !== 2)
throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');
checkArrayTypes(signedMsg, publicKey);
if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
throw new Error('bad public key size');
var tmp = new Uint8Array(signedMsg.length);
var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
if (mlen < 0) return null;
var m = new Uint8Array(mlen);
for (var i = 0; i < m.length; i++) m[i] = tmp[i];
return m;
};
nacl.sign.detached = function(msg, secretKey) {
var signedMsg = nacl.sign(msg, secretKey);
var sig = new Uint8Array(crypto_sign_BYTES);
for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];
return sig;
};
nacl.sign.detached.verify = function(msg, sig, publicKey) {
checkArrayTypes(msg, sig, publicKey);
if (sig.length !== crypto_sign_BYTES)
throw new Error('bad signature size');
if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
throw new Error('bad public key size');
var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
var m = new Uint8Array(crypto_sign_BYTES + msg.length);
var i;
for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];
return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);
};
nacl.sign.keyPair = function() {
var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
crypto_sign_keypair(pk, sk);
return {publicKey: pk, secretKey: sk};
};
nacl.sign.keyPair.fromSecretKey = function(secretKey) {
checkArrayTypes(secretKey);
if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
throw new Error('bad secret key size');
var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];
return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
};
nacl.sign.keyPair.fromSeed = function(seed) {
checkArrayTypes(seed);
if (seed.length !== crypto_sign_SEEDBYTES)
throw new Error('bad seed size');
var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
for (var i = 0; i < 32; i++) sk[i] = seed[i];
crypto_sign_keypair(pk, sk, true);
return {publicKey: pk, secretKey: sk};
};
nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
nacl.sign.seedLength = crypto_sign_SEEDBYTES;
nacl.sign.signatureLength = crypto_sign_BYTES;
nacl.hash = function(msg) {
checkArrayTypes(msg);
var h = new Uint8Array(crypto_hash_BYTES);
crypto_hash(h, msg, msg.length);
return h;
};
nacl.hash.hashLength = crypto_hash_BYTES;
nacl.verify = function(x, y) {
checkArrayTypes(x, y);
// Zero length arguments are considered not equal.
if (x.length === 0 || y.length === 0) return false;
if (x.length !== y.length) return false;
return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
};
nacl.setPRNG = function(fn) {
randombytes = fn;
};
(function() {
// Initialize PRNG if environment provides CSPRNG.
// If not, methods calling randombytes will throw.
var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
if (crypto && crypto.getRandomValues) {
// Browsers.
var QUOTA = 65536;
nacl.setPRNG(function(x, n) {
var i, v = new Uint8Array(n);
for (i = 0; i < n; i += QUOTA) {
crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
}
for (i = 0; i < n; i++) x[i] = v[i];
cleanup(v);
});
} else if (typeof require !== 'undefined') {
// Node.js.
crypto = require('crypto');
if (crypto && crypto.randomBytes) {
nacl.setPRNG(function(x, n) {
var i, v = crypto.randomBytes(n);
for (i = 0; i < n; i++) x[i] = v[i];
cleanup(v);
});
}
}
})();
})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
| wolfiex/VisACC | dsmaccropa/node_modules/tweetnacl/nacl.js | JavaScript | mit | 32,948 |
YUI.add('event-key', function (Y, NAME) {
/**
* Functionality to listen for one or more specific key combinations.
* @module event
* @submodule event-key
*/
var ALT = "+alt",
CTRL = "+ctrl",
META = "+meta",
SHIFT = "+shift",
trim = Y.Lang.trim,
eventDef = {
KEY_MAP: {
enter : 13,
esc : 27,
backspace: 8,
tab : 9,
pageup : 33,
pagedown : 34
},
_typeRE: /^(up|down|press):/,
_keysRE: /^(?:up|down|press):|\+(alt|ctrl|meta|shift)/g,
processArgs: function (args) {
var spec = args.splice(3,1)[0],
mods = Y.Array.hash(spec.match(/\+(?:alt|ctrl|meta|shift)\b/g) || []),
config = {
type: this._typeRE.test(spec) ? RegExp.$1 : null,
mods: mods,
keys: null
},
// strip type and modifiers from spec, leaving only keyCodes
bits = spec.replace(this._keysRE, ''),
chr, uc, lc, i;
if (bits) {
bits = bits.split(',');
config.keys = {};
// FIXME: need to support '65,esc' => keypress, keydown
for (i = bits.length - 1; i >= 0; --i) {
chr = trim(bits[i]);
// catch sloppy filters, trailing commas, etc 'a,,'
if (!chr) {
continue;
}
// non-numerics are single characters or key names
if (+chr == chr) {
config.keys[chr] = mods;
} else {
lc = chr.toLowerCase();
if (this.KEY_MAP[lc]) {
config.keys[this.KEY_MAP[lc]] = mods;
// FIXME: '65,enter' defaults keydown for both
if (!config.type) {
config.type = "down"; // safest
}
} else {
// FIXME: Character mapping only works for keypress
// events. Otherwise, it uses String.fromCharCode()
// from the keyCode, which is wrong.
chr = chr.charAt(0);
uc = chr.toUpperCase();
if (mods["+shift"]) {
chr = uc;
}
// FIXME: stupid assumption that
// the keycode of the lower case == the
// charCode of the upper case
// a (key:65,char:97), A (key:65,char:65)
config.keys[chr.charCodeAt(0)] =
(chr === uc) ?
// upper case chars get +shift free
Y.merge(mods, { "+shift": true }) :
mods;
}
}
}
}
if (!config.type) {
config.type = "press";
}
return config;
},
on: function (node, sub, notifier, filter) {
var spec = sub._extra,
type = "key" + spec.type,
keys = spec.keys,
method = (filter) ? "delegate" : "on";
// Note: without specifying any keyCodes, this becomes a
// horribly inefficient alias for 'keydown' (et al), but I
// can't abort this subscription for a simple
// Y.on('keypress', ...);
// Please use keyCodes or just subscribe directly to keydown,
// keyup, or keypress
sub._detach = node[method](type, function (e) {
var key = keys ? keys[e.which] : spec.mods;
if (key &&
(!key[ALT] || (key[ALT] && e.altKey)) &&
(!key[CTRL] || (key[CTRL] && e.ctrlKey)) &&
(!key[META] || (key[META] && e.metaKey)) &&
(!key[SHIFT] || (key[SHIFT] && e.shiftKey)))
{
notifier.fire(e);
}
}, filter);
},
detach: function (node, sub, notifier) {
sub._detach.detach();
}
};
eventDef.delegate = eventDef.on;
eventDef.detachDelegate = eventDef.detach;
/**
* <p>Add a key listener. The listener will only be notified if the
* keystroke detected meets the supplied specification. The
* specification is a string that is defined as:</p>
*
* <dl>
* <dt>spec</dt>
* <dd><code>[{type}:]{code}[,{code}]*</code></dd>
* <dt>type</dt>
* <dd><code>"down", "up", or "press"</code></dd>
* <dt>code</dt>
* <dd><code>{keyCode|character|keyName}[+{modifier}]*</code></dd>
* <dt>modifier</dt>
* <dd><code>"shift", "ctrl", "alt", or "meta"</code></dd>
* <dt>keyName</dt>
* <dd><code>"enter", "backspace", "esc", "tab", "pageup", or "pagedown"</code></dd>
* </dl>
*
* <p>Examples:</p>
* <ul>
* <li><code>Y.on("key", callback, "press:12,65+shift+ctrl", "#my-input");</code></li>
* <li><code>Y.delegate("key", preventSubmit, "enter", "#forms", "input[type=text]");</code></li>
* <li><code>Y.one("doc").on("key", viNav, "j,k,l,;");</code></li>
* </ul>
*
* @event key
* @for YUI
* @param type {string} 'key'
* @param fn {function} the function to execute
* @param id {string|HTMLElement|collection} the element(s) to bind
* @param spec {string} the keyCode and modifier specification
* @param o optional context object
* @param args 0..n additional arguments to provide to the listener.
* @return {Event.Handle} the detach handle
*/
Y.Event.define('key', eventDef, true);
}, '@VERSION@', {"requires": ["event-synthetic"]});
| FaiblUG/cdnjs | ajax/libs/yui/3.7.2/event-key/event-key-debug.js | JavaScript | mit | 6,040 |
webshims.validityMessages.es={typeMismatch:{email:"Por favor, introduzca una direcci\xf3n de correo.",url:"Por favor, introduzca una URL."},badInput:{number:"Valor no v\xe1lido",date:"Valor no v\xe1lido",time:"Valor no v\xe1lido",range:"Valor no v\xe1lido","datetime-local":"Valor no v\xe1lido"},tooLong:"Valor no v\xe1lido",patternMismatch:"Por favor, aj\xfastese al formato solicitado: {%title}.",valueMissing:{defaultMessage:"Por favor, rellene este campo.",checkbox:"Por favor, marque esta casilla si desea continuar.",select:"Por favor, seleccione un elemento de la lista.",radio:"Por favor, seleccione una de estas opciones."},rangeUnderflow:{defaultMessage:"El valor debe superior o igual a {%min}.",date:"El valor debe superior o igual a {%min}.",time:"El valor debe superior o igual a {%min}.","datetime-local":"El valor debe superior o igual a {%min}."},rangeOverflow:{defaultMessage:"El valor debe inferior o igual a {%max}.",date:"El valor debe inferior o igual a {%max}.",time:"El valor debe inferior o igual a {%max}.","datetime-local":"El valor debe inferior o igual a {%max}."},stepMismatch:"Valor no v\xe1lido"},webshims.formcfg.es={numberFormat:{".":".",",":","},numberSigns:".",dateSigns:"/",timeSigns:":. ",dFormat:"/",patterns:{d:"dd/mm/yy"},date:{closeText:"Cerrar",prevText:"<Ant",nextText:"Sig>",currentText:"Hoy",monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthNamesShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],dayNames:["Domingo","Lunes","Martes","Mi\xe9rcoles","Jueves","Viernes","S\xe1bado"],dayNamesShort:["Dom","Lun","Mar","Mi\xe9","Juv","Vie","S\xe1b"],dayNamesMin:["Do","Lu","Ma","Mi","Ju","Vi","S\xe1"],weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | AMoo-Miki/cdnjs | ajax/libs/webshim/1.15.3/minified/shims/i18n/formcfg-es.js | JavaScript | mit | 1,838 |
webshims.validityMessages.it={typeMismatch:{email:"Inserire un indirizzo e-mail",url:"Inserire un URL"},badInput:{number:"Valore non valido.",date:"Valore non valido.",time:"Valore non valido.",range:"Valore non valido.","datetime-local":"Valore non valido."},tooLong:"Valore non valido.",patternMismatch:"Inserire un valore nel formato richiesto: {%title}",valueMissing:{defaultMessage:"Compilare questo campo",checkbox:"Selezionare questa casella per procedere",select:"Selezionare un elemento dall'elenco",radio:"Selezionare una delle opzioni disponibili"},rangeUnderflow:{defaultMessage:"Il valore deve essere superiore o uguale a {%min}.",date:"Il valore deve essere superiore o uguale a {%min}.",time:"Il valore deve essere superiore o uguale a {%min}.","datetime-local":"Il valore deve essere superiore o uguale a {%min}."},rangeOverflow:{defaultMessage:"Il valore deve essere inferiore o uguale a {%max}.",date:"Il valore deve essere inferiore o uguale a {%max}.",time:"Il valore deve essere inferiore o uguale a {%max}.","datetime-local":"Il valore deve essere inferiore o uguale a {%max}."},stepMismatch:"Valore non valido."},webshims.formcfg.it={numberFormat:{".":".",",":","},numberSigns:".",dateSigns:"/",timeSigns:":. ",dFormat:"/",patterns:{d:"dd/mm/yy"},date:{closeText:"Chiudi",prevText:"<Prec",nextText:"Succ>",currentText:"Oggi",monthNames:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthNamesShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],dayNames:["Domenica","Luned\xec","Marted\xec","Mercoled\xec","Gioved\xec","Venerd\xec","Sabato"],dayNamesShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],dayNamesMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],weekHeader:"Sm",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | opennorth/readyreckoner.ca | public/assets/shims/i18n/formcfg-it.js | JavaScript | mit | 1,857 |
webshims.validityMessages["pt-PT"]={typeMismatch:{email:"Por favor escreva um endere\xe7o de correio.",url:"Por favor escreva o URL."},badInput:{defaultMessage:"Valor inv\xe1lido.",number:"Valor inv\xe1lido.",date:"Valor inv\xe1lido.",time:"Valor inv\xe1lido.",range:"Valor inv\xe1lido.","datetime-local":"Valor inv\xe1lido."},tooLong:"Valor inv\xe1lido.",patternMismatch:"Por favor corresponda ao formato pedido: {%title}.",valueMissing:{defaultMessage:"Por favor preencha este campo.",checkbox:"Por favor seleccione esta caixa se deseja continuar.",select:"Por favor seleccione um item da lista.",radio:"Por favor seleccione uma destas op\xe7\xf5es."},rangeUnderflow:{defaultMessage:"O valor tem de ser superior ou igual a {%min}.",date:"O valor tem de ser superior ou igual a {%min}.",time:"O valor tem de ser superior ou igual a {%min}.","datetime-local":"O valor tem de ser superior ou igual a {%min}."},rangeOverflow:{defaultMessage:"O valor tem de ser inferior ou igual a {%max}.",date:"O valor tem de ser inferior ou igual a {%max}.",time:"O valor tem de ser inferior ou igual a {%max}.","datetime-local":"O valor tem de ser inferior ou igual a {%max}."},stepMismatch:"Valor inv\xe1lido."},webshims.formcfg["pt-PT"]={numberFormat:{".":".",",":","},numberSigns:".",dateSigns:"/",timeSigns:":. ",dFormat:"/",patterns:{d:"dd/mm/yy"},date:{closeText:"Fechar",prevText:"<Anterior",nextText:"Seguinte",currentText:"Hoje",monthNames:["Janeiro","Fevereiro","Mar\xe7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda-feira","Ter\xe7a-feira","Quarta-feira","Quinta-feira","Sexta-feira","S\xe1bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","S\xe1b"],dayNamesMin:["Dom","Seg","Ter","Qua","Qui","Sex","S\xe1b"],weekHeader:"Sem",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | jessepollak/cdnjs | ajax/libs/webshim/1.12.7/minified/shims/i18n/formcfg-pt-PT.js | JavaScript | mit | 1,952 |
webshims.validityMessages["pt-BR"]={typeMismatch:{email:"Por favor informe o e-mail.",url:"Por favor informe a URL."},badInput:{defaultMessage:"Valor inv\xe1lido.",number:"Valor inv\xe1lido.",date:"Data inv\xe1lida.",time:"Hora inv\xe1lida.",range:"Valor inv\xe1lido.","datetime-local":"Data inv\xe1lida."},tooLong:"Valor inv\xe1lido.",patternMismatch:"Por favor informe no formato: {%title}.",valueMissing:{defaultMessage:"Por favor preencha este campo.",checkbox:"Por favor selecione esta caixa se deseja continuar.",select:"Por favor selecione um item da lista.",radio:"Por favor selecione uma destas op\xe7\xf5es."},rangeUnderflow:{defaultMessage:"O valor tem de ser superior ou igual a {%min}.",date:"O valor tem de ser superior ou igual a {%min}.",time:"O valor tem de ser superior ou igual a {%min}.","datetime-local":"O valor tem de ser superior ou igual a {%min}."},rangeOverflow:{defaultMessage:"O valor tem de ser inferior ou igual a {%max}.",date:"O valor tem de ser inferior ou igual a {%max}.",time:"O valor tem de ser inferior ou igual a {%max}.","datetime-local":"O valor tem de ser inferior ou igual a {%max}."},stepMismatch:"Valor inv\xe1lido."},webshims.formcfg["pt-BR"]={numberFormat:{",":".",".":","},numberSigns:".",dateSigns:"/",timeSigns:":. ",dFormat:"/",patterns:{d:"dd/mm/yy"},month:{currentText:"Este m\xeas"},time:{currentText:"Agora"},date:{closeText:"Feito",clear:"Limpa",prevText:"Pr\xf3ximo",nextText:"Anterior",currentText:"Hoje",monthNames:["Janeiro","Fevereiro","Mar\xe7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthNamesShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],dayNames:["Domingo","Segunda","Ter\xe7a","Quarta","Quinta","Sexta","S\xe1bado"],dayNamesShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],dayNamesMin:["Do","Se","Te","Qa","Qi","Se","Sa"],weekHeader:"Sem",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}}; | ruslanas/cdnjs | ajax/libs/webshim/1.15.4/minified/shims/i18n/formcfg-pt-BR.js | JavaScript | mit | 1,945 |
// export the class if we are in a Node-like system.
if (typeof module === 'object' && module.exports === exports)
exports = module.exports = SemVer;
// The debug function is excluded entirely from the minified version.
/* nomin */ var debug;
/* nomin */ if (typeof process === 'object' &&
/* nomin */ process.env &&
/* nomin */ process.env.NODE_DEBUG &&
/* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG))
/* nomin */ debug = function() {
/* nomin */ var args = Array.prototype.slice.call(arguments, 0);
/* nomin */ args.unshift('SEMVER');
/* nomin */ console.log.apply(console, args);
/* nomin */ };
/* nomin */ else
/* nomin */ debug = function() {};
// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
exports.SEMVER_SPEC_VERSION = '2.0.0';
// The actual regexps go on exports.re
var re = exports.re = [];
var src = exports.src = [];
var R = 0;
// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.
// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.
var NUMERICIDENTIFIER = R++;
src[NUMERICIDENTIFIER] = '0|[1-9]\\d*';
var NUMERICIDENTIFIERLOOSE = R++;
src[NUMERICIDENTIFIERLOOSE] = '[0-9]+';
// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.
var NONNUMERICIDENTIFIER = R++;
src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
// ## Main Version
// Three dot-separated numeric identifiers.
var MAINVERSION = R++;
src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
'(' + src[NUMERICIDENTIFIER] + ')\\.' +
'(' + src[NUMERICIDENTIFIER] + ')';
var MAINVERSIONLOOSE = R++;
src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
'(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
'(' + src[NUMERICIDENTIFIERLOOSE] + ')';
// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
var PRERELEASEIDENTIFIER = R++;
src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
'|' + src[NONNUMERICIDENTIFIER] + ')';
var PRERELEASEIDENTIFIERLOOSE = R++;
src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
'|' + src[NONNUMERICIDENTIFIER] + ')';
// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.
var PRERELEASE = R++;
src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
'(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))';
var PRERELEASELOOSE = R++;
src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
'(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';
// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.
var BUILDIDENTIFIER = R++;
src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.
var BUILD = R++;
src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
'(?:\\.' + src[BUILDIDENTIFIER] + ')*))';
// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.
// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups. The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.
var FULL = R++;
var FULLPLAIN = 'v?' + src[MAINVERSION] +
src[PRERELEASE] + '?' +
src[BUILD] + '?';
src[FULL] = '^' + FULLPLAIN + '$';
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
src[PRERELEASELOOSE] + '?' +
src[BUILD] + '?';
var LOOSE = R++;
src[LOOSE] = '^' + LOOSEPLAIN + '$';
var GTLT = R++;
src[GTLT] = '((?:<|>)?=?)';
// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifer, meaning "any version"
// Only the first item is strictly required.
var XRANGEIDENTIFIERLOOSE = R++;
src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
var XRANGEIDENTIFIER = R++;
src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*';
var XRANGEPLAIN = R++;
src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
'(?:(' + src[PRERELEASE] + ')' +
')?)?)?';
var XRANGEPLAINLOOSE = R++;
src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
'(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
'(?:(' + src[PRERELEASELOOSE] + ')' +
')?)?)?';
// >=2.x, for example, means >=2.0.0-0
// <1.x would be the same as "<1.0.0-0", though.
var XRANGE = R++;
src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$';
var XRANGELOOSE = R++;
src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$';
// Tilde ranges.
// Meaning is "reasonably at or greater than"
var LONETILDE = R++;
src[LONETILDE] = '(?:~>?)';
var TILDETRIM = R++;
src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
var tildeTrimReplace = '$1~';
var TILDE = R++;
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
var TILDELOOSE = R++;
src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
// Caret ranges.
// Meaning is "at least and backwards compatible with"
var LONECARET = R++;
src[LONECARET] = '(?:\\^)';
var CARETTRIM = R++;
src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
var caretTrimReplace = '$1^';
var CARET = R++;
src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
var CARETLOOSE = R++;
src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
// A simple gt/lt/eq thing, or just "" to indicate "any version"
var COMPARATORLOOSE = R++;
src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$';
var COMPARATOR = R++;
src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
var COMPARATORTRIM = R++;
src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
'\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
// this one has to use the /g flag
re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
var comparatorTrimReplace = '$1$2$3';
// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
var HYPHENRANGE = R++;
src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
'\\s+-\\s+' +
'(' + src[XRANGEPLAIN] + ')' +
'\\s*$';
var HYPHENRANGELOOSE = R++;
src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
'\\s+-\\s+' +
'(' + src[XRANGEPLAINLOOSE] + ')' +
'\\s*$';
// Star ranges basically just allow anything at all.
var STAR = R++;
src[STAR] = '(<|>)?=?\\s*\\*';
// Compile to actual regexp objects.
// All are flag-free, unless they were created above with a flag.
for (var i = 0; i < R; i++) {
debug(i, src[i]);
if (!re[i])
re[i] = new RegExp(src[i]);
}
exports.parse = parse;
function parse(version, loose) {
var r = loose ? re[LOOSE] : re[FULL];
return (r.test(version)) ? new SemVer(version, loose) : null;
}
exports.valid = valid;
function valid(version, loose) {
var v = parse(version, loose);
return v ? v.version : null;
}
exports.clean = clean;
function clean(version, loose) {
var s = parse(version, loose);
return s ? s.version : null;
}
exports.SemVer = SemVer;
function SemVer(version, loose) {
if (version instanceof SemVer) {
if (version.loose === loose)
return version;
else
version = version.version;
}
if (!(this instanceof SemVer))
return new SemVer(version, loose);
debug('SemVer', version, loose);
this.loose = loose;
var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
if (!m)
throw new TypeError('Invalid Version: ' + version);
this.raw = version;
// these are actually numbers
this.major = +m[1];
this.minor = +m[2];
this.patch = +m[3];
// numberify any prerelease numeric ids
if (!m[4])
this.prerelease = [];
else
this.prerelease = m[4].split('.').map(function(id) {
return (/^[0-9]+$/.test(id)) ? +id : id;
});
this.build = m[5] ? m[5].split('.') : [];
this.format();
}
SemVer.prototype.format = function() {
this.version = this.major + '.' + this.minor + '.' + this.patch;
if (this.prerelease.length)
this.version += '-' + this.prerelease.join('.');
return this.version;
};
SemVer.prototype.inspect = function() {
return '<SemVer "' + this + '">';
};
SemVer.prototype.toString = function() {
return this.version;
};
SemVer.prototype.compare = function(other) {
debug('SemVer.compare', this.version, this.loose, other);
if (!(other instanceof SemVer))
other = new SemVer(other, this.loose);
return this.compareMain(other) || this.comparePre(other);
};
SemVer.prototype.compareMain = function(other) {
if (!(other instanceof SemVer))
other = new SemVer(other, this.loose);
return compareIdentifiers(this.major, other.major) ||
compareIdentifiers(this.minor, other.minor) ||
compareIdentifiers(this.patch, other.patch);
};
SemVer.prototype.comparePre = function(other) {
if (!(other instanceof SemVer))
other = new SemVer(other, this.loose);
// NOT having a prerelease is > having one
if (this.prerelease.length && !other.prerelease.length)
return -1;
else if (!this.prerelease.length && other.prerelease.length)
return 1;
else if (!this.prerelease.lenth && !other.prerelease.length)
return 0;
var i = 0;
do {
var a = this.prerelease[i];
var b = other.prerelease[i];
debug('prerelease compare', i, a, b);
if (a === undefined && b === undefined)
return 0;
else if (b === undefined)
return 1;
else if (a === undefined)
return -1;
else if (a === b)
continue;
else
return compareIdentifiers(a, b);
} while (++i);
};
SemVer.prototype.inc = function(release) {
switch (release) {
case 'major':
this.major++;
this.minor = -1;
case 'minor':
this.minor++;
this.patch = -1;
case 'patch':
this.patch++;
this.prerelease = [];
break;
case 'prerelease':
if (this.prerelease.length === 0)
this.prerelease = [0];
else {
var i = this.prerelease.length;
while (--i >= 0) {
if (typeof this.prerelease[i] === 'number') {
this.prerelease[i]++;
i = -2;
}
}
if (i === -1) // didn't increment anything
this.prerelease.push(0);
}
break;
default:
throw new Error('invalid increment argument: ' + release);
}
this.format();
return this;
};
exports.inc = inc;
function inc(version, release, loose) {
try {
return new SemVer(version, loose).inc(release).version;
} catch (er) {
return null;
}
}
exports.compareIdentifiers = compareIdentifiers;
var numeric = /^[0-9]+$/;
function compareIdentifiers(a, b) {
var anum = numeric.test(a);
var bnum = numeric.test(b);
if (anum && bnum) {
a = +a;
b = +b;
}
return (anum && !bnum) ? -1 :
(bnum && !anum) ? 1 :
a < b ? -1 :
a > b ? 1 :
0;
}
exports.rcompareIdentifiers = rcompareIdentifiers;
function rcompareIdentifiers(a, b) {
return compareIdentifiers(b, a);
}
exports.compare = compare;
function compare(a, b, loose) {
return new SemVer(a, loose).compare(b);
}
exports.compareLoose = compareLoose;
function compareLoose(a, b) {
return compare(a, b, true);
}
exports.rcompare = rcompare;
function rcompare(a, b, loose) {
return compare(b, a, loose);
}
exports.sort = sort;
function sort(list, loose) {
return list.sort(function(a, b) {
return exports.compare(a, b, loose);
});
}
exports.rsort = rsort;
function rsort(list, loose) {
return list.sort(function(a, b) {
return exports.rcompare(a, b, loose);
});
}
exports.gt = gt;
function gt(a, b, loose) {
return compare(a, b, loose) > 0;
}
exports.lt = lt;
function lt(a, b, loose) {
return compare(a, b, loose) < 0;
}
exports.eq = eq;
function eq(a, b, loose) {
return compare(a, b, loose) === 0;
}
exports.neq = neq;
function neq(a, b, loose) {
return compare(a, b, loose) !== 0;
}
exports.gte = gte;
function gte(a, b, loose) {
return compare(a, b, loose) >= 0;
}
exports.lte = lte;
function lte(a, b, loose) {
return compare(a, b, loose) <= 0;
}
exports.cmp = cmp;
function cmp(a, op, b, loose) {
var ret;
switch (op) {
case '===': ret = a === b; break;
case '!==': ret = a !== b; break;
case '': case '=': case '==': ret = eq(a, b, loose); break;
case '!=': ret = neq(a, b, loose); break;
case '>': ret = gt(a, b, loose); break;
case '>=': ret = gte(a, b, loose); break;
case '<': ret = lt(a, b, loose); break;
case '<=': ret = lte(a, b, loose); break;
default: throw new TypeError('Invalid operator: ' + op);
}
return ret;
}
exports.Comparator = Comparator;
function Comparator(comp, loose) {
if (comp instanceof Comparator) {
if (comp.loose === loose)
return comp;
else
comp = comp.value;
}
if (!(this instanceof Comparator))
return new Comparator(comp, loose);
debug('comparator', comp, loose);
this.loose = loose;
this.parse(comp);
if (this.semver === ANY)
this.value = '';
else
this.value = this.operator + this.semver.version;
}
var ANY = {};
Comparator.prototype.parse = function(comp) {
var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
var m = comp.match(r);
if (!m)
throw new TypeError('Invalid comparator: ' + comp);
this.operator = m[1];
// if it literally is just '>' or '' then allow anything.
if (!m[2])
this.semver = ANY;
else {
this.semver = new SemVer(m[2], this.loose);
// <1.2.3-rc DOES allow 1.2.3-beta (has prerelease)
// >=1.2.3 DOES NOT allow 1.2.3-beta
// <=1.2.3 DOES allow 1.2.3-beta
// However, <1.2.3 does NOT allow 1.2.3-beta,
// even though `1.2.3-beta < 1.2.3`
// The assumption is that the 1.2.3 version has something you
// *don't* want, so we push the prerelease down to the minimum.
if (this.operator === '<' && !this.semver.prerelease.length) {
this.semver.prerelease = ['0'];
this.semver.format();
}
}
};
Comparator.prototype.inspect = function() {
return '<SemVer Comparator "' + this + '">';
};
Comparator.prototype.toString = function() {
return this.value;
};
Comparator.prototype.test = function(version) {
debug('Comparator.test', version, this.loose);
return (this.semver === ANY) ? true :
cmp(version, this.operator, this.semver, this.loose);
};
exports.Range = Range;
function Range(range, loose) {
if ((range instanceof Range) && range.loose === loose)
return range;
if (!(this instanceof Range))
return new Range(range, loose);
this.loose = loose;
// First, split based on boolean or ||
this.raw = range;
this.set = range.split(/\s*\|\|\s*/).map(function(range) {
return this.parseRange(range.trim());
}, this).filter(function(c) {
// throw out any that are not relevant for whatever reason
return c.length;
});
if (!this.set.length) {
throw new TypeError('Invalid SemVer Range: ' + range);
}
this.format();
}
Range.prototype.inspect = function() {
return '<SemVer Range "' + this.range + '">';
};
Range.prototype.format = function() {
this.range = this.set.map(function(comps) {
return comps.join(' ').trim();
}).join('||').trim();
return this.range;
};
Range.prototype.toString = function() {
return this.range;
};
Range.prototype.parseRange = function(range) {
var loose = this.loose;
range = range.trim();
debug('range', range, loose);
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
range = range.replace(hr, hyphenReplace);
debug('hyphen replace', range);
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
debug('comparator trim', range, re[COMPARATORTRIM]);
// `~ 1.2.3` => `~1.2.3`
range = range.replace(re[TILDETRIM], tildeTrimReplace);
// `^ 1.2.3` => `^1.2.3`
range = range.replace(re[CARETTRIM], caretTrimReplace);
// normalize spaces
range = range.split(/\s+/).join(' ');
// At this point, the range is completely trimmed and
// ready to be split into comparators.
var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
var set = range.split(' ').map(function(comp) {
return parseComparator(comp, loose);
}).join(' ').split(/\s+/);
if (this.loose) {
// in loose mode, throw out any that are not valid comparators
set = set.filter(function(comp) {
return !!comp.match(compRe);
});
}
set = set.map(function(comp) {
return new Comparator(comp, loose);
});
return set;
};
// Mostly just for testing and legacy API reasons
exports.toComparators = toComparators;
function toComparators(range, loose) {
return new Range(range, loose).set.map(function(comp) {
return comp.map(function(c) {
return c.value;
}).join(' ').trim().split(' ');
});
}
// comprised of xranges, tildes, stars, and gtlt's at this point.
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
function parseComparator(comp, loose) {
debug('comp', comp);
comp = replaceCarets(comp, loose);
debug('caret', comp);
comp = replaceTildes(comp, loose);
debug('tildes', comp);
comp = replaceXRanges(comp, loose);
debug('xrange', comp);
comp = replaceStars(comp, loose);
debug('stars', comp);
return comp;
}
function isX(id) {
return !id || id.toLowerCase() === 'x' || id === '*';
}
// ~, ~> --> * (any, kinda silly)
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
function replaceTildes(comp, loose) {
return comp.trim().split(/\s+/).map(function(comp) {
return replaceTilde(comp, loose);
}).join(' ');
}
function replaceTilde(comp, loose) {
var r = loose ? re[TILDELOOSE] : re[TILDE];
return comp.replace(r, function(_, M, m, p, pr) {
debug('tilde', comp, _, M, m, p, pr);
var ret;
if (isX(M))
ret = '';
else if (isX(m))
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0';
else if (isX(p))
// ~1.2 == >=1.2.0- <1.3.0-
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0';
else if (pr) {
debug('replaceTilde pr', pr);
if (pr.charAt(0) !== '-')
pr = '-' + pr;
ret = '>=' + M + '.' + m + '.' + p + pr +
' <' + M + '.' + (+m + 1) + '.0-0';
} else
// ~1.2.3 == >=1.2.3-0 <1.3.0-0
ret = '>=' + M + '.' + m + '.' + p + '-0' +
' <' + M + '.' + (+m + 1) + '.0-0';
debug('tilde return', ret);
return ret;
});
}
// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
// ^1.2.3 --> >=1.2.3 <2.0.0
// ^1.2.0 --> >=1.2.0 <2.0.0
function replaceCarets(comp, loose) {
return comp.trim().split(/\s+/).map(function(comp) {
return replaceCaret(comp, loose);
}).join(' ');
}
function replaceCaret(comp, loose) {
var r = loose ? re[CARETLOOSE] : re[CARET];
return comp.replace(r, function(_, M, m, p, pr) {
debug('caret', comp, _, M, m, p, pr);
var ret;
if (isX(M))
ret = '';
else if (isX(m))
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0';
else if (isX(p)) {
if (M === '0')
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0';
else
ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0';
} else if (pr) {
debug('replaceCaret pr', pr);
if (pr.charAt(0) !== '-')
pr = '-' + pr;
if (M === '0') {
if (m === '0')
ret = '=' + M + '.' + m + '.' + p + pr;
else
ret = '>=' + M + '.' + m + '.' + p + pr +
' <' + M + '.' + (+m + 1) + '.0-0';
} else
ret = '>=' + M + '.' + m + '.' + p + pr +
' <' + (+M + 1) + '.0.0-0';
} else {
if (M === '0') {
if (m === '0')
ret = '=' + M + '.' + m + '.' + p;
else
ret = '>=' + M + '.' + m + '.' + p + '-0' +
' <' + M + '.' + (+m + 1) + '.0-0';
} else
ret = '>=' + M + '.' + m + '.' + p + '-0' +
' <' + (+M + 1) + '.0.0-0';
}
debug('caret return', ret);
return ret;
});
}
function replaceXRanges(comp, loose) {
debug('replaceXRanges', comp, loose);
return comp.split(/\s+/).map(function(comp) {
return replaceXRange(comp, loose);
}).join(' ');
}
function replaceXRange(comp, loose) {
comp = comp.trim();
var r = loose ? re[XRANGELOOSE] : re[XRANGE];
return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
debug('xRange', comp, ret, gtlt, M, m, p, pr);
var xM = isX(M);
var xm = xM || isX(m);
var xp = xm || isX(p);
var anyX = xp;
if (gtlt === '=' && anyX)
gtlt = '';
if (gtlt && anyX) {
// replace X with 0, and then append the -0 min-prerelease
if (xM)
M = 0;
if (xm)
m = 0;
if (xp)
p = 0;
if (gtlt === '>') {
// >1 => >=2.0.0-0
// >1.2 => >=1.3.0-0
// >1.2.3 => >= 1.2.4-0
gtlt = '>=';
if (xM) {
// no change
} else if (xm) {
M = +M + 1;
m = 0;
p = 0;
} else if (xp) {
m = +m + 1;
p = 0;
}
}
ret = gtlt + M + '.' + m + '.' + p + '-0';
} else if (xM) {
// allow any
ret = '*';
} else if (xm) {
// append '-0' onto the version, otherwise
// '1.x.x' matches '2.0.0-beta', since the tag
// *lowers* the version value
ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0';
} else if (xp) {
ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0';
}
debug('xRange return', ret);
return ret;
});
}
// Because * is AND-ed with everything else in the comparator,
// and '' means "any version", just remove the *s entirely.
function replaceStars(comp, loose) {
debug('replaceStars', comp, loose);
// Looseness is ignored here. star is always as loose as it gets!
return comp.trim().replace(re[STAR], '');
}
// This function is passed to string.replace(re[HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5
// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do
// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0
function hyphenReplace($0,
from, fM, fm, fp, fpr, fb,
to, tM, tm, tp, tpr, tb) {
if (isX(fM))
from = '';
else if (isX(fm))
from = '>=' + fM + '.0.0-0';
else if (isX(fp))
from = '>=' + fM + '.' + fm + '.0-0';
else
from = '>=' + from;
if (isX(tM))
to = '';
else if (isX(tm))
to = '<' + (+tM + 1) + '.0.0-0';
else if (isX(tp))
to = '<' + tM + '.' + (+tm + 1) + '.0-0';
else if (tpr)
to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
else
to = '<=' + to;
return (from + ' ' + to).trim();
}
// if ANY of the sets match ALL of its comparators, then pass
Range.prototype.test = function(version) {
if (!version)
return false;
for (var i = 0; i < this.set.length; i++) {
if (testSet(this.set[i], version))
return true;
}
return false;
};
function testSet(set, version) {
for (var i = 0; i < set.length; i++) {
if (!set[i].test(version))
return false;
}
return true;
}
exports.satisfies = satisfies;
function satisfies(version, range, loose) {
try {
range = new Range(range, loose);
} catch (er) {
return false;
}
return range.test(version);
}
exports.maxSatisfying = maxSatisfying;
function maxSatisfying(versions, range, loose) {
return versions.filter(function(version) {
return satisfies(version, range, loose);
}).sort(function(a, b) {
return rcompare(a, b, loose);
})[0] || null;
}
exports.validRange = validRange;
function validRange(range, loose) {
try {
// Return '*' instead of '' so that truthiness works.
// This will throw if it's invalid anyway
return new Range(range, loose).range || '*';
} catch (er) {
return null;
}
}
// Determine if version is less than all the versions possible in the range
exports.ltr = ltr;
function ltr(version, range, loose) {
return outside(version, range, '<', loose);
}
// Determine if version is greater than all the versions possible in the range.
exports.gtr = gtr;
function gtr(version, range, loose) {
return outside(version, range, '>', loose);
}
exports.outside = outside;
function outside(version, range, hilo, loose) {
version = new SemVer(version, loose);
range = new Range(range, loose);
var gtfn, ltefn, ltfn, comp, ecomp;
switch (hilo) {
case '>':
gtfn = gt;
ltefn = lte;
ltfn = lt;
comp = '>';
ecomp = '>=';
break;
case '<':
gtfn = lt;
ltefn = gte;
ltfn = gt;
comp = '<';
ecomp = '<=';
break;
default:
throw new TypeError('Must provide a hilo val of "<" or ">"');
}
// If it satisifes the range it is not outside
if (satisfies(version, range, loose)) {
return false;
}
// From now on, variable terms are as if we're in "gtr" mode.
// but note that everything is flipped for the "ltr" function.
for (var i = 0; i < range.set.length; ++i) {
var comparators = range.set[i];
var high = null;
var low = null;
comparators.forEach(function(comparator) {
high = high || comparator;
low = low || comparator;
if (gtfn(comparator.semver, high.semver, loose)) {
high = comparator;
} else if (ltfn(comparator.semver, low.semver, loose)) {
low = comparator;
}
});
// If the edge version comparator has a operator then our version
// isn't outside it
if (high.operator === comp || high.operator === ecomp) {
return false;
}
// If the lowest version comparator has an operator and our version
// is less than it then it isn't higher than the range
if ((!low.operator || low.operator === comp) &&
ltefn(version, low.semver)) {
return false;
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
return false;
}
}
return true;
}
// Use the define() function if we're in AMD land
if (typeof define === 'function' && define.amd)
define(exports);
| shallaa/cdnjs | ajax/libs/jquery.tablesorter/2.17.7/js/extras/semver.js | JavaScript | mit | 27,601 |
/*! Widget: filter - updated 5/17/2015 (v2.22.0) */
!function(a){"use strict";var b=a.tablesorter||{},c=b.css;a.extend(c,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),b.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_childByColumn:!1,filter_columnFilters:!0,filter_columnAnyMatch:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(a,c,d){c.$table.hasClass("hasFilters")||b.filter.init(a,c,d)},remove:function(d,e,f,g){var h,i,j=e.$table,k=e.$tbodies,l="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(e.namespace+"filter ");if(j.removeClass("hasFilters").unbind(l.replace(/\s+/g," ")).find("."+c.filterRow).remove(),!g){for(h=0;h<k.length;h++)i=b.processTbody(d,k.eq(h),!0),i.children().removeClass(f.filter_filteredRow).show(),b.processTbody(d,i,!1);f.filter_reset&&a(document).undelegate(f.filter_reset,"click.tsfilter")}}}),b.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,nondigit:/[^\w,. \-()]/g,operators:/[<>=]/g,query:"(q|query)"},types:{regex:function(a,c){if(b.filter.regex.regex.test(c.filter)){var d,e=c.filter_regexCache[c.index]||b.filter.regex.regex.exec(c.filter),f=e instanceof RegExp;try{f||(c.filter_regexCache[c.index]=e=new RegExp(e[1],e[2])),d=e.test(c.exact)}catch(g){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)&&""!==d.iExact){var e,f,g,h=c.table,i=d.index,j=d.parsed[i],k=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),h),l=c.parsers[i],m=k;return(j||"numeric"===l.type)&&(g=a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),f=b.filter.parseFilter(c,g,i,!0),k="number"!=typeof f||""===f||isNaN(f)?k:f),!j&&"numeric"!==l.type||isNaN(k)||"undefined"==typeof d.cache?(g=isNaN(d.iExact)?d.iExact.replace(b.filter.regex.nondigit,""):d.iExact,e=b.formatFloat(g,h)):e=d.cache,/>/.test(d.iFilter)?f=/>=/.test(d.iFilter)?e>=k:e>k:/</.test(d.iFilter)&&(f=/<=/.test(d.iFilter)?k>=e:k>e),f||""!==m||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=d.iFilter.replace("!",""),g=b.filter.parseFilter(c,f,d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(g)?(g=g.replace(b.filter.regex.exact,""),""===g?!0:a.trim(g)!==d.iExact):(e=d.iExact.search(a.trim(g)),""===g?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.filter.regex.exact.test(d.iFilter)){var e=d.iFilter.replace(b.filter.regex.exact,""),f=b.filter.parseFilter(c,e,d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(f,d.rowArray)>=0:f==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f,g,h=a.table,i=c.index,j=c.parsed[i],k=c.iFilter.split(b.filter.regex.toSplit);return e=k[0].replace(b.filter.regex.nondigit,"")||"",f=b.formatFloat(b.filter.parseFilter(a,e,i,j),h),e=k[1].replace(b.filter.regex.nondigit,"")||"",g=b.formatFloat(b.filter.parseFilter(a,e,i,j),h),(j||"numeric"===a.parsers[i].type)&&(d=a.parsers[i].format(""+k[0],h,a.$headers.eq(i),i),f=""===d||isNaN(d)?f:d,d=a.parsers[i].format(""+k[1],h,a.$headers.eq(i),i),g=""===d||isNaN(d)?g:d),!j&&"numeric"!==a.parsers[i].type||isNaN(f)||isNaN(g)?(e=isNaN(c.iExact)?c.iExact.replace(b.filter.regex.nondigit,""):c.iExact,d=b.formatFloat(e,h)):d=c.cache,f>g&&(e=f,f=g,g=e),d>=f&&g>=d||""===f||""===g}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=d.iFilter.replace(b.filter.regex.orReplace,"|"),h=b.filter.parseFilter(c,g,e,f)||"";return!c.$headerIndexed[e].hasClass("filter-match")&&/\|/.test(h)&&("|"===h[h.length-1]&&(h+="*"),h=d.anyMatch&&a.isArray(d.rowArray)?"("+h+")":"^("+h+")$"),new RegExp(h.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=c.iFilter.slice(1),h=b.filter.parseFilter(a,g,c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===h[e]&&(e+=1);return e===h.length?!0:!1}return null}},init:function(d,e,f){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var g,h,i,j,k,l,m,n,o,p=b.filter.regex;if(e.$table.addClass("hasFilters"),f.searchTimer=null,f.filter_initTimer=null,f.filter_formatterCount=0,f.filter_formatterInit=[],f.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',f.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',m="\\{"+b.filter.regex.query+"\\}",a.extend(p,{child:new RegExp(e.cssChildRow),filtered:new RegExp(f.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+b.language.or+"|-|"+b.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+b.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+b.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+b.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+b.language.and+"|&&)\\s+)","gi"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(m,"i"),igQuery:new RegExp(m,"ig")}),m=e.$headers.filter(".filter-false, .parser-false").length,f.filter_columnFilters!==!1&&m!==e.$headers.length&&b.filter.buildRow(d,e,f),i="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(e.namespace+"filter "),e.$table.bind(i,function(g,h){return m=f.filter_hideEmpty&&a.isEmptyObject(e.cache)&&!(e.delayInit&&"appendCache"===g.type),e.$table.find("."+c.filterRow).toggleClass(f.filter_filteredRow,m),/(search|filter)/.test(g.type)||(g.stopPropagation(),b.filter.buildDefault(d,!0)),"filterReset"===g.type?(e.$table.find("."+c.filter).add(f.filter_$externalFilters).val(""),b.filter.searching(d,[])):"filterEnd"===g.type?b.filter.buildDefault(d,!0):(h="search"===g.type?h:"updateComplete"===g.type?e.$table.data("lastSearch"):"",/(update|add)/.test(g.type)&&"updateComplete"!==g.type&&(e.lastCombinedFilter=null,e.lastSearch=[]),b.filter.searching(d,h,!0)),!1}),f.filter_reset&&(f.filter_reset instanceof a?f.filter_reset.click(function(){e.$table.trigger("filterReset")}):a(f.filter_reset).length&&a(document).undelegate(f.filter_reset,"click.tsfilter").delegate(f.filter_reset,"click.tsfilter",function(){e.$table.trigger("filterReset")})),f.filter_functions)for(k=0;k<e.columns;k++)if(n=b.getColumnData(d,f.filter_functions,k))if(j=e.$headerIndexed[k].removeClass("filter-select"),o=!(j.hasClass("filter-false")||j.hasClass("parser-false")),g="",n===!0&&o)b.filter.buildSelect(d,k);else if("object"==typeof n&&o){for(h in n)"string"==typeof h&&(g+=""===g?'<option value="">'+(j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.select||"")+"</option>":"",m=h,i=h,h.indexOf(f.filter_selectSourceSeparator)>=0&&(m=h.split(f.filter_selectSourceSeparator),i=m[1],m=m[0]),g+="<option "+(i===m?"":'data-function-name="'+h+'" ')+'value="'+m+'">'+i+"</option>");e.$table.find("thead").find("select."+c.filter+'[data-column="'+k+'"]').append(g),i=f.filter_selectSource,n=a.isFunction(i)?!0:b.getColumnData(d,i,k),n&&b.filter.buildSelect(e.table,k,"",!0,j.hasClass(f.filter_onlyAvail))}b.filter.buildDefault(d,!0),b.filter.bindSearch(d,e.$table.find("."+c.filter),!0),f.filter_external&&b.filter.bindSearch(d,f.filter_external),f.filter_hideFilters&&b.filter.hideFilters(d,e),e.showProcessing&&(i="filterStart filterEnd ".split(" ").join(e.namespace+"filter "),e.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(f,g){j=g?e.$table.find("."+c.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",b.isProcessing(d,"filterStart"===f.type,g?j:"")})),e.filteredRows=e.totalRows,i="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter "),e.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(){var a=this.config.widgetOptions;l=b.filter.setDefaults(d,e,a)||[],l.length&&(e.delayInit&&""===l.join("")||b.setFilters(d,l,!0)),e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(e)},100)}),e.pager&&e.pager.initialized&&!f.filter_initialized&&(e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(e)},100))},formatterUpdated:function(a,b){var c=a.closest("table")[0].config.widgetOptions;c.filter_initialized||(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.filter.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},setDefaults:function(c,d,e){var f,g,h,i,j,k=b.getFilters(c)||[];if(e.filter_saveFilters&&b.storage&&(g=b.storage(c,"tablesorter-filters")||[],f=a.isArray(g),f&&""===g.join("")||!f||(k=g)),""===k.join(""))for(j=d.$headers.add(e.filter_$externalFilters).filter("["+e.filter_defaultAttrib+"]"),h=0;h<=d.columns;h++)i=h===d.columns?"all":h,k[h]=j.filter('[data-column="'+i+'"]').attr(e.filter_defaultAttrib)||k[h]||"";return d.$table.data("lastSearch",k),k},parseFilter:function(a,b,c,d){return d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(d,e,f){var g,h,i,j,k,l,m,n,o=f.filter_cellFilter,p=e.columns,q=a.isArray(o),r='<tr role="row" class="'+c.filterRow+" "+e.cssIgnoreRow+'">';for(h=0;p>h;h++)r+="<td",r+=q?o[h]?' class="'+o[h]+'"':"":""!==o?' class="'+o+'"':"",r+="></td>";for(e.$filters=a(r+="</tr>").appendTo(e.$table.children("thead").eq(0)).find("td"),h=0;p>h;h++)k=!1,i=e.$headerIndexed[h],m=b.getColumnData(d,f.filter_functions,h),j=f.filter_functions&&m&&"function"!=typeof m||i.hasClass("filter-select"),g=b.getColumnData(d,e.headers,h),k="false"===b.getData(i[0],g,"filter")||"false"===b.getData(i[0],g,"parser"),j?r=a("<select>").appendTo(e.$filters.eq(h)):(m=b.getColumnData(d,f.filter_formatter,h),m?(f.filter_formatterCount++,r=m(e.$filters.eq(h),h),r&&0===r.length&&(r=e.$filters.eq(h).children("input")),r&&(0===r.parent().length||r.parent().length&&r.parent()[0]!==e.$filters[h])&&e.$filters.eq(h).append(r)):r=a('<input type="search">').appendTo(e.$filters.eq(h)),r&&(n=i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.search||"",r.attr("placeholder",n))),r&&(l=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[h]?f.filter_cssFilter[h]||"":"":f.filter_cssFilter)||"",r.addClass(c.filter+" "+l).attr("data-column",h),k&&(r.attr("placeholder","").addClass(c.filterDisabled)[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f,g=c.config,h=g.widgetOptions,i=g.namespace+"filter",j=h.filter_$externalFilters;e!==!0&&(f=h.filter_anyColumnSelector+","+h.filter_multipleColumnSelector,h.filter_$anyMatch=d.filter(f),h.filter_$externalFilters=j&&j.length?h.filter_$externalFilters.add(d):d,b.setFilters(c,g.$table.data("lastSearch")||[],e===!1)),f="keypress keyup search change ".split(" ").join(i+" "),d.attr("data-lastSearchTime",(new Date).getTime()).unbind(f.replace(/\s+/g," ")).bind("keyup"+i,function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(h.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof h.filter_liveSearch&&this.value.length<h.filter_liveSearch||13!==d.which&&8!==d.which&&(d.which<32||d.which>=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(i+" "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==g.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.filter.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.searchTimer),"undefined"==typeof c||c===!0?e.searchTimer=setTimeout(function(){b.filter.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.filter.checkFilters(a,c,d)},checkFilters:function(d,e,f){var g=d.config,h=g.widgetOptions,i=a.isArray(e),j=i?e:b.getFilters(d,!0),k=(j||[]).join("");return a.isEmptyObject(g.cache)?void(g.delayInit&&g.pager&&g.pager.initialized&&g.$table.trigger("updateCache",[function(){b.filter.checkFilters(d,!1,f)}])):(i&&(b.setFilters(d,j,!1,f!==!0),h.filter_initialized||(g.lastCombinedFilter="")),h.filter_hideFilters&&g.$table.find("."+c.filterRow).trigger(""===k?"mouseleave":"mouseenter"),g.lastCombinedFilter!==k||e===!1?(e===!1&&(g.lastCombinedFilter=null,g.lastSearch=[]),h.filter_initialized&&g.$table.trigger("filterStart",[j]),g.showProcessing?void setTimeout(function(){return b.filter.findRows(d,j,k),!1},30):(b.filter.findRows(d,j,k),!1)):void 0)},hideFilters:function(d,e){var f,g,h;a(d).find("."+c.filterRow).addClass(c.filterRowHide).bind("mouseenter mouseleave",function(b){var d=b;f=a(this),clearTimeout(h),h=setTimeout(function(){/enter|over/.test(d.type)?f.removeClass(c.filterRowHide):a(document.activeElement).closest("tr")[0]!==f[0]&&""===e.lastCombinedFilter&&f.addClass(c.filterRowHide)},200)}).find("input, select").bind("focus blur",function(d){g=a(this).closest("tr"),clearTimeout(h);var f=d;h=setTimeout(function(){""===b.getFilters(e.$table).join("")&&g.toggleClass(c.filterRowHide,"focus"===f.type)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.filter.regex.iQuery,f=d.match(b.filter.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.filter.getLatestSearch(d).attr("data-column")||"");if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l<c.columns&&p.push(l));if(!p.length)for(l=0;l<c.columns;l++)p.push(l);return p},processRow:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=b.filter.regex,r=c.widgetOptions,s=!0;if(d.$cells=d.$row.children(),d.anyMatchFlag){g=b.filter.multipleColumns(c,r.filter_$anyMatch),d.anyMatch=!0,d.rowArray=d.$cells.map(function(e){return a.inArray(e,g)>-1?(d.parsed[e]?p=d.cacheArray[e]:(p=d.rawArray[e],p=a.trim(r.filter_ignoreCase?p.toLowerCase():p),c.sortLocaleCompare&&(p=b.replaceAccents(p))),p):void 0}).get(),d.filter=d.anyMatchFilter,d.iFilter=d.iAnyMatchFilter,d.exact=d.rowArray.join(" "),d.iExact=r.filter_ignoreCase?d.exact.toLowerCase():d.exact,d.cache=d.cacheArray.slice(0,-1).join(" "),l=null,i=null;for(o in b.filter.types)a.inArray(o,e.noAnyMatch)<0&&null===i&&(i=b.filter.types[o](c,d),null!==i&&(l=i));if(null!==l)s=l;else if(r.filter_startsWith)for(s=!1,g=c.columns;!s&&g>0;)g--,s=s||0===d.rowArray[g].indexOf(d.iFilter);else s=(d.iExact+d.childRowText).indexOf(d.iFilter)>=0;if(d.anyMatch=!1,d.filters.join("")===d.filter)return s}for(g=0;g<c.columns;g++)if(d.filter=d.filters[g],d.index=g,m=e.excludeFilter[g],d.filter){if(d.cache=d.cacheArray[g],r.filter_useParsedData||d.parsed[g]?d.exact=d.cache:(j=d.rawArray[g]||"",d.exact=c.sortLocaleCompare?b.replaceAccents(j):j),d.iExact=!q.type.test(typeof d.exact)&&r.filter_ignoreCase?d.exact.toLowerCase():d.exact,j=s,o=r.filter_columnFilters?c.$filters.add(c.$externalFilters).filter('[data-column="'+g+'"]').find("select option:selected").attr("data-function-name")||"":"",c.sortLocaleCompare&&(d.filter=b.replaceAccents(d.filter)),k=!0,r.filter_defaultFilter&&q.iQuery.test(e.defaultColFilter[g])&&(d.filter=b.filter.defaultFilter(d.filter,e.defaultColFilter[g]),k=!1),d.iFilter=r.filter_ignoreCase?(d.filter||"").toLowerCase():d.filter,n=e.functions[g],f=c.$headerIndexed[g],h=f.hasClass("filter-select"),l=null,(n||h&&k)&&(n===!0||h?l=f.hasClass("filter-match")?d.iExact.search(d.iFilter)>=0:d.filter===d.exact:"function"==typeof n?l=n(d.exact,d.cache,d.filter,g,d.$row,c,d):"function"==typeof n[o||d.filter]&&(p=o||d.filter,l=n[p](d.exact,d.cache,d.filter,g,d.$row,c,d))),null===l){i=null;for(o in b.filter.types)a.inArray(o,m)<0&&null===i&&(i=b.filter.types[o](c,d),null!==i&&(l=i));null!==l?j=l:(p=(d.iExact+d.childRowText).indexOf(b.filter.parseFilter(c,d.iFilter,g,d.parsed[g])),j=!r.filter_startsWith&&p>=0||r.filter_startsWith&&0===p)}else j=l;s=j?s:!1}return s},findRows:function(c,d,e){if(c.config.lastCombinedFilter!==e&&c.config.widgetOptions.filter_initialized){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=a.extend([],d),C=b.filter.regex,D=c.config,E=D.widgetOptions,F={anyMatch:!1,filters:d,filter_regexCache:[]},G={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:b.getColumnData(c,E.filter_defaultFilter,D.columns,!0)||""};for(F.parsed=D.$headers.map(function(d){return D.parsers&&D.parsers[d]&&(D.parsers[d].parsed||"numeric"===D.parsers[d].type)||b.getData&&"parsed"===b.getData(D.$headerIndexed[d],b.getColumnData(c,D.headers,d),"filter")||a(this).hasClass("filter-parsed")}).get(),m=0;m<D.columns;m++)G.functions[m]=b.getColumnData(c,E.filter_functions,m),G.defaultColFilter[m]=b.getColumnData(c,E.filter_defaultFilter,m)||"",G.excludeFilter[m]=(b.getColumnData(c,E.filter_excludeFilter,m,!0)||"").split(/\s+/);for(D.debug&&(b.log("Filter: Starting filter widget search",d),r=new Date),D.filteredRows=0,D.totalRows=0,e=(B||[]).join(""),k=0;k<D.$tbodies.length;k++){if(l=b.processTbody(c,D.$tbodies.eq(k),!0),m=D.columns,g=D.cache[k].normalized,i=a(a.map(g,function(a){return a[m].$row.get()})),""===e||E.filter_serversideFiltering)i.removeClass(E.filter_filteredRow).not("."+D.cssChildRow).css("display","");else{if(i=i.not("."+D.cssChildRow),f=i.length,(E.filter_$anyMatch&&E.filter_$anyMatch.length||"undefined"!=typeof d[D.columns])&&(F.anyMatchFlag=!0,F.anyMatchFilter=""+(d[D.columns]||E.filter_$anyMatch&&b.filter.getLatestSearch(E.filter_$anyMatch).val()||""),E.filter_columnAnyMatch)){for(w=F.anyMatchFilter.split(C.andSplit),x=!1,t=0;t<w.length;t++)y=w[t].split(":"),y.length>1&&(z=parseInt(y[0],10)-1,z>=0&&z<D.columns&&(d[z]=y[1],w.splice(t,1),t--,x=!0));x&&(F.anyMatchFilter=w.join(" && "))}if(v=E.filter_searchFiltered,p=D.lastSearch||D.$table.data("lastSearch")||[],v)for(t=0;m+1>t;t++)s=d[t]||"",v||(t=m),v=!(!v||!p.length||0!==s.indexOf(p[t]||"")||C.alreadyFiltered.test(s)||/[=\"\|!]/.test(s)||/(>=?\s*-\d)/.test(s)||/(<=?\s*\d)/.test(s)||""!==s&&D.$filters&&D.$filters.eq(t).find("select").length&&!D.$headerIndexed[t].hasClass("filter-match"));for(u=i.not("."+E.filter_filteredRow).length,v&&0===u&&(v=!1),D.debug&&b.log("Filter: Searching through "+(v&&f>u?u:"all")+" rows"),F.anyMatchFlag&&(D.sortLocaleCompare&&(F.anyMatchFilter=b.replaceAccents(F.anyMatchFilter)),E.filter_defaultFilter&&C.iQuery.test(G.defaultAnyFilter)&&(F.anyMatchFilter=b.filter.defaultFilter(F.anyMatchFilter,G.defaultAnyFilter),v=!1),F.iAnyMatchFilter=E.filter_ignoreCase&&D.ignoreCase?F.anyMatchFilter.toLowerCase():F.anyMatchFilter),j=0;f>j;j++)if(A=i[j].className,n=j&&C.child.test(A),!(n||v&&C.filtered.test(A))){if(F.$row=i.eq(j),F.cacheArray=g[j],h=F.cacheArray[D.columns],F.rawArray=h.raw,F.childRowText="",!E.filter_childByColumn){for(A="",o=h.child,t=0;t<o.length;t++)A+=" "+o[t].join("")||"";F.childRowText=E.filter_childRows?E.filter_ignoreCase?A.toLowerCase():A:""}if(q=b.filter.processRow(D,F,G),o=h.$row.filter(":gt( 0 )"),E.filter_childRows&&o.length){if(E.filter_childByColumn)for(t=0;t<o.length;t++)F.$row=o.eq(t),F.cacheArray=h.child[t],F.rawArray=F.cacheArray,q=q||b.filter.processRow(D,F,G);o.toggleClass(E.filter_filteredRow,!q)}h.$row.toggleClass(E.filter_filteredRow,!q)[0].display=q?"":"none"}}D.filteredRows+=i.not("."+E.filter_filteredRow).length,D.totalRows+=i.length,b.processTbody(c,l,!1)}D.lastCombinedFilter=e,D.lastSearch=B,D.$table.data("lastSearch",B),E.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",B),D.debug&&b.benchmark("Completed filter widget search",r),E.filter_initialized&&D.$table.trigger("filterEnd",D),setTimeout(function(){D.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g,h,i=c.config,j=i.widgetOptions,k=[],l=!1,m=j.filter_selectSource,n=i.$table.data("lastSearch")||[],o=a.isFunction(m)?!0:b.getColumnData(c,m,d);if(e&&""!==n[d]&&(e=!1),o===!0)l=m(c,d,e);else{if(o instanceof a||"string"===a.type(o)&&o.indexOf("</option>")>=0)return o;a.isArray(o)?l=o:"object"===a.type(m)&&o&&(l=o(c,d,e))}if(l===!1&&(l=b.filter.getOptions(c,d,e)),l=a.grep(l,function(b,c){return a.inArray(b,l)===c}),i.$headerIndexed[d].hasClass("filter-select-nosort"))return l;for(h=l.length,g=0;h>g;g++)k.push({t:l[g],p:i.parsers&&i.parsers[d].format(l[g],c,[],d)});for(f=i.textSorter||"",k.sort(function(e,g){var h=e.p.toString(),i=g.p.toString();return a.isFunction(f)?f(h,i,!0,d,c):"object"==typeof f&&f.hasOwnProperty(d)?f[d](h,i,!0,d,c):b.sortNatural?b.sortNatural(h,i):!0}),l=[],h=k.length,g=0;h>g;g++)l.push(k[g].t);return l},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j=b.config,k=j.widgetOptions,l=[];for(f=0;f<j.$tbodies.length;f++)for(i=j.cache[f],g=j.cache[f].normalized.length,e=0;g>e;e++)h=i.row?i.row[e]:i.normalized[e][j.columns].$row[0],d&&h.className.match(k.filter_filteredRow)||l.push(k.filter_useParsedData||j.parsers[c].parsed||j.$headerIndexed[c].hasClass("filter-parsed")?""+i.normalized[e][c]:i.normalized[e][j.columns].raw[c]);return l},buildSelect:function(d,e,f,g,h){if(d=a(d)[0],e=parseInt(e,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var i,j,k,l,m,n,o=d.config,p=o.widgetOptions,q=o.$headerIndexed[e],r='<option value="">'+(q.data("placeholder")||q.attr("data-placeholder")||p.filter_placeholder.select||"")+"</option>",s=o.$table.find("thead").find("select."+c.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.filter.getOptionSource(d,e,h)),a.isArray(f)){for(i=0;i<f.length;i++)k=f[i]=(""+f[i]).replace(/\"/g,"""),j=k,k.indexOf(p.filter_selectSourceSeparator)>=0&&(l=k.split(p.filter_selectSourceSeparator),j=l[0],k=l[1]),r+=""!==f[i]?"<option "+(j===k?"":'data-function-name="'+f[i]+'" ')+'value="'+j+'">'+k+"</option>":"";f=[]}m=(o.$filters?o.$filters:o.$table.children("thead")).find("."+c.filter),p.filter_$externalFilters&&(m=m&&m.length?m.add(p.filter_$externalFilters):p.filter_$externalFilters),n=m.filter('select[data-column="'+e+'"]'),n.length&&(n[g?"html":"append"](r),a.isArray(f)||n.append(f).val(s),n.val(s))}},buildDefault:function(a,c){var d,e,f,g=a.config,h=g.widgetOptions,i=g.columns;for(d=0;i>d;d++)e=g.$headerIndexed[d],f=!(e.hasClass("filter-false")||e.hasClass("parser-false")),(e.hasClass("filter-select")||b.getColumnData(a,h.filter_functions,d)===!0)&&f&&b.filter.buildSelect(a,d,"",c,e.hasClass(h.filter_onlyAvail))}},b.getFilters=function(d,e,f,g){var h,i,j,k,l=!1,m=d?a(d)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(d).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+c.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h<m.columns+1;h++)k=h===m.columns?n.filter_anyColumnSelector+","+n.filter_multipleColumnSelector:'[data-column="'+h+'"]',j=i.filter(k),j.length&&(j=b.filter.getLatestSearch(j),a.isArray(f)?(g&&j.slice(1),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change.tsfilter")):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},b.setFilters=function(c,d,e,f){var g=c?a(c)[0].config:"",h=b.getFilters(c,!0,d,f);return g&&e&&(g.lastCombinedFilter=null,g.lastSearch=[],b.filter.searching(g.table,d,f),g.$table.trigger("filterFomatterUpdate")),!!h}}(jQuery); | kellyselden/cdnjs | ajax/libs/jquery.tablesorter/2.22.0/js/widgets/widget-filter.min.js | JavaScript | mit | 25,363 |
/*
Copyright (C) 2011 Ariya Hidayat <ariya.hidayat@gmail.com>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// Unfortunately we have to use User Agent detection to blacklist the browsers.
/*jslint browser:true */
(function (window) {
'use strict';
var majorVersion = parseInt(window.platform.version.split('.')[0], 10);
window.checkEnv = function () {
if (window.platform.name === 'Safari' && majorVersion <= 3) {
throw new Error('CodeMirror does not support Safari <= 3');
}
if (window.platform.name === 'Opera' && majorVersion <= 8) {
throw new Error('CodeMirror does not support Opera <= 8');
}
};
}(window));
/* vim: set sw=4 ts=4 et tw=80 : */
| Dryl0gic/videochat | node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/checkenv.js | JavaScript | mit | 1,950 |
<?php
/**
* @file
* Contains \Drupal\Tests\Core\Form\FormStateTest.
*/
namespace Drupal\Tests\Core\Form;
use Drupal\Core\Form\FormInterface;
use Drupal\Core\Form\FormState;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\Tests\UnitTestCase;
use Symfony\Component\HttpFoundation\RedirectResponse;
/**
* @coversDefaultClass \Drupal\Core\Form\FormState
*
* @group Form
*/
class FormStateTest extends UnitTestCase {
/**
* Tests the getRedirect() method.
*
* @covers ::getRedirect
*
* @dataProvider providerTestGetRedirect
*/
public function testGetRedirect($form_state_additions, $expected) {
$form_state = (new FormState())->setFormState($form_state_additions);
$redirect = $form_state->getRedirect();
$this->assertEquals($expected, $redirect);
}
/**
* Provides test data for testing the getRedirect() method.
*
* @return array
* Returns some test data.
*/
public function providerTestGetRedirect() {
$data = array();
$data[] = array(array(), NULL);
$redirect = new RedirectResponse('/example');
$data[] = array(array('redirect' => $redirect), $redirect);
$data[] = array(array('redirect' => new Url('test_route_b', array('key' => 'value'))), new Url('test_route_b', array('key' => 'value')));
$data[] = array(array('programmed' => TRUE), NULL);
$data[] = array(array('rebuild' => TRUE), NULL);
$data[] = array(array('no_redirect' => TRUE), NULL);
return $data;
}
/**
* Tests the setError() method.
*
* @covers ::setError
*/
public function testSetError() {
$form_state = new FormState();
$element['#parents'] = array('foo', 'bar');
$form_state->setError($element, 'Fail');
$this->assertSame(['foo][bar' => 'Fail'], $form_state->getErrors());
}
/**
* Tests the getError() method.
*
* @covers ::getError
*
* @dataProvider providerTestGetError
*/
public function testGetError($errors, $parents, $error = NULL) {
$element['#parents'] = $parents;
$form_state = (new FormState())->setFormState([
'errors' => $errors,
]);
$this->assertSame($error, $form_state->getError($element));
}
public function providerTestGetError() {
return array(
array(array(), array('foo')),
array(array('foo][bar' => 'Fail'), array()),
array(array('foo][bar' => 'Fail'), array('foo')),
array(array('foo][bar' => 'Fail'), array('bar')),
array(array('foo][bar' => 'Fail'), array('baz')),
array(array('foo][bar' => 'Fail'), array('foo', 'bar'), 'Fail'),
array(array('foo][bar' => 'Fail'), array('foo', 'bar', 'baz'), 'Fail'),
array(array('foo][bar' => 'Fail 2'), array('foo')),
array(array('foo' => 'Fail 1', 'foo][bar' => 'Fail 2'), array('foo'), 'Fail 1'),
array(array('foo' => 'Fail 1', 'foo][bar' => 'Fail 2'), array('foo', 'bar'), 'Fail 1'),
);
}
/**
* @covers ::setErrorByName
*
* @dataProvider providerTestSetErrorByName
*/
public function testSetErrorByName($limit_validation_errors, $expected_errors) {
$form_state = new FormState();
$form_state->setLimitValidationErrors($limit_validation_errors);
$form_state->clearErrors();
$form_state->setErrorByName('test', 'Fail 1');
$form_state->setErrorByName('test', 'Fail 2');
$form_state->setErrorByName('options');
$this->assertSame(!empty($expected_errors), $form_state::hasAnyErrors());
$this->assertSame($expected_errors, $form_state->getErrors());
}
public function providerTestSetErrorByName() {
return array(
// Only validate the 'options' element.
array(array(array('options')), array('options' => '')),
// Do not limit an validation, and, ensuring the first error is returned
// for the 'test' element.
[NULL, ['test' => 'Fail 1', 'options' => '']],
// Limit all validation.
array(array(), array()),
);
}
/**
* Tests that form errors during submission throw an exception.
*
* @covers ::setErrorByName
*
* @expectedException \LogicException
* @expectedExceptionMessage Form errors cannot be set after form validation has finished.
*/
public function testFormErrorsDuringSubmission() {
$form_state = new FormState();
$form_state->setValidationComplete();
$form_state->setErrorByName('test', 'message');
}
/**
* Tests that setting the value for an element adds to the values.
*
* @covers ::setValueForElement
*/
public function testSetValueForElement() {
$element = array(
'#parents' => array(
'foo',
'bar',
),
);
$value = $this->randomMachineName();
$form_state = new FormState();
$form_state->setValueForElement($element, $value);
$expected = array(
'foo' => array(
'bar' => $value,
),
);
$this->assertSame($expected, $form_state->getValues());
}
/**
* @covers ::getValue
*
* @dataProvider providerTestGetValue
*/
public function testGetValue($key, $expected, $default = NULL) {
$form_state = (new FormState())->setValues([
'foo' => 'one',
'bar' => array(
'baz' => 'two',
),
]);
$this->assertSame($expected, $form_state->getValue($key, $default));
}
public function providerTestGetValue() {
$data = array();
$data[] = array(
'foo', 'one',
);
$data[] = array(
array('bar', 'baz'), 'two',
);
$data[] = array(
array('foo', 'bar', 'baz'), NULL,
);
$data[] = array(
'baz', 'baz', 'baz',
);
return $data;
}
/**
* @covers ::setValue
*
* @dataProvider providerTestSetValue
*/
public function testSetValue($key, $value, $expected) {
$form_state = (new FormState())->setValues([
'bar' => 'wrong',
]);
$form_state->setValue($key, $value);
$this->assertSame($expected, $form_state->getValues());
}
/**
* @covers ::prepareCallback
*/
public function testPrepareCallbackValidMethod() {
$form_state = new FormState();
$form_state->setFormObject(new PrepareCallbackTestForm());
$processed_callback = $form_state->prepareCallback('::buildForm');
$this->assertEquals([$form_state->getFormObject(), 'buildForm'], $processed_callback);
}
/**
* @covers ::prepareCallback
*/
public function testPrepareCallbackInValidMethod() {
$form_state = new FormState();
$form_state->setFormObject(new PrepareCallbackTestForm());
$processed_callback = $form_state->prepareCallback('not_a_method');
// The callback was not changed as no such method exists.
$this->assertEquals('not_a_method', $processed_callback);
}
/**
* @covers ::prepareCallback
*/
public function testPrepareCallbackArray() {
$form_state = new FormState();
$form_state->setFormObject(new PrepareCallbackTestForm());
$callback = [$form_state->getFormObject(), 'buildForm'];
$processed_callback = $form_state->prepareCallback($callback);
$this->assertEquals($callback, $processed_callback);
}
public function providerTestSetValue() {
$data = array();
$data[] = array(
'foo', 'one', array('bar' => 'wrong', 'foo' => 'one'),
);
$data[] = array(
array('bar', 'baz'), 'two', array('bar' => array('baz' => 'two')),
);
$data[] = array(
array('foo', 'bar', 'baz'), NULL, array('bar' => 'wrong', 'foo' => array('bar' => array('baz' => NULL))),
);
return $data;
}
/**
* @covers ::hasValue
*
* @dataProvider providerTestHasValue
*/
public function testHasValue($key, $expected) {
$form_state = (new FormState())->setValues([
'foo' => 'one',
'bar' => array(
'baz' => 'two',
),
'true' => TRUE,
'false' => FALSE,
'null' => NULL,
]);
$this->assertSame($expected, $form_state->hasValue($key));
}
public function providerTestHasValue() {
$data = array();
$data[] = array(
'foo', TRUE,
);
$data[] = array(
array('bar', 'baz'), TRUE,
);
$data[] = array(
array('foo', 'bar', 'baz'), FALSE,
);
$data[] = array(
'true', TRUE,
);
$data[] = array(
'false', TRUE,
);
$data[] = array(
'null', FALSE,
);
return $data;
}
/**
* @covers ::isValueEmpty
*
* @dataProvider providerTestIsValueEmpty
*/
public function testIsValueEmpty($key, $expected) {
$form_state = (new FormState())->setValues([
'foo' => 'one',
'bar' => array(
'baz' => 'two',
),
'true' => TRUE,
'false' => FALSE,
'null' => NULL,
]);
$this->assertSame($expected, $form_state->isValueEmpty($key));
}
public function providerTestIsValueEmpty() {
$data = array();
$data[] = array(
'foo', FALSE,
);
$data[] = array(
array('bar', 'baz'), FALSE,
);
$data[] = array(
array('foo', 'bar', 'baz'), TRUE,
);
$data[] = array(
'true', FALSE,
);
$data[] = array(
'false', TRUE,
);
$data[] = array(
'null', TRUE,
);
return $data;
}
/**
* @covers ::loadInclude
*/
public function testLoadInclude() {
$type = 'some_type';
$module = 'some_module';
$name = 'some_name';
$form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
->setMethods(array('moduleLoadInclude'))
->getMock();
$form_state->expects($this->once())
->method('moduleLoadInclude')
->with($module, $type, $name)
->willReturn(TRUE);
$this->assertTrue($form_state->loadInclude($module, $type, $name));
}
/**
* @covers ::loadInclude
*/
public function testLoadIncludeNoName() {
$type = 'some_type';
$module = 'some_module';
$form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
->setMethods(array('moduleLoadInclude'))
->getMock();
$form_state->expects($this->once())
->method('moduleLoadInclude')
->with($module, $type, $module)
->willReturn(TRUE);
$this->assertTrue($form_state->loadInclude($module, $type));
}
/**
* @covers ::loadInclude
*/
public function testLoadIncludeNotFound() {
$type = 'some_type';
$module = 'some_module';
$form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
->setMethods(array('moduleLoadInclude'))
->getMock();
$form_state->expects($this->once())
->method('moduleLoadInclude')
->with($module, $type, $module)
->willReturn(FALSE);
$this->assertFalse($form_state->loadInclude($module, $type));
}
/**
* @covers ::loadInclude
*/
public function testLoadIncludeAlreadyLoaded() {
$type = 'some_type';
$module = 'some_module';
$name = 'some_name';
$form_state = $this->getMockBuilder('Drupal\Core\Form\FormState')
->setMethods(array('moduleLoadInclude'))
->getMock();
$form_state->addBuildInfo('files', [
'some_module:some_name.some_type' => [
'type' => $type,
'module' => $module,
'name' => $name,
],
]);
$form_state->expects($this->never())
->method('moduleLoadInclude');
$this->assertFalse($form_state->loadInclude($module, $type, $name));
}
/**
* @covers ::isCached
*
* @dataProvider providerTestIsCached
*/
public function testIsCached($cache_key, $no_cache_key, $expected) {
$form_state = (new FormState())->setFormState([
'cache' => $cache_key,
'no_cache' => $no_cache_key,
]);
$form_state->setMethod('POST');
$this->assertSame($expected, $form_state->isCached());
$form_state->setMethod('GET');
$this->assertSame($expected, $form_state->isCached());
}
/**
* Provides test data for testIsCached().
*/
public function providerTestIsCached() {
$data = [];
$data[] = [
TRUE,
TRUE,
FALSE,
];
$data[] = [
FALSE,
TRUE,
FALSE,
];
$data[] = [
FALSE,
FALSE,
FALSE,
];
$data[] = [
TRUE,
FALSE,
TRUE,
];
$data[] = [
TRUE,
NULL,
TRUE,
];
$data[] = [
FALSE,
NULL,
FALSE,
];
return $data;
}
/**
* @covers ::setCached
*/
public function testSetCachedPost() {
$form_state = new FormState();
$form_state->setRequestMethod('POST');
$form_state->setCached();
$this->assertTrue($form_state->isCached());
}
/**
* @covers ::setCached
*
* @expectedException \LogicException
* @expectedExceptionMessage Form state caching on GET requests is not allowed.
*/
public function testSetCachedGet() {
$form_state = new FormState();
$form_state->setRequestMethod('GET');
$form_state->setCached();
}
/**
* @covers ::isMethodType
* @covers ::setMethod
*
* @dataProvider providerTestIsMethodType
*/
public function testIsMethodType($set_method_type, $input, $expected) {
$form_state = (new FormState())
->setMethod($set_method_type);
$this->assertSame($expected, $form_state->isMethodType($input));
}
/**
* Provides test data for testIsMethodType().
*/
public function providerTestIsMethodType() {
$data = [];
$data[] = [
'get',
'get',
TRUE,
];
$data[] = [
'get',
'GET',
TRUE,
];
$data[] = [
'GET',
'GET',
TRUE,
];
$data[] = [
'post',
'get',
FALSE,
];
return $data;
}
/**
* @covers ::getTemporaryValue
* @covers ::hasTemporaryValue
* @covers ::setTemporaryValue
*/
public function testTemporaryValue() {
$form_state = New FormState();
$this->assertFalse($form_state->hasTemporaryValue('rainbow_sparkles'));
$form_state->setTemporaryValue('rainbow_sparkles', 'yes please');
$this->assertSame($form_state->getTemporaryValue('rainbow_sparkles'), 'yes please');
$this->assertTrue($form_state->hasTemporaryValue('rainbow_sparkles'), TRUE);
$form_state->setTemporaryValue(array('rainbow_sparkles', 'magic_ponies'), 'yes please');
$this->assertSame($form_state->getTemporaryValue(array('rainbow_sparkles', 'magic_ponies')), 'yes please');
$this->assertTrue($form_state->hasTemporaryValue(array('rainbow_sparkles', 'magic_ponies')), TRUE);
}
/**
* @covers ::getCleanValueKeys
*/
public function testGetCleanValueKeys() {
$form_state = new FormState();
$this->assertSame($form_state->getCleanValueKeys(), ['form_id', 'form_token', 'form_build_id', 'op']);
}
/**
* @covers ::setCleanValueKeys
*/
public function testSetCleanValueKeys() {
$form_state = new FormState();
$form_state->setCleanValueKeys(['key1', 'key2']);
$this->assertSame($form_state->getCleanValueKeys(), ['key1', 'key2']);
}
/**
* @covers ::addCleanValueKey
*/
public function testAddCleanValueKey() {
$form_state = new FormState();
$form_state->setValue('value_to_clean', 'rainbow_sprinkles');
$form_state->addCleanValueKey('value_to_clean');
$this->assertSame($form_state->getCleanValueKeys(), ['form_id', 'form_token', 'form_build_id', 'op', 'value_to_clean']);
return $form_state;
}
/**
* @depends testAddCleanValueKey
*
* @covers ::cleanValues
*/
public function testCleanValues($form_state) {
$form_state->setValue('value_to_keep', 'magic_ponies');
$this->assertSame($form_state->cleanValues()->getValues(), ['value_to_keep' => 'magic_ponies']);
}
}
/**
* A test form used for the prepareCallback() tests.
*/
class PrepareCallbackTestForm implements FormInterface {
public function getFormId() {
return 'test_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {}
public function validateForm(array &$form, FormStateInterface $form_state) { }
public function submitForm(array &$form, FormStateInterface $form_state) { }
}
| edwardchan/d8-drupalvm | drupal/core/tests/Drupal/Tests/Core/Form/FormStateTest.php | PHP | mit | 15,912 |
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
;(function (undefined) {
var objectTypes = {
'boolean': false,
'function': true,
'object': true,
'number': false,
'string': false,
'undefined': false
};
var root = (objectTypes[typeof window] && window) || this,
freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports,
freeModule = objectTypes[typeof module] && module && !module.nodeType && module,
moduleExports = freeModule && freeModule.exports === freeExports && freeExports,
freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
root = freeGlobal;
}
var Rx = {
internals: {},
config: {
Promise: root.Promise // Detect if promise exists
},
helpers: { }
};
// Defaults
var noop = Rx.helpers.noop = function () { },
notDefined = Rx.helpers.notDefined = function (x) { return typeof x === 'undefined'; },
isScheduler = Rx.helpers.isScheduler = function (x) { return x instanceof Rx.Scheduler; },
identity = Rx.helpers.identity = function (x) { return x; },
pluck = Rx.helpers.pluck = function (property) { return function (x) { return x[property]; }; },
just = Rx.helpers.just = function (value) { return function () { return value; }; },
defaultNow = Rx.helpers.defaultNow = (function () { return !!Date.now ? Date.now : function () { return +new Date; }; }()),
defaultComparer = Rx.helpers.defaultComparer = function (x, y) { return isEqual(x, y); },
defaultSubComparer = Rx.helpers.defaultSubComparer = function (x, y) { return x > y ? 1 : (x < y ? -1 : 0); },
defaultKeySerializer = Rx.helpers.defaultKeySerializer = function (x) { return x.toString(); },
defaultError = Rx.helpers.defaultError = function (err) { throw err; },
isPromise = Rx.helpers.isPromise = function (p) { return !!p && typeof p.then === 'function'; },
asArray = Rx.helpers.asArray = function () { return Array.prototype.slice.call(arguments); },
not = Rx.helpers.not = function (a) { return !a; };
// Errors
var sequenceContainsNoElements = 'Sequence contains no elements.';
var argumentOutOfRange = 'Argument out of range';
var objectDisposed = 'Object has been disposed';
function checkDisposed() { if (this.isDisposed) { throw new Error(objectDisposed); } }
// Shim in iterator support
var $iterator$ = (typeof Symbol === 'function' && Symbol.iterator) ||
'_es6shim_iterator_';
// Bug for mozilla version
if (root.Set && typeof new root.Set()['@@iterator'] === 'function') {
$iterator$ = '@@iterator';
}
var doneEnumerator = { done: true, value: undefined };
/** `Object#toString` result shortcuts */
var argsClass = '[object Arguments]',
arrayClass = '[object Array]',
boolClass = '[object Boolean]',
dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]',
numberClass = '[object Number]',
objectClass = '[object Object]',
regexpClass = '[object RegExp]',
stringClass = '[object String]';
var toString = Object.prototype.toString,
hasOwnProperty = Object.prototype.hasOwnProperty,
supportsArgsClass = toString.call(arguments) == argsClass, // For less <IE9 && FF<4
suportNodeClass,
errorProto = Error.prototype,
objectProto = Object.prototype,
propertyIsEnumerable = objectProto.propertyIsEnumerable;
try {
suportNodeClass = !(toString.call(document) == objectClass && !({ 'toString': 0 } + ''));
} catch(e) {
suportNodeClass = true;
}
var shadowedProps = [
'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'
];
var nonEnumProps = {};
nonEnumProps[arrayClass] = nonEnumProps[dateClass] = nonEnumProps[numberClass] = { 'constructor': true, 'toLocaleString': true, 'toString': true, 'valueOf': true };
nonEnumProps[boolClass] = nonEnumProps[stringClass] = { 'constructor': true, 'toString': true, 'valueOf': true };
nonEnumProps[errorClass] = nonEnumProps[funcClass] = nonEnumProps[regexpClass] = { 'constructor': true, 'toString': true };
nonEnumProps[objectClass] = { 'constructor': true };
var support = {};
(function () {
var ctor = function() { this.x = 1; },
props = [];
ctor.prototype = { 'valueOf': 1, 'y': 1 };
for (var key in new ctor) { props.push(key); }
for (key in arguments) { }
// Detect if `name` or `message` properties of `Error.prototype` are enumerable by default.
support.enumErrorProps = propertyIsEnumerable.call(errorProto, 'message') || propertyIsEnumerable.call(errorProto, 'name');
// Detect if `prototype` properties are enumerable by default.
support.enumPrototypes = propertyIsEnumerable.call(ctor, 'prototype');
// Detect if `arguments` object indexes are non-enumerable
support.nonEnumArgs = key != 0;
// Detect if properties shadowing those on `Object.prototype` are non-enumerable.
support.nonEnumShadows = !/valueOf/.test(props);
}(1));
function isObject(value) {
// check if the value is the ECMAScript language type of Object
// http://es5.github.io/#x8
// and avoid a V8 bug
// https://code.google.com/p/v8/issues/detail?id=2291
var type = typeof value;
return value && (type == 'function' || type == 'object') || false;
}
function keysIn(object) {
var result = [];
if (!isObject(object)) {
return result;
}
if (support.nonEnumArgs && object.length && isArguments(object)) {
object = slice.call(object);
}
var skipProto = support.enumPrototypes && typeof object == 'function',
skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error);
for (var key in object) {
if (!(skipProto && key == 'prototype') &&
!(skipErrorProps && (key == 'message' || key == 'name'))) {
result.push(key);
}
}
if (support.nonEnumShadows && object !== objectProto) {
var ctor = object.constructor,
index = -1,
length = shadowedProps.length;
if (object === (ctor && ctor.prototype)) {
var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
nonEnum = nonEnumProps[className];
}
while (++index < length) {
key = shadowedProps[index];
if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) {
result.push(key);
}
}
}
return result;
}
function internalFor(object, callback, keysFunc) {
var index = -1,
props = keysFunc(object),
length = props.length;
while (++index < length) {
var key = props[index];
if (callback(object[key], key, object) === false) {
break;
}
}
return object;
}
function internalForIn(object, callback) {
return internalFor(object, callback, keysIn);
}
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof (value + '') == 'string';
}
function isArguments(value) {
return (value && typeof value == 'object') ? toString.call(value) == argsClass : false;
}
// fallback for browsers that can't detect `arguments` objects by [[Class]]
if (!supportsArgsClass) {
isArguments = function(value) {
return (value && typeof value == 'object') ? hasOwnProperty.call(value, 'callee') : false;
};
}
function isFunction(value) {
return typeof value == 'function' || false;
}
// fallback for older versions of Chrome and Safari
if (isFunction(/x/)) {
isFunction = function(value) {
return typeof value == 'function' && toString.call(value) == funcClass;
};
}
var isEqual = Rx.internals.isEqual = function (x, y) {
return deepEquals(x, y, [], []);
};
/** @private
* Used for deep comparison
**/
function deepEquals(a, b, stackA, stackB) {
// exit early for identical values
if (a === b) {
// treat `+0` vs. `-0` as not equal
return a !== 0 || (1 / a == 1 / b);
}
var type = typeof a,
otherType = typeof b;
// exit early for unlike primitive values
if (a === a && (a == null || b == null ||
(type != 'function' && type != 'object' && otherType != 'function' && otherType != 'object'))) {
return false;
}
// compare [[Class]] names
var className = toString.call(a),
otherClass = toString.call(b);
if (className == argsClass) {
className = objectClass;
}
if (otherClass == argsClass) {
otherClass = objectClass;
}
if (className != otherClass) {
return false;
}
switch (className) {
case boolClass:
case dateClass:
// coerce dates and booleans to numbers, dates to milliseconds and booleans
// to `1` or `0` treating invalid dates coerced to `NaN` as not equal
return +a == +b;
case numberClass:
// treat `NaN` vs. `NaN` as equal
return (a != +a)
? b != +b
// but treat `-0` vs. `+0` as not equal
: (a == 0 ? (1 / a == 1 / b) : a == +b);
case regexpClass:
case stringClass:
// coerce regexes to strings (http://es5.github.io/#x15.10.6.4)
// treat string primitives and their corresponding object instances as equal
return a == String(b);
}
var isArr = className == arrayClass;
if (!isArr) {
// exit for functions and DOM nodes
if (className != objectClass || (!support.nodeClass && (isNode(a) || isNode(b)))) {
return false;
}
// in older versions of Opera, `arguments` objects have `Array` constructors
var ctorA = !support.argsObject && isArguments(a) ? Object : a.constructor,
ctorB = !support.argsObject && isArguments(b) ? Object : b.constructor;
// non `Object` object instances with different constructors are not equal
if (ctorA != ctorB &&
!(hasOwnProperty.call(a, 'constructor') && hasOwnProperty.call(b, 'constructor')) &&
!(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB) &&
('constructor' in a && 'constructor' in b)
) {
return false;
}
}
// assume cyclic structures are equal
// the algorithm for detecting cyclic structures is adapted from ES 5.1
// section 15.12.3, abstract operation `JO` (http://es5.github.io/#x15.12.3)
var initedStack = !stackA;
stackA || (stackA = []);
stackB || (stackB = []);
var length = stackA.length;
while (length--) {
if (stackA[length] == a) {
return stackB[length] == b;
}
}
var size = 0;
result = true;
// add `a` and `b` to the stack of traversed objects
stackA.push(a);
stackB.push(b);
// recursively compare objects and arrays (susceptible to call stack limits)
if (isArr) {
// compare lengths to determine if a deep comparison is necessary
length = a.length;
size = b.length;
result = size == length;
if (result) {
// deep compare the contents, ignoring non-numeric properties
while (size--) {
var index = length,
value = b[size];
if (!(result = deepEquals(a[size], value, stackA, stackB))) {
break;
}
}
}
}
else {
// deep compare objects using `forIn`, instead of `forOwn`, to avoid `Object.keys`
// which, in this case, is more costly
internalForIn(b, function(value, key, b) {
if (hasOwnProperty.call(b, key)) {
// count the number of properties.
size++;
// deep compare each property value.
return (result = hasOwnProperty.call(a, key) && deepEquals(a[key], value, stackA, stackB));
}
});
if (result) {
// ensure both objects have the same number of properties
internalForIn(a, function(value, key, a) {
if (hasOwnProperty.call(a, key)) {
// `size` will be `-1` if `a` has more properties than `b`
return (result = --size > -1);
}
});
}
}
stackA.pop();
stackB.pop();
return result;
}
var slice = Array.prototype.slice;
function argsOrArray(args, idx) {
return args.length === 1 && Array.isArray(args[idx]) ?
args[idx] :
slice.call(args);
}
var hasProp = {}.hasOwnProperty;
/** @private */
var inherits = this.inherits = Rx.internals.inherits = function (child, parent) {
function __() { this.constructor = child; }
__.prototype = parent.prototype;
child.prototype = new __();
};
/** @private */
var addProperties = Rx.internals.addProperties = function (obj) {
var sources = slice.call(arguments, 1);
for (var i = 0, len = sources.length; i < len; i++) {
var source = sources[i];
for (var prop in source) {
obj[prop] = source[prop];
}
}
};
// Rx Utils
var addRef = Rx.internals.addRef = function (xs, r) {
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(r.getDisposable(), xs.subscribe(observer));
});
};
// Collection polyfills
function arrayInitialize(count, factory) {
var a = new Array(count);
for (var i = 0; i < count; i++) {
a[i] = factory();
}
return a;
}
// Utilities
if (!Function.prototype.bind) {
Function.prototype.bind = function (that) {
var target = this,
args = slice.call(arguments, 1);
var bound = function () {
if (this instanceof bound) {
function F() { }
F.prototype = target.prototype;
var self = new F();
var result = target.apply(self, args.concat(slice.call(arguments)));
if (Object(result) === result) {
return result;
}
return self;
} else {
return target.apply(that, args.concat(slice.call(arguments)));
}
};
return bound;
};
}
var boxedString = Object("a"),
splitString = boxedString[0] != "a" || !(0 in boxedString);
if (!Array.prototype.every) {
Array.prototype.every = function every(fun /*, thisp */) {
var object = Object(this),
self = splitString && {}.toString.call(this) == stringClass ?
this.split("") :
object,
length = self.length >>> 0,
thisp = arguments[1];
if ({}.toString.call(fun) != funcClass) {
throw new TypeError(fun + " is not a function");
}
for (var i = 0; i < length; i++) {
if (i in self && !fun.call(thisp, self[i], i, object)) {
return false;
}
}
return true;
};
}
if (!Array.prototype.map) {
Array.prototype.map = function map(fun /*, thisp*/) {
var object = Object(this),
self = splitString && {}.toString.call(this) == stringClass ?
this.split("") :
object,
length = self.length >>> 0,
result = Array(length),
thisp = arguments[1];
if ({}.toString.call(fun) != funcClass) {
throw new TypeError(fun + " is not a function");
}
for (var i = 0; i < length; i++) {
if (i in self)
result[i] = fun.call(thisp, self[i], i, object);
}
return result;
};
}
if (!Array.prototype.filter) {
Array.prototype.filter = function (predicate) {
var results = [], item, t = new Object(this);
for (var i = 0, len = t.length >>> 0; i < len; i++) {
item = t[i];
if (i in t && predicate.call(arguments[1], item, i, t)) {
results.push(item);
}
}
return results;
};
}
if (!Array.isArray) {
Array.isArray = function (arg) {
return Object.prototype.toString.call(arg) == arrayClass;
};
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function indexOf(searchElement) {
var t = Object(this);
var len = t.length >>> 0;
if (len === 0) {
return -1;
}
var n = 0;
if (arguments.length > 1) {
n = Number(arguments[1]);
if (n !== n) {
n = 0;
} else if (n !== 0 && n != Infinity && n !== -Infinity) {
n = (n > 0 || -1) * Math.floor(Math.abs(n));
}
}
if (n >= len) {
return -1;
}
var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
for (; k < len; k++) {
if (k in t && t[k] === searchElement) {
return k;
}
}
return -1;
};
}
// Collections
var IndexedItem = function (id, value) {
this.id = id;
this.value = value;
};
IndexedItem.prototype.compareTo = function (other) {
var c = this.value.compareTo(other.value);
if (c === 0) {
c = this.id - other.id;
}
return c;
};
// Priority Queue for Scheduling
var PriorityQueue = Rx.internals.PriorityQueue = function (capacity) {
this.items = new Array(capacity);
this.length = 0;
};
var priorityProto = PriorityQueue.prototype;
priorityProto.isHigherPriority = function (left, right) {
return this.items[left].compareTo(this.items[right]) < 0;
};
priorityProto.percolate = function (index) {
if (index >= this.length || index < 0) {
return;
}
var parent = index - 1 >> 1;
if (parent < 0 || parent === index) {
return;
}
if (this.isHigherPriority(index, parent)) {
var temp = this.items[index];
this.items[index] = this.items[parent];
this.items[parent] = temp;
this.percolate(parent);
}
};
priorityProto.heapify = function (index) {
if (index === undefined) {
index = 0;
}
if (index >= this.length || index < 0) {
return;
}
var left = 2 * index + 1,
right = 2 * index + 2,
first = index;
if (left < this.length && this.isHigherPriority(left, first)) {
first = left;
}
if (right < this.length && this.isHigherPriority(right, first)) {
first = right;
}
if (first !== index) {
var temp = this.items[index];
this.items[index] = this.items[first];
this.items[first] = temp;
this.heapify(first);
}
};
priorityProto.peek = function () { return this.items[0].value; };
priorityProto.removeAt = function (index) {
this.items[index] = this.items[--this.length];
delete this.items[this.length];
this.heapify();
};
priorityProto.dequeue = function () {
var result = this.peek();
this.removeAt(0);
return result;
};
priorityProto.enqueue = function (item) {
var index = this.length++;
this.items[index] = new IndexedItem(PriorityQueue.count++, item);
this.percolate(index);
};
priorityProto.remove = function (item) {
for (var i = 0; i < this.length; i++) {
if (this.items[i].value === item) {
this.removeAt(i);
return true;
}
}
return false;
};
PriorityQueue.count = 0;
/**
* Represents a group of disposable resources that are disposed together.
* @constructor
*/
var CompositeDisposable = Rx.CompositeDisposable = function () {
this.disposables = argsOrArray(arguments, 0);
this.isDisposed = false;
this.length = this.disposables.length;
};
var CompositeDisposablePrototype = CompositeDisposable.prototype;
/**
* Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
* @param {Mixed} item Disposable to add.
*/
CompositeDisposablePrototype.add = function (item) {
if (this.isDisposed) {
item.dispose();
} else {
this.disposables.push(item);
this.length++;
}
};
/**
* Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
* @param {Mixed} item Disposable to remove.
* @returns {Boolean} true if found; false otherwise.
*/
CompositeDisposablePrototype.remove = function (item) {
var shouldDispose = false;
if (!this.isDisposed) {
var idx = this.disposables.indexOf(item);
if (idx !== -1) {
shouldDispose = true;
this.disposables.splice(idx, 1);
this.length--;
item.dispose();
}
}
return shouldDispose;
};
/**
* Disposes all disposables in the group and removes them from the group.
*/
CompositeDisposablePrototype.dispose = function () {
if (!this.isDisposed) {
this.isDisposed = true;
var currentDisposables = this.disposables.slice(0);
this.disposables = [];
this.length = 0;
for (var i = 0, len = currentDisposables.length; i < len; i++) {
currentDisposables[i].dispose();
}
}
};
/**
* Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable.
*/
CompositeDisposablePrototype.clear = function () {
var currentDisposables = this.disposables.slice(0);
this.disposables = [];
this.length = 0;
for (var i = 0, len = currentDisposables.length; i < len; i++) {
currentDisposables[i].dispose();
}
};
/**
* Determines whether the CompositeDisposable contains a specific disposable.
* @param {Mixed} item Disposable to search for.
* @returns {Boolean} true if the disposable was found; otherwise, false.
*/
CompositeDisposablePrototype.contains = function (item) {
return this.disposables.indexOf(item) !== -1;
};
/**
* Converts the existing CompositeDisposable to an array of disposables
* @returns {Array} An array of disposable objects.
*/
CompositeDisposablePrototype.toArray = function () {
return this.disposables.slice(0);
};
/**
* Provides a set of static methods for creating Disposables.
*
* @constructor
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
*/
var Disposable = Rx.Disposable = function (action) {
this.isDisposed = false;
this.action = action || noop;
};
/** Performs the task of cleaning up resources. */
Disposable.prototype.dispose = function () {
if (!this.isDisposed) {
this.action();
this.isDisposed = true;
}
};
/**
* Creates a disposable object that invokes the specified action when disposed.
* @param {Function} dispose Action to run during the first call to dispose. The action is guaranteed to be run at most once.
* @return {Disposable} The disposable object that runs the given action upon disposal.
*/
var disposableCreate = Disposable.create = function (action) { return new Disposable(action); };
/**
* Gets the disposable that does nothing when disposed.
*/
var disposableEmpty = Disposable.empty = { dispose: noop };
var BooleanDisposable = (function () {
function BooleanDisposable (isSingle) {
this.isSingle = isSingle;
this.isDisposed = false;
this.current = null;
}
var booleanDisposablePrototype = BooleanDisposable.prototype;
/**
* Gets the underlying disposable.
* @return The underlying disposable.
*/
booleanDisposablePrototype.getDisposable = function () {
return this.current;
};
/**
* Sets the underlying disposable.
* @param {Disposable} value The new underlying disposable.
*/
booleanDisposablePrototype.setDisposable = function (value) {
if (this.current && this.isSingle) {
throw new Error('Disposable has already been assigned');
}
var shouldDispose = this.isDisposed, old;
if (!shouldDispose) {
old = this.current;
this.current = value;
}
old && old.dispose();
shouldDispose && value && value.dispose();
};
/**
* Disposes the underlying disposable as well as all future replacements.
*/
booleanDisposablePrototype.dispose = function () {
var old;
if (!this.isDisposed) {
this.isDisposed = true;
old = this.current;
this.current = null;
}
old && old.dispose();
};
return BooleanDisposable;
}());
/**
* Represents a disposable resource which only allows a single assignment of its underlying disposable resource.
* If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an Error.
*/
var SingleAssignmentDisposable = Rx.SingleAssignmentDisposable = (function (super_) {
inherits(SingleAssignmentDisposable, super_);
function SingleAssignmentDisposable() {
super_.call(this, true);
}
return SingleAssignmentDisposable;
}(BooleanDisposable));
/**
* Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource.
*/
var SerialDisposable = Rx.SerialDisposable = (function (super_) {
inherits(SerialDisposable, super_);
function SerialDisposable() {
super_.call(this, false);
}
return SerialDisposable;
}(BooleanDisposable));
/**
* Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed.
*/
var RefCountDisposable = Rx.RefCountDisposable = (function () {
function InnerDisposable(disposable) {
this.disposable = disposable;
this.disposable.count++;
this.isInnerDisposed = false;
}
InnerDisposable.prototype.dispose = function () {
if (!this.disposable.isDisposed) {
if (!this.isInnerDisposed) {
this.isInnerDisposed = true;
this.disposable.count--;
if (this.disposable.count === 0 && this.disposable.isPrimaryDisposed) {
this.disposable.isDisposed = true;
this.disposable.underlyingDisposable.dispose();
}
}
}
};
/**
* Initializes a new instance of the RefCountDisposable with the specified disposable.
* @constructor
* @param {Disposable} disposable Underlying disposable.
*/
function RefCountDisposable(disposable) {
this.underlyingDisposable = disposable;
this.isDisposed = false;
this.isPrimaryDisposed = false;
this.count = 0;
}
/**
* Disposes the underlying disposable only when all dependent disposables have been disposed
*/
RefCountDisposable.prototype.dispose = function () {
if (!this.isDisposed) {
if (!this.isPrimaryDisposed) {
this.isPrimaryDisposed = true;
if (this.count === 0) {
this.isDisposed = true;
this.underlyingDisposable.dispose();
}
}
}
};
/**
* Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
* @returns {Disposable} A dependent disposable contributing to the reference count that manages the underlying disposable's lifetime.
*/
RefCountDisposable.prototype.getDisposable = function () {
return this.isDisposed ? disposableEmpty : new InnerDisposable(this);
};
return RefCountDisposable;
})();
var ScheduledItem = Rx.internals.ScheduledItem = function (scheduler, state, action, dueTime, comparer) {
this.scheduler = scheduler;
this.state = state;
this.action = action;
this.dueTime = dueTime;
this.comparer = comparer || defaultSubComparer;
this.disposable = new SingleAssignmentDisposable();
}
ScheduledItem.prototype.invoke = function () {
this.disposable.setDisposable(this.invokeCore());
};
ScheduledItem.prototype.compareTo = function (other) {
return this.comparer(this.dueTime, other.dueTime);
};
ScheduledItem.prototype.isCancelled = function () {
return this.disposable.isDisposed;
};
ScheduledItem.prototype.invokeCore = function () {
return this.action(this.scheduler, this.state);
};
/** Provides a set of static properties to access commonly used schedulers. */
var Scheduler = Rx.Scheduler = (function () {
function Scheduler(now, schedule, scheduleRelative, scheduleAbsolute) {
this.now = now;
this._schedule = schedule;
this._scheduleRelative = scheduleRelative;
this._scheduleAbsolute = scheduleAbsolute;
}
function invokeRecImmediate(scheduler, pair) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2) {
var isAdded = false, isDone = false,
d = scheduler.scheduleWithState(state2, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function invokeRecDate(scheduler, pair, method) {
var state = pair.first, action = pair.second, group = new CompositeDisposable(),
recursiveAction = function (state1) {
action(state1, function (state2, dueTime1) {
var isAdded = false, isDone = false,
d = scheduler[method].call(scheduler, state2, dueTime1, function (scheduler1, state3) {
if (isAdded) {
group.remove(d);
} else {
isDone = true;
}
recursiveAction(state3);
return disposableEmpty;
});
if (!isDone) {
group.add(d);
isAdded = true;
}
});
};
recursiveAction(state);
return group;
}
function invokeAction(scheduler, action) {
action();
return disposableEmpty;
}
var schedulerProto = Scheduler.prototype;
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
schedulerProto.schedulePeriodic = function (period, action) {
return this.schedulePeriodicWithState(null, period, function () {
action();
});
};
/**
* Schedules a periodic piece of work by dynamically discovering the scheduler's capabilities. The periodic task will be scheduled using window.setInterval for the base implementation.
* @param {Mixed} state Initial state passed to the action upon the first iteration.
* @param {Number} period Period for running the work periodically.
* @param {Function} action Action to be executed, potentially updating the state.
* @returns {Disposable} The disposable object used to cancel the scheduled recurring action (best effort).
*/
schedulerProto.schedulePeriodicWithState = function (state, period, action) {
var s = state, id = setInterval(function () {
s = action(s);
}, period);
return disposableCreate(function () {
clearInterval(id);
});
};
/**
* Schedules an action to be executed.
* @param {Function} action Action to execute.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.schedule = function (action) {
return this._schedule(action, invokeAction);
};
/**
* Schedules an action to be executed.
* @param state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithState = function (state, action) {
return this._schedule(state, action);
};
/**
* Schedules an action to be executed after the specified relative due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelative = function (dueTime, action) {
return this._scheduleRelative(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed after dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number} dueTime Relative time after which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative(state, dueTime, action);
};
/**
* Schedules an action to be executed at the specified absolute due time.
* @param {Function} action Action to execute.
* @param {Number} dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsolute = function (dueTime, action) {
return this._scheduleAbsolute(action, dueTime, invokeAction);
};
/**
* Schedules an action to be executed at dueTime.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to be executed.
* @param {Number}dueTime Absolute time at which to execute the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute(state, dueTime, action);
};
/**
* Schedules an action to be executed recursively.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursive = function (action) {
return this.scheduleRecursiveWithState(action, function (_action, self) {
_action(function () {
self(_action);
});
});
};
/**
* Schedules an action to be executed recursively.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithState = function (state, action) {
return this.scheduleWithState({ first: state, second: action }, function (s, p) {
return invokeRecImmediate(s, p);
});
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified relative time.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelative = function (dueTime, action) {
return this.scheduleRecursiveWithRelativeAndState(action, dueTime, function (_action, self) {
_action(function (dt) {
self(_action, dt);
});
});
};
/**
* Schedules an action to be executed recursively after a specified relative due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Relative time after which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithRelativeAndState = function (state, dueTime, action) {
return this._scheduleRelative({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithRelativeAndState');
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Function} action Action to execute recursively. The parameter passed to the action is used to trigger recursive scheduling of the action at the specified absolute time.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsolute = function (dueTime, action) {
return this.scheduleRecursiveWithAbsoluteAndState(action, dueTime, function (_action, self) {
_action(function (dt) {
self(_action, dt);
});
});
};
/**
* Schedules an action to be executed recursively at a specified absolute due time.
* @param {Mixed} state State passed to the action to be executed.
* @param {Function} action Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in the recursive due time and invocation state.
* @param {Number}dueTime Absolute time at which to execute the action for the first time.
* @returns {Disposable} The disposable object used to cancel the scheduled action (best effort).
*/
schedulerProto.scheduleRecursiveWithAbsoluteAndState = function (state, dueTime, action) {
return this._scheduleAbsolute({ first: state, second: action }, dueTime, function (s, p) {
return invokeRecDate(s, p, 'scheduleWithAbsoluteAndState');
});
};
/** Gets the current time according to the local machine's system clock. */
Scheduler.now = defaultNow;
/**
* Normalizes the specified TimeSpan value to a positive value.
* @param {Number} timeSpan The time span value to normalize.
* @returns {Number} The specified TimeSpan value if it is zero or positive; otherwise, 0
*/
Scheduler.normalize = function (timeSpan) {
if (timeSpan < 0) {
timeSpan = 0;
}
return timeSpan;
};
return Scheduler;
}());
var normalizeTime = Scheduler.normalize;
/**
* Gets a scheduler that schedules work immediately on the current thread.
*/
var immediateScheduler = Scheduler.immediate = (function () {
function scheduleNow(state, action) { return action(this, state); }
function scheduleRelative(state, dueTime, action) {
var dt = normalizeTime(dt);
while (dt - this.now() > 0) { }
return action(this, state);
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
}());
/**
* Gets a scheduler that schedules work as soon as possible on the current thread.
*/
var currentThreadScheduler = Scheduler.currentThread = (function () {
var queue;
function runTrampoline (q) {
var item;
while (q.length > 0) {
item = q.dequeue();
if (!item.isCancelled()) {
// Note, do not schedule blocking work!
while (item.dueTime - Scheduler.now() > 0) {
}
if (!item.isCancelled()) {
item.invoke();
}
}
}
}
function scheduleNow(state, action) {
return this.scheduleWithRelativeAndState(state, 0, action);
}
function scheduleRelative(state, dueTime, action) {
var dt = this.now() + Scheduler.normalize(dueTime),
si = new ScheduledItem(this, state, action, dt);
if (!queue) {
queue = new PriorityQueue(4);
queue.enqueue(si);
try {
runTrampoline(queue);
} catch (e) {
throw e;
} finally {
queue = null;
}
} else {
queue.enqueue(si);
}
return si.disposable;
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
var currentScheduler = new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
currentScheduler.scheduleRequired = function () { return !queue; };
currentScheduler.ensureTrampoline = function (action) {
if (!queue) { this.schedule(action); } else { action(); }
};
return currentScheduler;
}());
var SchedulePeriodicRecursive = Rx.internals.SchedulePeriodicRecursive = (function () {
function tick(command, recurse) {
recurse(0, this._period);
try {
this._state = this._action(this._state);
} catch (e) {
this._cancel.dispose();
throw e;
}
}
function SchedulePeriodicRecursive(scheduler, state, period, action) {
this._scheduler = scheduler;
this._state = state;
this._period = period;
this._action = action;
}
SchedulePeriodicRecursive.prototype.start = function () {
var d = new SingleAssignmentDisposable();
this._cancel = d;
d.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0, this._period, tick.bind(this)));
return d;
};
return SchedulePeriodicRecursive;
}());
var scheduleMethod, clearMethod = noop;
(function () {
var reNative = RegExp('^' +
String(toString)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/toString| for [^\]]+/g, '.*?') + '$'
);
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
!reNative.test(setImmediate) && setImmediate,
clearImmediate = typeof (clearImmediate = freeGlobal && moduleExports && freeGlobal.clearImmediate) == 'function' &&
!reNative.test(clearImmediate) && clearImmediate;
function postMessageSupported () {
// Ensure not in a worker
if (!root.postMessage || root.importScripts) { return false; }
var isAsync = false,
oldHandler = root.onmessage;
// Test for async
root.onmessage = function () { isAsync = true; };
root.postMessage('','*');
root.onmessage = oldHandler;
return isAsync;
}
// Use in order, nextTick, setImmediate, postMessage, MessageChannel, script readystatechanged, setTimeout
if (typeof process !== 'undefined' && {}.toString.call(process) === '[object process]') {
scheduleMethod = process.nextTick;
} else if (typeof setImmediate === 'function') {
scheduleMethod = setImmediate;
clearMethod = clearImmediate;
} else if (postMessageSupported()) {
var MSG_PREFIX = 'ms.rx.schedule' + Math.random(),
tasks = {},
taskId = 0;
function onGlobalPostMessage(event) {
// Only if we're a match to avoid any other global events
if (typeof event.data === 'string' && event.data.substring(0, MSG_PREFIX.length) === MSG_PREFIX) {
var handleId = event.data.substring(MSG_PREFIX.length),
action = tasks[handleId];
action();
delete tasks[handleId];
}
}
if (root.addEventListener) {
root.addEventListener('message', onGlobalPostMessage, false);
} else {
root.attachEvent('onmessage', onGlobalPostMessage, false);
}
scheduleMethod = function (action) {
var currentId = taskId++;
tasks[currentId] = action;
root.postMessage(MSG_PREFIX + currentId, '*');
};
} else if (!!root.MessageChannel) {
var channel = new root.MessageChannel(),
channelTasks = {},
channelTaskId = 0;
channel.port1.onmessage = function (event) {
var id = event.data,
action = channelTasks[id];
action();
delete channelTasks[id];
};
scheduleMethod = function (action) {
var id = channelTaskId++;
channelTasks[id] = action;
channel.port2.postMessage(id);
};
} else if ('document' in root && 'onreadystatechange' in root.document.createElement('script')) {
scheduleMethod = function (action) {
var scriptElement = root.document.createElement('script');
scriptElement.onreadystatechange = function () {
action();
scriptElement.onreadystatechange = null;
scriptElement.parentNode.removeChild(scriptElement);
scriptElement = null;
};
root.document.documentElement.appendChild(scriptElement);
};
} else {
scheduleMethod = function (action) { return setTimeout(action, 0); };
clearMethod = clearTimeout;
}
}());
/**
* Gets a scheduler that schedules work via a timed callback based upon platform.
*/
var timeoutScheduler = Scheduler.timeout = (function () {
function scheduleNow(state, action) {
var scheduler = this,
disposable = new SingleAssignmentDisposable();
var id = scheduleMethod(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
});
return new CompositeDisposable(disposable, disposableCreate(function () {
clearMethod(id);
}));
}
function scheduleRelative(state, dueTime, action) {
var scheduler = this,
dt = Scheduler.normalize(dueTime);
if (dt === 0) {
return scheduler.scheduleWithState(state, action);
}
var disposable = new SingleAssignmentDisposable();
var id = setTimeout(function () {
if (!disposable.isDisposed) {
disposable.setDisposable(action(scheduler, state));
}
}, dt);
return new CompositeDisposable(disposable, disposableCreate(function () {
clearTimeout(id);
}));
}
function scheduleAbsolute(state, dueTime, action) {
return this.scheduleWithRelativeAndState(state, dueTime - this.now(), action);
}
return new Scheduler(defaultNow, scheduleNow, scheduleRelative, scheduleAbsolute);
})();
/**
* Represents a notification to an observer.
*/
var Notification = Rx.Notification = (function () {
function Notification(kind, hasValue) {
this.hasValue = hasValue == null ? false : hasValue;
this.kind = kind;
}
/**
* Invokes the delegate corresponding to the notification or the observer's method corresponding to the notification and returns the produced result.
*
* @memberOf Notification
* @param {Any} observerOrOnNext Delegate to invoke for an OnNext notification or Observer to invoke the notification on..
* @param {Function} onError Delegate to invoke for an OnError notification.
* @param {Function} onCompleted Delegate to invoke for an OnCompleted notification.
* @returns {Any} Result produced by the observation.
*/
Notification.prototype.accept = function (observerOrOnNext, onError, onCompleted) {
return observerOrOnNext && typeof observerOrOnNext === 'object' ?
this._acceptObservable(observerOrOnNext) :
this._accept(observerOrOnNext, onError, onCompleted);
};
/**
* Returns an observable sequence with a single notification.
*
* @memberOf Notifications
* @param {Scheduler} [scheduler] Scheduler to send out the notification calls on.
* @returns {Observable} The observable sequence that surfaces the behavior of the notification upon subscription.
*/
Notification.prototype.toObservable = function (scheduler) {
var notification = this;
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
notification._acceptObservable(observer);
notification.kind === 'N' && observer.onCompleted();
});
});
};
return Notification;
})();
/**
* Creates an object that represents an OnNext notification to an observer.
* @param {Any} value The value contained in the notification.
* @returns {Notification} The OnNext notification containing the value.
*/
var notificationCreateOnNext = Notification.createOnNext = (function () {
function _accept (onNext) { return onNext(this.value); }
function _acceptObservable(observer) { return observer.onNext(this.value); }
function toString () { return 'OnNext(' + this.value + ')'; }
return function (value) {
var notification = new Notification('N', true);
notification.value = value;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
/**
* Creates an object that represents an OnError notification to an observer.
* @param {Any} error The exception contained in the notification.
* @returns {Notification} The OnError notification containing the exception.
*/
var notificationCreateOnError = Notification.createOnError = (function () {
function _accept (onNext, onError) { return onError(this.exception); }
function _acceptObservable(observer) { return observer.onError(this.exception); }
function toString () { return 'OnError(' + this.exception + ')'; }
return function (exception) {
var notification = new Notification('E');
notification.exception = exception;
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
/**
* Creates an object that represents an OnCompleted notification to an observer.
* @returns {Notification} The OnCompleted notification.
*/
var notificationCreateOnCompleted = Notification.createOnCompleted = (function () {
function _accept (onNext, onError, onCompleted) { return onCompleted(); }
function _acceptObservable(observer) { return observer.onCompleted(); }
function toString () { return 'OnCompleted()'; }
return function () {
var notification = new Notification('C');
notification._accept = _accept;
notification._acceptObservable = _acceptObservable;
notification.toString = toString;
return notification;
};
}());
var Enumerator = Rx.internals.Enumerator = function (next) {
this._next = next;
};
Enumerator.prototype.next = function () {
return this._next();
};
Enumerator.prototype[$iterator$] = function () { return this; }
var Enumerable = Rx.internals.Enumerable = function (iterator) {
this._iterator = iterator;
};
Enumerable.prototype[$iterator$] = function () {
return this._iterator();
};
Enumerable.prototype.concat = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var e;
try {
e = sources[$iterator$]();
} catch(err) {
observer.onError();
return;
}
var isDisposed,
subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
var currentItem;
if (isDisposed) { return; }
try {
currentItem = e.next();
} catch (ex) {
observer.onError(ex);
return;
}
if (currentItem.done) {
observer.onCompleted();
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
observer.onNext.bind(observer),
observer.onError.bind(observer),
function () { self(); })
);
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
Enumerable.prototype.catchException = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var e;
try {
e = sources[$iterator$]();
} catch(err) {
observer.onError();
return;
}
var isDisposed,
lastException,
subscription = new SerialDisposable();
var cancelable = immediateScheduler.scheduleRecursive(function (self) {
if (isDisposed) { return; }
var currentItem;
try {
currentItem = e.next();
} catch (ex) {
observer.onError(ex);
return;
}
if (currentItem.done) {
if (lastException) {
observer.onError(lastException);
} else {
observer.onCompleted();
}
return;
}
// Check if promise
var currentValue = currentItem.value;
isPromise(currentValue) && (currentValue = observableFromPromise(currentValue));
var d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(currentValue.subscribe(
observer.onNext.bind(observer),
function (exn) {
lastException = exn;
self();
},
observer.onCompleted.bind(observer)));
});
return new CompositeDisposable(subscription, cancelable, disposableCreate(function () {
isDisposed = true;
}));
});
};
var enumerableRepeat = Enumerable.repeat = function (value, repeatCount) {
if (repeatCount == null) { repeatCount = -1; }
return new Enumerable(function () {
var left = repeatCount;
return new Enumerator(function () {
if (left === 0) { return doneEnumerator; }
if (left > 0) { left--; }
return { done: false, value: value };
});
});
};
var enumerableFor = Enumerable.forEach = function (source, selector, thisArg) {
selector || (selector = identity);
return new Enumerable(function () {
var index = -1;
return new Enumerator(
function () {
return ++index < source.length ?
{ done: false, value: selector.call(thisArg, source[index], index, source) } :
doneEnumerator;
});
});
};
/**
* Supports push-style iteration over an observable sequence.
*/
var Observer = Rx.Observer = function () { };
/**
* Creates a notification callback from an observer.
*
* @param observer Observer object.
* @returns The action that forwards its input notification to the underlying observer.
*/
Observer.prototype.toNotifier = function () {
var observer = this;
return function (n) {
return n.accept(observer);
};
};
/**
* Hides the identity of an observer.
* @returns An observer that hides the identity of the specified observer.
*/
Observer.prototype.asObserver = function () {
return new AnonymousObserver(this.onNext.bind(this), this.onError.bind(this), this.onCompleted.bind(this));
};
/**
* Creates an observer from the specified OnNext, along with optional OnError, and OnCompleted actions.
*
* @static
* @memberOf Observer
* @param {Function} [onNext] Observer's OnNext action implementation.
* @param {Function} [onError] Observer's OnError action implementation.
* @param {Function} [onCompleted] Observer's OnCompleted action implementation.
* @returns {Observer} The observer object implemented using the given actions.
*/
var observerCreate = Observer.create = function (onNext, onError, onCompleted) {
onNext || (onNext = noop);
onError || (onError = defaultError);
onCompleted || (onCompleted = noop);
return new AnonymousObserver(onNext, onError, onCompleted);
};
/**
* Creates an observer from a notification callback.
*
* @static
* @memberOf Observer
* @param {Function} handler Action that handles a notification.
* @returns The observer object that invokes the specified handler using a notification corresponding to each message it receives.
*/
Observer.fromNotifier = function (handler) {
return new AnonymousObserver(function (x) {
return handler(notificationCreateOnNext(x));
}, function (exception) {
return handler(notificationCreateOnError(exception));
}, function () {
return handler(notificationCreateOnCompleted());
});
};
/**
* Abstract base class for implementations of the Observer class.
* This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.
*/
var AbstractObserver = Rx.internals.AbstractObserver = (function (_super) {
inherits(AbstractObserver, _super);
/**
* Creates a new observer in a non-stopped state.
*
* @constructor
*/
function AbstractObserver() {
this.isStopped = false;
_super.call(this);
}
/**
* Notifies the observer of a new element in the sequence.
*
* @memberOf AbstractObserver
* @param {Any} value Next element in the sequence.
*/
AbstractObserver.prototype.onNext = function (value) {
if (!this.isStopped) {
this.next(value);
}
};
/**
* Notifies the observer that an exception has occurred.
*
* @memberOf AbstractObserver
* @param {Any} error The error that has occurred.
*/
AbstractObserver.prototype.onError = function (error) {
if (!this.isStopped) {
this.isStopped = true;
this.error(error);
}
};
/**
* Notifies the observer of the end of the sequence.
*/
AbstractObserver.prototype.onCompleted = function () {
if (!this.isStopped) {
this.isStopped = true;
this.completed();
}
};
/**
* Disposes the observer, causing it to transition to the stopped state.
*/
AbstractObserver.prototype.dispose = function () {
this.isStopped = true;
};
AbstractObserver.prototype.fail = function (e) {
if (!this.isStopped) {
this.isStopped = true;
this.error(e);
return true;
}
return false;
};
return AbstractObserver;
}(Observer));
/**
* Class to create an Observer instance from delegate-based implementations of the on* methods.
*/
var AnonymousObserver = Rx.AnonymousObserver = (function (_super) {
inherits(AnonymousObserver, _super);
/**
* Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
* @param {Any} onNext Observer's OnNext action implementation.
* @param {Any} onError Observer's OnError action implementation.
* @param {Any} onCompleted Observer's OnCompleted action implementation.
*/
function AnonymousObserver(onNext, onError, onCompleted) {
_super.call(this);
this._onNext = onNext;
this._onError = onError;
this._onCompleted = onCompleted;
}
/**
* Calls the onNext action.
* @param {Any} value Next element in the sequence.
*/
AnonymousObserver.prototype.next = function (value) {
this._onNext(value);
};
/**
* Calls the onError action.
* @param {Any} error The error that has occurred.
*/
AnonymousObserver.prototype.error = function (exception) {
this._onError(exception);
};
/**
* Calls the onCompleted action.
*/
AnonymousObserver.prototype.completed = function () {
this._onCompleted();
};
return AnonymousObserver;
}(AbstractObserver));
var observableProto;
/**
* Represents a push-style collection.
*/
var Observable = Rx.Observable = (function () {
function Observable(subscribe) {
this._subscribe = subscribe;
}
observableProto = Observable.prototype;
/**
* Subscribes an observer to the observable sequence.
*
* @example
* 1 - source.subscribe();
* 2 - source.subscribe(observer);
* 3 - source.subscribe(function (x) { console.log(x); });
* 4 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); });
* 5 - source.subscribe(function (x) { console.log(x); }, function (err) { console.log(err); }, function () { console.log('done'); });
* @param {Mixed} [observerOrOnNext] The object that is to receive notifications or an action to invoke for each element in the observable sequence.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence.
* @returns {Diposable} The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler.
*/
observableProto.subscribe = observableProto.forEach = function (observerOrOnNext, onError, onCompleted) {
var subscriber = typeof observerOrOnNext === 'object' ?
observerOrOnNext :
observerCreate(observerOrOnNext, onError, onCompleted);
return this._subscribe(subscriber);
};
return Observable;
})();
var ScheduledObserver = Rx.internals.ScheduledObserver = (function (_super) {
inherits(ScheduledObserver, _super);
function ScheduledObserver(scheduler, observer) {
_super.call(this);
this.scheduler = scheduler;
this.observer = observer;
this.isAcquired = false;
this.hasFaulted = false;
this.queue = [];
this.disposable = new SerialDisposable();
}
ScheduledObserver.prototype.next = function (value) {
var self = this;
this.queue.push(function () {
self.observer.onNext(value);
});
};
ScheduledObserver.prototype.error = function (exception) {
var self = this;
this.queue.push(function () {
self.observer.onError(exception);
});
};
ScheduledObserver.prototype.completed = function () {
var self = this;
this.queue.push(function () {
self.observer.onCompleted();
});
};
ScheduledObserver.prototype.ensureActive = function () {
var isOwner = false, parent = this;
if (!this.hasFaulted && this.queue.length > 0) {
isOwner = !this.isAcquired;
this.isAcquired = true;
}
if (isOwner) {
this.disposable.setDisposable(this.scheduler.scheduleRecursive(function (self) {
var work;
if (parent.queue.length > 0) {
work = parent.queue.shift();
} else {
parent.isAcquired = false;
return;
}
try {
work();
} catch (ex) {
parent.queue = [];
parent.hasFaulted = true;
throw ex;
}
self();
}));
}
};
ScheduledObserver.prototype.dispose = function () {
_super.prototype.dispose.call(this);
this.disposable.dispose();
};
return ScheduledObserver;
}(AbstractObserver));
/**
* Creates a list from an observable sequence.
* @returns An observable sequence containing a single element with a list containing all the elements of the source sequence.
*/
observableProto.toArray = function () {
var self = this;
return new AnonymousObservable(function(observer) {
var arr = [];
return self.subscribe(
arr.push.bind(arr),
observer.onError.bind(observer),
function () {
observer.onNext(arr);
observer.onCompleted();
});
});
};
/**
* Creates an observable sequence from a specified subscribe method implementation.
*
* @example
* var res = Rx.Observable.create(function (observer) { return function () { } );
* var res = Rx.Observable.create(function (observer) { return Rx.Disposable.empty; } );
* var res = Rx.Observable.create(function (observer) { } );
*
* @param {Function} subscribe Implementation of the resulting observable sequence's subscribe method, returning a function that will be wrapped in a Disposable.
* @returns {Observable} The observable sequence with the specified implementation for the Subscribe method.
*/
Observable.create = Observable.createWithDisposable = function (subscribe) {
return new AnonymousObservable(subscribe);
};
/**
* Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes.
*
* @example
* var res = Rx.Observable.defer(function () { return Rx.Observable.fromArray([1,2,3]); });
* @param {Function} observableFactory Observable factory function to invoke for each observer that subscribes to the resulting sequence or Promise.
* @returns {Observable} An observable sequence whose observers trigger an invocation of the given observable factory function.
*/
var observableDefer = Observable.defer = function (observableFactory) {
return new AnonymousObservable(function (observer) {
var result;
try {
result = observableFactory();
} catch (e) {
return observableThrow(e).subscribe(observer);
}
isPromise(result) && (result = observableFromPromise(result));
return result.subscribe(observer);
});
};
/**
* Returns an empty observable sequence, using the specified scheduler to send out the single OnCompleted message.
*
* @example
* var res = Rx.Observable.empty();
* var res = Rx.Observable.empty(Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to send the termination call on.
* @returns {Observable} An observable sequence with no elements.
*/
var observableEmpty = Observable.empty = function (scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onCompleted();
});
});
};
var maxSafeInteger = Math.pow(2, 53) - 1;
function numberIsFinite(value) {
return typeof value === 'number' && root.isFinite(value);
}
function isNan(n) {
return n !== n;
}
function isIterable(o) {
return o[$iterator$] !== undefined;
}
function sign(value) {
var number = +value;
if (number === 0) { return number; }
if (isNaN(number)) { return number; }
return number < 0 ? -1 : 1;
}
function toLength(o) {
var len = +o.length;
if (isNaN(len)) { return 0; }
if (len === 0 || !numberIsFinite(len)) { return len; }
len = sign(len) * Math.floor(Math.abs(len));
if (len <= 0) { return 0; }
if (len > maxSafeInteger) { return maxSafeInteger; }
return len;
}
function isCallable(f) {
return Object.prototype.toString.call(f) === '[object Function]' && typeof f === 'function';
}
/**
* This method creates a new Observable sequence from an array-like or iterable object.
* @param {Any} arrayLike An array-like or iterable object to convert to an Observable sequence.
* @param {Function} [mapFn] Map function to call on every element of the array.
* @param {Any} [thisArg] The context to use calling the mapFn if provided.
* @param {Scheduler} [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread.
*/
Observable.from = function (iterable, mapFn, thisArg, scheduler) {
if (iterable == null) {
throw new Error('iterable cannot be null.')
}
if (mapFn && !isCallable(mapFn)) {
throw new Error('mapFn when provided must be a function');
}
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var list = Object(iterable),
objIsIterable = isIterable(list),
len = objIsIterable ? 0 : toLength(list),
it = objIsIterable ? list[$iterator$]() : null,
i = 0;
return scheduler.scheduleRecursive(function (self) {
if (i < len || objIsIterable) {
var result;
if (objIsIterable) {
var next = it.next();
if (next.done) {
observer.onCompleted();
return;
}
result = next.value;
} else {
result = list[i];
}
if (mapFn && isCallable(mapFn)) {
try {
result = thisArg ? mapFn.call(thisArg, result, i) : mapFn(result, i);
} catch (e) {
observer.onError(e);
return;
}
}
observer.onNext(result);
i++;
self();
} else {
observer.onCompleted();
}
});
});
};
/**
* Converts an array to an observable sequence, using an optional scheduler to enumerate the array.
*
* @example
* var res = Rx.Observable.fromArray([1,2,3]);
* var res = Rx.Observable.fromArray([1,2,3], Rx.Scheduler.timeout);
* @param {Scheduler} [scheduler] Scheduler to run the enumeration of the input sequence on.
* @returns {Observable} The observable sequence whose elements are pulled from the given enumerable sequence.
*/
var observableFromArray = Observable.fromArray = function (array, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
var count = 0, len = array.length;
return scheduler.scheduleRecursive(function (self) {
if (count < len) {
observer.onNext(array[count++]);
self();
} else {
observer.onCompleted();
}
});
});
};
/**
* Returns a non-terminating observable sequence, which can be used to denote an infinite duration (e.g. when using reactive joins).
* @returns {Observable} An observable sequence whose observers will never get called.
*/
var observableNever = Observable.never = function () {
return new AnonymousObservable(function () {
return disposableEmpty;
});
};
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @example
* var res = Rx.Observable.of(1,2,3);
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
Observable.of = function () {
var len = arguments.length, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i]; }
return observableFromArray(args);
};
/**
* This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments.
* @example
* var res = Rx.Observable.of(1,2,3);
* @param {Scheduler} scheduler A scheduler to use for scheduling the arguments.
* @returns {Observable} The observable sequence whose elements are pulled from the given arguments.
*/
var observableOf = Observable.ofWithScheduler = function (scheduler) {
var len = arguments.length - 1, args = new Array(len);
for(var i = 0; i < len; i++) { args[i] = arguments[i + 1]; }
return observableFromArray(args, scheduler);
};
/**
* Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.range(0, 10);
* var res = Rx.Observable.range(0, 10, Rx.Scheduler.timeout);
* @param {Number} start The value of the first integer in the sequence.
* @param {Number} count The number of sequential integers to generate.
* @param {Scheduler} [scheduler] Scheduler to run the generator loop on. If not specified, defaults to Scheduler.currentThread.
* @returns {Observable} An observable sequence that contains a range of sequential integral numbers.
*/
Observable.range = function (start, count, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleRecursiveWithState(0, function (i, self) {
if (i < count) {
observer.onNext(start + i);
self(i + 1);
} else {
observer.onCompleted();
}
});
});
};
/**
* Generates an observable sequence that repeats the given element the specified number of times, using the specified scheduler to send out observer messages.
*
* @example
* var res = Rx.Observable.repeat(42);
* var res = Rx.Observable.repeat(42, 4);
* 3 - res = Rx.Observable.repeat(42, 4, Rx.Scheduler.timeout);
* 4 - res = Rx.Observable.repeat(42, null, Rx.Scheduler.timeout);
* @param {Mixed} value Element to repeat.
* @param {Number} repeatCount [Optiona] Number of times to repeat the element. If not specified, repeats indefinitely.
* @param {Scheduler} scheduler Scheduler to run the producer loop on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence that repeats the given element the specified number of times.
*/
Observable.repeat = function (value, repeatCount, scheduler) {
isScheduler(scheduler) || (scheduler = currentThreadScheduler);
return observableReturn(value, scheduler).repeat(repeatCount == null ? -1 : repeatCount);
};
/**
* Returns an observable sequence that contains a single element, using the specified scheduler to send out observer messages.
* There is an alias called 'just', and 'returnValue' for browsers <IE9.
*
* @example
* var res = Rx.Observable.return(42);
* var res = Rx.Observable.return(42, Rx.Scheduler.timeout);
* @param {Mixed} value Single element in the resulting observable sequence.
* @param {Scheduler} scheduler Scheduler to send the single element on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} An observable sequence containing the single specified element.
*/
var observableReturn = Observable['return'] = Observable.returnValue = Observable.just = function (value, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onNext(value);
observer.onCompleted();
});
});
};
/**
* Returns an observable sequence that terminates with an exception, using the specified scheduler to send out the single onError message.
* There is an alias to this method called 'throwException' for browsers <IE9.
*
* @example
* var res = Rx.Observable.throw(new Error('Error'));
* var res = Rx.Observable.throw(new Error('Error'), Rx.Scheduler.timeout);
* @param {Mixed} exception An object used for the sequence's termination.
* @param {Scheduler} scheduler Scheduler to send the exceptional termination call on. If not specified, defaults to Scheduler.immediate.
* @returns {Observable} The observable sequence that terminates exceptionally with the specified exception object.
*/
var observableThrow = Observable['throw'] = Observable.throwException = function (exception, scheduler) {
isScheduler(scheduler) || (scheduler = immediateScheduler);
return new AnonymousObservable(function (observer) {
return scheduler.schedule(function () {
observer.onError(exception);
});
});
};
function observableCatchHandler(source, handler) {
return new AnonymousObservable(function (observer) {
var d1 = new SingleAssignmentDisposable(), subscription = new SerialDisposable();
subscription.setDisposable(d1);
d1.setDisposable(source.subscribe(observer.onNext.bind(observer), function (exception) {
var d, result;
try {
result = handler(exception);
} catch (ex) {
observer.onError(ex);
return;
}
isPromise(result) && (result = observableFromPromise(result));
d = new SingleAssignmentDisposable();
subscription.setDisposable(d);
d.setDisposable(result.subscribe(observer));
}, observer.onCompleted.bind(observer)));
return subscription;
});
}
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
* @example
* 1 - xs.catchException(ys)
* 2 - xs.catchException(function (ex) { return ys(ex); })
* @param {Mixed} handlerOrSecond Exception handler function that returns an observable sequence given the error that occurred in the first sequence, or a second observable sequence used to produce results when an error occurred in the first sequence.
* @returns {Observable} An observable sequence containing the first sequence's elements, followed by the elements of the handler sequence in case an exception occurred.
*/
observableProto['catch'] = observableProto.catchException = function (handlerOrSecond) {
return typeof handlerOrSecond === 'function' ?
observableCatchHandler(this, handlerOrSecond) :
observableCatch([this, handlerOrSecond]);
};
/**
* Continues an observable sequence that is terminated by an exception with the next observable sequence.
*
* @example
* 1 - res = Rx.Observable.catchException(xs, ys, zs);
* 2 - res = Rx.Observable.catchException([xs, ys, zs]);
* @returns {Observable} An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully.
*/
var observableCatch = Observable.catchException = Observable['catch'] = function () {
var items = argsOrArray(arguments, 0);
return enumerableFor(items).catchException();
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
* This can be in the form of an argument list of observables or an array.
*
* @example
* 1 - obs = observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.combineLatest = function () {
var args = slice.call(arguments);
if (Array.isArray(args[0])) {
args[0].unshift(this);
} else {
args.unshift(this);
}
return combineLatest.apply(this, args);
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences or Promises produces an element.
*
* @example
* 1 - obs = Rx.Observable.combineLatest(obs1, obs2, obs3, function (o1, o2, o3) { return o1 + o2 + o3; });
* 2 - obs = Rx.Observable.combineLatest([obs1, obs2, obs3], function (o1, o2, o3) { return o1 + o2 + o3; });
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
var combineLatest = Observable.combineLatest = function () {
var args = slice.call(arguments), resultSelector = args.pop();
if (Array.isArray(args[0])) {
args = args[0];
}
return new AnonymousObservable(function (observer) {
var falseFactory = function () { return false; },
n = args.length,
hasValue = arrayInitialize(n, falseFactory),
hasValueAll = false,
isDone = arrayInitialize(n, falseFactory),
values = new Array(n);
function next(i) {
var res;
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
res = resultSelector.apply(null, values);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
}
}
function done (i) {
isDone[i] = true;
if (isDone.every(identity)) {
observer.onCompleted();
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = args[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
values[i] = x;
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
subscriptions[i] = sad;
}(idx));
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Concatenates all the observable sequences. This takes in either an array or variable arguments to concatenate.
*
* @example
* 1 - concatenated = xs.concat(ys, zs);
* 2 - concatenated = xs.concat([ys, zs]);
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
observableProto.concat = function () {
var items = slice.call(arguments, 0);
items.unshift(this);
return observableConcat.apply(this, items);
};
/**
* Concatenates all the observable sequences.
*
* @example
* 1 - res = Rx.Observable.concat(xs, ys, zs);
* 2 - res = Rx.Observable.concat([xs, ys, zs]);
* @returns {Observable} An observable sequence that contains the elements of each given sequence, in sequential order.
*/
var observableConcat = Observable.concat = function () {
var sources = argsOrArray(arguments, 0);
return enumerableFor(sources).concat();
};
/**
* Concatenates an observable sequence of observable sequences.
* @returns {Observable} An observable sequence that contains the elements of each observed inner sequence, in sequential order.
*/
observableProto.concatObservable = observableProto.concatAll =function () {
return this.merge(1);
};
/**
* Merges an observable sequence of observable sequences into an observable sequence, limiting the number of concurrent subscriptions to inner sequences.
* Or merges two observable sequences into a single observable sequence.
*
* @example
* 1 - merged = sources.merge(1);
* 2 - merged = source.merge(otherSource);
* @param {Mixed} [maxConcurrentOrOther] Maximum number of inner observable sequences being subscribed to concurrently or the second observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.merge = function (maxConcurrentOrOther) {
if (typeof maxConcurrentOrOther !== 'number') {
return observableMerge(this, maxConcurrentOrOther);
}
var sources = this;
return new AnonymousObservable(function (observer) {
var activeCount = 0,
group = new CompositeDisposable(),
isStopped = false,
q = [],
subscribe = function (xs) {
var subscription = new SingleAssignmentDisposable();
group.add(subscription);
// Check for promises support
if (isPromise(xs)) { xs = observableFromPromise(xs); }
subscription.setDisposable(xs.subscribe(observer.onNext.bind(observer), observer.onError.bind(observer), function () {
var s;
group.remove(subscription);
if (q.length > 0) {
s = q.shift();
subscribe(s);
} else {
activeCount--;
if (isStopped && activeCount === 0) {
observer.onCompleted();
}
}
}));
};
group.add(sources.subscribe(function (innerSource) {
if (activeCount < maxConcurrentOrOther) {
activeCount++;
subscribe(innerSource);
} else {
q.push(innerSource);
}
}, observer.onError.bind(observer), function () {
isStopped = true;
if (activeCount === 0) {
observer.onCompleted();
}
}));
return group;
});
};
/**
* Merges all the observable sequences into a single observable sequence.
* The scheduler is optional and if not specified, the immediate scheduler is used.
*
* @example
* 1 - merged = Rx.Observable.merge(xs, ys, zs);
* 2 - merged = Rx.Observable.merge([xs, ys, zs]);
* 3 - merged = Rx.Observable.merge(scheduler, xs, ys, zs);
* 4 - merged = Rx.Observable.merge(scheduler, [xs, ys, zs]);
* @returns {Observable} The observable sequence that merges the elements of the observable sequences.
*/
var observableMerge = Observable.merge = function () {
var scheduler, sources;
if (!arguments[0]) {
scheduler = immediateScheduler;
sources = slice.call(arguments, 1);
} else if (arguments[0].now) {
scheduler = arguments[0];
sources = slice.call(arguments, 1);
} else {
scheduler = immediateScheduler;
sources = slice.call(arguments, 0);
}
if (Array.isArray(sources[0])) {
sources = sources[0];
}
return observableFromArray(sources, scheduler).mergeObservable();
};
/**
* Merges an observable sequence of observable sequences into an observable sequence.
* @returns {Observable} The observable sequence that merges the elements of the inner sequences.
*/
observableProto.mergeObservable = observableProto.mergeAll =function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var group = new CompositeDisposable(),
isStopped = false,
m = new SingleAssignmentDisposable();
group.add(m);
m.setDisposable(sources.subscribe(function (innerSource) {
var innerSubscription = new SingleAssignmentDisposable();
group.add(innerSubscription);
// Check if Promise or Observable
if (isPromise(innerSource)) {
innerSource = observableFromPromise(innerSource);
}
innerSubscription.setDisposable(innerSource.subscribe(function (x) {
observer.onNext(x);
}, observer.onError.bind(observer), function () {
group.remove(innerSubscription);
if (isStopped && group.length === 1) { observer.onCompleted(); }
}));
}, observer.onError.bind(observer), function () {
isStopped = true;
if (group.length === 1) { observer.onCompleted(); }
}));
return group;
});
};
/**
* Returns the values from the source observable sequence only after the other observable sequence produces a value.
* @param {Observable | Promise} other The observable sequence or Promise that triggers propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence starting from the point the other sequence triggered propagation.
*/
observableProto.skipUntil = function (other) {
var source = this;
return new AnonymousObservable(function (observer) {
var isOpen = false;
var disposables = new CompositeDisposable(source.subscribe(function (left) {
isOpen && observer.onNext(left);
}, observer.onError.bind(observer), function () {
isOpen && observer.onCompleted();
}));
isPromise(other) && (other = observableFromPromise(other));
var rightSubscription = new SingleAssignmentDisposable();
disposables.add(rightSubscription);
rightSubscription.setDisposable(other.subscribe(function () {
isOpen = true;
rightSubscription.dispose();
}, observer.onError.bind(observer), function () {
rightSubscription.dispose();
}));
return disposables;
});
};
/**
* Transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @returns {Observable} The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto['switch'] = observableProto.switchLatest = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasLatest = false,
innerSubscription = new SerialDisposable(),
isStopped = false,
latest = 0,
subscription = sources.subscribe(function (innerSource) {
var d = new SingleAssignmentDisposable(), id = ++latest;
hasLatest = true;
innerSubscription.setDisposable(d);
// Check if Promise or Observable
if (isPromise(innerSource)) {
innerSource = observableFromPromise(innerSource);
}
d.setDisposable(innerSource.subscribe(function (x) {
if (latest === id) {
observer.onNext(x);
}
}, function (e) {
if (latest === id) {
observer.onError(e);
}
}, function () {
if (latest === id) {
hasLatest = false;
if (isStopped) {
observer.onCompleted();
}
}
}));
}, observer.onError.bind(observer), function () {
isStopped = true;
if (!hasLatest) {
observer.onCompleted();
}
});
return new CompositeDisposable(subscription, innerSubscription);
});
};
/**
* Returns the values from the source observable sequence until the other observable sequence produces a value.
* @param {Observable | Promise} other Observable sequence or Promise that terminates propagation of elements of the source sequence.
* @returns {Observable} An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation.
*/
observableProto.takeUntil = function (other) {
var source = this;
return new AnonymousObservable(function (observer) {
isPromise(other) && (other = observableFromPromise(other));
return new CompositeDisposable(
source.subscribe(observer),
other.subscribe(observer.onCompleted.bind(observer), observer.onError.bind(observer), noop)
);
});
};
function zipArray(second, resultSelector) {
var first = this;
return new AnonymousObservable(function (observer) {
var index = 0, len = second.length;
return first.subscribe(function (left) {
if (index < len) {
var right = second[index++], result;
try {
result = resultSelector(left, right);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
} else {
observer.onCompleted();
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
}
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences or an array have produced an element at a corresponding index.
* The last element in the arguments must be a function to invoke for each series of elements at corresponding indexes in the sources.
*
* @example
* 1 - res = obs1.zip(obs2, fn);
* 1 - res = x1.zip([1,2,3], fn);
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
observableProto.zip = function () {
if (Array.isArray(arguments[0])) {
return zipArray.apply(this, arguments);
}
var parent = this, sources = slice.call(arguments), resultSelector = sources.pop();
sources.unshift(parent);
return new AnonymousObservable(function (observer) {
var n = sources.length,
queues = arrayInitialize(n, function () { return []; }),
isDone = arrayInitialize(n, function () { return false; });
function next(i) {
var res, queuedValues;
if (queues.every(function (x) { return x.length > 0; })) {
try {
queuedValues = queues.map(function (x) { return x.shift(); });
res = resultSelector.apply(parent, queuedValues);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(function (x) { return x; })) {
observer.onCompleted();
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
var source = sources[i], sad = new SingleAssignmentDisposable();
isPromise(source) && (source = observableFromPromise(source));
sad.setDisposable(source.subscribe(function (x) {
queues[i].push(x);
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
subscriptions[i] = sad;
})(idx);
}
return new CompositeDisposable(subscriptions);
});
};
/**
* Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index.
* @param arguments Observable sources.
* @param {Function} resultSelector Function to invoke for each series of elements at corresponding indexes in the sources.
* @returns {Observable} An observable sequence containing the result of combining elements of the sources using the specified result selector function.
*/
Observable.zip = function () {
var args = slice.call(arguments, 0),
first = args.shift();
return first.zip.apply(first, args);
};
/**
* Merges the specified observable sequences into one observable sequence by emitting a list with the elements of the observable sequences at corresponding indexes.
* @param arguments Observable sources.
* @returns {Observable} An observable sequence containing lists of elements at corresponding indexes.
*/
Observable.zipArray = function () {
var sources = argsOrArray(arguments, 0);
return new AnonymousObservable(function (observer) {
var n = sources.length,
queues = arrayInitialize(n, function () { return []; }),
isDone = arrayInitialize(n, function () { return false; });
function next(i) {
if (queues.every(function (x) { return x.length > 0; })) {
var res = queues.map(function (x) { return x.shift(); });
observer.onNext(res);
} else if (isDone.filter(function (x, j) { return j !== i; }).every(identity)) {
observer.onCompleted();
return;
}
};
function done(i) {
isDone[i] = true;
if (isDone.every(identity)) {
observer.onCompleted();
return;
}
}
var subscriptions = new Array(n);
for (var idx = 0; idx < n; idx++) {
(function (i) {
subscriptions[i] = new SingleAssignmentDisposable();
subscriptions[i].setDisposable(sources[i].subscribe(function (x) {
queues[i].push(x);
next(i);
}, observer.onError.bind(observer), function () {
done(i);
}));
})(idx);
}
var compositeDisposable = new CompositeDisposable(subscriptions);
compositeDisposable.add(disposableCreate(function () {
for (var qIdx = 0, qLen = queues.length; qIdx < qLen; qIdx++) {
queues[qIdx] = [];
}
}));
return compositeDisposable;
});
};
/**
* Hides the identity of an observable sequence.
* @returns {Observable} An observable sequence that hides the identity of the source sequence.
*/
observableProto.asObservable = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(observer);
});
};
/**
* Dematerializes the explicit notification values of an observable sequence as implicit notifications.
* @returns {Observable} An observable sequence exhibiting the behavior corresponding to the source sequence's notification values.
*/
observableProto.dematerialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (x) {
return x.accept(observer);
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer.
*
* var obs = observable.distinctUntilChanged();
* var obs = observable.distinctUntilChanged(function (x) { return x.id; });
* var obs = observable.distinctUntilChanged(function (x) { return x.id; }, function (x, y) { return x === y; });
*
* @param {Function} [keySelector] A function to compute the comparison key for each element. If not provided, it projects the value.
* @param {Function} [comparer] Equality comparer for computed key values. If not provided, defaults to an equality comparer function.
* @returns {Observable} An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence.
*/
observableProto.distinctUntilChanged = function (keySelector, comparer) {
var source = this;
keySelector || (keySelector = identity);
comparer || (comparer = defaultComparer);
return new AnonymousObservable(function (observer) {
var hasCurrentKey = false, currentKey;
return source.subscribe(function (value) {
var comparerEquals = false, key;
try {
key = keySelector(value);
} catch (exception) {
observer.onError(exception);
return;
}
if (hasCurrentKey) {
try {
comparerEquals = comparer(currentKey, key);
} catch (exception) {
observer.onError(exception);
return;
}
}
if (!hasCurrentKey || !comparerEquals) {
hasCurrentKey = true;
currentKey = key;
observer.onNext(value);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence.
* This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
*
* @example
* var res = observable.do(observer);
* var res = observable.do(onNext);
* var res = observable.do(onNext, onError);
* var res = observable.do(onNext, onError, onCompleted);
* @param {Function | Observer} observerOrOnNext Action to invoke for each element in the observable sequence or an observer.
* @param {Function} [onError] Action to invoke upon exceptional termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @param {Function} [onCompleted] Action to invoke upon graceful termination of the observable sequence. Used if only the observerOrOnNext parameter is also a function.
* @returns {Observable} The source sequence with the side-effecting behavior applied.
*/
observableProto['do'] = observableProto.doAction = observableProto.tap = function (observerOrOnNext, onError, onCompleted) {
var source = this, onNextFunc;
if (typeof observerOrOnNext === 'function') {
onNextFunc = observerOrOnNext;
} else {
onNextFunc = observerOrOnNext.onNext.bind(observerOrOnNext);
onError = observerOrOnNext.onError.bind(observerOrOnNext);
onCompleted = observerOrOnNext.onCompleted.bind(observerOrOnNext);
}
return new AnonymousObservable(function (observer) {
return source.subscribe(function (x) {
try {
onNextFunc(x);
} catch (e) {
observer.onError(e);
}
observer.onNext(x);
}, function (err) {
if (!onError) {
observer.onError(err);
} else {
try {
onError(err);
} catch (e) {
observer.onError(e);
}
observer.onError(err);
}
}, function () {
if (!onCompleted) {
observer.onCompleted();
} else {
try {
onCompleted();
} catch (e) {
observer.onError(e);
}
observer.onCompleted();
}
});
});
};
/**
* Invokes a specified action after the source observable sequence terminates gracefully or exceptionally.
*
* @example
* var res = observable.finallyAction(function () { console.log('sequence ended'; });
* @param {Function} finallyAction Action to invoke after the source observable sequence terminates.
* @returns {Observable} Source sequence with the action-invoking termination behavior applied.
*/
observableProto['finally'] = observableProto.finallyAction = function (action) {
var source = this;
return new AnonymousObservable(function (observer) {
var subscription;
try {
subscription = source.subscribe(observer);
} catch (e) {
action();
throw e;
}
return disposableCreate(function () {
try {
subscription.dispose();
} catch (e) {
throw e;
} finally {
action();
}
});
});
};
/**
* Ignores all elements in an observable sequence leaving only the termination messages.
* @returns {Observable} An empty observable sequence that signals termination, successful or exceptional, of the source sequence.
*/
observableProto.ignoreElements = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(noop, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Materializes the implicit notifications of an observable sequence as explicit notification values.
* @returns {Observable} An observable sequence containing the materialized notification values from the source sequence.
*/
observableProto.materialize = function () {
var source = this;
return new AnonymousObservable(function (observer) {
return source.subscribe(function (value) {
observer.onNext(notificationCreateOnNext(value));
}, function (e) {
observer.onNext(notificationCreateOnError(e));
observer.onCompleted();
}, function () {
observer.onNext(notificationCreateOnCompleted());
observer.onCompleted();
});
});
};
/**
* Repeats the observable sequence a specified number of times. If the repeat count is not specified, the sequence repeats indefinitely.
*
* @example
* var res = repeated = source.repeat();
* var res = repeated = source.repeat(42);
* @param {Number} [repeatCount] Number of times to repeat the sequence. If not provided, repeats the sequence indefinitely.
* @returns {Observable} The observable sequence producing the elements of the given sequence repeatedly.
*/
observableProto.repeat = function (repeatCount) {
return enumerableRepeat(this, repeatCount).concat();
};
/**
* Repeats the source observable sequence the specified number of times or until it successfully terminates. If the retry count is not specified, it retries indefinitely.
* Note if you encounter an error and want it to retry once, then you must use .retry(2);
*
* @example
* var res = retried = retry.repeat();
* var res = retried = retry.repeat(2);
* @param {Number} [retryCount] Number of times to retry the sequence. If not provided, retry the sequence indefinitely.
* @returns {Observable} An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully.
*/
observableProto.retry = function (retryCount) {
return enumerableRepeat(this, retryCount).catchException();
};
/**
* Applies an accumulator function over an observable sequence and returns each intermediate result. The optional seed value is used as the initial accumulator value.
* For aggregation behavior with no intermediate results, see Observable.aggregate.
* @example
* var res = source.scan(function (acc, x) { return acc + x; });
* var res = source.scan(0, function (acc, x) { return acc + x; });
* @param {Mixed} [seed] The initial accumulator value.
* @param {Function} accumulator An accumulator function to be invoked on each element.
* @returns {Observable} An observable sequence containing the accumulated values.
*/
observableProto.scan = function () {
var hasSeed = false, seed, accumulator, source = this;
if (arguments.length === 2) {
hasSeed = true;
seed = arguments[0];
accumulator = arguments[1];
} else {
accumulator = arguments[0];
}
return new AnonymousObservable(function (observer) {
var hasAccumulation, accumulation, hasValue;
return source.subscribe (
function (x) {
try {
if (!hasValue) {
hasValue = true;
}
if (hasAccumulation) {
accumulation = accumulator(accumulation, x);
} else {
accumulation = hasSeed ? accumulator(seed, x) : x;
hasAccumulation = true;
}
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(accumulation);
},
observer.onError.bind(observer),
function () {
if (!hasValue && hasSeed) {
observer.onNext(seed);
}
observer.onCompleted();
}
);
});
};
/**
* Bypasses a specified number of elements at the end of an observable sequence.
* @description
* This operator accumulates a queue with a length enough to store the first `count` elements. As more elements are
* received, elements are taken from the front of the queue and produced on the result sequence. This causes elements to be delayed.
* @param count Number of elements to bypass at the end of the source sequence.
* @returns {Observable} An observable sequence containing the source sequence elements except for the bypassed ones at the end.
*/
observableProto.skipLast = function (count) {
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
if (q.length > count) {
observer.onNext(q.shift());
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Prepends a sequence of values to an observable sequence with an optional scheduler and an argument list of values to prepend.
*
* var res = source.startWith(1, 2, 3);
* var res = source.startWith(Rx.Scheduler.timeout, 1, 2, 3);
*
* @memberOf Observable#
* @returns {Observable} The source sequence prepended with the specified values.
*/
observableProto.startWith = function () {
var values, scheduler, start = 0;
if (!!arguments.length && 'now' in Object(arguments[0])) {
scheduler = arguments[0];
start = 1;
} else {
scheduler = immediateScheduler;
}
values = slice.call(arguments, start);
return enumerableFor([observableFromArray(values, scheduler), this]).concat();
};
/**
* Returns a specified number of contiguous elements from the end of an observable sequence.
*
* @example
* var res = source.takeLast(5);
*
* @description
* This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of
* the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed.
* @param {Number} count Number of elements to take from the end of the source sequence.
* @returns {Observable} An observable sequence containing the specified number of elements from the end of the source sequence.
*/
observableProto.takeLast = function (count) {
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
q.push(x);
q.length > count && q.shift();
}, observer.onError.bind(observer), function () {
while(q.length > 0) { observer.onNext(q.shift()); }
observer.onCompleted();
});
});
};
function concatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
return isPromise(result) ? observableFromPromise(result) : result;
}).concatAll();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.concatMap(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.concatMap(Rx.Observable.fromArray([1,2,3]));
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
* source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectConcat = observableProto.concatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
return this.concatMap(function (x, i) {
var selectorResult = selector(x, i),
result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult;
return result.map(function (y) {
return resultSelector(x, y, i);
});
});
}
return typeof selector === 'function' ?
concatMap(this, selector, thisArg) :
concatMap(this, function () { return selector; });
};
/**
* Projects each element of an observable sequence into a new form by incorporating the element's index.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source.
*/
observableProto.select = observableProto.map = function (selector, thisArg) {
var parent = this;
return new AnonymousObservable(function (observer) {
var count = 0;
return parent.subscribe(function (value) {
var result;
try {
result = selector.call(thisArg, value, count++, parent);
} catch (exception) {
observer.onError(exception);
return;
}
observer.onNext(result);
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Retrieves the value of a specified property from all elements in the Observable sequence.
* @param {String} property The property to pluck.
* @returns {Observable} Returns a new Observable sequence of property values.
*/
observableProto.pluck = function (property) {
return this.select(function (x) { return x[property]; });
};
function flatMap(source, selector, thisArg) {
return source.map(function (x, i) {
var result = selector.call(thisArg, x, i);
return isPromise(result) ? observableFromPromise(result) : result;
}).mergeObservable();
}
/**
* One of the Following:
* Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
*
* @example
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); });
* Or:
* Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
*
* var res = source.selectMany(function (x) { return Rx.Observable.range(0, x); }, function (x, y) { return x + y; });
* Or:
* Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
*
* var res = source.selectMany(Rx.Observable.fromArray([1,2,3]));
* @param selector A transform function to apply to each element or an observable sequence to project each element from the
* source sequence onto which could be either an observable or Promise.
* @param {Function} [resultSelector] A transform function to apply to each element of the intermediate sequence.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of the input sequence and then mapping each of those sequence elements and their corresponding source element to a result element.
*/
observableProto.selectMany = observableProto.flatMap = function (selector, resultSelector, thisArg) {
if (resultSelector) {
return this.flatMap(function (x, i) {
var selectorResult = selector(x, i),
result = isPromise(selectorResult) ? observableFromPromise(selectorResult) : selectorResult;
return result.map(function (y) {
return resultSelector(x, y, i);
});
}, thisArg);
}
return typeof selector === 'function' ?
flatMap(this, selector, thisArg) :
flatMap(this, function () { return selector; });
};
/**
* Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then
* transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
* @param {Function} selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences
* and that at any point in time produces the elements of the most recent inner observable sequence that has been received.
*/
observableProto.selectSwitch = observableProto.flatMapLatest = observableProto.switchMap = function (selector, thisArg) {
return this.select(selector, thisArg).switchLatest();
};
/**
* Bypasses a specified number of elements in an observable sequence and then returns the remaining elements.
* @param {Number} count The number of elements to skip before returning the remaining elements.
* @returns {Observable} An observable sequence that contains the elements that occur after the specified index in the input sequence.
*/
observableProto.skip = function (count) {
if (count < 0) {
throw new Error(argumentOutOfRange);
}
var observable = this;
return new AnonymousObservable(function (observer) {
var remaining = count;
return observable.subscribe(function (x) {
if (remaining <= 0) {
observer.onNext(x);
} else {
remaining--;
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements.
* The element's index is used in the logic of the predicate function.
*
* var res = source.skipWhile(function (value) { return value < 10; });
* var res = source.skipWhile(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.
*/
observableProto.skipWhile = function (predicate, thisArg) {
var source = this;
return new AnonymousObservable(function (observer) {
var i = 0, running = false;
return source.subscribe(function (x) {
if (!running) {
try {
running = !predicate.call(thisArg, x, i++, source);
} catch (e) {
observer.onError(e);
return;
}
}
if (running) {
observer.onNext(x);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns a specified number of contiguous elements from the start of an observable sequence, using the specified scheduler for the edge case of take(0).
*
* var res = source.take(5);
* var res = source.take(0, Rx.Scheduler.timeout);
* @param {Number} count The number of elements to return.
* @param {Scheduler} [scheduler] Scheduler used to produce an OnCompleted message in case <paramref name="count count</paramref> is set to 0.
* @returns {Observable} An observable sequence that contains the specified number of elements from the start of the input sequence.
*/
observableProto.take = function (count, scheduler) {
if (count < 0) {
throw new Error(argumentOutOfRange);
}
if (count === 0) {
return observableEmpty(scheduler);
}
var observable = this;
return new AnonymousObservable(function (observer) {
var remaining = count;
return observable.subscribe(function (x) {
if (remaining > 0) {
remaining--;
observer.onNext(x);
if (remaining === 0) {
observer.onCompleted();
}
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Returns elements from an observable sequence as long as a specified condition is true.
* The element's index is used in the logic of the predicate function.
*
* @example
* var res = source.takeWhile(function (value) { return value < 10; });
* var res = source.takeWhile(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.
*/
observableProto.takeWhile = function (predicate, thisArg) {
var observable = this;
return new AnonymousObservable(function (observer) {
var i = 0, running = true;
return observable.subscribe(function (x) {
if (running) {
try {
running = predicate.call(thisArg, x, i++, observable);
} catch (e) {
observer.onError(e);
return;
}
if (running) {
observer.onNext(x);
} else {
observer.onCompleted();
}
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
*
* @example
* var res = source.where(function (value) { return value < 10; });
* var res = source.where(function (value, index) { return value < 10 || index < 10; });
* @param {Function} predicate A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
* @param {Any} [thisArg] Object to use as this when executing callback.
* @returns {Observable} An observable sequence that contains elements from the input sequence that satisfy the condition.
*/
observableProto.where = observableProto.filter = function (predicate, thisArg) {
var parent = this;
return new AnonymousObservable(function (observer) {
var count = 0;
return parent.subscribe(function (value) {
var shouldRun;
try {
shouldRun = predicate.call(thisArg, value, count++, parent);
} catch (exception) {
observer.onError(exception);
return;
}
if (shouldRun) {
observer.onNext(value);
}
}, observer.onError.bind(observer), observer.onCompleted.bind(observer));
});
};
/**
* Converts a callback function to an observable sequence.
*
* @param {Function} function Function with a callback as the last parameter to convert to an Observable sequence.
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback to produce a single item to yield on next.
* @returns {Function} A function, when executed with the required parameters minus the callback, produces an Observable sequence with a single value of the arguments to the callback as an array.
*/
Observable.fromCallback = function (func, context, selector) {
return function () {
var args = slice.call(arguments, 0);
return new AnonymousObservable(function (observer) {
function handler(e) {
var results = e;
if (selector) {
try {
results = selector(arguments);
} catch (err) {
observer.onError(err);
return;
}
observer.onNext(results);
} else {
if (results.length <= 1) {
observer.onNext.apply(observer, results);
} else {
observer.onNext(results);
}
}
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
});
};
};
/**
* Converts a Node.js callback style function to an observable sequence. This must be in function (err, ...) format.
* @param {Function} func The function to call
* @param {Mixed} [context] The context for the func parameter to be executed. If not specified, defaults to undefined.
* @param {Function} [selector] A selector which takes the arguments from the callback minus the error to produce a single item to yield on next.
* @returns {Function} An async function which when applied, returns an observable sequence with the callback arguments as an array.
*/
Observable.fromNodeCallback = function (func, context, selector) {
return function () {
var args = slice.call(arguments, 0);
return new AnonymousObservable(function (observer) {
function handler(err) {
if (err) {
observer.onError(err);
return;
}
var results = slice.call(arguments, 1);
if (selector) {
try {
results = selector(results);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(results);
} else {
if (results.length <= 1) {
observer.onNext.apply(observer, results);
} else {
observer.onNext(results);
}
}
observer.onCompleted();
}
args.push(handler);
func.apply(context, args);
});
};
};
function fixEvent(event) {
var stopPropagation = function () {
this.cancelBubble = true;
};
var preventDefault = function () {
this.bubbledKeyCode = this.keyCode;
if (this.ctrlKey) {
try {
this.keyCode = 0;
} catch (e) { }
}
this.defaultPrevented = true;
this.returnValue = false;
this.modified = true;
};
event || (event = root.event);
if (!event.target) {
event.target = event.target || event.srcElement;
if (event.type == 'mouseover') {
event.relatedTarget = event.fromElement;
}
if (event.type == 'mouseout') {
event.relatedTarget = event.toElement;
}
// Adding stopPropogation and preventDefault to IE
if (!event.stopPropagation){
event.stopPropagation = stopPropagation;
event.preventDefault = preventDefault;
}
// Normalize key events
switch(event.type){
case 'keypress':
var c = ('charCode' in event ? event.charCode : event.keyCode);
if (c == 10) {
c = 0;
event.keyCode = 13;
} else if (c == 13 || c == 27) {
c = 0;
} else if (c == 3) {
c = 99;
}
event.charCode = c;
event.keyChar = event.charCode ? String.fromCharCode(event.charCode) : '';
break;
}
}
return event;
}
function createListener (element, name, handler) {
// Standards compliant
if (element.addEventListener) {
element.addEventListener(name, handler, false);
return disposableCreate(function () {
element.removeEventListener(name, handler, false);
});
}
if (element.attachEvent) {
// IE Specific
var innerHandler = function (event) {
handler(fixEvent(event));
};
element.attachEvent('on' + name, innerHandler);
return disposableCreate(function () {
element.detachEvent('on' + name, innerHandler);
});
}
// Level 1 DOM Events
element['on' + name] = handler;
return disposableCreate(function () {
element['on' + name] = null;
});
}
function createEventListener (el, eventName, handler) {
var disposables = new CompositeDisposable();
// Asume NodeList
if (Object.prototype.toString.call(el) === '[object NodeList]') {
for (var i = 0, len = el.length; i < len; i++) {
disposables.add(createEventListener(el.item(i), eventName, handler));
}
} else if (el) {
disposables.add(createListener(el, eventName, handler));
}
return disposables;
}
/**
* Configuration option to determine whether to use native events only
*/
Rx.config.useNativeEvents = false;
// Check for Angular/jQuery/Zepto support
var jq =
!!root.angular && !!angular.element ? angular.element :
(!!root.jQuery ? root.jQuery : (
!!root.Zepto ? root.Zepto : null));
// Check for ember
var ember = !!root.Ember && typeof root.Ember.addListener === 'function';
// Check for Backbone.Marionette. Note if using AMD add Marionette as a dependency of rxjs
// for proper loading order!
var marionette = !!root.Backbone && !!root.Backbone.Marionette;
/**
* Creates an observable sequence by adding an event listener to the matching DOMElement or each item in the NodeList.
*
* @example
* var source = Rx.Observable.fromEvent(element, 'mouseup');
*
* @param {Object} element The DOMElement or NodeList to attach a listener.
* @param {String} eventName The event name to attach the observable sequence.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence of events from the specified element and the specified event.
*/
Observable.fromEvent = function (element, eventName, selector) {
// Node.js specific
if (element.addListener) {
return fromEventPattern(
function (h) { element.addListener(eventName, h); },
function (h) { element.removeListener(eventName, h); },
selector);
}
// Use only if non-native events are allowed
if (!Rx.config.useNativeEvents) {
if (marionette) {
return fromEventPattern(
function (h) { element.on(eventName, h); },
function (h) { element.off(eventName, h); },
selector);
}
if (ember) {
return fromEventPattern(
function (h) { Ember.addListener(element, eventName, h); },
function (h) { Ember.removeListener(element, eventName, h); },
selector);
}
if (jq) {
var $elem = jq(element);
return fromEventPattern(
function (h) { $elem.on(eventName, h); },
function (h) { $elem.off(eventName, h); },
selector);
}
}
return new AnonymousObservable(function (observer) {
return createEventListener(
element,
eventName,
function handler (e) {
var results = e;
if (selector) {
try {
results = selector(arguments);
} catch (err) {
observer.onError(err);
return
}
}
observer.onNext(results);
});
}).publish().refCount();
};
/**
* Creates an observable sequence from an event emitter via an addHandler/removeHandler pair.
* @param {Function} addHandler The function to add a handler to the emitter.
* @param {Function} [removeHandler] The optional function to remove a handler from an emitter.
* @param {Function} [selector] A selector which takes the arguments from the event handler to produce a single item to yield on next.
* @returns {Observable} An observable sequence which wraps an event from an event emitter
*/
var fromEventPattern = Observable.fromEventPattern = function (addHandler, removeHandler, selector) {
return new AnonymousObservable(function (observer) {
function innerHandler (e) {
var result = e;
if (selector) {
try {
result = selector(arguments);
} catch (err) {
observer.onError(err);
return;
}
}
observer.onNext(result);
}
var returnValue = addHandler(innerHandler);
return disposableCreate(function () {
if (removeHandler) {
removeHandler(innerHandler, returnValue);
}
});
}).publish().refCount();
};
/**
* Converts a Promise to an Observable sequence
* @param {Promise} An ES6 Compliant promise.
* @returns {Observable} An Observable sequence which wraps the existing promise success and failure.
*/
var observableFromPromise = Observable.fromPromise = function (promise) {
return new AnonymousObservable(function (observer) {
promise.then(
function (value) {
observer.onNext(value);
observer.onCompleted();
},
function (reason) {
observer.onError(reason);
});
return function () {
if (promise && promise.abort) {
promise.abort();
}
}
});
};
/*
* Converts an existing observable sequence to an ES6 Compatible Promise
* @example
* var promise = Rx.Observable.return(42).toPromise(RSVP.Promise);
*
* // With config
* Rx.config.Promise = RSVP.Promise;
* var promise = Rx.Observable.return(42).toPromise();
* @param {Function} [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise.
* @returns {Promise} An ES6 compatible promise with the last value from the observable sequence.
*/
observableProto.toPromise = function (promiseCtor) {
promiseCtor || (promiseCtor = Rx.config.Promise);
if (!promiseCtor) {
throw new Error('Promise type not provided nor in Rx.config.Promise');
}
var source = this;
return new promiseCtor(function (resolve, reject) {
// No cancellation can be done
var value, hasValue = false;
source.subscribe(function (v) {
value = v;
hasValue = true;
}, function (err) {
reject(err);
}, function () {
if (hasValue) {
resolve(value);
}
});
});
};
/**
* Invokes the asynchronous function, surfacing the result through an observable sequence.
* @param {Function} functionAsync Asynchronous function which returns a Promise to run.
* @returns {Observable} An observable sequence exposing the function's result value, or an exception.
*/
Observable.startAsync = function (functionAsync) {
var promise;
try {
promise = functionAsync();
} catch (e) {
return observableThrow(e);
}
return observableFromPromise(promise);
}
/**
* Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. Each
* subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's
* invocation. For specializations with fixed subject types, see Publish, PublishLast, and Replay.
*
* @example
* 1 - res = source.multicast(observable);
* 2 - res = source.multicast(function () { return new Subject(); }, function (x) { return x; });
*
* @param {Function|Subject} subjectOrSubjectSelector
* Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function.
* Or:
* Subject to push source elements into.
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. Specified only if <paramref name="subjectOrSubjectSelector" is a factory function.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.multicast = function (subjectOrSubjectSelector, selector) {
var source = this;
return typeof subjectOrSubjectSelector === 'function' ?
new AnonymousObservable(function (observer) {
var connectable = source.multicast(subjectOrSubjectSelector());
return new CompositeDisposable(selector(connectable).subscribe(observer), connectable.connect());
}) :
new ConnectableObservable(source, subjectOrSubjectSelector);
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of Multicast using a regular Subject.
*
* @example
* var resres = source.publish();
* var res = source.publish(function (x) { return x; });
*
* @param {Function} [selector] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publish = function (selector) {
return !selector ?
this.multicast(new Subject()) :
this.multicast(function () {
return new Subject();
}, selector);
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence.
* This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.share();
*
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.share = function () {
return this.publish(null).refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence containing only the last notification.
* This operator is a specialization of Multicast using a AsyncSubject.
*
* @example
* var res = source.publishLast();
* var res = source.publishLast(function (x) { return x; });
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will only receive the last notification of the source.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishLast = function (selector) {
return !selector ?
this.multicast(new AsyncSubject()) :
this.multicast(function () {
return new AsyncSubject();
}, selector);
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence and starts with initialValue.
* This operator is a specialization of Multicast using a BehaviorSubject.
*
* @example
* var res = source.publishValue(42);
* var res = source.publishValue(function (x) { return x.select(function (y) { return y * y; }) }, 42);
*
* @param {Function} [selector] Optional selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive immediately receive the initial value, followed by all notifications of the source from the time of the subscription on.
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.publishValue = function (initialValueOrSelector, initialValue) {
return arguments.length === 2 ?
this.multicast(function () {
return new BehaviorSubject(initialValue);
}, initialValueOrSelector) :
this.multicast(new BehaviorSubject(initialValueOrSelector));
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue.
* This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.shareValue(42);
*
* @param {Mixed} initialValue Initial value received by observers upon subscription.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareValue = function (initialValue) {
return this.publishValue(initialValue).
refCount();
};
/**
* Returns an observable sequence that is the result of invoking the selector on a connectable observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of Multicast using a ReplaySubject.
*
* @example
* var res = source.replay(null, 3);
* var res = source.replay(null, 3, 500);
* var res = source.replay(null, 3, 500, scheduler);
* var res = source.replay(function (x) { return x.take(6).repeat(); }, 3, 500, scheduler);
*
* @param selector [Optional] Selector function which can use the multicasted source sequence as many times as needed, without causing multiple subscriptions to the source sequence. Subscribers to the given source will receive all the notifications of the source subject to the specified replay buffer trimming policy.
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param window [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function.
*/
observableProto.replay = function (selector, bufferSize, window, scheduler) {
return !selector ?
this.multicast(new ReplaySubject(bufferSize, window, scheduler)) :
this.multicast(function () {
return new ReplaySubject(bufferSize, window, scheduler);
}, selector);
};
/**
* Returns an observable sequence that shares a single subscription to the underlying sequence replaying notifications subject to a maximum time length for the replay buffer.
* This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed.
*
* @example
* var res = source.shareReplay(3);
* var res = source.shareReplay(3, 500);
* var res = source.shareReplay(3, 500, scheduler);
*
* @param bufferSize [Optional] Maximum element count of the replay buffer.
* @param window [Optional] Maximum time length of the replay buffer.
* @param scheduler [Optional] Scheduler where connected observers within the selector function will be invoked on.
* @returns {Observable} An observable sequence that contains the elements of a sequence produced by multicasting the source sequence.
*/
observableProto.shareReplay = function (bufferSize, window, scheduler) {
return this.replay(null, bufferSize, window, scheduler).refCount();
};
var ConnectableObservable = Rx.ConnectableObservable = (function (__super__) {
inherits(ConnectableObservable, __super__);
function ConnectableObservable(source, subject) {
var hasSubscription = false,
subscription,
sourceObservable = source.asObservable();
this.connect = function () {
if (!hasSubscription) {
hasSubscription = true;
subscription = new CompositeDisposable(sourceObservable.subscribe(subject), disposableCreate(function () {
hasSubscription = false;
}));
}
return subscription;
};
__super__.call(this, subject.subscribe.bind(subject));
}
ConnectableObservable.prototype.refCount = function () {
var connectableSubscription, count = 0, source = this;
return new AnonymousObservable(function (observer) {
var shouldConnect = ++count === 1,
subscription = source.subscribe(observer);
shouldConnect && (connectableSubscription = source.connect());
return function () {
subscription.dispose();
--count === 0 && connectableSubscription.dispose();
};
});
};
return ConnectableObservable;
}(Observable));
function observableTimerDate(dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithAbsolute(dueTime, function () {
observer.onNext(0);
observer.onCompleted();
});
});
}
function observableTimerDateAndPeriod(dueTime, period, scheduler) {
var p = normalizeTime(period);
return new AnonymousObservable(function (observer) {
var count = 0, d = dueTime;
return scheduler.scheduleRecursiveWithAbsolute(d, function (self) {
var now;
if (p > 0) {
now = scheduler.now();
d = d + p;
if (d <= now) {
d = now + p;
}
}
observer.onNext(count++);
self(d);
});
});
}
function observableTimerTimeSpan(dueTime, scheduler) {
var d = normalizeTime(dueTime);
return new AnonymousObservable(function (observer) {
return scheduler.scheduleWithRelative(d, function () {
observer.onNext(0);
observer.onCompleted();
});
});
}
function observableTimerTimeSpanAndPeriod(dueTime, period, scheduler) {
if (dueTime === period) {
return new AnonymousObservable(function (observer) {
return scheduler.schedulePeriodicWithState(0, period, function (count) {
observer.onNext(count);
return count + 1;
});
});
}
return observableDefer(function () {
return observableTimerDateAndPeriod(scheduler.now() + dueTime, period, scheduler);
});
}
/**
* Returns an observable sequence that produces a value after each period.
*
* @example
* 1 - res = Rx.Observable.interval(1000);
* 2 - res = Rx.Observable.interval(1000, Rx.Scheduler.timeout);
*
* @param {Number} period Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
* @returns {Observable} An observable sequence that produces a value after each period.
*/
var observableinterval = Observable.interval = function (period, scheduler) {
return observableTimerTimeSpanAndPeriod(period, period, isScheduler(scheduler) ? scheduler : timeoutScheduler);
};
/**
* Returns an observable sequence that produces a value after dueTime has elapsed and then after each period.
*
* @example
* 1 - res = Rx.Observable.timer(new Date());
* 2 - res = Rx.Observable.timer(new Date(), 1000);
* 3 - res = Rx.Observable.timer(new Date(), Rx.Scheduler.timeout);
* 4 - res = Rx.Observable.timer(new Date(), 1000, Rx.Scheduler.timeout);
*
* 5 - res = Rx.Observable.timer(5000);
* 6 - res = Rx.Observable.timer(5000, 1000);
* 7 - res = Rx.Observable.timer(5000, Rx.Scheduler.timeout);
* 8 - res = Rx.Observable.timer(5000, 1000, Rx.Scheduler.timeout);
*
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) at which to produce the first value.
* @param {Mixed} [periodOrScheduler] Period to produce subsequent values (specified as an integer denoting milliseconds), or the scheduler to run the timer on. If not specified, the resulting timer is not recurring.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence that produces a value after due time has elapsed and then each period.
*/
var observableTimer = Observable.timer = function (dueTime, periodOrScheduler, scheduler) {
var period;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'number') {
period = periodOrScheduler;
} else if (periodOrScheduler !== undefined && typeof periodOrScheduler === 'object') {
scheduler = periodOrScheduler;
}
if (dueTime instanceof Date && period === undefined) {
return observableTimerDate(dueTime.getTime(), scheduler);
}
if (dueTime instanceof Date && period !== undefined) {
period = periodOrScheduler;
return observableTimerDateAndPeriod(dueTime.getTime(), period, scheduler);
}
return period === undefined ?
observableTimerTimeSpan(dueTime, scheduler) :
observableTimerTimeSpanAndPeriod(dueTime, period, scheduler);
};
function observableDelayTimeSpan(source, dueTime, scheduler) {
return new AnonymousObservable(function (observer) {
var active = false,
cancelable = new SerialDisposable(),
exception = null,
q = [],
running = false,
subscription;
subscription = source.materialize().timestamp(scheduler).subscribe(function (notification) {
var d, shouldRun;
if (notification.value.kind === 'E') {
q = [];
q.push(notification);
exception = notification.value.exception;
shouldRun = !running;
} else {
q.push({ value: notification.value, timestamp: notification.timestamp + dueTime });
shouldRun = !active;
active = true;
}
if (shouldRun) {
if (exception !== null) {
observer.onError(exception);
} else {
d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(scheduler.scheduleRecursiveWithRelative(dueTime, function (self) {
var e, recurseDueTime, result, shouldRecurse;
if (exception !== null) {
return;
}
running = true;
do {
result = null;
if (q.length > 0 && q[0].timestamp - scheduler.now() <= 0) {
result = q.shift().value;
}
if (result !== null) {
result.accept(observer);
}
} while (result !== null);
shouldRecurse = false;
recurseDueTime = 0;
if (q.length > 0) {
shouldRecurse = true;
recurseDueTime = Math.max(0, q[0].timestamp - scheduler.now());
} else {
active = false;
}
e = exception;
running = false;
if (e !== null) {
observer.onError(e);
} else if (shouldRecurse) {
self(recurseDueTime);
}
}));
}
}
});
return new CompositeDisposable(subscription, cancelable);
});
}
function observableDelayDate(source, dueTime, scheduler) {
return observableDefer(function () {
return observableDelayTimeSpan(source, dueTime - scheduler.now(), scheduler);
});
}
/**
* Time shifts the observable sequence by dueTime. The relative time intervals between the values are preserved.
*
* @example
* 1 - res = Rx.Observable.delay(new Date());
* 2 - res = Rx.Observable.delay(new Date(), Rx.Scheduler.timeout);
*
* 3 - res = Rx.Observable.delay(5000);
* 4 - res = Rx.Observable.delay(5000, 1000, Rx.Scheduler.timeout);
* @memberOf Observable#
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) by which to shift the observable sequence.
* @param {Scheduler} [scheduler] Scheduler to run the delay timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delay = function (dueTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return dueTime instanceof Date ?
observableDelayDate(this, dueTime.getTime(), scheduler) :
observableDelayTimeSpan(this, dueTime, scheduler);
};
/**
* Ignores values from an observable sequence which are followed by another value before dueTime.
*
* @example
* 1 - res = source.throttle(5000); // 5 seconds
* 2 - res = source.throttle(5000, scheduler);
*
* @param {Number} dueTime Duration of the throttle period for each value (specified as an integer denoting milliseconds).
* @param {Scheduler} [scheduler] Scheduler to run the throttle timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The throttled sequence.
*/
observableProto.throttle = function (dueTime, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return this.throttleWithSelector(function () { return observableTimer(dueTime, scheduler); })
};
/**
* Records the timestamp for each value in an observable sequence.
*
* @example
* 1 - res = source.timestamp(); // produces { value: x, timestamp: ts }
* 2 - res = source.timestamp(Rx.Scheduler.timeout);
*
* @param {Scheduler} [scheduler] Scheduler used to compute timestamps. If not specified, the timeout scheduler is used.
* @returns {Observable} An observable sequence with timestamp information on values.
*/
observableProto.timestamp = function (scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return this.map(function (x) {
return { value: x, timestamp: scheduler.now() };
});
};
function sampleObservable(source, sampler) {
return new AnonymousObservable(function (observer) {
var atEnd, value, hasValue;
function sampleSubscribe() {
if (hasValue) {
hasValue = false;
observer.onNext(value);
}
atEnd && observer.onCompleted();
}
return new CompositeDisposable(
source.subscribe(function (newValue) {
hasValue = true;
value = newValue;
}, observer.onError.bind(observer), function () {
atEnd = true;
}),
sampler.subscribe(sampleSubscribe, observer.onError.bind(observer), sampleSubscribe)
);
});
}
/**
* Samples the observable sequence at each interval.
*
* @example
* 1 - res = source.sample(sampleObservable); // Sampler tick sequence
* 2 - res = source.sample(5000); // 5 seconds
* 2 - res = source.sample(5000, Rx.Scheduler.timeout); // 5 seconds
*
* @param {Mixed} intervalOrSampler Interval at which to sample (specified as an integer denoting milliseconds) or Sampler Observable.
* @param {Scheduler} [scheduler] Scheduler to run the sampling timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Sampled observable sequence.
*/
observableProto.sample = function (intervalOrSampler, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return typeof intervalOrSampler === 'number' ?
sampleObservable(this, observableinterval(intervalOrSampler, scheduler)) :
sampleObservable(this, intervalOrSampler);
};
/**
* Returns the source observable sequence or the other observable sequence if dueTime elapses.
*
* @example
* 1 - res = source.timeout(new Date()); // As a date
* 2 - res = source.timeout(5000); // 5 seconds
* 3 - res = source.timeout(new Date(), Rx.Observable.returnValue(42)); // As a date and timeout observable
* 4 - res = source.timeout(5000, Rx.Observable.returnValue(42)); // 5 seconds and timeout observable
* 5 - res = source.timeout(new Date(), Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // As a date and timeout observable
* 6 - res = source.timeout(5000, Rx.Observable.returnValue(42), Rx.Scheduler.timeout); // 5 seconds and timeout observable
*
* @param {Number} dueTime Absolute (specified as a Date object) or relative time (specified as an integer denoting milliseconds) when a timeout occurs.
* @param {Observable} [other] Sequence to return in case of a timeout. If not specified, a timeout error throwing sequence will be used.
* @param {Scheduler} [scheduler] Scheduler to run the timeout timers on. If not specified, the timeout scheduler is used.
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeout = function (dueTime, other, scheduler) {
other || (other = observableThrow(new Error('Timeout')));
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this, schedulerMethod = dueTime instanceof Date ?
'scheduleWithAbsolute' :
'scheduleWithRelative';
return new AnonymousObservable(function (observer) {
var id = 0,
original = new SingleAssignmentDisposable(),
subscription = new SerialDisposable(),
switched = false,
timer = new SerialDisposable();
subscription.setDisposable(original);
var createTimer = function () {
var myId = id;
timer.setDisposable(scheduler[schedulerMethod](dueTime, function () {
if (id === myId) {
isPromise(other) && (other = observableFromPromise(other));
subscription.setDisposable(other.subscribe(observer));
}
}));
};
createTimer();
original.setDisposable(source.subscribe(function (x) {
if (!switched) {
id++;
observer.onNext(x);
createTimer();
}
}, function (e) {
if (!switched) {
id++;
observer.onError(e);
}
}, function () {
if (!switched) {
id++;
observer.onCompleted();
}
}));
return new CompositeDisposable(subscription, timer);
});
};
/**
* Time shifts the observable sequence by delaying the subscription.
*
* @example
* 1 - res = source.delaySubscription(5000); // 5s
* 2 - res = source.delaySubscription(5000, Rx.Scheduler.timeout); // 5 seconds
*
* @param {Number} dueTime Absolute or relative time to perform the subscription at.
* @param {Scheduler} [scheduler] Scheduler to run the subscription delay timer on. If not specified, the timeout scheduler is used.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delaySubscription = function (dueTime, scheduler) {
return this.delayWithSelector(observableTimer(dueTime, isScheduler(scheduler) ? scheduler : timeoutScheduler), observableEmpty);
};
/**
* Time shifts the observable sequence based on a subscription delay and a delay selector function for each element.
*
* @example
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(5000); }); // with selector only
* 1 - res = source.delayWithSelector(Rx.Observable.timer(2000), function (x) { return Rx.Observable.timer(x); }); // with delay and selector
*
* @param {Observable} [subscriptionDelay] Sequence indicating the delay for the subscription to the source.
* @param {Function} delayDurationSelector Selector function to retrieve a sequence indicating the delay for each given element.
* @returns {Observable} Time-shifted sequence.
*/
observableProto.delayWithSelector = function (subscriptionDelay, delayDurationSelector) {
var source = this, subDelay, selector;
if (typeof subscriptionDelay === 'function') {
selector = subscriptionDelay;
} else {
subDelay = subscriptionDelay;
selector = delayDurationSelector;
}
return new AnonymousObservable(function (observer) {
var delays = new CompositeDisposable(), atEnd = false, done = function () {
if (atEnd && delays.length === 0) {
observer.onCompleted();
}
}, subscription = new SerialDisposable(), start = function () {
subscription.setDisposable(source.subscribe(function (x) {
var delay;
try {
delay = selector(x);
} catch (error) {
observer.onError(error);
return;
}
var d = new SingleAssignmentDisposable();
delays.add(d);
d.setDisposable(delay.subscribe(function () {
observer.onNext(x);
delays.remove(d);
done();
}, observer.onError.bind(observer), function () {
observer.onNext(x);
delays.remove(d);
done();
}));
}, observer.onError.bind(observer), function () {
atEnd = true;
subscription.dispose();
done();
}));
};
if (!subDelay) {
start();
} else {
subscription.setDisposable(subDelay.subscribe(function () {
start();
}, observer.onError.bind(observer), function () { start(); }));
}
return new CompositeDisposable(subscription, delays);
});
};
/**
* Returns the source observable sequence, switching to the other observable sequence if a timeout is signaled.
*
* @example
* 1 - res = source.timeoutWithSelector(Rx.Observable.timer(500));
* 2 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); });
* 3 - res = source.timeoutWithSelector(Rx.Observable.timer(500), function (x) { return Rx.Observable.timer(200); }, Rx.Observable.returnValue(42));
*
* @param {Observable} [firstTimeout] Observable sequence that represents the timeout for the first element. If not provided, this defaults to Observable.never().
* @param {Function} [timeoutDurationSelector] Selector to retrieve an observable sequence that represents the timeout between the current element and the next element.
* @param {Observable} [other] Sequence to return in case of a timeout. If not provided, this is set to Observable.throwException().
* @returns {Observable} The source sequence switching to the other sequence in case of a timeout.
*/
observableProto.timeoutWithSelector = function (firstTimeout, timeoutdurationSelector, other) {
if (arguments.length === 1) {
timeoutdurationSelector = firstTimeout;
var firstTimeout = observableNever();
}
other || (other = observableThrow(new Error('Timeout')));
var source = this;
return new AnonymousObservable(function (observer) {
var subscription = new SerialDisposable(), timer = new SerialDisposable(), original = new SingleAssignmentDisposable();
subscription.setDisposable(original);
var id = 0, switched = false, setTimer = function (timeout) {
var myId = id, timerWins = function () {
return id === myId;
};
var d = new SingleAssignmentDisposable();
timer.setDisposable(d);
d.setDisposable(timeout.subscribe(function () {
if (timerWins()) {
subscription.setDisposable(other.subscribe(observer));
}
d.dispose();
}, function (e) {
if (timerWins()) {
observer.onError(e);
}
}, function () {
if (timerWins()) {
subscription.setDisposable(other.subscribe(observer));
}
}));
};
setTimer(firstTimeout);
var observerWins = function () {
var res = !switched;
if (res) {
id++;
}
return res;
};
original.setDisposable(source.subscribe(function (x) {
if (observerWins()) {
observer.onNext(x);
var timeout;
try {
timeout = timeoutdurationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
setTimer(timeout);
}
}, function (e) {
if (observerWins()) {
observer.onError(e);
}
}, function () {
if (observerWins()) {
observer.onCompleted();
}
}));
return new CompositeDisposable(subscription, timer);
});
};
/**
* Ignores values from an observable sequence which are followed by another value within a computed throttle duration.
*
* @example
* 1 - res = source.delayWithSelector(function (x) { return Rx.Scheduler.timer(x + x); });
*
* @param {Function} throttleDurationSelector Selector function to retrieve a sequence indicating the throttle duration for each given element.
* @returns {Observable} The throttled sequence.
*/
observableProto.throttleWithSelector = function (throttleDurationSelector) {
var source = this;
return new AnonymousObservable(function (observer) {
var value, hasValue = false, cancelable = new SerialDisposable(), id = 0, subscription = source.subscribe(function (x) {
var throttle;
try {
throttle = throttleDurationSelector(x);
} catch (e) {
observer.onError(e);
return;
}
hasValue = true;
value = x;
id++;
var currentid = id, d = new SingleAssignmentDisposable();
cancelable.setDisposable(d);
d.setDisposable(throttle.subscribe(function () {
if (hasValue && id === currentid) {
observer.onNext(value);
}
hasValue = false;
d.dispose();
}, observer.onError.bind(observer), function () {
if (hasValue && id === currentid) {
observer.onNext(value);
}
hasValue = false;
d.dispose();
}));
}, function (e) {
cancelable.dispose();
observer.onError(e);
hasValue = false;
id++;
}, function () {
cancelable.dispose();
if (hasValue) {
observer.onNext(value);
}
observer.onCompleted();
hasValue = false;
id++;
});
return new CompositeDisposable(subscription, cancelable);
});
};
/**
* Skips elements for the specified duration from the end of the observable source sequence, using the specified scheduler to run timers.
*
* 1 - res = source.skipLastWithTime(5000);
* 2 - res = source.skipLastWithTime(5000, scheduler);
*
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for skipping elements from the end of the sequence.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the end of the source sequence.
*/
observableProto.skipLastWithTime = function (duration, scheduler) {
isScheduler(scheduler) || (scheduler = timeoutScheduler);
var source = this;
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
observer.onNext(q.shift().value);
}
}, observer.onError.bind(observer), function () {
var now = scheduler.now();
while (q.length > 0 && now - q[0].interval >= duration) {
observer.onNext(q.shift().value);
}
observer.onCompleted();
});
});
};
/**
* Returns elements within the specified duration from the end of the observable source sequence, using the specified schedulers to run timers and to drain the collected elements.
*
* @example
* 1 - res = source.takeLastWithTime(5000, [optional timer scheduler], [optional loop scheduler]);
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the end of the sequence.
* @param {Scheduler} [scheduler] Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the end of the source sequence.
*/
observableProto.takeLastWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var q = [];
return source.subscribe(function (x) {
var now = scheduler.now();
q.push({ interval: now, value: x });
while (q.length > 0 && now - q[0].interval >= duration) {
q.shift();
}
}, observer.onError.bind(observer), function () {
var now = scheduler.now();
while (q.length > 0) {
var next = q.shift();
if (now - next.interval <= duration) {
observer.onNext(next.value);
}
}
observer.onCompleted();
});
});
};
/**
* Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.takeWithTime(5000, [optional scheduler]);
* @description
* This operator accumulates a queue with a length enough to store elements received during the initial duration window.
* As more elements are received, elements older than the specified duration are taken from the queue and produced on the
* result sequence. This causes elements to be delayed with duration.
* @param {Number} duration Duration for taking elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements taken during the specified duration from the start of the source sequence.
*/
observableProto.takeWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
return new CompositeDisposable(scheduler.scheduleWithRelative(duration, observer.onCompleted.bind(observer)), source.subscribe(observer));
});
};
/**
* Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers.
*
* @example
* 1 - res = source.skipWithTime(5000, [optional scheduler]);
*
* @description
* Specifying a zero value for duration doesn't guarantee no elements will be dropped from the start of the source sequence.
* This is a side-effect of the asynchrony introduced by the scheduler, where the action that causes callbacks from the source sequence to be forwarded
* may not execute immediately, despite the zero due time.
*
* Errors produced by the source sequence are always forwarded to the result sequence, even if the error occurs before the duration.
* @param {Number} duration Duration for skipping elements from the start of the sequence.
* @param {Scheduler} scheduler Scheduler to run the timer on. If not specified, defaults to Rx.Scheduler.timeout.
* @returns {Observable} An observable sequence with the elements skipped during the specified duration from the start of the source sequence.
*/
observableProto.skipWithTime = function (duration, scheduler) {
var source = this;
isScheduler(scheduler) || (scheduler = timeoutScheduler);
return new AnonymousObservable(function (observer) {
var open = false;
return new CompositeDisposable(
scheduler.scheduleWithRelative(duration, function () { open = true; }),
source.subscribe(function (x) { open && observer.onNext(x); }, observer.onError.bind(observer), observer.onCompleted.bind(observer)));
});
};
var PausableObservable = (function (_super) {
inherits(PausableObservable, _super);
function subscribe(observer) {
var conn = this.source.publish(),
subscription = conn.subscribe(observer),
connection = disposableEmpty;
var pausable = this.subject.distinctUntilChanged().subscribe(function (b) {
if (b) {
connection = conn.connect();
} else {
connection.dispose();
connection = disposableEmpty;
}
});
return new CompositeDisposable(subscription, connection, pausable);
}
function PausableObservable(source, subject) {
this.source = source;
this.subject = subject || new Subject();
this.isPaused = true;
_super.call(this, subscribe);
}
PausableObservable.prototype.pause = function () {
if (this.isPaused === true){
return;
}
this.isPaused = true;
this.subject.onNext(false);
};
PausableObservable.prototype.resume = function () {
if (this.isPaused === false){
return;
}
this.isPaused = false;
this.subject.onNext(true);
};
return PausableObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausable(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausable = function (pauser) {
return new PausableObservable(this, pauser);
};
function combineLatestSource(source, subject, resultSelector) {
return new AnonymousObservable(function (observer) {
var n = 2,
hasValue = [false, false],
hasValueAll = false,
isDone = false,
values = new Array(n);
function next(x, i) {
values[i] = x
var res;
hasValue[i] = true;
if (hasValueAll || (hasValueAll = hasValue.every(identity))) {
try {
res = resultSelector.apply(null, values);
} catch (ex) {
observer.onError(ex);
return;
}
observer.onNext(res);
} else if (isDone) {
observer.onCompleted();
}
}
return new CompositeDisposable(
source.subscribe(
function (x) {
next(x, 0);
},
observer.onError.bind(observer),
function () {
isDone = true;
observer.onCompleted();
}),
subject.subscribe(
function (x) {
next(x, 1);
},
observer.onError.bind(observer))
);
});
}
var PausableBufferedObservable = (function (_super) {
inherits(PausableBufferedObservable, _super);
function subscribe(observer) {
var q = [], previous = true;
var subscription =
combineLatestSource(
this.source,
this.subject.distinctUntilChanged(),
function (data, shouldFire) {
return { data: data, shouldFire: shouldFire };
})
.subscribe(
function (results) {
if (results.shouldFire && previous) {
observer.onNext(results.data);
}
if (results.shouldFire && !previous) {
while (q.length > 0) {
observer.onNext(q.shift());
}
previous = true;
} else if (!results.shouldFire && !previous) {
q.push(results.data);
} else if (!results.shouldFire && previous) {
previous = false;
}
},
function (err) {
// Empty buffer before sending error
while (q.length > 0) {
observer.onNext(q.shift());
}
observer.onError(err);
},
function () {
// Empty buffer before sending completion
while (q.length > 0) {
observer.onNext(q.shift());
}
observer.onCompleted();
}
);
this.subject.onNext(false);
return subscription;
}
function PausableBufferedObservable(source, subject) {
this.source = source;
this.subject = subject || new Subject();
this.isPaused = true;
_super.call(this, subscribe);
}
PausableBufferedObservable.prototype.pause = function () {
if (this.isPaused === true){
return;
}
this.isPaused = true;
this.subject.onNext(false);
};
PausableBufferedObservable.prototype.resume = function () {
if (this.isPaused === false){
return;
}
this.isPaused = false;
this.subject.onNext(true);
};
return PausableBufferedObservable;
}(Observable));
/**
* Pauses the underlying observable sequence based upon the observable sequence which yields true/false,
* and yields the values that were buffered while paused.
* @example
* var pauser = new Rx.Subject();
* var source = Rx.Observable.interval(100).pausableBuffered(pauser);
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.pausableBuffered = function (subject) {
return new PausableBufferedObservable(this, subject);
};
/**
* Attaches a controller to the observable sequence with the ability to queue.
* @example
* var source = Rx.Observable.interval(100).controlled();
* source.request(3); // Reads 3 values
* @param {Observable} pauser The observable sequence used to pause the underlying sequence.
* @returns {Observable} The observable sequence which is paused based upon the pauser.
*/
observableProto.controlled = function (enableQueue) {
if (enableQueue == null) { enableQueue = true; }
return new ControlledObservable(this, enableQueue);
};
var ControlledObservable = (function (_super) {
inherits(ControlledObservable, _super);
function subscribe (observer) {
return this.source.subscribe(observer);
}
function ControlledObservable (source, enableQueue) {
_super.call(this, subscribe);
this.subject = new ControlledSubject(enableQueue);
this.source = source.multicast(this.subject).refCount();
}
ControlledObservable.prototype.request = function (numberOfItems) {
if (numberOfItems == null) { numberOfItems = -1; }
return this.subject.request(numberOfItems);
};
return ControlledObservable;
}(Observable));
var ControlledSubject = Rx.ControlledSubject = (function (_super) {
function subscribe (observer) {
return this.subject.subscribe(observer);
}
inherits(ControlledSubject, _super);
function ControlledSubject(enableQueue) {
if (enableQueue == null) {
enableQueue = true;
}
_super.call(this, subscribe);
this.subject = new Subject();
this.enableQueue = enableQueue;
this.queue = enableQueue ? [] : null;
this.requestedCount = 0;
this.requestedDisposable = disposableEmpty;
this.error = null;
this.hasFailed = false;
this.hasCompleted = false;
this.controlledDisposable = disposableEmpty;
}
addProperties(ControlledSubject.prototype, Observer, {
onCompleted: function () {
checkDisposed.call(this);
this.hasCompleted = true;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onCompleted();
}
},
onError: function (error) {
checkDisposed.call(this);
this.hasFailed = true;
this.error = error;
if (!this.enableQueue || this.queue.length === 0) {
this.subject.onError(error);
}
},
onNext: function (value) {
checkDisposed.call(this);
var hasRequested = false;
if (this.requestedCount === 0) {
if (this.enableQueue) {
this.queue.push(value);
}
} else {
if (this.requestedCount !== -1) {
if (this.requestedCount-- === 0) {
this.disposeCurrentRequest();
}
}
hasRequested = true;
}
if (hasRequested) {
this.subject.onNext(value);
}
},
_processRequest: function (numberOfItems) {
if (this.enableQueue) {
//console.log('queue length', this.queue.length);
while (this.queue.length >= numberOfItems && numberOfItems > 0) {
//console.log('number of items', numberOfItems);
this.subject.onNext(this.queue.shift());
numberOfItems--;
}
if (this.queue.length !== 0) {
return { numberOfItems: numberOfItems, returnValue: true };
} else {
return { numberOfItems: numberOfItems, returnValue: false };
}
}
if (this.hasFailed) {
this.subject.onError(this.error);
this.controlledDisposable.dispose();
this.controlledDisposable = disposableEmpty;
} else if (this.hasCompleted) {
this.subject.onCompleted();
this.controlledDisposable.dispose();
this.controlledDisposable = disposableEmpty;
}
return { numberOfItems: numberOfItems, returnValue: false };
},
request: function (number) {
checkDisposed.call(this);
this.disposeCurrentRequest();
var self = this,
r = this._processRequest(number);
number = r.numberOfItems;
if (!r.returnValue) {
this.requestedCount = number;
this.requestedDisposable = disposableCreate(function () {
self.requestedCount = 0;
});
return this.requestedDisposable
} else {
return disposableEmpty;
}
},
disposeCurrentRequest: function () {
this.requestedDisposable.dispose();
this.requestedDisposable = disposableEmpty;
},
dispose: function () {
this.isDisposed = true;
this.error = null;
this.subject.dispose();
this.requestedDisposable.dispose();
}
});
return ControlledSubject;
}(Observable));
/*
* Performs a exclusive waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @returns {Observable} A exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusive = function () {
var sources = this;
return new AnonymousObservable(function (observer) {
var hasCurrent = false,
isStopped = false,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
var innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
innerSubscription.setDisposable(innerSource.subscribe(
observer.onNext.bind(observer),
observer.onError.bind(observer),
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
observer.onError.bind(observer),
function () {
isStopped = true;
if (!hasCurrent && g.length === 1) {
observer.onCompleted();
}
}));
return g;
});
};
/*
* Performs a exclusive map waiting for the first to finish before subscribing to another observable.
* Observables that come in between subscriptions will be dropped on the floor.
* @param {Function} selector Selector to invoke for every item in the current subscription.
* @param {Any} [thisArg] An optional context to invoke with the selector parameter.
* @returns {Observable} An exclusive observable with only the results that happen when subscribed.
*/
observableProto.exclusiveMap = function (selector, thisArg) {
var sources = this;
return new AnonymousObservable(function (observer) {
var index = 0,
hasCurrent = false,
isStopped = true,
m = new SingleAssignmentDisposable(),
g = new CompositeDisposable();
g.add(m);
m.setDisposable(sources.subscribe(
function (innerSource) {
if (!hasCurrent) {
hasCurrent = true;
innerSubscription = new SingleAssignmentDisposable();
g.add(innerSubscription);
isPromise(innerSource) && (innerSource = observableFromPromise(innerSource));
innerSubscription.setDisposable(innerSource.subscribe(
function (x) {
var result;
try {
result = selector.call(thisArg, x, index++, innerSource);
} catch (e) {
observer.onError(e);
return;
}
observer.onNext(result);
},
observer.onError.bind(observer),
function () {
g.remove(innerSubscription);
hasCurrent = false;
if (isStopped && g.length === 1) {
observer.onCompleted();
}
}));
}
},
observer.onError.bind(observer),
function () {
isStopped = true;
if (g.length === 1 && !hasCurrent) {
observer.onCompleted();
}
}));
return g;
});
};
var AnonymousObservable = Rx.AnonymousObservable = (function (__super__) {
inherits(AnonymousObservable, __super__);
// Fix subscriber to check for undefined or function returned to decorate as Disposable
function fixSubscriber(subscriber) {
if (subscriber && typeof subscriber.dispose === 'function') { return subscriber; }
return typeof subscriber === 'function' ?
disposableCreate(subscriber) :
disposableEmpty;
}
function AnonymousObservable(subscribe) {
if (!(this instanceof AnonymousObservable)) {
return new AnonymousObservable(subscribe);
}
function s(observer) {
var setDisposable = function () {
try {
autoDetachObserver.setDisposable(fixSubscriber(subscribe(autoDetachObserver)));
} catch (e) {
if (!autoDetachObserver.fail(e)) {
throw e;
}
}
};
var autoDetachObserver = new AutoDetachObserver(observer);
if (currentThreadScheduler.scheduleRequired()) {
currentThreadScheduler.schedule(setDisposable);
} else {
setDisposable();
}
return autoDetachObserver;
}
__super__.call(this, s);
}
return AnonymousObservable;
}(Observable));
/** @private */
var AutoDetachObserver = (function (_super) {
inherits(AutoDetachObserver, _super);
function AutoDetachObserver(observer) {
_super.call(this);
this.observer = observer;
this.m = new SingleAssignmentDisposable();
}
var AutoDetachObserverPrototype = AutoDetachObserver.prototype;
AutoDetachObserverPrototype.next = function (value) {
var noError = false;
try {
this.observer.onNext(value);
noError = true;
} catch (e) {
throw e;
} finally {
if (!noError) {
this.dispose();
}
}
};
AutoDetachObserverPrototype.error = function (exn) {
try {
this.observer.onError(exn);
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.completed = function () {
try {
this.observer.onCompleted();
} catch (e) {
throw e;
} finally {
this.dispose();
}
};
AutoDetachObserverPrototype.setDisposable = function (value) { this.m.setDisposable(value); };
AutoDetachObserverPrototype.getDisposable = function (value) { return this.m.getDisposable(); };
/* @private */
AutoDetachObserverPrototype.disposable = function (value) {
return arguments.length ? this.getDisposable() : setDisposable(value);
};
AutoDetachObserverPrototype.dispose = function () {
_super.prototype.dispose.call(this);
this.m.dispose();
};
return AutoDetachObserver;
}(AbstractObserver));
/** @private */
var InnerSubscription = function (subject, observer) {
this.subject = subject;
this.observer = observer;
};
/**
* @private
* @memberOf InnerSubscription
*/
InnerSubscription.prototype.dispose = function () {
if (!this.subject.isDisposed && this.observer !== null) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
this.observer = null;
}
};
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed observers.
*/
var Subject = Rx.Subject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
if (this.exception) {
observer.onError(this.exception);
return disposableEmpty;
}
observer.onCompleted();
return disposableEmpty;
}
inherits(Subject, _super);
/**
* Creates a subject.
* @constructor
*/
function Subject() {
_super.call(this, subscribe);
this.isDisposed = false,
this.isStopped = false,
this.observers = [];
}
addProperties(Subject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (exception) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = exception;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(exception);
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
for (var i = 0, len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
/**
* Creates a subject from the specified observer and observable.
* @param {Observer} observer The observer used to send messages to the subject.
* @param {Observable} observable The observable used to subscribe to messages sent from the subject.
* @returns {Subject} Subject implemented using the given observer and observable.
*/
Subject.create = function (observer, observable) {
return new AnonymousSubject(observer, observable);
};
return Subject;
}(Observable));
/**
* Represents the result of an asynchronous operation.
* The last value before the OnCompleted notification, or the error received through OnError, is sent to all subscribed observers.
*/
var AsyncSubject = Rx.AsyncSubject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
return new InnerSubscription(this, observer);
}
var ex = this.exception,
hv = this.hasValue,
v = this.value;
if (ex) {
observer.onError(ex);
} else if (hv) {
observer.onNext(v);
observer.onCompleted();
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(AsyncSubject, _super);
/**
* Creates a subject that can only receive one value and that value is cached for all future observations.
* @constructor
*/
function AsyncSubject() {
_super.call(this, subscribe);
this.isDisposed = false;
this.isStopped = false;
this.value = null;
this.hasValue = false;
this.observers = [];
this.exception = null;
}
addProperties(AsyncSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
checkDisposed.call(this);
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence, also causing the last received value to be sent out (if any).
*/
onCompleted: function () {
var o, i, len;
checkDisposed.call(this);
if (!this.isStopped) {
this.isStopped = true;
var os = this.observers.slice(0),
v = this.value,
hv = this.hasValue;
if (hv) {
for (i = 0, len = os.length; i < len; i++) {
o = os[i];
o.onNext(v);
o.onCompleted();
}
} else {
for (i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (exception) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = exception;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(exception);
}
this.observers = [];
}
},
/**
* Sends a value to the subject. The last value received before successful termination will be sent to all subscribed and future observers.
* @param {Mixed} value The value to store in the subject.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
this.value = value;
this.hasValue = true;
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.exception = null;
this.value = null;
}
});
return AsyncSubject;
}(Observable));
var AnonymousSubject = Rx.AnonymousSubject = (function (__super__) {
inherits(AnonymousSubject, __super__);
function AnonymousSubject(observer, observable) {
this.observer = observer;
this.observable = observable;
__super__.call(this, this.observable.subscribe.bind(this.observable));
}
addProperties(AnonymousSubject.prototype, Observer, {
onCompleted: function () {
this.observer.onCompleted();
},
onError: function (exception) {
this.observer.onError(exception);
},
onNext: function (value) {
this.observer.onNext(value);
}
});
return AnonymousSubject;
}(Observable));
/**
* Represents a value that changes over time.
* Observers can subscribe to the subject to receive the last (or initial) value and all subsequent notifications.
*/
var BehaviorSubject = Rx.BehaviorSubject = (function (_super) {
function subscribe(observer) {
checkDisposed.call(this);
if (!this.isStopped) {
this.observers.push(observer);
observer.onNext(this.value);
return new InnerSubscription(this, observer);
}
var ex = this.exception;
if (ex) {
observer.onError(ex);
} else {
observer.onCompleted();
}
return disposableEmpty;
}
inherits(BehaviorSubject, _super);
/**
* @constructor
* Initializes a new instance of the BehaviorSubject class which creates a subject that caches its last value and starts with the specified value.
* @param {Mixed} value Initial value sent to observers when no other value has been received by the subject yet.
*/
function BehaviorSubject(value) {
_super.call(this, subscribe);
this.value = value,
this.observers = [],
this.isDisposed = false,
this.isStopped = false,
this.exception = null;
}
addProperties(BehaviorSubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onCompleted();
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
checkDisposed.call(this);
if (!this.isStopped) {
var os = this.observers.slice(0);
this.isStopped = true;
this.exception = error;
for (var i = 0, len = os.length; i < len; i++) {
os[i].onError(error);
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
checkDisposed.call(this);
if (!this.isStopped) {
this.value = value;
var os = this.observers.slice(0);
for (var i = 0, len = os.length; i < len; i++) {
os[i].onNext(value);
}
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
this.value = null;
this.exception = null;
}
});
return BehaviorSubject;
}(Observable));
/**
* Represents an object that is both an observable sequence as well as an observer.
* Each notification is broadcasted to all subscribed and future observers, subject to buffer trimming policies.
*/
var ReplaySubject = Rx.ReplaySubject = (function (_super) {
function RemovableDisposable (subject, observer) {
this.subject = subject;
this.observer = observer;
};
RemovableDisposable.prototype.dispose = function () {
this.observer.dispose();
if (!this.subject.isDisposed) {
var idx = this.subject.observers.indexOf(this.observer);
this.subject.observers.splice(idx, 1);
}
};
function subscribe(observer) {
var so = new ScheduledObserver(this.scheduler, observer),
subscription = new RemovableDisposable(this, so);
checkDisposed.call(this);
this._trim(this.scheduler.now());
this.observers.push(so);
var n = this.q.length;
for (var i = 0, len = this.q.length; i < len; i++) {
so.onNext(this.q[i].value);
}
if (this.hasError) {
n++;
so.onError(this.error);
} else if (this.isStopped) {
n++;
so.onCompleted();
}
so.ensureActive(n);
return subscription;
}
inherits(ReplaySubject, _super);
/**
* Initializes a new instance of the ReplaySubject class with the specified buffer size, window size and scheduler.
* @param {Number} [bufferSize] Maximum element count of the replay buffer.
* @param {Number} [windowSize] Maximum time length of the replay buffer.
* @param {Scheduler} [scheduler] Scheduler the observers are invoked on.
*/
function ReplaySubject(bufferSize, windowSize, scheduler) {
this.bufferSize = bufferSize == null ? Number.MAX_VALUE : bufferSize;
this.windowSize = windowSize == null ? Number.MAX_VALUE : windowSize;
this.scheduler = scheduler || currentThreadScheduler;
this.q = [];
this.observers = [];
this.isStopped = false;
this.isDisposed = false;
this.hasError = false;
this.error = null;
_super.call(this, subscribe);
}
addProperties(ReplaySubject.prototype, Observer, {
/**
* Indicates whether the subject has observers subscribed to it.
* @returns {Boolean} Indicates whether the subject has observers subscribed to it.
*/
hasObservers: function () {
return this.observers.length > 0;
},
/* @private */
_trim: function (now) {
while (this.q.length > this.bufferSize) {
this.q.shift();
}
while (this.q.length > 0 && (now - this.q[0].interval) > this.windowSize) {
this.q.shift();
}
},
/**
* Notifies all subscribed observers about the arrival of the specified element in the sequence.
* @param {Mixed} value The value to send to all observers.
*/
onNext: function (value) {
var observer;
checkDisposed.call(this);
if (!this.isStopped) {
var now = this.scheduler.now();
this.q.push({ interval: now, value: value });
this._trim(now);
var o = this.observers.slice(0);
for (var i = 0, len = o.length; i < len; i++) {
observer = o[i];
observer.onNext(value);
observer.ensureActive();
}
}
},
/**
* Notifies all subscribed observers about the exception.
* @param {Mixed} error The exception to send to all observers.
*/
onError: function (error) {
var observer;
checkDisposed.call(this);
if (!this.isStopped) {
this.isStopped = true;
this.error = error;
this.hasError = true;
var now = this.scheduler.now();
this._trim(now);
var o = this.observers.slice(0);
for (var i = 0, len = o.length; i < len; i++) {
observer = o[i];
observer.onError(error);
observer.ensureActive();
}
this.observers = [];
}
},
/**
* Notifies all subscribed observers about the end of the sequence.
*/
onCompleted: function () {
var observer;
checkDisposed.call(this);
if (!this.isStopped) {
this.isStopped = true;
var now = this.scheduler.now();
this._trim(now);
var o = this.observers.slice(0);
for (var i = 0, len = o.length; i < len; i++) {
observer = o[i];
observer.onCompleted();
observer.ensureActive();
}
this.observers = [];
}
},
/**
* Unsubscribe all observers and release resources.
*/
dispose: function () {
this.isDisposed = true;
this.observers = null;
}
});
return ReplaySubject;
}(Observable));
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
root.Rx = Rx;
define(function() {
return Rx;
});
} else if (freeExports && freeModule) {
// in Node.js or RingoJS
if (moduleExports) {
(freeModule.exports = Rx).Rx = Rx;
} else {
freeExports.Rx = Rx;
}
} else {
// in a browser or Rhino
root.Rx = Rx;
}
}.call(this)); | zhangbg/cdnjs | ajax/libs/rxjs/2.3.4/rx.lite.compat.js | JavaScript | mit | 228,973 |
var fs = require('fs'),
path = require('path'),
util = require('util');
const modern = /^v0\.1\d\.\d+/.test(process.version);
module.exports = ncp;
ncp.ncp = ncp;
function ncp (source, dest, options, callback) {
var cback = callback;
if (!callback) {
cback = options;
options = {};
}
var basePath = process.cwd(),
currentPath = path.resolve(basePath, source),
targetPath = path.resolve(basePath, dest),
filter = options.filter,
rename = options.rename,
transform = options.transform,
clobber = options.clobber !== false,
modified = options.modified,
dereference = options.dereference,
errs = null,
eventName = modern ? 'finish' : 'close',
defer = modern ? setImmediate : process.nextTick,
started = 0,
finished = 0,
running = 0,
limit = options.limit || ncp.limit || 16;
limit = (limit < 1) ? 1 : (limit > 512) ? 512 : limit;
startCopy(currentPath);
function startCopy(source) {
started++;
if (filter) {
if (filter instanceof RegExp) {
if (!filter.test(source)) {
return cb(true);
}
}
else if (typeof filter === 'function') {
if (!filter(source)) {
return cb(true);
}
}
}
return getStats(source);
}
function getStats(source) {
var stat = dereference ? fs.stat : fs.lstat;
if (running >= limit) {
return defer(function () {
getStats(source);
});
}
running++;
stat(source, function (err, stats) {
var item = {};
if (err) {
return onError(err);
}
// We need to get the mode from the stats object and preserve it.
item.name = source;
item.mode = stats.mode;
item.mtime = stats.mtime; //modified time
item.atime = stats.atime; //access time
if (stats.isDirectory()) {
return onDir(item);
}
else if (stats.isFile()) {
return onFile(item);
}
else if (stats.isSymbolicLink()) {
// Symlinks don't really need to know about the mode.
return onLink(source);
}
});
}
function onFile(file) {
var target = file.name.replace(currentPath, targetPath);
if(rename) {
target = rename(target);
}
isWritable(target, function (writable) {
if (writable) {
return copyFile(file, target);
}
if(clobber) {
rmFile(target, function () {
copyFile(file, target);
});
}
if (modified) {
var stat = dereference ? fs.stat : fs.lstat;
stat(target, function(err, stats) {
//if souce modified time greater to target modified time copy file
if (file.mtime.getTime()>stats.mtime.getTime())
copyFile(file, target);
else return cb();
});
}
else {
return cb();
}
});
}
function copyFile(file, target) {
var readStream = fs.createReadStream(file.name),
writeStream = fs.createWriteStream(target, { mode: file.mode });
readStream.on('error', onError);
writeStream.on('error', onError);
if(transform) {
transform(readStream, writeStream, file);
} else {
writeStream.on('open', function() {
readStream.pipe(writeStream);
});
}
writeStream.once(eventName, function() {
if (modified) {
//target file modified date sync.
fs.utimesSync(target, file.atime, file.mtime);
cb();
}
else cb();
});
}
function rmFile(file, done) {
fs.unlink(file, function (err) {
if (err) {
return onError(err);
}
return done();
});
}
function onDir(dir) {
var target = dir.name.replace(currentPath, targetPath);
isWritable(target, function (writable) {
if (writable) {
return mkDir(dir, target);
}
copyDir(dir.name);
});
}
function mkDir(dir, target) {
fs.mkdir(target, dir.mode, function (err) {
if (err) {
return onError(err);
}
copyDir(dir.name);
});
}
function copyDir(dir) {
fs.readdir(dir, function (err, items) {
if (err) {
return onError(err);
}
items.forEach(function (item) {
startCopy(dir + '/' + item);
});
return cb();
});
}
function onLink(link) {
var target = link.replace(currentPath, targetPath);
fs.readlink(link, function (err, resolvedPath) {
if (err) {
return onError(err);
}
checkLink(resolvedPath, target);
});
}
function checkLink(resolvedPath, target) {
if (dereference) {
resolvedPath = path.resolve(basePath, resolvedPath);
}
isWritable(target, function (writable) {
if (writable) {
return makeLink(resolvedPath, target);
}
fs.readlink(target, function (err, targetDest) {
if (err) {
return onError(err);
}
if (dereference) {
targetDest = path.resolve(basePath, targetDest);
}
if (targetDest === resolvedPath) {
return cb();
}
return rmFile(target, function () {
makeLink(resolvedPath, target);
});
});
});
}
function makeLink(linkPath, target) {
fs.symlink(linkPath, target, function (err) {
if (err) {
return onError(err);
}
return cb();
});
}
function isWritable(path, done) {
fs.lstat(path, function (err) {
if (err) {
if (err.code === 'ENOENT') return done(true);
return done(false);
}
return done(false);
});
}
function onError(err) {
if (options.stopOnError) {
return cback(err);
}
else if (!errs && options.errs) {
errs = fs.createWriteStream(options.errs);
}
else if (!errs) {
errs = [];
}
if (typeof errs.write === 'undefined') {
errs.push(err);
}
else {
errs.write(err.stack + '\n\n');
}
return cb();
}
function cb(skipped) {
if (!skipped) running--;
finished++;
if ((started === finished) && (running === 0)) {
if (cback !== undefined ) {
return errs ? cback(errs) : cback(null);
}
}
}
}
| grdmunoz/peopleplusplus | node_modules/karma-phantomjs-launcher/node_modules/phantomjs/node_modules/ncp/lib/ncp.js | JavaScript | mit | 6,288 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Tests\Extension\Validator\ViolationMapper;
use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\FormError;
use Symfony\Component\PropertyAccess\PropertyPath;
use Symfony\Component\Validator\ConstraintViolation;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class ViolationMapperTest extends \PHPUnit_Framework_TestCase
{
const LEVEL_0 = 0;
const LEVEL_1 = 1;
const LEVEL_1B = 2;
const LEVEL_2 = 3;
/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
private $dispatcher;
/**
* @var ViolationMapper
*/
private $mapper;
/**
* @var string
*/
private $message;
/**
* @var string
*/
private $messageTemplate;
/**
* @var array
*/
private $params;
protected function setUp()
{
if (!class_exists('Symfony\Component\EventDispatcher\Event')) {
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
$this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
$this->mapper = new ViolationMapper();
$this->message = 'Message';
$this->messageTemplate = 'Message template';
$this->params = array('foo' => 'bar');
}
protected function getForm($name = 'name', $propertyPath = null, $dataClass = null, $errorMapping = array(), $inheritData = false, $synchronized = true)
{
$config = new FormConfigBuilder($name, $dataClass, $this->dispatcher, array(
'error_mapping' => $errorMapping,
));
$config->setMapped(true);
$config->setInheritData($inheritData);
$config->setPropertyPath($propertyPath);
$config->setCompound(true);
$config->setDataMapper($this->getDataMapper());
if (!$synchronized) {
$config->addViewTransformer(new CallbackTransformer(
function ($normData) { return $normData; },
function () { throw new TransformationFailedException(); }
));
}
return new Form($config);
}
/**
* @return \PHPUnit_Framework_MockObject_MockObject
*/
private function getDataMapper()
{
return $this->getMock('Symfony\Component\Form\DataMapperInterface');
}
/**
* @param $propertyPath
*
* @return ConstraintViolation
*/
protected function getConstraintViolation($propertyPath)
{
return new ConstraintViolation($this->message, $this->messageTemplate, $this->params, null, $propertyPath, null);
}
/**
* @return FormError
*/
protected function getFormError()
{
return new FormError($this->message, $this->messageTemplate, $this->params);
}
public function testMapToFormInheritingParentDataIfDataDoesNotMatch()
{
$violation = $this->getConstraintViolation('children[address].data.foo');
$parent = $this->getForm('parent');
$child = $this->getForm('address', 'address', null, array(), true);
$grandChild = $this->getForm('street');
$parent->add($child);
$child->add($grandChild);
$this->mapper->mapViolation($violation, $parent);
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $child->getName().' should have an error, but has none');
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName().' should not have an error, but has one');
}
public function testFollowDotRules()
{
$violation = $this->getConstraintViolation('data.foo');
$parent = $this->getForm('parent', null, null, array(
'foo' => 'address',
));
$child = $this->getForm('address', null, null, array(
'.' => 'street',
));
$grandChild = $this->getForm('street', null, null, array(
'.' => 'name',
));
$grandGrandChild = $this->getForm('name');
$parent->add($child);
$child->add($grandChild);
$grandChild->add($grandGrandChild);
$this->mapper->mapViolation($violation, $parent);
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $child->getName().' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName().' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $grandGrandChild->getErrors(), $grandGrandChild->getName().' should have an error, but has none');
}
public function testAbortMappingIfNotSynchronized()
{
$violation = $this->getConstraintViolation('children[address].data.street');
$parent = $this->getForm('parent');
$child = $this->getForm('address', 'address', null, array(), false, false);
// even though "street" is synchronized, it should not have any errors
// due to its parent not being synchronized
$grandChild = $this->getForm('street' , 'street');
$parent->add($child);
$child->add($grandChild);
// submit to invoke the transformer and mark the form unsynchronized
$parent->submit(array());
$this->mapper->mapViolation($violation, $parent);
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $child->getName().' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName().' should not have an error, but has one');
}
public function testAbortDotRuleMappingIfNotSynchronized()
{
$violation = $this->getConstraintViolation('data.address');
$parent = $this->getForm('parent');
$child = $this->getForm('address', 'address', null, array(
'.' => 'street',
), false, false);
// even though "street" is synchronized, it should not have any errors
// due to its parent not being synchronized
$grandChild = $this->getForm('street');
$parent->add($child);
$child->add($grandChild);
// submit to invoke the transformer and mark the form unsynchronized
$parent->submit(array());
$this->mapper->mapViolation($violation, $parent);
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $child->getName().' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChild->getName().' should not have an error, but has one');
}
public function provideDefaultTests()
{
// The mapping must be deterministic! If a child has the property path "[street]",
// "data[street]" should be mapped, but "data.street" should not!
return array(
// mapping target, child name, its property path, grand child name, its property path, violation path
array(self::LEVEL_0, 'address', 'address', 'street', 'street', ''),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.address.street'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.address.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'data.address[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'data.address[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address].data'),
array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'children[address].data[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'data.address.street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'data.address.street.prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'data.address[street]'),
array(self::LEVEL_2, 'address', 'address', 'street', '[street]', 'data.address[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address].street'),
array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address].street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address][street]'),
array(self::LEVEL_0, 'address', 'address', 'street', '[street]', 'data[address][street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address].data'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address.street'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address.street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address[street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'street', 'data.address[street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'data[address].street'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'street', 'data[address].street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'data[address][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'data[address][street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address].data'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address.street'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address.street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address[street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[street]', 'data.address[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'data[address].street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'data[address].street.prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'data[address][street]'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[street]', 'data[address][street].prop'),
array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'children[address].data'),
array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'data.person.address.street'),
array(self::LEVEL_2, 'address', 'person.address', 'street', 'street', 'data.person.address.street.prop'),
array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'data.person.address[street]'),
array(self::LEVEL_1, 'address', 'person.address', 'street', 'street', 'data.person.address[street].prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address].street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address].street.prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address][street]'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.person[address][street].prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address.street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address.street.prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address[street]'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person].address[street].prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address].street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address].street.prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address][street]'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'children[address].data'),
array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'children[address].data[street].prop'),
array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'data.person.address.street'),
array(self::LEVEL_1, 'address', 'person.address', 'street', '[street]', 'data.person.address.street.prop'),
array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'data.person.address[street]'),
array(self::LEVEL_2, 'address', 'person.address', 'street', '[street]', 'data.person.address[street].prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address].street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address].street.prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address][street]'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data.person[address][street].prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address.street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address.street.prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address[street]'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person].address[street].prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address].street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address].street.prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address][street]'),
array(self::LEVEL_0, 'address', 'person.address', 'street', '[street]', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'children[address].data'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address.street'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address.street.prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address[street]'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data.person.address[street].prop'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'data.person[address].street'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', 'street', 'data.person[address].street.prop'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'data.person[address][street]'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', 'street', 'data.person[address][street].prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address.street'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address.street.prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address[street]'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person].address[street].prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address].street'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address].street.prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address][street]'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', 'street', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'children[address].data'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address.street'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address.street.prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address[street]'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data.person.address[street].prop'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'data.person[address].street'),
array(self::LEVEL_1, 'address', 'person[address]', 'street', '[street]', 'data.person[address].street.prop'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'data.person[address][street]'),
array(self::LEVEL_2, 'address', 'person[address]', 'street', '[street]', 'data.person[address][street].prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address.street'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address.street.prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address[street]'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person].address[street].prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address].street'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address].street.prop'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address][street]'),
array(self::LEVEL_0, 'address', 'person[address]', 'street', '[street]', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'children[address].data'),
array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address.street'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address.street.prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address[street]'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person.address[street].prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address].street'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address].street.prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address][street]'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data.person[address][street].prop'),
array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'data[person].address.street'),
array(self::LEVEL_2, 'address', '[person].address', 'street', 'street', 'data[person].address.street.prop'),
array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'data[person].address[street]'),
array(self::LEVEL_1, 'address', '[person].address', 'street', 'street', 'data[person].address[street].prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address].street'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address].street.prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address][street]'),
array(self::LEVEL_0, 'address', '[person].address', 'street', 'street', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'children[address].data'),
array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address.street'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address.street.prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address[street]'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person.address[street].prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address].street'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address].street.prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address][street]'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data.person[address][street].prop'),
array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'data[person].address.street'),
array(self::LEVEL_1, 'address', '[person].address', 'street', '[street]', 'data[person].address.street.prop'),
array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'data[person].address[street]'),
array(self::LEVEL_2, 'address', '[person].address', 'street', '[street]', 'data[person].address[street].prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address].street'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address].street.prop'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address][street]'),
array(self::LEVEL_0, 'address', '[person].address', 'street', '[street]', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address]'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address].data'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address.street'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address.street.prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address[street]'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person.address[street].prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address].street'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address].street.prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address][street]'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data.person[address][street].prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address.street'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address.street.prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address[street]'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', 'street', 'data[person].address[street].prop'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'data[person][address].street'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', 'street', 'data[person][address].street.prop'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'data[person][address][street]'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', 'street', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'children[address].data'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'children[address].data[street].prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address.street'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address.street.prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address[street]'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person.address[street].prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address].street'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address].street.prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address][street]'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data.person[address][street].prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address.street'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address.street.prop'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address[street]'),
array(self::LEVEL_0, 'address', '[person][address]', 'street', '[street]', 'data[person].address[street].prop'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'data[person][address].street'),
array(self::LEVEL_1, 'address', '[person][address]', 'street', '[street]', 'data[person][address].street.prop'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'data[person][address][street]'),
array(self::LEVEL_2, 'address', '[person][address]', 'street', '[street]', 'data[person][address][street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.office'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].data.office.street'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'children[address].data.office.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.office[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office].street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office].street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data[office][street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'data.address.office.street'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office.street', 'data.address.office.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address.office[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address.office[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office].street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office].street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address[office][street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office.street'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office.street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office[street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address].office[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office].street'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office].street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office][street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office.street', 'data[address][office][street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data.office'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].data.office.street'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'children[address].data.office.street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data.office[street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office].street'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office].street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'children[address].data[office][street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office.street'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office.street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office[street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address.office[street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office].street'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office].street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office][street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office.street', 'data.address[office][street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'data[address].office.street'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office.street', 'data[address].office.street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address].office[street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address].office[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office].street'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office].street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office.street', 'data[address][office][street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data.office'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data.office.street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data.office.street.prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].data.office[street]'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office].street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office].street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'children[address].data[office][street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address.office.street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address.office.street.prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'data.address.office[street]'),
array(self::LEVEL_2, 'address', 'address', 'street', 'office[street]', 'data.address.office[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office].street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office].street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office[street]', 'data.address[office][street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office.street'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office.street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office[street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address].office[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office].street'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office].street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office][street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'office[street]', 'data[address][office][street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office.street'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office.street.prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office[street]'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office].street'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office].street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'children[address].data[office][street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office.street'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office.street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office[street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address.office[street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office].street'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office].street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office][street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', 'office[street]', 'data.address[office][street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address].office.street'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address].office.street.prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'data[address].office[street]'),
array(self::LEVEL_2, 'address', '[address]', 'street', 'office[street]', 'data[address].office[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office].street'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office].street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'office[street]', 'data[address][office][street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office.street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data[office]'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].data[office].street'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'children[address].data[office].street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data[office][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'children[address].data[office][street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office.street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address.office[street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'data.address[office].street'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office].street', 'data.address[office].street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address[office][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office].street', 'data.address[office][street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office.street'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office.street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office[street]'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address].office[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office].street'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office].street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office][street]'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office].street', 'data[address][office][street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office.street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office.street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office[street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data[office]'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].data[office].street'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'children[address].data[office].street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data[office][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'children[address].data[office][street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office.street'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office.street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office[street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address.office[street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office].street'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office].street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office][street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office].street', 'data.address[office][street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office.street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office.street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office[street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address].office[street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'data[address][office].street'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office].street', 'data[address][office].street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address][office][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office].street', 'data[address][office][street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office.street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data[office]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data[office].street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'children[address].data[office].street.prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].data[office][street]'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'children[address].data[office][street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office.street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address.office[street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address[office].street'),
array(self::LEVEL_1, 'address', 'address', 'street', '[office][street]', 'data.address[office].street.prop'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'data.address[office][street]'),
array(self::LEVEL_2, 'address', 'address', 'street', '[office][street]', 'data.address[office][street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office.street'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office.street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office[street]'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address].office[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office].street'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office].street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office][street]'),
array(self::LEVEL_0, 'address', 'address', 'street', '[office][street]', 'data[address][office][street].prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office.street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office.street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office[street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data.office[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office].street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office].street.prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office][street]'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'children[address].data[office][street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office.street'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office.street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office[street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address.office[street].prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office].street'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office].street.prop'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office][street]'),
array(self::LEVEL_0, 'address', '[address]', 'street', '[office][street]', 'data.address[office][street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office.street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office.street.prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office[street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address].office[street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address][office].street'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[office][street]', 'data[address][office].street.prop'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'data[address][office][street]'),
array(self::LEVEL_2, 'address', '[address]', 'street', '[office][street]', 'data[address][office][street].prop'),
// Edge cases which must not occur
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address][street].prop'),
array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address][street]'),
array(self::LEVEL_1, 'address', 'address', 'street', '[street]', 'children[address][street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', 'street', 'children[address][street].prop'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address][street]'),
array(self::LEVEL_1, 'address', '[address]', 'street', '[street]', 'children[address][street].prop'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'children[person].children[address].children[street]'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'children[person].children[address].data.street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'children[person].data.address.street'),
array(self::LEVEL_0, 'address', 'person.address', 'street', 'street', 'data.address.street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].children[office].children[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].children[office].data.street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'children[address].data.street'),
array(self::LEVEL_1, 'address', 'address', 'street', 'office.street', 'data.address.street'),
);
}
/**
* @dataProvider provideDefaultTests
*/
public function testDefaultErrorMapping($target, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath)
{
$violation = $this->getConstraintViolation($violationPath);
$parent = $this->getForm('parent');
$child = $this->getForm($childName, $childPath);
$grandChild = $this->getForm($grandChildName, $grandChildPath);
$parent->add($child);
$child->add($grandChild);
$this->mapper->mapViolation($violation, $parent);
if (self::LEVEL_0 === $target) {
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName().' should have an error, but has none');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} elseif (self::LEVEL_1 === $target) {
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName.' should have an error, but has none');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} else {
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName.' should have an error, but has none');
}
}
public function provideCustomDataErrorTests()
{
return array(
// mapping target, error mapping, child name, its property path, grand child name, its property path, violation path
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo]'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo].prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address]'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address].prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo]'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address.prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address]'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address].prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo.street'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo[street]'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.foo[street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo].street'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo].street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo][street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[foo][street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address.street'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address[street]'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', 'street', 'data.address[street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address].street'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address].street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address][street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', 'street', 'data[address][street].prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street]'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street].prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address.street'),
array(self::LEVEL_1, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address.street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address[street]'),
array(self::LEVEL_2, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data.address[street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address].street'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address].street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address][street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', 'address', 'street', '[street]', 'data[address][street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street]'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address.street'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address.street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address[street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.address[street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address].street'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address].street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address][street]'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[address][street].prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street]'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street].prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street]'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street].prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street].prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address.street'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address.street.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address[street]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.address[street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address].street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address].street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address][street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[address][street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[street].prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].street.prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street]'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][street].prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address.street'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address.street.prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address[street]'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data.address[street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address].street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address].street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address][street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', '[street]', 'data[address][street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street].prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address.street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address.street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address[street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data.address[street].prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address].street'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address].street.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address][street]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', 'street', 'data[address][street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo.street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.foo[street].prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo].street.prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street]'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[foo][street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address.street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data.address[street].prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street'),
array(self::LEVEL_1, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address].street.prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street]'),
array(self::LEVEL_2, '[foo]', 'address', 'address', '[address]', 'street', '[street]', 'data[address][street].prop'),
array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'),
array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'),
array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'),
array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'),
array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'),
array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar]'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'),
array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar]'),
array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'),
array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'),
array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'),
array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'),
array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'),
array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'),
array(self::LEVEL_1, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'),
array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'),
array(self::LEVEL_2, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'),
array(self::LEVEL_0, 'foo.bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'),
array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'),
array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'),
array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'),
array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'),
array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'),
array(self::LEVEL_1, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'),
array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'),
array(self::LEVEL_2, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'),
array(self::LEVEL_0, 'foo[bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'),
array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'),
array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'),
array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'),
array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'),
array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'),
array(self::LEVEL_1, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'),
array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'),
array(self::LEVEL_2, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'),
array(self::LEVEL_0, '[foo].bar', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar.street.prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street]'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo.bar[street].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar].street.prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street]'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data.foo[bar][street].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar.street.prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street]'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo].bar[street].prop'),
array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street'),
array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar].street.prop'),
array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street]'),
array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', 'street', 'data[foo][bar][street].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar.street.prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street]'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo.bar[street].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar].street.prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street]'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data.foo[bar][street].prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar.street.prop'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street]'),
array(self::LEVEL_0, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo].bar[street].prop'),
array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street'),
array(self::LEVEL_1, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar].street.prop'),
array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street]'),
array(self::LEVEL_2, '[foo][bar]', 'address', 'address', 'address', 'street', '[street]', 'data[foo][bar][street].prop'),
array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', 'street', 'data.foo'),
array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', 'street', 'data.foo.prop'),
array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo]'),
array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo].prop'),
array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo'),
array(self::LEVEL_2, 'foo', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo.prop'),
array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo]'),
array(self::LEVEL_2, '[foo]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo].prop'),
array(self::LEVEL_2, 'foo', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo'),
array(self::LEVEL_2, 'foo', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo.prop'),
array(self::LEVEL_2, '[foo]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo]'),
array(self::LEVEL_2, '[foo]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo].prop'),
array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', 'street', 'data.foo.bar'),
array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', 'street', 'data.foo.bar.prop'),
array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', 'street', 'data.foo[bar]'),
array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', 'street', 'data.foo[bar].prop'),
array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', 'street', 'data[foo].bar'),
array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', 'street', 'data[foo].bar.prop'),
array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo][bar]'),
array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', 'street', 'data[foo][bar].prop'),
array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo.bar'),
array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo.bar.prop'),
array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo[bar]'),
array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data.foo[bar].prop'),
array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo].bar'),
array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo].bar.prop'),
array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo][bar]'),
array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', 'address', 'street', '[street]', 'data[foo][bar].prop'),
array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo.bar'),
array(self::LEVEL_2, 'foo.bar', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo.bar.prop'),
array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo[bar]'),
array(self::LEVEL_2, 'foo[bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data.foo[bar].prop'),
array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo].bar'),
array(self::LEVEL_2, '[foo].bar', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo].bar.prop'),
array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo][bar]'),
array(self::LEVEL_2, '[foo][bar]', 'address.street', 'address', '[address]', 'street', 'street', 'data[foo][bar].prop'),
// Edge cases
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street'),
array(self::LEVEL_2, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street]'),
array(self::LEVEL_1, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data.foo[street].prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo].street.prop'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street]'),
array(self::LEVEL_0, 'foo', 'address', 'address', '[address]', 'street', 'street', 'data[foo][street].prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo.street.prop'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street]'),
array(self::LEVEL_0, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data.foo[street].prop'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street'),
array(self::LEVEL_2, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo].street.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street]'),
array(self::LEVEL_1, '[foo]', 'address', 'address', 'address', 'street', 'street', 'data[foo][street].prop'),
);
}
/**
* @dataProvider provideCustomDataErrorTests
*/
public function testCustomDataErrorMapping($target, $mapFrom, $mapTo, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath)
{
$violation = $this->getConstraintViolation($violationPath);
$parent = $this->getForm('parent', null, null, array($mapFrom => $mapTo));
$child = $this->getForm($childName, $childPath);
$grandChild = $this->getForm($grandChildName, $grandChildPath);
$parent->add($child);
$child->add($grandChild);
// Add a field mapped to the first element of $mapFrom
// to try to distract the algorithm
// Only add it if we expect the error to come up on a different
// level than LEVEL_0, because in this case the error would
// (correctly) be mapped to the distraction field
if ($target !== self::LEVEL_0) {
$mapFromPath = new PropertyPath($mapFrom);
$mapFromPrefix = $mapFromPath->isIndex(0)
? '['.$mapFromPath->getElement(0).']'
: $mapFromPath->getElement(0);
$distraction = $this->getForm('distraction', $mapFromPrefix);
$parent->add($distraction);
}
$this->mapper->mapViolation($violation, $parent);
if ($target !== self::LEVEL_0) {
$this->assertCount(0, $distraction->getErrors(), 'distraction should not have an error, but has one');
}
if (self::LEVEL_0 === $target) {
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName().' should have an error, but has none');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} elseif (self::LEVEL_1 === $target) {
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName.' should have an error, but has none');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} else {
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName.' should have an error, but has none');
}
}
public function provideCustomFormErrorTests()
{
// This case is different than the data errors, because here the
// left side of the mapping refers to the property path of the actual
// children. In other words, a child error only works if
// 1) the error actually maps to an existing child and
// 2) the property path of that child (relative to the form providing
// the mapping) matches the left side of the mapping
return array(
// mapping target, map from, map to, child name, its property path, grand child name, its property path, violation path
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street]'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street].prop'),
// Property path of the erroneous field and mapping must match exactly
array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'),
array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'),
array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street'),
array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'),
array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street]'),
array(self::LEVEL_1B, 'foo', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'),
array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'),
array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'),
array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street'),
array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'),
array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street]'),
array(self::LEVEL_1B, '[foo]', 'address', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'),
array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data'),
array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].children[street].data.prop'),
array(self::LEVEL_2, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street'),
array(self::LEVEL_2, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data.street.prop'),
array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street]'),
array(self::LEVEL_1, '[foo]', 'address', 'foo', '[foo]', 'address', 'address', 'street', 'street', 'children[foo].data[street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].children[street].data'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].children[street].data.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data.street'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data.street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data[street]'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo].data[street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street].prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].children[street].data'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].children[street].data.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data.street'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data[street]'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo].data[street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].children[street].data'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].children[street].data.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data.street'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data.street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data[street]'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo].data[street].prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street].data'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street].data.prop'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street.prop'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'foo', 'address', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street].prop'),
// Map to a nested child
array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[foo]'),
array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[foo]'),
array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[foo]'),
array(self::LEVEL_2, 'foo', 'address.street', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[foo]'),
// Map from a nested child
array(self::LEVEL_1B, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_1B, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1B, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_2, 'address.street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1B, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1B, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1B, 'address[street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_2, 'address[street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_1B, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_1B, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1B, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_2, '[address].street', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', 'address', 'street', '[street]', 'children[address].data[street]'),
array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].children[street]'),
array(self::LEVEL_2, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_1B, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1B, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].children[street]'),
array(self::LEVEL_1, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data.street'),
array(self::LEVEL_1B, '[address][street]', 'foo', 'foo', 'foo', 'address', '[address]', 'street', '[street]', 'children[address].data[street]'),
);
}
/**
* @dataProvider provideCustomFormErrorTests
*/
public function testCustomFormErrorMapping($target, $mapFrom, $mapTo, $errorName, $errorPath, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath)
{
$violation = $this->getConstraintViolation($violationPath);
$parent = $this->getForm('parent', null, null, array($mapFrom => $mapTo));
$child = $this->getForm($childName, $childPath);
$grandChild = $this->getForm($grandChildName, $grandChildPath);
$errorChild = $this->getForm($errorName, $errorPath);
$parent->add($child);
$parent->add($errorChild);
$child->add($grandChild);
$this->mapper->mapViolation($violation, $parent);
if (self::LEVEL_0 === $target) {
$this->assertCount(0, $errorChild->getErrors(), $errorName.' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName().' should have an error, but has none');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} elseif (self::LEVEL_1 === $target) {
$this->assertCount(0, $errorChild->getErrors(), $errorName.' should not have an error, but has one');
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName.' should have an error, but has none');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} elseif (self::LEVEL_1B === $target) {
$this->assertEquals(array($this->getFormError()), $errorChild->getErrors(), $errorName.' should have an error, but has none');
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} else {
$this->assertCount(0, $errorChild->getErrors(), $errorName.' should not have an error, but has one');
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName.' should have an error, but has none');
}
}
public function provideErrorTestsForFormInheritingParentData()
{
return array(
// mapping target, child name, its property path, grand child name, its property path, violation path
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].children[street].data.prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'children[address].data.street.prop'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street]'),
array(self::LEVEL_1, 'address', 'address', 'street', 'street', 'children[address].data[street].prop'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.street'),
array(self::LEVEL_2, 'address', 'address', 'street', 'street', 'data.street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address.street'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address.street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address[street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data.address[street].prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address].street.prop'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street]'),
array(self::LEVEL_0, 'address', 'address', 'street', 'street', 'data[address][street].prop'),
);
}
/**
* @dataProvider provideErrorTestsForFormInheritingParentData
*/
public function testErrorMappingForFormInheritingParentData($target, $childName, $childPath, $grandChildName, $grandChildPath, $violationPath)
{
$violation = $this->getConstraintViolation($violationPath);
$parent = $this->getForm('parent');
$child = $this->getForm($childName, $childPath, null, array(), true);
$grandChild = $this->getForm($grandChildName, $grandChildPath);
$parent->add($child);
$child->add($grandChild);
$this->mapper->mapViolation($violation, $parent);
if (self::LEVEL_0 === $target) {
$this->assertEquals(array($this->getFormError()), $parent->getErrors(), $parent->getName().' should have an error, but has none');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} elseif (self::LEVEL_1 === $target) {
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $child->getErrors(), $childName.' should have an error, but has none');
$this->assertCount(0, $grandChild->getErrors(), $grandChildName.' should not have an error, but has one');
} else {
$this->assertCount(0, $parent->getErrors(), $parent->getName().' should not have an error, but has one');
$this->assertCount(0, $child->getErrors(), $childName.' should not have an error, but has one');
$this->assertEquals(array($this->getFormError()), $grandChild->getErrors(), $grandChildName.' should have an error, but has none');
}
}
}
| sivler/cassiopeia | vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php | PHP | mit | 142,668 |
(function(){function d(a,b){try{for(var c in b)Object.defineProperty(a.prototype,c,{value:b[c],enumerable:!1})}catch(d){a.prototype=b}}function f(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function g(a){return Array.prototype.slice.call(a)}function j(){}function m(a){return a}function n(){return this}function o(){return!0}function p(a){return typeof a=="function"?a:function(){return a}}function q(a,b,c){return function(){var d=c.apply(b,arguments);return arguments.length?a:d}}function r(a){return a!=null&&!isNaN(a)}function s(a){return a.length}function u(a){return a==null}function v(a){return a.trim().replace(/\s+/g," ")}function w(a){var b=1;while(a*b%1)b*=10;return b}function z(){}function A(a){function d(){var c=b,d=-1,e=c.length,f;while(++d<e)(f=c[d].on)&&f.apply(this,arguments);return a}var b=[],c=new j;return d.on=function(d,e){var f=c.get(d),g;return arguments.length<2?f&&f.on:(f&&(f.on=null,b=b.slice(0,g=b.indexOf(f)).concat(b.slice(g+1)),c.remove(d)),e&&b.push(c.set(d,{on:e})),a)},d}function D(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function E(a){return a+""}function F(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function H(a,b){var c=Math.pow(10,Math.abs(8-b)*3);return{scale:b>8?function(a){return a/c}:function(a){return a*c},symbol:a}}function N(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function O(a){return function(b){return 1-a(1-b)}}function P(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function Q(a){return a}function R(a){return function(b){return Math.pow(b,a)}}function S(a){return 1-Math.cos(a*Math.PI/2)}function T(a){return Math.pow(2,10*(a-1))}function U(a){return 1-Math.sqrt(1-a*a)}function V(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function W(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function X(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function Y(){d3.event.stopPropagation(),d3.event.preventDefault()}function Z(){var a=d3.event,b;while(b=a.sourceEvent)a=b;return a}function $(a){var b=new z,c=0,d=arguments.length;while(++c<d)b[arguments[c]]=A(b);return b.of=function(c,d){return function(e){try{var f=e.sourceEvent=d3.event;e.target=a,d3.event=e,b[e.type].apply(c,d)}finally{d3.event=f}}},b}function _(a){var b=[a.a,a.b],c=[a.c,a.d],d=bb(b),e=ba(b,c),f=bb(bc(c,b,-e))||0;b[0]*c[1]<c[0]*b[1]&&(b[0]*=-1,b[1]*=-1,d*=-1,e*=-1),this.rotate=(d?Math.atan2(b[1],b[0]):Math.atan2(-c[0],c[1]))*bd,this.translate=[a.e,a.f],this.scale=[d,f],this.skew=f?Math.atan2(e,f)*bd:0}function ba(a,b){return a[0]*b[0]+a[1]*b[1]}function bb(a){var b=Math.sqrt(ba(a,a));return b&&(a[0]/=b,a[1]/=b),b}function bc(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function bg(a){return a=="transform"?d3.interpolateTransform:d3.interpolate}function bh(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function bi(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function bj(a,b,c){return new bk(a,b,c)}function bk(a,b,c){this.r=a,this.g=b,this.b=c}function bl(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function bm(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(bq(h[0]),bq(h[1]),bq(h[2]))}}return(i=br.get(a))?b(i.r,i.g,i.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16)),b(d,e,f))}function bn(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;return f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0,bs(g,h,i)}function bo(a,b,c){a=bp(a),b=bp(b),c=bp(c);var d=bH((.4124564*a+.3575761*b+.1804375*c)/bB),e=bH((.2126729*a+.7151522*b+.072175*c)/bC),f=bH((.0193339*a+.119192*b+.9503041*c)/bD);return by(116*e-16,500*(d-e),200*(e-f))}function bp(a){return(a/=255)<=.04045?a/12.92:Math.pow((a+.055)/1.055,2.4)}function bq(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function bs(a,b,c){return new bt(a,b,c)}function bt(a,b,c){this.h=a,this.s=b,this.l=c}function bu(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}function g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,bj(g(a+120),g(a),g(a-120))}function bv(a,b,c){return new bw(a,b,c)}function bw(a,b,c){this.h=a,this.c=b,this.l=c}function bx(a,b,c){return by(c,Math.cos(a*=Math.PI/180)*b,Math.sin(a)*b)}function by(a,b,c){return new bz(a,b,c)}function bz(a,b,c){this.l=a,this.a=b,this.b=c}function bE(a,b,c){var d=(a+16)/116,e=d+b/500,f=d-c/200;return e=bG(e)*bB,d=bG(d)*bC,f=bG(f)*bD,bj(bI(3.2404542*e-1.5371385*d-.4985314*f),bI(-0.969266*e+1.8760108*d+.041556*f),bI(.0556434*e-.2040259*d+1.0572252*f))}function bF(a,b,c){return bv(Math.atan2(c,b)/Math.PI*180,Math.sqrt(b*b+c*c),a)}function bG(a){return a>.206893034?a*a*a:(a-4/29)/7.787037}function bH(a){return a>.008856?Math.pow(a,1/3):7.787037*a+4/29}function bI(a){return Math.round(255*(a<=.00304?12.92*a:1.055*Math.pow(a,1/2.4)-.055))}function bJ(a){return i(a,bP),a}function bQ(a){return function(){return bK(a,this)}}function bR(a){return function(){return bL(a,this)}}function bS(a,b){function c(){this.removeAttribute(a)}function d(){this.removeAttributeNS(a.space,a.local)}function e(){this.setAttribute(a,b)}function f(){this.setAttributeNS(a.space,a.local,b)}function g(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}return a=d3.ns.qualify(a),b==null?a.local?d:c:typeof b=="function"?a.local?h:g:a.local?f:e}function bT(a){return new RegExp("(?:^|\\s+)"+d3.requote(a)+"(?:\\s+|$)","g")}function bU(a,b){function d(){var d=-1;while(++d<c)a[d](this,b)}function e(){var d=-1,e=b.apply(this,arguments);while(++d<c)a[d](this,e)}a=a.trim().split(/\s+/).map(bV);var c=a.length;return typeof b=="function"?e:d}function bV(a){var b=bT(a);return function(c,d){if(e=c.classList)return d?e.add(a):e.remove(a);var e=c.className,f=e.baseVal!=null,g=f?e.baseVal:e;d?(b.lastIndex=0,b.test(g)||(g=v(g+" "+a),f?e.baseVal=g:c.className=g)):g&&(g=v(g.replace(b," ")),f?e.baseVal=g:c.className=g)}}function bW(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return b==null?d:typeof b=="function"?f:e}function bX(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return b==null?c:typeof b=="function"?e:d}function bY(a){return{__data__:a}}function bZ(a){return function(){return bO(this,a)}}function b$(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function b_(a,b,c){function f(){var b=this[d];b&&(this.removeEventListener(a,b,b.$),delete this[d])}function g(){function h(a){var c=d3.event;d3.event=a,g[0]=e.__data__;try{b.apply(e,g)}finally{d3.event=c}}var e=this,g=arguments;f.call(this),this.addEventListener(a,this[d]=h,h.$=c),h._=b}var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),b?g:f}function ca(a,b){for(var c=0,d=a.length;c<d;c++)for(var e=a[c],f=0,g=e.length,h;f<g;f++)(h=e[f])&&b(h,f,c);return a}function cc(a){return i(a,cd),a}function ce(a,b,c){i(a,cf);var d=new j,e=d3.dispatch("start","end"),f=cn;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d.get(b):(c==null?d.remove(b):d.set(b,c),a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?co.call(a,b):(e.on(b,c),a)},d3.timer(function(g){return ca(a,function(a,h,i){function o(f){return m.active>b?q():(m.active=b,d.forEach(function(b,c){(c=c.call(a,n,h))&&j.push(c)}),e.start.call(a,n,h),p(f)||d3.timer(p,0,c),1)}function p(c){if(m.active!==b)return q();var d=(c-k)/l,g=f(d),i=j.length;while(i>0)j[--i].call(a,g);if(d>=1)return q(),ch=b,e.end.call(a,n,h),ch=0,1}function q(){return--m.count||delete a.__transition__,1}var j=[],k=a.delay,l=a.duration,m=(a=a.node).__transition__||(a.__transition__={active:0,count:0}),n=a.__data__;++m.count,k<=g?o(g):d3.timer(o,k,c)})},0,c),a}function co(a){var b=ch,c=cn,d=cl,e=cm;return ch=this.id,cn=this.ease(),ca(this,function(b,c,d){cl=b.delay,cm=b.duration,a.call(b=b.node,b.__data__,c,d)}),ch=b,cn=c,cl=d,cm=e,this}function cq(a,b,c){return c!=""&&cp}function cr(a,b){return d3.tween(a,bg(b))}function cv(){var a,b=Date.now(),c=cs;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=cw()-b;d>24?(isFinite(d)&&(clearTimeout(cu),cu=setTimeout(cv,d)),ct=0):(ct=1,cx(cv))}function cw(){var a=null,b=cs,c=Infinity;while(b)b.flush?b=a?a.next=b.next:cs=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function cz(a,b){var c=a.ownerSVGElement||a;if(c.createSVGPoint){var d=c.createSVGPoint();if(cy<0&&(window.scrollX||window.scrollY)){c=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var e=c[0][0].getScreenCTM();cy=!e.f&&!e.e,c.remove()}return cy?(d.x=b.pageX,d.y=b.pageY):(d.x=b.clientX,d.y=b.clientY),d=d.matrixTransform(a.getScreenCTM().inverse()),[d.x,d.y]}var f=a.getBoundingClientRect();return[b.clientX-f.left-a.clientLeft,b.clientY-f.top-a.clientTop]}function cA(){}function cB(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function cC(a){return a.rangeExtent?a.rangeExtent():cB(a.range())}function cD(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(b=b(f-e))a[c]=b.floor(e),a[d]=b.ceil(f);return a}function cE(){return Math}function cF(a,b,c,d){function g(){var g=Math.min(a.length,b.length)>2?cM:cL,i=d?bi:bh;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return cJ(a,b)},h.tickFormat=function(b){return cK(a,b)},h.nice=function(){return cD(a,cH),g()},h.copy=function(){return cF(a,b,c,d)},g()}function cG(a,b){return d3.rebind(a,b,"range","rangeRound","interpolate","clamp")}function cH(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),a&&{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function cI(a,b){var c=cB(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function cJ(a,b){return d3.range.apply(d3,cI(a,b))}function cK(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(cI(a,b)[2])/Math.LN10+.01))+"f")}function cL(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function cM(a,b,c,d){var e=[],f=[],g=0,h=Math.min(a.length,b.length)-1;a[h]<a[0]&&(a=a.slice().reverse(),b=b.slice().reverse());while(++g<=h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,h)-1;return f[c](e[c](b))}}function cN(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=function(e){return arguments.length?(b=e[0]<0?cQ:cP,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(cD(a.domain(),cE)),d},d.ticks=function(){var d=cB(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=c(d[0]),i=c(d[1]);if(b===cQ){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=cO);if(arguments.length<1)return e;var f=Math.max(.1,a/d.ticks().length),g=b===cQ?(h=-1e-12,Math.floor):(h=1e-12,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<=f?e(a):""}},d.copy=function(){return cN(a.copy(),b)},cG(d,a)}function cP(a){return Math.log(a<0?0:a)/Math.LN10}function cQ(a){return-Math.log(a>0?0:-a)/Math.LN10}function cR(a,b){function e(b){return a(c(b))}var c=cS(b),d=cS(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return cJ(e.domain(),a)},e.tickFormat=function(a){return cK(e.domain(),a)},e.nice=function(){return e.domain(cD(e.domain(),cH))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=cS(b=a),d=cS(1/b),e.domain(f)},e.copy=function(){return cR(a.copy(),b)},cG(e,a)}function cS(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function cT(a,b){function f(b){return d[((c.get(b)||c.set(b,a.push(b)))-1)%d.length]}function g(b,c){return d3.range(a.length).map(function(a){return b+c*a})}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c=new j;var e=-1,g=d.length,h;while(++e<g)c.has(h=d[e])||c.set(h,a.push(h));return f[b.t].apply(f,b.a)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",a:arguments},f):d},f.rangePoints=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=(j-i)/(a.length-1+h);return d=g(a.length<2?(i+j)/2:i+k*h/2,k),e=0,b={t:"rangePoints",a:arguments},f},f.rangeBands=function(c,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=c[1]<c[0],k=c[j-0],l=c[1-j],m=(l-k)/(a.length-h+2*i);return d=g(k+m*i,m),j&&d.reverse(),e=m*(1-h),b={t:"rangeBands",a:arguments},f},f.rangeRoundBands=function(c,h,i){arguments.length<2&&(h=0),arguments.length<3&&(i=h);var j=c[1]<c[0],k=c[j-0],l=c[1-j],m=Math.floor((l-k)/(a.length-h+2*i)),n=l-k-(a.length-h)*m;return d=g(k+Math.round(n/2),m),j&&d.reverse(),e=Math.round(m*(1-h)),b={t:"rangeRoundBands",a:arguments},f},f.rangeBand=function(){return e},f.rangeExtent=function(){return cB(b.a[0])},f.copy=function(){return cT(a,b)},f.domain(a)}function cY(a,b){function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return cY(a,b)},d()}function cZ(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return cZ(a,b,c)},g()}function c$(a,b){function c(c){return b[d3.bisect(a,c)]}return c.domain=function(b){return arguments.length?(a=b,c):a},c.range=function(a){return arguments.length?(b=a,c):b},c.copy=function(){return c$(a,b)},c}function c_(a){function b(a){return+a}return b.invert=b,b.domain=b.range=function(c){return arguments.length?(a=c.map(b),b):a},b.ticks=function(b){return cJ(a,b)},b.tickFormat=function(b){return cK(a,b)},b.copy=function(){return c_(a)},b}function dc(a){return a.innerRadius}function dd(a){return a.outerRadius}function de(a){return a.startAngle}function df(a){return a.endAngle}function dg(a){function h(f){function o(){h.push("M",e(a(i),g))}var h=[],i=[],j=-1,k=f.length,l,m=p(b),n=p(c);while(++j<k)d.call(this,l=f[j],j)?i.push([+m.call(this,l,j),+n.call(this,l,j)]):i.length&&(o(),i=[]);return i.length&&o(),h.length?h.join(""):null}var b=dh,c=di,d=o,e=dk,f=e.key,g=.7;return h.x=function(a){return arguments.length?(b=a,h):b},h.y=function(a){return arguments.length?(c=a,h):c},h.defined=function(a){return arguments.length?(d=a,h):d},h.interpolate=function(a){return arguments.length?(typeof a=="function"?f=e=a:f=(e=dj.get(a)||dk).key,h):f},h.tension=function(a){return arguments.length?(g=a,h):g},h}function dh(a){return a[0]}function di(a){return a[1]}function dk(a){return a.join("L")}function dl(a){return dk(a)+"Z"}function dm(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function dn(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function dp(a,b){return a.length<4?dk(a):a[1]+ds(a.slice(1,a.length-1),dt(a,b))}function dq(a,b){return a.length<3?dk(a):a[0]+ds((a.push(a[0]),a),dt([a[a.length-2]].concat(a,[a[1]]),b))}function dr(a,b,c){return a.length<3?dk(a):a[0]+ds(a,dt(a,b))}function ds(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return dk(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function dt(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function du(a){if(a.length<3)return dk(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];dC(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),dC(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),dC(i,g,h);return i.join("")}function dv(a){if(a.length<4)return dk(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(dy(dB,f)+","+dy(dB,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),dC(b,f,g);return b.join("")}function dw(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[dy(dB,g),",",dy(dB,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),dC(b,g,h);return b.join("")}function dx(a,b){var c=a.length-1;if(c){var d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g)}return du(a)}function dy(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function dC(a,b,c){a.push("C",dy(dz,b),",",dy(dz,c),",",dy(dA,b),",",dy(dA,c),",",dy(dB,b),",",dy(dB,c))}function dD(a,b){return(b[1]-a[1])/(b[0]-a[0])}function dE(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=dD(e,f);while(++b<c)d[b]=(g+(g=dD(e=f,f=a[b+1])))/2;return d[b]=g,d}function dF(a){var b=[],c,d,e,f,g=dE(a),h=-1,i=a.length-1;while(++h<i)c=dD(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function dG(a){return a.length<3?dk(a):a[0]+ds(a,dF(a))}function dH(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+da,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function dI(a){function l(h){function y(){l.push("M",g(a(n),k),j,i(a(m.reverse()),k),"Z")}var l=[],m=[],n=[],o=-1,q=h.length,r,s=p(b),t=p(d),u=b===c?function(){return w}:p(c),v=d===e?function(){return x}:p(e),w,x;while(++o<q)f.call(this,r=h[o],o)?(m.push([w=+s.call(this,r,o),x=+t.call(this,r,o)]),n.push([+u.call(this,r,o),+v.call(this,r,o)])):m.length&&(y(),m=[],n=[]);return m.length&&y(),l.length?l.join(""):null}var b=dh,c=dh,d=0,e=di,f=o,g=dk,h=g.key,i=g,j="L",k=.7;return l.x=function(a){return arguments.length?(b=c=a,l):c},l.x0=function(a){return arguments.length?(b=a,l):b},l.x1=function(a){return arguments.length?(c=a,l):c},l.y=function(a){return arguments.length?(d=e=a,l):e},l.y0=function(a){return arguments.length?(d=a,l):d},l.y1=function(a){return arguments.length?(e=a,l):e},l.defined=function(a){return arguments.length?(f=a,l):f},l.interpolate=function(a){return arguments.length?(typeof a=="function"?h=g=a:h=(g=dj.get(a)||dk).key,i=g.reverse||g,j=g.closed?"M":"L",l):h},l.tension=function(a){return arguments.length?(k=a,l):k},l}function dJ(a){return a.source}function dK(a){return a.target}function dL(a){return a.radius}function dM(a){return a.startAngle}function dN(a){return a.endAngle}function dO(a){return[a.x,a.y]}function dP(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+da;return[c*Math.cos(d),c*Math.sin(d)]}}function dQ(){return 64}function dR(){return"circle"}function dS(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"}function dW(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function dX(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function dY(a,b,c){e=[];if(c&&b.length>1){var d=cB(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function eb(){d_||(d_=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{d_.scrollTop=1e3,d_.dispatchEvent(a),b=1e3-d_.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b}function ec(a){var b=a.source,c=a.target,d=ee(b,c),e=[b];while(b!==d)b=b.parent,e.push(b);var f=e.length;while(c!==d)e.splice(f,0,c),c=c.parent;return e}function ed(a){var b=[],c=a.parent;while(c!=null)b.push(a),a=c,c=c.parent;return b.push(a),b}function ee(a,b){if(a===b)return a;var c=ed(a),d=ed(b),e=c.pop(),f=d.pop(),g=null;while(e===f)g=e,e=c.pop(),f=d.pop();return g}function eh(a){a.fixed|=2}function ei(a){a!==eg&&(a.fixed&=1)}function ej(){eg.fixed&=1,ef=eg=null}function ek(){eg.px=d3.event.x,eg.py=d3.event.y,ef.resume()}function el(a,b,c){var d=0,e=0;a.charge=0;if(!a.leaf){var f=a.nodes,g=f.length,h=-1,i;while(++h<g){i=f[h];if(i==null)continue;el(i,b,c),a.charge+=i.charge,d+=i.charge*i.cx,e+=i.charge*i.cy}}if(a.point){a.leaf||(a.point.x+=Math.random()-.5,a.point.y+=Math.random()-.5);var j=b*c[a.point.index];a.charge+=a.pointCharge=j,d+=j*a.point.x,e+=j*a.point.y}a.cx=d/a.charge,a.cy=e/a.charge}function em(a){return 20}function en(a){return 1}function ep(a){return a.x}function eq(a){return a.y}function er(a,b,c){a.y0=b,a.y=c}function eu(a){return d3.range(a.length)}function ev(a){var b=-1,c=a[0].length,d=[];while(++b<c)d[b]=0;return d}function ew(a){var b=1,c=0,d=a[0][1],e,f=a.length;for(;b<f;++b)(e=a[b][1])>d&&(c=b,d=e);return c}function ex(a){return a.reduce(ey,0)}function ey(a,b){return a+b[1]}function ez(a,b){return eA(a,Math.ceil(Math.log(b.length)/Math.LN2+1))}function eA(a,b){var c=-1,d=+a[0],e=(a[1]-d)/b,f=[];while(++c<=b)f[c]=e*c+d;return f}function eB(a){return[d3.min(a),d3.max(a)]}function eC(a,b){return d3.rebind(a,b,"sort","children","value"),a.links=eG,a.nodes=function(b){return eH=!0,(a.nodes=a)(b)},a}function eD(a){return a.children}function eE(a){return a.value}function eF(a,b){return b.value-a.value}function eG(a){return d3.merge(a.map(function(a){return(a.children||[]).map(function(b){return{source:a,target:b}})}))}function eI(a,b){return a.value-b.value}function eJ(a,b){var c=a._pack_next;a._pack_next=b,b._pack_prev=a,b._pack_next=c,c._pack_prev=b}function eK(a,b){a._pack_next=b,b._pack_prev=a}function eL(a,b){var c=b.x-a.x,d=b.y-a.y,e=a.r+b.r;return e*e-c*c-d*d>.001}function eM(a){function n(a){c=Math.min(a.x-a.r,c),d=Math.max(a.x+a.r,d),e=Math.min(a.y-a.r,e),f=Math.max(a.y+a.r,f)}if(!(b=a.children)||!(m=b.length))return;var b,c=Infinity,d=-Infinity,e=Infinity,f=-Infinity,g,h,i,j,k,l,m;b.forEach(eN),g=b[0],g.x=-g.r,g.y=0,n(g);if(m>1){h=b[1],h.x=h.r,h.y=0,n(h);if(m>2){i=b[2],eQ(g,h,i),n(i),eJ(g,i),g._pack_prev=i,eJ(i,h),h=g._pack_next;for(j=3;j<m;j++){eQ(g,h,i=b[j]);var o=0,p=1,q=1;for(k=h._pack_next;k!==h;k=k._pack_next,p++)if(eL(k,i)){o=1;break}if(o==1)for(l=g._pack_prev;l!==k._pack_prev;l=l._pack_prev,q++)if(eL(l,i))break;o?(p<q||p==q&&h.r<g.r?eK(g,h=k):eK(g=l,h),j--):(eJ(g,i),h=i,n(i))}}}var r=(c+d)/2,s=(e+f)/2,t=0;for(j=0;j<m;j++)i=b[j],i.x-=r,i.y-=s,t=Math.max(t,i.r+Math.sqrt(i.x*i.x+i.y*i.y));a.r=t,b.forEach(eO)}function eN(a){a._pack_next=a._pack_prev=a}function eO(a){delete a._pack_next,delete a._pack_prev}function eP(a,b,c,d){var e=a.children;a.x=b+=d*a.x,a.y=c+=d*a.y,a.r*=d;if(e){var f=-1,g=e.length;while(++f<g)eP(e[f],b,c,d)}}function eQ(a,b,c){var d=a.r+c.r,e=b.x-a.x,f=b.y-a.y;if(d&&(e||f)){var g=b.r+c.r,h=e*e+f*f;g*=g,d*=d;var i=.5+(d-g)/(2*h),j=Math.sqrt(Math.max(0,2*g*(d+h)-(d-=h)*d-g*g))/(2*h);c.x=a.x+i*e+j*f,c.y=a.y+i*f-j*e}else c.x=a.x+d,c.y=a.y}function eR(a){return 1+d3.max(a,function(a){return a.y})}function eS(a){return a.reduce(function(a,b){return a+b.x},0)/a.length}function eT(a){var b=a.children;return b&&b.length?eT(b[0]):a}function eU(a){var b=a.children,c;return b&&(c=b.length)?eU(b[c-1]):a}function eV(a,b){return a.parent==b.parent?1:2}function eW(a){var b=a.children;return b&&b.length?b[0]:a._tree.thread}function eX(a){var b=a.children,c;return b&&(c=b.length)?b[c-1]:a._tree.thread}function eY(a,b){var c=a.children;if(c&&(e=c.length)){var d,e,f=-1;while(++f<e)b(d=eY(c[f],b),a)>0&&(a=d)}return a}function eZ(a,b){return a.x-b.x}function e$(a,b){return b.x-a.x}function e_(a,b){return a.depth-b.depth}function fa(a,b){function c(a,d){var e=a.children;if(e&&(i=e.length)){var f,g=null,h=-1,i;while(++h<i)f=e[h],c(f,g),g=f}b(a,d)}c(a,null)}function fb(a){var b=0,c=0,d=a.children,e=d.length,f;while(--e>=0)f=d[e]._tree,f.prelim+=b,f.mod+=b,b+=f.shift+(c+=f.change)}function fc(a,b,c){a=a._tree,b=b._tree;var d=c/(b.number-a.number);a.change+=d,b.change-=d,b.shift+=c,b.prelim+=c,b.mod+=c}function fd(a,b,c){return a._tree.ancestor.parent==b.parent?a._tree.ancestor:c}function fe(a){return{x:a.x,y:a.y,dx:a.dx,dy:a.dy}}function ff(a,b){var c=a.x+b[3],d=a.y+b[0],e=a.dx-b[1]-b[3],f=a.dy-b[0]-b[2];return e<0&&(c+=e/2,e=0),f<0&&(d+=f/2,f=0),{x:c,y:d,dx:e,dy:f}}function fg(a,b){function f(a,c){d3.text(a,b,function(a){c(a&&f.parse(a))})}function g(b){return b.map(h).join(a)}function h(a){return d.test(a)?'"'+a.replace(/\"/g,'""')+'"':a}var c=new RegExp("\r\n|["+a+"\r\n]","g"),d=new RegExp('["'+a+"\n]"),e=a.charCodeAt(0);return f.parse=function(a){var b;return f.parseRows(a,function(a,c){if(c){var d={},e=-1,f=b.length;while(++e<f)d[b[e]]=a[e];return d}return b=a,null})},f.parseRows=function(a,b){function k(){if(c.lastIndex>=a.length)return f;if(j)return j=!1,d;var b=c.lastIndex;if(a.charCodeAt(b)===34){var g=b;while(g++<a.length)if(a.charCodeAt(g)===34){if(a.charCodeAt(g+1)!==34)break;g++}c.lastIndex=g+2;var h=a.charCodeAt(g+1);return h===13?(j=!0,a.charCodeAt(g+2)===10&&c.lastIndex++):h===10&&(j=!0),a.substring(b+1,g).replace(/""/g,'"')}var i=c.exec(a);return i?(j=i[0].charCodeAt(0)!==e,a.substring(b,i.index)):(c.lastIndex=a.length,a.substring(b))}var d={},f={},g=[],h=0,i,j;c.lastIndex=0;while((i=k())!==f){var l=[];while(i!==d&&i!==f)l.push(i),i=k();if(b&&!(l=b(l,h++)))continue;g.push(l)}return g},f.format=function(a){return a.map(g).join("\n")},f}function fi(a,b){return function(c){return c&&a.hasOwnProperty(c.type)?a[c.type](c):b}}function fj(a){return"m0,"+a+"a"+a+","+a+" 0 1,1 0,"+ -2*a+"a"+a+","+a+" 0 1,1 0,"+2*a+"z"}function fk(a,b){fl.hasOwnProperty(a.type)&&fl[a.type](a,b)}function fm(a,b){fk(a.geometry,b)}function fn(a,b){for(var c=a.features,d=0,e=c.length;d<e;d++)fk(c[d].geometry,b)}function fo(a,b){for(var c=a.geometries,d=0,e=c.length;d<e;d++)fk(c[d],b)}function fp(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function fq(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function fr(a,b){for(var c=a.coordinates,d=0,e=c.length;d<e;d++)for(var f=c[d][0],g=0,h=f.length;g<h;g++)b.apply(null,f[g])}function fs(a,b){b.apply(null,a.coordinates)}function ft(a,b){for(var c=a.coordinates[0],d=0,e=c.length;d<e;d++)b.apply(null,c[d])}function fu(a){return a.source}function fv(a){return a.target}function fw(){function o(a){var b=Math.sin(a*=m)*n,c=Math.sin(m-a)*n,g=c*e+b*k,h=c*f+b*l,i=c*d+b*j;return[Math.atan2(h,g)/fh,Math.atan2(i,Math.sqrt(g*g+h*h))/fh]}var a,b,c,d,e,f,g,h,i,j,k,l,m,n;return o.distance=function(){return m==null&&(n=1/Math.sin(m=Math.acos(Math.max(-1,Math.min(1,d*j+c*i*Math.cos(g-a)))))),m},o.source=function(g){var h=Math.cos(a=g[0]*fh),i=Math.sin(a);return c=Math.cos(b=g[1]*fh),d=Math.sin(b),e=c*h,f=c*i,m=null,o},o.target=function(a){var b=Math.cos(g=a[0]*fh),c=Math.sin(g);return i=Math.cos(h=a[1]*fh),j=Math.sin(h),k=i*b,l=i*c,m=null,o},o}function fx(a,b){var c=fw().source(a).target(b);return c.distance(),c}function fA(a){var b=0,c=0;for(;;){if(a(b,c))return[b,c];b===0?(b=c+1,c=0):(b-=1,c+=1)}}function fB(a,b,c,d){var e,f,g,h,i,j,k;return e=d[a],f=e[0],g=e[1],e=d[b],h=e[0],i=e[1],e=d[c],j=e[0],k=e[1],(k-g)*(h-f)-(i-g)*(j-f)>0}function fC(a,b,c){return(c[0]-b[0])*(a[1]-b[1])<(c[1]-b[1])*(a[0]-b[0])}function fD(a,b,c,d){var e=a[0],f=b[0],g=c[0],h=d[0],i=a[1],j=b[1],k=c[1],l=d[1],m=e-g,n=f-e,o=h-g,p=i-k,q=j-i,r=l-k,s=(o*p-r*m)/(r*n-o*q);return[e+s*n,i+s*q]}function fF(a,b){var c={list:a.map(function(a,b){return{index:b,x:a[0],y:a[1]}}).sort(function(a,b){return a.y<b.y?-1:a.y>b.y?1:a.x<b.x?-1:a.x>b.x?1:0}),bottomSite:null},d={list:[],leftEnd:null,rightEnd:null,init:function(){d.leftEnd=d.createHalfEdge(null,"l"),d.rightEnd=d.createHalfEdge(null,"l"),d.leftEnd.r=d.rightEnd,d.rightEnd.l=d.leftEnd,d.list.unshift(d.leftEnd,d.rightEnd)},createHalfEdge:function(a,b){return{edge:a,side:b,vertex:null,l:null,r:null}},insert:function(a,b){b.l=a,b.r=a.r,a.r.l=b,a.r=b},leftBound:function(a){var b=d.leftEnd;do b=b.r;while(b!=d.rightEnd&&e.rightOf(b,a));return b=b.l,b},del:function(a){a.l.r=a.r,a.r.l=a.l,a.edge=null},right:function(a){return a.r},left:function(a){return a.l},leftRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[a.side]},rightRegion:function(a){return a.edge==null?c.bottomSite:a.edge.region[fE[a.side]]}},e={bisect:function(a,b){var c={region:{l:a,r:b},ep:{l:null,r:null}},d=b.x-a.x,e=b.y-a.y,f=d>0?d:-d,g=e>0?e:-e;return c.c=a.x*d+a.y*e+(d*d+e*e)*.5,f>g?(c.a=1,c.b=e/d,c.c/=d):(c.b=1,c.a=d/e,c.c/=e),c},intersect:function(a,b){var c=a.edge,d=b.edge;if(!c||!d||c.region.r==d.region.r)return null;var e=c.a*d.b-c.b*d.a;if(Math.abs(e)<1e-10)return null;var f=(c.c*d.b-d.c*c.b)/e,g=(d.c*c.a-c.c*d.a)/e,h=c.region.r,i=d.region.r,j,k;h.y<i.y||h.y==i.y&&h.x<i.x?(j=a,k=c):(j=b,k=d);var l=f>=k.region.r.x;return l&&j.side==="l"||!l&&j.side==="r"?null:{x:f,y:g}},rightOf:function(a,b){var c=a.edge,d=c.region.r,e=b.x>d.x;if(e&&a.side==="l")return 1;if(!e&&a.side==="r")return 0;if(c.a===1){var f=b.y-d.y,g=b.x-d.x,h=0,i=0;!e&&c.b<0||e&&c.b>=0?i=h=f>=c.b*g:(i=b.x+b.y*c.b>c.c,c.b<0&&(i=!i),i||(h=1));if(!h){var j=d.x-c.region.l.x;i=c.b*(g*g-f*f)<j*f*(1+2*g/j+c.b*c.b),c.b<0&&(i=!i)}}else{var k=c.c-c.a*b.x,l=b.y-k,m=b.x-d.x,n=k-d.y;i=l*l>m*m+n*n}return a.side==="l"?i:!i},endPoint:function(a,c,d){a.ep[c]=d;if(!a.ep[fE[c]])return;b(a)},distance:function(a,b){var c=a.x-b.x,d=a.y-b.y;return Math.sqrt(c*c+d*d)}},f={list:[],insert:function(a,b,c){a.vertex=b,a.ystar=b.y+c;for(var d=0,e=f.list,g=e.length;d<g;d++){var h=e[d];if(a.ystar>h.ystar||a.ystar==h.ystar&&b.x>h.vertex.x)continue;break}e.splice(d,0,a)},del:function(a){for(var b=0,c=f.list,d=c.length;b<d&&c[b]!=a;++b);c.splice(b,1)},empty:function(){return f.list.length===0},nextEvent:function(a){for(var b=0,c=f.list,d=c.length;b<d;++b)if(c[b]==a)return c[b+1];return null},min:function(){var a=f.list[0];return{x:a.vertex.x,y:a.ystar}},extractMin:function(){return f.list.shift()}};d.init(),c.bottomSite=c.list.shift();var g=c.list.shift(),h,i,j,k,l,m,n,o,p,q,r,s,t;for(;;){f.empty()||(h=f.min());if(g&&(f.empty()||g.y<h.y||g.y==h.y&&g.x<h.x))i=d.leftBound(g),j=d.right(i),n=d.rightRegion(i),s=e.bisect(n,g),m=d.createHalfEdge(s,"l"),d.insert(i,m),q=e.intersect
(i,m),q&&(f.del(i),f.insert(i,q,e.distance(q,g))),i=m,m=d.createHalfEdge(s,"r"),d.insert(i,m),q=e.intersect(m,j),q&&f.insert(m,q,e.distance(q,g)),g=c.list.shift();else if(!f.empty())i=f.extractMin(),k=d.left(i),j=d.right(i),l=d.right(j),n=d.leftRegion(i),o=d.rightRegion(j),r=i.vertex,e.endPoint(i.edge,i.side,r),e.endPoint(j.edge,j.side,r),d.del(i),f.del(j),d.del(j),t="l",n.y>o.y&&(p=n,n=o,o=p,t="r"),s=e.bisect(n,o),m=d.createHalfEdge(s,t),d.insert(k,m),e.endPoint(s,fE[t],r),q=e.intersect(k,m),q&&(f.del(k),f.insert(k,q,e.distance(q,n))),q=e.intersect(m,l),q&&f.insert(m,q,e.distance(q,n));else break}for(i=d.right(d.leftEnd);i!=d.rightEnd;i=d.right(i))b(i.edge)}function fG(){return{leaf:!0,nodes:[],point:null}}function fH(a,b,c,d,e,f){if(!a(b,c,d,e,f)){var g=(c+e)*.5,h=(d+f)*.5,i=b.nodes;i[0]&&fH(a,i[0],c,d,g,h),i[1]&&fH(a,i[1],g,d,e,h),i[2]&&fH(a,i[2],c,h,g,f),i[3]&&fH(a,i[3],g,h,e,f)}}function fI(a){return{x:a[0],y:a[1]}}function fL(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function fU(a){return a.substring(0,3)}function fV(a,b,c,d){var e,f,g=0,h=b.length,i=c.length;while(g<h){if(d>=i)return-1;e=b.charCodeAt(g++);if(e==37){f=gh[b.charAt(g++)];if(!f||(d=f(a,c,d))<0)return-1}else if(e!=c.charCodeAt(d++))return-1}return d}function fW(a){return new RegExp("^(?:"+a.map(d3.requote).join("|")+")","i")}function fX(a){var b=new j,c=-1,d=a.length;while(++c<d)b.set(a[c].toLowerCase(),c);return b}function gi(a,b,c){gb.lastIndex=0;var d=gb.exec(b.substring(c));return d?c+=d[0].length:-1}function gj(a,b,c){ga.lastIndex=0;var d=ga.exec(b.substring(c));return d?c+=d[0].length:-1}function gk(a,b,c){ge.lastIndex=0;var d=ge.exec(b.substring(c));return d?(a.m=gf.get(d[0].toLowerCase()),c+=d[0].length):-1}function gl(a,b,c){gc.lastIndex=0;var d=gc.exec(b.substring(c));return d?(a.m=gd.get(d[0].toLowerCase()),c+=d[0].length):-1}function gm(a,b,c){return fV(a,gg.c.toString(),b,c)}function gn(a,b,c){return fV(a,gg.x.toString(),b,c)}function go(a,b,c){return fV(a,gg.X.toString(),b,c)}function gp(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+4));return d?(a.y=+d[0],c+=d[0].length):-1}function gq(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+2));return d?(a.y=gr(+d[0]),c+=d[0].length):-1}function gr(a){return a+(a>68?1900:2e3)}function gs(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+2));return d?(a.m=d[0]-1,c+=d[0].length):-1}function gt(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+2));return d?(a.d=+d[0],c+=d[0].length):-1}function gu(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+2));return d?(a.H=+d[0],c+=d[0].length):-1}function gv(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+2));return d?(a.M=+d[0],c+=d[0].length):-1}function gw(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+2));return d?(a.S=+d[0],c+=d[0].length):-1}function gx(a,b,c){gy.lastIndex=0;var d=gy.exec(b.substring(c,c+3));return d?(a.L=+d[0],c+=d[0].length):-1}function gz(a,b,c){var d=gA.get(b.substring(c,c+=2).toLowerCase());return d==null?-1:(a.p=d,c)}function gB(a){var b=a.getTimezoneOffset(),c=b>0?"-":"+",d=~~(Math.abs(b)/60),e=Math.abs(b)%60;return c+fY(d)+fY(e)}function gD(a){return a.toISOString()}function gE(a,b,c){function d(b){var c=a(b),d=f(c,1);return b-c<d-b?c:d}function e(c){return b(c=a(new fJ(c-1)),1),c}function f(a,c){return b(a=new fJ(+a),c),a}function g(a,d,f){var g=e(a),h=[];if(f>1)while(g<d)c(g)%f||h.push(new Date(+g)),b(g,1);else while(g<d)h.push(new Date(+g)),b(g,1);return h}function h(a,b,c){try{fJ=fL;var d=new fL;return d._=a,g(d,b,c)}finally{fJ=Date}}a.floor=a,a.round=d,a.ceil=e,a.offset=f,a.range=g;var i=a.utc=gF(a);return i.floor=i,i.round=gF(d),i.ceil=gF(e),i.offset=gF(f),i.range=h,a}function gF(a){return function(b,c){try{fJ=fL;var d=new fL;return d._=b,a(d,c)._}finally{fJ=Date}}}function gG(a,b,c){function d(b){return a(b)}return d.invert=function(b){return gI(a.invert(b))},d.domain=function(b){return arguments.length?(a.domain(b),d):a.domain().map(gI)},d.nice=function(a){return d.domain(cD(d.domain(),function(){return a}))},d.ticks=function(c,e){var f=gH(d.domain());if(typeof c!="function"){var g=f[1]-f[0],h=g/c,i=d3.bisect(gM,h);if(i==gM.length)return b.year(f,c);if(!i)return a.ticks(c).map(gI);Math.log(h/gM[i-1])<Math.log(gM[i]/h)&&--i,c=b[i],e=c[1],c=c[0].range}return c(f[0],new Date(+f[1]+1),e)},d.tickFormat=function(){return c},d.copy=function(){return gG(a.copy(),b,c)},d3.rebind(d,a,"range","rangeRound","interpolate","clamp")}function gH(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function gI(a){return new Date(a)}function gJ(a){return function(b){var c=a.length-1,d=a[c];while(!d[1](b))d=a[--c];return d[0](b)}}function gK(a){var b=new Date(a,0,1);return b.setFullYear(a),b}function gL(a){var b=a.getFullYear(),c=gK(b),d=gK(b+1);return b+(a-c)/(d-c)}function gU(a){var b=new Date(Date.UTC(a,0,1));return b.setUTCFullYear(a),b}function gV(a){var b=a.getUTCFullYear(),c=gU(b),d=gU(b+1);return b+(a-c)/(d-c)}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.10.0"};var e=g;try{e(document.documentElement.childNodes)[0].nodeType}catch(h){e=f}var i=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.map=function(a){var b=new j;for(var c in a)b.set(c,a[c]);return b},d(j,{has:function(a){return k+a in this},get:function(a){return this[k+a]},set:function(a,b){return this[k+a]=b},remove:function(a){return a=k+a,a in this&&delete this[a]},keys:function(){var a=[];return this.forEach(function(b){a.push(b)}),a},values:function(){var a=[];return this.forEach(function(b,c){a.push(c)}),a},entries:function(){var a=[];return this.forEach(function(b,c){a.push({key:b,value:c})}),a},forEach:function(a){for(var b in this)b.charCodeAt(0)===l&&a.call(this,b.substring(1),this[b])}});var k="\0",l=k.charCodeAt(0);d3.functor=p,d3.rebind=function(a,b){var c=1,d=arguments.length,e;while(++c<d)a[e=arguments[c]]=q(a,b,b[e]);return a},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)r(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)r(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(r),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(arguments.length===1){while(++c<d&&((e=g=a[c])==null||e!=e))e=g=undefined;while(++c<d)(f=a[c])!=null&&(e>f&&(e=f),g<f&&(g=f))}else{while(++c<d&&((e=g=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&(e>f&&(e=f),g<f&&(g=f))}return[e,g]},d3.random={normal:function(a,b){var c=arguments.length;return c<2&&(b=1),c<1&&(a=0),function(){var c,d,e;do c=Math.random()*2-1,d=Math.random()*2-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}},logNormal:function(a,b){var c=arguments.length;c<2&&(b=1),c<1&&(a=0);var d=d3.random.normal();return function(){return Math.exp(a+b*d())}},irwinHall:function(a){return function(){for(var b=0,c=0;c<a;c++)b+=Math.random();return b/a}}},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.transpose=function(a){return d3.zip.apply(d3,a)},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,s),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[d]=arguments[d][a];return c},d3.bisector=function(a){return{left:function(b,c,d,e){arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);while(d<e){var f=d+e>>>1;a.call(b,b[f],f)<c?d=f+1:e=f}return d},right:function(b,c,d,e){arguments.length<3&&(d=0),arguments.length<4&&(e=b.length);while(d<e){var f=d+e>>>1;c<a.call(b,b[f],f)?e=f:d=f+1}return d}}};var t=d3.bisector(function(a){return a});d3.bisectLeft=t.left,d3.bisect=d3.bisectRight=t.right,d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,k=b[g++],l,m,n=new j,o,p={};while(++h<i)(o=n.get(l=k(m=c[h])))?o.push(m):n.set(l,[m]);return n.forEach(function(a){p[a]=f(n.get(a),g)}),p}function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,g=a.length;arguments.length<2&&(b=u);while(++f<g)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c===Infinity)throw new Error("infinite range");var d=[],e=w(Math.abs(c)),f=-1,g;a*=e,b*=e,c*=e;if(c<0)while((g=a+c*++f)>b)d.push(g/e);else while((g=a+c*++f)<b)d.push(g/e);return d},d3.requote=function(a){return a.replace(x,"\\$&")};var x=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*(b=Math.pow(10,b)))/b:Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?(c=b,b=null):b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),b&&d.setRequestHeader("Accept",b),d.onreadystatechange=function(){if(d.readyState===4){var a=d.status;c(!a&&d.response||a>=200&&a<300||a===304?d:null)}},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)};var y={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:y,qualify:function(a){var b=a.indexOf(":"),c=a;return b>=0&&(c=a.substring(0,b),a=a.substring(b+1)),y.hasOwnProperty(c)?{space:y[c],local:a}:a}},d3.dispatch=function(){var a=new z,b=-1,c=arguments.length;while(++b<c)a[arguments[b]]=A(a);return a},z.prototype.on=function(a,b){var c=a.indexOf("."),d="";return c>0&&(d=a.substring(c+1),a=a.substring(0,c)),arguments.length<2?this[a].on(d):this[a].on(d,b)},d3.format=function(a){var b=B.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=C.get(i)||E,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"-":d;if(j<0){var m=d3.formatPrefix(a,h);a=m.scale(a),k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=F(a)),a=b+a}else{g&&(a=F(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var B=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,C=d3.map({g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=D(a,b)).toFixed(Math.max(0,Math.min(20,b)))}}),G=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(H);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,D(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),G[8+c/3]};var I=R(2),J=R(3),K=function(){return Q},L=d3.map({linear:K,poly:R,quad:function(){return I},cubic:function(){return J},sin:function(){return S},exp:function(){return T},circle:function(){return U},elastic:V,back:W,bounce:function(){return X}}),M=d3.map({"in":Q,out:O,"in-out":P,"out-in":function(a){return P(O(a))}});d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return c=L.get(c)||K,d=M.get(d)||Q,N(d(c.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.transform=function(a){var b=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(a){b.setAttribute("transform",a);var c=b.transform.baseVal.consolidate();return new _(c?c.matrix:be)})(a)},_.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var bd=180/Math.PI,be={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;bf.lastIndex=0;for(d=0;c=bf.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=bf.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=bf.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateTransform=function(a,b){var c=[],d=[],e,f=d3.transform(a),g=d3.transform(b),h=f.translate,i=g.translate,j=f.rotate,k=g.rotate,l=f.skew,m=g.skew,n=f.scale,o=g.scale;return h[0]!=i[0]||h[1]!=i[1]?(c.push("translate(",null,",",null,")"),d.push({i:1,x:d3.interpolateNumber(h[0],i[0])},{i:3,x:d3.interpolateNumber(h[1],i[1])})):i[0]||i[1]?c.push("translate("+i+")"):c.push(""),j!=k?(j-k>180?k+=360:k-j>180&&(j+=360),d.push({i:c.push(c.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(j,k)})):k&&c.push(c.pop()+"rotate("+k+")"),l!=m?d.push({i:c.push(c.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(l,m)}):m&&c.push(c.pop()+"skewX("+m+")"),n[0]!=o[0]||n[1]!=o[1]?(e=c.push(c.pop()+"scale(",null,",",null,")"),d.push({i:e-4,x:d3.interpolateNumber(n[0],o[0])},{i:e-2,x:d3.interpolateNumber(n[1],o[1])})):(o[0]!=1||o[1]!=1)&&c.push(c.pop()+"scale("+o+")"),e=d.length,function(a){var b=-1,f;while(++b<e)c[(f=d[b]).i]=f.x(a);return c.join("")}},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+bl(Math.round(c+f*a))+bl(Math.round(d+g*a))+bl(Math.round(e+h*a))}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return f>180?f-=360:f<-180&&(f+=360),function(a){return bu(c+f*a,d+g*a,e+h*a)+""}},d3.interpolateLab=function(a,b){a=d3.lab(a),b=d3.lab(b);var c=a.l,d=a.a,e=a.b,f=b.l-c,g=b.a-d,h=b.b-e;return function(a){return bE(c+f*a,d+g*a,e+h*a)+""}},d3.interpolateHcl=function(a,b){a=d3.hcl(a),b=d3.hcl(b);var c=a.h,d=a.c,e=a.l,f=b.h-c,g=b.c-d,h=b.l-e;return f>180?f-=360:f<-180&&(f+=360),function(a){return bx(c+f*a,d+g*a,e+h*a)+""}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=bg(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var bf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return(typeof a=="string"||typeof b=="string")&&d3.interpolateString(a+"",b+"")},function(a,b){return(typeof b=="string"?br.has(b)||/^(#|rgb\(|hsl\()/.test(b):b instanceof bk||b instanceof bt)&&d3.interpolateRgb(a,b)},function(a,b){return!isNaN(a=+a)&&!isNaN(b=+b)&&d3.interpolateNumber(a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof bk?bj(a.r,a.g,a.b):bm(""+a,bj,bu):bj(~~a,~~b,~~c)},bk.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?bj(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),bj(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},bk.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),bj(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},bk.prototype.hsl=function(){return bn(this.r,this.g,this.b)},bk.prototype.toString=function(){return"#"+bl(this.r)+bl(this.g)+bl(this.b)};var br=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});br.forEach(function(a,b){br.set(a,bm(b,bj,bu))}),d3.hsl=function(a,b,c){return arguments.length===1?a instanceof bt?bs(a.h,a.s,a.l):bm(""+a,bn,bs):bs(+a,+b,+c)},bt.prototype.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),bs(this.h,this.s,this.l/a)},bt.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),bs(this.h,this.s,a*this.l)},bt.prototype.rgb=function(){return bu(this.h,this.s,this.l)},bt.prototype.toString=function(){return this.rgb().toString()},d3.hcl=function(a,b,c){return arguments.length===1?a instanceof bw?bv(a.h,a.c,a.l):a instanceof bz?bF(a.l,a.a,a.b):bF((a=bo((a=d3.rgb(a)).r,a.g,a.b)).l,a.a,a.b):bv(+a,+b,+c)},bw.prototype.brighter=function(a){return bv(this.h,this.c,Math.min(100,this.l+bA*(arguments.length?a:1)))},bw.prototype.darker=function(a){return bv(this.h,this.c,Math.max(0,this.l-bA*(arguments.length?a:1)))},bw.prototype.rgb=function(){return bx(this.h,this.c,this.l).rgb()},bw.prototype.toString=function(){return this.rgb()+""},d3.lab=function(a,b,c){return arguments.length===1?a instanceof bz?by(a.l,a.a,a.b):a instanceof bw?bx(a.l,a.c,a.h):bo((a=d3.rgb(a)).r,a.g,a.b):by(+a,+b,+c)};var bA=18,bB=.95047,bC=1,bD=1.08883;bz.prototype.brighter=function(a){return by(Math.min(100,this.l+bA*(arguments.length?a:1)),this.a,this.b)},bz.prototype.darker=function(a){return by(Math.max(0,this.l-bA*(arguments.length?a:1)),this.a,this.b)},bz.prototype.rgb=function(){return bE(this.l,this.a,this.b)},bz.prototype.toString=function(){return this.rgb()+""};var bK=function(a,b){return b.querySelector(a)},bL=function(a,b){return b.querySelectorAll(a)},bM=document.documentElement,bN=bM.matchesSelector||bM.webkitMatchesSelector||bM.mozMatchesSelector||bM.msMatchesSelector||bM.oMatchesSelector,bO=function(a,b){return bN.call(a,b)};typeof Sizzle=="function"&&(bK=function(a,b){return Sizzle(a,b)[0]||null},bL=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))},bO=Sizzle.matchesSelector);var bP=[];d3.selection=function(){return cb},d3.selection.prototype=bP,bP.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=bQ(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return bJ(b)},bP.selectAll=function(a){var b=[],c,d;typeof a!="function"&&(a=bR(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(d=h[i])b.push(c=e(a.call(d,d.__data__,i))),c.parentNode=d;return bJ(b)},bP.attr=function(a,b){if(arguments.length<2){if(typeof a=="string"){var c=this.node();return a=d3.ns.qualify(a),a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}for(b in a)this.each(bS(b,a[b]));return this}return this.each(bS(a,b))},bP.classed=function(a,b){if(arguments.length<2){if(typeof a=="string"){var c=this.node(),d=(a=a.trim().split(/^|\s+/g)).length,e=-1;if(b=c.classList){while(++e<d)if(!b.contains(a[e]))return!1}else{b=c.className,b.baseVal!=null&&(b=b.baseVal);while(++e<d)if(!bT(a[e]).test(b))return!1}return!0}for(b in a)this.each(bU(b,a[b]));return this}return this.each(bU(a,b))},bP.style=function(a,b,c){var d=arguments.length;if(d<3){if(typeof a!="string"){d<2&&(b="");for(c in a)this.each(bW(c,a[c],b));return this}if(d<2)return window.getComputedStyle(this.node(),null).getPropertyValue(a);c=""}return this.each(bW(a,b,c))},bP.property=function(a,b){if(arguments.length<2){if(typeof a=="string")return this.node()[a];for(b in a)this.each(bX(b,a[b]));return this}return this.each(bX(a,b))},bP.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.textContent=b==null?"":b}:a==null?function(){this.textContent=""}:function(){this.textContent=a})},bP.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){var b=a.apply(this,arguments);this.innerHTML=b==null?"":b}:a==null?function(){this.innerHTML=""}:function(){this.innerHTML=a})},bP.append=function(a){function b(){return this.appendChild(document.createElementNS(this.namespaceURI,a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bP.insert=function(a,b){function c(){return this.insertBefore(document.createElementNS(this.namespaceURI,a),bK(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),bK(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bP.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bP.data=function(a,b){function g(a,c){var d,e=a.length,f=c.length,g=Math.min(e,f),l=Math.max(e,f),m=[],n=[],o=[],p,q;if(b){var r=new j,s=[],t,u=c.length;for(d=-1;++d<e;)t=b.call(p=a[d],p.__data__,d),r.has(t)?o[u++]=p:r.set(t,p),s.push(t);for(d=-1;++d<f;)t=b.call(c,q=c[d],d),r.has(t)?(m[d]=p=r.get(t),p.__data__=q,n[d]=o[d]=null):(n[d]=bY(q),m[d]=o[d]=null),r.remove(t);for(d=-1;++d<e;)r.has(s[d])&&(o[d]=a[d])}else{for(d=-1;++d<g;)p=a[d],q=c[d],p?(p.__data__=q,m[d]=p,n[d]=o[d]=null):(n[d]=bY(q),m[d]=o[d]=null);for(;d<f;++d)n[d]=bY(c[d]),m[d]=o[d]=null;for(;d<l;++d)o[d]=a[d],n[d]=m[d]=null}n.update=m,n.parentNode=m.parentNode=o.parentNode=a.parentNode,h.push(n),i.push(m),k.push(o)}var c=-1,d=this.length,e,f;if(!arguments.length){a=new Array(d=(e=this[0]).length);while(++c<d)if(f=e[c])a[c]=f.__data__;return a}var h=cc([]),i=bJ([]),k=bJ([]);if(typeof a=="function")while(++c<d)g(e=this[c],a.call(e,e.parentNode.__data__,c));else while(++c<d)g(e=this[c],a);return i.enter=function(){return h},i.exit=function(){return k},i},bP.datum=bP.map=function(a){return arguments.length<1?this.property("__data__"):this.property("__data__",a)},bP.filter=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bZ(a));for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return bJ(b)},bP.order=function(){for(var a=-1,b=this.length;++a<b;)for(var c=this[a],d=c.length-1,e=c[d],f;--d>=0;)if(f=c[d])e&&e!==f.nextSibling&&e.parentNode.insertBefore(f,e),e=f;return this},bP.sort=function(a){a=b$.apply(this,arguments);for(var b=-1,c=this.length;++b<c;)this[b].sort(a);return this.order()},bP.on=function(a,b,c){var d=arguments.length;if(d<3){if(typeof a!="string"){d<2&&(b=!1);for(c in a)this.each(b_(c,a[c],b));return this}if(d<2)return(d=this.node()["__on"+a])&&d._;c=!1}return this.each(b_(a,b,c))},bP.each=function(a){return ca(this,function(b,c,d){a.call(b,b.__data__,c,d)})},bP.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bP.empty=function(){return!this.node()},bP.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bP.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:cl,duration:cm}:null)}return ce(a,ch||++cg,Date.now())};var cb=bJ([[document]]);cb[0].parentNode=bM,d3.select=function(a){return typeof a=="string"?cb.select(a):bJ([[a]])},d3.selectAll=function(a){return typeof a=="string"?cb.selectAll(a):bJ([e(a)])};var cd=[];d3.selection.enter=cc,d3.selection.enter.prototype=cd,cd.append=bP.append,cd.insert=bP.insert,cd.empty=bP.empty,cd.node=bP.node,cd.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return bJ(b)};var cf=[],cg=0,ch=0,ci=0,cj=250,ck=d3.ease("cubic-in-out"),cl=ci,cm=cj,cn=ck;cf.call=bP.call,d3.transition=function(a){return arguments.length?ch?a.transition():a:cb.transition()},d3.transition.prototype=cf,cf.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bQ(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return ce(b,this.id,this.time).ease(this.ease())},cf.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bR(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.push({node:d[k],delay:e.delay,duration:e.duration})}return ce(b,this.id,this.time).ease(this.ease())},cf.filter=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bZ(a));for(var f=0,g=this.length;f<g;f++){b.push(c=[]);for(var d=this[f],h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e.node,e.node.__data__,h)&&c.push(e)}return ce(b,this.id,this.time).ease(this.ease())},cf.attr=function(a,b){if(arguments.length<2){for(b in a)this.attrTween(b,cr(a[b],b));return this}return this.attrTween(a,cr(b,a))},cf.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===cp?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===cp?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},cf.style=function(a,b,c){var d=arguments.length;if(d<3){if(typeof a!="string"){d<2&&(b="");for(c in a)this.styleTween(c,cr(a[c],c),b);return this}c=""}return this.styleTween(a,cr(b,a),c)},cf.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===cp?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},cf.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},cf.remove=function(){return this.each("end.transition",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},cf.delay=function(a){return ca(this,typeof a=="function"?function(b,c,d){b.delay=a.call(b=b.node,b.__data__,c,d)|0}:(a|=0,function(b){b.delay=a}))},cf.duration=function(a){return ca(this,typeof a=="function"?function(b,c,d){b.duration=Math.max(1,a.call(b=b.node,b.__data__,c,d)|0)}:(a=Math.max(1,a|0),function(b){b.duration=a}))},cf.transition=function(){return this.select(n)},d3.tween=function(a,b){function c(c,d,e){var f=a.call(this,c,d);return f==null?e!=""&&cp:e!=f&&b(e,f)}function d(c,d,e){return e!=a&&b(e,a)}return typeof a=="function"?c:a==null?cq:(a+="",d)};var cp={},cs=null,ct,cu;d3.timer=function(a,b,c){var d=!1,e,f=cs;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(cs={callback:a,then:c,delay:b,next:cs}),ct||(cu=clearTimeout(cu),ct=1,cx(cv))},d3.timer.flush=function(){var a,b=Date.now(),c=cs;while(c)a=b-c.then,c.delay||(c.flush=c.callback
(a)),c=c.next;cw()};var cx=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.mouse=function(a){return cz(a,Z())};var cy=/WebKit/.test(navigator.userAgent)?-1:0;d3.touches=function(a,b){return arguments.length<2&&(b=Z().touches),b?e(b).map(function(b){var c=cz(a,b);return c.identifier=b.identifier,c}):[]},d3.scale={},d3.scale.linear=function(){return cF([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return cN(d3.scale.linear(),cP)};var cO=d3.format(".0e");cP.pow=function(a){return Math.pow(10,a)},cQ.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return cR(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return cT([],{t:"range",a:[[]]})},d3.scale.category10=function(){return d3.scale.ordinal().range(cU)},d3.scale.category20=function(){return d3.scale.ordinal().range(cV)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cW)},d3.scale.category20c=function(){return d3.scale.ordinal().range(cX)};var cU=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],cV=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cW=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],cX=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return cY([],[])},d3.scale.quantize=function(){return cZ(0,1,[0,1])},d3.scale.threshold=function(){return c$([.5],[0,1])},d3.scale.identity=function(){return c_([0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+da,h=d.apply(this,arguments)+da,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=db?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=dc,b=dd,c=de,d=df;return e.innerRadius=function(b){return arguments.length?(a=p(b),e):a},e.outerRadius=function(a){return arguments.length?(b=p(a),e):b},e.startAngle=function(a){return arguments.length?(c=p(a),e):c},e.endAngle=function(a){return arguments.length?(d=p(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+da;return[Math.cos(f)*e,Math.sin(f)*e]},e};var da=-Math.PI/2,db=2*Math.PI-1e-6;d3.svg.line=function(){return dg(m)};var dj=d3.map({linear:dk,"linear-closed":dl,"step-before":dm,"step-after":dn,basis:du,"basis-open":dv,"basis-closed":dw,bundle:dx,cardinal:dr,"cardinal-open":dp,"cardinal-closed":dq,monotone:dG});dj.forEach(function(a,b){b.key=a,b.closed=/-closed$/.test(a)});var dz=[0,2/3,1/3,0],dA=[0,1/3,2/3,0],dB=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=dg(dH);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},dm.reverse=dn,dn.reverse=dm,d3.svg.area=function(){return dI(m)},d3.svg.area.radial=function(){var a=dI(dH);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1,e.a1-e.a0)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1,f.a1-f.a0)+j(f.r,f.p1,e.r,e.p0))+"Z"}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+da,k=e.call(a,h,g)+da;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b,c){return"A"+a+","+a+" 0 "+ +(c>Math.PI)+",1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=dJ,b=dK,c=dL,d=de,e=df;return f.radius=function(a){return arguments.length?(c=p(a),f):c},f.source=function(b){return arguments.length?(a=p(b),f):a},f.target=function(a){return arguments.length?(b=p(a),f):b},f.startAngle=function(a){return arguments.length?(d=p(a),f):d},f.endAngle=function(a){return arguments.length?(e=p(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=dJ,b=dK,c=dO;return d.source=function(b){return arguments.length?(a=p(b),d):a},d.target=function(a){return arguments.length?(b=p(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=dO,c=a.projection;return a.projection=function(a){return arguments.length?c(dP(b=a)):b},a},d3.svg.mouse=d3.mouse,d3.svg.touches=d3.touches,d3.svg.symbol=function(){function c(c,d){return(dT.get(a.call(this,c,d))||dS)(b.call(this,c,d))}var a=dR,b=dQ;return c.type=function(b){return arguments.length?(a=p(b),c):a},c.size=function(a){return arguments.length?(b=p(a),c):b},c};var dT=d3.map({circle:dS,cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*dV)),c=b*dV;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/dU),c=b*dU/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/dU),c=b*dU/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}});d3.svg.symbolTypes=dT.keys();var dU=Math.sqrt(3),dV=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function k(k){k.each(function(){var k=d3.select(this),l=h==null?a.ticks?a.ticks.apply(a,g):a.domain():h,m=i==null?a.tickFormat?a.tickFormat.apply(a,g):String:i,n=dY(a,l,j),o=k.selectAll(".minor").data(n,String),p=o.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),q=d3.transition(o.exit()).style("opacity",1e-6).remove(),r=d3.transition(o).style("opacity",1),s=k.selectAll("g").data(l,String),t=s.enter().insert("g","path").style("opacity",1e-6),u=d3.transition(s.exit()).style("opacity",1e-6).remove(),v=d3.transition(s).style("opacity",1),w,x=cC(a),y=k.selectAll(".domain").data([0]),z=y.enter().append("path").attr("class","domain"),A=d3.transition(y),B=a.copy(),C=this.__chart__||B;this.__chart__=B,t.append("line").attr("class","tick"),t.append("text");var D=t.select("line"),E=v.select("line"),F=s.select("text").text(m),G=t.select("text"),H=v.select("text");switch(b){case"bottom":w=dW,p.attr("y2",d),r.attr("x2",0).attr("y2",d),D.attr("y2",c),G.attr("y",Math.max(c,0)+f),E.attr("x2",0).attr("y2",c),H.attr("x",0).attr("y",Math.max(c,0)+f),F.attr("dy",".71em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+e+"V0H"+x[1]+"V"+e);break;case"top":w=dW,p.attr("y2",-d),r.attr("x2",0).attr("y2",-d),D.attr("y2",-c),G.attr("y",-(Math.max(c,0)+f)),E.attr("x2",0).attr("y2",-c),H.attr("x",0).attr("y",-(Math.max(c,0)+f)),F.attr("dy","0em").attr("text-anchor","middle"),A.attr("d","M"+x[0]+","+ -e+"V0H"+x[1]+"V"+ -e);break;case"left":w=dX,p.attr("x2",-d),r.attr("x2",-d).attr("y2",0),D.attr("x2",-c),G.attr("x",-(Math.max(c,0)+f)),E.attr("x2",-c).attr("y2",0),H.attr("x",-(Math.max(c,0)+f)).attr("y",0),F.attr("dy",".32em").attr("text-anchor","end"),A.attr("d","M"+ -e+","+x[0]+"H0V"+x[1]+"H"+ -e);break;case"right":w=dX,p.attr("x2",d),r.attr("x2",d).attr("y2",0),D.attr("x2",c),G.attr("x",Math.max(c,0)+f),E.attr("x2",c).attr("y2",0),H.attr("x",Math.max(c,0)+f).attr("y",0),F.attr("dy",".32em").attr("text-anchor","start"),A.attr("d","M"+e+","+x[0]+"H0V"+x[1]+"H"+e)}if(a.ticks)t.call(w,C),v.call(w,B),u.call(w,B),p.call(w,C),r.call(w,B),q.call(w,B);else{var I=B.rangeBand()/2,J=function(a){return B(a)+I};t.call(w,J),v.call(w,J)}})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h=null,i,j=0;return k.scale=function(b){return arguments.length?(a=b,k):a},k.orient=function(a){return arguments.length?(b=a,k):b},k.ticks=function(){return arguments.length?(g=arguments,k):g},k.tickValues=function(a){return arguments.length?(h=a,k):h},k.tickFormat=function(a){return arguments.length?(i=a,k):i},k.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,k},k.tickPadding=function(a){return arguments.length?(f=+a,k):f},k.tickSubdivide=function(a){return arguments.length?(j=+a,k):j},k},d3.svg.brush=function(){function g(a){a.each(function(){var a=d3.select(this),e=a.selectAll(".background").data([0]),f=a.selectAll(".extent").data([0]),l=a.selectAll(".resize").data(d,String),m;a.style("pointer-events","all").on("mousedown.brush",k).on("touchstart.brush",k),e.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.enter().append("rect").attr("class","extent").style("cursor","move"),l.enter().append("g").attr("class",function(a){return"resize "+a}).style("cursor",function(a){return dZ[a]}).append("rect").attr("x",function(a){return/[ew]$/.test(a)?-3:null}).attr("y",function(a){return/^[ns]/.test(a)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),l.style("display",g.empty()?"none":null),l.exit().remove(),b&&(m=cC(b),e.attr("x",m[0]).attr("width",m[1]-m[0]),i(a)),c&&(m=cC(c),e.attr("y",m[0]).attr("height",m[1]-m[0]),j(a)),h(a)})}function h(a){a.selectAll(".resize").attr("transform",function(a){return"translate("+e[+/e$/.test(a)][0]+","+e[+/^s/.test(a)][1]+")"})}function i(a){a.select(".extent").attr("x",e[0][0]),a.selectAll(".extent,.n>rect,.s>rect").attr("width",e[1][0]-e[0][0])}function j(a){a.select(".extent").attr("y",e[0][1]),a.selectAll(".extent,.e>rect,.w>rect").attr("height",e[1][1]-e[0][1])}function k(){function x(){var a=d3.event.changedTouches;return a?d3.touches(d,a)[0]:d3.mouse(d)}function y(){d3.event.keyCode==32&&(q||(r=null,s[0]-=e[1][0],s[1]-=e[1][1],q=2),Y())}function z(){d3.event.keyCode==32&&q==2&&(s[0]+=e[1][0],s[1]+=e[1][1],q=0,Y())}function A(){var a=x(),d=!1;t&&(a[0]+=t[0],a[1]+=t[1]),q||(d3.event.altKey?(r||(r=[(e[0][0]+e[1][0])/2,(e[0][1]+e[1][1])/2]),s[0]=e[+(a[0]<r[0])][0],s[1]=e[+(a[1]<r[1])][1]):r=null),o&&B(a,b,0)&&(i(m),d=!0),p&&B(a,c,1)&&(j(m),d=!0),d&&(h(m),l({type:"brush",mode:q?"move":"resize"}))}function B(a,b,c){var d=cC(b),g=d[0],h=d[1],i=s[c],j=e[1][c]-e[0][c],k,l;q&&(g-=i,h-=j+i),k=Math.max(g,Math.min(h,a[c])),q?l=(k+=i)+j:(r&&(i=Math.max(g,Math.min(h,2*r[c]-k))),i<k?(l=k,k=i):l=i);if(e[0][c]!==k||e[1][c]!==l)return f=null,e[0][c]=k,e[1][c]=l,!0}function C(){A(),m.style("pointer-events","all").selectAll(".resize").style("display",g.empty()?"none":null),d3.select("body").style("cursor",null),u.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),l({type:"brushend"}),Y()}var d=this,k=d3.select(d3.event.target),l=a.of(d,arguments),m=d3.select(d),n=k.datum(),o=!/^(n|s)$/.test(n)&&b,p=!/^(e|w)$/.test(n)&&c,q=k.classed("extent"),r,s=x(),t,u=d3.select(window).on("mousemove.brush",A).on("mouseup.brush",C).on("touchmove.brush",A).on("touchend.brush",C).on("keydown.brush",y).on("keyup.brush",z);if(q)s[0]=e[0][0]-s[0],s[1]=e[0][1]-s[1];else if(n){var v=+/w$/.test(n),w=+/^n/.test(n);t=[e[1-v][0]-s[0],e[1-w][1]-s[1]],s[0]=e[v][0],s[1]=e[w][1]}else d3.event.altKey&&(r=s.slice());m.style("pointer-events","none").selectAll(".resize").style("display",null),d3.select("body").style("cursor",k.style("cursor")),l({type:"brushstart"}),A(),Y()}var a=$(g,"brushstart","brush","brushend"),b=null,c=null,d=d$[0],e=[[0,0],[0,0]],f;return g.x=function(a){return arguments.length?(b=a,d=d$[!b<<1|!c],g):b},g.y=function(a){return arguments.length?(c=a,d=d$[!b<<1|!c],g):c},g.extent=function(a){var d,h,i,j,k;return arguments.length?(f=[[0,0],[0,0]],b&&(d=a[0],h=a[1],c&&(d=d[0],h=h[0]),f[0][0]=d,f[1][0]=h,b.invert&&(d=b(d),h=b(h)),h<d&&(k=d,d=h,h=k),e[0][0]=d|0,e[1][0]=h|0),c&&(i=a[0],j=a[1],b&&(i=i[1],j=j[1]),f[0][1]=i,f[1][1]=j,c.invert&&(i=c(i),j=c(j)),j<i&&(k=i,i=j,j=k),e[0][1]=i|0,e[1][1]=j|0),g):(a=f||e,b&&(d=a[0][0],h=a[1][0],f||(d=e[0][0],h=e[1][0],b.invert&&(d=b.invert(d),h=b.invert(h)),h<d&&(k=d,d=h,h=k))),c&&(i=a[0][1],j=a[1][1],f||(i=e[0][1],j=e[1][1],c.invert&&(i=c.invert(i),j=c.invert(j)),j<i&&(k=i,i=j,j=k))),b&&c?[[d,i],[h,j]]:b?[d,h]:c&&[i,j])},g.clear=function(){return f=null,e[0][0]=e[0][1]=e[1][0]=e[1][1]=0,g},g.empty=function(){return b&&e[0][0]===e[1][0]||c&&e[0][1]===e[1][1]},d3.rebind(g,a,"on")};var dZ={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},d$=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={},d3.behavior.drag=function(){function c(){this.on("mousedown.drag",d).on("touchstart.drag",d)}function d(){function j(){var a=c.parentNode,b=d3.event.changedTouches;return b?d3.touches(a,b)[0]:d3.mouse(a)}function k(){if(!c.parentNode)return l();var a=j(),b=a[0]-g[0],e=a[1]-g[1];h|=b|e,g=a,Y(),d({type:"drag",x:a[0]+f[0],y:a[1]+f[1],dx:b,dy:e})}function l(){d({type:"dragend"}),h&&(Y(),d3.event.target===e&&i.on("click.drag",m,!0)),i.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function m(){Y(),i.on("click.drag",null)}var c=this,d=a.of(c,arguments),e=d3.event.target,f,g=j(),h=0,i=d3.select(window).on("mousemove.drag",k).on("touchmove.drag",k).on("mouseup.drag",l,!0).on("touchend.drag",l,!0);b?(f=b.apply(c,arguments),f=[f.x-g[0],f.y-g[1]]):f=[0,0],Y(),d({type:"dragstart"})}var a=$(c,"drag","dragstart","dragend"),b=null;return c.origin=function(a){return arguments.length?(b=a,c):b},d3.rebind(c,a,"on")},d3.behavior.zoom=function(){function l(){this.on("mousedown.zoom",r).on("mousewheel.zoom",s).on("mousemove.zoom",t).on("DOMMouseScroll.zoom",s).on("dblclick.zoom",u).on("touchstart.zoom",v).on("touchmove.zoom",w).on("touchend.zoom",v)}function m(b){return[(b[0]-a[0])/c,(b[1]-a[1])/c]}function n(b){return[b[0]*c+a[0],b[1]*c+a[1]]}function o(a){c=Math.max(e[0],Math.min(e[1],a))}function p(b,c){c=n(c),a[0]+=b[0]-c[0],a[1]+=b[1]-c[1]}function q(b){h&&h.domain(g.range().map(function(b){return(b-a[0])/c}).map(g.invert)),j&&j.domain(i.range().map(function(b){return(b-a[1])/c}).map(i.invert)),d3.event.preventDefault(),b({type:"zoom",scale:c,translate:a})}function r(){function h(){d=1,p(d3.mouse(a),g),q(b)}function i(){d&&Y(),e.on("mousemove.zoom",null).on("mouseup.zoom",null),d&&d3.event.target===c&&e.on("click.zoom",j,!0)}function j(){Y(),e.on("click.zoom",null)}var a=this,b=f.of(a,arguments),c=d3.event.target,d=0,e=d3.select(window).on("mousemove.zoom",h).on("mouseup.zoom",i),g=m(d3.mouse(a));window.focus(),Y()}function s(){b||(b=m(d3.mouse(this))),o(Math.pow(2,eb()*.002)*c),p(d3.mouse(this),b),q(f.of(this,arguments))}function t(){b=null}function u(){var a=d3.mouse(this),b=m(a);o(d3.event.shiftKey?c/2:c*2),p(a,b),q(f.of(this,arguments))}function v(){var a=d3.touches(this),e=Date.now();d=c,b={},a.forEach(function(a){b[a.identifier]=m(a)}),Y();if(a.length===1){if(e-k<500){var g=a[0],h=m(a[0]);o(c*2),p(g,h),q(f.of(this,arguments))}k=e}}function w(){var a=d3.touches(this),c=a[0],e=b[c.identifier];if(g=a[1]){var g,h=b[g.identifier];c=[(c[0]+g[0])/2,(c[1]+g[1])/2],e=[(e[0]+h[0])/2,(e[1]+h[1])/2],o(d3.event.scale*d)}p(c,e),k=null,q(f.of(this,arguments))}var a=[0,0],b,c=1,d,e=ea,f=$(l,"zoom"),g,h,i,j,k;return l.translate=function(b){return arguments.length?(a=b.map(Number),l):a},l.scale=function(a){return arguments.length?(c=+a,l):c},l.scaleExtent=function(a){return arguments.length?(e=a==null?ea:a.map(Number),l):e},l.x=function(a){return arguments.length?(h=a,g=a.copy(),l):h},l.y=function(a){return arguments.length?(j=a,i=a.copy(),l):j},d3.rebind(l,f,"on")};var d_,ea=[0,Infinity];d3.layout={},d3.layout.bundle=function(){return function(a){var b=[],c=-1,d=a.length;while(++c<d)b.push(ec(a[c]));return b}},d3.layout.chord=function(){function j(){var a={},j=[],l=d3.range(e),m=[],n,o,p,q,r;b=[],c=[],n=0,q=-1;while(++q<e){o=0,r=-1;while(++r<e)o+=d[q][r];j.push(o),m.push(d3.range(e)),n+=o}g&&l.sort(function(a,b){return g(j[a],j[b])}),h&&m.forEach(function(a,b){a.sort(function(a,c){return h(d[b][a],d[b][c])})}),n=(2*Math.PI-f*e)/n,o=0,q=-1;while(++q<e){p=o,r=-1;while(++r<e){var s=l[q],t=m[s][r],u=d[s][t],v=o,w=o+=u*n;a[s+"-"+t]={index:s,subindex:t,startAngle:v,endAngle:w,value:u}}c[s]={index:s,startAngle:p,endAngle:o,value:(o-p)/n},o+=f}q=-1;while(++q<e){r=q-1;while(++r<e){var x=a[q+"-"+r],y=a[r+"-"+q];(x.value||y.value)&&b.push(x.value<y.value?{source:y,target:x}:{source:x,target:y})}}i&&k()}function k(){b.sort(function(a,b){return i((a.source.value+a.target.value)/2,(b.source.value+b.target.value)/2)})}var a={},b,c,d,e,f=0,g,h,i;return a.matrix=function(f){return arguments.length?(e=(d=f)&&d.length,b=c=null,a):d},a.padding=function(d){return arguments.length?(f=d,b=c=null,a):f},a.sortGroups=function(d){return arguments.length?(g=d,b=c=null,a):g},a.sortSubgroups=function(c){return arguments.length?(h=c,b=null,a):h},a.sortChords=function(c){return arguments.length?(i=c,b&&k(),a):i},a.chords=function(){return b||j(),b},a.groups=function(){return c||j(),c},a},d3.layout.force=function(){function t(a){return function(b,c,d,e,f){if(b.point!==a){var g=b.cx-a.x,h=b.cy-a.y,i=1/Math.sqrt(g*g+h*h);if((e-c)*i<k){var j=b.charge*i*i;return a.px-=g*j,a.py-=h*j,!0}if(b.point&&isFinite(i)){var j=b.pointCharge*i*i;a.px-=g*j,a.py-=h*j}}return!b.charge}}function u(b){eh(eg=b),ef=a}var a={},b=d3.dispatch("start","tick","end"),c=[1,1],d,e,f=.9,g=em,h=en,i=-30,j=.1,k=.8,l,n=[],o=[],q,r,s;return a.tick=function(){if((e*=.99)<.005)return b.end({type:"end",alpha:e=0}),!0;var a=n.length,d=o.length,g,h,k,l,m,p,u,v,w;for(h=0;h<d;++h){k=o[h],l=k.source,m=k.target,v=m.x-l.x,w=m.y-l.y;if(p=v*v+w*w)p=e*r[h]*((p=Math.sqrt(p))-q[h])/p,v*=p,w*=p,m.x-=v*(u=l.weight/(m.weight+l.weight)),m.y-=w*u,l.x+=v*(u=1-u),l.y+=w*u}if(u=e*j){v=c[0]/2,w=c[1]/2,h=-1;if(u)while(++h<a)k=n[h],k.x+=(v-k.x)*u,k.y+=(w-k.y)*u}if(i){el(g=d3.geom.quadtree(n),e,s),h=-1;while(++h<a)(k=n[h]).fixed||g.visit(t(k))}h=-1;while(++h<a)k=n[h],k.fixed?(k.x=k.px,k.y=k.py):(k.x-=(k.px-(k.px=k.x))*f,k.y-=(k.py-(k.py=k.y))*f);b.tick({type:"tick",alpha:e})},a.nodes=function(b){return arguments.length?(n=b,a):n},a.links=function(b){return arguments.length?(o=b,a):o},a.size=function(b){return arguments.length?(c=b,a):c},a.linkDistance=function(b){return arguments.length?(g=p(b),a):g},a.distance=a.linkDistance,a.linkStrength=function(b){return arguments.length?(h=p(b),a):h},a.friction=function(b){return arguments.length?(f=b,a):f},a.charge=function(b){return arguments.length?(i=typeof b=="function"?b:+b,a):i},a.gravity=function(b){return arguments.length?(j=b,a):j},a.theta=function(b){return arguments.length?(k=b,a):k},a.alpha=function(c){return arguments.length?(e?c>0?e=c:e=0:c>0&&(b.start({type:"start",alpha:e=c}),d3.timer(a.tick)),a):e},a.start=function(){function p(a,c){var d=t(b),e=-1,f=d.length,g;while(++e<f)if(!isNaN(g=d[e][a]))return g;return Math.random()*c}function t(){if(!l){l=[];for(d=0;d<e;++d)l[d]=[];for(d=0;d<f;++d){var a=o[d];l[a.source.index].push(a.target),l[a.target.index].push(a.source)}}return l[b]}var b,d,e=n.length,f=o.length,j=c[0],k=c[1],l,m;for(b=0;b<e;++b)(m=n[b]).index=b,m.weight=0;q=[],r=[];for(b=0;b<f;++b)m=o[b],typeof m.source=="number"&&(m.source=n[m.source]),typeof m.target=="number"&&(m.target=n[m.target]),q[b]=g.call(this,m,b),r[b]=h.call(this,m,b),++m.source.weight,++m.target.weight;for(b=0;b<e;++b)m=n[b],isNaN(m.x)&&(m.x=p("x",j)),isNaN(m.y)&&(m.y=p("y",k)),isNaN(m.px)&&(m.px=m.x),isNaN(m.py)&&(m.py=m.y);s=[];if(typeof i=="function")for(b=0;b<e;++b)s[b]=+i.call(this,n[b],b);else for(b=0;b<e;++b)s[b]=i;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){d||(d=d3.behavior.drag().origin(m).on("dragstart",u).on("drag",ek).on("dragend",ej)),this.on("mouseover.force",eh).on("mouseout.force",ei).call(d)},d3.rebind(a,b,"on")};var ef,eg;d3.layout.partition=function(){function c(a,b,d,e){var f=a.children;a.x=b,a.y=a.depth*e,a.dx=d,a.dy=e;if(f&&(h=f.length)){var g=-1,h,i,j;d=a.value?d/a.value:0;while(++g<h)c(i=f[g],b,j=i.value*d,e),b+=j}}function d(a){var b=a.children,c=0;if(b&&(f=b.length)){var e=-1,f;while(++e<f)c=Math.max(c,d(b[e]))}return 1+c}function e(e,f){var g=a.call(this,e,f);return c(g[0],0,b[0],b[1]/d(g[0])),g}var a=d3.layout.hierarchy(),b=[1,1];return e.size=function(a){return arguments.length?(b=a,e):b},eC(e,a)},d3.layout.pie=function(){function e(f,g){var h=f.map(function(b,c){return+a.call(e,b,c)}),i=+(typeof c=="function"?c.apply(this,arguments):c),j=((typeof d=="function"?d.apply(this,arguments):d)-c)/d3.sum(h),k=d3.range(f.length);b!=null&&k.sort(b===eo?function(a,b){return h[b]-h[a]}:function(a,c){return b(f[a],f[c])});var l=[];return k.forEach(function(a){var b;l[a]={data:f[a],value:b=h[a],startAngle:i,endAngle:i+=b*j}}),l}var a=Number,b=eo,c=0,d=2*Math.PI;return e.value=function(b){return arguments.length?(a=b,e):a},e.sort=function(a){return arguments.length?(b=a,e):b},e.startAngle=function(a){return arguments.length?(c=a,e):c},e.endAngle=function(a){return arguments.length?(d=a,e):d},e};var eo={};d3.layout.stack=function(){function g(h,i){var j=h.map(function(b,c){return a.call(g,b,c)}),k=j.map(function(a,b){return a.map(function(a,b){return[e.call(g,a,b),f.call(g,a,b)]})}),l=b.call(g,k,i);j=d3.permute(j,l),k=d3.permute(k,l);var m=c.call(g,k,i),n=j.length,o=j[0].length,p,q,r;for(q=0;q<o;++q){d.call(g,j[0][q],r=m[q],k[0][q][1]);for(p=1;p<n;++p)d.call(g,j[p][q],r+=k[p-1][q][1],k[p][q][1])}return h}var a=m,b=eu,c=ev,d=er,e=ep,f=eq;return g.values=function(b){return arguments.length?(a=b,g):a},g.order=function(a){return arguments.length?(b=typeof a=="function"?a:es.get(a)||eu,g):b},g.offset=function(a){return arguments.length?(c=typeof a=="function"?a:et.get(a)||ev,g):c},g.x=function(a){return arguments.length?(e=a,g):e},g.y=function(a){return arguments.length?(f=a,g):f},g.out=function(a){return arguments.length?(d=a,g):d},g};var es=d3.map({"inside-out":function(a){var b=a.length,c,d,e=a.map(ew),f=a.map(ex),g=d3.range(b).sort(function(a,b){return e[a]-e[b]}),h=0,i=0,j=[],k=[];for(c=0;c<b;++c)d=g[c],h<i?(h+=f[d],j.push(d)):(i+=f[d],k.push(d));return k.reverse().concat(j)},reverse:function(a){return d3.range(a.length).reverse()},"default":eu}),et=d3.map({silhouette:function(a){var b=a.length,c=a[0].length,d=[],e=0,f,g,h,i=[];for(g=0;g<c;++g){for(f=0,h=0;f<b;f++)h+=a[f][g][1];h>e&&(e=h),d.push(h)}for(g=0;g<c;++g)i[g]=(e-d[g])/2;return i},wiggle:function(a){var b=a.length,c=a[0],d=c.length,e=0,f,g,h,i,j,k,l,m,n,o=[];o[0]=m=n=0;for(g=1;g<d;++g){for(f=0,i=0;f<b;++f)i+=a[f][g][1];for(f=0,j=0,l=c[g][0]-c[g-1][0];f<b;++f){for(h=0,k=(a[f][g][1]-a[f][g-1][1])/(2*l);h<f;++h)k+=(a[h][g][1]-a[h][g-1][1])/l;j+=k*a[f][g][1]}o[g]=m-=i?j/i*l:0,m<n&&(n=m)}for(g=0;g<d;++g)o[g]-=n;return o},expand:function(a){var b=a.length,c=a[0].length,d=1/b,e,f,g,h=[];for(f=0;f<c;++f){for(e=0,g=0;e<b;e++)g+=a[e][f][1];if(g)for(e=0;e<b;e++)a[e][f][1]/=g;else for(e=0;e<b;e++)a[e][f][1]=d}for(f=0;f<c;++f)h[f]=0;return h},zero:ev});d3.layout.histogram=function(){function e(e,f){var g=[],h=e.map(b,this),i=c.call(this,h,f),j=d.call(this,i,h,f),k,f=-1,l=h.length,m=j.length-1,n=a?1:1/l,o;while(++f<m)k=g[f]=[],k.dx=j[f+1]-(k.x=j[f]),k.y=0;if(m>0){f=-1;while(++f<l)o=h[f],o>=i[0]&&o<=i[1]&&(k=g[d3.bisect(j,o,1,m)-1],k.y+=n,k.push(e[f]))}return g}var a=!0,b=Number,c=eB,d=ez;return e.value=function(a){return arguments.length?(b=a,e):b},e.range=function(a){return arguments.length?(c=p(a),e):c},e.bins=function(a){return arguments.length?(d=typeof a=="number"?function(b){return eA(b,a)}:p(a),e):d},e.frequency=function(b){return arguments.length?(a=!!b,e):a},e},d3.layout.hierarchy=function(){function d(e,g,h){var i=b.call(f,e,g),j=eH?e:{data:e};j.depth=g,h.push(j);if(i&&(l=i.length)){var k=-1,l,m=j.children=[],n=0,o=g+1,p;while(++k<l)p=d(i[k],o,h),p.parent=j,m.push(p),n+=p.value;a&&m.sort(a),c&&(j.value=n)}else c&&(j.value=+c.call(f,e,g)||0);return j}function e(a,b){var d=a.children,g=0;if(d&&(i=d.length)){var h=-1,i,j=b+1;while(++h<i)g+=e(d[h],j)}else c&&(g=+c.call(f,eH?a:a.data,b)||0);return c&&(a.value=g),g}function f(a){var b=[];return d(a,0,b),b}var a=eF,b=eD,c=eE;return f.sort=function(b){return arguments.length?(a=b,f):a},f.children=function(a){return arguments.length?(b=a,f):b},f.value=function(a){return arguments.length?(c=a,f):c},f.revalue=function(a){return e(a,0),a},f};var eH=!1;d3.layout.pack=function(){function d(d,e){var f=a.call(this,d,e),g=f[0];g.x=0,g.y=0,fa(g,function(a){a.r=Math.sqrt(a.value)}),fa(g,eM);var h=c[0],i=c[1],j=Math.max(2*g.r/h,2*g.r/i);if(b>0){var k=b*j/2;fa(g,function(a){a.r+=k}),fa(g,eM),fa(g,function(a){a.r-=k}),j=Math.max(2*g.r/h,2*g.r/i)}return eP(g,h/2,i/2,1/j),f}var a=d3.layout.hierarchy().sort(eI),b=0,c=[1,1];return d.size=function(a){return arguments.length?(c=a,d):c},d.padding=function(a){return arguments.length?(b=+a,d):b},eC(d,a)},d3.layout.cluster=function(){function d(d,e){var f=a.call(this,d,e),g=f[0],h,i=0,j,k;fa(g,function(a){var c=a.children;c&&c.length?(a.x=eS(c),a.y=eR(c)):(a.x=h?i+=b(a,h):0,a.y=0,h=a)});var l=eT(g),m=eU(g),n=l.x-b(l,m)/2,o=m.x+b(m,l)/2;return fa(g,function(a){a.x=(a.x-n)/(o-n)*c[0],a.y=(1-(g.y?a.y/g.y:1))*c[1]}),f}var a=d3.layout.hierarchy().sort(null).value(null),b=eV,c=[1,1];return d.separation=function(a){return arguments.length?(b=a,d):b},d.size=function(a){return arguments.length?(c=a,d):c},eC(d,a)},d3.layout.tree=function(){function d(d,e){function h(a,c){var d=a.children,e=a._tree;if(d&&(f=d.length)){var f,g=d[0],i,k=g,l,m=-1;while(++m<f)l=d[m],h(l,i),k=j(l,i,k),i=l;fb(a);var n=.5*(g._tree.prelim+l._tree.prelim);c?(e.prelim=c._tree.prelim+b(a,c),e.mod=e.prelim-n):e.prelim=n}else c&&(e.prelim=c._tree.prelim+b(a,c))}function i(a,b){a.x=a._tree.prelim+b;var c=a.children;if(c&&(e=c.length)){var d=-1,e;b+=a._tree.mod;while(++d<e)i(c[d],b)}}function j(a,c,d){if(c){var e=a,f=a,g=c,h=a.parent.children[0],i=e._tree.mod,j=f._tree.mod,k=g._tree.mod,l=h._tree.mod,m;while(g=eX(g),e=eW(e),g&&e)h=eW(h),f=eX(f),f._tree.ancestor=a,m=g._tree.prelim+k-e._tree.prelim-i+b(g,e),m>0&&(fc(fd(g,a,d),a,m),i+=m,j+=m),k+=g._tree.mod,i+=e._tree.mod,l+=h._tree.mod,j+=f._tree.mod;g&&!eX(f)&&(f._tree.thread=g,f._tree.mod+=k-j),e&&!eW(h)&&(h._tree.thread=e,h._tree.mod+=i-l,d=a)}return d}var f=a.call(this,d,e),g=f[0];fa(g,function(a,b){a._tree={ancestor:a,prelim:0,mod:0,change:0,shift:0,number:b?b._tree.number+1:0}}),h(g),i(g,-g._tree.prelim);var k=eY(g,e$),l=eY(g,eZ),m=eY(g,e_),n=k.x-b(k,l)/2,o=l.x+b(l,k)/2,p=m.depth||1;return fa(g,function(a){a.x=(a.x-n)/(o-n)*c[0],a.y=a.depth/p*c[1],delete a._tree}),f}var a=d3.layout.hierarchy().sort(null).value(null),b=eV,c=[1,1];return d.separation=function(a){return arguments.length?(b=a,d):b},d.size=function(a){return arguments.length?(c=a,d):c},eC(d,a)},d3.layout.treemap=function(){function i(a,b){var c=-1,d=a.length,e,f;while(++c<d)f=(e=a[c]).value*(b<0?0:b),e.area=isNaN(f)||f<=0?0:f}function j(a){var b=a.children;if(b&&b.length){var c=e(a),d=[],f=b.slice(),g,h=Infinity,k,n=Math.min(c.dx,c.dy),o;i(f,c.dx*c.dy/a.value),d.area=0;while((o=f.length)>0)d.push(g=f[o-1]),d.area+=g.area,(k=l(d,n))<=h?(f.pop(),h=k):(d.area-=d.pop().area,m(d,n,c,!1),n=Math.min(c.dx,c.dy),d.length=d.area=0,h=Infinity);d.length&&(m(d,n,c,!0),d.length=d.area=0),b.forEach(j)}}function k(a){var b=a.children;if(b&&b.length){var c=e(a),d=b.slice(),f,g=[];i(d,c.dx*c.dy/a.value),g.area=0;while(f=d.pop())g.push(f),g.area+=f.area,f.z!=null&&(m(g,f.z?c.dx:c.dy,c,!d.length),g.length=g.area=0);b.forEach(k)}}function l(a,b){var c=a.area,d,e=0,f=Infinity,g=-1,i=a.length;while(++g<i){if(!(d=a[g].area))continue;d<f&&(f=d),d>e&&(e=d)}return c*=c,b*=b,c?Math.max(b*e*h/c,c/(b*f*h)):Infinity}function m(a,c,d,e){var f=-1,g=a.length,h=d.x,i=d.y,j=c?b(a.area/c):0,k;if(c==d.dx){if(e||j>d.dy)j=d.dy;while(++f<g)k=a[f],k.x=h,k.y=i,k.dy=j,h+=k.dx=Math.min(d.x+d.dx-h,j?b(k.area/j):0);k.z=!0,k.dx+=d.x+d.dx-h,d.y+=j,d.dy-=j}else{if(e||j>d.dx)j=d.dx;while(++f<g)k=a[f],k.x=h,k.y=i,k.dx=j,i+=k.dy=Math.min(d.y+d.dy-i,j?b(k.area/j):0);k.z=!1,k.dy+=d.y+d.dy-i,d.x+=j,d.dx-=j}}function n(b){var d=g||a(b),e=d[0];return e.x=0,e.y=0,e.dx=c[0],e.dy=c[1],g&&a.revalue(e),i([e],e.dx*e.dy/e.value),(g?k:j)(e),f&&(g=d),d}var a=d3.layout.hierarchy(),b=Math.round,c=[1,1],d=null,e=fe,f=!1,g,h=.5*(1+Math.sqrt(5));return n.size=function(a){return arguments.length?(c=a,n):c},n.padding=function(a){function b(b){var c=a.call(n,b,b.depth);return c==null?fe(b):ff(b,typeof c=="number"?[c,c,c,c]:c)}function c(b){return ff(b,a)}if(!arguments.length)return d;var f;return e=(d=a)==null?fe:(f=typeof a)==="function"?b:f==="number"?(a=[a,a,a,a],c):c,n},n.round=function(a){return arguments.length?(b=a?Math.round:Number,n):b!=Number},n.sticky=function(a){return arguments.length?(f=a,g=null,n):f},n.ratio=function(a){return arguments.length?(h=a,n):h},eC(n,a)},d3.csv=fg(",","text/csv"),d3.tsv=fg("\t","text/tab-separated-values"),d3.geo={};var fh=Math.PI/180;d3.geo.azimuthal=function(){function i(b){var f=b[0]*fh-e,i=b[1]*fh,j=Math.cos(f),k=Math.sin(f),l=Math.cos(i),m=Math.sin(i),n=a!=="orthographic"?h*m+g*l*j:null,o,p=a==="stereographic"?1/(1+n):a==="gnomonic"?1/n:a==="equidistant"?(o=Math.acos(n),o?o/Math.sin(o):0):a==="equalarea"?Math.sqrt(2/(1+n)):1,q=p*l*k,r=p*(h*l*j-g*m);return[c*q+d[0],c*r+d[1]]}var a="orthographic",b,c=200,d=[480,250],e,f,g,h;return i.invert=function(b){var f=(b[0]-d[0])/c,i=(b[1]-d[1])/c,j=Math.sqrt(f*f+i*i),k=a==="stereographic"?2*Math.atan(j):a==="gnomonic"?Math.atan(j):a==="equidistant"?j:a==="equalarea"?2*Math.asin(.5*j):Math.asin(j),l=Math.sin(k),m=Math.cos(k);return[(e+Math.atan2(f*l,j*g*m+i*h*l))/fh,Math.asin(m*h-(j?i*l*g/j:0))/fh]},i.mode=function(b){return arguments.length?(a=b+"",i):a},i.origin=function(a){return arguments.length?(b=a,e=b[0]*fh,f=b[1]*fh,g=Math.cos(f),h=Math.sin(f),i):b},i.scale=function(a){return arguments.length?(c=+a,i):c},i.translate=function(a){return arguments.length?(d=[+a[0],+a[1]],i):d},i.origin([0,0])},d3.geo.albers=function(){function i(a){var b=f*(fh*a[0]-e),i=Math.sqrt(g-2*f*Math.sin(fh*a[1]))/f;return[c*i*Math.sin(b)+d[0],c*(i*Math.cos(b)-h)+d[1]]}function j(){var c=fh*b[0],d=fh*b[1],j=fh*a[1],k=Math.sin(c),l=Math.cos(c);return e=fh*a[0],f=.5*(k+Math.sin(d)),g=l*l+2*f*k,h=Math.sqrt(g-2*f*Math.sin(j))/f,i}var a=[-98,38],b=[29.5,45.5],c=1e3,d=[480,250],e,f,g,h;return i.invert=function(a){var b=(a[0]-d[0])/c,i=(a[1]-d[1])/c,j=h+i,k=Math.atan2(b,j),l=Math.sqrt(b*b+j*j);return[(e+k/f)/fh,Math.asin((g-l*l*f*f)/(2*f))/fh]},i.origin=function(b){return arguments.length?(a=[+b[0],+b[1]],j()):a},i.parallels=function(a){return arguments.length?(b=[+a[0],+a[1]],j()):b},i.scale=function(a){return arguments.length?(c=+a,i):c},i.translate=function(a){return arguments.length?(d=[+a[0],+a[1]],i):d},j()},d3.geo.albersUsa=function(){function e(e){var f=e[0],g=e[1];return(g>50?b:f<-140?c:g<21?d:a)(e)}var a=d3.geo.albers(),b=d3.geo.albers().origin([-160,60]).parallels([55,65]),c=d3.geo.albers().origin([-160,20]).parallels([8,18]),d=d3.geo.albers().origin([-60,10]).parallels([8,18]);return e.scale=function(f){return arguments.length?(a.scale(f),b.scale(f*.6),c.scale(f),d.scale(f*1.5),e.translate(a.translate())):a.scale()},e.translate=function(f){if(!arguments.length)return a.translate();var g=a.scale()/1e3,h=f[0],i=f[1];return a.translate(f),b.translate([h-400*g,i+170*g]),c.translate([h-190*g,i+200*g]),d.translate([h+580*g,i+430*g]),e},e.scale(a.scale())},d3.geo.bonne=function(){function g(g){var h=g[0]*fh-c,i=g[1]*fh-d;if(e){var j=f+e-i,k=h*Math.cos(i)/j;h=j*Math.sin(k),i=j*Math.cos(k)-f}else h*=Math.cos(i),i*=-1;return[a*h+b[0],a*i+b[1]]}var a=200,b=[480,250],c,d,e,f;return g.invert=function(d){var g=(d[0]-b[0])/a,h=(d[1]-b[1])/a;if(e){var i=f+h,j=Math.sqrt(g*g+i*i);h=f+e-j,g=c+j*Math.atan2(g,i)/Math.cos(h)}else h*=-1,g/=Math.cos(h);return[g/fh,h/fh]},g.parallel=function(a){return arguments.length?(f=1/
Math.tan(e=a*fh),g):e/fh},g.origin=function(a){return arguments.length?(c=a[0]*fh,d=a[1]*fh,g):[c/fh,d/fh]},g.scale=function(b){return arguments.length?(a=+b,g):a},g.translate=function(a){return arguments.length?(b=[+a[0],+a[1]],g):b},g.origin([0,0]).parallel(45)},d3.geo.equirectangular=function(){function c(c){var d=c[0]/360,e=-c[1]/360;return[a*d+b[0],a*e+b[1]]}var a=500,b=[480,250];return c.invert=function(c){var d=(c[0]-b[0])/a,e=(c[1]-b[1])/a;return[360*d,-360*e]},c.scale=function(b){return arguments.length?(a=+b,c):a},c.translate=function(a){return arguments.length?(b=[+a[0],+a[1]],c):b},c},d3.geo.mercator=function(){function c(c){var d=c[0]/360,e=-(Math.log(Math.tan(Math.PI/4+c[1]*fh/2))/fh)/360;return[a*d+b[0],a*Math.max(-0.5,Math.min(.5,e))+b[1]]}var a=500,b=[480,250];return c.invert=function(c){var d=(c[0]-b[0])/a,e=(c[1]-b[1])/a;return[360*d,2*Math.atan(Math.exp(-360*e*fh))/fh-90]},c.scale=function(b){return arguments.length?(a=+b,c):a},c.translate=function(a){return arguments.length?(b=[+a[0],+a[1]],c):b},c},d3.geo.path=function(){function e(c,e){typeof a=="function"&&(b=fj(a.apply(this,arguments))),g(c);var f=d.length?d.join(""):null;return d=[],f}function f(a){return c(a).join(",")}function i(a){var b=l(a[0]),c=0,d=a.length;while(++c<d)b-=l(a[c]);return b}function j(a){var b=d3.geom.polygon(a[0].map(c)),d=b.area(),e=b.centroid(d<0?(d*=-1,1):-1),f=e[0],g=e[1],h=d,i=0,j=a.length;while(++i<j)b=d3.geom.polygon(a[i].map(c)),d=b.area(),e=b.centroid(d<0?(d*=-1,1):-1),f-=e[0],g-=e[1],h-=d;return[f,g,6*h]}function l(a){return Math.abs(d3.geom.polygon(a.map(c)).area())}var a=4.5,b=fj(a),c=d3.geo.albersUsa(),d=[],g=fi({FeatureCollection:function(a){var b=a.features,c=-1,e=b.length;while(++c<e)d.push(g(b[c].geometry))},Feature:function(a){g(a.geometry)},Point:function(a){d.push("M",f(a.coordinates),b)},MultiPoint:function(a){var c=a.coordinates,e=-1,g=c.length;while(++e<g)d.push("M",f(c[e]),b)},LineString:function(a){var b=a.coordinates,c=-1,e=b.length;d.push("M");while(++c<e)d.push(f(b[c]),"L");d.pop()},MultiLineString:function(a){var b=a.coordinates,c=-1,e=b.length,g,h,i;while(++c<e){g=b[c],h=-1,i=g.length,d.push("M");while(++h<i)d.push(f(g[h]),"L");d.pop()}},Polygon:function(a){var b=a.coordinates,c=-1,e=b.length,g,h,i;while(++c<e){g=b[c],h=-1;if((i=g.length-1)>0){d.push("M");while(++h<i)d.push(f(g[h]),"L");d[d.length-1]="Z"}}},MultiPolygon:function(a){var b=a.coordinates,c=-1,e=b.length,g,h,i,j,k,l;while(++c<e){g=b[c],h=-1,i=g.length;while(++h<i){j=g[h],k=-1;if((l=j.length-1)>0){d.push("M");while(++k<l)d.push(f(j[k]),"L");d[d.length-1]="Z"}}}},GeometryCollection:function(a){var b=a.geometries,c=-1,e=b.length;while(++c<e)d.push(g(b[c]))}}),h=e.area=fi({FeatureCollection:function(a){var b=0,c=a.features,d=-1,e=c.length;while(++d<e)b+=h(c[d]);return b},Feature:function(a){return h(a.geometry)},Polygon:function(a){return i(a.coordinates)},MultiPolygon:function(a){var b=0,c=a.coordinates,d=-1,e=c.length;while(++d<e)b+=i(c[d]);return b},GeometryCollection:function(a){var b=0,c=a.geometries,d=-1,e=c.length;while(++d<e)b+=h(c[d]);return b}},0),k=e.centroid=fi({Feature:function(a){return k(a.geometry)},Polygon:function(a){var b=j(a.coordinates);return[b[0]/b[2],b[1]/b[2]]},MultiPolygon:function(a){var b=0,c=a.coordinates,d,e=0,f=0,g=0,h=-1,i=c.length;while(++h<i)d=j(c[h]),e+=d[0],f+=d[1],g+=d[2];return[e/g,f/g]}});return e.projection=function(a){return c=a,e},e.pointRadius=function(c){return typeof c=="function"?a=c:(a=+c,b=fj(a)),e},e},d3.geo.bounds=function(a){var b=Infinity,c=Infinity,d=-Infinity,e=-Infinity;return fk(a,function(a,f){a<b&&(b=a),a>d&&(d=a),f<c&&(c=f),f>e&&(e=f)}),[[b,c],[d,e]]};var fl={Feature:fm,FeatureCollection:fn,GeometryCollection:fo,LineString:fp,MultiLineString:fq,MultiPoint:fp,MultiPolygon:fr,Point:fs,Polygon:ft};d3.geo.circle=function(){function e(){}function f(a){return d.distance(a)<c}function h(a){var b=-1,e=a.length,f=[],g,h,j,k,l;while(++b<e)l=d.distance(j=a[b]),l<c?(h&&f.push(fx(h,j)((k-c)/(k-l))),f.push(j),g=h=null):(h=j,!g&&f.length&&(f.push(fx(f[f.length-1],h)((c-k)/(l-k))),g=h)),k=l;return g=a[0],h=f[0],h&&j[0]===g[0]&&j[1]===g[1]&&(j[0]!==h[0]||j[1]!==h[1])&&f.push(h),i(f)}function i(a){var b=0,c=a.length,e,f,g=c?[a[0]]:a,h,i=d.source();while(++b<c){h=d.source(a[b-1])(a[b]).coordinates;for(e=0,f=h.length;++e<f;)g.push(h[e])}return d.source(i),g}var a=[0,0],b=89.99,c=b*fh,d=d3.geo.greatArc().source(a).target(m);e.clip=function(b){return typeof a=="function"&&d.source(a.apply(this,arguments)),g(b)||null};var g=fi({FeatureCollection:function(a){var b=a.features.map(g).filter(m);return b&&(a=Object.create(a),a.features=b,a)},Feature:function(a){var b=g(a.geometry);return b&&(a=Object.create(a),a.geometry=b,a)},Point:function(a){return f(a.coordinates)&&a},MultiPoint:function(a){var b=a.coordinates.filter(f);return b.length&&{type:a.type,coordinates:b}},LineString:function(a){var b=h(a.coordinates);return b.length&&(a=Object.create(a),a.coordinates=b,a)},MultiLineString:function(a){var b=a.coordinates.map(h).filter(function(a){return a.length});return b.length&&(a=Object.create(a),a.coordinates=b,a)},Polygon:function(a){var b=a.coordinates.map(h);return b[0].length&&(a=Object.create(a),a.coordinates=b,a)},MultiPolygon:function(a){var b=a.coordinates.map(function(a){return a.map(h)}).filter(function(a){return a[0].length});return b.length&&(a=Object.create(a),a.coordinates=b,a)},GeometryCollection:function(a){var b=a.geometries.map(g).filter(m);return b.length&&(a=Object.create(a),a.geometries=b,a)}});return e.origin=function(b){return arguments.length?(a=b,typeof a!="function"&&d.source(a),e):a},e.angle=function(a){return arguments.length?(c=(b=+a)*fh,e):b},d3.rebind(e,d,"precision")},d3.geo.greatArc=function(){function g(){var a=g.distance.apply(this,arguments),c=0,h=e/a,i=[b];while((c+=h)<1)i.push(f(c));return i.push(d),{type:"LineString",coordinates:i}}var a=fu,b,c=fv,d,e=6*fh,f=fw();return g.distance=function(){return typeof a=="function"&&f.source(b=a.apply(this,arguments)),typeof c=="function"&&f.target(d=c.apply(this,arguments)),f.distance()},g.source=function(c){return arguments.length?(a=c,typeof a!="function"&&f.source(b=a),g):a},g.target=function(a){return arguments.length?(c=a,typeof c!="function"&&f.target(d=c),g):c},g.precision=function(a){return arguments.length?(e=a*fh,g):e/fh},g},d3.geo.greatCircle=d3.geo.circle,d3.geom={},d3.geom.contour=function(a,b){var c=b||fA(a),d=[],e=c[0],f=c[1],g=0,h=0,i=NaN,j=NaN,k=0;do k=0,a(e-1,f-1)&&(k+=1),a(e,f-1)&&(k+=2),a(e-1,f)&&(k+=4),a(e,f)&&(k+=8),k===6?(g=j===-1?-1:1,h=0):k===9?(g=0,h=i===1?-1:1):(g=fy[k],h=fz[k]),g!=i&&h!=j&&(d.push([e,f]),i=g,j=h),e+=g,f+=h;while(c[0]!=e||c[1]!=f);return d};var fy=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],fz=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];d3.geom.hull=function(a){if(a.length<3)return[];var b=a.length,c=b-1,d=[],e=[],f,g,h=0,i,j,k,l,m,n,o,p;for(f=1;f<b;++f)a[f][1]<a[h][1]?h=f:a[f][1]==a[h][1]&&(h=a[f][0]<a[h][0]?f:h);for(f=0;f<b;++f){if(f===h)continue;j=a[f][1]-a[h][1],i=a[f][0]-a[h][0],d.push({angle:Math.atan2(j,i),index:f})}d.sort(function(a,b){return a.angle-b.angle}),o=d[0].angle,n=d[0].index,m=0;for(f=1;f<c;++f)g=d[f].index,o==d[f].angle?(i=a[n][0]-a[h][0],j=a[n][1]-a[h][1],k=a[g][0]-a[h][0],l=a[g][1]-a[h][1],i*i+j*j>=k*k+l*l?d[f].index=-1:(d[m].index=-1,o=d[f].angle,m=f,n=g)):(o=d[f].angle,m=f,n=g);e.push(h);for(f=0,g=0;f<2;++g)d[g].index!==-1&&(e.push(d[g].index),f++);p=e.length;for(;g<c;++g){if(d[g].index===-1)continue;while(!fB(e[p-2],e[p-1],d[g].index,a))--p;e[p++]=d[g].index}var q=[];for(f=0;f<p;++f)q.push(a[e[f]]);return q},d3.geom.polygon=function(a){return a.area=function(){var b=0,c=a.length,d=a[c-1][0]*a[0][1],e=a[c-1][1]*a[0][0];while(++b<c)d+=a[b-1][0]*a[b][1],e+=a[b-1][1]*a[b][0];return(e-d)*.5},a.centroid=function(b){var c=-1,d=a.length,e=0,f=0,g,h=a[d-1],i;arguments.length||(b=-1/(6*a.area()));while(++c<d)g=h,h=a[c],i=g[0]*h[1]-h[0]*g[1],e+=(g[0]+h[0])*i,f+=(g[1]+h[1])*i;return[e*b,f*b]},a.clip=function(b){var c,d=-1,e=a.length,f,g,h=a[e-1],i,j,k;while(++d<e){c=b.slice(),b.length=0,i=a[d],j=c[(g=c.length)-1],f=-1;while(++f<g)k=c[f],fC(k,h,i)?(fC(j,h,i)||b.push(fD(j,k,h,i)),b.push(k)):fC(j,h,i)&&b.push(fD(j,k,h,i)),j=k;h=i}return b},a},d3.geom.voronoi=function(a){var b=a.map(function(){return[]});return fF(a,function(a){var c,d,e,f,g,h;a.a===1&&a.b>=0?(c=a.ep.r,d=a.ep.l):(c=a.ep.l,d=a.ep.r),a.a===1?(g=c?c.y:-1e6,e=a.c-a.b*g,h=d?d.y:1e6,f=a.c-a.b*h):(e=c?c.x:-1e6,g=a.c-a.a*e,f=d?d.x:1e6,h=a.c-a.a*f);var i=[e,g],j=[f,h];b[a.region.l.index].push(i,j),b[a.region.r.index].push(i,j)}),b.map(function(b,c){var d=a[c][0],e=a[c][1];return b.forEach(function(a){a.angle=Math.atan2(a[0]-d,a[1]-e)}),b.sort(function(a,b){return a.angle-b.angle}).filter(function(a,c){return!c||a.angle-b[c-1].angle>1e-10})})};var fE={l:"r",r:"l"};d3.geom.delaunay=function(a){var b=a.map(function(){return[]}),c=[];return fF(a,function(c){b[c.region.l.index].push(a[c.region.r.index])}),b.forEach(function(b,d){var e=a[d],f=e[0],g=e[1];b.forEach(function(a){a.angle=Math.atan2(a[0]-f,a[1]-g)}),b.sort(function(a,b){return a.angle-b.angle});for(var h=0,i=b.length-1;h<i;h++)c.push([e,b[h],b[h+1]])}),c},d3.geom.quadtree=function(a,b,c,d,e){function k(a,b,c,d,e,f){if(isNaN(b.x)||isNaN(b.y))return;if(a.leaf){var g=a.point;g?Math.abs(g.x-b.x)+Math.abs(g.y-b.y)<.01?l(a,b,c,d,e,f):(a.point=null,l(a,g,c,d,e,f),l(a,b,c,d,e,f)):a.point=b}else l(a,b,c,d,e,f)}function l(a,b,c,d,e,f){var g=(c+e)*.5,h=(d+f)*.5,i=b.x>=g,j=b.y>=h,l=(j<<1)+i;a.leaf=!1,a=a.nodes[l]||(a.nodes[l]=fG()),i?c=g:e=g,j?d=h:f=h,k(a,b,c,d,e,f)}var f,g=-1,h=a.length;h&&isNaN(a[0].x)&&(a=a.map(fI));if(arguments.length<5)if(arguments.length===3)e=d=c,c=b;else{b=c=Infinity,d=e=-Infinity;while(++g<h)f=a[g],f.x<b&&(b=f.x),f.y<c&&(c=f.y),f.x>d&&(d=f.x),f.y>e&&(e=f.y);var i=d-b,j=e-c;i>j?e=c+i:d=b+j}var m=fG();return m.add=function(a){k(m,a,b,c,d,e)},m.visit=function(a){fH(a,m,b,c,d,e)},a.forEach(m.add),m},d3.time={};var fJ=Date,fK=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];fL.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){fM.setUTCDate.apply(this._,arguments)},setDay:function(){fM.setUTCDay.apply(this._,arguments)},setFullYear:function(){fM.setUTCFullYear.apply(this._,arguments)},setHours:function(){fM.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){fM.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){fM.setUTCMinutes.apply(this._,arguments)},setMonth:function(){fM.setUTCMonth.apply(this._,arguments)},setSeconds:function(){fM.setUTCSeconds.apply(this._,arguments)},setTime:function(){fM.setTime.apply(this._,arguments)}};var fM=Date.prototype,fN="%a %b %e %H:%M:%S %Y",fO="%m/%d/%y",fP="%H:%M:%S",fQ=fK,fR=fQ.map(fU),fS=["January","February","March","April","May","June","July","August","September","October","November","December"],fT=fS.map(fU);d3.time.format=function(a){function c(c){var d=[],e=-1,f=0,g,h;while(++e<b)a.charCodeAt(e)==37&&(d.push(a.substring(f,e),(h=gg[g=a.charAt(++e)])?h(c):g),f=e+1);return d.push(a.substring(f,e)),d.join("")}var b=a.length;return c.parse=function(b){var c={y:1900,m:0,d:1,H:0,M:0,S:0,L:0},d=fV(c,a,b,0);if(d!=b.length)return null;"p"in c&&(c.H=c.H%12+c.p*12);var e=new fJ;return e.setFullYear(c.y,c.m,c.d),e.setHours(c.H,c.M,c.S,c.L),e},c.toString=function(){return a},c};var fY=d3.format("02d"),fZ=d3.format("03d"),f$=d3.format("04d"),f_=d3.format("2d"),ga=fW(fQ),gb=fW(fR),gc=fW(fS),gd=fX(fS),ge=fW(fT),gf=fX(fT),gg={a:function(a){return fR[a.getDay()]},A:function(a){return fQ[a.getDay()]},b:function(a){return fT[a.getMonth()]},B:function(a){return fS[a.getMonth()]},c:d3.time.format(fN),d:function(a){return fY(a.getDate())},e:function(a){return f_(a.getDate())},H:function(a){return fY(a.getHours())},I:function(a){return fY(a.getHours()%12||12)},j:function(a){return fZ(1+d3.time.dayOfYear(a))},L:function(a){return fZ(a.getMilliseconds())},m:function(a){return fY(a.getMonth()+1)},M:function(a){return fY(a.getMinutes())},p:function(a){return a.getHours()>=12?"PM":"AM"},S:function(a){return fY(a.getSeconds())},U:function(a){return fY(d3.time.sundayOfYear(a))},w:function(a){return a.getDay()},W:function(a){return fY(d3.time.mondayOfYear(a))},x:d3.time.format(fO),X:d3.time.format(fP),y:function(a){return fY(a.getFullYear()%100)},Y:function(a){return f$(a.getFullYear()%1e4)},Z:gB,"%":function(a){return"%"}},gh={a:gi,A:gj,b:gk,B:gl,c:gm,d:gt,e:gt,H:gu,I:gu,L:gx,m:gs,M:gv,p:gz,S:gw,x:gn,X:go,y:gq,Y:gp},gy=/^\s*\d+/,gA=d3.map({am:0,pm:1});d3.time.format.utc=function(a){function c(a){try{fJ=fL;var c=new fJ;return c._=a,b(c)}finally{fJ=Date}}var b=d3.time.format(a);return c.parse=function(a){try{fJ=fL;var c=b.parse(a);return c&&c._}finally{fJ=Date}},c.toString=b.toString,c};var gC=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?gD:gC,gD.parse=function(a){var b=new Date(a);return isNaN(b)?null:b},gD.toString=gC.toString,d3.time.second=gE(function(a){return new fJ(Math.floor(a/1e3)*1e3)},function(a,b){a.setTime(a.getTime()+Math.floor(b)*1e3)},function(a){return a.getSeconds()}),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=gE(function(a){return new fJ(Math.floor(a/6e4)*6e4)},function(a,b){a.setTime(a.getTime()+Math.floor(b)*6e4)},function(a){return a.getMinutes()}),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=gE(function(a){var b=a.getTimezoneOffset()/60;return new fJ((Math.floor(a/36e5-b)+b)*36e5)},function(a,b){a.setTime(a.getTime()+Math.floor(b)*36e5)},function(a){return a.getHours()}),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=gE(function(a){var b=new fJ(0,a.getMonth(),a.getDate());return b.setFullYear(a.getFullYear()),b},function(a,b){a.setDate(a.getDate()+b)},function(a){return a.getDate()-1}),d3.time.days=d3.time.day.range,d3.time.days.utc=d3.time.day.utc.range,d3.time.dayOfYear=function(a){var b=d3.time.year(a);return Math.floor((a-b-(a.getTimezoneOffset()-b.getTimezoneOffset())*6e4)/864e5)},fK.forEach(function(a,b){a=a.toLowerCase(),b=7-b;var c=d3.time[a]=gE(function(a){return(a=d3.time.day(a)).setDate(a.getDate()-(a.getDay()+b)%7),a},function(a,b){a.setDate(a.getDate()+Math.floor(b)*7)},function(a){var c=d3.time.year(a).getDay();return Math.floor((d3.time.dayOfYear(a)+(c+b)%7)/7)-(c!==b)});d3.time[a+"s"]=c.range,d3.time[a+"s"].utc=c.utc.range,d3.time[a+"OfYear"]=function(a){var c=d3.time.year(a).getDay();return Math.floor((d3.time.dayOfYear(a)+(c+b)%7)/7)}}),d3.time.week=d3.time.sunday,d3.time.weeks=d3.time.sunday.range,d3.time.weeks.utc=d3.time.sunday.utc.range,d3.time.weekOfYear=d3.time.sundayOfYear,d3.time.month=gE(function(a){return a=d3.time.day(a),a.setDate(1),a},function(a,b){a.setMonth(a.getMonth()+b)},function(a){return a.getMonth()}),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=gE(function(a){return a=d3.time.day(a),a.setMonth(0,1),a},function(a,b){a.setFullYear(a.getFullYear()+b)},function(a){return a.getFullYear()}),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var gM=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],gN=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]],gO=[[d3.time.format("%Y"),function(a){return!0}],[d3.time.format("%B"),function(a){return a.getMonth()}],[d3.time.format("%b %d"),function(a){return a.getDate()!=1}],[d3.time.format("%a %d"),function(a){return a.getDay()&&a.getDate()!=1}],[d3.time.format("%I %p"),function(a){return a.getHours()}],[d3.time.format("%I:%M"),function(a){return a.getMinutes()}],[d3.time.format(":%S"),function(a){return a.getSeconds()}],[d3.time.format(".%L"),function(a){return a.getMilliseconds()}]],gP=d3.scale.linear(),gQ=gJ(gO);gN.year=function(a,b){return gP.domain(a.map(gL)).ticks(b).map(gK)},d3.time.scale=function(){return gG(d3.scale.linear(),gN,gQ)};var gR=gN.map(function(a){return[a[0].utc,a[1]]}),gS=[[d3.time.format.utc("%Y"),function(a){return!0}],[d3.time.format.utc("%B"),function(a){return a.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(a){return a.getUTCDate()!=1}],[d3.time.format.utc("%a %d"),function(a){return a.getUTCDay()&&a.getUTCDate()!=1}],[d3.time.format.utc("%I %p"),function(a){return a.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(a){return a.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(a){return a.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(a){return a.getUTCMilliseconds()}]],gT=gJ(gS);gR.year=function(a,b){return gP.domain(a.map(gV)).ticks(b).map(gU)},d3.time.scale.utc=function(){return gG(d3.scale.linear(),gR,gT)}})(); | rm-hull/cdnjs | ajax/libs/d3/2.10.0/d3.v2.min.js | JavaScript | mit | 115,816 |
/**
* Author: Gautam Mehta
* Branched from CodeMirror's Scheme mode
*/
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("cobol", function () {
var BUILTIN = "builtin", COMMENT = "comment", STRING = "string",
ATOM = "atom", NUMBER = "number", KEYWORD = "keyword", MODTAG = "header",
COBOLLINENUM = "def", PERIOD = "link";
function makeKeywords(str) {
var obj = {}, words = str.split(" ");
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
var atoms = makeKeywords("TRUE FALSE ZEROES ZEROS ZERO SPACES SPACE LOW-VALUE LOW-VALUES ");
var keywords = makeKeywords(
"ACCEPT ACCESS ACQUIRE ADD ADDRESS " +
"ADVANCING AFTER ALIAS ALL ALPHABET " +
"ALPHABETIC ALPHABETIC-LOWER ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED " +
"ALSO ALTER ALTERNATE AND ANY " +
"ARE AREA AREAS ARITHMETIC ASCENDING " +
"ASSIGN AT ATTRIBUTE AUTHOR AUTO " +
"AUTO-SKIP AUTOMATIC B-AND B-EXOR B-LESS " +
"B-NOT B-OR BACKGROUND-COLOR BACKGROUND-COLOUR BEEP " +
"BEFORE BELL BINARY BIT BITS " +
"BLANK BLINK BLOCK BOOLEAN BOTTOM " +
"BY CALL CANCEL CD CF " +
"CH CHARACTER CHARACTERS CLASS CLOCK-UNITS " +
"CLOSE COBOL CODE CODE-SET COL " +
"COLLATING COLUMN COMMA COMMIT COMMITMENT " +
"COMMON COMMUNICATION COMP COMP-0 COMP-1 " +
"COMP-2 COMP-3 COMP-4 COMP-5 COMP-6 " +
"COMP-7 COMP-8 COMP-9 COMPUTATIONAL COMPUTATIONAL-0 " +
"COMPUTATIONAL-1 COMPUTATIONAL-2 COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 " +
"COMPUTATIONAL-6 COMPUTATIONAL-7 COMPUTATIONAL-8 COMPUTATIONAL-9 COMPUTE " +
"CONFIGURATION CONNECT CONSOLE CONTAINED CONTAINS " +
"CONTENT CONTINUE CONTROL CONTROL-AREA CONTROLS " +
"CONVERTING COPY CORR CORRESPONDING COUNT " +
"CRT CRT-UNDER CURRENCY CURRENT CURSOR " +
"DATA DATE DATE-COMPILED DATE-WRITTEN DAY " +
"DAY-OF-WEEK DB DB-ACCESS-CONTROL-KEY DB-DATA-NAME DB-EXCEPTION " +
"DB-FORMAT-NAME DB-RECORD-NAME DB-SET-NAME DB-STATUS DBCS " +
"DBCS-EDITED DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE " +
"DEBUG-NAME DEBUG-SUB-1 DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING " +
"DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED " +
"DELIMITER DEPENDING DESCENDING DESCRIBED DESTINATION " +
"DETAIL DISABLE DISCONNECT DISPLAY DISPLAY-1 " +
"DISPLAY-2 DISPLAY-3 DISPLAY-4 DISPLAY-5 DISPLAY-6 " +
"DISPLAY-7 DISPLAY-8 DISPLAY-9 DIVIDE DIVISION " +
"DOWN DROP DUPLICATE DUPLICATES DYNAMIC " +
"EBCDIC EGI EJECT ELSE EMI " +
"EMPTY EMPTY-CHECK ENABLE END END. END-ACCEPT END-ACCEPT. " +
"END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY " +
"END-DIVIDE END-EVALUATE END-IF END-INVOKE END-MULTIPLY " +
"END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN " +
"END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT " +
"END-UNSTRING END-WRITE END-XML ENTER ENTRY " +
"ENVIRONMENT EOP EQUAL EQUALS ERASE " +
"ERROR ESI EVALUATE EVERY EXCEEDS " +
"EXCEPTION EXCLUSIVE EXIT EXTEND EXTERNAL " +
"EXTERNALLY-DESCRIBED-KEY FD FETCH FILE FILE-CONTROL " +
"FILE-STREAM FILES FILLER FINAL FIND " +
"FINISH FIRST FOOTING FOR FOREGROUND-COLOR " +
"FOREGROUND-COLOUR FORMAT FREE FROM FULL " +
"FUNCTION GENERATE GET GIVING GLOBAL " +
"GO GOBACK GREATER GROUP HEADING " +
"HIGH-VALUE HIGH-VALUES HIGHLIGHT I-O I-O-CONTROL " +
"ID IDENTIFICATION IF IN INDEX " +
"INDEX-1 INDEX-2 INDEX-3 INDEX-4 INDEX-5 " +
"INDEX-6 INDEX-7 INDEX-8 INDEX-9 INDEXED " +
"INDIC INDICATE INDICATOR INDICATORS INITIAL " +
"INITIALIZE INITIATE INPUT INPUT-OUTPUT INSPECT " +
"INSTALLATION INTO INVALID INVOKE IS " +
"JUST JUSTIFIED KANJI KEEP KEY " +
"LABEL LAST LD LEADING LEFT " +
"LEFT-JUSTIFY LENGTH LENGTH-CHECK LESS LIBRARY " +
"LIKE LIMIT LIMITS LINAGE LINAGE-COUNTER " +
"LINE LINE-COUNTER LINES LINKAGE LOCAL-STORAGE " +
"LOCALE LOCALLY LOCK " +
"MEMBER MEMORY MERGE MESSAGE METACLASS " +
"MODE MODIFIED MODIFY MODULES MOVE " +
"MULTIPLE MULTIPLY NATIONAL NATIVE NEGATIVE " +
"NEXT NO NO-ECHO NONE NOT " +
"NULL NULL-KEY-MAP NULL-MAP NULLS NUMBER " +
"NUMERIC NUMERIC-EDITED OBJECT OBJECT-COMPUTER OCCURS " +
"OF OFF OMITTED ON ONLY " +
"OPEN OPTIONAL OR ORDER ORGANIZATION " +
"OTHER OUTPUT OVERFLOW OWNER PACKED-DECIMAL " +
"PADDING PAGE PAGE-COUNTER PARSE PERFORM " +
"PF PH PIC PICTURE PLUS " +
"POINTER POSITION POSITIVE PREFIX PRESENT " +
"PRINTING PRIOR PROCEDURE PROCEDURE-POINTER PROCEDURES " +
"PROCEED PROCESS PROCESSING PROGRAM PROGRAM-ID " +
"PROMPT PROTECTED PURGE QUEUE QUOTE " +
"QUOTES RANDOM RD READ READY " +
"REALM RECEIVE RECONNECT RECORD RECORD-NAME " +
"RECORDS RECURSIVE REDEFINES REEL REFERENCE " +
"REFERENCE-MONITOR REFERENCES RELATION RELATIVE RELEASE " +
"REMAINDER REMOVAL RENAMES REPEATED REPLACE " +
"REPLACING REPORT REPORTING REPORTS REPOSITORY " +
"REQUIRED RERUN RESERVE RESET RETAINING " +
"RETRIEVAL RETURN RETURN-CODE RETURNING REVERSE-VIDEO " +
"REVERSED REWIND REWRITE RF RH " +
"RIGHT RIGHT-JUSTIFY ROLLBACK ROLLING ROUNDED " +
"RUN SAME SCREEN SD SEARCH " +
"SECTION SECURE SECURITY SEGMENT SEGMENT-LIMIT " +
"SELECT SEND SENTENCE SEPARATE SEQUENCE " +
"SEQUENTIAL SET SHARED SIGN SIZE " +
"SKIP1 SKIP2 SKIP3 SORT SORT-MERGE " +
"SORT-RETURN SOURCE SOURCE-COMPUTER SPACE-FILL " +
"SPECIAL-NAMES STANDARD STANDARD-1 STANDARD-2 " +
"START STARTING STATUS STOP STORE " +
"STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUB-SCHEMA " +
"SUBFILE SUBSTITUTE SUBTRACT SUM SUPPRESS " +
"SYMBOLIC SYNC SYNCHRONIZED SYSIN SYSOUT " +
"TABLE TALLYING TAPE TENANT TERMINAL " +
"TERMINATE TEST TEXT THAN THEN " +
"THROUGH THRU TIME TIMES TITLE " +
"TO TOP TRAILING TRAILING-SIGN TRANSACTION " +
"TYPE TYPEDEF UNDERLINE UNEQUAL UNIT " +
"UNSTRING UNTIL UP UPDATE UPON " +
"USAGE USAGE-MODE USE USING VALID " +
"VALIDATE VALUE VALUES VARYING VLR " +
"WAIT WHEN WHEN-COMPILED WITH WITHIN " +
"WORDS WORKING-STORAGE WRITE XML XML-CODE " +
"XML-EVENT XML-NTEXT XML-TEXT ZERO ZERO-FILL " );
var builtins = makeKeywords("- * ** / + < <= = > >= ");
var tests = {
digit: /\d/,
digit_or_colon: /[\d:]/,
hex: /[0-9a-f]/i,
sign: /[+-]/,
exponent: /e/i,
keyword_char: /[^\s\(\[\;\)\]]/,
symbol: /[\w*+\-]/
};
function isNumber(ch, stream){
// hex
if ( ch === '0' && stream.eat(/x/i) ) {
stream.eatWhile(tests.hex);
return true;
}
// leading sign
if ( ( ch == '+' || ch == '-' ) && ( tests.digit.test(stream.peek()) ) ) {
stream.eat(tests.sign);
ch = stream.next();
}
if ( tests.digit.test(ch) ) {
stream.eat(ch);
stream.eatWhile(tests.digit);
if ( '.' == stream.peek()) {
stream.eat('.');
stream.eatWhile(tests.digit);
}
if ( stream.eat(tests.exponent) ) {
stream.eat(tests.sign);
stream.eatWhile(tests.digit);
}
return true;
}
return false;
}
return {
startState: function () {
return {
indentStack: null,
indentation: 0,
mode: false
};
},
token: function (stream, state) {
if (state.indentStack == null && stream.sol()) {
// update indentation, but only if indentStack is empty
state.indentation = 6 ; //stream.indentation();
}
// skip spaces
if (stream.eatSpace()) {
return null;
}
var returnType = null;
switch(state.mode){
case "string": // multi-line string parsing mode
var next = false;
while ((next = stream.next()) != null) {
if (next == "\"" || next == "\'") {
state.mode = false;
break;
}
}
returnType = STRING; // continue on in string mode
break;
default: // default parsing mode
var ch = stream.next();
var col = stream.column();
if (col >= 0 && col <= 5) {
returnType = COBOLLINENUM;
} else if (col >= 72 && col <= 79) {
stream.skipToEnd();
returnType = MODTAG;
} else if (ch == "*" && col == 6) { // comment
stream.skipToEnd(); // rest of the line is a comment
returnType = COMMENT;
} else if (ch == "\"" || ch == "\'") {
state.mode = "string";
returnType = STRING;
} else if (ch == "'" && !( tests.digit_or_colon.test(stream.peek()) )) {
returnType = ATOM;
} else if (ch == ".") {
returnType = PERIOD;
} else if (isNumber(ch,stream)){
returnType = NUMBER;
} else {
if (stream.current().match(tests.symbol)) {
while (col < 71) {
if (stream.eat(tests.symbol) === undefined) {
break;
} else {
col++;
}
}
}
if (keywords && keywords.propertyIsEnumerable(stream.current().toUpperCase())) {
returnType = KEYWORD;
} else if (builtins && builtins.propertyIsEnumerable(stream.current().toUpperCase())) {
returnType = BUILTIN;
} else if (atoms && atoms.propertyIsEnumerable(stream.current().toUpperCase())) {
returnType = ATOM;
} else returnType = null;
}
}
return returnType;
},
indent: function (state) {
if (state.indentStack == null) return state.indentation;
return state.indentStack.indent;
}
};
});
CodeMirror.defineMIME("text/x-cobol", "cobol");
});
| johnyblaze/SocialMedia | public/filemanager/scripts/CodeMirror/mode/cobol/cobol.js | JavaScript | mit | 10,160 |
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("properties", function() {
return {
token: function(stream, state) {
var sol = stream.sol() || state.afterSection;
var eol = stream.eol();
state.afterSection = false;
if (sol) {
if (state.nextMultiline) {
state.inMultiline = true;
state.nextMultiline = false;
} else {
state.position = "def";
}
}
if (eol && ! state.nextMultiline) {
state.inMultiline = false;
state.position = "def";
}
if (sol) {
while(stream.eatSpace());
}
var ch = stream.next();
if (sol && (ch === "#" || ch === "!" || ch === ";")) {
state.position = "comment";
stream.skipToEnd();
return "comment";
} else if (sol && ch === "[") {
state.afterSection = true;
stream.skipTo("]"); stream.eat("]");
return "header";
} else if (ch === "=" || ch === ":") {
state.position = "quote";
return null;
} else if (ch === "\\" && state.position === "quote") {
if (stream.next() !== "u") { // u = Unicode sequence \u1234
// Multiline value
state.nextMultiline = true;
}
}
return state.position;
},
startState: function() {
return {
position : "def", // Current position, "def", "quote" or "comment"
nextMultiline : false, // Is the next line multiline value
inMultiline : false, // Is the current line a multiline value
afterSection : false // Did we just open a section
};
}
};
});
CodeMirror.defineMIME("text/x-properties", "properties");
CodeMirror.defineMIME("text/x-ini", "properties");
});
| afghanistanyn/jsdelivr | files/codemirror/4.0.3/mode/properties/properties.js | JavaScript | mit | 2,067 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Intl\Tests\NumberFormatter;
use Symfony\Component\Intl\Globals\IntlGlobals;
use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
use Symfony\Component\Intl\Util\IntlTestHelper;
/**
* Note that there are some values written like -2147483647 - 1. This is the lower 32bit int max and is a known
* behavior of PHP.
*/
class NumberFormatterTest extends AbstractNumberFormatterTest
{
protected function setUp()
{
IntlTestHelper::requireIntl($this);
parent::setUp();
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
*/
public function testConstructorWithUnsupportedLocale()
{
new NumberFormatter('pt_BR');
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
*/
public function testConstructorWithUnsupportedStyle()
{
new NumberFormatter('en', NumberFormatter::PATTERN_DECIMAL);
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException
*/
public function testConstructorWithPatternDifferentThanNull()
{
new NumberFormatter('en', NumberFormatter::DECIMAL, '');
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
*/
public function testSetAttributeWithUnsupportedAttribute()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$formatter->setAttribute(NumberFormatter::LENIENT_PARSE, null);
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
*/
public function testSetAttributeInvalidRoundingMode()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$formatter->setAttribute(NumberFormatter::ROUNDING_MODE, null);
}
public function testCreate()
{
$this->assertInstanceOf(
'\Symfony\Component\Intl\NumberFormatter\NumberFormatter',
NumberFormatter::create('en', NumberFormatter::DECIMAL)
);
}
/**
* @expectedException \RuntimeException
*/
public function testFormatWithCurrencyStyle()
{
parent::testFormatWithCurrencyStyle();
}
/**
* @dataProvider formatTypeInt32Provider
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
*/
public function testFormatTypeInt32($formatter, $value, $expected, $message = '')
{
parent::testFormatTypeInt32($formatter, $value, $expected, $message);
}
/**
* @dataProvider formatTypeInt32WithCurrencyStyleProvider
* @expectedException \Symfony\Component\Intl\Exception\NotImplementedException
*/
public function testFormatTypeInt32WithCurrencyStyle($formatter, $value, $expected, $message = '')
{
parent::testFormatTypeInt32WithCurrencyStyle($formatter, $value, $expected, $message);
}
/**
* @dataProvider formatTypeInt64Provider
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
*/
public function testFormatTypeInt64($formatter, $value, $expected)
{
parent::testFormatTypeInt64($formatter, $value, $expected);
}
/**
* @dataProvider formatTypeInt64WithCurrencyStyleProvider
* @expectedException \Symfony\Component\Intl\Exception\NotImplementedException
*/
public function testFormatTypeInt64WithCurrencyStyle($formatter, $value, $expected)
{
parent::testFormatTypeInt64WithCurrencyStyle($formatter, $value, $expected);
}
/**
* @dataProvider formatTypeDoubleProvider
* @expectedException \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException
*/
public function testFormatTypeDouble($formatter, $value, $expected)
{
parent::testFormatTypeDouble($formatter, $value, $expected);
}
/**
* @dataProvider formatTypeDoubleWithCurrencyStyleProvider
* @expectedException \Symfony\Component\Intl\Exception\NotImplementedException
*/
public function testFormatTypeDoubleWithCurrencyStyle($formatter, $value, $expected)
{
parent::testFormatTypeDoubleWithCurrencyStyle($formatter, $value, $expected);
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException
*/
public function testGetPattern()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$formatter->getPattern();
}
public function testGetErrorCode()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$this->assertEquals(IntlGlobals::U_ZERO_ERROR, $formatter->getErrorCode());
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException
*/
public function testParseCurrency()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$formatter->parseCurrency(null, $currency);
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException
*/
public function testSetPattern()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$formatter->setPattern(null);
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException
*/
public function testSetSymbol()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$formatter->setSymbol(null, null);
}
/**
* @expectedException \Symfony\Component\Intl\Exception\MethodNotImplementedException
*/
public function testSetTextAttribute()
{
$formatter = $this->getNumberFormatter('en', NumberFormatter::DECIMAL);
$formatter->setTextAttribute(null, null);
}
protected function getNumberFormatter($locale = 'en', $style = null, $pattern = null)
{
return new NumberFormatter($locale, $style, $pattern);
}
protected function getIntlErrorMessage()
{
return IntlGlobals::getErrorMessage();
}
protected function getIntlErrorCode()
{
return IntlGlobals::getErrorCode();
}
protected function isIntlFailure($errorCode)
{
return IntlGlobals::isFailure($errorCode);
}
}
| UAPV/statMoodle | vendor/symfony/symfony/src/Symfony/Component/Intl/Tests/NumberFormatter/NumberFormatterTest.php | PHP | mit | 6,757 |
// Copyright 2009,2010 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Darwin system calls.
// This file is compiled as ordinary Go code,
// but it is also input to mksyscall,
// which parses the //sys lines and generates system call stubs.
// Note that sometimes we use a lowercase //sys name and wrap
// it in our own nicer implementation, either here or in
// syscall_bsd.go or syscall_unix.go.
package unix
import (
errorspkg "errors"
"syscall"
"unsafe"
)
const ImplementsGetwd = true
func Getwd() (string, error) {
buf := make([]byte, 2048)
attrs, err := getAttrList(".", attrList{CommonAttr: attrCmnFullpath}, buf, 0)
if err == nil && len(attrs) == 1 && len(attrs[0]) >= 2 {
wd := string(attrs[0])
// Sanity check that it's an absolute path and ends
// in a null byte, which we then strip.
if wd[0] == '/' && wd[len(wd)-1] == 0 {
return wd[:len(wd)-1], nil
}
}
// If pkg/os/getwd.go gets ENOTSUP, it will fall back to the
// slow algorithm.
return "", ENOTSUP
}
type SockaddrDatalink struct {
Len uint8
Family uint8
Index uint16
Type uint8
Nlen uint8
Alen uint8
Slen uint8
Data [12]int8
raw RawSockaddrDatalink
}
// Translate "kern.hostname" to []_C_int{0,1,2,3}.
func nametomib(name string) (mib []_C_int, err error) {
const siz = unsafe.Sizeof(mib[0])
// NOTE(rsc): It seems strange to set the buffer to have
// size CTL_MAXNAME+2 but use only CTL_MAXNAME
// as the size. I don't know why the +2 is here, but the
// kernel uses +2 for its own implementation of this function.
// I am scared that if we don't include the +2 here, the kernel
// will silently write 2 words farther than we specify
// and we'll get memory corruption.
var buf [CTL_MAXNAME + 2]_C_int
n := uintptr(CTL_MAXNAME) * siz
p := (*byte)(unsafe.Pointer(&buf[0]))
bytes, err := ByteSliceFromString(name)
if err != nil {
return nil, err
}
// Magic sysctl: "setting" 0.3 to a string name
// lets you read back the array of integers form.
if err = sysctl([]_C_int{0, 3}, p, &n, &bytes[0], uintptr(len(name))); err != nil {
return nil, err
}
return buf[0 : n/siz], nil
}
// ParseDirent parses up to max directory entries in buf,
// appending the names to names. It returns the number
// bytes consumed from buf, the number of entries added
// to names, and the new names slice.
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
origlen := len(buf)
for max != 0 && len(buf) > 0 {
dirent := (*Dirent)(unsafe.Pointer(&buf[0]))
if dirent.Reclen == 0 {
buf = nil
break
}
buf = buf[dirent.Reclen:]
if dirent.Ino == 0 { // File absent in directory.
continue
}
bytes := (*[10000]byte)(unsafe.Pointer(&dirent.Name[0]))
var name = string(bytes[0:dirent.Namlen])
if name == "." || name == ".." { // Useless names
continue
}
max--
count++
names = append(names, name)
}
return origlen - len(buf), count, names
}
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
const (
attrBitMapCount = 5
attrCmnFullpath = 0x08000000
)
type attrList struct {
bitmapCount uint16
_ uint16
CommonAttr uint32
VolAttr uint32
DirAttr uint32
FileAttr uint32
Forkattr uint32
}
func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {
if len(attrBuf) < 4 {
return nil, errorspkg.New("attrBuf too small")
}
attrList.bitmapCount = attrBitMapCount
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return nil, err
}
_, _, e1 := Syscall6(
SYS_GETATTRLIST,
uintptr(unsafe.Pointer(_p0)),
uintptr(unsafe.Pointer(&attrList)),
uintptr(unsafe.Pointer(&attrBuf[0])),
uintptr(len(attrBuf)),
uintptr(options),
0,
)
if e1 != 0 {
return nil, e1
}
size := *(*uint32)(unsafe.Pointer(&attrBuf[0]))
// dat is the section of attrBuf that contains valid data,
// without the 4 byte length header. All attribute offsets
// are relative to dat.
dat := attrBuf
if int(size) < len(attrBuf) {
dat = dat[:size]
}
dat = dat[4:] // remove length prefix
for i := uint32(0); int(i) < len(dat); {
header := dat[i:]
if len(header) < 8 {
return attrs, errorspkg.New("truncated attribute header")
}
datOff := *(*int32)(unsafe.Pointer(&header[0]))
attrLen := *(*uint32)(unsafe.Pointer(&header[4]))
if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {
return attrs, errorspkg.New("truncated results; attrBuf too small")
}
end := uint32(datOff) + attrLen
attrs = append(attrs, dat[datOff:end])
i = end
if r := i % 4; r != 0 {
i += (4 - r)
}
}
return
}
//sysnb pipe() (r int, w int, err error)
func Pipe(p []int) (err error) {
if len(p) != 2 {
return EINVAL
}
p[0], p[1], err = pipe()
return
}
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var _p0 unsafe.Pointer
var bufsize uintptr
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(_p0), bufsize, uintptr(flags))
n = int(r0)
if e1 != 0 {
err = e1
}
return
}
/*
* Wrapped
*/
//sys kill(pid int, signum int, posix int) (err error)
func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
/*
* Exposed directly
*/
//sys Access(path string, mode uint32) (err error)
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
//sys Chdir(path string) (err error)
//sys Chflags(path string, flags int) (err error)
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)
//sys Exchangedata(path1 string, path2 string, options int) (err error)
//sys Exit(code int)
//sys Fchdir(fd int) (err error)
//sys Fchflags(fd int, flags int) (err error)
//sys Fchmod(fd int, mode uint32) (err error)
//sys Fchown(fd int, uid int, gid int) (err error)
//sys Flock(fd int, how int) (err error)
//sys Fpathconf(fd int, name int) (val int, err error)
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
//sys Fsync(fd int) (err error)
//sys Ftruncate(fd int, length int64) (err error)
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
//sys Getdtablesize() (size int)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (uid int)
//sysnb Getgid() (gid int)
//sysnb Getpgid(pid int) (pgid int, err error)
//sysnb Getpgrp() (pgrp int)
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
//sys Getpriority(which int, who int) (prio int, err error)
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
//sysnb Getrusage(who int, rusage *Rusage) (err error)
//sysnb Getsid(pid int) (sid int, err error)
//sysnb Getuid() (uid int)
//sysnb Issetugid() (tainted bool)
//sys Kqueue() (fd int, err error)
//sys Lchown(path string, uid int, gid int) (err error)
//sys Link(path string, link string) (err error)
//sys Listen(s int, backlog int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
//sys Mkdir(path string, mode uint32) (err error)
//sys Mkfifo(path string, mode uint32) (err error)
//sys Mknod(path string, mode uint32, dev int) (err error)
//sys Mlock(b []byte) (err error)
//sys Mlockall(flags int) (err error)
//sys Mprotect(b []byte, prot int) (err error)
//sys Munlock(b []byte) (err error)
//sys Munlockall() (err error)
//sys Open(path string, mode int, perm uint32) (fd int, err error)
//sys Pathconf(path string, name int) (val int, err error)
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Rename(from string, to string) (err error)
//sys Revoke(path string) (err error)
//sys Rmdir(path string) (err error)
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
//sys Setegid(egid int) (err error)
//sysnb Seteuid(euid int) (err error)
//sysnb Setgid(gid int) (err error)
//sys Setlogin(name string) (err error)
//sysnb Setpgid(pid int, pgid int) (err error)
//sys Setpriority(which int, who int, prio int) (err error)
//sys Setprivexec(flag int) (err error)
//sysnb Setregid(rgid int, egid int) (err error)
//sysnb Setreuid(ruid int, euid int) (err error)
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
//sysnb Setsid() (pid int, err error)
//sysnb Settimeofday(tp *Timeval) (err error)
//sysnb Setuid(uid int) (err error)
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
//sys Symlink(path string, link string) (err error)
//sys Sync() (err error)
//sys Truncate(path string, length int64) (err error)
//sys Umask(newmask int) (oldmask int)
//sys Undelete(path string) (err error)
//sys Unlink(path string) (err error)
//sys Unmount(path string, flags int) (err error)
//sys write(fd int, p []byte) (n int, err error)
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
//sys munmap(addr uintptr, length uintptr) (err error)
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
/*
* Unimplemented
*/
// Profil
// Sigaction
// Sigprocmask
// Getlogin
// Sigpending
// Sigaltstack
// Ioctl
// Reboot
// Execve
// Vfork
// Sbrk
// Sstk
// Ovadvise
// Mincore
// Setitimer
// Swapon
// Select
// Sigsuspend
// Readv
// Writev
// Nfssvc
// Getfh
// Quotactl
// Mount
// Csops
// Waitid
// Add_profil
// Kdebug_trace
// Sigreturn
// Mmap
// Mlock
// Munlock
// Atsocket
// Kqueue_from_portset_np
// Kqueue_portset
// Getattrlist
// Setattrlist
// Getdirentriesattr
// Searchfs
// Delete
// Copyfile
// Poll
// Watchevent
// Waitevent
// Modwatch
// Getxattr
// Fgetxattr
// Setxattr
// Fsetxattr
// Removexattr
// Fremovexattr
// Listxattr
// Flistxattr
// Fsctl
// Initgroups
// Posix_spawn
// Nfsclnt
// Fhopen
// Minherit
// Semsys
// Msgsys
// Shmsys
// Semctl
// Semget
// Semop
// Msgctl
// Msgget
// Msgsnd
// Msgrcv
// Shmat
// Shmctl
// Shmdt
// Shmget
// Shm_open
// Shm_unlink
// Sem_open
// Sem_close
// Sem_unlink
// Sem_wait
// Sem_trywait
// Sem_post
// Sem_getvalue
// Sem_init
// Sem_destroy
// Open_extended
// Umask_extended
// Stat_extended
// Lstat_extended
// Fstat_extended
// Chmod_extended
// Fchmod_extended
// Access_extended
// Settid
// Gettid
// Setsgroups
// Getsgroups
// Setwgroups
// Getwgroups
// Mkfifo_extended
// Mkdir_extended
// Identitysvc
// Shared_region_check_np
// Shared_region_map_np
// __pthread_mutex_destroy
// __pthread_mutex_init
// __pthread_mutex_lock
// __pthread_mutex_trylock
// __pthread_mutex_unlock
// __pthread_cond_init
// __pthread_cond_destroy
// __pthread_cond_broadcast
// __pthread_cond_signal
// Setsid_with_pid
// __pthread_cond_timedwait
// Aio_fsync
// Aio_return
// Aio_suspend
// Aio_cancel
// Aio_error
// Aio_read
// Aio_write
// Lio_listio
// __pthread_cond_wait
// Iopolicysys
// Mlockall
// Munlockall
// __pthread_kill
// __pthread_sigmask
// __sigwait
// __disable_threadsignal
// __pthread_markcancel
// __pthread_canceled
// __semwait_signal
// Proc_info
// sendfile
// Stat64_extended
// Lstat64_extended
// Fstat64_extended
// __pthread_chdir
// __pthread_fchdir
// Audit
// Auditon
// Getauid
// Setauid
// Getaudit
// Setaudit
// Getaudit_addr
// Setaudit_addr
// Auditctl
// Bsdthread_create
// Bsdthread_terminate
// Stack_snapshot
// Bsdthread_register
// Workq_open
// Workq_ops
// __mac_execve
// __mac_syscall
// __mac_get_file
// __mac_set_file
// __mac_get_link
// __mac_set_link
// __mac_get_proc
// __mac_set_proc
// __mac_get_fd
// __mac_set_fd
// __mac_get_pid
// __mac_get_lcid
// __mac_get_lctx
// __mac_set_lctx
// Setlcid
// Read_nocancel
// Write_nocancel
// Open_nocancel
// Close_nocancel
// Wait4_nocancel
// Recvmsg_nocancel
// Sendmsg_nocancel
// Recvfrom_nocancel
// Accept_nocancel
// Msync_nocancel
// Fcntl_nocancel
// Select_nocancel
// Fsync_nocancel
// Connect_nocancel
// Sigsuspend_nocancel
// Readv_nocancel
// Writev_nocancel
// Sendto_nocancel
// Pread_nocancel
// Pwrite_nocancel
// Waitid_nocancel
// Poll_nocancel
// Msgsnd_nocancel
// Msgrcv_nocancel
// Sem_wait_nocancel
// Aio_suspend_nocancel
// __sigwait_nocancel
// __semwait_signal_nocancel
// __mac_mount
// __mac_get_mount
// __mac_getfsstat
| Jennal/goplay | vendor/golang.org/x/sys/unix/syscall_darwin.go | GO | mit | 12,995 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
// Collect all Dockerfile directives
var instructions = ["from", "maintainer", "run", "cmd", "expose", "env",
"add", "copy", "entrypoint", "volume", "user",
"workdir", "onbuild"],
instructionRegex = "(" + instructions.join('|') + ")",
instructionOnlyLine = new RegExp(instructionRegex + "\\s*$", "i"),
instructionWithArguments = new RegExp(instructionRegex + "(\\s+)", "i");
CodeMirror.defineSimpleMode("dockerfile", {
start: [
// Block comment: This is a line starting with a comment
{
regex: /#.*$/,
token: "comment"
},
// Highlight an instruction without any arguments (for convenience)
{
regex: instructionOnlyLine,
token: "variable-2"
},
// Highlight an instruction followed by arguments
{
regex: instructionWithArguments,
token: ["variable-2", null],
next: "arguments"
},
{
regex: /./,
token: null
}
],
arguments: [
{
// Line comment without instruction arguments is an error
regex: /#.*$/,
token: "error",
next: "start"
},
{
regex: /[^#]+\\$/,
token: null
},
{
// Match everything except for the inline comment
regex: /[^#]+/,
token: null,
next: "start"
},
{
regex: /$/,
token: null,
next: "start"
},
// Fail safe return to start
{
token: null,
next: "start"
}
]
});
CodeMirror.defineMIME("text/x-dockerfile", "dockerfile");
});
| WebReflection/cdnjs | ajax/libs/codemirror/4.9.0/mode/dockerfile/dockerfile.js | JavaScript | mit | 2,171 |
/*!
* commander
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var EventEmitter = require('events').EventEmitter
, path = require('path')
, tty = require('tty')
, basename = path.basename;
/**
* Expose the root command.
*/
exports = module.exports = new Command;
/**
* Expose `Command`.
*/
exports.Command = Command;
/**
* Expose `Option`.
*/
exports.Option = Option;
/**
* Initialize a new `Option` with the given `flags` and `description`.
*
* @param {String} flags
* @param {String} description
* @api public
*/
function Option(flags, description) {
this.flags = flags;
this.required = ~flags.indexOf('<');
this.optional = ~flags.indexOf('[');
this.bool = !~flags.indexOf('-no-');
flags = flags.split(/[ ,|]+/);
if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
this.long = flags.shift();
this.description = description;
}
/**
* Return option name.
*
* @return {String}
* @api private
*/
Option.prototype.name = function(){
return this.long
.replace('--', '')
.replace('no-', '');
};
/**
* Check if `arg` matches the short or long flag.
*
* @param {String} arg
* @return {Boolean}
* @api private
*/
Option.prototype.is = function(arg){
return arg == this.short
|| arg == this.long;
};
/**
* Initialize a new `Command`.
*
* @param {String} name
* @api public
*/
function Command(name) {
this.commands = [];
this.options = [];
this.args = [];
this.name = name;
}
/**
* Inherit from `EventEmitter.prototype`.
*/
Command.prototype.__proto__ = EventEmitter.prototype;
/**
* Add command `name`.
*
* The `.action()` callback is invoked when the
* command `name` is specified via __ARGV__,
* and the remaining arguments are applied to the
* function for access.
*
* When the `name` is "*" an un-matched command
* will be passed as the first arg, followed by
* the rest of __ARGV__ remaining.
*
* Examples:
*
* program
* .version('0.0.1')
* .option('-C, --chdir <path>', 'change the working directory')
* .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
* .option('-T, --no-tests', 'ignore test hook')
*
* program
* .command('setup')
* .description('run remote setup commands')
* .action(function(){
* console.log('setup');
* });
*
* program
* .command('exec <cmd>')
* .description('run the given remote command')
* .action(function(cmd){
* console.log('exec "%s"', cmd);
* });
*
* program
* .command('*')
* .description('deploy the given env')
* .action(function(env){
* console.log('deploying "%s"', env);
* });
*
* program.parse(process.argv);
*
* @param {String} name
* @return {Command} the new command
* @api public
*/
Command.prototype.command = function(name){
var args = name.split(/ +/);
var cmd = new Command(args.shift());
this.commands.push(cmd);
cmd.parseExpectedArgs(args);
cmd.parent = this;
return cmd;
};
/**
* Parse expected `args`.
*
* For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
*
* @param {Array} args
* @return {Command} for chaining
* @api public
*/
Command.prototype.parseExpectedArgs = function(args){
if (!args.length) return;
var self = this;
args.forEach(function(arg){
switch (arg[0]) {
case '<':
self.args.push({ required: true, name: arg.slice(1, -1) });
break;
case '[':
self.args.push({ required: false, name: arg.slice(1, -1) });
break;
}
});
return this;
};
/**
* Register callback `fn` for the command.
*
* Examples:
*
* program
* .command('help')
* .description('display verbose help')
* .action(function(){
* // output help here
* });
*
* @param {Function} fn
* @return {Command} for chaining
* @api public
*/
Command.prototype.action = function(fn){
var self = this;
this.parent.on(this.name, function(args, unknown){
// Parse any so-far unknown options
unknown = unknown || [];
var parsed = self.parseOptions(unknown);
// Output help if necessary
outputHelpIfNecessary(self, parsed.unknown);
// If there are still any unknown options, then we simply
// die, unless someone asked for help, in which case we give it
// to them, and then we die.
if (parsed.unknown.length > 0) {
self.unknownOption(parsed.unknown[0]);
}
self.args.forEach(function(arg, i){
if (arg.required && null == args[i]) {
self.missingArgument(arg.name);
}
});
// Always append ourselves to the end of the arguments,
// to make sure we match the number of arguments the user
// expects
if (self.args.length) {
args[self.args.length] = self;
} else {
args.push(self);
}
fn.apply(this, args);
});
return this;
};
/**
* Define option with `flags`, `description` and optional
* coercion `fn`.
*
* The `flags` string should contain both the short and long flags,
* separated by comma, a pipe or space. The following are all valid
* all will output this way when `--help` is used.
*
* "-p, --pepper"
* "-p|--pepper"
* "-p --pepper"
*
* Examples:
*
* // simple boolean defaulting to false
* program.option('-p, --pepper', 'add pepper');
*
* --pepper
* program.pepper
* // => Boolean
*
* // simple boolean defaulting to false
* program.option('-C, --no-cheese', 'remove cheese');
*
* program.cheese
* // => true
*
* --no-cheese
* program.cheese
* // => true
*
* // required argument
* program.option('-C, --chdir <path>', 'change the working directory');
*
* --chdir /tmp
* program.chdir
* // => "/tmp"
*
* // optional argument
* program.option('-c, --cheese [type]', 'add cheese [marble]');
*
* @param {String} flags
* @param {String} description
* @param {Function|Mixed} fn or default
* @param {Mixed} defaultValue
* @return {Command} for chaining
* @api public
*/
Command.prototype.option = function(flags, description, fn, defaultValue){
var self = this
, option = new Option(flags, description)
, oname = option.name()
, name = camelcase(oname);
// default as 3rd arg
if ('function' != typeof fn) defaultValue = fn, fn = null;
// preassign default value only for --no-*, [optional], or <required>
if (false == option.bool || option.optional || option.required) {
// when --no-* we make sure default is true
if (false == option.bool) defaultValue = true;
// preassign only if we have a default
if (undefined !== defaultValue) self[name] = defaultValue;
}
// register the option
this.options.push(option);
// when it's passed assign the value
// and conditionally invoke the callback
this.on(oname, function(val){
// coercion
if (null != val && fn) val = fn(val);
// unassigned or bool
if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
// if no value, bool true, and we have a default, then use it!
if (null == val) {
self[name] = option.bool
? defaultValue || true
: false;
} else {
self[name] = val;
}
} else if (null !== val) {
// reassign
self[name] = val;
}
});
return this;
};
/**
* Parse `argv`, settings options and invoking commands when defined.
*
* @param {Array} argv
* @return {Command} for chaining
* @api public
*/
Command.prototype.parse = function(argv){
// store raw args
this.rawArgs = argv;
// guess name
if (!this.name) this.name = basename(argv[1]);
// process argv
var parsed = this.parseOptions(this.normalize(argv.slice(2)));
this.args = parsed.args;
return this.parseArgs(this.args, parsed.unknown);
};
/**
* Normalize `args`, splitting joined short flags. For example
* the arg "-abc" is equivalent to "-a -b -c".
*
* @param {Array} args
* @return {Array}
* @api private
*/
Command.prototype.normalize = function(args){
var ret = []
, arg;
for (var i = 0, len = args.length; i < len; ++i) {
arg = args[i];
if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
arg.slice(1).split('').forEach(function(c){
ret.push('-' + c);
});
} else {
ret.push(arg);
}
}
return ret;
};
/**
* Parse command `args`.
*
* When listener(s) are available those
* callbacks are invoked, otherwise the "*"
* event is emitted and those actions are invoked.
*
* @param {Array} args
* @return {Command} for chaining
* @api private
*/
Command.prototype.parseArgs = function(args, unknown){
var cmds = this.commands
, len = cmds.length
, name;
if (args.length) {
name = args[0];
if (this.listeners(name).length) {
this.emit(args.shift(), args, unknown);
} else {
this.emit('*', args);
}
} else {
outputHelpIfNecessary(this, unknown);
// If there were no args and we have unknown options,
// then they are extraneous and we need to error.
if (unknown.length > 0) {
this.unknownOption(unknown[0]);
}
}
return this;
};
/**
* Return an option matching `arg` if any.
*
* @param {String} arg
* @return {Option}
* @api private
*/
Command.prototype.optionFor = function(arg){
for (var i = 0, len = this.options.length; i < len; ++i) {
if (this.options[i].is(arg)) {
return this.options[i];
}
}
};
/**
* Parse options from `argv` returning `argv`
* void of these options.
*
* @param {Array} argv
* @return {Array}
* @api public
*/
Command.prototype.parseOptions = function(argv){
var args = []
, len = argv.length
, literal
, option
, arg;
var unknownOptions = [];
// parse options
for (var i = 0; i < len; ++i) {
arg = argv[i];
// literal args after --
if ('--' == arg) {
literal = true;
continue;
}
if (literal) {
args.push(arg);
continue;
}
// find matching Option
option = this.optionFor(arg);
// option is defined
if (option) {
// requires arg
if (option.required) {
arg = argv[++i];
if (null == arg) return this.optionMissingArgument(option);
if ('-' == arg[0]) return this.optionMissingArgument(option, arg);
this.emit(option.name(), arg);
// optional arg
} else if (option.optional) {
arg = argv[i+1];
if (null == arg || '-' == arg[0]) {
arg = null;
} else {
++i;
}
this.emit(option.name(), arg);
// bool
} else {
this.emit(option.name());
}
continue;
}
// looks like an option
if (arg.length > 1 && '-' == arg[0]) {
unknownOptions.push(arg);
// If the next argument looks like it might be
// an argument for this option, we pass it on.
// If it isn't, then it'll simply be ignored
if (argv[i+1] && '-' != argv[i+1][0]) {
unknownOptions.push(argv[++i]);
}
continue;
}
// arg
args.push(arg);
}
return { args: args, unknown: unknownOptions };
};
/**
* Argument `name` is missing.
*
* @param {String} name
* @api private
*/
Command.prototype.missingArgument = function(name){
console.error();
console.error(" error: missing required argument `%s'", name);
console.error();
process.exit(1);
};
/**
* `Option` is missing an argument, but received `flag` or nothing.
*
* @param {String} option
* @param {String} flag
* @api private
*/
Command.prototype.optionMissingArgument = function(option, flag){
console.error();
if (flag) {
console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
} else {
console.error(" error: option `%s' argument missing", option.flags);
}
console.error();
process.exit(1);
};
/**
* Unknown option `flag`.
*
* @param {String} flag
* @api private
*/
Command.prototype.unknownOption = function(flag){
console.error();
console.error(" error: unknown option `%s'", flag);
console.error();
process.exit(1);
};
/**
* Set the program version to `str`.
*
* This method auto-registers the "-V, --version" flag
* which will print the version number when passed.
*
* @param {String} str
* @param {String} flags
* @return {Command} for chaining
* @api public
*/
Command.prototype.version = function(str, flags){
if (0 == arguments.length) return this._version;
this._version = str;
flags = flags || '-V, --version';
this.option(flags, 'output the version number');
this.on('version', function(){
console.log(str);
process.exit(0);
});
return this;
};
/**
* Set the description `str`.
*
* @param {String} str
* @return {String|Command}
* @api public
*/
Command.prototype.description = function(str){
if (0 == arguments.length) return this._description;
this._description = str;
return this;
};
/**
* Set / get the command usage `str`.
*
* @param {String} str
* @return {String|Command}
* @api public
*/
Command.prototype.usage = function(str){
var args = this.args.map(function(arg){
return arg.required
? '<' + arg.name + '>'
: '[' + arg.name + ']';
});
var usage = '[options'
+ (this.commands.length ? '] [command' : '')
+ ']'
+ (this.args.length ? ' ' + args : '');
if (0 == arguments.length) return this._usage || usage;
this._usage = str;
return this;
};
/**
* Return the largest option length.
*
* @return {Number}
* @api private
*/
Command.prototype.largestOptionLength = function(){
return this.options.reduce(function(max, option){
return Math.max(max, option.flags.length);
}, 0);
};
/**
* Return help for options.
*
* @return {String}
* @api private
*/
Command.prototype.optionHelp = function(){
var width = this.largestOptionLength();
// Prepend the help information
return [pad('-h, --help', width) + ' ' + 'output usage information']
.concat(this.options.map(function(option){
return pad(option.flags, width)
+ ' ' + option.description;
}))
.join('\n');
};
/**
* Return command help documentation.
*
* @return {String}
* @api private
*/
Command.prototype.commandHelp = function(){
if (!this.commands.length) return '';
return [
''
, ' Commands:'
, ''
, this.commands.map(function(cmd){
var args = cmd.args.map(function(arg){
return arg.required
? '<' + arg.name + '>'
: '[' + arg.name + ']';
}).join(' ');
return cmd.name
+ (cmd.options.length
? ' [options]'
: '') + ' ' + args
+ (cmd.description()
? '\n' + cmd.description()
: '');
}).join('\n\n').replace(/^/gm, ' ')
, ''
].join('\n');
};
/**
* Return program help documentation.
*
* @return {String}
* @api private
*/
Command.prototype.helpInformation = function(){
return [
''
, ' Usage: ' + this.name + ' ' + this.usage()
, '' + this.commandHelp()
, ' Options:'
, ''
, '' + this.optionHelp().replace(/^/gm, ' ')
, ''
, ''
].join('\n');
};
/**
* Prompt for a `Number`.
*
* @param {String} str
* @param {Function} fn
* @api private
*/
Command.prototype.promptForNumber = function(str, fn){
var self = this;
this.promptSingleLine(str, function parseNumber(val){
val = Number(val);
if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber);
fn(val);
});
};
/**
* Prompt for a `Date`.
*
* @param {String} str
* @param {Function} fn
* @api private
*/
Command.prototype.promptForDate = function(str, fn){
var self = this;
this.promptSingleLine(str, function parseDate(val){
val = new Date(val);
if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate);
fn(val);
});
};
/**
* Single-line prompt.
*
* @param {String} str
* @param {Function} fn
* @api private
*/
Command.prototype.promptSingleLine = function(str, fn){
if ('function' == typeof arguments[2]) {
return this['promptFor' + (fn.name || fn)](str, arguments[2]);
}
process.stdout.write(str);
process.stdin.setEncoding('utf8');
process.stdin.once('data', function(val){
fn(val.trim());
}).resume();
};
/**
* Multi-line prompt.
*
* @param {String} str
* @param {Function} fn
* @api private
*/
Command.prototype.promptMultiLine = function(str, fn){
var buf = [];
console.log(str);
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(val){
if ('\n' == val || '\r\n' == val) {
process.stdin.removeAllListeners('data');
fn(buf.join('\n'));
} else {
buf.push(val.trimRight());
}
}).resume();
};
/**
* Prompt `str` and callback `fn(val)`
*
* Commander supports single-line and multi-line prompts.
* To issue a single-line prompt simply add white-space
* to the end of `str`, something like "name: ", whereas
* for a multi-line prompt omit this "description:".
*
*
* Examples:
*
* program.prompt('Username: ', function(name){
* console.log('hi %s', name);
* });
*
* program.prompt('Description:', function(desc){
* console.log('description was "%s"', desc.trim());
* });
*
* @param {String|Object} str
* @param {Function} fn
* @api public
*/
Command.prototype.prompt = function(str, fn){
var self = this;
if ('string' == typeof str) {
if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments);
this.promptMultiLine(str, fn);
} else {
var keys = Object.keys(str)
, obj = {};
function next() {
var key = keys.shift()
, label = str[key];
if (!key) return fn(obj);
self.prompt(label, function(val){
obj[key] = val;
next();
});
}
next();
}
};
/**
* Prompt for password with `str`, `mask` char and callback `fn(val)`.
*
* The mask string defaults to '', aka no output is
* written while typing, you may want to use "*" etc.
*
* Examples:
*
* program.password('Password: ', function(pass){
* console.log('got "%s"', pass);
* process.stdin.destroy();
* });
*
* program.password('Password: ', '*', function(pass){
* console.log('got "%s"', pass);
* process.stdin.destroy();
* });
*
* @param {String} str
* @param {String} mask
* @param {Function} fn
* @api public
*/
Command.prototype.password = function(str, mask, fn){
var self = this
, buf = '';
// default mask
if ('function' == typeof mask) {
fn = mask;
mask = '';
}
process.stdin.resume();
tty.setRawMode(true);
process.stdout.write(str);
// keypress
process.stdin.on('keypress', function(c, key){
if (key && 'enter' == key.name) {
console.log();
process.stdin.removeAllListeners('keypress');
tty.setRawMode(false);
if (!buf.trim().length) return self.password(str, mask, fn);
fn(buf);
return;
}
if (key && key.ctrl && 'c' == key.name) {
console.log('%s', buf);
process.exit();
}
process.stdout.write(mask);
buf += c;
}).resume();
};
/**
* Confirmation prompt with `str` and callback `fn(bool)`
*
* Examples:
*
* program.confirm('continue? ', function(ok){
* console.log(' got %j', ok);
* process.stdin.destroy();
* });
*
* @param {String} str
* @param {Function} fn
* @api public
*/
Command.prototype.confirm = function(str, fn, verbose){
var self = this;
this.prompt(str, function(ok){
if (!ok.trim()) {
if (!verbose) str += '(yes or no) ';
return self.confirm(str, fn, true);
}
fn(parseBool(ok));
});
};
/**
* Choice prompt with `list` of items and callback `fn(index, item)`
*
* Examples:
*
* var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
*
* console.log('Choose the coolest pet:');
* program.choose(list, function(i){
* console.log('you chose %d "%s"', i, list[i]);
* process.stdin.destroy();
* });
*
* @param {Array} list
* @param {Number|Function} index or fn
* @param {Function} fn
* @api public
*/
Command.prototype.choose = function(list, index, fn){
var self = this
, hasDefault = 'number' == typeof index;
if (!hasDefault) {
fn = index;
index = null;
}
list.forEach(function(item, i){
if (hasDefault && i == index) {
console.log('* %d) %s', i + 1, item);
} else {
console.log(' %d) %s', i + 1, item);
}
});
function again() {
self.prompt(' : ', function(val){
val = parseInt(val, 10) - 1;
if (hasDefault && isNaN(val)) val = index;
if (null == list[val]) {
again();
} else {
fn(val, list[val]);
}
});
}
again();
};
/**
* Camel-case the given `flag`
*
* @param {String} flag
* @return {String}
* @api private
*/
function camelcase(flag) {
return flag.split('-').reduce(function(str, word){
return str + word[0].toUpperCase() + word.slice(1);
});
}
/**
* Parse a boolean `str`.
*
* @param {String} str
* @return {Boolean}
* @api private
*/
function parseBool(str) {
return /^y|yes|ok|true$/i.test(str);
}
/**
* Pad `str` to `width`.
*
* @param {String} str
* @param {Number} width
* @return {String}
* @api private
*/
function pad(str, width) {
var len = Math.max(0, width - str.length);
return str + Array(len + 1).join(' ');
}
/**
* Output help information if necessary
*
* @param {Command} command to output help for
* @param {Array} array of options to search for -h or --help
* @api private
*/
function outputHelpIfNecessary(cmd, options) {
options = options || [];
for (var i = 0; i < options.length; i++) {
if (options[i] == '--help' || options[i] == '-h') {
process.stdout.write(cmd.helpInformation());
cmd.emit('--help');
process.exit(0);
}
}
}
| RobbieD/finalfinalprojectproject | server/node_modules/ws/node_modules/commander/lib/commander.js | JavaScript | mit | 22,203 |
'use strict'
var qs = require('qs')
, querystring = require('querystring')
function Querystring (request) {
this.request = request
this.lib = null
this.useQuerystring = null
this.parseOptions = null
this.stringifyOptions = null
}
Querystring.prototype.init = function (options) {
if (this.lib) {return}
this.useQuerystring = options.useQuerystring
this.lib = (this.useQuerystring ? querystring : qs)
this.parseOptions = options.qsParseOptions || {}
this.stringifyOptions = options.qsStringifyOptions || {}
}
Querystring.prototype.stringify = function (obj) {
return (this.useQuerystring)
? this.rfc3986(this.lib.stringify(obj,
this.stringifyOptions.sep || null,
this.stringifyOptions.eq || null,
this.stringifyOptions))
: this.lib.stringify(obj, this.stringifyOptions)
}
Querystring.prototype.parse = function (str) {
return (this.useQuerystring)
? this.lib.parse(str,
this.parseOptions.sep || null,
this.parseOptions.eq || null,
this.parseOptions)
: this.lib.parse(str, this.parseOptions)
}
Querystring.prototype.rfc3986 = function (str) {
return str.replace(/[!'()*]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
})
}
Querystring.prototype.unescape = querystring.unescape
exports.Querystring = Querystring
| TobiasSK/AarhusWebDevCoop | AarhusWebDevCoop/node_modules/gulp-sass/node_modules/node-sass/node_modules/request/lib/querystring.js | JavaScript | mit | 1,333 |
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) {
return Array.isArray(ar);
}
exports.isArray = isArray;
function isBoolean(arg) {
return typeof arg === 'boolean';
}
exports.isBoolean = isBoolean;
function isNull(arg) {
return arg === null;
}
exports.isNull = isNull;
function isNullOrUndefined(arg) {
return arg == null;
}
exports.isNullOrUndefined = isNullOrUndefined;
function isNumber(arg) {
return typeof arg === 'number';
}
exports.isNumber = isNumber;
function isString(arg) {
return typeof arg === 'string';
}
exports.isString = isString;
function isSymbol(arg) {
return typeof arg === 'symbol';
}
exports.isSymbol = isSymbol;
function isUndefined(arg) {
return arg === void 0;
}
exports.isUndefined = isUndefined;
function isRegExp(re) {
return isObject(re) && objectToString(re) === '[object RegExp]';
}
exports.isRegExp = isRegExp;
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
}
exports.isObject = isObject;
function isDate(d) {
return isObject(d) && objectToString(d) === '[object Date]';
}
exports.isDate = isDate;
function isError(e) {
return isObject(e) &&
(objectToString(e) === '[object Error]' || e instanceof Error);
}
exports.isError = isError;
function isFunction(arg) {
return typeof arg === 'function';
}
exports.isFunction = isFunction;
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
}
exports.isPrimitive = isPrimitive;
function isBuffer(arg) {
return Buffer.isBuffer(arg);
}
exports.isBuffer = isBuffer;
function objectToString(o) {
return Object.prototype.toString.call(o);
} | abhijitkamb/Template_MEANjs | node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/lib/util.js | JavaScript | mit | 3,040 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This code is partially based on the Rack-Cache library by Ryan Tomayko,
* which is released under the MIT license.
* (based on commit 02d2b48d75bcb63cf1c0c7149c077ad256542801)
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\HttpKernel\HttpCache;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\TerminableInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Cache provides HTTP caching.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
*/
class HttpCache implements HttpKernelInterface, TerminableInterface
{
private $kernel;
private $store;
private $request;
private $esi;
private $esiCacheStrategy;
private $traces;
/**
* Constructor.
*
* The available options are:
*
* * debug: If true, the traces are added as a HTTP header to ease debugging
*
* * default_ttl The number of seconds that a cache entry should be considered
* fresh when no explicit freshness information is provided in
* a response. Explicit Cache-Control or Expires headers
* override this value. (default: 0)
*
* * private_headers Set of request headers that trigger "private" cache-control behavior
* on responses that don't explicitly state whether the response is
* public or private via a Cache-Control directive. (default: Authorization and Cookie)
*
* * allow_reload Specifies whether the client can force a cache reload by including a
* Cache-Control "no-cache" directive in the request. Set it to ``true``
* for compliance with RFC 2616. (default: false)
*
* * allow_revalidate Specifies whether the client can force a cache revalidate by including
* a Cache-Control "max-age=0" directive in the request. Set it to ``true``
* for compliance with RFC 2616. (default: false)
*
* * stale_while_revalidate Specifies the default number of seconds (the granularity is the second as the
* Response TTL precision is a second) during which the cache can immediately return
* a stale response while it revalidates it in the background (default: 2).
* This setting is overridden by the stale-while-revalidate HTTP Cache-Control
* extension (see RFC 5861).
*
* * stale_if_error Specifies the default number of seconds (the granularity is the second) during which
* the cache can serve a stale response when an error is encountered (default: 60).
* This setting is overridden by the stale-if-error HTTP Cache-Control extension
* (see RFC 5861).
*
* @param HttpKernelInterface $kernel An HttpKernelInterface instance
* @param StoreInterface $store A Store instance
* @param Esi $esi An Esi instance
* @param array $options An array of options
*/
public function __construct(HttpKernelInterface $kernel, StoreInterface $store, Esi $esi = null, array $options = array())
{
$this->store = $store;
$this->kernel = $kernel;
// needed in case there is a fatal error because the backend is too slow to respond
register_shutdown_function(array($this->store, 'cleanup'));
$this->options = array_merge(array(
'debug' => false,
'default_ttl' => 0,
'private_headers' => array('Authorization', 'Cookie'),
'allow_reload' => false,
'allow_revalidate' => false,
'stale_while_revalidate' => 2,
'stale_if_error' => 60,
), $options);
$this->esi = $esi;
$this->traces = array();
}
/**
* Gets the current store.
*
* @return StoreInterface $store A StoreInterface instance
*/
public function getStore()
{
return $this->store;
}
/**
* Returns an array of events that took place during processing of the last request.
*
* @return array An array of events
*/
public function getTraces()
{
return $this->traces;
}
/**
* Returns a log message for the events of the last request processing.
*
* @return string A log message
*/
public function getLog()
{
$log = array();
foreach ($this->traces as $request => $traces) {
$log[] = sprintf('%s: %s', $request, implode(', ', $traces));
}
return implode('; ', $log);
}
/**
* Gets the Request instance associated with the master request.
*
* @return Symfony\Component\HttpFoundation\Request A Request instance
*/
public function getRequest()
{
return $this->request;
}
/**
* Gets the Kernel instance
*
* @return Symfony\Component\HttpKernel\HttpKernelInterface An HttpKernelInterface instance
*/
public function getKernel()
{
return $this->kernel;
}
/**
* Gets the Esi instance
*
* @return Symfony\Component\HttpKernel\HttpCache\Esi An Esi instance
*/
public function getEsi()
{
return $this->esi;
}
/**
* {@inheritdoc}
*
* @api
*/
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
// FIXME: catch exceptions and implement a 500 error page here? -> in Varnish, there is a built-in error page mechanism
if (HttpKernelInterface::MASTER_REQUEST === $type) {
$this->traces = array();
$this->request = $request;
if (null !== $this->esi) {
$this->esiCacheStrategy = $this->esi->createCacheStrategy();
}
}
$path = $request->getPathInfo();
if ($qs = $request->getQueryString()) {
$path .= '?'.$qs;
}
$this->traces[$request->getMethod().' '.$path] = array();
if (!$request->isMethodSafe()) {
$response = $this->invalidate($request, $catch);
} elseif ($request->headers->has('expect')) {
$response = $this->pass($request, $catch);
} else {
$response = $this->lookup($request, $catch);
}
$response->isNotModified($request);
$this->restoreResponseBody($request, $response);
$response->setDate(new \DateTime(null, new \DateTimeZone('UTC')));
if (HttpKernelInterface::MASTER_REQUEST === $type && $this->options['debug']) {
$response->headers->set('X-Symfony-Cache', $this->getLog());
}
if (null !== $this->esi) {
$this->esiCacheStrategy->add($response);
if (HttpKernelInterface::MASTER_REQUEST === $type) {
$this->esiCacheStrategy->update($response);
}
}
$response->prepare($request);
return $response;
}
/**
* {@inheritdoc}
*
* @api
*/
public function terminate(Request $request, Response $response)
{
if ($this->getKernel() instanceof TerminableInterface) {
$this->getKernel()->terminate($request, $response);
}
}
/**
* Forwards the Request to the backend without storing the Response in the cache.
*
* @param Request $request A Request instance
* @param Boolean $catch Whether to process exceptions
*
* @return Response A Response instance
*/
protected function pass(Request $request, $catch = false)
{
$this->record($request, 'pass');
return $this->forward($request, $catch);
}
/**
* Invalidates non-safe methods (like POST, PUT, and DELETE).
*
* @param Request $request A Request instance
* @param Boolean $catch Whether to process exceptions
*
* @return Response A Response instance
*
* @see RFC2616 13.10
*/
protected function invalidate(Request $request, $catch = false)
{
$response = $this->pass($request, $catch);
// invalidate only when the response is successful
if ($response->isSuccessful() || $response->isRedirect()) {
try {
$this->store->invalidate($request, $catch);
$this->record($request, 'invalidate');
} catch (\Exception $e) {
$this->record($request, 'invalidate-failed');
if ($this->options['debug']) {
throw $e;
}
}
}
return $response;
}
/**
* Lookups a Response from the cache for the given Request.
*
* When a matching cache entry is found and is fresh, it uses it as the
* response without forwarding any request to the backend. When a matching
* cache entry is found but is stale, it attempts to "validate" the entry with
* the backend using conditional GET. When no matching cache entry is found,
* it triggers "miss" processing.
*
* @param Request $request A Request instance
* @param Boolean $catch whether to process exceptions
*
* @return Response A Response instance
*/
protected function lookup(Request $request, $catch = false)
{
// if allow_reload and no-cache Cache-Control, allow a cache reload
if ($this->options['allow_reload'] && $request->isNoCache()) {
$this->record($request, 'reload');
return $this->fetch($request);
}
try {
$entry = $this->store->lookup($request);
} catch (\Exception $e) {
$this->record($request, 'lookup-failed');
if ($this->options['debug']) {
throw $e;
}
return $this->pass($request, $catch);
}
if (null === $entry) {
$this->record($request, 'miss');
return $this->fetch($request, $catch);
}
if (!$this->isFreshEnough($request, $entry)) {
$this->record($request, 'stale');
return $this->validate($request, $entry, $catch);
}
$this->record($request, 'fresh');
$entry->headers->set('Age', $entry->getAge());
return $entry;
}
/**
* Validates that a cache entry is fresh.
*
* The original request is used as a template for a conditional
* GET request with the backend.
*
* @param Request $request A Request instance
* @param Response $entry A Response instance to validate
* @param Boolean $catch Whether to process exceptions
*
* @return Response A Response instance
*/
protected function validate(Request $request, Response $entry, $catch = false)
{
$subRequest = clone $request;
// send no head requests because we want content
$subRequest->setMethod('GET');
// add our cached last-modified validator
$subRequest->headers->set('if_modified_since', $entry->headers->get('Last-Modified'));
// Add our cached etag validator to the environment.
// We keep the etags from the client to handle the case when the client
// has a different private valid entry which is not cached here.
$cachedEtags = $entry->getEtag() ? array($entry->getEtag()) : array();
$requestEtags = $request->getEtags();
if ($etags = array_unique(array_merge($cachedEtags, $requestEtags))) {
$subRequest->headers->set('if_none_match', implode(', ', $etags));
}
$response = $this->forward($subRequest, $catch, $entry);
if (304 == $response->getStatusCode()) {
$this->record($request, 'valid');
// return the response and not the cache entry if the response is valid but not cached
$etag = $response->getEtag();
if ($etag && in_array($etag, $requestEtags) && !in_array($etag, $cachedEtags)) {
return $response;
}
$entry = clone $entry;
$entry->headers->remove('Date');
foreach (array('Date', 'Expires', 'Cache-Control', 'ETag', 'Last-Modified') as $name) {
if ($response->headers->has($name)) {
$entry->headers->set($name, $response->headers->get($name));
}
}
$response = $entry;
} else {
$this->record($request, 'invalid');
}
if ($response->isCacheable()) {
$this->store($request, $response);
}
return $response;
}
/**
* Forwards the Request to the backend and determines whether the response should be stored.
*
* This methods is triggered when the cache missed or a reload is required.
*
* @param Request $request A Request instance
* @param Boolean $catch whether to process exceptions
*
* @return Response A Response instance
*/
protected function fetch(Request $request, $catch = false)
{
$subRequest = clone $request;
// send no head requests because we want content
$subRequest->setMethod('GET');
// avoid that the backend sends no content
$subRequest->headers->remove('if_modified_since');
$subRequest->headers->remove('if_none_match');
$response = $this->forward($subRequest, $catch);
if ($this->isPrivateRequest($request) && !$response->headers->hasCacheControlDirective('public')) {
$response->setPrivate(true);
} elseif ($this->options['default_ttl'] > 0 && null === $response->getTtl() && !$response->headers->getCacheControlDirective('must-revalidate')) {
$response->setTtl($this->options['default_ttl']);
}
if ($response->isCacheable()) {
$this->store($request, $response);
}
return $response;
}
/**
* Forwards the Request to the backend and returns the Response.
*
* @param Request $request A Request instance
* @param Boolean $catch Whether to catch exceptions or not
* @param Response $entry A Response instance (the stale entry if present, null otherwise)
*
* @return Response A Response instance
*/
protected function forward(Request $request, $catch = false, Response $entry = null)
{
if ($this->esi) {
$this->esi->addSurrogateEsiCapability($request);
}
// always a "master" request (as the real master request can be in cache)
$response = $this->kernel->handle($request, HttpKernelInterface::MASTER_REQUEST, $catch);
// FIXME: we probably need to also catch exceptions if raw === true
// we don't implement the stale-if-error on Requests, which is nonetheless part of the RFC
if (null !== $entry && in_array($response->getStatusCode(), array(500, 502, 503, 504))) {
if (null === $age = $entry->headers->getCacheControlDirective('stale-if-error')) {
$age = $this->options['stale_if_error'];
}
if (abs($entry->getTtl()) < $age) {
$this->record($request, 'stale-if-error');
return $entry;
}
}
$this->processResponseBody($request, $response);
return $response;
}
/**
* Checks whether the cache entry is "fresh enough" to satisfy the Request.
*
* @param Request $request A Request instance
* @param Response $entry A Response instance
*
* @return Boolean true if the cache entry if fresh enough, false otherwise
*/
protected function isFreshEnough(Request $request, Response $entry)
{
if (!$entry->isFresh()) {
return $this->lock($request, $entry);
}
if ($this->options['allow_revalidate'] && null !== $maxAge = $request->headers->getCacheControlDirective('max-age')) {
return $maxAge > 0 && $maxAge >= $entry->getAge();
}
return true;
}
/**
* Locks a Request during the call to the backend.
*
* @param Request $request A Request instance
* @param Response $entry A Response instance
*
* @return Boolean true if the cache entry can be returned even if it is staled, false otherwise
*/
protected function lock(Request $request, Response $entry)
{
// try to acquire a lock to call the backend
$lock = $this->store->lock($request, $entry);
// there is already another process calling the backend
if (true !== $lock) {
// check if we can serve the stale entry
if (null === $age = $entry->headers->getCacheControlDirective('stale-while-revalidate')) {
$age = $this->options['stale_while_revalidate'];
}
if (abs($entry->getTtl()) < $age) {
$this->record($request, 'stale-while-revalidate');
// server the stale response while there is a revalidation
return true;
}
// wait for the lock to be released
$wait = 0;
while (is_file($lock) && $wait < 5000000) {
usleep(50000);
$wait += 50000;
}
if ($wait < 2000000) {
// replace the current entry with the fresh one
$new = $this->lookup($request);
$entry->headers = $new->headers;
$entry->setContent($new->getContent());
$entry->setStatusCode($new->getStatusCode());
$entry->setProtocolVersion($new->getProtocolVersion());
foreach ($new->headers->getCookies() as $cookie) {
$entry->headers->setCookie($cookie);
}
} else {
// backend is slow as hell, send a 503 response (to avoid the dog pile effect)
$entry->setStatusCode(503);
$entry->setContent('503 Service Unavailable');
$entry->headers->set('Retry-After', 10);
}
return true;
}
// we have the lock, call the backend
return false;
}
/**
* Writes the Response to the cache.
*
* @param Request $request A Request instance
* @param Response $response A Response instance
*/
protected function store(Request $request, Response $response)
{
try {
$this->store->write($request, $response);
$this->record($request, 'store');
$response->headers->set('Age', $response->getAge());
} catch (\Exception $e) {
$this->record($request, 'store-failed');
if ($this->options['debug']) {
throw $e;
}
}
// now that the response is cached, release the lock
$this->store->unlock($request);
}
/**
* Restores the Response body.
*
* @param Request $request A Request instance
* @param Response $response A Response instance
*
* @return Response A Response instance
*/
private function restoreResponseBody(Request $request, Response $response)
{
if ('HEAD' === $request->getMethod() || 304 === $response->getStatusCode()) {
$response->setContent(null);
$response->headers->remove('X-Body-Eval');
$response->headers->remove('X-Body-File');
return;
}
if ($response->headers->has('X-Body-Eval')) {
ob_start();
if ($response->headers->has('X-Body-File')) {
include $response->headers->get('X-Body-File');
} else {
eval('; ?>'.$response->getContent().'<?php ;');
}
$response->setContent(ob_get_clean());
$response->headers->remove('X-Body-Eval');
if (!$response->headers->has('Transfer-Encoding')) {
$response->headers->set('Content-Length', strlen($response->getContent()));
}
} elseif ($response->headers->has('X-Body-File')) {
$response->setContent(file_get_contents($response->headers->get('X-Body-File')));
} else {
return;
}
$response->headers->remove('X-Body-File');
}
protected function processResponseBody(Request $request, Response $response)
{
if (null !== $this->esi && $this->esi->needsEsiParsing($response)) {
$this->esi->process($request, $response);
}
}
/**
* Checks if the Request includes authorization or other sensitive information
* that should cause the Response to be considered private by default.
*
* @param Request $request A Request instance
*
* @return Boolean true if the Request is private, false otherwise
*/
private function isPrivateRequest(Request $request)
{
foreach ($this->options['private_headers'] as $key) {
$key = strtolower(str_replace('HTTP_', '', $key));
if ('cookie' === $key) {
if (count($request->cookies->all())) {
return true;
}
} elseif ($request->headers->has($key)) {
return true;
}
}
return false;
}
/**
* Records that an event took place.
*
* @param Request $request A Request instance
* @param string $event The event name
*/
private function record(Request $request, $event)
{
$path = $request->getPathInfo();
if ($qs = $request->getQueryString()) {
$path .= '?'.$qs;
}
$this->traces[$request->getMethod().' '.$path][] = $event;
}
}
| ruthi87isabel/invoice-system | vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php | PHP | mit | 22,434 |
/** Add World Map Data Points */
jQuery.fn.vectorMap('addMap', 'australia_en', {"width":950,"height":550,"paths":{"pg":{"path":"m 484.34788,3.4935749 -1.05721,69.8328711 10.05776,-0.54289 13.22939,-15.458095 11.11497,0.542891 7.1433,6.400394 2.37157,19.715499 22.74426,12.000739 5.82893,-2.142989 v -7.200443 l -18.25827,-15.200936 -9.00055,-20.801281 7.1433,-3.457356 -5.28604,-11.457848 -10.57208,-0.257159 -2.65731,-12.257897 -28.0303,-18.9154509 -4.77172,-0.8000492 0,0 m 79.20488,2.0286963 -2.51444,3.5716485 13.7437,12.1721783 1.88583,7.143297 3.74309,-0.428598 0.4286,-7.343309 -4.17169,-3.771661 -13.11509,-11.3435558 0,0 m 6.88614,17.2296328 -2.71446,0.62861 -1.65724,7.343309 -5.20032,3.371636 -15.62954,2.743026 0.62861,5.886077 16.45816,-0.828622 10.42921,-6.514687 -0.62861,-11.343556 -1.68581,-1.285793 0,0 m 18.54399,12.800788 3.54308,9.85775 6.25753,6.086089 1.88583,-1.685818 -0.62861,-6.514687 -7.08615,-8.60053 -3.97168,0.857196 0,0 z","name":"Papua New Guinea"},"au":{"path":"m 222.64605,231.19331 -1.00006,72.51875 -11.14354,8.17193 -1.00007,7.1433 15.20094,10.20063 37.5166,-7.1433 h 19.25833 l 7.08615,-10.2292 42.57405,-8.17193 30.40187,9.20056 -2.0287,12.2579 4.05739,12.2579 23.31573,-4.08597 1.00006,6.11467 -15.20094,11.22926 5.05746,4.08596 11.14354,-4.08596 -3.02876,33.71636 21.28703,16.34386 12.17217,-4.08596 6.08609,6.11466 35.4879,-5.1146 33.45921,-54.14619 12.17217,-3.05733 24.31579,-44.94563 6.08609,-38.80239 -15.20094,-19.40119 6.08609,-4.08597 -12.17218,-37.80232 -13.17224,-9.20057 2.0287,-51.06029 -12.17218,-9.20056 -3.02876,-28.601766 h -6.08609 l -20.28696,67.404146 -11.14354,1.02864 -25.34442,-25.54443 14.20087,-37.80233 -26.34448,-5.114599 -29.40181,8.171929 -8.11478,23.48716 -13.17224,3.05733 -1.00006,-16.34386 -53.7176,32.68773 1.00006,12.2579 -8.11478,11.22926 h -20.28696 l -43.60269,18.37256 -15.22951,40.97395 0,0 m 184.49708,195.09773 -5.05746,20.42983 1.00006,14.28659 15.20094,-1.02863 17.22963,-26.5445 -28.37317,-7.14329 0,0 z","name":"Australia"},"nz":{"path":"m 656.52991,385.43138 3.02876,33.71636 -4.05739,15.31523 -15.20094,11.22926 1.00006,13.28653 v 14.2866 l 4.05739,5.1146 41.57399,-35.74506 v -8.17193 H 676.7883 l -14.20087,-48.00296 -6.05752,-1.02863 0,0 m -30.40187,73.54738 8.11478,15.31523 -22.31566,21.45847 -2.02869,11.22926 -15.20094,2.0287 -25.34442,23.48716 -23.31572,-11.22927 -2.02869,-8.17193 42.57405,-18.37256 39.54529,-35.74506 0,0 z","name":"New Zealand"},"nc":{"path":"m 638.30022,209.73485 -1.00006,5.1146 13.17223,18.37256 7.08616,3.05733 1.00006,-7.1433 -20.25839,-19.40119 0,0 z","name":"New Caledonia"},"sb":{"path":"m 606.26967,50.23931 0.4286,6.514687 3.97167,3.771661 3.74309,-2.314428 -3.34306,-6.943285 -4.8003,-1.028635 0,0 m 5.00031,16.172425 -3.34306,3.571648 3.54307,6.514687 4.17169,1.25722 -0.20001,-4.40027 -4.17169,-6.943285 0,0 m 8.14336,-3.771661 2.91446,7.143297 5.62892,6.714699 3.11448,-5.028881 -4.17169,-7.143297 -7.48617,-1.685818 0,0 m 14.6009,10.714946 1.65724,8.829115 3.97168,5.457479 3.34306,-6.914712 -8.97198,-7.371882 0,0 m 4.57171,19.744072 -1.45723,2.514441 4.80029,6.314677 3.34306,0.20001 -2.08584,-8.200505 -4.60028,-0.828623 0,0 m -10.62923,12.572208 -5.00031,2.31442 4.3717,6.08609 3.74309,-2.11441 -3.11448,-6.2861 0,0 z","name":"Solomon Islands"},"vu":{"path":"m 678.95986,143.30218 -3.54307,4.74315 1.4858,5.34319 1.77154,1.20007 3.22877,-4.17168 -2.94304,-7.11473 0,0 m 1.77154,14.54376 0.28573,3.85738 3.82881,1.20007 2.65731,-1.48581 -2.65731,-4.17168 -4.11454,0.60004 0,0 m 5.60035,34.45926 -1.77154,2.68588 2.6573,2.97161 4.42885,-1.4858 -5.31461,-4.17169 0,0 z","name":"Vanuatu"},"fj":{"path":"m 758.25046,186.36198 -3.54308,4.74315 -0.28573,5.34318 4.11454,4.17169 -0.28573,-14.25802 0,0 z","name":"Fiji"}}});
| iwdmb/cdnjs | ajax/libs/jqvmap/1.5.1/maps/continents/jquery.vmap.australia.js | JavaScript | mit | 3,752 |
define("ace/snippets",["require","exports","module","ace/lib/oop","ace/lib/event_emitter","ace/lib/lang","ace/range","ace/anchor","ace/keyboard/hash_handler","ace/tokenizer","ace/lib/dom","ace/editor"],function(e,t,n){"use strict";var r=e("./lib/oop"),i=e("./lib/event_emitter").EventEmitter,s=e("./lib/lang"),o=e("./range").Range,u=e("./anchor").Anchor,a=e("./keyboard/hash_handler").HashHandler,f=e("./tokenizer").Tokenizer,l=o.comparePoints,c=function(){this.snippetMap={},this.snippetNameMap={}};(function(){r.implement(this,i),this.getTokenizer=function(){function e(e,t,n){return e=e.substr(1),/^\d+$/.test(e)&&!n.inFormatString?[{tabstopId:parseInt(e,10)}]:[{text:e}]}function t(e){return"(?:[^\\\\"+e+"]|\\\\.)"}return c.$tokenizer=new f({start:[{regex:/:/,onMatch:function(e,t,n){return n.length&&n[0].expectIf?(n[0].expectIf=!1,n[0].elseBranch=n[0],[n[0]]):":"}},{regex:/\\./,onMatch:function(e,t,n){var r=e[1];return r=="}"&&n.length?e=r:"`$\\".indexOf(r)!=-1?e=r:n.inFormatString&&(r=="n"?e="\n":r=="t"?e="\n":"ulULE".indexOf(r)!=-1&&(e={changeCase:r,local:r>"a"})),[e]}},{regex:/}/,onMatch:function(e,t,n){return[n.length?n.shift():e]}},{regex:/\$(?:\d+|\w+)/,onMatch:e},{regex:/\$\{[\dA-Z_a-z]+/,onMatch:function(t,n,r){var i=e(t.substr(1),n,r);return r.unshift(i[0]),i},next:"snippetVar"},{regex:/\n/,token:"newline",merge:!1}],snippetVar:[{regex:"\\|"+t("\\|")+"*\\|",onMatch:function(e,t,n){n[0].choices=e.slice(1,-1).split(",")},next:"start"},{regex:"/("+t("/")+"+)/(?:("+t("/")+"*)/)(\\w*):?",onMatch:function(e,t,n){var r=n[0];return r.fmtString=e,e=this.splitRegex.exec(e),r.guard=e[1],r.fmt=e[2],r.flag=e[3],""},next:"start"},{regex:"`"+t("`")+"*`",onMatch:function(e,t,n){return n[0].code=e.splice(1,-1),""},next:"start"},{regex:"\\?",onMatch:function(e,t,n){n[0]&&(n[0].expectIf=!0)},next:"start"},{regex:"([^:}\\\\]|\\\\.)*:?",token:"",next:"start"}],formatString:[{regex:"/("+t("/")+"+)/",token:"regex"},{regex:"",onMatch:function(e,t,n){n.inFormatString=!0},next:"start"}]}),c.prototype.getTokenizer=function(){return c.$tokenizer},c.$tokenizer},this.tokenizeTmSnippet=function(e,t){return this.getTokenizer().getLineTokens(e,t).tokens.map(function(e){return e.value||e})},this.$getDefaultValue=function(e,t){if(/^[A-Z]\d+$/.test(t)){var n=t.substr(1);return(this.variables[t[0]+"__"]||{})[n]}if(/^\d+$/.test(t))return(this.variables.__||{})[t];t=t.replace(/^TM_/,"");if(!e)return;var r=e.session;switch(t){case"CURRENT_WORD":var i=r.getWordRange();case"SELECTION":case"SELECTED_TEXT":return r.getTextRange(i);case"CURRENT_LINE":return r.getLine(e.getCursorPosition().row);case"PREV_LINE":return r.getLine(e.getCursorPosition().row-1);case"LINE_INDEX":return e.getCursorPosition().column;case"LINE_NUMBER":return e.getCursorPosition().row+1;case"SOFT_TABS":return r.getUseSoftTabs()?"YES":"NO";case"TAB_SIZE":return r.getTabSize();case"FILENAME":case"FILEPATH":return"";case"FULLNAME":return"Ace"}},this.variables={},this.getVariableValue=function(e,t){return this.variables.hasOwnProperty(t)?this.variables[t](e,t)||"":this.$getDefaultValue(e,t)||""},this.tmStrFormat=function(e,t,n){var r=t.flag||"",i=t.guard;i=new RegExp(i,r.replace(/[^gi]/,""));var s=this.tokenizeTmSnippet(t.fmt,"formatString"),o=this,u=e.replace(i,function(){o.variables.__=arguments;var e=o.resolveVariables(s,n),t="E";for(var r=0;r<e.length;r++){var i=e[r];if(typeof i=="object"){e[r]="";if(i.changeCase&&i.local){var u=e[r+1];u&&typeof u=="string"&&(i.changeCase=="u"?e[r]=u[0].toUpperCase():e[r]=u[0].toLowerCase(),e[r+1]=u.substr(1))}else i.changeCase&&(t=i.changeCase)}else t=="U"?e[r]=i.toUpperCase():t=="L"&&(e[r]=i.toLowerCase())}return e.join("")});return this.variables.__=null,u},this.resolveVariables=function(e,t){function o(t){var n=e.indexOf(t,r+1);n!=-1&&(r=n)}var n=[];for(var r=0;r<e.length;r++){var i=e[r];if(typeof i=="string")n.push(i);else{if(typeof i!="object")continue;if(i.skip)o(i);else{if(i.processed<r)continue;if(i.text){var s=this.getVariableValue(t,i.text);s&&i.fmtString&&(s=this.tmStrFormat(s,i)),i.processed=r,i.expectIf==null?s&&(n.push(s),o(i)):s?i.skip=i.elseBranch:o(i)}else i.tabstopId!=null?n.push(i):i.changeCase!=null&&n.push(i)}}}return n},this.insertSnippetForSelection=function(e,t){function f(e){var t=[];for(var n=0;n<e.length;n++){var r=e[n];if(typeof r=="object"){if(a[r.tabstopId])continue;var i=e.lastIndexOf(r,n-1);r=t[i]||{tabstopId:r.tabstopId}}t[n]=r}return t}var n=e.getCursorPosition(),r=e.session.getLine(n.row),i=e.session.getTabString(),s=r.match(/^\s*/)[0];n.column<s.length&&(s=s.slice(0,n.column));var o=this.tokenizeTmSnippet(t);o=this.resolveVariables(o,e),o=o.map(function(e){return e=="\n"?e+s:typeof e=="string"?e.replace(/\t/g,i):e});var u=[];o.forEach(function(e,t){if(typeof e!="object")return;var n=e.tabstopId,r=u[n];r||(r=u[n]=[],r.index=n,r.value="");if(r.indexOf(e)!==-1)return;r.push(e);var i=o.indexOf(e,t+1);if(i===-1)return;var s=o.slice(t+1,i),a=s.some(function(e){return typeof e=="object"});a&&!r.value?r.value=s:s.length&&(!r.value||typeof r.value!="string")&&(r.value=s.join(""))}),u.forEach(function(e){e.length=0});var a={};for(var l=0;l<o.length;l++){var c=o[l];if(typeof c!="object")continue;var p=c.tabstopId,d=o.indexOf(c,l+1);if(a[p]){a[p]===c&&(a[p]=null);continue}var v=u[p],m=typeof v.value=="string"?[v.value]:f(v.value);m.unshift(l+1,Math.max(0,d-l)),m.push(c),a[p]=c,o.splice.apply(o,m),v.indexOf(c)===-1&&v.push(c)}var g=0,y=0,b="";o.forEach(function(e){typeof e=="string"?(e[0]==="\n"?(y=e.length-1,g++):y+=e.length,b+=e):e.start?e.end={row:g,column:y}:e.start={row:g,column:y}});var w=e.getSelectionRange(),E=e.session.replace(w,b),S=new h(e),x=e.inVirtualSelectionMode&&e.selection.index;S.addTabstops(u,w.start,E,x)},this.insertSnippet=function(e,t){var n=this;if(e.inVirtualSelectionMode)return n.insertSnippetForSelection(e,t);e.forEachSelection(function(){n.insertSnippetForSelection(e,t)},null,{keepOrder:!0}),e.tabstopManager&&e.tabstopManager.tabNext()},this.$getScope=function(e){var t=e.session.$mode.$id||"";t=t.split("/").pop();if(t==="html"||t==="php"){t==="php"&&!e.session.$mode.inlinePhp&&(t="html");var n=e.getCursorPosition(),r=e.session.getState(n.row);typeof r=="object"&&(r=r[0]),r.substring&&(r.substring(0,3)=="js-"?t="javascript":r.substring(0,4)=="css-"?t="css":r.substring(0,4)=="php-"&&(t="php"))}return t},this.getActiveScopes=function(e){var t=this.$getScope(e),n=[t],r=this.snippetMap;return r[t]&&r[t].includeScopes&&n.push.apply(n,r[t].includeScopes),n.push("_"),n},this.expandWithTab=function(e,t){var n=this,r=e.forEachSelection(function(){return n.expandSnippetForSelection(e,t)},null,{keepOrder:!0});return r&&e.tabstopManager&&e.tabstopManager.tabNext(),r},this.expandSnippetForSelection=function(e,t){var n=e.getCursorPosition(),r=e.session.getLine(n.row),i=r.substring(0,n.column),s=r.substr(n.column),o=this.snippetMap,u;return this.getActiveScopes(e).some(function(e){var t=o[e];return t&&(u=this.findMatchingSnippet(t,i,s)),!!u},this),u?t&&t.dryRun?!0:(e.session.doc.removeInLine(n.row,n.column-u.replaceBefore.length,n.column+u.replaceAfter.length),this.variables.M__=u.matchBefore,this.variables.T__=u.matchAfter,this.insertSnippetForSelection(e,u.content),this.variables.M__=this.variables.T__=null,!0):!1},this.findMatchingSnippet=function(e,t,n){for(var r=e.length;r--;){var i=e[r];if(i.startRe&&!i.startRe.test(t))continue;if(i.endRe&&!i.endRe.test(n))continue;if(!i.startRe&&!i.endRe)continue;return i.matchBefore=i.startRe?i.startRe.exec(t):[""],i.matchAfter=i.endRe?i.endRe.exec(n):[""],i.replaceBefore=i.triggerRe?i.triggerRe.exec(t)[0]:"",i.replaceAfter=i.endTriggerRe?i.endTriggerRe.exec(n)[0]:"",i}},this.snippetMap={},this.snippetNameMap={},this.register=function(e,t){function o(e){return e&&!/^\^?\(.*\)\$?$|^\\b$/.test(e)&&(e="(?:"+e+")"),e||""}function u(e,t,n){return e=o(e),t=o(t),n?(e=t+e,e&&e[e.length-1]!="$"&&(e+="$")):(e+=t,e&&e[0]!="^"&&(e="^"+e)),new RegExp(e)}function a(e){e.scope||(e.scope=t||"_"),t=e.scope,n[t]||(n[t]=[],r[t]={});var o=r[t];if(e.name){var a=o[e.name];a&&i.unregister(a),o[e.name]=e}n[t].push(e),e.tabTrigger&&!e.trigger&&(!e.guard&&/^\w/.test(e.tabTrigger)&&(e.guard="\\b"),e.trigger=s.escapeRegExp(e.tabTrigger)),e.startRe=u(e.trigger,e.guard,!0),e.triggerRe=new RegExp(e.trigger,"",!0),e.endRe=u(e.endTrigger,e.endGuard,!0),e.endTriggerRe=new RegExp(e.endTrigger,"",!0)}var n=this.snippetMap,r=this.snippetNameMap,i=this;e.content?a(e):Array.isArray(e)&&e.forEach(a),this._signal("registerSnippets",{scope:t})},this.unregister=function(e,t){function i(e){var i=r[e.scope||t];if(i&&i[e.name]){delete i[e.name];var s=n[e.scope||t],o=s&&s.indexOf(e);o>=0&&s.splice(o,1)}}var n=this.snippetMap,r=this.snippetNameMap;e.content?i(e):Array.isArray(e)&&e.forEach(i)},this.parseSnippetFile=function(e){e=e.replace(/\r/g,"");var t=[],n={},r=/^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm,i;while(i=r.exec(e)){if(i[1])try{n=JSON.parse(i[1]),t.push(n)}catch(s){}if(i[4])n.content=i[4].replace(/^\t/gm,""),t.push(n),n={};else{var o=i[2],u=i[3];if(o=="regex"){var a=/\/((?:[^\/\\]|\\.)*)|$/g;n.guard=a.exec(u)[1],n.trigger=a.exec(u)[1],n.endTrigger=a.exec(u)[1],n.endGuard=a.exec(u)[1]}else o=="snippet"?(n.tabTrigger=u.match(/^\S*/)[0],n.name||(n.name=u)):n[o]=u}}return t},this.getSnippetByName=function(e,t){var n=this.snippetNameMap,r;return this.getActiveScopes(t).some(function(t){var i=n[t];return i&&(r=i[e]),!!r},this),r}}).call(c.prototype);var h=function(e){if(e.tabstopManager)return e.tabstopManager;e.tabstopManager=this,this.$onChange=this.onChange.bind(this),this.$onChangeSelection=s.delayedCall(this.onChangeSelection.bind(this)).schedule,this.$onChangeSession=this.onChangeSession.bind(this),this.$onAfterExec=this.onAfterExec.bind(this),this.attach(e)};(function(){this.attach=function(e){this.index=0,this.ranges=[],this.tabstops=[],this.$openTabstops=null,this.selectedTabstop=null,this.editor=e,this.editor.on("change",this.$onChange),this.editor.on("changeSelection",this.$onChangeSelection),this.editor.on("changeSession",this.$onChangeSession),this.editor.commands.on("afterExec",this.$onAfterExec),this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.detach=function(){this.tabstops.forEach(this.removeTabstopMarkers,this),this.ranges=null,this.tabstops=null,this.selectedTabstop=null,this.editor.removeListener("change",this.$onChange),this.editor.removeListener("changeSelection",this.$onChangeSelection),this.editor.removeListener("changeSession",this.$onChangeSession),this.editor.commands.removeListener("afterExec",this.$onAfterExec),this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.tabstopManager=null,this.editor=null},this.onChange=function(e){var t=e.data.range,n=e.data.action[0]=="r",r=t.start,i=t.end,s=r.row,o=i.row,u=o-s,a=i.column-r.column;n&&(u=-u,a=-a);if(!this.$inChange&&n){var f=this.selectedTabstop,c=f&&!f.some(function(e){return l(e.start,r)<=0&&l(e.end,i)>=0});if(c)return this.detach()}var h=this.ranges;for(var p=0;p<h.length;p++){var d=h[p];if(d.end.row<r.row)continue;if(n&&l(r,d.start)<0&&l(i,d.end)>0){this.removeRange(d),p--;continue}d.start.row==s&&d.start.column>r.column&&(d.start.column+=a),d.end.row==s&&d.end.column>=r.column&&(d.end.column+=a),d.start.row>=s&&(d.start.row+=u),d.end.row>=s&&(d.end.row+=u),l(d.start,d.end)>0&&this.removeRange(d)}h.length||this.detach()},this.updateLinkedFields=function(){var e=this.selectedTabstop;if(!e||!e.hasLinkedRanges)return;this.$inChange=!0;var n=this.editor.session,r=n.getTextRange(e.firstNonLinked);for(var i=e.length;i--;){var s=e[i];if(!s.linked)continue;var o=t.snippetManager.tmStrFormat(r,s.original);n.replace(s,o)}this.$inChange=!1},this.onAfterExec=function(e){e.command&&!e.command.readOnly&&this.updateLinkedFields()},this.onChangeSelection=function(){if(!this.editor)return;var e=this.editor.selection.lead,t=this.editor.selection.anchor,n=this.editor.selection.isEmpty();for(var r=this.ranges.length;r--;){if(this.ranges[r].linked)continue;var i=this.ranges[r].contains(e.row,e.column),s=n||this.ranges[r].contains(t.row,t.column);if(i&&s)return}this.detach()},this.onChangeSession=function(){this.detach()},this.tabNext=function(e){var t=this.tabstops.length,n=this.index+(e||1);n=Math.min(Math.max(n,1),t),n==t&&(n=0),this.selectTabstop(n),n===0&&this.detach()},this.selectTabstop=function(e){this.$openTabstops=null;var t=this.tabstops[this.index];t&&this.addTabstopMarkers(t),this.index=e,t=this.tabstops[this.index];if(!t||!t.length)return;this.selectedTabstop=t;if(!this.editor.inVirtualSelectionMode){var n=this.editor.multiSelect;n.toSingleRange(t.firstNonLinked.clone());for(var r=t.length;r--;){if(t.hasLinkedRanges&&t[r].linked)continue;n.addRange(t[r].clone(),!0)}n.ranges[0]&&n.addRange(n.ranges[0].clone())}else this.editor.selection.setRange(t.firstNonLinked);this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler)},this.addTabstops=function(e,t,n){this.$openTabstops||(this.$openTabstops=[]);if(!e[0]){var r=o.fromPoints(n,n);v(r.start,t),v(r.end,t),e[0]=[r],e[0].index=0}var i=this.index,s=[i+1,0],u=this.ranges;e.forEach(function(e,n){var r=this.$openTabstops[n]||e;for(var i=e.length;i--;){var a=e[i],f=o.fromPoints(a.start,a.end||a.start);d(f.start,t),d(f.end,t),f.original=a,f.tabstop=r,u.push(f),r!=e?r.unshift(f):r[i]=f,a.fmtString?(f.linked=!0,r.hasLinkedRanges=!0):r.firstNonLinked||(r.firstNonLinked=f)}r.firstNonLinked||(r.hasLinkedRanges=!1),r===e&&(s.push(r),this.$openTabstops[n]=r),this.addTabstopMarkers(r)},this),s.length>2&&(this.tabstops.length&&s.push(s.splice(2,1)[0]),this.tabstops.splice.apply(this.tabstops,s))},this.addTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){e.markerId||(e.markerId=t.addMarker(e,"ace_snippet-marker","text"))})},this.removeTabstopMarkers=function(e){var t=this.editor.session;e.forEach(function(e){t.removeMarker(e.markerId),e.markerId=null})},this.removeRange=function(e){var t=e.tabstop.indexOf(e);e.tabstop.splice(t,1),t=this.ranges.indexOf(e),this.ranges.splice(t,1),this.editor.session.removeMarker(e.markerId),e.tabstop.length||(t=this.tabstops.indexOf(e.tabstop),t!=-1&&this.tabstops.splice(t,1),this.tabstops.length||this.detach())},this.keyboardHandler=new a,this.keyboardHandler.bindKeys({Tab:function(e){if(t.snippetManager&&t.snippetManager.expandWithTab(e))return;e.tabstopManager.tabNext(1)},"Shift-Tab":function(e){e.tabstopManager.tabNext(-1)},Esc:function(e){e.tabstopManager.detach()},Return:function(e){return!1}})}).call(h.prototype);var p={};p.onChange=u.prototype.onChange,p.setPosition=function(e,t){this.pos.row=e,this.pos.column=t},p.update=function(e,t,n){this.$insertRight=n,this.pos=e,this.onChange(t)};var d=function(e,t){e.row==0&&(e.column+=t.column),e.row+=t.row},v=function(e,t){e.row==t.row&&(e.column-=t.column),e.row-=t.row};e("./lib/dom").importCssString(".ace_snippet-marker { -moz-box-sizing: border-box; box-sizing: border-box; background: rgba(194, 193, 208, 0.09); border: 1px dotted rgba(211, 208, 235, 0.62); position: absolute;}"),t.snippetManager=new c;var m=e("./editor").Editor;(function(){this.insertSnippet=function(e,n){return t.snippetManager.insertSnippet(this,e,n)},this.expandSnippet=function(e){return t.snippetManager.expandWithTab(this,e)}}).call(m.prototype)}),define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","range","tabStops","resources","utils","actions","ace/config"],function(e,t,n){"use strict";function a(){}var r=e("ace/keyboard/hash_handler").HashHandler,i=e("ace/editor").Editor,s=e("ace/snippets").snippetManager,o=e("ace/range").Range,u;i.prototype.indexToPosition=function(e){return this.session.doc.indexToPosition(e)},i.prototype.positionToIndex=function(e){return this.session.doc.positionToIndex(e)},a.prototype={setupContext:function(e){this.ace=e,this.indentation=e.session.getTabString(),u||(u=window.emmet),u.require("resources").setVariable("indentation",this.indentation),this.$syntax=null,this.$syntax=this.getSyntax()},getSelectionRange:function(){var e=this.ace.getSelectionRange();return{start:this.ace.positionToIndex(e.start),end:this.ace.positionToIndex(e.end)}},createSelection:function(e,t){this.ace.selection.setRange({start:this.ace.indexToPosition(e),end:this.ace.indexToPosition(t)})},getCurrentLineRange:function(){var e=this.ace.getCursorPosition().row,t=this.ace.session.getLine(e).length,n=this.ace.positionToIndex({row:e,column:0});return{start:n,end:n+t}},getCaretPos:function(){var e=this.ace.getCursorPosition();return this.ace.positionToIndex(e)},setCaretPos:function(e){var t=this.ace.indexToPosition(e);this.ace.selection.moveToPosition(t)},getCurrentLine:function(){var e=this.ace.getCursorPosition().row;return this.ace.session.getLine(e)},replaceContent:function(e,t,n,r){n==null&&(n=t==null?this.getContent().length:t),t==null&&(t=0);var i=this.ace,u=o.fromPoints(i.indexToPosition(t),i.indexToPosition(n));i.session.remove(u),u.end=u.start,e=this.$updateTabstops(e),s.insertSnippet(i,e)},getContent:function(){return this.ace.getValue()},getSyntax:function(){if(this.$syntax)return this.$syntax;var e=this.ace.session.$modeId.split("/").pop();if(e=="html"||e=="php"){var t=this.ace.getCursorPosition(),n=this.ace.session.getState(t.row);typeof n!="string"&&(n=n[0]),n&&(n=n.split("-"),n.length>1?e=n[0]:e=="php"&&(e="html"))}return e},getProfileName:function(){switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var e=u.require("resources").getVariable("profile");return e||(e=this.ace.session.getLines(0,2).join("").search(/<!DOCTYPE[^>]+XHTML/i)!=-1?"xhtml":"html"),e}return"xhtml"},prompt:function(e){return prompt(e)},getSelection:function(){return this.ace.session.getTextRange()},getFilePath:function(){return""},$updateTabstops:function(e){var t=1e3,n=0,r=null,i=u.require("range"),s=u.require("tabStops"),o=u.require("resources").getVocabulary("user"),a={tabstop:function(e){var o=parseInt(e.group,10),u=o===0;u?o=++n:o+=t;var f=e.placeholder;f&&(f=s.processText(f,a));var l="${"+o+(f?":"+f:"")+"}";return u&&(r=i.create(e.start,l)),l},escape:function(e){return e=="$"?"\\$":e=="\\"?"\\\\":e}};return e=s.processText(e,a),o.variables.insert_final_tabstop&&!/\$\{0\}$/.test(e)?e+="${0}":r&&(e=u.require("utils").replaceSubstring(e,"${0}",r)),e}};var f={expand_abbreviation:{mac:"ctrl+alt+e",win:"alt+e"},match_pair_outward:{mac:"ctrl+d",win:"ctrl+,"},match_pair_inward:{mac:"ctrl+j",win:"ctrl+shift+0"},matching_pair:{mac:"ctrl+alt+j",win:"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{mac:"command+/",win:"ctrl+/"},split_join_tag:{mac:"shift+command+'",win:"shift+ctrl+`"},remove_tag:{mac:"command+'",win:"shift+ctrl+;"},evaluate_math_expression:{mac:"shift+command+y",win:"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{mac:"alt+command+up",win:"shift+alt+up"},decrement_number_by_10:{mac:"alt+command+down",win:"shift+alt+down"},select_next_item:{mac:"shift+command+.",win:"shift+ctrl+."},select_previous_item:{mac:"shift+command+,",win:"shift+ctrl+,"},reflect_css_value:{mac:"shift+command+r",win:"shift+ctrl+r"},encode_decode_data_url:{mac:"shift+ctrl+d",win:"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{mac:"shift+ctrl+a",win:"shift+ctrl+a"}},l=new a;t.commands=new r,t.runEmmetCommand=function(e){l.setupContext(e);if(l.getSyntax()=="php")return!1;var t=u.require("actions");if(this.action=="expand_abbreviation_with_tab"&&!e.selection.isEmpty())return!1;if(this.action=="wrap_with_abbreviation")return setTimeout(function(){t.run("wrap_with_abbreviation",l)},0);try{var n=t.run(this.action,l)}catch(r){e._signal("changeStatus",typeof r=="string"?r:r.message),console.log(r),n=!1}return n};for(var c in f)t.commands.addCommand({name:"emmet:"+c,action:c,bindKey:f[c],exec:t.runEmmetCommand,multiSelectAction:"forEach"});var h=function(e,n){var r=n;if(!r)return;var i=r.session.$modeId,s=i&&/css|less|scss|sass|stylus|html|php/.test(i);e.enableEmmet===!1&&(s=!1),s?r.keyBinding.addKeyboardHandler(t.commands):r.keyBinding.removeKeyboardHandler(t.commands)};t.AceEmmetEditor=a,e("ace/config").defineOptions(i.prototype,"editor",{enableEmmet:{set:function(e){this[e?"on":"removeListener"]("changeMode",h),h({enableEmmet:!!e},this)},value:!0}}),t.setCore=function(e){u=e}});
(function() {
window.require(["ace/ext/emmet"], function() {});
})();
| marxo/cdnjs | ajax/libs/ace/1.1.4/ext-emmet.js | JavaScript | mit | 20,625 |
// Chosen, a Select Box Enhancer for jQuery and Protoype
// by Patrick Filler for Harvest, http://getharvest.com
//
// Version 0.9.11
// Full source at https://github.com/harvesthq/chosen
// Copyright (c) 2011 Harvest http://getharvest.com
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
// This file is generated by `cake build`, do not edit it by hand.
(function() {
var SelectParser;
SelectParser = (function() {
function SelectParser() {
this.options_index = 0;
this.parsed = [];
}
SelectParser.prototype.add_node = function(child) {
if (child.nodeName.toUpperCase() === "OPTGROUP") {
return this.add_group(child);
} else {
return this.add_option(child);
}
};
SelectParser.prototype.add_group = function(group) {
var group_position, option, _i, _len, _ref, _results;
group_position = this.parsed.length;
this.parsed.push({
array_index: group_position,
group: true,
label: group.label,
children: 0,
disabled: group.disabled
});
_ref = group.childNodes;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
option = _ref[_i];
_results.push(this.add_option(option, group_position, group.disabled));
}
return _results;
};
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
if (option.nodeName.toUpperCase() === "OPTION") {
if (option.text !== "") {
if (group_position != null) {
this.parsed[group_position].children += 1;
}
this.parsed.push({
array_index: this.parsed.length,
options_index: this.options_index,
value: option.value,
text: option.text,
html: option.innerHTML,
selected: option.selected,
disabled: group_disabled === true ? group_disabled : option.disabled,
group_array_index: group_position,
classes: option.className,
style: option.style.cssText
});
} else {
this.parsed.push({
array_index: this.parsed.length,
options_index: this.options_index,
empty: true
});
}
return this.options_index += 1;
}
};
return SelectParser;
})();
SelectParser.select_to_array = function(select) {
var child, parser, _i, _len, _ref;
parser = new SelectParser();
_ref = select.childNodes;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
child = _ref[_i];
parser.add_node(child);
}
return parser.parsed;
};
this.SelectParser = SelectParser;
}).call(this);
/*
Chosen source: generate output using 'cake build'
Copyright (c) 2011 by Harvest
*/
(function() {
var AbstractChosen, root;
root = this;
AbstractChosen = (function() {
function AbstractChosen(form_field, options) {
this.form_field = form_field;
this.options = options != null ? options : {};
this.is_multiple = this.form_field.multiple;
this.set_default_text();
this.set_default_values();
this.setup();
this.set_up_html();
this.register_observers();
this.finish_setup();
}
AbstractChosen.prototype.set_default_values = function() {
var _this = this;
this.click_test_action = function(evt) {
return _this.test_active_click(evt);
};
this.activate_action = function(evt) {
return _this.activate_field(evt);
};
this.active_field = false;
this.mouse_on_container = false;
this.results_showing = false;
this.result_highlighted = null;
this.result_single_selected = null;
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
this.disable_search_threshold = this.options.disable_search_threshold || 0;
this.disable_search = this.options.disable_search || false;
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
this.search_contains = this.options.search_contains || false;
this.choices = 0;
this.single_backstroke_delete = this.options.single_backstroke_delete || false;
this.max_selected_options = this.options.max_selected_options || Infinity;
return this.inherit_select_classes = this.options.inherit_select_classes || false;
};
AbstractChosen.prototype.set_default_text = function() {
if (this.form_field.getAttribute("data-placeholder")) {
this.default_text = this.form_field.getAttribute("data-placeholder");
} else if (this.is_multiple) {
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
} else {
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
}
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
};
AbstractChosen.prototype.mouse_enter = function() {
return this.mouse_on_container = true;
};
AbstractChosen.prototype.mouse_leave = function() {
return this.mouse_on_container = false;
};
AbstractChosen.prototype.input_focus = function(evt) {
var _this = this;
if (this.is_multiple) {
if (!this.active_field) {
return setTimeout((function() {
return _this.container_mousedown();
}), 50);
}
} else {
if (!this.active_field) {
return this.activate_field();
}
}
};
AbstractChosen.prototype.input_blur = function(evt) {
var _this = this;
if (!this.mouse_on_container) {
this.active_field = false;
return setTimeout((function() {
return _this.blur_test();
}), 100);
}
};
AbstractChosen.prototype.result_add_option = function(option) {
var classes, style;
if (!option.disabled) {
option.dom_id = this.container_id + "_o_" + option.array_index;
classes = option.selected && this.is_multiple ? [] : ["active-result"];
if (option.selected) {
classes.push("result-selected");
}
if (option.group_array_index != null) {
classes.push("group-option");
}
if (option.classes !== "") {
classes.push(option.classes);
}
style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
} else {
return "";
}
};
AbstractChosen.prototype.results_update_field = function() {
if (!this.is_multiple) {
this.results_reset_cleanup();
}
this.result_clear_highlight();
this.result_single_selected = null;
return this.results_build();
};
AbstractChosen.prototype.results_toggle = function() {
if (this.results_showing) {
return this.results_hide();
} else {
return this.results_show();
}
};
AbstractChosen.prototype.results_search = function(evt) {
if (this.results_showing) {
return this.winnow_results();
} else {
return this.results_show();
}
};
AbstractChosen.prototype.keyup_checker = function(evt) {
var stroke, _ref;
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
this.search_field_scale();
switch (stroke) {
case 8:
if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
return this.keydown_backstroke();
} else if (!this.pending_backstroke) {
this.result_clear_highlight();
return this.results_search();
}
break;
case 13:
evt.preventDefault();
if (this.results_showing) {
return this.result_select(evt);
}
break;
case 27:
if (this.results_showing) {
this.results_hide();
}
return true;
case 9:
case 38:
case 40:
case 16:
case 91:
case 17:
break;
default:
return this.results_search();
}
};
AbstractChosen.prototype.generate_field_id = function() {
var new_id;
new_id = this.generate_random_id();
this.form_field.id = new_id;
return new_id;
};
AbstractChosen.prototype.generate_random_char = function() {
var chars, newchar, rand;
chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
rand = Math.floor(Math.random() * chars.length);
return newchar = chars.substring(rand, rand + 1);
};
return AbstractChosen;
})();
root.AbstractChosen = AbstractChosen;
}).call(this);
/*
Chosen source: generate output using 'cake build'
Copyright (c) 2011 by Harvest
*/
(function() {
var Chosen, get_side_border_padding, root,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
root = this;
Chosen = (function(_super) {
__extends(Chosen, _super);
function Chosen() {
return Chosen.__super__.constructor.apply(this, arguments);
}
Chosen.prototype.setup = function() {
this.current_value = this.form_field.value;
return this.is_rtl = this.form_field.hasClassName("chzn-rtl");
};
Chosen.prototype.finish_setup = function() {
return this.form_field.addClassName("chzn-done");
};
Chosen.prototype.set_default_values = function() {
Chosen.__super__.set_default_values.call(this);
this.single_temp = new Template('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>#{default}</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
this.multi_temp = new Template('<ul class="chzn-choices"><li class="search-field"><input type="text" value="#{default}" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
this.choice_temp = new Template('<li class="search-choice" id="#{id}"><span>#{choice}</span><a href="javascript:void(0)" class="search-choice-close" rel="#{position}"></a></li>');
this.choice_noclose_temp = new Template('<li class="search-choice search-choice-disabled" id="#{id}"><span>#{choice}</span></li>');
return this.no_results_temp = new Template('<li class="no-results">' + this.results_none_found + ' "<span>#{terms}</span>"</li>');
};
Chosen.prototype.set_up_html = function() {
var base_template, container_classes, container_props, dd_top, dd_width, sf_width;
this.container_id = this.form_field.identify().replace(/[^\w]/g, '_') + "_chzn";
container_classes = ["chzn-container"];
container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single"));
if (this.inherit_select_classes && this.form_field.className) {
container_classes.push(this.form_field.className);
}
if (this.is_rtl) {
container_classes.push("chzn-rtl");
}
this.f_width = this.form_field.getStyle("width") ? parseInt(this.form_field.getStyle("width"), 10) : this.form_field.getWidth();
container_props = {
'id': this.container_id,
'class': container_classes.join(' '),
'style': 'width: ' + this.f_width + 'px',
'title': this.form_field.title
};
base_template = this.is_multiple ? new Element('div', container_props).update(this.multi_temp.evaluate({
"default": this.default_text
})) : new Element('div', container_props).update(this.single_temp.evaluate({
"default": this.default_text
}));
this.form_field.hide().insert({
after: base_template
});
this.container = $(this.container_id);
this.dropdown = this.container.down('div.chzn-drop');
dd_top = this.container.getHeight();
dd_width = this.f_width - get_side_border_padding(this.dropdown);
this.dropdown.setStyle({
"width": dd_width + "px",
"top": dd_top + "px"
});
this.search_field = this.container.down('input');
this.search_results = this.container.down('ul.chzn-results');
this.search_field_scale();
this.search_no_results = this.container.down('li.no-results');
if (this.is_multiple) {
this.search_choices = this.container.down('ul.chzn-choices');
this.search_container = this.container.down('li.search-field');
} else {
this.search_container = this.container.down('div.chzn-search');
this.selected_item = this.container.down('.chzn-single');
sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
this.search_field.setStyle({
"width": sf_width + "px"
});
}
this.results_build();
this.set_tab_index();
return this.form_field.fire("liszt:ready", {
chosen: this
});
};
Chosen.prototype.register_observers = function() {
var _this = this;
this.container.observe("mousedown", function(evt) {
return _this.container_mousedown(evt);
});
this.container.observe("mouseup", function(evt) {
return _this.container_mouseup(evt);
});
this.container.observe("mouseenter", function(evt) {
return _this.mouse_enter(evt);
});
this.container.observe("mouseleave", function(evt) {
return _this.mouse_leave(evt);
});
this.search_results.observe("mouseup", function(evt) {
return _this.search_results_mouseup(evt);
});
this.search_results.observe("mouseover", function(evt) {
return _this.search_results_mouseover(evt);
});
this.search_results.observe("mouseout", function(evt) {
return _this.search_results_mouseout(evt);
});
this.form_field.observe("liszt:updated", function(evt) {
return _this.results_update_field(evt);
});
this.form_field.observe("liszt:activate", function(evt) {
return _this.activate_field(evt);
});
this.form_field.observe("liszt:open", function(evt) {
return _this.container_mousedown(evt);
});
this.search_field.observe("blur", function(evt) {
return _this.input_blur(evt);
});
this.search_field.observe("keyup", function(evt) {
return _this.keyup_checker(evt);
});
this.search_field.observe("keydown", function(evt) {
return _this.keydown_checker(evt);
});
this.search_field.observe("focus", function(evt) {
return _this.input_focus(evt);
});
if (this.is_multiple) {
return this.search_choices.observe("click", function(evt) {
return _this.choices_click(evt);
});
} else {
return this.container.observe("click", function(evt) {
return evt.preventDefault();
});
}
};
Chosen.prototype.search_field_disabled = function() {
this.is_disabled = this.form_field.disabled;
if (this.is_disabled) {
this.container.addClassName('chzn-disabled');
this.search_field.disabled = true;
if (!this.is_multiple) {
this.selected_item.stopObserving("focus", this.activate_action);
}
return this.close_field();
} else {
this.container.removeClassName('chzn-disabled');
this.search_field.disabled = false;
if (!this.is_multiple) {
return this.selected_item.observe("focus", this.activate_action);
}
}
};
Chosen.prototype.container_mousedown = function(evt) {
var target_closelink;
if (!this.is_disabled) {
target_closelink = evt != null ? evt.target.hasClassName("search-choice-close") : false;
if (evt && evt.type === "mousedown" && !this.results_showing) {
evt.stop();
}
if (!this.pending_destroy_click && !target_closelink) {
if (!this.active_field) {
if (this.is_multiple) {
this.search_field.clear();
}
document.observe("click", this.click_test_action);
this.results_show();
} else if (!this.is_multiple && evt && (evt.target === this.selected_item || evt.target.up("a.chzn-single"))) {
this.results_toggle();
}
return this.activate_field();
} else {
return this.pending_destroy_click = false;
}
}
};
Chosen.prototype.container_mouseup = function(evt) {
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
return this.results_reset(evt);
}
};
Chosen.prototype.blur_test = function(evt) {
if (!this.active_field && this.container.hasClassName("chzn-container-active")) {
return this.close_field();
}
};
Chosen.prototype.close_field = function() {
document.stopObserving("click", this.click_test_action);
this.active_field = false;
this.results_hide();
this.container.removeClassName("chzn-container-active");
this.winnow_results_clear();
this.clear_backstroke();
this.show_search_field_default();
return this.search_field_scale();
};
Chosen.prototype.activate_field = function() {
this.container.addClassName("chzn-container-active");
this.active_field = true;
this.search_field.value = this.search_field.value;
return this.search_field.focus();
};
Chosen.prototype.test_active_click = function(evt) {
if (evt.target.up('#' + this.container_id)) {
return this.active_field = true;
} else {
return this.close_field();
}
};
Chosen.prototype.results_build = function() {
var content, data, _i, _len, _ref;
this.parsing = true;
this.results_data = root.SelectParser.select_to_array(this.form_field);
if (this.is_multiple && this.choices > 0) {
this.search_choices.select("li.search-choice").invoke("remove");
this.choices = 0;
} else if (!this.is_multiple) {
this.selected_item.addClassName("chzn-default").down("span").update(this.default_text);
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
this.container.addClassName("chzn-container-single-nosearch");
} else {
this.container.removeClassName("chzn-container-single-nosearch");
}
}
content = '';
_ref = this.results_data;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
data = _ref[_i];
if (data.group) {
content += this.result_add_group(data);
} else if (!data.empty) {
content += this.result_add_option(data);
if (data.selected && this.is_multiple) {
this.choice_build(data);
} else if (data.selected && !this.is_multiple) {
this.selected_item.removeClassName("chzn-default").down("span").update(data.html);
if (this.allow_single_deselect) {
this.single_deselect_control_build();
}
}
}
}
this.search_field_disabled();
this.show_search_field_default();
this.search_field_scale();
this.search_results.update(content);
return this.parsing = false;
};
Chosen.prototype.result_add_group = function(group) {
if (!group.disabled) {
group.dom_id = this.container_id + "_g_" + group.array_index;
return '<li id="' + group.dom_id + '" class="group-result">' + group.label.escapeHTML() + '</li>';
} else {
return "";
}
};
Chosen.prototype.result_do_highlight = function(el) {
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
this.result_clear_highlight();
this.result_highlight = el;
this.result_highlight.addClassName("highlighted");
maxHeight = parseInt(this.search_results.getStyle('maxHeight'), 10);
visible_top = this.search_results.scrollTop;
visible_bottom = maxHeight + visible_top;
high_top = this.result_highlight.positionedOffset().top;
high_bottom = high_top + this.result_highlight.getHeight();
if (high_bottom >= visible_bottom) {
return this.search_results.scrollTop = (high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0;
} else if (high_top < visible_top) {
return this.search_results.scrollTop = high_top;
}
};
Chosen.prototype.result_clear_highlight = function() {
if (this.result_highlight) {
this.result_highlight.removeClassName('highlighted');
}
return this.result_highlight = null;
};
Chosen.prototype.results_show = function() {
var dd_top;
if (!this.is_multiple) {
this.selected_item.addClassName('chzn-single-with-drop');
if (this.result_single_selected) {
this.result_do_highlight(this.result_single_selected);
}
} else if (this.max_selected_options <= this.choices) {
this.form_field.fire("liszt:maxselected", {
chosen: this
});
return false;
}
dd_top = this.is_multiple ? this.container.getHeight() : this.container.getHeight() - 1;
this.form_field.fire("liszt:showing_dropdown", {
chosen: this
});
this.dropdown.setStyle({
"top": dd_top + "px",
"left": 0
});
this.results_showing = true;
this.search_field.focus();
this.search_field.value = this.search_field.value;
return this.winnow_results();
};
Chosen.prototype.results_hide = function() {
if (!this.is_multiple) {
this.selected_item.removeClassName('chzn-single-with-drop');
}
this.result_clear_highlight();
this.form_field.fire("liszt:hiding_dropdown", {
chosen: this
});
this.dropdown.setStyle({
"left": "-9000px"
});
return this.results_showing = false;
};
Chosen.prototype.set_tab_index = function(el) {
var ti;
if (this.form_field.tabIndex) {
ti = this.form_field.tabIndex;
this.form_field.tabIndex = -1;
return this.search_field.tabIndex = ti;
}
};
Chosen.prototype.show_search_field_default = function() {
if (this.is_multiple && this.choices < 1 && !this.active_field) {
this.search_field.value = this.default_text;
return this.search_field.addClassName("default");
} else {
this.search_field.value = "";
return this.search_field.removeClassName("default");
}
};
Chosen.prototype.search_results_mouseup = function(evt) {
var target;
target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
if (target) {
this.result_highlight = target;
this.result_select(evt);
return this.search_field.focus();
}
};
Chosen.prototype.search_results_mouseover = function(evt) {
var target;
target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
if (target) {
return this.result_do_highlight(target);
}
};
Chosen.prototype.search_results_mouseout = function(evt) {
if (evt.target.hasClassName('active-result') || evt.target.up('.active-result')) {
return this.result_clear_highlight();
}
};
Chosen.prototype.choices_click = function(evt) {
evt.preventDefault();
if (this.active_field && !(evt.target.hasClassName('search-choice') || evt.target.up('.search-choice')) && !this.results_showing) {
return this.results_show();
}
};
Chosen.prototype.choice_build = function(item) {
var choice_id, link,
_this = this;
if (this.is_multiple && this.max_selected_options <= this.choices) {
this.form_field.fire("liszt:maxselected", {
chosen: this
});
return false;
}
choice_id = this.container_id + "_c_" + item.array_index;
this.choices += 1;
this.search_container.insert({
before: (item.disabled ? this.choice_noclose_temp : this.choice_temp).evaluate({
id: choice_id,
choice: item.html,
position: item.array_index
})
});
if (!item.disabled) {
link = $(choice_id).down('a');
return link.observe("click", function(evt) {
return _this.choice_destroy_link_click(evt);
});
}
};
Chosen.prototype.choice_destroy_link_click = function(evt) {
evt.preventDefault();
if (!this.is_disabled) {
this.pending_destroy_click = true;
return this.choice_destroy(evt.target);
}
};
Chosen.prototype.choice_destroy = function(link) {
if (this.result_deselect(link.readAttribute("rel"))) {
this.choices -= 1;
this.show_search_field_default();
if (this.is_multiple && this.choices > 0 && this.search_field.value.length < 1) {
this.results_hide();
}
link.up('li').remove();
return this.search_field_scale();
}
};
Chosen.prototype.results_reset = function() {
this.form_field.options[0].selected = true;
this.selected_item.down("span").update(this.default_text);
if (!this.is_multiple) {
this.selected_item.addClassName("chzn-default");
}
this.show_search_field_default();
this.results_reset_cleanup();
if (typeof Event.simulate === 'function') {
this.form_field.simulate("change");
}
if (this.active_field) {
return this.results_hide();
}
};
Chosen.prototype.results_reset_cleanup = function() {
var deselect_trigger;
this.current_value = this.form_field.value;
deselect_trigger = this.selected_item.down("abbr");
if (deselect_trigger) {
return deselect_trigger.remove();
}
};
Chosen.prototype.result_select = function(evt) {
var high, item, position;
if (this.result_highlight) {
high = this.result_highlight;
this.result_clear_highlight();
if (this.is_multiple) {
this.result_deactivate(high);
} else {
this.search_results.descendants(".result-selected").invoke("removeClassName", "result-selected");
this.selected_item.removeClassName("chzn-default");
this.result_single_selected = high;
}
high.addClassName("result-selected");
position = high.id.substr(high.id.lastIndexOf("_") + 1);
item = this.results_data[position];
item.selected = true;
this.form_field.options[item.options_index].selected = true;
if (this.is_multiple) {
this.choice_build(item);
} else {
this.selected_item.down("span").update(item.html);
if (this.allow_single_deselect) {
this.single_deselect_control_build();
}
}
if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
this.results_hide();
}
this.search_field.value = "";
if (typeof Event.simulate === 'function' && (this.is_multiple || this.form_field.value !== this.current_value)) {
this.form_field.simulate("change");
}
this.current_value = this.form_field.value;
return this.search_field_scale();
}
};
Chosen.prototype.result_activate = function(el) {
return el.addClassName("active-result");
};
Chosen.prototype.result_deactivate = function(el) {
return el.removeClassName("active-result");
};
Chosen.prototype.result_deselect = function(pos) {
var result, result_data;
result_data = this.results_data[pos];
if (!this.form_field.options[result_data.options_index].disabled) {
result_data.selected = false;
this.form_field.options[result_data.options_index].selected = false;
result = $(this.container_id + "_o_" + pos);
result.removeClassName("result-selected").addClassName("active-result").show();
this.result_clear_highlight();
this.winnow_results();
if (typeof Event.simulate === 'function') {
this.form_field.simulate("change");
}
this.search_field_scale();
return true;
} else {
return false;
}
};
Chosen.prototype.single_deselect_control_build = function() {
if (this.allow_single_deselect && !this.selected_item.down("abbr")) {
return this.selected_item.down("span").insert({
after: "<abbr class=\"search-choice-close\"></abbr>"
});
}
};
Chosen.prototype.winnow_results = function() {
var found, option, part, parts, regex, regexAnchor, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len1, _ref;
this.no_results_clear();
results = 0;
searchText = this.search_field.value === this.default_text ? "" : this.search_field.value.strip().escapeHTML();
regexAnchor = this.search_contains ? "" : "^";
regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
_ref = this.results_data;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
option = _ref[_i];
if (!option.disabled && !option.empty) {
if (option.group) {
$(option.dom_id).hide();
} else if (!(this.is_multiple && option.selected)) {
found = false;
result_id = option.dom_id;
if (regex.test(option.html)) {
found = true;
results += 1;
} else if (this.enable_split_word_search && (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0)) {
parts = option.html.replace(/\[|\]/g, "").split(" ");
if (parts.length) {
for (_j = 0, _len1 = parts.length; _j < _len1; _j++) {
part = parts[_j];
if (regex.test(part)) {
found = true;
results += 1;
}
}
}
}
if (found) {
if (searchText.length) {
startpos = option.html.search(zregex);
text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
} else {
text = option.html;
}
if ($(result_id).innerHTML !== text) {
$(result_id).update(text);
}
this.result_activate($(result_id));
if (option.group_array_index != null) {
$(this.results_data[option.group_array_index].dom_id).setStyle({
display: 'list-item'
});
}
} else {
if ($(result_id) === this.result_highlight) {
this.result_clear_highlight();
}
this.result_deactivate($(result_id));
}
}
}
}
if (results < 1 && searchText.length) {
return this.no_results(searchText);
} else {
return this.winnow_results_set_highlight();
}
};
Chosen.prototype.winnow_results_clear = function() {
var li, lis, _i, _len, _results;
this.search_field.clear();
lis = this.search_results.select("li");
_results = [];
for (_i = 0, _len = lis.length; _i < _len; _i++) {
li = lis[_i];
if (li.hasClassName("group-result")) {
_results.push(li.show());
} else if (!this.is_multiple || !li.hasClassName("result-selected")) {
_results.push(this.result_activate(li));
} else {
_results.push(void 0);
}
}
return _results;
};
Chosen.prototype.winnow_results_set_highlight = function() {
var do_high;
if (!this.result_highlight) {
if (!this.is_multiple) {
do_high = this.search_results.down(".result-selected.active-result");
}
if (!(do_high != null)) {
do_high = this.search_results.down(".active-result");
}
if (do_high != null) {
return this.result_do_highlight(do_high);
}
}
};
Chosen.prototype.no_results = function(terms) {
return this.search_results.insert(this.no_results_temp.evaluate({
terms: terms
}));
};
Chosen.prototype.no_results_clear = function() {
var nr, _results;
nr = null;
_results = [];
while (nr = this.search_results.down(".no-results")) {
_results.push(nr.remove());
}
return _results;
};
Chosen.prototype.keydown_arrow = function() {
var actives, nexts, sibs;
actives = this.search_results.select("li.active-result");
if (actives.length) {
if (!this.result_highlight) {
this.result_do_highlight(actives.first());
} else if (this.results_showing) {
sibs = this.result_highlight.nextSiblings();
nexts = sibs.intersect(actives);
if (nexts.length) {
this.result_do_highlight(nexts.first());
}
}
if (!this.results_showing) {
return this.results_show();
}
}
};
Chosen.prototype.keyup_arrow = function() {
var actives, prevs, sibs;
if (!this.results_showing && !this.is_multiple) {
return this.results_show();
} else if (this.result_highlight) {
sibs = this.result_highlight.previousSiblings();
actives = this.search_results.select("li.active-result");
prevs = sibs.intersect(actives);
if (prevs.length) {
return this.result_do_highlight(prevs.first());
} else {
if (this.choices > 0) {
this.results_hide();
}
return this.result_clear_highlight();
}
}
};
Chosen.prototype.keydown_backstroke = function() {
var next_available_destroy;
if (this.pending_backstroke) {
this.choice_destroy(this.pending_backstroke.down("a"));
return this.clear_backstroke();
} else {
next_available_destroy = this.search_container.siblings().last();
if (next_available_destroy && next_available_destroy.hasClassName("search-choice") && !next_available_destroy.hasClassName("search-choice-disabled")) {
this.pending_backstroke = next_available_destroy;
if (this.pending_backstroke) {
this.pending_backstroke.addClassName("search-choice-focus");
}
if (this.single_backstroke_delete) {
return this.keydown_backstroke();
} else {
return this.pending_backstroke.addClassName("search-choice-focus");
}
}
}
};
Chosen.prototype.clear_backstroke = function() {
if (this.pending_backstroke) {
this.pending_backstroke.removeClassName("search-choice-focus");
}
return this.pending_backstroke = null;
};
Chosen.prototype.keydown_checker = function(evt) {
var stroke, _ref;
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
this.search_field_scale();
if (stroke !== 8 && this.pending_backstroke) {
this.clear_backstroke();
}
switch (stroke) {
case 8:
this.backstroke_length = this.search_field.value.length;
break;
case 9:
if (this.results_showing && !this.is_multiple) {
this.result_select(evt);
}
this.mouse_on_container = false;
break;
case 13:
evt.preventDefault();
break;
case 38:
evt.preventDefault();
this.keyup_arrow();
break;
case 40:
this.keydown_arrow();
break;
}
};
Chosen.prototype.search_field_scale = function() {
var dd_top, div, h, style, style_block, styles, w, _i, _len;
if (this.is_multiple) {
h = 0;
w = 0;
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
for (_i = 0, _len = styles.length; _i < _len; _i++) {
style = styles[_i];
style_block += style + ":" + this.search_field.getStyle(style) + ";";
}
div = new Element('div', {
'style': style_block
}).update(this.search_field.value.escapeHTML());
document.body.appendChild(div);
w = Element.measure(div, 'width') + 25;
div.remove();
if (w > this.f_width - 10) {
w = this.f_width - 10;
}
this.search_field.setStyle({
'width': w + 'px'
});
dd_top = this.container.getHeight();
return this.dropdown.setStyle({
"top": dd_top + "px"
});
}
};
return Chosen;
})(AbstractChosen);
root.Chosen = Chosen;
if (Prototype.Browser.IE) {
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) {
Prototype.BrowserFeatures['Version'] = new Number(RegExp.$1);
}
}
get_side_border_padding = function(elmt) {
var layout, side_border_padding;
layout = new Element.Layout(elmt);
return side_border_padding = layout.get("border-left") + layout.get("border-right") + layout.get("padding-left") + layout.get("padding-right");
};
root.get_side_border_padding = get_side_border_padding;
}).call(this);
| thejameskyle/cdnjs | ajax/libs/chosen/0.9.11/chosen.proto.js | JavaScript | mit | 38,611 |
/*
* jQuery mmenu dragOpen addon
* @requires mmenu 4.0.0 or later
*
* mmenu.frebsite.nl
*
* Copyright (c) Fred Heusschen
* www.frebsite.nl
*
* Dual licensed under the MIT and GPL licenses.
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*/
(function( $ ) {
var _PLUGIN_ = 'mmenu',
_ADDON_ = 'dragOpen';
$[ _PLUGIN_ ].prototype[ '_addon_' + _ADDON_ ] = function()
{
var that = this,
opts = this.opts[ _ADDON_ ];
if ( !$.fn.hammer )
{
return;
}
var _c = $[ _PLUGIN_ ]._c,
_d = $[ _PLUGIN_ ]._d,
_e = $[ _PLUGIN_ ]._e;
_c.add( 'dragging' );
_e.add( 'dragleft dragright dragup dragdown dragend' );
var glbl = $[ _PLUGIN_ ].glbl;
// Extend options
if ( typeof opts == 'boolean' )
{
opts = {
open: opts
};
}
if ( typeof opts != 'object' )
{
opts = {};
}
if ( typeof opts.maxStartPos != 'number' )
{
opts.maxStartPos = this.opts.position == 'left' || this.opts.position == 'right'
? 150
: 50;
}
opts = $.extend( true, {}, $[ _PLUGIN_ ].defaults[ _ADDON_ ], opts );
if ( opts.open )
{
var _stage = 0,
_direction = false,
_distance = 0,
_maxDistance = 0,
_dimension = 'width';
switch( this.opts.position )
{
case 'left':
case 'right':
_dimension = 'width';
break;
default:
_dimension = 'height';
break;
}
// Set up variables
switch( this.opts.position )
{
case 'left':
var drag = {
events : _e.dragleft + ' ' + _e.dragright,
open_dir : 'right',
close_dir : 'left',
delta : 'deltaX',
page : 'pageX',
negative : false
};
break;
case 'right':
var drag = {
events : _e.dragleft + ' ' + _e.dragright,
open_dir : 'left',
close_dir : 'right',
delta : 'deltaX',
page : 'pageX',
negative : true
};
break;
case 'top':
var drag = {
events : _e.dragup + ' ' + _e.dragdown,
open_dir : 'down',
close_dir : 'up',
delta : 'deltaY',
page : 'pageY',
negative : false
};
break;
case 'bottom':
var drag = {
events : _e.dragup + ' ' + _e.dragdown,
open_dir : 'up',
close_dir : 'down',
delta : 'deltaY',
page : 'pageY',
negative : true
};
break;
}
$dragNode = this.__valueOrFn( opts.pageNode, this.$menu, glbl.$page );
if ( typeof $dragNode == 'string' )
{
$dragNode = $($dragNode);
}
// Bind events
$dragNode
.hammer()
.on( _e.touchstart + ' ' + _e.mousedown,
function( e )
{
if ( e.type == 'touchstart' )
{
var tch = e.originalEvent.touches[ 0 ] || e.originalEvent.changedTouches[ 0 ],
pos = tch[ drag.page ];
}
else if ( e.type == 'mousedown' )
{
var pos = e[ drag.page ];
}
switch( that.opts.position )
{
case 'right':
case 'bottom':
if ( pos >= glbl.$wndw[ _dimension ]() - opts.maxStartPos )
{
_stage = 1;
}
break;
default:
if ( pos <= opts.maxStartPos )
{
_stage = 1;
}
break;
}
}
)
.on( drag.events + ' ' + _e.dragend,
function( e )
{
if ( _stage > 0 )
{
e.gesture.preventDefault();
e.stopPropagation();
}
}
)
.on( drag.events,
function( e )
{
var new_distance = drag.negative
? -e.gesture[ drag.delta ]
: e.gesture[ drag.delta ];
_direction = ( new_distance > _distance )
? drag.open_dir
: drag.close_dir;
_distance = new_distance;
if ( _distance > opts.threshold )
{
if ( _stage == 1 )
{
if ( glbl.$html.hasClass( _c.opened ) )
{
return;
}
_stage = 2;
that._openSetup();
glbl.$html.addClass( _c.dragging );
_maxDistance = minMax(
glbl.$wndw[ _dimension ]() * that.conf[ _ADDON_ ][ _dimension ].perc,
that.conf[ _ADDON_ ][ _dimension ].min,
that.conf[ _ADDON_ ][ _dimension ].max
);
}
}
if ( _stage == 2 )
{
var $drag = glbl.$page;
switch ( that.opts.zposition )
{
case 'front':
$drag = that.$menu;
break;
case 'next':
$drag = $drag.add( that.$menu );
break;
}
$drag.css( that.opts.position, minMax( _distance, 10, _maxDistance ) );
}
}
)
.on( _e.dragend,
function( e )
{
if ( _stage == 2 )
{
var $drag = glbl.$page;
switch ( that.opts.zposition )
{
case 'front':
$drag = that.$menu;
break;
case 'next':
$drag = $drag.add( that.$menu );
break;
}
glbl.$html.removeClass( _c.dragging );
$drag.css( that.opts.position, '' );
if ( _direction == drag.open_dir )
{
that._openFinish();
}
else
{
that.close();
}
}
_stage = 0;
}
);
}
};
$[ _PLUGIN_ ].defaults[ _ADDON_ ] = {
open : false,
// pageNode : null,
// maxStartPos : null,
threshold : 50
};
$[ _PLUGIN_ ].configuration[ _ADDON_ ] = {
width : {
perc : 0.8,
min : 140,
max : 440
},
height : {
perc : 0.8,
min : 140,
max : 880
}
};
// Add to plugin
$[ _PLUGIN_ ].addons = $[ _PLUGIN_ ].addons || [];
$[ _PLUGIN_ ].addons.push( _ADDON_ );
// Functions
function minMax( val, min, max )
{
if ( val < min )
{
val = min;
}
if ( val > max )
{
val = max;
}
return val;
}
})( jQuery ); | ruo91/cdnjs | ajax/libs/jQuery.mmenu/4.1.6/js/addons/jquery.mmenu.dragopen.js | JavaScript | mit | 5,828 |
/**
* CSS patterns
*
* @author Craig Campbell
* @version 1.0.6
*/
Rainbow.extend('css', [
{
'name': 'comment',
'pattern': /\/\*[\s\S]*?\*\//gm
},
{
'name': 'constant.hex-color',
'pattern': /#([a-f0-9]{3}|[a-f0-9]{6})(?=;|\s)/gi
},
{
'matches': {
1: 'constant.numeric',
2: 'keyword.unit'
},
'pattern': /(\d+)(px|cm|s|%)?/g
},
{
'name': 'string',
'pattern': /('|")(.*?)\1/g
},
{
'name': 'support.css-property',
'matches': {
1: 'support.vendor-prefix'
},
'pattern': /(-o-|-moz-|-webkit-|-ms-)?[\w-]+(?=\s?:)(?!.*\{)/g
},
{
'matches': {
1: [
{
'name': 'entity.name.sass',
'pattern': /&/g
},
{
'name': 'direct-descendant',
'pattern': />/g
},
{
'name': 'entity.name.class',
'pattern': /\.[\w\-_]+/g
},
{
'name': 'entity.name.id',
'pattern': /\#[\w\-_]+/g
},
{
'name': 'entity.name.pseudo',
'pattern': /:[\w\-_]+/g
},
{
'name': 'entity.name.tag',
'pattern': /\w+/g
}
]
},
'pattern': /([\w\ ,:\.\#\&\;\-_]+)(?=.*\{)/g
},
{
'matches': {
2: 'support.vendor-prefix',
3: 'support.css-value'
},
'pattern': /(:|,)\s?(-o-|-moz-|-webkit-|-ms-)?([a-zA-Z-]*)(?=\b)(?!.*\{)/g
},
{
'matches': {
1: 'support.tag.style',
2: [
{
'name': 'string',
'pattern': /('|")(.*?)(\1)/g
},
{
'name': 'entity.tag.style',
'pattern': /(\w+)/g
}
],
3: 'support.tag.style'
},
'pattern': /(<\/?)(style.*?)(>)/g
}
], true);
| danut007ro/cdnjs | ajax/libs/rainbow/1.1.8/js/language/css.js | JavaScript | mit | 2,249 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
class SubRequestController extends ContainerAware
{
public function indexAction()
{
$handler = $this->container->get('fragment.handler');
$errorUrl = $this->generateUrl('subrequest_fragment_error', array('_locale' => 'fr', '_format' => 'json'));
$altUrl = $this->generateUrl('subrequest_fragment', array('_locale' => 'fr', '_format' => 'json'));
// simulates a failure during the rendering of a fragment...
// should render fr/json
$content = $handler->render($errorUrl, 'inline', array('alt' => $altUrl));
// ...to check that the FragmentListener still references the right Request
// when rendering another fragment after the error occurred
// should render en/html instead of fr/json
$content .= $handler->render(new ControllerReference('TestBundle:SubRequest:fragment'));
// forces the LocaleListener to set fr for the locale...
// should render fr/json
$content .= $handler->render($altUrl);
// ...and check that after the rendering, the original Request is back
// and en is used as a locale
// should use en/html instead of fr/json
$content .= '--'.$this->generateUrl('subrequest_fragment');
// The RouterListener is also tested as if it does not keep the right
// Request in the context, a 301 would be generated
return new Response($content);
}
public function fragmentAction(Request $request)
{
return new Response('--'.$request->getLocale().'/'.$request->getRequestFormat());
}
public function fragmentErrorAction()
{
throw new \RuntimeException('error');
}
protected function generateUrl($name, $arguments = array())
{
return $this->container->get('router')->generate($name, $arguments);
}
}
| lapto093/vushop | vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php | PHP | mit | 2,390 |
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("a11yhelp","zh-cn",{title:"辅助说明",contents:"帮助内容。要关闭此对话框请按 ESC 键。",legend:[{name:"常规",items:[{name:"编辑器工具栏",legend:"按 ${toolbarFocus} 导航到工具栏,使用 TAB 键或 SHIFT+TAB 组合键选择工具栏组,使用左右箭头键选择按钮,按空格键或回车键以应用选中的按钮。"},{name:"编辑器对话框",legend:"在对话框内,TAB 键移动到下一个字段,SHIFT + TAB 组合键移动到上一个字段,ENTER 键提交对话框,ESC 键取消对话框。对于有多标签的对话框,用ALT + F10来移到标签列表。然后用 TAB 键或者向右箭头来移动到下一个标签;SHIFT + TAB 组合键或者向左箭头移动到上一个标签。用 SPACE 键或者 ENTER 键选择标签。"},{name:"编辑器上下文菜单",legend:"用 ${contextMenu}或者 应用程序键 打开上下文菜单。然后用 TAB 键或者下箭头键来移动到下一个菜单项;SHIFT + TAB 组合键或者上箭头键移动到上一个菜单项。用 SPACE 键或者 ENTER 键选择菜单项。用 SPACE 键,ENTER 键或者右箭头键打开子菜单。返回菜单用 ESC 键或者左箭头键。用 ESC 键关闭上下文菜单。"},
{name:"编辑器列表框",legend:"在列表框中,移到下一列表项用 TAB 键或者下箭头键。移到上一列表项用SHIFT + TAB 组合键或者上箭头键,用 SPACE 键或者 ENTER 键选择列表项。用 ESC 键收起列表框。"},{name:"编辑器元素路径栏",legend:"按 ${elementsPathFocus} 以导航到元素路径栏,使用 TAB 键或右箭头键选择下一个元素,使用 SHIFT+TAB 组合键或左箭头键选择上一个元素,按空格键或回车键以选定编辑器里的元素。"}]},{name:"命令",items:[{name:" 撤消命令",legend:"按 ${undo}"},{name:" 重做命令",legend:"按 ${redo}"},{name:" 加粗命令",legend:"按 ${bold}"},{name:" 倾斜命令",legend:"按 ${italic}"},{name:" 下划线命令",legend:"按 ${underline}"},{name:" 链接命令",legend:"按 ${link}"},{name:" 工具栏折叠命令",legend:"按 ${toolbarCollapse}"},
{name:" Access previous focus space command",legend:"Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:" Access next focus space command",legend:"Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:" 无障碍设计说明",legend:"按 ${a11yHelp}"}]}]}); | teropa/cdnjs | ajax/libs/ckeditor/4.0.1/plugins/a11yhelp/dialogs/lang/zh-cn.js | JavaScript | mit | 2,834 |
/*
* # Semantic UI
* https://github.com/Semantic-Org/Semantic-UI
* http://www.semantic-ui.com/
*
* Copyright 2014 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
*/
/*******************************
Checkbox
*******************************/
/*--------------
Content
---------------*/
.ui.checkbox {
position: relative;
display: inline-block;
height: 17px;
font-size: 1rem;
line-height: 15px;
min-width: 17px;
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
outline: none;
vertical-align: middle;
}
.ui.checkbox input {
position: absolute;
top: 0px;
left: 0px;
opacity: 0 !important;
outline: none;
z-index: -1;
}
/*--------------
Box
---------------*/
.ui.checkbox .box,
.ui.checkbox label {
display: block;
cursor: pointer;
padding-left: 1.75em;
outline: none;
}
.ui.checkbox label {
font-size: 1em;
}
.ui.checkbox .box:before,
.ui.checkbox label:before {
position: absolute;
line-height: 1;
width: 17px;
height: 17px;
top: 0em;
left: 0em;
content: '';
background: #ffffff;
border-radius: 0.25em;
-webkit-transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
transition: background-color 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
border: 1px solid #d4d4d5;
}
/*--------------
Checkmark
---------------*/
.ui.checkbox .box:after,
.ui.checkbox label:after {
position: absolute;
top: 0px;
left: 0px;
line-height: 17px;
width: 17px;
height: 17px;
text-align: center;
opacity: 0;
color: rgba(0, 0, 0, 0.8);
-webkit-transition: all 0.1s ease;
transition: all 0.1s ease;
}
/*--------------
Label
---------------*/
/* Inside */
.ui.checkbox label,
.ui.checkbox + label {
cursor: pointer;
color: rgba(0, 0, 0, 0.8);
-webkit-transition: color 0.2s ease;
transition: color 0.2s ease;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Outside */
.ui.checkbox + label {
vertical-align: middle;
}
/*******************************
States
*******************************/
/*--------------
Hover
---------------*/
.ui.checkbox .box:hover::before,
.ui.checkbox label:hover::before {
background: #ffffff;
border: 1px solid rgba(39, 41, 43, 0.3);
}
.ui.checkbox label:hover,
.ui.checkbox + label:hover {
color: rgba(0, 0, 0, 0.8);
}
/*--------------
Down
---------------*/
.ui.checkbox .box:active::before,
.ui.checkbox label:active::before {
background: #f5f5f5;
border: 1px solid 1px solid rgba(39, 41, 43, 0.3);
}
.ui.checkbox input:active ~ label {
color: rgba(0, 0, 0, 0.8);
}
/*--------------
Focus
---------------*/
.ui.checkbox input:focus ~ .box:before,
.ui.checkbox input:focus ~ label:before {
background: #f5f5f5;
border: 1px solid 1px solid rgba(39, 41, 43, 0.3);
}
.ui.checkbox input:focus ~ label {
color: rgba(0, 0, 0, 0.8);
}
/*--------------
Active
---------------*/
.ui.checkbox input:checked ~ .box:after,
.ui.checkbox input:checked ~ label:after {
opacity: 1;
}
/*--------------
Read-Only
---------------*/
.ui.read-only.checkbox,
.ui.read-only.checkbox label {
cursor: default;
}
/*--------------
Disabled
---------------*/
.ui.disabled.checkbox .box:after,
.ui.disabled.checkbox label,
.ui.checkbox input[disabled] ~ .box:after,
.ui.checkbox input[disabled] ~ label {
cursor: default;
opacity: 0.5;
color: #000000;
}
/*******************************
Types
*******************************/
/*--------------
Radio
---------------*/
.ui.radio.checkbox {
height: 14px;
}
/* Box */
.ui.radio.checkbox .box:before,
.ui.radio.checkbox label:before {
width: 14px;
height: 14px;
border-radius: 500rem;
top: 1px;
left: 0px;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
/* Circle */
.ui.radio.checkbox .box:after,
.ui.radio.checkbox label:after {
border: none;
width: 14px;
height: 14px;
line-height: 14px;
top: 1px;
left: 0px;
font-size: 9px;
}
/* Radio Checkbox */
.ui.radio.checkbox .box:after,
.ui.radio.checkbox label:after {
width: 14px;
height: 14px;
border-radius: 500rem;
-webkit-transform: scale(0.42857143);
-ms-transform: scale(0.42857143);
transform: scale(0.42857143);
background-color: rgba(0, 0, 0, 0.8);
}
/*--------------
Slider
---------------*/
.ui.slider.checkbox {
cursor: pointer;
height: 1.25rem;
}
.ui.slider.checkbox .box,
.ui.slider.checkbox label {
padding-left: 4.5rem;
line-height: 1rem;
color: rgba(0, 0, 0, 0.4);
}
/* Line */
.ui.slider.checkbox .box:before,
.ui.slider.checkbox label:before {
cursor: pointer;
display: block;
position: absolute;
content: '';
top: 0.4rem;
left: 0em;
z-index: 1;
border: none !important;
background-color: rgba(0, 0, 0, 0.05);
width: 3.5rem;
height: 0.25rem;
-webkit-transform: none;
-ms-transform: none;
transform: none;
border-radius: 500rem;
-webkit-transition: background 0.3s ease
;
transition: background 0.3s ease
;
}
/* Handle */
.ui.slider.checkbox .box:after,
.ui.slider.checkbox label:after {
background: #ffffff -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.05));
background: #ffffff linear-gradient(transparent, rgba(0, 0, 0, 0.05));
position: absolute;
content: '';
opacity: 1;
z-index: 2;
border: none;
box-shadow: 0px 1px 2px 0 rgba(0, 0, 0, 0.05), 0px 0px 0px 1px rgba(39, 41, 43, 0.15) inset;
width: 1.5rem;
height: 1.5rem;
top: -0.25rem;
left: 0em;
-webkit-transform: none;
-ms-transform: none;
transform: none;
border-radius: 500rem;
-webkit-transition: left 0.3s ease 0s
;
transition: left 0.3s ease 0s
;
}
/* Focus */
.ui.slider.checkbox input:focus ~ .box:before,
.ui.slider.checkbox input:focus ~ label:before {
background-color: rgba(0, 0, 0, 0.1);
border: none;
}
/* Hover */
.ui.slider.checkbox .box:hover,
.ui.slider.checkbox label:hover {
color: rgba(0, 0, 0, 0.8);
}
.ui.slider.checkbox .box:hover::before,
.ui.slider.checkbox label:hover::before {
background: rgba(0, 0, 0, 0.1);
}
/* Active */
.ui.slider.checkbox input:checked ~ .box,
.ui.slider.checkbox input:checked ~ label {
color: rgba(0, 0, 0, 0.8);
}
.ui.slider.checkbox input:checked ~ .box:before,
.ui.slider.checkbox input:checked ~ label:before {
background-color: rgba(0, 0, 0, 0.1);
}
.ui.slider.checkbox input:checked ~ .box:after,
.ui.slider.checkbox input:checked ~ label:after {
left: 2rem;
}
/*--------------
Toggle
---------------*/
.ui.toggle.checkbox {
cursor: pointer;
height: 1.5rem;
}
.ui.toggle.checkbox .box,
.ui.toggle.checkbox label {
height: 1.5rem;
padding-left: 4.5rem;
line-height: 1.5rem;
color: rgba(0, 0, 0, 0.8);
}
/* Switch */
.ui.toggle.checkbox .box:before,
.ui.toggle.checkbox label:before {
cursor: pointer;
display: block;
position: absolute;
content: '';
top: 0rem;
z-index: 1;
border: none;
background-color: rgba(0, 0, 0, 0.05);
width: 3.5rem;
height: 1.5rem;
border-radius: 500rem;
}
/* Handle */
.ui.toggle.checkbox .box:after,
.ui.toggle.checkbox label:after {
background: #ffffff -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.05));
background: #ffffff linear-gradient(transparent, rgba(0, 0, 0, 0.05));
position: absolute;
content: '';
opacity: 1;
z-index: 2;
border: none;
box-shadow: 0px 1px 2px 0 rgba(0, 0, 0, 0.05), 0px 0px 0px 1px rgba(39, 41, 43, 0.15) inset;
width: 1.5rem;
height: 1.5rem;
top: 0rem;
left: 0em;
border-radius: 500rem;
-webkit-transition: background 0.3s ease 0s,
left 0.3s ease 0s
;
transition: background 0.3s ease 0s,
left 0.3s ease 0s
;
}
.ui.toggle.checkbox input ~ .box:after,
.ui.toggle.checkbox input ~ label:after {
left: -0.05rem;
}
/* Focus */
.ui.toggle.checkbox input:focus ~ .box:before,
.ui.toggle.checkbox input:focus ~ label:before {
background-color: rgba(0, 0, 0, 0.1);
border: none;
}
/* Hover */
.ui.toggle.checkbox .box:hover::before,
.ui.toggle.checkbox label:hover::before {
background-color: rgba(0, 0, 0, 0.1);
border: none;
}
/* Active */
.ui.toggle.checkbox input:checked ~ .box,
.ui.toggle.checkbox input:checked ~ label {
color: #5bbd72;
}
.ui.toggle.checkbox input:checked ~ .box:before,
.ui.toggle.checkbox input:checked ~ label:before {
background-color: #5bbd72;
}
.ui.toggle.checkbox input:checked ~ .box:after,
.ui.toggle.checkbox input:checked ~ label:after {
left: 2.05rem;
}
/*******************************
Variations
*******************************/
/*--------------
Fitted
---------------*/
.ui.fitted.checkbox .box,
.ui.fitted.checkbox label {
padding-left: 0em !important;
}
.ui.fitted.toggle.checkbox,
.ui.fitted.toggle.checkbox {
width: 3.5rem;
}
.ui.fitted.slider.checkbox,
.ui.fitted.slider.checkbox {
width: 3.5rem;
}
/*******************************
Theme Overrides
*******************************/
@font-face {
font-family: 'Checkbox';
src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAOAIAAAwBgT1MvMj3hSQEAAADsAAAAVmNtYXDQEhm3AAABRAAAAUpjdnQgBkn/lAAABuwAAAAcZnBnbYoKeDsAAAcIAAAJkWdhc3AAAAAQAAAG5AAAAAhnbHlm32cEdgAAApAAAAC2aGVhZAErPHsAAANIAAAANmhoZWEHUwNNAAADgAAAACRobXR4CykAAAAAA6QAAAAMbG9jYQA4AFsAAAOwAA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18D3jhMasuo3G3/MwgMIKW2hEvKoQBhI12jrnNppooUOaMkMyM8+KkMBFTONizR1htpIy7nPMGSW0PjNisgOP3+WRH5MC7o9ZRR+tHsYT0u6MKPOSfTns7jBrREqyTDezs9/eU2x4WpvWcNeuS511JTE8qCF5H7u1BY1H72S3Ymi7aPD95/9+AN1fhEsAeJxjYGKAAC4G7ICZgYGRiZGZMzkjNTk7N7Eomy05syg5J5WBAQBE1QZBAABLuADIUlixAQGOWbkIAAgAYyCwASNEsAMjcLIEKAlFUkSyCgIHKrEGAUSxJAGIUViwQIhYsQYDRLEmAYhRWLgEAIhYsQYBRFlZWVm4Af+FsASNsQUARAAA) format('woff');
}
.ui.checkbox label:before,
.ui.checkbox .box:before,
.ui.checkbox label:after,
.ui.checkbox .box:after {
font-family: 'Checkbox';
}
.ui.checkbox label:after,
.ui.checkbox .box:after {
content: '\e800';
}
/* UTF Reference
.check:before { content: '\e800'; } ''
.circle:before { content: '\e801'; }
.ok-circled:before { content: '\e806'; }
.ok-circle:before { content: '\e805'; }
.cancel-circle:before { content: '\e807'; }
.cancel-circle-1:before { content: '\e804'; }
.empty-circle:before { content: '\e802'; }
.radio:before { content: '\e803'; }
*/
/*******************************
Site Overrides
*******************************/
| sitic/cdnjs | ajax/libs/semantic-ui/1.0.1/components/checkbox.css | CSS | mit | 19,205 |
!function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function r(e){for(var r=e.display.lineSpace.childNodes.length-1;r>=0;r--){var o=e.display.lineSpace.childNodes[r];/(^|\s)CodeMirror-ruler($|\s)/.test(o.className)&&o.parentNode.removeChild(o)}}function o(r){for(var o=r.getOption("rulers"),t=r.defaultCharWidth(),l=r.charCoords(e.Pos(r.firstLine(),0),"div").left,i=r.display.scroller.offsetHeight+30,s=0;s<o.length;s++){var n=document.createElement("div");n.className="CodeMirror-ruler";var d,a=null,c=o[s];"number"==typeof c?d=c:(d=c.column,c.className&&(n.className+=" "+c.className),c.color&&(n.style.borderColor=c.color),c.lineStyle&&(n.style.borderLeftStyle=c.lineStyle),c.width&&(n.style.borderLeftWidth=c.width),a=o[s].className),n.style.left=l+d*t+"px",n.style.top="-50px",n.style.bottom="-20px",n.style.minHeight=i+"px",r.display.lineSpace.insertBefore(n,r.display.cursorDiv)}}function t(e){r(e),o(e)}e.defineOption("rulers",!1,function(l,i,s){s&&s!=e.Init&&(r(l),l.off("refresh",t)),i&&i.length&&(o(l),l.on("refresh",t))})}); | LaurensRietveld/cdnjs | ajax/libs/codemirror/4.5.0/addon/display/rulers.min.js | JavaScript | mit | 1,195 |
module.exports=function(e){function t(r){if(o[r])return o[r].exports;var n=o[r]={exports:{},id:r,loaded:!1};return e[r].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var o={};return t.m=e,t.c=o,t.p="",t(0)}([function(e,t,o){function r(e,t,a){var i=o(4);return a=i(!0,{},a)||{},void 0===a.protocol&&(a.protocol="https:"),a._setTimeout=s,a._ua=r.ua,a._useCache=!1,new n(e,t,a)}function n(){c.apply(this,arguments)}function s(e,t){function o(){return Date.now()<r+t?void process.nextTick(o):void e()}var r=Date.now();process.nextTick(o)}e.exports=r,process.env={};var a=o(2)("algoliasearch:parse"),i=o(3),c=o(1);a("loaded the Parse client"),r.version=o(5),r.ua="Algolia for Parse "+r.version,i(n,c),n.prototype._request=function(e,t){function r(o){a("error: %j - %s %j",o,e,t),i.resolve({statusCode:o.status,body:o.data})}function n(o){a("success: %j - %s %j",o,e,t),i.resolve({statusCode:o.status,body:o.data})}var s=o(4),i=new Parse.Promise;a("url: %s, opts: %j",e,t);var c={url:e,headers:s([],t.headers),method:t.method,success:n,error:r};return t.body&&(c.headers["content-type"]="application/json;charset=utf-8",c.body=t.body),Parse.Cloud.httpRequest(c),i},n.prototype._promise={reject:function(e){return Parse.Promise.error(e)},resolve:function(e){return Parse.Promise.as(e)},delay:function(e){var t=new Parse.Promise;return s(t.resolve.bind(t),e),t}}},function(e,t,o){function r(e,t,o){void 0===o.protocol&&(o.protocol="https:"),s.apply(this,arguments)}e.exports=r;var n=o(3),s=o(6);n(r,s),r.prototype.enableRateLimitForward=function(e,t,o){this._forward={adminAPIKey:e,endUserIP:t,rateLimitAPIKey:o}},r.prototype.disableRateLimitForward=function(){this._forward=null},r.prototype.useSecuredAPIKey=function(e,t,o){this._secure={apiKey:e,securityTags:t,userToken:o}},r.prototype.disableSecuredAPIKey=function(){this._secure=null},r.prototype._computeRequestHeaders=function(){var e=r.super_.prototype._computeRequestHeaders.call(this);return this._forward&&(e["x-algolia-api-key"]=this._forward.adminAPIKey,e["x-forwarded-for"]=this._forward.endUserIP,e["x-forwarded-api-key"]=this._forward.rateLimitAPIKey),this._secure&&(e["x-algolia-api-key"]=this._secure.apiKey,e["x-algolia-tagfilters"]=this._secure.securityTags,e["x-algolia-usertoken"]=this._secure.userToken),e}},function(e,t,o){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function n(){var e=arguments,o=this.useColors;if(e[0]=(o?"%c":"")+this.namespace+(o?" %c":" ")+e[0]+(o?"%c ":" ")+"+"+t.humanize(this.diff),!o)return e;var r="color: "+this.color;e=[e[0],r,"color: inherit"].concat(Array.prototype.slice.call(e,1));var n=0,s=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(s=n))}),e.splice(s,0,r),e}function s(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(e){try{null==e?u.removeItem("debug"):u.debug=e}catch(t){}}function i(){var e;try{e=u.debug}catch(t){}return e}function c(){try{return window.localStorage}catch(e){}}t=e.exports=o(7),t.log=s,t.formatArgs=n,t.save=a,t.load=i,t.useColors=r;var u;u="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:c(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){return JSON.stringify(e)},t.enable(i())},function(e){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}},function(e,t,o){var r,n=Object.prototype.hasOwnProperty,s=Object.prototype.toString,a=o(8),i=function(e){"use strict";if(!e||"[object Object]"!==s.call(e))return!1;var t=n.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!t&&!o)return!1;var a;for(a in e);return a===r||n.call(e,a)};e.exports=function c(){"use strict";var e,t,o,n,s,u,l=arguments[0],d=1,h=arguments.length,p=!1;for("boolean"==typeof l?(p=l,l=arguments[1]||{},d=2):("object"!=typeof l&&"function"!=typeof l||null==l)&&(l={});h>d;++d)if(e=arguments[d],null!=e)for(t in e)o=l[t],n=e[t],l!==n&&(p&&n&&(i(n)||(s=a(n)))?(s?(s=!1,u=o&&a(o)?o:[]):u=o&&i(o)?o:{},l[t]=c(p,u,n)):n!==r&&(l[t]=n));return l}},function(e){e.exports="3.3.2"},function(e,t,o){function r(e,t,r){var a=o(4),i="Usage: algoliasearch(applicationID, apiKey, opts)";if(!e)throw new Error("algoliasearch: Please provide an application ID. "+i);if(!t)throw new Error("algoliasearch: Please provide an API key. "+i);this.applicationID=e,this.apiKey=t;var c=[this.applicationID+"-1.algolianet.com",this.applicationID+"-2.algolianet.com",this.applicationID+"-3.algolianet.com"];this.hosts={read:[],write:[]},this.hostIndex={read:0,write:0},r=r||{};var u=r.protocol||"https:",d=void 0===r.timeout?2e3:r.timeout;if(/:$/.test(u)||(u+=":"),"http:"!==r.protocol&&"https:"!==r.protocol)throw new Error("algoliasearch: protocol must be `http:` or `https:` (was `"+r.protocol+"`)");r.hosts?(this.hosts.read=a([],r.hosts),this.hosts.write=a([],r.hosts)):(this.hosts.read=[this.applicationID+"-dsn.algolia.net"].concat(c),this.hosts.write=[this.applicationID+".algolia.net"].concat(c)),this.hosts.read=n(this.hosts.read,s(u)),this.hosts.write=n(this.hosts.write,s(u)),this.requestTimeout=d,this.extraHeaders=[],this.cache={},this._ua=r._ua,this._useCache=void 0===r._useCache?!0:r._useCache,this._setTimeout=r._setTimeout,l("init done, %j",this)}function n(e,t){for(var o=[],r=0;r<e.length;++r)o.push(t(e[r],r));return o}function s(e){return function(t){return e+"//"+t.toLowerCase()}}function a(){var e="algoliasearch: Not implemented in this environment.\nIf you feel this is a mistake, write to support@algolia.com";throw new Error(e)}function i(e,t){var o=e.toLowerCase().replace(".","").replace("()","");return"algoliasearch: `"+e+"` was replaced by `"+t+"`. Please see https://github.com/algolia/algoliasearch-client-js/wiki/Deprecated#"+o}function c(e,t){t(e,0)}function u(e,t){function o(){return r||(console.log(t),r=!0),e.apply(this,arguments)}var r=!1;return o}e.exports=r,"development"===process.env.NODE_ENV&&o(2).enable("algoliasearch*");var l=o(2)("algoliasearch"),d=o(9);r.prototype={deleteIndex:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(e),hostType:"write",callback:t})},moveIndex:function(e,t,o){var r={operation:"move",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:o})},copyIndex:function(e,t,o){var r={operation:"copy",destination:t};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(e)+"/operation",body:r,hostType:"write",callback:o})},getLogs:function(e,t,o){return 0===arguments.length||"function"==typeof e?(o=e,e=0,t=10):(1===arguments.length||"function"==typeof t)&&(o=t,t=10),this._jsonRequest({method:"GET",url:"/1/logs?offset="+e+"&length="+t,hostType:"read",callback:o})},listIndexes:function(e,t){var o="";return void 0===e||"function"==typeof e?t=e:o="?page="+e,this._jsonRequest({method:"GET",url:"/1/indexes"+o,hostType:"read",callback:t})},initIndex:function(e){return new this.Index(this,e)},listUserKeys:function(e){return this._jsonRequest({method:"GET",url:"/1/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){return this._jsonRequest({method:"GET",url:"/1/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+e,hostType:"write",callback:t})},addUserKey:function(e,t,o){(1===arguments.length||"function"==typeof t)&&(o=t,t=null);var r={acl:e};return t&&(r.validity=t.validity,r.maxQueriesPerIPPerHour=t.maxQueriesPerIPPerHour,r.maxHitsPerQuery=t.maxHitsPerQuery,r.indexes=t.indexes),this._jsonRequest({method:"POST",url:"/1/keys",body:r,hostType:"write",callback:o})},addUserKeyWithValidity:u(function(e,t,o){return this.addUserKey(e,t,o)},i("client.addUserKeyWithValidity()","client.addUserKey()")),updateUserKey:function(e,t,o,r){(2===arguments.length||"function"==typeof o)&&(r=o,o=null);var n={acl:t};return o&&(n.validity=o.validity,n.maxQueriesPerIPPerHour=o.maxQueriesPerIPPerHour,n.maxHitsPerQuery=o.maxHitsPerQuery,n.indexes=o.indexes),this._jsonRequest({method:"PUT",url:"/1/keys/"+e,body:n,hostType:"write",callback:r})},setSecurityTags:function(e){if("[object Array]"===Object.prototype.toString.call(e)){for(var t=[],o=0;o<e.length;++o)if("[object Array]"===Object.prototype.toString.call(e[o])){for(var r=[],n=0;n<e[o].length;++n)r.push(e[o][n]);t.push("("+r.join(",")+")")}else t.push(e[o]);e=t.join(",")}this.securityTags=e},setUserToken:function(e){this.userToken=e},startQueriesBatch:u(function(){this._batch=[]},i("client.startQueriesBatch()","client.search()")),addQueryInBatch:u(function(e,t,o){this._batch.push({indexName:e,query:t,params:o})},i("client.addQueryInBatch()","client.search()")),clearCache:function(){this.cache={}},sendQueriesBatch:u(function(e){return this.search(this._batch,e)},i("client.sendQueriesBatch()","client.search()")),setRequestTimeout:function(e){e&&(this.requestTimeout=parseInt(e,10))},search:function(e,t){var o=this,r={requests:n(e,function(e){var t="";return void 0!==e.query&&(t+="query="+encodeURIComponent(e.query)),{indexName:e.indexName,params:o._getSearchParams(e.params,t)}})};return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:r,hostType:"read",callback:t})},destroy:a,enableRateLimitForward:a,disableRateLimitForward:a,useSecuredAPIKey:a,disableSecuredAPIKey:a,generateSecuredApiKey:a,Index:function(e,t){this.indexName=t,this.as=e,this.typeAheadArgs=null,this.typeAheadValueOption=null,this.cache={}},setExtraHeader:function(e,t){this.extraHeaders.push({name:e.toLowerCase(),value:t})},_sendQueriesBatch:function(e,t){return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:e,hostType:"read",fallback:{method:"GET",url:"/1/indexes/*",body:{params:function(){for(var t="",o=0;o<e.requests.length;++o){var r="/1/indexes/"+encodeURIComponent(e.requests[o].indexName)+"?"+e.requests[o].params;t+=o+"="+encodeURIComponent(r)+"&"}return t}()}},callback:t})},_jsonRequest:function(e){function t(o,c){function l(){return a.hostIndex[e.hostType]=++a.hostIndex[e.hostType]%a.hosts[e.hostType].length,i+=1,c.timeout=a.requestTimeout*(i+1),t(o,c)}function d(r){return n("error: %s, stack: %s",r.message,r.stack),a.useFallback?(a.hostIndex[e.hostType]=++a.hostIndex[e.hostType]%a.hosts[e.hostType].length,i+=1):i=a.hosts[e.hostType].length,t(o,c)}var h;return a._useCache&&(h=e.url),a._useCache&&r&&(h+="_body_"+c.body),a._useCache&&s&&void 0!==s[h]?(n("serving response from cache"),a._promise.resolve(s[h])):i>=a.hosts[e.hostType].length?e.fallback&&a._request.fallback&&!u?(i=0,c.method=e.fallback.method,c.url=e.fallback.url,c.jsonBody=e.fallback.body,c.jsonBody&&(c.body=JSON.stringify(e.fallback.body)),c.timeout=a.requestTimeout*(i+1),a.hostIndex[e.hostType]=0,a.useFallback=!0,u=!0,t(a._request.fallback,c)):a._promise.reject(new Error("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue.")):o.call(a,a.hosts[e.hostType][a.hostIndex[e.hostType]]+c.url,{body:r,jsonBody:e.body,method:c.method,headers:a._computeRequestHeaders(),timeout:c.timeout,debug:n}).then(function(e){if(e instanceof Error)return n("error: %s",e.message),l();n("received response: %j",e);var t=e&&e.body&&e.body.message&&e.body.status||e.statusCode||e&&e.body&&200,o=200===t||201===t,r=!o&&4!==Math.floor(t/100)&&1!==Math.floor(t/100);if(a._useCache&&o&&s&&(s[h]=e.body),o)return e.body;if(r)return l();var i=new Error(e.body&&e.body.message||"Unknown error");return a._promise.reject(i)},d)}var r,n=o(2)("algoliasearch:"+e.url),s=e.cache,a=this,i=0,u=!1;void 0!==e.body&&(r=JSON.stringify(e.body)),n("request start");var l=a.useFallback&&e.fallback,d=l?e.fallback:e,h=t(l?a._request.fallback:a._request,{url:d.url,method:d.method,body:r,jsonBody:e.body,timeout:a.requestTimeout*(i+1)});return e.callback?void h.then(function(t){c(function(){e.callback(null,t)},a._setTimeout||setTimeout)},function(t){c(function(){e.callback(t)},a._setTimeout||setTimeout)}):h},_getSearchParams:function(e,t){if(this._isUndefined(e)||null===e)return t;for(var o in e)null!==o&&e.hasOwnProperty(o)&&(t+=""===t?"":"&",t+=o+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(e[o])?JSON.stringify(e[o]):e[o]));return t},_isUndefined:function(e){return void 0===e},_computeRequestHeaders:function(){var e={"x-algolia-api-key":this.apiKey,"x-algolia-application-id":this.applicationID,"x-user-agent":this._ua};return this.userToken&&(e["x-algolia-usertoken"]=this.userToken),this.securityTags&&(e["x-algolia-tagfilters"]=this.securityTags),this.extraHeaders&&d(this.extraHeaders,function(t){e[t.name]=t.value}),e}},r.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(e,t,o){var r=this;return(1===arguments.length||"function"==typeof t)&&(o=t,t=void 0),this.as._jsonRequest({method:void 0!==t?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(r.indexName)+(void 0!==t?"/"+encodeURIComponent(t):""),body:e,hostType:"write",callback:o})},addObjects:function(e,t){for(var o=this,r={requests:[]},n=0;n<e.length;++n){var s={action:"addObject",body:e[n]};r.requests.push(s)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/batch",body:r,hostType:"write",callback:t})},getObject:function(e,t,o){var r=this;(1===arguments.length||"function"==typeof t)&&(o=t,t=void 0);var n="";if(void 0!==t){n="?attributes=";for(var s=0;s<t.length;++s)0!==s&&(n+=","),n+=t[s]}return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e)+n,hostType:"read",callback:o})},getObjects:function(e,t){var o=this,r={requests:n(e,function(e){return{indexName:o.indexName,objectID:e}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/*/objects",hostType:"read",body:r,callback:t})},partialUpdateObject:function(e,t){var o=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/"+encodeURIComponent(e.objectID)+"/partial",body:e,hostType:"write",callback:t})},partialUpdateObjects:function(e,t){for(var o=this,r={requests:[]},n=0;n<e.length;++n){var s={action:"partialUpdateObject",objectID:e[n].objectID,body:e[n]};r.requests.push(s)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/batch",body:r,hostType:"write",callback:t})},saveObject:function(e,t){var o=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/"+encodeURIComponent(e.objectID),body:e,hostType:"write",callback:t})},saveObjects:function(e,t){for(var o=this,r={requests:[]},n=0;n<e.length;++n){var s={action:"updateObject",objectID:e[n].objectID,body:e[n]};r.requests.push(s)}return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/batch",body:r,hostType:"write",callback:t})},deleteObject:function(e,t){if("function"==typeof e||"string"!=typeof e&&"number"!=typeof e){var o=new Error("Cannot delete an object without an objectID");return t=e,"function"==typeof t?t(o):this.as._promise.reject(o)}var r=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/"+encodeURIComponent(e),hostType:"write",callback:t})},deleteObjects:function(e,t){var o=this,r={requests:n(e,function(e){return{action:"deleteObject",objectID:e,body:{objectID:e}}})};return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/batch",body:r,hostType:"write",callback:t})},deleteByQuery:function(e,t,o){function r(e){if(0===e.nbHits)return e;var t=n(e.hits,function(e){return e.objectID});return l.deleteObjects(t).then(s).then(a)}function s(e){return l.waitTask(e.taskID)}function a(){return l.deleteByQuery(e,t)}function i(){c(function(){o(null)},d._setTimeout||setTimeout)}function u(e){c(function(){o(e)},d._setTimeout||setTimeout)}var l=this,d=l.as;(1===arguments.length||"function"==typeof t)&&(o=t,t={}),t.attributesToRetrieve="objectID",t.hitsPerPage=1e3,this.clearCache();var h=this.search(e,t).then(r);return o?void h.then(i,u):h},search:function(e,t,o){if("function"==typeof e&&"object"==typeof t||"object"==typeof o)throw new Error("algoliasearch: index.search usage is index.search(query, params, cb)");0===arguments.length||"function"==typeof e?(o=e,e=""):(1===arguments.length||"function"==typeof t)&&(o=t,t=void 0),"object"==typeof e&&null!==e?(t=e,e=void 0):(void 0===e||null===e)&&(e="");var r="";return void 0!==e&&(r+="query="+encodeURIComponent(e)),void 0!==t&&(r=this.as._getSearchParams(t,r)),this._search(r,o)},browse:function(e,t,o){var r=this;(1===arguments.length||"function"==typeof t)&&(o=t,t=void 0);var n="?page="+e;return this.as._isUndefined(t)||(n+="&hitsPerPage="+t),this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(r.indexName)+"/browse"+n,hostType:"read",callback:o})},ttAdapter:function(e){var t=this;return function(o,r){t.search(o,e,function(e,t){return e?void r(e):void r(t.hits)})}},waitTask:function(e,t){function o(e){c(function(){t(null,e)},s._setTimeout||setTimeout)}function r(e){c(function(){t(e)},s._setTimeout||setTimeout)}var n=this,s=n.as,a=this.as._jsonRequest({method:"GET",hostType:"read",url:"/1/indexes/"+encodeURIComponent(n.indexName)+"/task/"+e}).then(function(t){return"published"!==t.status?n.as._promise.delay(100).then(function(){return n.waitTask(e)}):t});return t?void a.then(o,r):a},clearIndex:function(e){var t=this;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/clear",hostType:"write",callback:e})},getSettings:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/settings",hostType:"read",callback:e})},setSettings:function(e,t){var o=this;return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/settings",hostType:"write",body:e,callback:t})},listUserKeys:function(e){var t=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(t.indexName)+"/keys",hostType:"read",callback:e})},getUserKeyACL:function(e,t){var o=this;return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/keys/"+e,hostType:"read",callback:t})},deleteUserKey:function(e,t){var o=this;return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(o.indexName)+"/keys/"+e,hostType:"write",callback:t})},addUserKey:function(e,t,o){(1===arguments.length||"function"==typeof t)&&(o=t,t=null);var r={acl:e};return t&&(r.validity=t.validity,r.maxQueriesPerIPPerHour=t.maxQueriesPerIPPerHour,r.maxHitsPerQuery=t.maxHitsPerQuery),this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:r,hostType:"write",callback:o})},addUserKeyWithValidity:u(function(e,t,o){return this.addUserKey(e,t,o)},i("index.addUserKeyWithValidity()","index.addUserKey()")),updateUserKey:function(e,t,o,r){(2===arguments.length||"function"==typeof o)&&(r=o,o=null);var n={acl:t};return o&&(n.validity=o.validity,n.maxQueriesPerIPPerHour=o.maxQueriesPerIPPerHour,n.maxHitsPerQuery=o.maxHitsPerQuery),this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+e,body:n,hostType:"write",callback:r})},_search:function(e,t){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:e},hostType:"read",fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:e}},callback:t})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}},function(e,t,o){function r(){return t.colors[l++%t.colors.length]}function n(e){function o(){}function n(){var e=n,o=+new Date,s=o-(u||o);e.diff=s,e.prev=u,e.curr=o,u=o,null==e.useColors&&(e.useColors=t.useColors()),null==e.color&&e.useColors&&(e.color=r());var a=Array.prototype.slice.call(arguments);a[0]=t.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var i=0;a[0]=a[0].replace(/%([a-z%])/g,function(o,r){if("%%"===o)return o;i++;var n=t.formatters[r];if("function"==typeof n){var s=a[i];o=n.call(e,s),a.splice(i,1),i--}return o}),"function"==typeof t.formatArgs&&(a=t.formatArgs.apply(e,a));var c=n.log||t.log||console.log.bind(console);c.apply(e,a)}o.enabled=!1,n.enabled=!0;var s=t.enabled(e)?n:o;return s.namespace=e,s}function s(e){t.save(e);for(var o=(e||"").split(/[\s,]+/),r=o.length,n=0;r>n;n++)o[n]&&(e=o[n].replace(/\*/g,".*?"),"-"===e[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))}function a(){t.enable("")}function i(e){var o,r;for(o=0,r=t.skips.length;r>o;o++)if(t.skips[o].test(e))return!1;for(o=0,r=t.names.length;r>o;o++)if(t.names[o].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}t=e.exports=n,t.coerce=c,t.disable=a,t.enable=s,t.enabled=i,t.humanize=o(10),t.names=[],t.skips=[],t.formatters={};var u,l=0},function(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e){var t=Object.prototype.hasOwnProperty,o=Object.prototype.toString;e.exports=function(e,r,n){if("[object Function]"!==o.call(r))throw new TypeError("iterator must be a function");var s=e.length;if(s===+s)for(var a=0;s>a;a++)r.call(n,e[a],a,e);else for(var i in e)t.call(e,i)&&r.call(n,e[i],i,e)}},function(e){function t(e){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var o=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return o*u;case"days":case"day":case"d":return o*c;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*a;case"seconds":case"second":case"secs":case"sec":case"s":return o*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o}}}function o(e){return e>=c?Math.round(e/c)+"d":e>=i?Math.round(e/i)+"h":e>=a?Math.round(e/a)+"m":e>=s?Math.round(e/s)+"s":e+"ms"}function r(e){return n(e,c,"day")||n(e,i,"hour")||n(e,a,"minute")||n(e,s,"second")||e+" ms"}function n(e,t,o){return t>e?void 0:1.5*t>e?Math.floor(e/t)+" "+o:Math.ceil(e/t)+" "+o+"s"}var s=1e3,a=60*s,i=60*a,c=24*i,u=365.25*c;e.exports=function(e,n){return n=n||{},"string"==typeof e?t(e):n.long?r(e):o(e)}}]); | BitsyCode/cdnjs | ajax/libs/algoliasearch/3.3.2/algoliasearch.parse.min.js | JavaScript | mit | 22,942 |
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Processes bytes as they pass through a buffer and replaces sequences in it.
* This stream filter deals with Byte arrays rather than simple strings.
* @package Swift
* @author Chris Corbyn
*/
class Swift_StreamFilters_ByteArrayReplacementFilter
implements Swift_StreamFilter
{
/** The needle(s) to search for */
private $_search;
/** The replacement(s) to make */
private $_replace;
/** The Index for searching */
private $_index;
/** The Search Tree */
private $_tree = array();
/** Gives the size of the largest search */
private $_treeMaxLen = 0;
private $_repSize;
/**
* Create a new ByteArrayReplacementFilter with $search and $replace.
* @param array $search
* @param array $replace
*/
public function __construct($search, $replace)
{
$this->_search = $search;
$this->_index = array();
$this->_tree = array();
$this->_replace = array();
$this->_repSize = array();
$tree = null;
$i = null;
$last_size = $size = 0;
foreach ($search as $i => $search_element)
{
if ($tree !== null)
{
$tree[-1] = min (count($replace) - 1, $i - 1);
$tree[-2] = $last_size;
}
$tree = &$this->_tree;
if (is_array ($search_element))
{
foreach ($search_element as $k => $char)
{
$this->_index[$char] = true;
if (!isset($tree[$char]))
{
$tree[$char] = array();
}
$tree = &$tree[$char];
}
$last_size = $k+1;
$size = max($size, $last_size);
}
else
{
$last_size = 1;
if (!isset($tree[$search_element]))
{
$tree[$search_element] = array();
}
$tree = &$tree[$search_element];
$size = max($last_size, $size);
$this->_index[$search_element] = true;
}
}
if ($i !== null)
{
$tree[-1] = min (count ($replace) - 1, $i);
$tree[-2] = $last_size;
$this->_treeMaxLen = $size;
}
foreach ($replace as $rep)
{
if (!is_array($rep))
{
$rep = array ($rep);
}
$this->_replace[] = $rep;
}
for ($i = count($this->_replace) - 1; $i >= 0; --$i)
{
$this->_replace[$i] = $rep = $this->filter($this->_replace[$i], $i);
$this->_repSize[$i] = count($rep);
}
}
/**
* Returns true if based on the buffer passed more bytes should be buffered.
* @param array $buffer
* @return boolean
*/
public function shouldBuffer($buffer)
{
$endOfBuffer = end($buffer);
return isset ($this->_index[$endOfBuffer]);
}
/**
* Perform the actual replacements on $buffer and return the result.
* @param array $buffer
* @return array
*/
public function filter($buffer, $_minReplaces = -1)
{
if ($this->_treeMaxLen == 0)
{
return $buffer;
}
$newBuffer = array();
$buf_size = count($buffer);
for ($i = 0; $i < $buf_size; ++$i)
{
$search_pos = $this->_tree;
$last_found = PHP_INT_MAX;
// We try to find if the next byte is part of a search pattern
for ($j = 0; $j <= $this->_treeMaxLen; ++$j)
{
// We have a new byte for a search pattern
if (isset ($buffer [$p = $i + $j]) && isset($search_pos[$buffer[$p]]))
{
$search_pos = $search_pos[$buffer[$p]];
// We have a complete pattern, save, in case we don't find a better match later
if (isset($search_pos[- 1]) && $search_pos[-1] < $last_found
&& $search_pos[-1] > $_minReplaces)
{
$last_found = $search_pos[-1];
$last_size = $search_pos[-2];
}
}
// We got a complete pattern
elseif ($last_found !== PHP_INT_MAX)
{
// Adding replacement datas to output buffer
$rep_size = $this->_repSize[$last_found];
for ($j = 0; $j < $rep_size; ++$j)
{
$newBuffer[] = $this->_replace[$last_found][$j];
}
// We Move cursor forward
$i += $last_size - 1;
// Edge Case, last position in buffer
if ($i >= $buf_size)
{
$newBuffer[] = $buffer[$i];
}
// We start the next loop
continue 2;
}
else
{
// this byte is not in a pattern and we haven't found another pattern
break;
}
}
// Normal byte, move it to output buffer
$newBuffer[] = $buffer[$i];
}
return $newBuffer;
}
}
| Trip09/symfony-1.4.20-php-5.5 | lib/vendor/swiftmailer/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php | PHP | mit | 4,798 |
<?php
/*
* This file is part of SwiftMailer.
* (c) 2004-2009 Chris Corbyn
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* A base Event which all Event classes inherit from.
*
* @package Swift
* @subpackage Events
* @author Chris Corbyn
*/
class Swift_Events_EventObject implements Swift_Events_Event
{
/** The source of this Event */
private $_source;
/** The state of this Event (should it bubble up the stack?) */
private $_bubbleCancelled = false;
/**
* Create a new EventObject originating at $source.
* @param object $source
*/
public function __construct($source)
{
$this->_source = $source;
}
/**
* Get the source object of this event.
* @return object
*/
public function getSource()
{
return $this->_source;
}
/**
* Prevent this Event from bubbling any further up the stack.
* @param boolean $cancel, optional
*/
public function cancelBubble($cancel = true)
{
$this->_bubbleCancelled = $cancel;
}
/**
* Returns true if this Event will not bubble any further up the stack.
* @return boolean
*/
public function bubbleCancelled()
{
return $this->_bubbleCancelled;
}
}
| octavioalapizco/symfony | vendor/swiftmailer/lib/classes/Swift/Events/EventObject.php | PHP | mit | 1,290 |
jasmineRequire.html=function(e){e.ResultsNode=jasmineRequire.ResultsNode(),e.HtmlReporter=jasmineRequire.HtmlReporter(e),e.QueryString=jasmineRequire.QueryString(),e.HtmlSpecFilter=jasmineRequire.HtmlSpecFilter()},jasmineRequire.HtmlReporter=function(e){function s(s){function i(e){return d().querySelector(e)}function a(e,s){for(var t=o(e),i=2;i<arguments.length;i++){var a=arguments[i];"string"==typeof a?t.appendChild(m(a)):a&&t.appendChild(a)}for(var n in s)"className"==n?t[n]=s[n]:t.setAttribute(n,s[n]);return t}function n(e,s){var t=1==s?e:e+"s";return""+s+" "+t}function r(e){return"?spec="+encodeURIComponent(e.fullName)}function l(e){c.setAttribute("class","html-reporter "+e)}var c,u,p=s.env||{},d=s.getContainer,o=s.createElement,m=s.createTextNode,f=s.onRaiseExceptionsClick||function(){},h=s.timer||t,v=0,N=0,g=0;this.initialize=function(){c=a("div",{className:"html-reporter"},a("div",{className:"banner"},a("span",{className:"title"},"Jasmine"),a("span",{className:"version"},e.version)),a("ul",{className:"symbol-summary"}),a("div",{className:"alert"}),a("div",{className:"results"},a("div",{className:"failures"}))),d().appendChild(c),u=i(".symbol-summary")};var C;this.jasmineStarted=function(e){C=e.totalSpecsDefined||0,h.start()};var R=a("div",{className:"summary"}),b=new e.ResultsNode({},"",null),S=b;this.suiteStarted=function(e){S.addChild(e,"suite"),S=S.last()},this.suiteDone=function(){S!=b&&(S=S.parent)},this.specStarted=function(e){S.addChild(e,"spec")};var y=[];return this.specDone=function(e){if("disabled"!=e.status&&v++,u.appendChild(a("li",{className:e.status,id:"spec_"+e.id,title:e.fullName})),"failed"==e.status){N++;for(var s=a("div",{className:"spec-detail failed"},a("div",{className:"description"},a("a",{title:e.fullName,href:r(e)},e.fullName)),a("div",{className:"messages"})),t=s.childNodes[1],i=0;i<e.failedExpectations.length;i++){var n=e.failedExpectations[i];t.appendChild(a("div",{className:"result-message"},n.message)),t.appendChild(a("div",{className:"stack-trace"},n.stack))}y.push(s)}"pending"==e.status&&g++},this.jasmineDone=function(){function e(s,t){for(var i,n=0;n<s.children.length;n++){var l=s.children[n];if("suite"==l.type){var c=a("ul",{className:"suite",id:"suite-"+l.result.id},a("li",{className:"suite-detail"},a("a",{href:r(l.result)},l.result.description)));e(l,c),t.appendChild(c)}"spec"==l.type&&("specs"!=t.getAttribute("class")&&(i=a("ul",{className:"specs"}),t.appendChild(i)),i.appendChild(a("li",{className:l.result.status,id:"spec-"+l.result.id},a("a",{href:r(l.result)},l.result.description))))}}var s=i(".banner");s.appendChild(a("span",{className:"duration"},"finished in "+h.elapsed()/1e3+"s"));var t=i(".alert");t.appendChild(a("span",{className:"exceptions"},a("label",{className:"label","for":"raise-exceptions"},"raise exceptions"),a("input",{className:"raise",id:"raise-exceptions",type:"checkbox"})));var c=i("input");if(c.checked=!p.catchingExceptions(),c.onclick=f,C>v){var u="Ran "+v+" of "+C+" specs - run all";t.appendChild(a("span",{className:"bar skipped"},a("a",{href:"?",title:"Run all specs"},u)))}var d=""+n("spec",v)+", "+n("failure",N);g&&(d+=", "+n("pending spec",g));var o="bar "+(N>0?"failed":"passed");t.appendChild(a("span",{className:o},d));var m=i(".results");if(m.appendChild(R),e(b,R),y.length){t.appendChild(a("span",{className:"menu bar spec-list"},a("span",{},"Spec List | "),a("a",{className:"failures-menu",href:"#"},"Failures"))),t.appendChild(a("span",{className:"menu bar failure-list"},a("a",{className:"spec-list-menu",href:"#"},"Spec List"),a("span",{}," | Failures "))),i(".failures-menu").onclick=function(){l("failure-list")},i(".spec-list-menu").onclick=function(){l("spec-list")},l("failure-list");for(var S=i(".failures"),j=0;j<y.length;j++)S.appendChild(y[j])}},this}var t={start:function(){},elapsed:function(){return 0}};return s},jasmineRequire.HtmlSpecFilter=function(){function e(e){var s=e&&e.filterString()&&e.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),t=new RegExp(s);this.matches=function(e){return t.test(e)}}return e},jasmineRequire.ResultsNode=function(){function e(s,t,i){this.result=s,this.type=t,this.parent=i,this.children=[],this.addChild=function(s,t){this.children.push(new e(s,t,this))},this.last=function(){return this.children[this.children.length-1]}}return e},jasmineRequire.QueryString=function(){function e(e){function s(e){var s=[];for(var t in e)s.push(encodeURIComponent(t)+"="+encodeURIComponent(e[t]));return"?"+s.join("&")}function t(){var s=e.getWindowLocation().search.substring(1),t=[],i={};if(s.length>0){t=s.split("&");for(var a=0;a<t.length;a++){var n=t[a].split("="),r=decodeURIComponent(n[1]);("true"===r||"false"===r)&&(r=JSON.parse(r)),i[decodeURIComponent(n[0])]=r}}return i}return this.setParam=function(i,a){var n=t();n[i]=a,e.getWindowLocation().search=s(n)},this.getParam=function(e){return t()[e]},this}return e}; | kellyselden/cdnjs | ajax/libs/jasmine/2.0.0.rc3/jasmine-html.min.js | JavaScript | mit | 4,907 |
YUI.add("cache-offline",function(E){function D(){D.superclass.constructor.apply(this,arguments);}var A=null,C=E.JSON;try{A=E.config.win.localStorage;}catch(B){}E.mix(D,{NAME:"cacheOffline",ATTRS:{sandbox:{value:"default",writeOnce:"initOnly"},expires:{value:86400000},max:{value:null,readOnly:true},uniqueKeys:{value:true,readOnly:true,setter:function(){return true;}}},flushAll:function(){var F=A,G;if(F){if(F.clear){F.clear();}else{for(G in F){if(F.hasOwnProperty(G)){F.removeItem(G);delete F[G];}}}}else{}}});E.extend(D,E.Cache,A?{_setMax:function(F){return null;},_getSize:function(){var H=0,G=0,F=A.length;for(;G<F;++G){if(A.key(G).indexOf(this.get("sandbox"))===0){H++;}}return H;},_getEntries:function(){var F=[],I=0,H=A.length,G=this.get("sandbox");for(;I<H;++I){if(A.key(I).indexOf(G)===0){F[I]=C.parse(A.key(I).substring(G.length));}}return F;},_defAddFn:function(K){var J=K.entry,I=J.request,H=J.cached,F=J.expires;J.cached=H.getTime();J.expires=F?F.getTime():F;try{A.setItem(this.get("sandbox")+C.stringify({"request":I}),C.stringify(J));}catch(G){this.fire("error",{error:G});}},_defFlushFn:function(H){var G,F=A.length-1;for(;F>-1;--F){G=A.key(F);if(G.indexOf(this.get("sandbox"))===0){A.removeItem(G);}}},retrieve:function(I){this.fire("request",{request:I});var H,F,G;try{G=this.get("sandbox")+C.stringify({"request":I});try{H=C.parse(A.getItem(G));}catch(K){}}catch(J){}if(H){H.cached=new Date(H.cached);F=H.expires;F=!F?null:new Date(F);H.expires=F;if(this._isMatch(I,H)){this.fire("retrieve",{entry:H});return H;}}return null;}}:{_setMax:function(F){return null;}});E.CacheOffline=D;},"@VERSION@",{requires:["cache-base","json"]}); | rivanvx/cdnjs | ajax/libs/yui/3.3.0/cache/cache-offline-min.js | JavaScript | mit | 1,650 |
// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08)
// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)
CodeMirror.defineMode("perl",function(){function r(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){var o=!1,u,a=0;while(u=e.next()){if(u===n[a]&&!o)return n[++a]!==undefined?(t.chain=n[a],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=s,r;o=!o&&u=="\\"}return r},t.tokenize(e,t)}function i(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=s),e.skipToEnd(),"string"},t.tokenize(e,t)}function s(s,o){if(s.eatSpace())return null;if(o.chain)return r(s,o,o.chain,o.style,o.tail);if(s.match(/^\-?[\d\.]/,!1)&&s.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(s.match(/^<<(?=\w)/))return s.eatWhile(/\w/),i(s,o,s.current().substr(2));if(s.sol()&&s.match(/^\=item(?!\w)/))return i(s,o,"=cut");var u=s.next();if(u=='"'||u=="'"){if(s.prefix(3)=="<<"+u){var a=s.pos;s.eatWhile(/\w/);var f=s.current().substr(1);if(f&&s.eat(u))return i(s,o,f);s.pos=a}return r(s,o,[u],"string")}if(u=="q"){var l=s.look(-2);if(!l||!/\w/.test(l)){l=s.look(0);if(l=="x"){l=s.look(1);if(l=="(")return s.eatSuffix(2),r(s,o,[")"],t,n);if(l=="[")return s.eatSuffix(2),r(s,o,["]"],t,n);if(l=="{")return s.eatSuffix(2),r(s,o,["}"],t,n);if(l=="<")return s.eatSuffix(2),r(s,o,[">"],t,n);if(/[\^'"!~\/]/.test(l))return s.eatSuffix(1),r(s,o,[s.eat(l)],t,n)}else if(l=="q"){l=s.look(1);if(l=="(")return s.eatSuffix(2),r(s,o,[")"],"string");if(l=="[")return s.eatSuffix(2),r(s,o,["]"],"string");if(l=="{")return s.eatSuffix(2),r(s,o,["}"],"string");if(l=="<")return s.eatSuffix(2),r(s,o,[">"],"string");if(/[\^'"!~\/]/.test(l))return s.eatSuffix(1),r(s,o,[s.eat(l)],"string")}else if(l=="w"){l=s.look(1);if(l=="(")return s.eatSuffix(2),r(s,o,[")"],"bracket");if(l=="[")return s.eatSuffix(2),r(s,o,["]"],"bracket");if(l=="{")return s.eatSuffix(2),r(s,o,["}"],"bracket");if(l=="<")return s.eatSuffix(2),r(s,o,[">"],"bracket");if(/[\^'"!~\/]/.test(l))return s.eatSuffix(1),r(s,o,[s.eat(l)],"bracket")}else if(l=="r"){l=s.look(1);if(l=="(")return s.eatSuffix(2),r(s,o,[")"],t,n);if(l=="[")return s.eatSuffix(2),r(s,o,["]"],t,n);if(l=="{")return s.eatSuffix(2),r(s,o,["}"],t,n);if(l=="<")return s.eatSuffix(2),r(s,o,[">"],t,n);if(/[\^'"!~\/]/.test(l))return s.eatSuffix(1),r(s,o,[s.eat(l)],t,n)}else if(/[\^'"!~\/(\[{<]/.test(l)){if(l=="(")return s.eatSuffix(1),r(s,o,[")"],"string");if(l=="[")return s.eatSuffix(1),r(s,o,["]"],"string");if(l=="{")return s.eatSuffix(1),r(s,o,["}"],"string");if(l=="<")return s.eatSuffix(1),r(s,o,[">"],"string");if(/[\^'"!~\/]/.test(l))return r(s,o,[s.eat(l)],"string")}}}if(u=="m"){var l=s.look(-2);if(!l||!/\w/.test(l)){l=s.eat(/[(\[{<\^'"!~\/]/);if(l){if(/[\^'"!~\/]/.test(l))return r(s,o,[l],t,n);if(l=="(")return r(s,o,[")"],t,n);if(l=="[")return r(s,o,["]"],t,n);if(l=="{")return r(s,o,["}"],t,n);if(l=="<")return r(s,o,[">"],t,n)}}}if(u=="s"){var l=/[\/>\]})\w]/.test(s.look(-2));if(!l){l=s.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?r(s,o,["]","]"],t,n):l=="{"?r(s,o,["}","}"],t,n):l=="<"?r(s,o,[">",">"],t,n):l=="("?r(s,o,[")",")"],t,n):r(s,o,[l,l],t,n)}}if(u=="y"){var l=/[\/>\]})\w]/.test(s.look(-2));if(!l){l=s.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?r(s,o,["]","]"],t,n):l=="{"?r(s,o,["}","}"],t,n):l=="<"?r(s,o,[">",">"],t,n):l=="("?r(s,o,[")",")"],t,n):r(s,o,[l,l],t,n)}}if(u=="t"){var l=/[\/>\]})\w]/.test(s.look(-2));if(!l){l=s.eat("r");if(l){l=s.eat(/[(\[{<\^'"!~\/]/);if(l)return l=="["?r(s,o,["]","]"],t,n):l=="{"?r(s,o,["}","}"],t,n):l=="<"?r(s,o,[">",">"],t,n):l=="("?r(s,o,[")",")"],t,n):r(s,o,[l,l],t,n)}}}if(u=="`")return r(s,o,[u],"variable-2");if(u=="/")return/~\s*$/.test(s.prefix())?r(s,o,[u],t,n):"operator";if(u=="$"){var a=s.pos;if(s.eatWhile(/\d/)||s.eat("{")&&s.eatWhile(/\d/)&&s.eat("}"))return"variable-2";s.pos=a}if(/[$@%]/.test(u)){var a=s.pos;if(s.eat("^")&&s.eat(/[A-Z]/)||!/[@$%&]/.test(s.look(-2))&&s.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var l=s.current();if(e[l])return"variable-2"}s.pos=a}if(/[$@%&]/.test(u))if(s.eatWhile(/[\w$\[\]]/)||s.eat("{")&&s.eatWhile(/[\w$\[\]]/)&&s.eat("}")){var l=s.current();return e[l]?"variable-2":"variable"}if(u=="#"&&s.look(-2)!="$")return s.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(u)){var a=s.pos;s.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);if(e[s.current()])return"operator";s.pos=a}if(u=="_"&&s.pos==1){if(s.suffix(6)=="_END__")return r(s,o,["\0"],"comment");if(s.suffix(7)=="_DATA__")return r(s,o,["\0"],"variable-2");if(s.suffix(7)=="_C__")return r(s,o,["\0"],"string")}if(/\w/.test(u)){var a=s.pos;if(s.look(-2)=="{"&&(s.look(0)=="}"||s.eatWhile(/\w/)&&s.look(0)=="}"))return"string";s.pos=a}if(/[A-Z]/.test(u)){var c=s.look(-2),a=s.pos;s.eatWhile(/[A-Z_]/);if(!/[\da-z]/.test(s.look(0))){var l=e[s.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}s.pos=a}if(/[a-zA-Z_]/.test(u)){var c=s.look(-2);s.eatWhile(/\w/);var l=e[s.current()];return l?(l[1]&&(l=l[0]),c!=":"?l==1?"keyword":l==2?"def":l==3?"atom":l==4?"operator":l==5?"variable-2":"meta":"meta"):"meta"}return null}var e={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},t="string-2",n=/[goseximacplud]/;return{startState:function(){return{tokenize:s,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||s)(e,t)},electricChars:"{}"}}),CodeMirror.defineMIME("text/x-perl","perl"),CodeMirror.StringStream.prototype.look=function(e){return this.string.charAt(this.pos+(e||0))},CodeMirror.StringStream.prototype.prefix=function(e){if(e){var t=this.pos-e;return this.string.substr(t>=0?t:0,e)}return this.string.substr(0,this.pos-1)},CodeMirror.StringStream.prototype.suffix=function(e){var t=this.string.length,n=t-this.pos+1;return this.string.substr(this.pos,e&&e<t?e:n)},CodeMirror.StringStream.prototype.nsuffix=function(e){var t=this.pos,n=e||this.string.length-this.pos+1;return this.pos+=n,this.string.substr(t,n)},CodeMirror.StringStream.prototype.eatSuffix=function(e){var t=this.pos+e,n;t<=0?this.pos=0:t>=(n=this.string.length-1)?this.pos=n:this.pos=t}; | Enelar/cdnjs | ajax/libs/codemirror/3.20.0/mode/perl/perl.min.js | JavaScript | mit | 10,621 |
YUI.add('node-screen', function(Y) {
/**
* Extended Node interface for managing regions and screen positioning.
* Adds support for positioning elements and normalizes window size and scroll detection.
* @module node
* @submodule node-screen
*/
// these are all "safe" returns, no wrapping required
Y.each([
/**
* Returns the inner width of the viewport (exludes scrollbar).
* @config winWidth
* @for Node
* @type {Int}
*/
'winWidth',
/**
* Returns the inner height of the viewport (exludes scrollbar).
* @config winHeight
* @type {Int}
*/
'winHeight',
/**
* Document width
* @config winHeight
* @type {Int}
*/
'docWidth',
/**
* Document height
* @config docHeight
* @type {Int}
*/
'docHeight',
/**
* Amount page has been scroll vertically
* @config docScrollX
* @type {Int}
*/
'docScrollX',
/**
* Amount page has been scroll horizontally
* @config docScrollY
* @type {Int}
*/
'docScrollY'
],
function(name) {
Y.Node.ATTRS[name] = {
getter: function() {
var args = Array.prototype.slice.call(arguments);
args.unshift(Y.Node.getDOMNode(this));
return Y.DOM[name].apply(this, args);
}
};
}
);
Y.Node.ATTRS.scrollLeft = {
getter: function() {
var node = Y.Node.getDOMNode(this);
return ('scrollLeft' in node) ? node.scrollLeft : Y.DOM.docScrollX(node);
},
setter: function(val) {
var node = Y.Node.getDOMNode(this);
if (node) {
if ('scrollLeft' in node) {
node.scrollLeft = val;
} else if (node.document || node.nodeType === 9) {
Y.DOM._getWin(node).scrollTo(val, Y.DOM.docScrollY(node)); // scroll window if win or doc
}
} else {
Y.log('unable to set scrollLeft for ' + node, 'error', 'Node');
}
}
};
Y.Node.ATTRS.scrollTop = {
getter: function() {
var node = Y.Node.getDOMNode(this);
return ('scrollTop' in node) ? node.scrollTop : Y.DOM.docScrollY(node);
},
setter: function(val) {
var node = Y.Node.getDOMNode(this);
if (node) {
if ('scrollTop' in node) {
node.scrollTop = val;
} else if (node.document || node.nodeType === 9) {
Y.DOM._getWin(node).scrollTo(Y.DOM.docScrollX(node), val); // scroll window if win or doc
}
} else {
Y.log('unable to set scrollTop for ' + node, 'error', 'Node');
}
}
};
Y.Node.importMethod(Y.DOM, [
/**
* Gets the current position of the node in page coordinates.
* @method getXY
* @for Node
* @return {Array} The XY position of the node
*/
'getXY',
/**
* Set the position of the node in page coordinates, regardless of how the node is positioned.
* @method setXY
* @param {Array} xy Contains X & Y values for new position (coordinates are page-based)
* @chainable
*/
'setXY',
/**
* Gets the current position of the node in page coordinates.
* @method getX
* @return {Int} The X position of the node
*/
'getX',
/**
* Set the position of the node in page coordinates, regardless of how the node is positioned.
* @method setX
* @param {Int} x X value for new position (coordinates are page-based)
* @chainable
*/
'setX',
/**
* Gets the current position of the node in page coordinates.
* @method getY
* @return {Int} The Y position of the node
*/
'getY',
/**
* Set the position of the node in page coordinates, regardless of how the node is positioned.
* @method setY
* @param {Int} y Y value for new position (coordinates are page-based)
* @chainable
*/
'setY',
/**
* Swaps the XY position of this node with another node.
* @method swapXY
* @param {Y.Node || HTMLElement} otherNode The node to swap with.
* @chainable
*/
'swapXY'
]);
/**
* Returns a region object for the node
* @config region
* @for Node
* @type Node
*/
Y.Node.ATTRS.region = {
getter: function() {
var node = Y.Node.getDOMNode(this),
region;
if (node && !node.tagName) {
if (node.nodeType === 9) { // document
node = node.documentElement;
}
}
if (node.alert) {
region = Y.DOM.viewportRegion(node);
} else {
region = Y.DOM.region(node);
}
return region;
}
};
/**
* Returns a region object for the node's viewport
* @config viewportRegion
* @type Node
*/
Y.Node.ATTRS.viewportRegion = {
getter: function() {
return Y.DOM.viewportRegion(Y.Node.getDOMNode(this));
}
};
Y.Node.importMethod(Y.DOM, 'inViewportRegion');
// these need special treatment to extract 2nd node arg
/**
* Compares the intersection of the node with another node or region
* @method intersect
* @for Node
* @param {Node|Object} node2 The node or region to compare with.
* @param {Object} altRegion An alternate region to use (rather than this node's).
* @return {Object} An object representing the intersection of the regions.
*/
Y.Node.prototype.intersect = function(node2, altRegion) {
var node1 = Y.Node.getDOMNode(this);
if (Y.instanceOf(node2, Y.Node)) { // might be a region object
node2 = Y.Node.getDOMNode(node2);
}
return Y.DOM.intersect(node1, node2, altRegion);
};
/**
* Determines whether or not the node is within the giving region.
* @method inRegion
* @param {Node|Object} node2 The node or region to compare with.
* @param {Boolean} all Whether or not all of the node must be in the region.
* @param {Object} altRegion An alternate region to use (rather than this node's).
* @return {Object} An object representing the intersection of the regions.
*/
Y.Node.prototype.inRegion = function(node2, all, altRegion) {
var node1 = Y.Node.getDOMNode(this);
if (Y.instanceOf(node2, Y.Node)) { // might be a region object
node2 = Y.Node.getDOMNode(node2);
}
return Y.DOM.inRegion(node1, node2, all, altRegion);
};
}, '@VERSION@' ,{requires:['dom-screen']});
| dominicrico/cdnjs | ajax/libs/yui/3.3.0/node/node-screen-debug.js | JavaScript | mit | 6,220 |
var baseFlatten = require('./_baseFlatten'),
baseOrderBy = require('./_baseOrderBy'),
baseRest = require('./_baseRest'),
isIterateeCall = require('./_isIterateeCall');
/**
* Creates an array of elements, sorted in ascending order by the results of
* running each element in a collection thru each iteratee. This method
* performs a stable sort, that is, it preserves the original sort order of
* equal elements. The iteratees are invoked with one argument: (value).
*
* @static
* @memberOf _
* @since 0.1.0
* @category Collection
* @param {Array|Object} collection The collection to iterate over.
* @param {...(Function|Function[])} [iteratees=[_.identity]]
* The iteratees to sort by.
* @returns {Array} Returns the new sorted array.
* @example
*
* var users = [
* { 'user': 'fred', 'age': 48 },
* { 'user': 'barney', 'age': 36 },
* { 'user': 'fred', 'age': 40 },
* { 'user': 'barney', 'age': 34 }
* ];
*
* _.sortBy(users, [function(o) { return o.user; }]);
* // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
*
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
*/
var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
var length = iteratees.length;
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
iteratees = [];
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
iteratees = [iteratees[0]];
}
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
});
module.exports = sortBy;
| jeffshen18/React-Course | node_modules/babel-generator/node_modules/lodash/sortBy.js | JavaScript | mit | 1,668 |
<?php
/*
* This file is part of Twig.
*
* (c) 2010 Fabien Potencier
* (c) 2010 Arnaud Le Blanc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Interface implemented by token parser brokers.
*
* Token parser brokers allows to implement custom logic in the process of resolving a token parser for a given tag name.
*
* @package twig
* @author Arnaud Le Blanc <arnaud.lb@gmail.com>
* @deprecated since 1.12 (to be removed in 2.0)
*/
interface Twig_TokenParserBrokerInterface
{
/**
* Gets a TokenParser suitable for a tag.
*
* @param string $tag A tag name
*
* @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found
*/
public function getTokenParser($tag);
/**
* Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of.
*
* @param Twig_ParserInterface $parser A Twig_ParserInterface interface
*/
public function setParser(Twig_ParserInterface $parser);
/**
* Gets the Twig_ParserInterface.
*
* @return null|Twig_ParserInterface A Twig_ParserInterface instance or null
*/
public function getParser();
}
| dovnmr/symfony | vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php | PHP | mit | 1,294 |
<?php
/*
* This file is part of the Doctrine Bundle
*
* The code was originally distributed inside the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
* (c) Doctrine Project, Benjamin Eberlei <kontakt@beberlei.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Doctrine\Bundle\DoctrineBundle\Tests;
use Doctrine\DBAL\Types\Type;
class ContainerTest extends TestCase
{
protected function setUp()
{
parent::setUp();
if (!class_exists('Doctrine\\ORM\\Version')) {
$this->markTestSkipped('Doctrine ORM is not available.');
}
}
public function testContainer()
{
$container = $this->createYamlBundleTestContainer();
$this->assertInstanceOf('Symfony\Bridge\Doctrine\Logger\DbalLogger', $container->get('doctrine.dbal.logger'));
$this->assertInstanceOf('Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector', $container->get('data_collector.doctrine'));
$this->assertInstanceOf('Doctrine\DBAL\Configuration', $container->get('doctrine.dbal.default_connection.configuration'));
$this->assertInstanceOf('Doctrine\Common\EventManager', $container->get('doctrine.dbal.default_connection.event_manager'));
$this->assertInstanceOf('Doctrine\DBAL\Connection', $container->get('doctrine.dbal.default_connection'));
$this->assertInstanceOf('Doctrine\Common\Annotations\Reader', $container->get('doctrine.orm.metadata.annotation_reader'));
$this->assertInstanceOf('Doctrine\ORM\Configuration', $container->get('doctrine.orm.default_configuration'));
$this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain', $container->get('doctrine.orm.default_metadata_driver'));
$this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $container->get('doctrine.orm.default_metadata_cache'));
$this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $container->get('doctrine.orm.default_query_cache'));
$this->assertInstanceOf('Doctrine\Common\Cache\ArrayCache', $container->get('doctrine.orm.default_result_cache'));
$this->assertInstanceOf('Doctrine\ORM\EntityManager', $container->get('doctrine.orm.default_entity_manager'));
$this->assertInstanceOf('Doctrine\DBAL\Connection', $container->get('database_connection'));
$this->assertInstanceOf('Doctrine\ORM\EntityManager', $container->get('doctrine.orm.entity_manager'));
$this->assertInstanceOf('Doctrine\Common\EventManager', $container->get('doctrine.orm.default_entity_manager.event_manager'));
$this->assertInstanceOf('Doctrine\Common\EventManager', $container->get('doctrine.dbal.event_manager'));
$this->assertInstanceOf('Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer', $container->get('doctrine.orm.proxy_cache_warmer'));
$this->assertInstanceOf('Doctrine\Common\Persistence\ManagerRegistry', $container->get('doctrine'));
$this->assertInstanceOf('Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntityValidator', $container->get('doctrine.orm.validator.unique'));
$this->assertSame($container->get('my.platform'), $container->get('doctrine.dbal.default_connection')->getDatabasePlatform());
$this->assertTrue(Type::hasType('test'));
if (version_compare(PHP_VERSION, '5.3.6', '<')) {
$this->assertInstanceOf('Doctrine\DBAL\Event\Listeners\MysqlSessionInit', $container->get('doctrine.dbal.default_connection.events.mysqlsessioninit'));
} else {
$this->assertFalse($container->has('doctrine.dbal.default_connection.events.mysqlsessioninit'));
}
if (interface_exists('Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface') && class_exists('Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor')) {
$this->assertInstanceOf('Doctrine\Common\Persistence\Mapping\ClassMetadataFactory', $container->get('doctrine.orm.default_entity_manager.metadata_factory'));
$this->assertInstanceOf('Symfony\Bridge\Doctrine\PropertyInfo\DoctrineExtractor', $container->get('doctrine.orm.default_entity_manager.property_info_extractor'));
} else {
$this->assertFalse($container->has('doctrine.orm.default_entity_manager.metadata_factory'));
$this->assertFalse($container->has('doctrine.orm.default_entity_manager.property_info_extractor'));
}
}
}
| UchiKir/SymfonyPadelApp | vendor/doctrine/doctrine-bundle/Tests/ContainerTest.php | PHP | mit | 4,509 |
@font-face {
font-family: 'simple-line-icons';
src: url('../fonts/Simple-Line-Icons.eot?v=2.4.0');
src: url('../fonts/Simple-Line-Icons.eot?v=2.4.0#iefix') format('embedded-opentype'), url('../fonts/Simple-Line-Icons.woff2?v=2.4.0') format('woff2'), url('../fonts/Simple-Line-Icons.ttf?v=2.4.0') format('truetype'), url('../fonts/Simple-Line-Icons.woff?v=2.4.0') format('woff'), url('../fonts/Simple-Line-Icons.svg?v=2.4.0#simple-line-icons') format('svg');
font-weight: normal;
font-style: normal;
}
/*
Use the following CSS code if you want to have a class per icon.
Instead of a list of all class selectors, you can use the generic [class*="icon-"] selector, but it's slower:
*/
.icon-user,
.icon-people,
.icon-user-female,
.icon-user-follow,
.icon-user-following,
.icon-user-unfollow,
.icon-login,
.icon-logout,
.icon-emotsmile,
.icon-phone,
.icon-call-end,
.icon-call-in,
.icon-call-out,
.icon-map,
.icon-location-pin,
.icon-direction,
.icon-directions,
.icon-compass,
.icon-layers,
.icon-menu,
.icon-list,
.icon-options-vertical,
.icon-options,
.icon-arrow-down,
.icon-arrow-left,
.icon-arrow-right,
.icon-arrow-up,
.icon-arrow-up-circle,
.icon-arrow-left-circle,
.icon-arrow-right-circle,
.icon-arrow-down-circle,
.icon-check,
.icon-clock,
.icon-plus,
.icon-minus,
.icon-close,
.icon-event,
.icon-exclamation,
.icon-organization,
.icon-trophy,
.icon-screen-smartphone,
.icon-screen-desktop,
.icon-plane,
.icon-notebook,
.icon-mustache,
.icon-mouse,
.icon-magnet,
.icon-energy,
.icon-disc,
.icon-cursor,
.icon-cursor-move,
.icon-crop,
.icon-chemistry,
.icon-speedometer,
.icon-shield,
.icon-screen-tablet,
.icon-magic-wand,
.icon-hourglass,
.icon-graduation,
.icon-ghost,
.icon-game-controller,
.icon-fire,
.icon-eyeglass,
.icon-envelope-open,
.icon-envelope-letter,
.icon-bell,
.icon-badge,
.icon-anchor,
.icon-wallet,
.icon-vector,
.icon-speech,
.icon-puzzle,
.icon-printer,
.icon-present,
.icon-playlist,
.icon-pin,
.icon-picture,
.icon-handbag,
.icon-globe-alt,
.icon-globe,
.icon-folder-alt,
.icon-folder,
.icon-film,
.icon-feed,
.icon-drop,
.icon-drawer,
.icon-docs,
.icon-doc,
.icon-diamond,
.icon-cup,
.icon-calculator,
.icon-bubbles,
.icon-briefcase,
.icon-book-open,
.icon-basket-loaded,
.icon-basket,
.icon-bag,
.icon-action-undo,
.icon-action-redo,
.icon-wrench,
.icon-umbrella,
.icon-trash,
.icon-tag,
.icon-support,
.icon-frame,
.icon-size-fullscreen,
.icon-size-actual,
.icon-shuffle,
.icon-share-alt,
.icon-share,
.icon-rocket,
.icon-question,
.icon-pie-chart,
.icon-pencil,
.icon-note,
.icon-loop,
.icon-home,
.icon-grid,
.icon-graph,
.icon-microphone,
.icon-music-tone-alt,
.icon-music-tone,
.icon-earphones-alt,
.icon-earphones,
.icon-equalizer,
.icon-like,
.icon-dislike,
.icon-control-start,
.icon-control-rewind,
.icon-control-play,
.icon-control-pause,
.icon-control-forward,
.icon-control-end,
.icon-volume-1,
.icon-volume-2,
.icon-volume-off,
.icon-calendar,
.icon-bulb,
.icon-chart,
.icon-ban,
.icon-bubble,
.icon-camrecorder,
.icon-camera,
.icon-cloud-download,
.icon-cloud-upload,
.icon-envelope,
.icon-eye,
.icon-flag,
.icon-heart,
.icon-info,
.icon-key,
.icon-link,
.icon-lock,
.icon-lock-open,
.icon-magnifier,
.icon-magnifier-add,
.icon-magnifier-remove,
.icon-paper-clip,
.icon-paper-plane,
.icon-power,
.icon-refresh,
.icon-reload,
.icon-settings,
.icon-star,
.icon-symbol-female,
.icon-symbol-male,
.icon-target,
.icon-credit-card,
.icon-paypal,
.icon-social-tumblr,
.icon-social-twitter,
.icon-social-facebook,
.icon-social-instagram,
.icon-social-linkedin,
.icon-social-pinterest,
.icon-social-github,
.icon-social-google,
.icon-social-reddit,
.icon-social-skype,
.icon-social-dribbble,
.icon-social-behance,
.icon-social-foursqare,
.icon-social-soundcloud,
.icon-social-spotify,
.icon-social-stumbleupon,
.icon-social-youtube,
.icon-social-dropbox,
.icon-social-vkontakte,
.icon-social-steam {
font-family: 'simple-line-icons';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-user:before {
content: "\e005";
}
.icon-people:before {
content: "\e001";
}
.icon-user-female:before {
content: "\e000";
}
.icon-user-follow:before {
content: "\e002";
}
.icon-user-following:before {
content: "\e003";
}
.icon-user-unfollow:before {
content: "\e004";
}
.icon-login:before {
content: "\e066";
}
.icon-logout:before {
content: "\e065";
}
.icon-emotsmile:before {
content: "\e021";
}
.icon-phone:before {
content: "\e600";
}
.icon-call-end:before {
content: "\e048";
}
.icon-call-in:before {
content: "\e047";
}
.icon-call-out:before {
content: "\e046";
}
.icon-map:before {
content: "\e033";
}
.icon-location-pin:before {
content: "\e096";
}
.icon-direction:before {
content: "\e042";
}
.icon-directions:before {
content: "\e041";
}
.icon-compass:before {
content: "\e045";
}
.icon-layers:before {
content: "\e034";
}
.icon-menu:before {
content: "\e601";
}
.icon-list:before {
content: "\e067";
}
.icon-options-vertical:before {
content: "\e602";
}
.icon-options:before {
content: "\e603";
}
.icon-arrow-down:before {
content: "\e604";
}
.icon-arrow-left:before {
content: "\e605";
}
.icon-arrow-right:before {
content: "\e606";
}
.icon-arrow-up:before {
content: "\e607";
}
.icon-arrow-up-circle:before {
content: "\e078";
}
.icon-arrow-left-circle:before {
content: "\e07a";
}
.icon-arrow-right-circle:before {
content: "\e079";
}
.icon-arrow-down-circle:before {
content: "\e07b";
}
.icon-check:before {
content: "\e080";
}
.icon-clock:before {
content: "\e081";
}
.icon-plus:before {
content: "\e095";
}
.icon-minus:before {
content: "\e615";
}
.icon-close:before {
content: "\e082";
}
.icon-event:before {
content: "\e619";
}
.icon-exclamation:before {
content: "\e617";
}
.icon-organization:before {
content: "\e616";
}
.icon-trophy:before {
content: "\e006";
}
.icon-screen-smartphone:before {
content: "\e010";
}
.icon-screen-desktop:before {
content: "\e011";
}
.icon-plane:before {
content: "\e012";
}
.icon-notebook:before {
content: "\e013";
}
.icon-mustache:before {
content: "\e014";
}
.icon-mouse:before {
content: "\e015";
}
.icon-magnet:before {
content: "\e016";
}
.icon-energy:before {
content: "\e020";
}
.icon-disc:before {
content: "\e022";
}
.icon-cursor:before {
content: "\e06e";
}
.icon-cursor-move:before {
content: "\e023";
}
.icon-crop:before {
content: "\e024";
}
.icon-chemistry:before {
content: "\e026";
}
.icon-speedometer:before {
content: "\e007";
}
.icon-shield:before {
content: "\e00e";
}
.icon-screen-tablet:before {
content: "\e00f";
}
.icon-magic-wand:before {
content: "\e017";
}
.icon-hourglass:before {
content: "\e018";
}
.icon-graduation:before {
content: "\e019";
}
.icon-ghost:before {
content: "\e01a";
}
.icon-game-controller:before {
content: "\e01b";
}
.icon-fire:before {
content: "\e01c";
}
.icon-eyeglass:before {
content: "\e01d";
}
.icon-envelope-open:before {
content: "\e01e";
}
.icon-envelope-letter:before {
content: "\e01f";
}
.icon-bell:before {
content: "\e027";
}
.icon-badge:before {
content: "\e028";
}
.icon-anchor:before {
content: "\e029";
}
.icon-wallet:before {
content: "\e02a";
}
.icon-vector:before {
content: "\e02b";
}
.icon-speech:before {
content: "\e02c";
}
.icon-puzzle:before {
content: "\e02d";
}
.icon-printer:before {
content: "\e02e";
}
.icon-present:before {
content: "\e02f";
}
.icon-playlist:before {
content: "\e030";
}
.icon-pin:before {
content: "\e031";
}
.icon-picture:before {
content: "\e032";
}
.icon-handbag:before {
content: "\e035";
}
.icon-globe-alt:before {
content: "\e036";
}
.icon-globe:before {
content: "\e037";
}
.icon-folder-alt:before {
content: "\e039";
}
.icon-folder:before {
content: "\e089";
}
.icon-film:before {
content: "\e03a";
}
.icon-feed:before {
content: "\e03b";
}
.icon-drop:before {
content: "\e03e";
}
.icon-drawer:before {
content: "\e03f";
}
.icon-docs:before {
content: "\e040";
}
.icon-doc:before {
content: "\e085";
}
.icon-diamond:before {
content: "\e043";
}
.icon-cup:before {
content: "\e044";
}
.icon-calculator:before {
content: "\e049";
}
.icon-bubbles:before {
content: "\e04a";
}
.icon-briefcase:before {
content: "\e04b";
}
.icon-book-open:before {
content: "\e04c";
}
.icon-basket-loaded:before {
content: "\e04d";
}
.icon-basket:before {
content: "\e04e";
}
.icon-bag:before {
content: "\e04f";
}
.icon-action-undo:before {
content: "\e050";
}
.icon-action-redo:before {
content: "\e051";
}
.icon-wrench:before {
content: "\e052";
}
.icon-umbrella:before {
content: "\e053";
}
.icon-trash:before {
content: "\e054";
}
.icon-tag:before {
content: "\e055";
}
.icon-support:before {
content: "\e056";
}
.icon-frame:before {
content: "\e038";
}
.icon-size-fullscreen:before {
content: "\e057";
}
.icon-size-actual:before {
content: "\e058";
}
.icon-shuffle:before {
content: "\e059";
}
.icon-share-alt:before {
content: "\e05a";
}
.icon-share:before {
content: "\e05b";
}
.icon-rocket:before {
content: "\e05c";
}
.icon-question:before {
content: "\e05d";
}
.icon-pie-chart:before {
content: "\e05e";
}
.icon-pencil:before {
content: "\e05f";
}
.icon-note:before {
content: "\e060";
}
.icon-loop:before {
content: "\e064";
}
.icon-home:before {
content: "\e069";
}
.icon-grid:before {
content: "\e06a";
}
.icon-graph:before {
content: "\e06b";
}
.icon-microphone:before {
content: "\e063";
}
.icon-music-tone-alt:before {
content: "\e061";
}
.icon-music-tone:before {
content: "\e062";
}
.icon-earphones-alt:before {
content: "\e03c";
}
.icon-earphones:before {
content: "\e03d";
}
.icon-equalizer:before {
content: "\e06c";
}
.icon-like:before {
content: "\e068";
}
.icon-dislike:before {
content: "\e06d";
}
.icon-control-start:before {
content: "\e06f";
}
.icon-control-rewind:before {
content: "\e070";
}
.icon-control-play:before {
content: "\e071";
}
.icon-control-pause:before {
content: "\e072";
}
.icon-control-forward:before {
content: "\e073";
}
.icon-control-end:before {
content: "\e074";
}
.icon-volume-1:before {
content: "\e09f";
}
.icon-volume-2:before {
content: "\e0a0";
}
.icon-volume-off:before {
content: "\e0a1";
}
.icon-calendar:before {
content: "\e075";
}
.icon-bulb:before {
content: "\e076";
}
.icon-chart:before {
content: "\e077";
}
.icon-ban:before {
content: "\e07c";
}
.icon-bubble:before {
content: "\e07d";
}
.icon-camrecorder:before {
content: "\e07e";
}
.icon-camera:before {
content: "\e07f";
}
.icon-cloud-download:before {
content: "\e083";
}
.icon-cloud-upload:before {
content: "\e084";
}
.icon-envelope:before {
content: "\e086";
}
.icon-eye:before {
content: "\e087";
}
.icon-flag:before {
content: "\e088";
}
.icon-heart:before {
content: "\e08a";
}
.icon-info:before {
content: "\e08b";
}
.icon-key:before {
content: "\e08c";
}
.icon-link:before {
content: "\e08d";
}
.icon-lock:before {
content: "\e08e";
}
.icon-lock-open:before {
content: "\e08f";
}
.icon-magnifier:before {
content: "\e090";
}
.icon-magnifier-add:before {
content: "\e091";
}
.icon-magnifier-remove:before {
content: "\e092";
}
.icon-paper-clip:before {
content: "\e093";
}
.icon-paper-plane:before {
content: "\e094";
}
.icon-power:before {
content: "\e097";
}
.icon-refresh:before {
content: "\e098";
}
.icon-reload:before {
content: "\e099";
}
.icon-settings:before {
content: "\e09a";
}
.icon-star:before {
content: "\e09b";
}
.icon-symbol-female:before {
content: "\e09c";
}
.icon-symbol-male:before {
content: "\e09d";
}
.icon-target:before {
content: "\e09e";
}
.icon-credit-card:before {
content: "\e025";
}
.icon-paypal:before {
content: "\e608";
}
.icon-social-tumblr:before {
content: "\e00a";
}
.icon-social-twitter:before {
content: "\e009";
}
.icon-social-facebook:before {
content: "\e00b";
}
.icon-social-instagram:before {
content: "\e609";
}
.icon-social-linkedin:before {
content: "\e60a";
}
.icon-social-pinterest:before {
content: "\e60b";
}
.icon-social-github:before {
content: "\e60c";
}
.icon-social-google:before {
content: "\e60d";
}
.icon-social-reddit:before {
content: "\e60e";
}
.icon-social-skype:before {
content: "\e60f";
}
.icon-social-dribbble:before {
content: "\e00d";
}
.icon-social-behance:before {
content: "\e610";
}
.icon-social-foursqare:before {
content: "\e611";
}
.icon-social-soundcloud:before {
content: "\e612";
}
.icon-social-spotify:before {
content: "\e613";
}
.icon-social-stumbleupon:before {
content: "\e614";
}
.icon-social-youtube:before {
content: "\e008";
}
.icon-social-dropbox:before {
content: "\e00c";
}
.icon-social-vkontakte:before {
content: "\e618";
}
.icon-social-steam:before {
content: "\e620";
}
| travisday/travisday.github.io | vendor/simple-line-icons/css/simple-line-icons.css | CSS | mit | 12,958 |
/*
JS Signals <http://millermedeiros.github.com/js-signals/>
Released under the MIT license
Author: Miller Medeiros
Version: 1.0.0 - Build: 268 (2012/11/29 05:48 PM)
*/
(function(i){function h(a,b,c,d,e){this._listener=b;this._isOnce=c;this.context=d;this._signal=a;this._priority=e||0}function g(a,b){if(typeof a!=="function")throw Error("listener is a required param of {fn}() and should be a Function.".replace("{fn}",b));}function e(){this._bindings=[];this._prevParams=null;var a=this;this.dispatch=function(){e.prototype.dispatch.apply(a,arguments)}}h.prototype={active:!0,params:null,execute:function(a){var b;this.active&&this._listener&&(a=this.params?this.params.concat(a):
a,b=this._listener.apply(this.context,a),this._isOnce&&this.detach());return b},detach:function(){return this.isBound()?this._signal.remove(this._listener,this.context):null},isBound:function(){return!!this._signal&&!!this._listener},isOnce:function(){return this._isOnce},getListener:function(){return this._listener},getSignal:function(){return this._signal},_destroy:function(){delete this._signal;delete this._listener;delete this.context},toString:function(){return"[SignalBinding isOnce:"+this._isOnce+
", isBound:"+this.isBound()+", active:"+this.active+"]"}};e.prototype={VERSION:"1.0.0",memorize:!1,_shouldPropagate:!0,active:!0,_registerListener:function(a,b,c,d){var e=this._indexOfListener(a,c);if(e!==-1){if(a=this._bindings[e],a.isOnce()!==b)throw Error("You cannot add"+(b?"":"Once")+"() then add"+(!b?"":"Once")+"() the same listener without removing the relationship first.");}else a=new h(this,a,b,c,d),this._addBinding(a);this.memorize&&this._prevParams&&a.execute(this._prevParams);return a},
_addBinding:function(a){var b=this._bindings.length;do--b;while(this._bindings[b]&&a._priority<=this._bindings[b]._priority);this._bindings.splice(b+1,0,a)},_indexOfListener:function(a,b){for(var c=this._bindings.length,d;c--;)if(d=this._bindings[c],d._listener===a&&d.context===b)return c;return-1},has:function(a,b){return this._indexOfListener(a,b)!==-1},add:function(a,b,c){g(a,"add");return this._registerListener(a,!1,b,c)},addOnce:function(a,b,c){g(a,"addOnce");return this._registerListener(a,
!0,b,c)},remove:function(a,b){g(a,"remove");var c=this._indexOfListener(a,b);c!==-1&&(this._bindings[c]._destroy(),this._bindings.splice(c,1));return a},removeAll:function(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();this._bindings.length=0},getNumListeners:function(){return this._bindings.length},halt:function(){this._shouldPropagate=!1},dispatch:function(a){if(this.active){var b=Array.prototype.slice.call(arguments),c=this._bindings.length,d;if(this.memorize)this._prevParams=
b;if(c){d=this._bindings.slice();this._shouldPropagate=!0;do c--;while(d[c]&&this._shouldPropagate&&d[c].execute(b)!==!1)}}},forget:function(){this._prevParams=null},dispose:function(){this.removeAll();delete this._bindings;delete this._prevParams},toString:function(){return"[Signal active:"+this.active+" numListeners:"+this.getNumListeners()+"]"}};var f=e;f.Signal=e;typeof define==="function"&&define.amd?define(function(){return f}):typeof module!=="undefined"&&module.exports?module.exports=f:i.signals=
f})(this);
| xrmx/cdnjs | ajax/libs/js-signals/1.0.0/js-signals.min.js | JavaScript | mit | 3,231 |
/*
* /MathJax/jax/output/SVG/fonts/Gyre-Termes/Latin/Regular/Main.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed 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.
*/
MathJax.OutputJax.SVG.FONTDATA.FONTS.GyreTermesMathJax_Latin={directory:"Latin/Regular",family:"GyreTermesMathJax_Latin",id:"GYRETERMESLATIN",32:[0,0,250,0,0,""],160:[0,0,250,0,0,""],161:[459,226,333,96,203,"203 -149c0 -47 -20 -77 -53 -77c-34 0 -53 28 -53 80c0 14 1 25 2 37l45 383h13l9 -108c2 -25 8 -78 17 -138c11 -72 20 -154 20 -177zM203 407c0 -31 -23 -55 -53 -55s-54 25 -54 55s23 52 55 52c30 0 52 -22 52 -52"],162:[579,138,500,53,448,"448 156c-34 -70 -53 -97 -88 -127c-28 -24 -65 -38 -103 -38c-17 0 -32 2 -56 9l-49 -138h-34l51 150c-37 21 -52 34 -70 59c-29 40 -46 94 -46 148c0 135 96 241 220 241c14 0 27 -1 51 -5l44 124h35l-47 -135c48 -19 75 -49 75 -84c0 -26 -18 -45 -43 -45 s-40 13 -58 52l-101 -291c24 -9 39 -12 59 -12c59 0 95 25 147 100zM313 421c-18 7 -30 9 -47 9c-82 0 -136 -68 -136 -170c0 -72 19 -117 68 -162"],164:[602,-58,500,-22,522,"522 108l-48 -50l-98 98c-40 -28 -78 -41 -125 -41s-85 12 -127 41l-96 -98l-50 50l98 96c-29 42 -41 78 -41 126s12 86 41 126l-98 98l50 48l96 -96c44 28 79 39 127 39c49 0 86 -12 125 -39l98 96l48 -48l-96 -98c29 -43 39 -76 39 -125c0 -48 -10 -82 -39 -127z M397 332c0 83 -65 149 -148 149c-80 0 -146 -68 -146 -150c0 -84 66 -152 148 -152s146 67 146 153"],166:[662,156,200,67,133,"133 335h-66v327h66v-327zM133 -156h-66v327h66v-327"],169:[686,14,760,30,730,"730 336c0 -193 -157 -350 -350 -350s-350 157 -350 350s157 350 350 350s350 -157 350 -350zM692 336c0 172 -140 312 -312 312s-312 -140 -312 -312s140 -312 312 -312s312 140 312 312zM573 212c-38 -48 -102 -75 -174 -75c-127 0 -213 78 -213 196 c0 65 26 120 74 156c39 29 91 46 140 46c31 0 62 -5 93 -14c10 -3 19 -5 25 -5c12 0 21 7 24 19h17l5 -133h-17c-12 38 -21 54 -41 72c-25 23 -57 35 -93 35c-90 0 -146 -67 -146 -169c0 -66 21 -117 58 -145c25 -19 58 -29 94 -29c52 0 94 17 141 58"],170:[676,-349,276,4,270,"270 424c-23 -23 -37 -30 -59 -30c-27 0 -39 12 -45 44c-33 -30 -61 -44 -91 -44c-41 0 -71 28 -71 68c0 20 9 40 22 51c27 23 40 30 131 63v30c0 27 -13 42 -36 42c-22 0 -45 -12 -45 -23c0 -4 1 -9 2 -14c1 -3 1 -8 1 -8c0 -13 -15 -25 -31 -25c-18 0 -32 14 -32 31 c0 39 46 67 108 67c70 0 105 -32 105 -96v-115c0 -29 2 -35 13 -35c10 0 18 4 28 12v-18zM158 474v77c-70 -25 -91 -40 -91 -66c0 -24 17 -44 38 -44c13 0 25 3 42 11c8 7 11 14 11 22zM270 349h-266v28h266v-28"],171:[411,-33,500,57,468,"278 42c0 -5 -4 -9 -10 -9c-4 0 -6 1 -10 6c-57 56 -97 92 -170 156l-31 27l31 27c73 63 113 100 170 156c4 5 6 6 10 6c6 0 10 -4 10 -9c0 -12 -41 -77 -118 -170l-10 -12l10 -12c77 -92 118 -154 118 -166zM468 42c0 -5 -4 -9 -10 -9c-4 0 -6 1 -10 6 c-57 56 -97 92 -170 156l-31 27l31 27c73 63 113 100 170 156c4 5 6 6 10 6c6 0 10 -4 10 -9c0 -12 -41 -77 -118 -170l-10 -12l10 -12c77 -92 118 -154 118 -166"],182:[662,154,453,-22,450,"450 -154h-154v794h-58v-794h-154v22c78 5 88 17 88 101v304c-63 2 -91 10 -124 34c-47 32 -70 89 -70 170c0 130 62 185 209 185h263v-19c-77 -7 -88 -18 -88 -90v-595c0 -71 12 -84 88 -90v-22zM172 295v345c-40 -3 -57 -9 -75 -22c-29 -21 -43 -66 -43 -137 c0 -126 32 -177 118 -186"],184:[5,215,333,52,261,"261 -131c0 -52 -48 -84 -125 -84c-32 0 -55 4 -84 16l14 31c28 -9 44 -12 65 -12c34 0 55 17 55 44c0 26 -15 36 -53 36c-11 0 -20 -1 -28 -4l-7 5l41 104h35l-25 -70c10 2 16 3 26 3c54 0 86 -26 86 -69"],186:[676,-349,310,6,304,"304 542c0 -84 -66 -148 -153 -148c-84 0 -145 59 -145 139c0 85 62 143 153 143c85 0 145 -55 145 -134zM231 514c0 75 -33 129 -81 129c-43 0 -71 -29 -71 -74c0 -39 9 -79 25 -108c12 -22 31 -34 56 -34c46 0 71 31 71 87zM304 349h-298v28h298v-28"],187:[411,-33,500,45,456,"266 222l-31 -27c-73 -63 -113 -100 -170 -156c-4 -5 -6 -6 -10 -6c-6 0 -10 4 -10 9c0 12 41 77 118 170l10 12l-10 12c-77 92 -118 154 -118 166c0 5 4 9 10 9c4 0 6 -1 10 -6c57 -56 97 -92 170 -156zM456 222l-31 -27c-73 -63 -113 -100 -170 -156 c-4 -5 -6 -6 -10 -6c-6 0 -10 4 -10 9c0 12 41 77 118 170l10 12l-10 12c-77 92 -118 154 -118 166c0 5 4 9 10 9c4 0 6 -1 10 -6c57 -56 97 -92 170 -156"],191:[458,226,444,30,376,"376 -81c0 -83 -70 -145 -162 -145c-54 0 -113 23 -148 58c-23 23 -36 59 -36 97c0 41 13 77 45 126c14 21 14 21 60 77c37 47 54 87 65 154h17c-1 -44 -11 -93 -30 -142l-28 -64c-24 -55 -37 -110 -37 -156c0 -67 48 -120 108 -120c49 0 95 30 95 62c0 8 -5 17 -17 31 c-15 17 -21 29 -21 43c0 24 17 41 41 41c31 0 48 -22 48 -62zM260 407c0 -32 -23 -56 -53 -56c-29 0 -54 25 -54 55s23 52 55 52c30 0 52 -22 52 -51"],192:[851,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM445 712h-43 l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],193:[851,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM512 825 c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],194:[847,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM531 718h-48 l-125 79l-125 -79h-48l134 129h77"],195:[835,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM522 835 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],196:[832,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM308 782 c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM507 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],197:[896,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM457 796 c0 -55 -45 -99 -100 -99c-56 0 -99 44 -99 100c0 54 45 99 99 99c55 0 100 -45 100 -100zM423 796c0 36 -30 66 -65 66c-36 0 -66 -29 -66 -65s29 -66 64 -66c37 0 67 29 67 65"],198:[662,0,889,0,863,"863 168l-44 -168h-510v19l17 2c60 7 72 21 72 87v152h-176l-28 -53c-40 -78 -64 -136 -64 -158c0 -15 25 -26 68 -30h1v-19h-199v19c43 6 55 17 88 78l245 484c6 11 9 22 9 28c0 22 -25 31 -90 33v20h564v-141h-23c-13 91 -36 105 -182 105h-87c-19 0 -27 -8 -27 -30 v-230h111c63 0 98 9 114 30c10 15 14 30 18 67h21v-234h-21c-5 41 -9 56 -20 72c-13 18 -40 28 -78 28h-145v-238c0 -50 4 -53 69 -53h76c108 0 139 20 197 130h24zM398 299v319l-159 -319h159"],199:[676,215,667,28,633,"633 113c-61 -81 -160 -127 -273 -127c-8 0 -15 0 -24 1l-20 -52c10 2 16 3 26 3c54 0 86 -25 86 -69c0 -52 -48 -84 -125 -84c-31 0 -55 4 -84 16l14 31c27 -9 44 -12 65 -12c34 0 55 17 55 44c0 26 -15 36 -53 36c-12 0 -20 -1 -28 -4l-7 5l37 89 c-167 24 -274 153 -274 335c0 114 41 209 117 272c61 50 140 79 217 79c49 0 98 -8 147 -24c16 -6 30 -9 40 -9c19 0 35 12 41 33h21l9 -226h-23c-19 65 -34 93 -66 125c-40 40 -91 61 -149 61c-145 0 -238 -117 -238 -298c0 -116 33 -206 92 -255c42 -35 96 -53 156 -53 c83 0 149 30 223 101"],200:[851,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM370 712h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],201:[851,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM437 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],202:[847,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM456 718h-48l-125 79l-125 -79h-48l134 129h77"],203:[832,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM233 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM432 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],204:[851,0,333,12,315,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM254 712h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],205:[851,0,333,18,321,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM321 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],206:[847,0,333,-6,340,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM340 718h-48l-125 79l-125 -79h-48l134 129h77"],207:[832,0,333,18,316,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM117 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM316 782c0 -27 -23 -49 -51 -49 c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],208:[662,0,722,16,685,"685 334c0 -97 -37 -186 -102 -245c-62 -56 -167 -89 -283 -89h-284v19c76 5 88 18 88 90v206h-83v44h83v194c0 74 -9 83 -88 90v19h270c137 0 246 -36 314 -105c55 -55 85 -133 85 -223zM576 327c0 108 -41 194 -119 248c-48 34 -112 50 -201 50c-40 0 -50 -8 -50 -39 v-227h146v-44h-146v-237c0 -32 12 -41 52 -41c87 0 145 12 196 41c81 47 122 131 122 249"],209:[835,11,722,12,707,"707 643c-38 -4 -52 -8 -66 -18c-19 -13 -29 -50 -29 -110v-526h-17l-442 550v-392c0 -101 17 -124 94 -128v-19h-235v19c83 6 97 25 97 128v441c-40 47 -54 55 -97 55v19h171l385 -484v337c0 62 -9 98 -29 112c-15 9 -29 13 -67 16v19h235v-19zM525 835 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],210:[851,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM449 712h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],211:[851,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM516 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],212:[847,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM535 718h-48l-125 79l-125 -79h-48l134 129h77"],213:[835,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM526 835c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18 l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],214:[832,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM312 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM511 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50 c0 26 23 49 48 49c28 0 51 -23 51 -50"],216:[734,80,722,34,688,"688 331c0 -203 -135 -345 -329 -345c-67 0 -113 13 -175 50l-79 -116h-49l95 139c-42 38 -58 58 -76 93c-26 50 -41 115 -41 178c0 203 136 346 328 346c66 0 111 -13 175 -49l72 107h49l-88 -130c41 -38 58 -58 76 -93c27 -50 42 -115 42 -180zM574 330 c0 89 -13 145 -47 210l-308 -452c43 -47 84 -66 142 -66c132 0 213 117 213 308zM502 575c-44 46 -86 65 -141 65c-131 0 -213 -119 -213 -310c0 -88 12 -143 46 -207"],217:[851,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM474 712h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],218:[851,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM541 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],219:[847,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM560 718h-48l-125 79l-125 -79h-48l134 129h77"],220:[832,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM337 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM536 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],221:[851,0,722,22,703,"703 643c-51 -4 -77 -26 -138 -114l-148 -226v-194c0 -76 14 -88 103 -90v-19h-306v19c91 4 101 14 101 101v174l-131 192c-100 141 -114 155 -162 157v19h280v-19c-11 -1 -21 -1 -25 -1c-32 -2 -46 -11 -46 -29c0 -11 6 -28 17 -44l148 -222l143 226c9 15 14 27 14 37 c0 24 -17 32 -69 33v19h219v-19zM521 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],222:[662,0,556,16,542,"542 351c0 -66 -37 -127 -96 -159c-43 -24 -97 -34 -175 -34c-24 0 -42 1 -69 3v-52c0 -73 15 -87 94 -90v-19h-280v19c76 7 84 17 84 101v433c0 72 -10 82 -84 90v19h277v-19c-82 -7 -92 -20 -91 -111h80c160 0 260 -70 260 -181zM433 345c0 103 -61 149 -199 149 c-25 0 -32 -7 -32 -33v-260c23 -2 37 -3 57 -3c115 0 174 50 174 147"],223:[683,9,500,12,468,"468 186c0 -109 -79 -195 -179 -195c-57 0 -97 30 -97 73c0 27 19 48 45 48c22 0 40 -17 42 -40l2 -22c2 -22 10 -30 29 -30c42 0 64 45 64 130c0 135 -44 204 -132 207c-23 1 -32 6 -32 17c0 9 8 13 29 15c65 7 95 48 95 128c0 87 -34 139 -91 139 c-52 0 -86 -42 -86 -107v-549h-145v15c50 4 61 16 61 69v370c0 70 9 115 30 152c29 51 80 77 148 77c104 0 170 -60 170 -152c0 -72 -30 -105 -137 -154c61 -12 90 -23 122 -51c40 -34 62 -84 62 -140"],224:[675,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM298 504h-40l-154 97 c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],225:[675,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM375 643c0 -16 -9 -29 -30 -42 l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],226:[674,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM380 507h-34l-122 103l-121 -103 h-34l124 167h62"],227:[643,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM389 643 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],228:[640,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM175 590c0 -27 -23 -49 -51 -49 c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM374 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],229:[690,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM324 590c0 -55 -45 -99 -100 -99 c-56 0 -99 44 -99 100c0 54 45 99 99 99c55 0 100 -45 100 -100zM290 590c0 36 -30 66 -65 66c-36 0 -66 -29 -66 -65s29 -66 64 -66c37 0 67 29 67 65"],230:[460,10,667,38,632,"632 149c-27 -59 -46 -87 -73 -111c-36 -32 -77 -48 -124 -48c-57 0 -95 21 -129 73c-68 -56 -102 -73 -152 -73c-68 0 -116 45 -116 110c0 60 42 101 149 145l86 36l2 63c1 23 -4 54 -12 69c-7 14 -26 23 -50 23c-42 0 -73 -23 -68 -50c1 -3 1 -6 1 -6v-11l1 -17 c1 -29 -15 -48 -43 -48c-27 0 -44 19 -44 48c0 62 69 108 160 108c49 0 79 -12 117 -45c45 34 73 45 119 45c101 0 149 -54 160 -183h-262c1 -99 6 -131 27 -170c17 -30 54 -50 95 -50c57 0 96 27 144 97zM294 88l-1 3c-13 37 -19 74 -19 110v52 c-121 -44 -149 -68 -149 -128c0 -48 30 -87 67 -87s102 32 102 50zM521 307c-2 87 -25 124 -79 124c-57 0 -82 -36 -87 -124h166"],231:[460,215,444,25,412,"412 147c-52 -105 -105 -150 -186 -157l-21 -55c10 2 16 3 26 3c54 0 86 -25 86 -69c0 -52 -48 -84 -125 -84c-31 0 -55 4 -84 16l14 31c27 -9 44 -12 65 -12c34 0 55 17 55 44c0 26 -15 36 -53 36c-12 0 -20 -1 -28 -4l-7 5l38 91c-101 13 -167 101 -167 220 c0 83 29 152 84 197c40 33 88 51 135 51c84 0 154 -47 154 -103c0 -23 -21 -42 -47 -42c-22 0 -40 17 -48 46l-6 22c-10 37 -23 48 -59 48c-81 0 -136 -70 -136 -174c0 -115 63 -195 155 -195c57 0 93 24 141 94"],232:[675,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M308 504h-40l-154 97c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],233:[675,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M385 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],234:[674,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M390 507h-34l-122 103l-121 -103h-34l124 167h62"],235:[640,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M185 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM384 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],236:[675,0,278,-13,253,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM211 504h-40l-154 97c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],237:[675,0,278,16,288,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM288 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],238:[674,0,278,-18,293,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM293 507h-34l-122 103l-121 -103h-34l124 167h62"],239:[640,0,278,-11,287,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM88 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM287 590c0 -27 -23 -49 -51 -49 c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],241:[643,0,500,16,485,"485 0h-208v15c50 4 63 21 63 84v209c0 66 -24 97 -73 97c-33 0 -55 -12 -103 -57v-281c0 -36 15 -48 66 -52v-15h-212v15c51 4 62 18 62 75v248c0 49 -9 64 -37 64c-11 0 -21 -1 -27 -4v17c55 16 89 27 138 45l7 -2v-79c68 64 99 81 145 81c74 0 118 -56 118 -150v-229 c0 -49 12 -61 61 -66v-15zM417 643c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],242:[675,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM324 504h-40l-154 97 c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],243:[675,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM401 643c0 -16 -9 -29 -30 -42 l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],244:[674,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM406 507h-34l-122 103l-121 -103 h-34l124 167h62"],245:[643,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM415 643 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],246:[640,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM201 590c0 -27 -23 -49 -51 -49 c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM400 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],248:[551,112,500,29,470,"470 234c0 -139 -96 -244 -223 -244c-35 0 -58 5 -93 21l-65 -123h-37l73 140c-34 27 -47 42 -63 69c-21 38 -33 84 -33 130c0 136 91 233 220 233c33 0 57 -5 92 -18l57 109h39l-65 -125c31 -22 44 -34 60 -58c24 -38 38 -86 38 -134zM380 203c0 64 -11 108 -40 163 l-161 -306c25 -30 48 -42 82 -42c75 0 119 69 119 185zM317 396c-27 26 -49 36 -80 36c-71 0 -118 -62 -118 -156c0 -69 12 -127 39 -184"],249:[675,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M318 504h-40l-154 97c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],250:[675,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M395 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],251:[674,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M400 507h-34l-122 103l-121 -103h-34l124 167h62"],252:[640,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M195 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM394 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],253:[675,218,500,14,475,"475 435c-24 -3 -35 -13 -48 -45l-154 -408c-54 -144 -102 -200 -169 -200c-42 0 -74 25 -74 58c0 24 20 44 43 44c17 0 34 -4 53 -11c10 -5 19 -7 25 -7c14 0 36 19 50 45c17 30 40 93 40 108c0 8 -4 20 -11 37l-165 348c-8 17 -25 28 -51 32v14h206v-15 c-43 -2 -58 -9 -58 -27c0 -11 4 -24 10 -38l115 -253l97 276c3 7 4 13 4 17c0 16 -16 25 -48 25v15h135v-15zM431 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],254:[683,217,500,5,470,"470 247c0 -145 -92 -257 -210 -257c-42 0 -66 10 -101 43v-157c0 -63 13 -74 88 -75v-18h-242v18c59 5 70 16 70 68v704c0 42 -9 51 -49 51c-7 0 -11 0 -17 -1v16c69 19 97 27 145 44l5 -3v-298c45 54 89 78 144 78c97 0 167 -89 167 -213zM384 208 c0 116 -49 192 -123 192c-46 0 -102 -36 -102 -66v-246c0 -30 57 -66 104 -66c72 0 121 75 121 186"],255:[640,218,500,14,475,"475 435c-24 -3 -35 -13 -48 -45l-154 -408c-54 -144 -102 -200 -169 -200c-42 0 -74 25 -74 58c0 24 20 44 43 44c17 0 34 -4 53 -11c10 -5 19 -7 25 -7c14 0 36 19 50 45c17 30 40 93 40 108c0 8 -4 20 -11 37l-165 348c-8 17 -25 28 -51 32v14h206v-15 c-43 -2 -58 -9 -58 -27c0 -11 4 -24 10 -38l115 -253l97 276c3 7 4 13 4 17c0 16 -16 25 -48 25v15h135v-15zM231 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM430 590c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50 c0 26 23 49 48 49c28 0 51 -23 51 -50"],256:[809,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM513 755h-311v54 h311v-54"],257:[617,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM380 563h-311v54h311v-54"],258:[851,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM514 851 c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],259:[669,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM365 669 c-12 -106 -58 -157 -142 -157c-47 0 -87 19 -112 54c-19 28 -26 52 -27 103h29c14 -67 48 -97 112 -97c58 0 83 21 111 97h29"],260:[674,245,722,15,706,"706 -164c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104c15 21 34 39 55 55h-166v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20 l249 -568c35 -74 45 -84 90 -87v-19c-38 0 -76 -16 -95 -49c-15 -24 -24 -51 -24 -83c0 -36 16 -61 46 -61c26 0 42 23 54 43zM447 257l-116 275l-115 -275h231"],261:[460,245,444,37,442,"442 -164c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104c12 17 27 32 43 46c-33 3 -48 24 -53 72c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49 c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26c-17 -19 -31 -31 -45 -39c-34 -19 -57 -52 -68 -89 c-4 -13 -6 -28 -6 -44c0 -36 16 -61 46 -61c26 0 42 23 54 43zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53"],262:[851,14,667,28,633,"633 113c-61 -81 -160 -127 -273 -127c-199 0 -332 136 -332 339c0 114 41 209 117 272c61 50 140 79 217 79c49 0 98 -8 147 -24c16 -6 30 -9 40 -9c19 0 35 12 41 33h21l9 -226h-23c-19 65 -34 93 -66 125c-40 40 -91 61 -149 61c-145 0 -238 -117 -238 -298 c0 -116 33 -206 92 -255c42 -35 96 -53 156 -53c83 0 149 30 223 101zM517 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],263:[675,10,444,25,412,"412 147c-32 -62 -52 -91 -82 -115c-34 -28 -72 -42 -115 -42c-111 0 -190 93 -190 222c0 83 30 152 84 197c40 33 88 51 135 51c84 0 154 -47 154 -103c0 -23 -21 -42 -47 -42c-22 0 -40 17 -48 46l-6 22c-10 37 -23 48 -59 48c-81 0 -136 -70 -136 -174 c0 -115 63 -195 155 -195c57 0 93 24 141 94zM395 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],268:[847,14,667,28,633,"633 113c-61 -81 -160 -127 -273 -127c-199 0 -332 136 -332 339c0 114 41 209 117 272c61 50 140 79 217 79c49 0 98 -8 147 -24c16 -6 30 -9 40 -9c19 0 35 12 41 33h21l9 -226h-23c-19 65 -34 93 -66 125c-40 40 -91 61 -149 61c-145 0 -238 -117 -238 -298 c0 -116 33 -206 92 -255c42 -35 96 -53 156 -53c83 0 149 30 223 101zM535 847l-134 -129h-77l-135 129h48l125 -79l125 79h48"],269:[674,10,444,25,412,"412 147c-32 -62 -52 -91 -82 -115c-34 -28 -72 -42 -115 -42c-111 0 -190 93 -190 222c0 83 30 152 84 197c40 33 88 51 135 51c84 0 154 -47 154 -103c0 -23 -21 -42 -47 -42c-22 0 -40 17 -48 46l-6 22c-10 37 -23 48 -59 48c-81 0 -136 -70 -136 -174 c0 -115 63 -195 155 -195c57 0 93 24 141 94zM400 674l-125 -167h-62l-124 167h34l121 -103l122 103h34"],270:[847,0,722,16,685,"685 334c0 -97 -37 -186 -102 -245c-62 -56 -167 -89 -283 -89h-284v19c76 5 88 18 88 90v444c0 74 -9 83 -88 90v19h270c137 0 246 -36 314 -105c55 -55 85 -133 85 -223zM576 327c0 108 -41 194 -119 248c-48 34 -113 50 -199 50c-41 0 -52 -8 -52 -39v-508 c0 -32 12 -41 52 -41c87 0 145 12 196 41c81 47 122 131 122 249zM473 847l-134 -129h-77l-135 129h48l125 -79l125 79h48"],271:[683,10,500,27,603,"491 42l-147 -52l-4 3v64c-34 -47 -72 -67 -128 -67c-110 0 -185 87 -185 215c0 142 93 255 208 255c40 0 67 -11 105 -43v156c0 41 -9 51 -46 51c-8 0 -14 0 -22 -1v16c64 17 99 27 147 44l5 -2v-567c0 -46 8 -57 44 -57c3 0 5 0 23 1v-16zM340 102v230 c0 53 -49 100 -102 100c-76 0 -125 -74 -125 -187c0 -123 55 -203 138 -203c29 0 54 10 72 30c10 11 17 23 17 30zM603 594c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57 c45 0 80 -39 80 -89"],272:[662,0,722,16,685,"685 334c0 -97 -37 -186 -102 -245c-62 -56 -167 -89 -283 -89h-284v19c76 5 88 18 88 90v206h-83v44h83v194c0 74 -9 83 -88 90v19h270c137 0 246 -36 314 -105c55 -55 85 -133 85 -223zM576 327c0 108 -41 194 -119 248c-48 34 -112 50 -201 50c-40 0 -50 -8 -50 -39 v-227h146v-44h-146v-237c0 -32 12 -41 52 -41c87 0 145 12 196 41c81 47 122 131 122 249"],273:[683,10,500,27,500,"500 527h-76v-413c0 -46 8 -57 44 -57c3 0 5 0 23 1v-16l-147 -52l-4 3v64c-34 -47 -72 -67 -128 -67c-110 0 -185 87 -185 215c0 142 93 255 208 255c40 0 67 -11 105 -43v110h-121v34h121v12c0 41 -9 51 -46 51c-8 0 -14 0 -22 -1v16c64 17 99 27 147 44l5 -2v-120h76 v-34zM340 102v230c0 53 -49 100 -102 100c-76 0 -125 -74 -125 -187c0 -123 55 -203 138 -203c29 0 54 10 72 30c10 11 17 23 17 30"],274:[809,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM438 755h-311v54h311v-54"],275:[617,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M390 563h-311v54h311v-54"],278:[833,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM333 782c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],279:[641,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M285 590c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],280:[662,245,611,12,597,"597 169l-45 -169c-38 0 -76 -16 -95 -49c-15 -24 -24 -51 -24 -83c0 -36 16 -61 46 -61c26 0 42 23 54 43l19 -14c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104c15 21 34 39 55 55h-451v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143 h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27c143 0 186 24 236 132h28"],281:[460,245,444,25,424,"424 157c-17 -43 -39 -79 -65 -105c-32 -33 -77 -79 -90 -101c-15 -24 -24 -51 -24 -83c0 -36 16 -61 46 -61c26 0 42 23 54 43l19 -14c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104c14 20 33 38 53 54c-19 -6 -39 -9 -61 -9 c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204"],282:[847,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM455 847l-134 -129h-77l-135 129h48l125 -79l125 79h48"],283:[674,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M390 674l-125 -167h-62l-124 167h34l121 -103l122 103h34"],286:[851,14,722,32,709,"709 336c-58 -5 -70 -18 -70 -77v-203c-40 -35 -165 -70 -251 -70c-110 0 -206 38 -273 107c-56 59 -83 134 -83 232c0 204 143 351 343 351c45 0 91 -8 136 -23c18 -7 34 -10 44 -10c21 0 39 14 45 33h22l8 -211h-23c-25 61 -41 88 -71 116c-39 36 -88 55 -144 55 c-68 0 -130 -27 -174 -76s-72 -140 -72 -234c0 -186 100 -300 263 -300c72 0 133 27 133 59v162c0 43 -6 66 -21 75c-12 8 -24 11 -67 14v18h255v-18zM532 851c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],287:[669,218,500,28,470,"470 388h-83c14 -32 19 -55 19 -84c0 -50 -15 -85 -48 -113c-31 -27 -71 -42 -108 -42c-6 0 -19 1 -38 3c-3 0 -10 1 -19 2c-27 -8 -60 -43 -60 -63c0 -16 25 -25 78 -27l129 -6c74 -3 121 -45 121 -107c0 -38 -17 -70 -55 -101c-52 -42 -130 -68 -205 -68 c-95 0 -173 44 -173 97c0 37 27 70 98 122c-41 20 -53 32 -53 53c0 20 13 40 46 69l43 40c-66 33 -93 71 -93 134c0 91 74 163 167 163c26 0 53 -5 80 -15l22 -8c20 -7 35 -10 55 -10h77v-39zM433 -64c0 36 -33 49 -124 49c-49 0 -129 6 -162 13c-42 -50 -49 -63 -49 -86 c0 -44 58 -73 146 -73c113 0 189 39 189 97zM329 265c0 39 -12 85 -30 120c-16 30 -42 47 -73 47c-46 0 -74 -35 -74 -94v-3c0 -96 42 -161 102 -161c46 0 75 35 75 91zM377 669c-12 -106 -58 -157 -142 -157c-47 0 -87 19 -112 54c-19 28 -26 52 -27 103h29 c14 -67 48 -97 112 -97c58 0 83 21 111 97h29"],290:[676,281,722,32,709,"709 336c-58 -5 -70 -18 -70 -77v-203c-40 -35 -165 -70 -251 -70c-110 0 -206 38 -273 107c-56 59 -83 134 -83 232c0 204 143 351 343 351c45 0 91 -8 136 -23c18 -7 34 -10 44 -10c21 0 39 14 45 33h22l8 -211h-23c-25 61 -41 88 -71 116c-39 36 -88 55 -144 55 c-68 0 -130 -27 -174 -76s-72 -140 -72 -234c0 -186 100 -300 263 -300c72 0 133 27 133 59v162c0 43 -6 66 -21 75c-12 8 -24 11 -67 14v18h255v-18zM445 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2 c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],291:[733,218,500,28,470,"306 547c0 -34 -24 -57 -59 -57c-45 0 -80 39 -80 89c0 60 45 121 112 154l9 -19c-54 -37 -82 -74 -82 -106c0 -8 6 -14 14 -14c0 0 1 0 8 2c6 1 13 2 19 2c36 0 59 -19 59 -51zM470 388h-83c14 -32 19 -55 19 -84c0 -50 -15 -85 -48 -113c-31 -27 -71 -42 -108 -42 c-6 0 -19 1 -38 3c-3 0 -10 1 -19 2c-27 -8 -60 -43 -60 -63c0 -16 25 -25 78 -27l129 -6c74 -3 121 -45 121 -107c0 -38 -17 -70 -55 -101c-52 -42 -130 -68 -205 -68c-95 0 -173 44 -173 97c0 37 27 70 98 122c-41 20 -53 32 -53 53c0 20 13 40 46 69l43 40 c-66 33 -93 71 -93 134c0 91 74 163 167 163c26 0 53 -5 80 -15l22 -8c20 -7 35 -10 55 -10h77v-39zM433 -64c0 36 -33 49 -124 49c-49 0 -129 6 -162 13c-42 -50 -49 -63 -49 -86c0 -44 58 -73 146 -73c113 0 189 39 189 97zM329 265c0 39 -12 85 -30 120 c-16 30 -42 47 -73 47c-46 0 -74 -35 -74 -94v-3c0 -96 42 -161 102 -161c46 0 75 35 75 91"],296:[835,0,333,1,331,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM331 835c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101 c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],297:[643,0,278,-28,302,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM302 643c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101 c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],298:[809,0,333,11,322,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM322 755h-311v54h311v-54"],299:[617,0,278,-18,293,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM293 563h-311v54h311v-54"],302:[662,245,333,18,315,"315 -164c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104c15 21 34 39 55 55h-208v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19c-38 0 -76 -16 -95 -49c-15 -24 -24 -51 -24 -83 c0 -36 16 -61 46 -61c26 0 42 23 54 43"],303:[641,245,278,16,253,"253 0c-42 7 -83 -13 -105 -49c-15 -24 -24 -51 -24 -83c0 -36 16 -61 46 -61c26 0 42 23 54 43l19 -14c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104c15 21 34 39 55 55h-138v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1 v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM190 590c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],304:[833,0,333,18,315,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM217 782c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],306:[662,14,787,40,747,"337 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM747 643c-81 -6 -92 -17 -92 -90v-370c0 -125 -61 -197 -169 -197c-58 0 -99 30 -99 72c0 27 22 50 49 50c26 0 42 -16 52 -51 c7 -25 13 -33 27 -33c26 0 38 21 38 66v463c0 73 -11 84 -93 90v19h287v-19"],307:[641,218,535,40,504,"277 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM212 590c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51zM495 0c0 -142 -59 -218 -170 -218 c-54 0 -93 23 -93 55c0 22 18 39 41 39c16 0 30 -9 48 -32c17 -21 27 -28 42 -28c14 0 28 8 34 18c11 20 14 45 14 121v379c0 43 -9 60 -32 60c-10 0 -24 -1 -40 -3l-5 -1v16c59 18 97 31 156 54l5 -3v-457zM504 590c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51 c0 28 23 51 51 51c29 0 51 -23 51 -51"],310:[662,281,722,34,723,"723 0h-305v19c12 1 23 1 28 1c28 1 42 8 42 22c0 24 -54 95 -130 170l-106 105l-26 -21v-187c0 -73 12 -85 90 -90v-19h-282v19c79 5 90 18 90 101v433c0 71 -12 84 -90 90v19h284v-19c-81 -6 -92 -17 -92 -90v-205l177 161c55 51 78 81 78 103c0 20 -12 28 -42 30 c-4 0 -14 0 -26 1v19h262v-19c-68 -5 -84 -13 -152 -78l-190 -188l233 -250c91 -97 105 -107 157 -108v-19zM437 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57 c45 0 80 -39 80 -89"],311:[683,281,500,7,505,"505 0h-218v15h19c12 0 21 6 21 15c0 5 -3 11 -11 21c-3 3 -5 6 -7 9l-3 4l-140 187v-184c0 -35 15 -49 55 -51l20 -1v-15h-234v15c72 12 75 15 75 67v482c0 48 -10 61 -43 61c-10 0 -19 -1 -32 -2v16l30 8l125 36l4 -2v-420l137 122c14 12 23 26 23 34 c0 14 -11 18 -50 19v14h204v-15h-8c-17 0 -31 -2 -46 -6c-29 -8 -91 -54 -162 -120l-29 -27l153 -194c42 -51 73 -70 117 -73v-15zM334 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51 c0 34 24 57 59 57c45 0 80 -39 80 -89"],313:[851,0,611,12,598,"598 174l-48 -174h-538v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h282v-19c-79 -5 -93 -19 -93 -90v-473c0 -35 13 -41 86 -41h67c86 0 141 19 176 61c14 16 27 39 43 74h25zM308 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19 c24 0 38 -10 38 -26"],314:[872,0,278,19,283,"257 0h-236v15c63 5 77 18 77 72v477c0 47 -10 61 -42 61c-8 0 -20 -1 -31 -2h-6v16c69 17 107 27 159 44l4 -2v-597c0 -55 11 -65 75 -69v-15zM283 846c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],315:[662,281,611,12,598,"598 174l-48 -174h-538v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h282v-19c-79 -5 -93 -19 -93 -90v-473c0 -35 13 -41 86 -41h67c86 0 141 19 176 61c14 16 27 39 43 74h25zM375 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14 c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],316:[683,281,278,19,257,"257 0h-236v15c63 5 77 18 77 72v477c0 47 -10 61 -42 61c-8 0 -20 -1 -31 -2h-6v16c69 17 107 27 159 44l4 -2v-597c0 -55 11 -65 75 -69v-15zM210 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2 c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],317:[662,0,611,12,598,"598 174l-48 -174h-538v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h282v-19c-79 -5 -93 -19 -93 -90v-473c0 -35 13 -41 86 -41h67c86 0 141 19 176 61c14 16 27 39 43 74h25zM473 573c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14 c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],318:[683,0,278,19,361,"257 0h-236v15c63 5 77 18 77 72v477c0 47 -10 61 -42 61c-8 0 -20 -1 -31 -2h-6v16c69 17 107 27 159 44l4 -2v-597c0 -55 11 -65 75 -69v-15zM361 594c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2 c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],321:[662,0,611,12,598,"598 174l-48 -174h-538v19c73 5 87 19 87 90v145l-62 -57v51l62 57v248c0 71 -13 84 -87 90v19h282v-19c-79 -5 -93 -19 -93 -90v-174l125 115v-51l-125 -115v-248c0 -35 13 -41 86 -41h67c86 0 141 19 176 61c14 16 27 39 43 74h25"],322:[683,0,278,15,264,"264 486l-82 -77v-325c0 -55 11 -65 75 -69v-15h-236v15c63 5 77 18 77 72v253l-83 -78v46l83 78v178c0 47 -10 61 -42 61c-8 0 -20 -1 -31 -2h-6v16c69 17 107 27 159 44l4 -2v-226l82 77v-46"],323:[851,11,722,12,707,"707 643c-38 -4 -52 -8 -66 -18c-19 -13 -29 -50 -29 -110v-526h-17l-442 550v-392c0 -101 17 -124 94 -128v-19h-235v19c83 6 97 25 97 128v441c-40 47 -54 55 -97 55v19h171l385 -484v337c0 62 -9 98 -29 112c-15 9 -29 13 -67 16v19h235v-19zM515 825 c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],324:[675,0,500,16,485,"485 0h-208v15c50 4 63 21 63 84v209c0 66 -24 97 -73 97c-33 0 -55 -12 -103 -57v-281c0 -36 15 -48 66 -52v-15h-212v15c51 4 62 18 62 75v248c0 49 -9 64 -37 64c-11 0 -21 -1 -27 -4v17c55 16 89 27 138 45l7 -2v-79c68 64 99 81 145 81c74 0 118 -56 118 -150v-229 c0 -49 12 -61 61 -66v-15zM403 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],325:[662,281,722,12,707,"707 643c-38 -4 -52 -8 -66 -18c-19 -13 -29 -50 -29 -110v-526h-17l-442 550v-392c0 -101 17 -124 94 -128v-19h-235v19c83 6 97 25 97 128v441c-40 47 -54 55 -97 55v19h171l385 -484v337c0 62 -9 98 -29 112c-15 9 -29 13 -67 16v19h235v-19zM430 -127 c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],326:[460,281,500,16,485,"485 0h-208v15c50 4 63 21 63 84v209c0 66 -24 97 -73 97c-33 0 -55 -12 -103 -57v-281c0 -36 15 -48 66 -52v-15h-212v15c51 4 62 18 62 75v248c0 49 -9 64 -37 64c-11 0 -21 -1 -27 -4v17c55 16 89 27 138 45l7 -2v-79c68 64 99 81 145 81c74 0 118 -56 118 -150v-229 c0 -49 12 -61 61 -66v-15zM322 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],327:[847,11,722,12,707,"707 643c-38 -4 -52 -8 -66 -18c-19 -13 -29 -50 -29 -110v-526h-17l-442 550v-392c0 -101 17 -124 94 -128v-19h-235v19c83 6 97 25 97 128v441c-40 47 -54 55 -97 55v19h171l385 -484v337c0 62 -9 98 -29 112c-15 9 -29 13 -67 16v19h235v-19zM533 847l-134 -129h-77 l-135 129h48l125 -79l125 79h48"],328:[674,0,500,16,485,"485 0h-208v15c50 4 63 21 63 84v209c0 66 -24 97 -73 97c-33 0 -55 -12 -103 -57v-281c0 -36 15 -48 66 -52v-15h-212v15c51 4 62 18 62 75v248c0 49 -9 64 -37 64c-11 0 -21 -1 -27 -4v17c55 16 89 27 138 45l7 -2v-79c68 64 99 81 145 81c74 0 118 -56 118 -150v-229 c0 -49 12 -61 61 -66v-15zM408 674l-125 -167h-62l-124 167h34l121 -103l122 103h34"],330:[662,218,722,12,707,"707 643c-38 -4 -52 -8 -66 -18c-19 -13 -29 -50 -29 -110v-515c0 -142 -20 -218 -130 -218c-54 0 -94 23 -94 55c0 22 18 39 41 39c16 0 30 -9 48 -32c17 -21 27 -28 42 -28c14 0 28 8 34 18c11 20 14 45 14 121v67l-414 517v-392c0 -101 17 -124 94 -128v-19h-235v19 c83 6 97 25 97 128v441c-40 47 -54 55 -97 55v19h171l385 -484v337c0 62 -9 98 -29 112c-15 9 -29 13 -67 16v19h235v-19"],331:[460,218,500,16,424,"424 0c0 -142 -59 -218 -169 -218c-54 0 -94 23 -94 55c0 22 18 39 41 39c16 0 30 -9 48 -32c17 -21 27 -28 42 -28c14 0 28 8 34 18c11 20 14 45 14 121v353c0 66 -24 97 -73 97c-33 0 -55 -12 -103 -57v-281c0 -36 15 -48 66 -52v-15h-212v15c51 4 62 18 62 75v248 c0 49 -9 64 -37 64c-11 0 -21 -1 -27 -4v17c55 16 89 27 138 45l7 -2v-79c68 64 99 81 145 81c74 0 118 -56 118 -150v-310"],332:[809,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM517 755h-311v54h311v-54"],333:[617,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM406 563h-311v54h311v-54"],336:[851,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM666 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM506 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120 c20 15 30 19 46 19c24 0 38 -10 38 -26"],337:[676,10,500,29,511,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM511 644c0 -16 -9 -29 -30 -42 l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32zM345 644c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],338:[668,6,889,30,885,"885 168l-44 -168h-350l-121 -4l-58 -2c-74 0 -142 27 -192 77c-60 59 -90 143 -90 251c0 115 37 215 101 271c55 49 128 75 211 75c14 0 17 0 65 -3l105 -3h326v-141h-23c-12 89 -37 105 -168 105h-51c-56 0 -65 -3 -65 -24v-236h104c62 0 98 10 113 31 c11 15 16 30 19 67h21v-234h-21c-9 79 -29 99 -98 99h-138v-245c0 -37 12 -47 56 -46l124 2c63 2 99 33 150 128h24zM431 131v396c0 73 -30 105 -99 105c-121 0 -190 -111 -190 -307c0 -190 67 -294 189 -294c71 0 100 29 100 100"],339:[460,10,722,30,690,"690 139c-52 -108 -101 -149 -179 -149c-62 0 -98 27 -128 95c-38 -68 -79 -95 -147 -95c-121 0 -206 95 -206 228c0 76 29 150 75 194c34 31 77 48 127 48c62 0 102 -20 152 -76c41 56 76 76 130 76c50 0 98 -23 126 -62c23 -31 31 -60 34 -121h-254 c4 -87 13 -124 39 -170c18 -30 53 -50 90 -50c48 0 83 24 130 88zM343 199c0 149 -41 232 -114 232c-29 0 -53 -11 -75 -33c-20 -21 -34 -75 -34 -127c0 -169 41 -255 120 -255c68 0 103 63 103 183zM579 307v27c0 56 -33 97 -79 97c-53 0 -80 -41 -81 -124h160"],340:[851,0,667,17,659,"659 0h-161l-238 308l-56 -2v-197c0 -72 13 -85 90 -90v-19h-277v19c75 6 85 18 85 101v433c0 71 -10 82 -85 90v19h276c94 0 177 -26 215 -67c26 -29 39 -66 39 -109c0 -47 -19 -89 -51 -115c-33 -27 -63 -39 -130 -52l206 -253c29 -34 49 -44 87 -47v-19zM438 488 c0 94 -58 137 -183 137c-40 0 -51 -8 -51 -36v-246c96 2 131 8 177 34c36 19 57 61 57 111zM449 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],341:[675,0,333,5,335,"335 407c0 -28 -15 -45 -39 -45c-13 0 -24 6 -40 20c-11 10 -20 15 -26 15c-27 0 -70 -50 -70 -82v-225c0 -57 17 -72 85 -75v-15h-240v15c64 12 71 19 71 69v250c0 44 -9 60 -34 60c-12 0 -21 -1 -35 -4v16c59 19 95 32 148 54l5 -2v-92c49 71 78 94 120 94 c34 0 55 -20 55 -53zM311 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],342:[662,281,667,17,659,"659 0h-161l-238 308l-56 -2v-197c0 -72 13 -85 90 -90v-19h-277v19c75 6 85 18 85 101v433c0 71 -10 82 -85 90v19h276c94 0 177 -26 215 -67c26 -29 39 -66 39 -109c0 -47 -19 -89 -51 -115c-33 -27 -63 -39 -130 -52l206 -253c29 -34 49 -44 87 -47v-19zM438 488 c0 94 -58 137 -183 137c-40 0 -51 -8 -51 -36v-246c96 2 131 8 177 34c36 19 57 61 57 111zM364 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],343:[460,281,333,5,335,"335 407c0 -28 -15 -45 -39 -45c-13 0 -24 6 -40 20c-11 10 -20 15 -26 15c-27 0 -70 -50 -70 -82v-225c0 -57 17 -72 85 -75v-15h-240v15c64 12 71 19 71 69v250c0 44 -9 60 -34 60c-12 0 -21 -1 -35 -4v16c59 19 95 32 148 54l5 -2v-92c49 71 78 94 120 94 c34 0 55 -20 55 -53zM195 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],344:[847,0,667,17,659,"659 0h-161l-238 308l-56 -2v-197c0 -72 13 -85 90 -90v-19h-277v19c75 6 85 18 85 101v433c0 71 -10 82 -85 90v19h276c94 0 177 -26 215 -67c26 -29 39 -66 39 -109c0 -47 -19 -89 -51 -115c-33 -27 -63 -39 -130 -52l206 -253c29 -34 49 -44 87 -47v-19zM438 488 c0 94 -58 137 -183 137c-40 0 -51 -8 -51 -36v-246c96 2 131 8 177 34c36 19 57 61 57 111zM467 847l-134 -129h-77l-135 129h48l125 -79l125 79h48"],345:[674,0,333,5,335,"335 407c0 -28 -15 -45 -39 -45c-13 0 -24 6 -40 20c-11 10 -20 15 -26 15c-27 0 -70 -50 -70 -82v-225c0 -57 17 -72 85 -75v-15h-240v15c64 12 71 19 71 69v250c0 44 -9 60 -34 60c-12 0 -21 -1 -35 -4v16c59 19 95 32 148 54l5 -2v-92c49 71 78 94 120 94 c34 0 55 -20 55 -53zM316 674l-125 -167h-62l-124 167h34l121 -103l122 103h34"],346:[851,14,556,42,491,"491 168c0 -103 -88 -182 -204 -182c-40 0 -80 8 -118 23c-19 7 -36 11 -47 11c-15 0 -27 -14 -28 -33h-22l-30 212h23c50 -122 112 -177 202 -177c73 0 123 46 123 112c0 25 -5 45 -14 59c-25 38 -77 78 -149 117c-112 59 -156 115 -156 194c0 55 19 98 58 130 c32 26 74 42 113 42c35 0 71 -8 108 -22c18 -8 34 -12 44 -12c17 0 28 12 32 34h21l22 -213h-25c-16 59 -30 85 -61 117c-35 36 -77 55 -122 55c-62 0 -104 -37 -104 -92s42 -99 147 -156c132 -72 187 -136 187 -219zM416 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120 c20 15 30 19 46 19c24 0 38 -10 38 -26"],347:[675,10,389,51,348,"348 118c0 -70 -64 -128 -140 -128c-21 0 -46 4 -74 10c-24 6 -35 8 -46 8c-12 0 -16 -2 -23 -12h-13v156h16c23 -102 58 -140 127 -140c51 0 83 28 83 72c0 31 -17 55 -52 75l-58 33c-85 49 -117 88 -117 144c0 73 56 123 138 123c24 0 47 -4 68 -12c11 -5 21 -7 27 -7 c4 0 5 1 14 8l2 2h11l4 -136h-15c-23 90 -53 123 -110 123c-46 0 -77 -27 -77 -68c0 -27 15 -52 43 -68l108 -64c61 -36 84 -69 84 -119zM340 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],350:[676,225,556,42,491,"491 168c0 -97 -78 -172 -183 -181l-24 -62c10 2 16 3 26 3c54 0 86 -25 86 -69c0 -52 -48 -84 -125 -84c-31 0 -55 4 -84 16l14 31c27 -9 44 -12 65 -12c34 0 55 17 55 44c0 26 -15 36 -53 36c-12 0 -20 -1 -28 -4l-7 5l39 95c-35 2 -70 10 -103 23c-19 7 -36 11 -47 11 c-15 0 -27 -14 -28 -33h-22l-30 212h23c50 -122 112 -177 202 -177c73 0 123 46 123 112c0 25 -5 45 -14 59c-25 38 -77 78 -149 117c-112 59 -156 115 -156 194c0 55 19 98 58 130c32 26 74 42 113 42c35 0 71 -8 108 -22c18 -8 34 -12 44 -12c17 0 28 12 32 34h21l22 -213 h-25c-16 59 -30 85 -61 117c-35 36 -77 55 -122 55c-62 0 -104 -37 -104 -92s42 -99 147 -156c132 -72 187 -136 187 -219"],351:[459,215,389,51,348,"348 118c0 -70 -64 -128 -140 -128l-19 -55c10 2 16 3 26 3c54 0 86 -26 86 -69c0 -52 -48 -84 -125 -84c-32 0 -55 4 -84 16l14 31c28 -9 44 -12 65 -12c34 0 55 17 55 44c0 26 -15 36 -53 36c-11 0 -20 -1 -28 -4l-7 5l36 92c-13 1 -26 4 -40 7c-24 6 -35 8 -46 8 c-12 0 -16 -2 -23 -12h-13v156h16c23 -102 58 -140 127 -140c51 0 83 28 83 72c0 31 -17 55 -52 75l-58 33c-85 49 -117 88 -117 144c0 73 56 123 138 123c24 0 47 -4 68 -12c11 -5 21 -7 27 -7c4 0 5 1 14 8l2 2h11l4 -136h-15c-23 90 -53 123 -110 123 c-46 0 -77 -27 -77 -68c0 -27 15 -52 43 -68l108 -64c61 -36 84 -69 84 -119"],352:[847,14,556,42,491,"491 168c0 -103 -88 -182 -204 -182c-40 0 -80 8 -118 23c-19 7 -36 11 -47 11c-15 0 -27 -14 -28 -33h-22l-30 212h23c50 -122 112 -177 202 -177c73 0 123 46 123 112c0 25 -5 45 -14 59c-25 38 -77 78 -149 117c-112 59 -156 115 -156 194c0 55 19 98 58 130 c32 26 74 42 113 42c35 0 71 -8 108 -22c18 -8 34 -12 44 -12c17 0 28 12 32 34h21l22 -213h-25c-16 59 -30 85 -61 117c-35 36 -77 55 -122 55c-62 0 -104 -37 -104 -92s42 -99 147 -156c132 -72 187 -136 187 -219zM434 847l-134 -129h-77l-135 129h48l125 -79l125 79h48"],353:[674,10,389,34,348,"348 118c0 -70 -64 -128 -140 -128c-21 0 -46 4 -74 10c-24 6 -35 8 -46 8c-12 0 -16 -2 -23 -12h-13v156h16c23 -102 58 -140 127 -140c51 0 83 28 83 72c0 31 -17 55 -52 75l-58 33c-85 49 -117 88 -117 144c0 73 56 123 138 123c24 0 47 -4 68 -12c11 -5 21 -7 27 -7 c4 0 5 1 14 8l2 2h11l4 -136h-15c-23 90 -53 123 -110 123c-46 0 -77 -27 -77 -68c0 -27 15 -52 43 -68l108 -64c61 -36 84 -69 84 -119zM345 674l-125 -167h-62l-124 167h34l121 -103l122 103h34"],354:[662,225,611,17,593,"593 492h-24c-23 110 -45 128 -159 128h-54v-511c0 -73 14 -86 96 -90v-19h-124l-29 -75c10 2 16 3 26 3c54 0 86 -25 86 -69c0 -52 -48 -84 -125 -84c-31 0 -55 4 -84 16l14 31c27 -9 44 -12 65 -12c34 0 55 17 55 44c0 26 -15 36 -53 36c-12 0 -20 -1 -28 -4l-7 5 l45 109h-133v19c83 5 94 16 94 101v500h-54c-112 0 -135 -18 -159 -128h-24l6 170h564"],355:[579,215,278,13,279,"279 66c-28 -44 -59 -68 -98 -74l-22 -57c10 2 16 3 26 3c54 0 86 -25 86 -69c0 -52 -48 -84 -125 -84c-31 0 -55 4 -84 16l14 31c27 -9 44 -12 65 -12c34 0 55 17 55 44c0 26 -15 36 -53 36c-12 0 -20 -1 -28 -4l-7 5l37 90c-49 6 -75 48 -75 126v301h-53 c-3 2 -4 4 -4 7c0 6 6 12 17 19c26 15 60 52 97 107c7 9 14 18 20 28c5 0 7 -3 7 -13v-116h101v-32h-101v-286c0 -64 15 -90 52 -90c22 0 38 9 60 35"],356:[847,0,611,17,593,"593 492h-24c-23 110 -45 128 -159 128h-54v-511c0 -73 14 -86 96 -90v-19h-292v19c83 5 94 16 94 101v500h-54c-112 0 -135 -18 -159 -128h-24l6 170h564zM478 847l-134 -129h-77l-135 129h48l125 -79l125 79h48"],357:[713,10,278,13,313,"279 66c-33 -52 -71 -76 -121 -76c-58 0 -88 43 -88 127v301h-53c-3 2 -4 4 -4 7c0 6 6 12 17 19c26 15 60 52 97 107c7 9 14 18 20 28c5 0 7 -3 7 -13v-116h101v-32h-101v-286c0 -64 15 -90 52 -90c22 0 38 9 60 35zM313 624c0 -60 -45 -121 -112 -154l-9 19 c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],360:[835,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM551 835c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],361:[643,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M409 643c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],362:[809,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM542 755h-311v54h311v-54"],363:[617,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M400 563h-311v54h311v-54"],366:[896,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM486 796c0 -55 -45 -99 -100 -99c-56 0 -99 44 -99 100c0 54 45 99 99 99c55 0 100 -45 100 -100zM452 796c0 36 -30 66 -65 66c-36 0 -66 -29 -66 -65s29 -66 64 -66c37 0 67 29 67 65"],367:[690,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M344 590c0 -55 -45 -99 -100 -99c-56 0 -99 44 -99 100c0 54 45 99 99 99c55 0 100 -45 100 -100zM310 590c0 36 -30 66 -65 66c-36 0 -66 -29 -66 -65s29 -66 64 -66c37 0 67 29 67 65"],368:[851,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM691 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM531 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],369:[676,10,500,9,505,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M505 644c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32zM339 644c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],370:[662,245,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-23 -41 -60 -70 -109 -86c-33 -12 -70 -24 -87 -52c-14 -24 -23 -51 -23 -83c0 -36 16 -61 46 -61c26 0 42 23 54 43l19 -14c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104 c10 15 24 29 38 41h-17c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19"],371:[450,245,500,9,479,"479 36l-29 -8c-41 -12 -74 -40 -96 -77c-15 -24 -24 -51 -24 -83c0 -36 16 -61 46 -61c26 0 42 23 54 43l19 -14c-18 -39 -46 -81 -103 -81c-43 0 -77 38 -77 86c0 40 14 75 36 104c12 16 23 32 33 48v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252 c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14"],376:[832,0,722,22,703,"703 643c-51 -4 -77 -26 -138 -114l-148 -226v-194c0 -76 14 -88 103 -90v-19h-306v19c91 4 101 14 101 101v174l-131 192c-100 141 -114 155 -162 157v19h280v-19c-11 -1 -21 -1 -25 -1c-32 -2 -46 -11 -46 -29c0 -11 6 -28 17 -44l148 -222l143 226c9 15 14 27 14 37 c0 24 -17 32 -69 33v19h219v-19zM317 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50zM516 782c0 -27 -23 -49 -51 -49c-27 0 -48 22 -48 50c0 26 23 49 48 49c28 0 51 -23 51 -50"],377:[851,0,611,9,597,"597 176l-24 -176h-564v15l437 609h-221c-66 0 -111 -14 -134 -43c-17 -21 -25 -41 -34 -90h-26l20 171h526v-15l-432 -609h257c57 0 101 14 125 39c20 22 30 43 47 99h23zM469 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],378:[675,0,444,27,418,"418 135l-14 -135h-377v15l266 405h-138c-60 0 -75 -15 -84 -88h-18l3 118h347v-15l-269 -405h138c51 0 85 9 99 26c13 17 19 33 29 83zM380 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],379:[833,0,611,9,597,"597 176l-24 -176h-564v15l437 609h-221c-66 0 -111 -14 -134 -43c-17 -21 -25 -41 -34 -90h-26l20 171h526v-15l-432 -609h257c57 0 101 14 125 39c20 22 30 43 47 99h23zM365 782c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],380:[641,0,444,27,418,"418 135l-14 -135h-377v15l266 405h-138c-60 0 -75 -15 -84 -88h-18l3 118h347v-15l-269 -405h138c51 0 85 9 99 26c13 17 19 33 29 83zM280 590c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],381:[847,0,611,9,597,"597 176l-24 -176h-564v15l437 609h-221c-66 0 -111 -14 -134 -43c-17 -21 -25 -41 -34 -90h-26l20 171h526v-15l-432 -609h257c57 0 101 14 125 39c20 22 30 43 47 99h23zM487 847l-134 -129h-77l-135 129h48l125 -79l125 79h48"],382:[674,0,444,27,418,"418 135l-14 -135h-377v15l266 405h-138c-60 0 -75 -15 -84 -88h-18l3 118h347v-15l-269 -405h138c51 0 85 9 99 26c13 17 19 33 29 83zM385 674l-125 -167h-62l-124 167h34l121 -103l122 103h34"],383:[683,0,333,20,383,"383 621c0 -23 -19 -41 -42 -41c-17 0 -29 10 -45 36c-18 29 -32 39 -53 39c-38 0 -56 -31 -56 -89v-462c0 -75 11 -86 93 -89v-15h-260v15c72 4 83 16 83 89v314h-52v32h52c1 80 9 116 35 160c26 46 79 73 141 73c60 0 104 -26 104 -62"],402:[676,189,500,7,490,"490 608c0 -25 -21 -45 -46 -45c-20 0 -38 16 -38 34c0 6 3 15 8 24c3 6 5 11 5 14c0 7 -8 12 -20 12c-16 0 -30 -6 -41 -17c-19 -20 -38 -84 -44 -147l-8 -76h126l-10 -31h-120l-16 -125c-24 -185 -41 -265 -72 -335c-33 -72 -72 -105 -127 -105c-47 0 -80 29 -80 69 c0 26 19 45 46 45c22 0 36 -14 36 -36c0 -9 -3 -16 -9 -27c-4 -7 -6 -11 -6 -14c0 -7 9 -13 21 -13c45 0 72 58 82 174l15 172c5 53 11 109 12 113l11 67l2 15h-111l10 31h107c16 104 33 152 71 208c26 38 69 61 111 61c47 0 85 -30 85 -68"],416:[771,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c63 0 121 -15 171 -46c17 3 39 21 39 31c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66c0 -41 -34 -76 -81 -90c18 -13 34 -28 49 -44 c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180"],417:[559,10,500,29,473,"473 493c0 -39 -31 -73 -74 -88c44 -41 71 -101 71 -171c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c48 0 92 -14 127 -38v2c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM380 199c0 137 -59 233 -143 233 c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181"],431:[771,14,706,14,706,"706 705c0 -45 -42 -84 -95 -94v-357c0 -189 -82 -268 -256 -268c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -147 55 -203 172 -203c75 0 139 31 166 79c16 29 23 68 23 136v270c0 100 -16 122 -94 128v19h138v-26 c12 5 30 14 30 25c0 18 -43 28 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66"],432:[560,10,513,9,513,"513 494c0 -45 -42 -84 -96 -94v-293c0 -46 11 -57 57 -57h5v-14c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c40 0 107 20 107 87v235c0 50 -12 60 -74 63v17 h158v-25c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66"],536:[676,281,556,42,491,"491 168c0 -103 -88 -182 -204 -182c-40 0 -80 8 -118 23c-19 7 -36 11 -47 11c-15 0 -27 -14 -28 -33h-22l-30 212h23c50 -122 112 -177 202 -177c73 0 123 46 123 112c0 25 -5 45 -14 59c-25 38 -77 78 -149 117c-112 59 -156 115 -156 194c0 55 19 98 58 130 c32 26 74 42 113 42c35 0 71 -8 108 -22c18 -8 34 -12 44 -12c17 0 28 12 32 34h21l22 -213h-25c-16 59 -30 85 -61 117c-35 36 -77 55 -122 55c-62 0 -104 -37 -104 -92s42 -99 147 -156c132 -72 187 -136 187 -219zM331 -127c0 -60 -45 -121 -112 -154l-9 19 c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],537:[459,281,389,51,348,"348 118c0 -70 -64 -128 -140 -128c-21 0 -46 4 -74 10c-24 6 -35 8 -46 8c-12 0 -16 -2 -23 -12h-13v156h16c23 -102 58 -140 127 -140c51 0 83 28 83 72c0 31 -17 55 -52 75l-58 33c-85 49 -117 88 -117 144c0 73 56 123 138 123c24 0 47 -4 68 -12c11 -5 21 -7 27 -7 c4 0 5 1 14 8l2 2h11l4 -136h-15c-23 90 -53 123 -110 123c-46 0 -77 -27 -77 -68c0 -27 15 -52 43 -68l108 -64c61 -36 84 -69 84 -119zM259 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2 c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],538:[662,281,611,17,593,"593 492h-24c-23 110 -45 128 -159 128h-54v-511c0 -73 14 -86 96 -90v-19h-292v19c83 5 94 16 94 101v500h-54c-112 0 -135 -18 -159 -128h-24l6 170h564zM375 -127c0 -60 -45 -121 -112 -154l-9 19c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2 c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],539:[579,281,278,13,279,"279 66c-33 -52 -71 -76 -121 -76c-58 0 -88 43 -88 127v301h-53c-3 2 -4 4 -4 7c0 6 6 12 17 19c26 15 60 52 97 107c7 9 14 18 20 28c5 0 7 -3 7 -13v-116h101v-32h-101v-286c0 -64 15 -90 52 -90c22 0 38 9 60 35zM224 -127c0 -60 -45 -121 -112 -154l-9 19 c54 37 82 74 82 106c0 8 -6 14 -14 14c0 0 -1 0 -8 -2c-6 -1 -13 -2 -19 -2c-36 0 -59 19 -59 51c0 34 24 57 59 57c45 0 80 -39 80 -89"],7840:[674,191,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM412 -140 c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7841:[460,191,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM275 -140c0 -29 -22 -51 -51 -51 c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7842:[896,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM456 838 c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53 c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7843:[684,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM323 626c0 -20 -15 -38 -42 -59 c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22 c13 -12 20 -24 20 -36"],7844:[1006,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM492 980 c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM531 718h-48l-125 79l-125 -79h-48l134 129h77"],7845:[794,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM359 768c0 -13 -10 -24 -32 -33 l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM398 506h-48l-125 79l-125 -79h-48l134 129h77"],7846:[1006,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM465 867h-43 l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM531 718h-48l-125 79l-125 -79h-48l134 129h77"],7847:[794,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM332 655h-43l-167 80 c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM398 506h-48l-125 79l-125 -79h-48l134 129h77"],7848:[1020,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM531 972 c0 -16 -17 -32 -46 -49c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17c-24 0 -37 8 -37 26c0 26 43 45 106 45 c39 0 68 -7 87 -18c15 -10 22 -20 22 -30zM531 718h-48l-125 79l-125 -79h-48l134 129h77"],7849:[808,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM398 760c0 -16 -17 -32 -46 -49 c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17c-24 0 -37 8 -37 26c0 26 43 45 106 45c39 0 68 -7 87 -18 c15 -10 22 -20 22 -30zM398 506h-48l-125 79l-125 -79h-48l134 129h77"],7850:[983,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM522 983 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM531 718h-48l-125 79l-125 -79h-48l134 129h77"],7851:[771,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM389 771 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM398 506h-48l-125 79l-125 -79h-48l134 129h77"],7852:[847,191,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM531 718h-48 l-125 79l-125 -79h-48l134 129h77zM412 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7853:[674,191,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM380 507h-34l-122 103l-121 -103 h-34l124 167h62zM275 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7854:[1010,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM532 984 c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM514 851c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],7855:[798,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM399 772c0 -13 -10 -24 -32 -33 l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM381 639c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],7856:[1010,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM425 871h-43 l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM514 851c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],7857:[798,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM292 659h-43l-167 80 c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM381 639c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],7858:[984,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM465 936 c0 -16 -17 -32 -46 -49c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17c-24 0 -37 8 -37 26c0 26 43 45 106 45 c39 0 68 -7 87 -18c15 -10 22 -20 22 -30zM514 851c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],7859:[772,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM332 724c0 -16 -17 -32 -46 -49 c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17c-24 0 -37 8 -37 26c0 26 43 45 106 45c39 0 68 -7 87 -18 c15 -10 22 -20 22 -30zM381 639c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26"],7860:[984,0,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM522 984 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM514 851c0 -70 -62 -138 -156 -138s-156 68 -156 138h26 c16 -58 68 -82 130 -82s114 24 130 82h26"],7861:[772,10,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM389 772 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM381 639c0 -70 -62 -138 -156 -138s-156 68 -156 138h26 c16 -58 68 -82 130 -82s114 24 130 82h26"],7862:[851,191,722,15,706,"706 0h-255v19c36 0 44 2 56 9c8 4 14 15 14 24c0 15 -7 40 -19 68l-41 96h-262l-46 -117c-5 -13 -8 -27 -8 -39c0 -28 20 -41 68 -41v-19h-198v19c48 3 60 18 124 164l208 491h20l249 -568c35 -74 45 -84 90 -87v-19zM447 257l-116 275l-115 -275h231zM514 851 c0 -70 -62 -138 -156 -138s-156 68 -156 138h26c16 -58 68 -82 130 -82s114 24 130 82h26zM412 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7863:[669,191,444,37,442,"442 40c-35 -38 -56 -50 -90 -50c-41 0 -59 20 -64 73c-61 -52 -102 -73 -146 -73c-62 0 -105 44 -105 107c0 33 14 67 36 87c43 38 60 46 214 108v61c0 54 -27 83 -76 83c-40 0 -72 -22 -72 -49c0 -7 1 -15 3 -24c1 -7 2 -12 2 -16c0 -22 -21 -42 -45 -42s-43 20 -43 43 c0 25 16 54 41 75c28 23 76 37 127 37c61 0 104 -20 125 -58c14 -23 19 -51 19 -102v-195c0 -44 7 -58 30 -58c15 0 27 5 44 19v-26zM287 123v145c-121 -44 -162 -80 -162 -139v-4c0 -43 28 -77 63 -77c21 0 49 8 73 22c21 13 26 22 26 53zM365 669 c-12 -106 -58 -157 -142 -157c-47 0 -87 19 -112 54c-19 28 -26 52 -27 103h29c14 -67 48 -97 112 -97c58 0 83 21 111 97h29zM275 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7864:[662,191,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM356 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7865:[460,191,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M285 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7866:[896,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM381 838c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19 c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7867:[684,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M333 626c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53 c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7868:[835,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM447 835c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],7869:[643,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M399 643c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],7870:[1006,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM417 980c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM456 718h-48l-125 79l-125 -79h-48l134 129h77"],7871:[794,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M369 768c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM408 506h-48l-125 79l-125 -79h-48l134 129h77"],7872:[1006,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM390 867h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM456 718h-48l-125 79l-125 -79h-48l134 129h77"],7873:[794,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M342 655h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM408 506h-48l-125 79l-125 -79h-48l134 129h77"],7874:[1020,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM456 972c0 -16 -17 -32 -46 -49c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17 c-24 0 -37 8 -37 26c0 26 43 45 106 45c39 0 68 -7 87 -18c15 -10 22 -20 22 -30zM456 718h-48l-125 79l-125 -79h-48l134 129h77"],7875:[808,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M408 760c0 -16 -17 -32 -46 -49c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17c-24 0 -37 8 -37 26c0 26 43 45 106 45 c39 0 68 -7 87 -18c15 -10 22 -20 22 -30zM408 506h-48l-125 79l-125 -79h-48l134 129h77"],7876:[983,0,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM447 983c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM456 718h-48l-125 79l-125 -79h-48 l134 129h77"],7877:[771,10,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M399 771c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM408 506h-48l-125 79l-125 -79h-48l134 129h77"],7878:[847,191,611,12,597,"597 169l-45 -169h-540v19c73 5 87 19 87 90v444c0 71 -13 84 -87 90v19h531l3 -143h-25c-17 90 -39 105 -152 105h-135c-27 0 -33 -6 -33 -34v-222h154c81 0 97 13 110 95h23v-232h-23c-13 83 -28 96 -110 96h-154v-247c0 -19 2 -28 8 -32c9 -7 49 -11 97 -11h27 c143 0 186 24 236 132h28zM456 718h-48l-125 79l-125 -79h-48l134 129h77zM356 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7879:[674,191,444,25,424,"424 157c-42 -108 -116 -167 -212 -167c-115 0 -187 86 -187 224c0 146 85 246 209 246c52 0 98 -21 128 -57c25 -32 35 -61 43 -126h-308c2 -64 10 -99 30 -138c29 -54 71 -80 126 -80c64 0 107 29 155 105zM303 309c-13 87 -37 115 -98 115s-95 -36 -106 -115h204z M390 507h-34l-122 103l-121 -103h-34l124 167h62zM285 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7880:[896,0,333,18,315,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM265 838c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42 c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7881:[684,0,278,16,253,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM236 626c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47 c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7882:[662,191,333,18,315,"315 0h-297v19c84 3 97 15 97 90v444c0 74 -12 85 -97 90v19h297v-19c-84 -4 -98 -17 -98 -90v-444c0 -73 16 -87 98 -90v-19zM217 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7883:[641,191,278,16,253,"253 0h-237v15c69 4 79 15 79 87v232c0 44 -9 60 -33 60c-9 0 -22 -1 -34 -3l-8 -1v15l155 55l4 -3v-355c0 -72 8 -82 74 -87v-15zM188 590c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51zM190 -140c0 -29 -22 -51 -51 -51 c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7884:[676,191,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM412 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7885:[460,191,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM301 -140c0 -29 -22 -51 -51 -51 c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7886:[896,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM460 838c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42 c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7887:[684,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM349 626c0 -20 -15 -38 -42 -59 c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22 c13 -12 20 -24 20 -36"],7888:[1006,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM496 980c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM535 718h-48l-125 79l-125 -79h-48l134 129h77"],7889:[794,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM385 768c0 -13 -10 -24 -32 -33 l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26zM424 506h-48l-125 79l-125 -79h-48l134 129h77"],7890:[1006,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM469 867h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM535 718h-48l-125 79l-125 -79h-48l134 129h77"],7891:[794,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM358 655h-43l-167 80 c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19zM424 506h-48l-125 79l-125 -79h-48l134 129h77"],7892:[1020,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM535 972c0 -16 -17 -32 -46 -49c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34 c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17c-24 0 -37 8 -37 26c0 26 43 45 106 45c39 0 68 -7 87 -18c15 -10 22 -20 22 -30zM535 718h-48l-125 79l-125 -79h-48l134 129h77"],7893:[808,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM424 760c0 -16 -17 -32 -46 -49 c-25 -14 -42 -25 -45 -32c-5 -6 -9 -14 -11 -24h-25c1 21 14 42 36 63c18 17 25 29 25 39c0 23 -18 34 -55 34c-17 0 -30 -2 -39 -8c-3 -2 -6 -3 -6 -6c0 -4 18 -17 18 -23c0 -11 -9 -17 -30 -17c-24 0 -37 8 -37 26c0 26 43 45 106 45c39 0 68 -7 87 -18 c15 -10 22 -20 22 -30zM424 506h-48l-125 79l-125 -79h-48l134 129h77"],7894:[983,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM526 983c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18 l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM535 718h-48l-125 79l-125 -79h-48l134 129h77"],7895:[771,10,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM415 771 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29zM424 506h-48l-125 79l-125 -79h-48l134 129h77"],7896:[847,191,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c96 0 180 -36 243 -105c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246 c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM535 718h-48l-125 79l-125 -79h-48l134 129h77zM412 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7897:[674,191,500,29,470,"470 234c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c128 0 220 -95 220 -226zM380 199c0 137 -59 233 -143 233c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM406 507h-34l-122 103l-121 -103 h-34l124 167h62zM301 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7898:[851,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c63 0 121 -15 171 -46c17 3 39 21 39 31c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66c0 -41 -34 -76 -81 -90c18 -13 34 -28 49 -44 c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM488 825 c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],7899:[675,10,500,29,473,"473 493c0 -39 -31 -73 -74 -88c44 -41 71 -101 71 -171c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c48 0 92 -14 127 -38v2c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM380 199c0 137 -59 233 -143 233 c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM373 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],7900:[851,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c63 0 121 -15 171 -46c17 3 39 21 39 31c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66c0 -41 -34 -76 -81 -90c18 -13 34 -28 49 -44 c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM421 712h-43l-167 80 c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],7901:[675,10,500,29,473,"473 493c0 -39 -31 -73 -74 -88c44 -41 71 -101 71 -171c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c48 0 92 -14 127 -38v2c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM380 199c0 137 -59 233 -143 233 c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM296 504h-40l-154 97c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],7902:[896,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c63 0 121 -15 171 -46c17 3 39 21 39 31c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66c0 -41 -34 -76 -81 -90c18 -13 34 -28 49 -44 c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM432 838 c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53 c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7903:[684,10,500,29,473,"473 493c0 -39 -31 -73 -74 -88c44 -41 71 -101 71 -171c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c48 0 92 -14 127 -38v2c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM380 199c0 137 -59 233 -143 233 c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM321 626c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10 c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7904:[835,14,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c63 0 121 -15 171 -46c17 3 39 21 39 31c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66c0 -41 -34 -76 -81 -90c18 -13 34 -28 49 -44 c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM498 835 c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],7905:[643,10,500,29,473,"473 493c0 -39 -31 -73 -74 -88c44 -41 71 -101 71 -171c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c48 0 92 -14 127 -38v2c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM380 199c0 137 -59 233 -143 233 c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM387 643c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12 c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],7906:[771,191,722,34,688,"688 327c0 -201 -136 -341 -333 -341c-88 0 -177 39 -235 102c-54 58 -86 149 -86 243c0 201 136 345 327 345c63 0 121 -15 171 -46c17 3 39 21 39 31c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66c0 -41 -34 -76 -81 -90c18 -13 34 -28 49 -44 c55 -60 84 -145 84 -244zM574 328c0 119 -31 213 -85 262c-36 32 -82 50 -128 50c-55 0 -104 -22 -143 -65c-42 -47 -70 -144 -70 -246c0 -111 33 -212 85 -258c35 -31 80 -49 126 -49c53 0 98 18 133 53c23 23 40 48 49 73c20 52 33 121 33 180zM384 -140 c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7907:[559,191,500,29,473,"473 493c0 -39 -31 -73 -74 -88c44 -41 71 -101 71 -171c0 -138 -96 -244 -222 -244s-219 101 -219 236c0 138 91 234 221 234c48 0 92 -14 127 -38v2c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM380 199c0 137 -59 233 -143 233 c-71 0 -118 -62 -118 -157c0 -71 16 -141 44 -193c21 -40 58 -64 97 -64c75 0 120 68 120 181zM273 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7908:[662,191,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM437 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7909:[450,191,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M295 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7910:[896,14,722,14,705,"705 643c-82 -10 -94 -26 -94 -128v-261c0 -77 -9 -123 -33 -165c-39 -68 -114 -103 -223 -103c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -63 7 -100 25 -132c27 -47 76 -71 147 -71c75 0 139 31 166 79 c16 30 23 68 23 136v270c0 100 -16 122 -94 128v19h232v-19zM485 838c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29 c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7911:[684,10,500,9,479,"479 36c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c31 0 62 12 90 36c12 9 17 24 17 51v235c0 50 -12 60 -74 63v17h158v-343c0 -46 11 -57 57 -57h5v-14z M343 626c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53 c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7912:[851,14,706,14,706,"706 705c0 -45 -42 -84 -95 -94v-357c0 -189 -82 -268 -256 -268c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -147 55 -203 172 -203c75 0 139 31 166 79c16 29 23 68 23 136v270c0 100 -16 122 -94 128v19h138v-26 c12 5 30 14 30 25c0 18 -43 28 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM513 825c0 -13 -10 -24 -32 -33l-167 -80h-43l158 120c20 15 30 19 46 19c24 0 38 -10 38 -26"],7913:[675,10,513,9,513,"513 494c0 -45 -42 -84 -96 -94v-293c0 -46 11 -57 57 -57h5v-14c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c40 0 107 20 107 87v235c0 50 -12 60 -74 63v17 h158v-25c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM367 643c0 -16 -9 -29 -30 -42l-154 -97h-40l147 148c18 18 27 23 42 23c22 0 35 -12 35 -32"],7914:[851,14,706,14,706,"706 705c0 -45 -42 -84 -95 -94v-357c0 -189 -82 -268 -256 -268c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -147 55 -203 172 -203c75 0 139 31 166 79c16 29 23 68 23 136v270c0 100 -16 122 -94 128v19h138v-26 c12 5 30 14 30 25c0 18 -43 28 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM446 712h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],7915:[675,10,513,9,513,"513 494c0 -45 -42 -84 -96 -94v-293c0 -46 11 -57 57 -57h5v-14c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c40 0 107 20 107 87v235c0 50 -12 60 -74 63v17 h158v-25c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM290 504h-40l-154 97c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],7916:[896,14,706,14,706,"706 705c0 -45 -42 -84 -95 -94v-357c0 -189 -82 -268 -256 -268c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -147 55 -203 172 -203c75 0 139 31 166 79c16 29 23 68 23 136v270c0 100 -16 122 -94 128v19h138v-26 c12 5 30 14 30 25c0 18 -43 28 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM457 838c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8 c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7917:[684,10,513,9,513,"513 494c0 -45 -42 -84 -96 -94v-293c0 -46 11 -57 57 -57h5v-14c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c40 0 107 20 107 87v235c0 50 -12 60 -74 63v17 h158v-25c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM315 626c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8 c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7918:[835,14,706,14,706,"706 705c0 -45 -42 -84 -95 -94v-357c0 -189 -82 -268 -256 -268c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -147 55 -203 172 -203c75 0 139 31 166 79c16 29 23 68 23 136v270c0 100 -16 122 -94 128v19h138v-26 c12 5 30 14 30 25c0 18 -43 28 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM523 835c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15 c23 0 36 12 53 50h29"],7919:[643,10,513,9,513,"513 494c0 -45 -42 -84 -96 -94v-293c0 -46 11 -57 57 -57h5v-14c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c40 0 107 20 107 87v235c0 50 -12 60 -74 63v17 h158v-25c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM381 643c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15 c23 0 36 12 53 50h29"],7920:[771,191,706,14,706,"706 705c0 -45 -42 -84 -95 -94v-357c0 -189 -82 -268 -256 -268c-170 0 -251 82 -251 255v312c0 73 -11 84 -90 90v19h283v-19c-80 -7 -91 -18 -91 -90v-320c0 -147 55 -203 172 -203c75 0 139 31 166 79c16 29 23 68 23 136v270c0 100 -16 122 -94 128v19h138v-26 c12 5 30 14 30 25c0 18 -43 28 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM409 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7921:[560,191,513,9,513,"513 494c0 -45 -42 -84 -96 -94v-293c0 -46 11 -57 57 -57h5v-14c-51 -14 -87 -25 -137 -45l-4 2v83l-43 -43c-27 -27 -66 -43 -103 -43c-73 0 -121 51 -121 130v252c0 46 -14 61 -62 64v14h146v-326c0 -42 32 -76 71 -76c40 0 107 20 107 87v235c0 50 -12 60 -74 63v17 h158v-25c13 5 31 14 31 25c0 18 -43 27 -43 62c0 25 26 48 49 48c32 0 59 -33 59 -66zM267 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7922:[851,0,722,22,703,"703 643c-51 -4 -77 -26 -138 -114l-148 -226v-194c0 -76 14 -88 103 -90v-19h-306v19c91 4 101 14 101 101v174l-131 192c-100 141 -114 155 -162 157v19h280v-19c-11 -1 -21 -1 -25 -1c-32 -2 -46 -11 -46 -29c0 -11 6 -28 17 -44l148 -222l143 226c9 15 14 27 14 37 c0 24 -17 32 -69 33v19h219v-19zM454 712h-43l-167 80c-22 9 -32 20 -32 33c0 16 14 26 38 26c16 0 26 -4 46 -19"],7923:[675,218,500,14,475,"475 435c-24 -3 -35 -13 -48 -45l-154 -408c-54 -144 -102 -200 -169 -200c-42 0 -74 25 -74 58c0 24 20 44 43 44c17 0 34 -4 53 -11c10 -5 19 -7 25 -7c14 0 36 19 50 45c17 30 40 93 40 108c0 8 -4 20 -11 37l-165 348c-8 17 -25 28 -51 32v14h206v-15 c-43 -2 -58 -9 -58 -27c0 -11 4 -24 10 -38l115 -253l97 276c3 7 4 13 4 17c0 16 -16 25 -48 25v15h135v-15zM354 504h-40l-154 97c-21 13 -30 26 -30 42c0 20 13 32 35 32c15 0 24 -5 42 -23"],7924:[662,191,722,22,703,"703 643c-51 -4 -77 -26 -138 -114l-148 -226v-194c0 -76 14 -88 103 -90v-19h-306v19c91 4 101 14 101 101v174l-131 192c-100 141 -114 155 -162 157v19h280v-19c-11 -1 -21 -1 -25 -1c-32 -2 -46 -11 -46 -29c0 -11 6 -28 17 -44l148 -222l143 226c9 15 14 27 14 37 c0 24 -17 32 -69 33v19h219v-19zM417 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7925:[450,218,500,14,475,"475 435c-24 -3 -35 -13 -48 -45l-154 -408c-54 -144 -102 -200 -169 -200c-42 0 -74 25 -74 58c0 24 20 44 43 44c17 0 34 -4 53 -11c10 -5 19 -7 25 -7c14 0 36 19 50 45c17 30 40 93 40 108c0 8 -4 20 -11 37l-165 348c-8 17 -25 28 -51 32v14h206v-15 c-43 -2 -58 -9 -58 -27c0 -11 4 -24 10 -38l115 -253l97 276c3 7 4 13 4 17c0 16 -16 25 -48 25v15h135v-15zM426 -140c0 -29 -22 -51 -51 -51c-28 0 -51 22 -51 51c0 28 23 51 51 51c29 0 51 -23 51 -51"],7926:[896,0,722,22,703,"703 643c-51 -4 -77 -26 -138 -114l-148 -226v-194c0 -76 14 -88 103 -90v-19h-306v19c91 4 101 14 101 101v174l-131 192c-100 141 -114 155 -162 157v19h280v-19c-11 -1 -21 -1 -25 -1c-32 -2 -46 -11 -46 -29c0 -11 6 -28 17 -44l148 -222l143 226c9 15 14 27 14 37 c0 24 -17 32 -69 33v19h219v-19zM465 838c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19 c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7927:[684,218,500,14,475,"475 435c-24 -3 -35 -13 -48 -45l-154 -408c-54 -144 -102 -200 -169 -200c-42 0 -74 25 -74 58c0 24 20 44 43 44c17 0 34 -4 53 -11c10 -5 19 -7 25 -7c14 0 36 19 50 45c17 30 40 93 40 108c0 8 -4 20 -11 37l-165 348c-8 17 -25 28 -51 32v14h206v-15 c-43 -2 -58 -9 -58 -27c0 -11 4 -24 10 -38l115 -253l97 276c3 7 4 13 4 17c0 16 -16 25 -48 25v15h135v-15zM379 626c0 -20 -15 -38 -42 -59c-23 -18 -38 -31 -42 -40c-4 -7 -7 -16 -10 -30h-23c1 27 14 52 33 79c17 19 23 35 23 47c0 27 -16 42 -50 42 c-16 0 -28 -4 -35 -10c-4 -2 -6 -5 -6 -8c0 -4 17 -21 17 -29c0 -13 -9 -19 -28 -19c-22 0 -34 10 -34 32c0 30 40 53 97 53c36 0 62 -7 80 -22c13 -12 20 -24 20 -36"],7928:[835,0,722,22,703,"703 643c-51 -4 -77 -26 -138 -114l-148 -226v-194c0 -76 14 -88 103 -90v-19h-306v19c91 4 101 14 101 101v174l-131 192c-100 141 -114 155 -162 157v19h280v-19c-11 -1 -21 -1 -25 -1c-32 -2 -46 -11 -46 -29c0 -11 6 -28 17 -44l148 -222l143 226c9 15 14 27 14 37 c0 24 -17 32 -69 33v19h219v-19zM531 835c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],7929:[643,218,500,14,475,"475 435c-24 -3 -35 -13 -48 -45l-154 -408c-54 -144 -102 -200 -169 -200c-42 0 -74 25 -74 58c0 24 20 44 43 44c17 0 34 -4 53 -11c10 -5 19 -7 25 -7c14 0 36 19 50 45c17 30 40 93 40 108c0 8 -4 20 -11 37l-165 348c-8 17 -25 28 -51 32v14h206v-15 c-43 -2 -58 -9 -58 -27c0 -11 4 -24 10 -38l115 -253l97 276c3 7 4 13 4 17c0 16 -16 25 -48 25v15h135v-15zM445 643c-21 -76 -50 -106 -105 -106c-25 0 -40 4 -81 24l-23 11c-15 7 -29 11 -41 11c-23 0 -40 -15 -51 -46h-29c15 65 51 101 101 101c22 0 47 -6 70 -18 l24 -12c19 -9 38 -15 53 -15c23 0 36 12 53 50h29"],64256:[683,0,600,31,650,"389 579c-9 5 -19 15 -30 32c-24 34 -43 47 -71 47c-36 0 -72 -21 -89 -52c-13 -24 -17 -62 -17 -107v-6v-43h188c1 60 6 96 19 129zM650 621c0 -23 -18 -41 -42 -41c-17 0 -29 9 -45 36c-18 29 -31 39 -53 39c-38 0 -57 -30 -57 -89v-116h123v-33h-122v-313 c0 -75 9 -84 67 -89v-15h-220v15c69 6 69 16 69 89v313h-187v-329c0 -55 13 -69 69 -73v-15h-220v15c56 2 67 15 67 79v323h-68v33h69c6 80 17 116 47 158c36 50 94 75 170 75c56 0 97 -14 116 -38c28 24 68 38 113 38c60 0 104 -26 104 -62"],64257:[683,0,556,31,521,"521 0h-220v15c62 5 69 14 69 82v264c0 53 -5 56 -101 56h-86v-329c0 -55 13 -69 69 -73v-15h-220v15c56 2 67 15 67 79v323h-68v33h69c6 80 17 116 47 158c36 50 94 75 170 75c77 0 127 -27 127 -70c0 -23 -15 -39 -36 -39c-17 0 -30 9 -49 37c-24 34 -43 47 -71 47 c-36 0 -72 -21 -89 -52c-13 -24 -19 -62 -17 -107v-6v-43h157c40 0 69 3 113 10l4 -3l-2 -98v-262c0 -64 11 -77 67 -82v-15"],64258:[683,0,556,32,521,"521 0h-215v15c52 4 67 20 67 69v334h-188v-339c0 -46 14 -58 71 -64v-15h-224v15c60 4 69 16 69 90v313h-69v32h71c4 88 14 127 44 170c28 39 74 63 119 63c26 0 55 -6 83 -17c14 -5 25 -8 30 -8c9 0 24 5 42 14c13 6 23 10 31 11l5 -2v-600c0 -52 10 -62 64 -66v-15z M373 450v141c-5 -6 -8 -7 -16 -7c-23 0 -36 9 -55 37c-18 27 -30 35 -52 35c-44 0 -65 -50 -65 -154v-52h188"],64259:[683,0,827,31,792,"398 574c-18 6 -30 24 -39 37c-24 34 -43 47 -71 47c-36 0 -72 -21 -89 -52c-13 -24 -17 -62 -17 -107v-6v-43h189c4 58 11 93 27 124zM792 0h-220v15c62 5 69 14 69 82v264c0 53 -5 56 -101 56h-86v-329c0 -55 13 -69 69 -73v-15h-220v15c56 2 67 15 67 79v323h-187 v-329c0 -55 13 -69 69 -73v-15h-220v15c56 2 67 15 67 79v323h-68v33h69c6 80 17 116 47 158c36 50 94 75 170 75c56 0 96 -12 116 -38c3 -4 6 -8 8 -11c36 33 85 49 147 49c77 0 127 -27 127 -70c0 -23 -15 -39 -36 -39c-17 0 -30 9 -49 37c-24 34 -43 47 -71 47 c-36 0 -72 -21 -89 -52c-13 -24 -17 -62 -17 -107v-6v-43h157c40 0 69 3 113 10l4 -3l-2 -98v-262c0 -64 11 -77 67 -82v-15"],64260:[683,0,827,31,792,"644 450v141c-5 -6 -8 -7 -16 -7c-23 0 -36 9 -55 37c-18 27 -32 35 -54 35c-44 0 -65 -50 -65 -154v-52h190zM392 577c-15 7 -25 22 -33 34c-24 34 -43 47 -71 47c-36 0 -72 -21 -89 -52c-13 -24 -17 -62 -17 -107v-6v-43h190c3 59 8 96 20 127zM792 0h-215v15 c52 4 67 20 67 69v333h-190v-338c0 -46 14 -58 71 -64v-15h-224v15c60 4 69 16 69 90v312h-187v-329c0 -55 13 -69 69 -73v-15h-220v15c56 2 67 15 67 79v323h-68v33h69c6 80 17 116 47 158c36 50 94 75 170 75c56 0 96 -12 116 -38l2 -3c28 26 64 41 100 41 c26 0 57 -6 85 -17c14 -5 25 -8 30 -8c9 0 24 5 42 14c13 6 23 10 31 11l5 -2v-600c0 -52 10 -62 64 -66v-15"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Latin/Regular/Main.js");
| dannyxx001/cdnjs | ajax/libs/mathjax/2.3.0/jax/output/SVG/fonts/Gyre-Termes/Latin/Regular/Main.js | JavaScript | mit | 121,277 |
/*
* /MathJax/jax/output/SVG/fonts/Latin-Modern/Size3/Regular/Main.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed 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.
*/
MathJax.OutputJax.SVG.FONTDATA.FONTS.LatinModernMathJax_Size3={directory:"Size3/Regular",family:"LatinModernMathJax_Size3",id:"LATINMODERNSIZE3",32:[0,0,332,0,0,""],40:[972,472,523,156,461,"461 -459c0 -7 -6 -13 -13 -13c-3 0 -6 1 -8 3c-147 111 -284 390 -284 633v172c0 243 137 522 284 633c2 2 5 3 8 3c7 0 13 -6 13 -13c0 -4 -2 -8 -5 -10c-140 -105 -236 -383 -236 -613v-172c0 -230 96 -508 236 -613c3 -2 5 -6 5 -10"],41:[972,472,523,62,367,"367 164c0 -243 -137 -522 -284 -633c-3 -2 -5 -3 -8 -3c-7 0 -13 6 -13 13c0 4 2 8 5 10c140 105 236 383 236 613v172c0 230 -96 508 -236 613c-3 2 -5 6 -5 10c0 7 6 13 13 13c3 0 5 -1 8 -3c147 -111 284 -390 284 -633v-172"],47:[1374,874,964,57,909,"909 1348c0 -4 -1 -7 -2 -10l-799 -2195c-4 -10 -14 -17 -25 -17c-15 0 -26 12 -26 26c0 4 0 7 1 10l799 2195c4 10 14 17 25 17c15 0 27 -12 27 -26"],91:[975,475,444,226,414,"414 -451c0 -13 -11 -24 -24 -24h-164v1450h164c13 0 24 -11 24 -24s-11 -24 -24 -24h-116v-1354h116c13 0 24 -11 24 -24"],92:[1374,874,964,56,908,"908 -848c0 -14 -12 -26 -27 -26c-11 0 -21 7 -25 17l-799 2195c-1 3 -1 6 -1 10c0 14 11 26 26 26c11 0 21 -7 25 -17l799 -2195c1 -3 2 -6 2 -10"],93:[975,475,444,30,218,"218 975v-1450h-164c-14 0 -24 11 -24 24s10 24 24 24h116v1354h-116c-14 0 -24 11 -24 24s10 24 24 24h164"],123:[975,475,624,100,524,"524 -459c0 -9 -7 -16 -16 -16h-2c-124 19 -232 96 -232 182v361c0 73 -67 152 -160 166c-8 1 -14 8 -14 16s6 15 14 16c93 14 160 93 160 166v361c0 86 108 163 232 182h2c9 0 16 -7 16 -16c0 -8 -6 -15 -14 -16c-92 -14 -160 -86 -160 -150v-361 c0 -79 -73 -149 -168 -182c95 -33 168 -103 168 -182v-361c0 -64 68 -136 160 -150c8 -1 14 -8 14 -16"],124:[1117,617,278,113,166,"166 -591c0 -15 -12 -26 -27 -26s-26 11 -26 26v1682c0 15 11 26 26 26s27 -11 27 -26v-1682"],125:[975,475,624,100,524,"524 250c0 -8 -6 -15 -14 -16c-93 -14 -160 -93 -160 -166v-361c0 -86 -108 -163 -232 -182h-2c-9 0 -16 7 -16 16c0 8 5 15 13 16c93 14 161 86 161 150v361c0 79 73 149 167 182c-94 33 -167 103 -167 182v361c0 64 -68 136 -161 150c-8 1 -13 8 -13 16c0 9 7 16 16 16 h2c124 -19 232 -96 232 -182v-361c0 -73 67 -152 160 -166c8 -1 14 -8 14 -16"],160:[0,0,332,0,0,""],770:[747,-572,919,0,919,"919 596l-7 -24c-152 33 -303 71 -452 113c-150 -42 -301 -80 -453 -113l-7 24c151 56 305 106 460 151c155 -45 308 -95 459 -151"],771:[757,-543,931,0,931,"931 744c0 -3 -1 -5 -2 -7c-55 -80 -113 -135 -213 -156c-19 -4 -38 -6 -57 -6c-69 0 -137 23 -203 47c-60 22 -121 44 -182 44c-16 0 -31 -1 -47 -5c-88 -18 -155 -42 -203 -112c-3 -4 -7 -6 -11 -6c-7 0 -13 6 -13 13c0 3 1 5 2 7c55 80 113 135 213 156 c19 4 38 6 57 6c69 0 137 -23 204 -47c59 -22 120 -44 181 -44c16 0 31 1 47 5c89 18 155 42 204 112c2 4 6 6 10 6c7 0 13 -6 13 -13"],774:[742,-577,937,0,937,"937 734c-53 -157 -278 -157 -469 -157c-190 0 -416 0 -468 157l25 8c35 -106 267 -106 443 -106c177 0 408 0 444 106"],780:[740,-565,919,0,919,"919 716c-151 -56 -304 -106 -459 -151c-155 45 -309 95 -460 151l7 24c152 -33 303 -71 453 -113c149 42 300 80 452 113"],785:[758,-592,937,0,937,"937 600l-25 -8c-36 106 -267 107 -444 107c-176 0 -408 -1 -443 -107l-25 8c52 157 278 158 468 158c191 0 416 -1 469 -158"],812:[-96,271,919,0,919,"919 -121c-151 -56 -304 -106 -459 -150c-155 44 -309 94 -460 150l7 25c152 -33 303 -71 453 -114c149 43 300 81 452 114"],813:[-108,283,919,0,919,"919 -258l-7 -25c-152 33 -303 71 -452 114c-150 -43 -301 -81 -453 -114l-7 25c151 56 305 106 460 150c155 -44 308 -94 459 -150"],814:[-96,262,937,0,937,"937 -104c-53 -158 -278 -158 -469 -158c-190 0 -416 0 -468 158l25 8c35 -107 267 -107 443 -107c177 0 408 0 444 107"],815:[-118,284,937,0,937,"937 -275l-25 -9c-36 107 -267 107 -444 107c-176 0 -408 0 -443 -107l-25 9c52 157 278 157 468 157c191 0 416 0 469 -157"],816:[-118,332,931,0,931,"931 -131c0 -3 -1 -5 -2 -7c-55 -80 -113 -135 -213 -156c-19 -4 -38 -6 -57 -6c-69 0 -137 23 -203 47c-60 22 -121 44 -182 44c-16 0 -31 -1 -47 -5c-88 -18 -155 -42 -203 -112c-3 -4 -7 -6 -11 -6c-7 0 -13 6 -13 13c0 3 1 5 2 7c55 80 113 135 213 156 c19 4 38 6 57 6c69 0 137 -23 204 -47c59 -22 120 -44 181 -44c16 0 31 1 47 5c89 18 155 42 204 112c2 4 6 6 10 6c7 0 13 -6 13 -13"],8214:[1117,617,372,57,317,"110 -591c0 -15 -12 -26 -27 -26s-26 11 -26 26v1682c0 15 11 26 26 26s27 -11 27 -26v-1682zM317 -591c0 -15 -12 -26 -27 -26s-26 11 -26 26v1682c0 15 11 26 26 26s27 -11 27 -26v-1682"],8260:[1374,874,964,57,909,"909 1348c0 -4 -1 -7 -2 -10l-799 -2195c-4 -10 -14 -17 -25 -17c-15 0 -26 12 -26 26c0 4 0 7 1 10l799 2195c4 10 14 17 25 17c15 0 27 -12 27 -26"],8425:[742,-535,1485,0,1485,"1485 742v-183c0 -13 -11 -24 -24 -24s-24 11 -24 24v135h-1389v-135c0 -13 -11 -24 -24 -24s-24 11 -24 24v183h1485"],8730:[1450,950,1000,111,1020,"1020 1430c0 -5 -2 -14 -4 -21l-550 -2333c-6 -26 -9 -26 -42 -26l-231 1073l-68 -107s-14 12 -14 16c0 0 0 3 7 12l131 206l216 -1002h1l512 2175c3 14 6 27 22 27c12 0 20 -9 20 -20"],8739:[1117,617,278,113,166,"166 -591c0 -15 -12 -26 -27 -26s-26 11 -26 26v1682c0 15 11 26 26 26s27 -11 27 -26v-1682"],8741:[1117,617,372,57,317,"110 -591c0 -15 -12 -26 -27 -26s-26 11 -26 26v1682c0 15 11 26 26 26s27 -11 27 -26v-1682zM317 -591c0 -15 -12 -26 -27 -26s-26 11 -26 26v1682c0 15 11 26 26 26s27 -11 27 -26v-1682"],8968:[975,475,499,189,471,"471 951c0 -13 -11 -24 -24 -24h-210v-1378c0 -13 -11 -24 -24 -24s-24 11 -24 24v1426h258c13 0 24 -11 24 -24"],8969:[975,475,499,28,310,"310 -451c0 -13 -11 -24 -24 -24s-24 11 -24 24v1378h-210c-13 0 -24 11 -24 24s11 24 24 24h258v-1426"],8970:[975,475,499,189,471,"471 -451c0 -13 -11 -24 -24 -24h-258v1426c0 13 11 24 24 24s24 -11 24 -24v-1378h210c13 0 24 -11 24 -24"],8971:[975,475,499,28,310,"310 951v-1426h-258c-13 0 -24 11 -24 24s11 24 24 24h210v1378c0 13 11 24 24 24s24 -11 24 -24"],9001:[975,475,537,154,476,"476 -451c0 -13 -11 -24 -24 -24c-10 0 -19 6 -22 15l-274 701c-1 3 -2 6 -2 9s1 6 2 9l274 701c3 9 12 15 22 15c13 0 24 -11 24 -24c0 -3 -1 -6 -2 -9l-270 -692l270 -692c1 -3 2 -6 2 -9"],9002:[975,475,537,61,383,"383 250c0 -3 -1 -6 -2 -9l-274 -701c-3 -9 -12 -15 -22 -15c-13 0 -24 11 -24 24c0 3 1 6 2 9l270 692l-270 692c-1 3 -2 6 -2 9c0 13 11 24 24 24c10 0 19 -6 22 -15l274 -701c1 -3 2 -6 2 -9"],9140:[742,-535,1485,0,1485,"1485 742v-183c0 -13 -11 -24 -24 -24s-24 11 -24 24v135h-1389v-135c0 -13 -11 -24 -24 -24s-24 11 -24 24v183h1485"],9141:[-105,312,1485,0,1485,"1485 -312h-1485v183c0 13 11 24 24 24s24 -11 24 -24v-135h1389v135c0 13 11 24 24 24s24 -11 24 -24v-183"],9180:[767,-509,2012,0,2012,"2012 525c0 -9 -7 -16 -16 -16c-4 0 -8 2 -11 5c-114 113 -486 189 -826 189h-306c-340 0 -712 -76 -826 -189c-3 -3 -7 -5 -11 -5c-9 0 -16 7 -16 16c0 4 2 8 5 11c118 118 495 231 848 231h306c353 0 730 -113 848 -231c3 -3 5 -7 5 -11"],9181:[-79,337,2012,0,2012,"2012 -95c0 -4 -2 -8 -5 -11c-118 -118 -495 -231 -848 -231h-306c-353 0 -730 113 -848 231c-3 3 -5 7 -5 11c0 9 7 16 16 16c4 0 8 -2 11 -5c114 -113 486 -189 826 -189h306c340 0 712 76 826 189c3 3 7 5 11 5c9 0 16 -7 16 -16"],9182:[825,-506,1996,0,1996,"1996 514c0 -5 -4 -8 -8 -8c-3 0 -6 2 -8 5c-28 79 -162 122 -287 122h-400c-149 0 -264 69 -295 144c-31 -75 -146 -144 -295 -144h-400c-125 0 -259 -43 -287 -122c-2 -3 -5 -5 -8 -5c-4 0 -8 3 -8 8v2c33 89 162 181 303 181h400c153 0 287 41 287 120c0 4 4 8 8 8 s8 -4 8 -8c0 -79 134 -120 287 -120h400c141 0 270 -92 303 -181v-2"],9183:[-75,394,1996,0,1996,"1996 -83v-3c-33 -89 -162 -181 -303 -181h-400c-153 0 -287 -41 -287 -119c0 -5 -4 -8 -8 -8s-8 3 -8 8c0 78 -134 119 -287 119h-400c-141 0 -270 92 -303 181v3c0 4 4 8 8 8c3 0 6 -3 8 -6c28 -79 162 -122 287 -122h400c149 0 264 -69 295 -144 c31 75 146 144 295 144h400c125 0 259 43 287 122c2 3 5 6 8 6c4 0 8 -4 8 -8"],9184:[858,-610,2056,0,2056,"2056 610h-76l-172 172h-1560l-172 -172h-76l248 248h1560"],9185:[-180,428,2056,0,2056,"2056 -180l-248 -248h-1560l-248 248h76l172 -172h1560l172 172h76"],10214:[975,475,555,170,532,"532 -451c0 -13 -11 -24 -24 -24h-338v1450h338c13 0 24 -11 24 -24s-11 -24 -24 -24h-121v-1354h121c13 0 24 -11 24 -24zM339 927h-121v-1354h121v1354"],10215:[975,475,555,23,385,"385 -475h-338c-13 0 -24 11 -24 24s11 24 24 24h121v1354h-121c-13 0 -24 11 -24 24s11 24 24 24h338v-1450zM337 927h-121v-1354h121v1354"],10216:[975,475,537,154,476,"476 -451c0 -13 -11 -24 -24 -24c-10 0 -19 6 -22 15l-274 701c-1 3 -2 6 -2 9s1 6 2 9l274 701c3 9 12 15 22 15c13 0 24 -11 24 -24c0 -3 -1 -6 -2 -9l-270 -692l270 -692c1 -3 2 -6 2 -9"],10217:[975,475,537,61,383,"383 250c0 -3 -1 -6 -2 -9l-274 -701c-3 -9 -12 -15 -22 -15c-13 0 -24 11 -24 24c0 3 1 6 2 9l270 692l-270 692c-1 3 -2 6 -2 9c0 13 11 24 24 24c10 0 19 -6 22 -15l274 -701c1 -3 2 -6 2 -9"],10218:[975,475,781,154,720,"476 -451c0 -13 -11 -24 -24 -24c-10 0 -19 6 -22 15l-274 701c-1 3 -2 6 -2 9s1 6 2 9l274 701c3 9 12 15 22 15c13 0 24 -11 24 -24c0 -3 -1 -6 -2 -9l-270 -692l270 -692c1 -3 2 -6 2 -9zM720 -451c0 -13 -11 -24 -24 -24c-10 0 -19 6 -23 15l-274 701c-1 3 -1 6 -1 9 s0 6 1 9l274 701c4 9 13 15 23 15c13 0 24 -11 24 -24c0 -3 -1 -6 -2 -9l-270 -692l270 -692c1 -3 2 -6 2 -9"],10219:[975,475,781,61,627,"627 250c0 -3 -1 -6 -2 -9l-274 -701c-3 -9 -12 -15 -22 -15c-13 0 -24 11 -24 24c0 3 0 6 1 9l271 692l-271 692c-1 3 -1 6 -1 9c0 13 11 24 24 24c10 0 19 -6 22 -15l274 -701c1 -3 2 -6 2 -9zM383 250c0 -3 -1 -6 -2 -9l-274 -701c-3 -9 -12 -15 -22 -15 c-13 0 -24 11 -24 24c0 3 1 6 2 9l270 692l-270 692c-1 3 -2 6 -2 9c0 13 11 24 24 24c10 0 19 -6 22 -15l274 -701c1 -3 2 -6 2 -9"],10222:[991,491,370,142,314,"314 -475c0 -9 -7 -16 -16 -16c-4 0 -8 2 -11 5c-71 70 -145 336 -145 598v276c0 262 74 528 145 598c3 3 7 5 11 5c9 0 16 -7 16 -16c0 -4 -2 -8 -5 -11c-66 -67 -103 -327 -103 -576v-276c0 -249 37 -509 103 -576c3 -3 5 -7 5 -11"],10223:[991,491,370,56,228,"228 112c0 -262 -74 -528 -145 -598c-3 -3 -7 -5 -11 -5c-9 0 -16 7 -16 16c0 4 2 8 5 11c66 67 103 327 103 576v276c0 249 -37 509 -103 576c-3 3 -5 7 -5 11c0 9 7 16 16 16c4 0 8 -2 11 -5c71 -70 145 -336 145 -598v-276"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Size3/Regular/Main.js");
| sufuf3/cdnjs | ajax/libs/mathjax/2.3.0/jax/output/SVG/fonts/Latin-Modern/Size3/Regular/Main.js | JavaScript | mit | 10,382 |
hljs.registerLanguage("applescript",function(e){var t=e.inherit(e.QSM,{i:""}),r={cN:"params",b:"\\(",e:"\\)",c:["self",e.CNM,t]},o=[{cN:"comment",b:"--",e:"$"},{cN:"comment",b:"\\(\\*",e:"\\*\\)",c:["self",{b:"--",e:"$"}]},e.HCM];return{aliases:["osascript"],k:{keyword:"about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",constant:"AppleScript false linefeed return pi quote result space tab true",type:"alias application boolean class constant date file integer list number real record string text",command:"activate beep count delay launch log offset read round run say summarize write",property:"character characters contents day frontmost id item length month name paragraph paragraphs rest reverse running time version weekday word words year"},c:[t,e.CNM,{cN:"type",b:"\\bPOSIX file\\b"},{cN:"command",b:"\\b(clipboard info|the clipboard|info for|list (disks|folder)|mount volume|path to|(close|open for) access|(get|set) eof|current date|do shell script|get volume settings|random number|set volume|system attribute|system info|time to GMT|(load|run|store) script|scripting components|ASCII (character|number)|localized string|choose (application|color|file|file name|folder|from list|remote application|URL)|display (alert|dialog))\\b|^\\s*return\\b"},{cN:"constant",b:"\\b(text item delimiters|current application|missing value)\\b"},{cN:"keyword",b:"\\b(apart from|aside from|instead of|out of|greater than|isn't|(doesn't|does not) (equal|come before|come after|contain)|(greater|less) than( or equal)?|(starts?|ends|begins?) with|contained by|comes (before|after)|a (ref|reference))\\b"},{cN:"property",b:"\\b(POSIX path|(date|time) string|quoted form)\\b"},{cN:"function_start",bK:"on",i:"[${=;\\n]",c:[e.UTM,r]}].concat(o),i:"//|->|=>"}}); | peteygao/cdnjs | ajax/libs/highlight.js/8.4/languages/applescript.min.js | JavaScript | mit | 2,254 |
/*
* /MathJax/jax/output/SVG/fonts/Gyre-Termes/DoubleStruck/Regular/Main.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed 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.
*/
MathJax.OutputJax.SVG.FONTDATA.FONTS.GyreTermesMathJax_DoubleStruck={directory:"DoubleStruck/Regular",family:"GyreTermesMathJax_DoubleStruck",id:"GYRETERMESDOUBLESTRUCK",32:[0,0,250,0,0,""],160:[0,0,250,0,0,""],8450:[718,14,816,80,736,"736 127c0 -4 -2 -9 -6 -14c-66 -80 -169 -127 -286 -127c-213 0 -364 144 -364 359c0 232 184 371 366 371c52 0 103 -7 155 -25c15 -6 29 -9 39 -9c14 0 30 6 35 21c4 12 12 15 20 15c9 0 18 -10 19 -21l10 -192c1 -15 -8 -21 -17 -22c-10 -1 -21 5 -22 15 c-3 55 -16 85 -42 113c-41 44 -114 64 -176 64c-145 0 -231 -138 -231 -317c0 -197 104 -328 247 -328c59 0 146 29 216 109c3 3 7 7 20 7c7 0 17 -8 17 -19zM339 35c-87 51 -143 183 -143 323c0 112 30 218 93 282c-97 -49 -169 -161 -169 -295c0 -145 100 -274 219 -310"],8461:[702,0,923,79,843,"843 22c0 -11 -7 -22 -20 -22h-287c-13 0 -20 11 -20 22s6 20 19 20c64 0 71 18 71 92v202h-289v-213c0 -62 11 -81 72 -81c12 0 18 -10 18 -20c0 -11 -7 -22 -20 -22h-287c-13 0 -20 11 -20 22s6 20 19 20c64 0 71 18 71 92v445c0 63 -6 81 -72 81c-12 0 -19 11 -18 22 s7 20 20 20h287c13 0 19 -9 20 -20s-6 -22 -18 -22c-65 0 -72 -18 -72 -81v-203h289v203c0 63 -11 81 -72 81c-12 0 -19 11 -18 22s7 20 20 20h287c13 0 19 -9 19 -20s-5 -22 -17 -22c-63 0 -72 -18 -72 -81v-456c0 -62 10 -81 72 -81c12 0 18 -10 18 -20zM726 40 c-10 18 -13 44 -13 83v456c0 39 2 65 12 83h-91c10 -18 12 -44 12 -83v-445c0 -45 -2 -75 -12 -94h92zM290 40c-10 18 -13 44 -13 83v456c0 39 2 65 12 83h-91c10 -18 12 -44 12 -83v-445c0 -45 -2 -75 -12 -94h92"],8469:[702,11,915,80,835,"835 682c0 -11 -6 -22 -18 -22c-83 0 -93 -13 -93 -120v-531c0 -13 -9 -20 -20 -20c-7 0 -15 3 -18 7l-453 553v-387c0 -104 13 -120 91 -120c13 0 19 -9 19 -20s-7 -22 -20 -22h-223c-13 0 -20 11 -20 22c0 10 6 20 18 20c80 0 95 13 95 119v435c-53 59 -60 65 -93 65 c-13 0 -20 10 -20 21s7 20 20 20h181c5 0 12 -3 15 -7l388 -472v317c0 109 -6 120 -94 120c-12 0 -18 11 -18 22s7 20 20 20h223c13 0 20 -9 20 -20zM684 61v99l-412 502h-86c12 -12 23 -25 42 -44"],8473:[702,0,754,80,674,"674 505c0 -125 -98 -197 -296 -197c-22 0 -38 1 -61 2v-187c0 -64 10 -82 78 -82c13 0 19 -10 19 -21s-7 -20 -20 -20h-294c-13 0 -20 11 -20 22c0 10 6 20 18 20c63 0 69 18 69 92v445c0 68 -7 81 -69 81c-12 0 -18 8 -18 22c0 11 7 20 20 20h287 c168 0 287 -62 287 -197zM634 505c0 76 -47 119 -120 142c36 -36 51 -87 51 -148c0 -55 -12 -100 -42 -132c73 23 111 69 111 138zM525 499c0 100 -38 163 -184 163c-19 0 -24 -5 -24 -24v-287c20 -2 33 -2 48 -2c112 0 160 57 160 150zM290 40c-10 18 -13 45 -13 83v515 c0 9 1 17 1 24h-83c10 -17 12 -43 12 -83v-445c0 -46 -2 -75 -12 -94h95"],8474:[716,178,875,80,795,"795 -156c0 -10 -7 -20 -19 -21c-13 -1 -17 -1 -34 -1c-167 0 -293 47 -364 129l-44 51c-134 37 -254 179 -254 349c0 214 154 365 356 365c201 0 357 -151 357 -363c0 -179 -113 -324 -266 -356c79 -96 147 -131 249 -134c13 0 19 -10 19 -19zM753 353 c0 132 -70 238 -172 289c56 -64 98 -166 98 -287c0 -167 -46 -232 -86 -289c75 43 160 118 160 287zM639 355c0 183 -93 321 -200 321c-117 0 -206 -133 -206 -319c0 -193 83 -329 203 -329c130 0 203 141 203 327zM280 639c-98 -53 -160 -158 -160 -288 c0 -154 115 -264 159 -279c-37 54 -85 130 -85 285c0 120 32 218 86 282zM600 -125c-42 28 -75 59 -119 113c-8 -3 -20 -3 -30 -3h-12c-16 0 -25 0 -41 4c37 -48 97 -93 202 -114"],8477:[702,0,876,80,796,"634 515c0 76 -47 109 -120 132c36 -36 51 -77 51 -138c0 -55 -12 -90 -42 -122c73 23 111 59 111 128zM525 509c0 100 -38 153 -184 153c-19 0 -24 -5 -24 -24v-267c20 -2 33 -2 48 -2c112 0 160 47 160 140zM290 40c-10 18 -13 45 -13 83v515c0 9 1 17 1 24h-83 c10 -17 12 -43 12 -83v-445c0 -46 -2 -75 -12 -94h95zM690 40c-5 6 -11 12 -17 19l-221 276c-22 -2 -55 -3 -70 -3l223 -292h85zM796 20c0 -10 -7 -20 -20 -20h-181c-5 0 -13 4 -16 8l-244 320c-11 1 -5 1 -18 2v-207c0 -73 8 -82 78 -82c13 0 19 -10 19 -21s-7 -20 -20 -20 h-294c-13 0 -20 11 -20 22c0 10 6 20 18 20c62 0 69 18 69 92v445c0 71 -5 81 -69 81c-12 0 -18 8 -18 22c0 11 7 20 20 20h287c168 0 287 -52 287 -187c0 -96 -60 -152 -176 -174l206 -256c25 -30 41 -43 74 -43c12 0 18 -11 18 -22"],8484:[702,0,808,79,728,"728 179l-23 -162c-2 -11 -9 -17 -20 -17h-585c-13 0 -20 9 -20 20c0 6 -1 8 4 15l438 627h-208c-141 0 -155 -14 -169 -141c-1 -11 -11 -16 -21 -16c-13 0 -22 7 -20 22l18 157c1 12 8 18 20 18h546c13 0 20 -9 20 -20c0 -6 0 -9 -4 -15l-433 -627h246 c133 0 151 5 171 148c1 9 8 14 20 14c14 0 22 -8 20 -23zM654 662h-84l-435 -622h89"],8508:[511,16,738,80,658,"658 378c-38 -12 -61 -16 -94 -20v-141c0 -98 19 -217 19 -217h-153v352h-7c-38 0 -90 3 -132 7v-152c0 -113 -19 -223 -86 -223c-86 0 -99 85 -99 163c0 11 9 19 20 19s20 -9 20 -19c0 -33 40 -42 55 -42c49 0 50 39 50 100c0 0 1 181 1 158c-70 7 -69 8 -83 8 c-15 0 -49 1 -49 -39c0 -8 -6 -21 -20 -21c-19 0 -20 15 -20 23c0 101 41 146 124 146c47 0 146 -14 248 -14c74 0 131 15 206 45v-133zM618 408v45c-50 -15 -99 -27 -166 -27c-102 0 -201 14 -248 14c-37 0 -61 0 -73 -32c14 4 28 3 38 3c14 0 54 -5 82 -8 c67 -7 129 -11 172 -11h47v-352h66c-5 35 -12 105 -12 177v177c47 5 73 9 94 14zM242 84c-13 -17 -27 -21 -43 -21c-20 0 -33 4 -50 24c1 -38 22 -65 54 -65c25 0 34 19 39 62"],8509:[491,234,715,80,635,"635 458c0 -5 -2 -10 -6 -16c-117 -158 -186 -285 -226 -384c14 -93 16 -171 16 -178c0 -104 -51 -114 -75 -114c-113 0 -137 35 -137 127c0 55 16 149 112 334c-28 67 -77 124 -144 124c-15 0 -55 -11 -55 -42c0 -10 -9 -20 -20 -20s-20 9 -20 20c0 67 38 182 120 182 c76 0 109 -112 146 -214l113 188c3 5 11 9 17 9h137c14 0 22 -7 22 -16zM286 338c-17 62 -57 113 -86 113c-39 0 -61 -35 -71 -74c17 9 35 14 46 14c40 0 84 -18 111 -53zM574 434h-87c-210 -331 -240 -469 -240 -541c0 -57 14 -82 75 -86c-7 7 -11 20 -11 39 c0 50 12 141 72 272c39 88 101 192 191 316zM377 -134c0 5 -1 45 -6 102c-15 -54 -20 -94 -20 -122c0 -10 2 -12 5 -12c8 0 21 11 21 32"],8510:[702,0,734,80,654,"654 565c0 -14 -11 -23 -19 -23c-12 0 -20 5 -21 18c-9 97 -32 101 -144 101h-141c-22 0 -22 -20 -22 -44v-494c0 -63 11 -78 75 -82c13 -1 19 -7 19 -20v-1c0 -13 -7 -20 -20 -20h-281c-13 0 -20 7 -20 20v2c0 13 6 19 19 20c64 4 71 19 71 92v445c0 61 -10 75 -72 81 c-12 1 -18 8 -18 20v2c0 13 7 20 20 20h531c13 0 20 -6 20 -19zM280 40c-10 18 -13 45 -13 83v494c0 17 2 32 6 45h-76c10 -18 13 -44 13 -83v-445c0 -45 -3 -75 -13 -94h83"],8511:[702,0,883,80,803,"803 20c0 -13 -7 -20 -20 -20h-277c-13 0 -20 7 -20 20v2c0 13 6 19 19 20c65 4 71 18 71 92v445c0 66 -10 76 -80 82h-109c-70 -6 -80 -16 -80 -82v-456c0 -62 10 -75 72 -81c12 -1 18 -8 18 -20v-2c0 -13 -7 -20 -20 -20h-277c-13 0 -20 7 -20 20v2c0 13 6 19 19 20 c65 4 71 18 71 92v445c0 63 -9 75 -72 81c-12 1 -18 8 -18 20v2c0 13 7 20 20 20h683c13 0 20 -7 20 -20v-2c0 -12 -6 -19 -18 -20c-63 -6 -72 -18 -72 -81v-456c0 -62 10 -75 72 -81c12 -1 18 -8 18 -20v-2zM686 40c-10 18 -13 44 -13 83v456c0 39 2 65 12 83h-82 c10 -18 13 -44 13 -83v-445c0 -45 -2 -75 -12 -94h82zM280 40c-10 18 -13 44 -13 83v456c0 39 3 65 13 83h-82c10 -18 12 -44 12 -83v-445c0 -45 -2 -75 -12 -94h82"],8512:[728,228,884,80,803,"803 -17l-51 -196c-2 -10 -9 -15 -19 -15h-630c-14 0 -23 7 -23 16c0 4 2 9 6 15l261 417l-255 479c-3 6 -4 11 -4 15c0 9 9 14 22 14h601c13 0 19 -6 20 -19l9 -150c1 -14 -9 -22 -19 -22c-9 0 -19 5 -21 17c-9 43 -19 84 -33 102c-21 23 -76 32 -145 32h-261l192 -355 c2 -3 3 -6 3 -9c0 -4 -2 -9 -4 -12l-248 -398h400c91 0 130 8 162 82c4 9 11 13 18 13c12 0 23 -10 19 -26zM411 323l-197 365h-71l228 -427zM740 -102c-31 -20 -73 -24 -136 -24h-426l-39 -62h579"],8517:[702,0,869,43,834,"824 354c-42 -200 -233 -354 -461 -354h-303c-13 0 -19 7 -16 20l1 2c2 12 10 20 22 20c63 0 76 19 89 81l97 456c14 64 10 81 -55 81c-12 0 -16 8 -13 20v2c3 13 11 20 24 20h288c261 0 373 -133 327 -348zM784 354c27 124 -7 215 -95 265c49 -65 48 -163 25 -272 c-21 -97 -50 -176 -98 -235c85 58 147 143 168 242zM674 347c36 172 12 315 -214 315c-32 0 -43 -4 -48 -29l-120 -562c-5 -25 4 -31 36 -31c230 0 305 116 346 307zM380 662h-80c5 -17 2 -43 -7 -83l-97 -456c-8 -39 -17 -65 -29 -83h82c-1 9 1 19 3 31l120 562 c2 11 5 21 8 29"],8518:[723,8,699,80,659,"658 703l-121 -573c-8 -38 -5 -48 24 -48c3 0 4 0 14 1c15 2 21 -5 17 -20v-1c-2 -9 -8 -16 -17 -19l-178 -51c-15 -5 -15 12 -14 18l7 34c-47 -40 -87 -52 -134 -52c-120 0 -198 93 -169 231c33 152 175 271 300 271c35 0 59 -7 92 -34l29 139c7 33 2 41 -29 41 c-10 0 -17 1 -17 1c-12 2 -17 10 -15 19c2 8 9 17 22 20l167 42c19 5 26 -2 22 -19zM613 676l-66 -13c8 -12 8 -32 1 -64l-118 -556l67 15c-8 13 -8 35 0 72zM456 352c10 50 -24 106 -74 106c-74 0 -137 -87 -160 -195c-25 -117 9 -201 90 -201c27 0 52 10 73 28 c10 8 19 17 20 22zM265 32c-74 20 -110 106 -83 231c10 47 28 96 57 136c-44 -32 -98 -113 -112 -176c-23 -112 39 -190 138 -191"],8519:[500,10,624,83,552,"551 311c-1 -15 -10 -23 -25 -23h-302c-10 -60 -9 -91 2 -127c18 -53 54 -78 108 -78c62 0 108 27 170 98c5 5 12 9 20 9c13 -1 23 -11 12 -28c-69 -112 -163 -172 -266 -172c-126 0 -212 93 -180 244c33 158 175 266 312 266c57 0 104 -24 129 -63 c20 -32 25 -62 20 -126zM512 328c1 39 -3 61 -17 83c-12 19 -30 33 -53 41c20 -24 22 -64 14 -124h56zM415 329c10 65 2 122 -54 122c-54 0 -96 -50 -125 -122h179zM358 45c-11 -1 -22 -2 -33 -2c-70 0 -116 32 -139 99c-13 44 -16 83 1 165c5 20 24 60 44 93 c-49 -36 -90 -115 -101 -166c-27 -125 44 -204 148 -204c27 0 54 5 80 15"],8520:[728,0,455,43,403,"402 645c-10 -46 -57 -83 -103 -83s-78 37 -68 83s57 83 103 83s78 -37 68 -83zM356 475l-76 -360c-14 -62 12 -70 43 -78c13 -2 17 -7 16 -18c-1 -12 -12 -19 -25 -19h-253c-13 0 -20 7 -17 19c3 11 11 16 24 18c33 4 69 16 83 78l50 238c8 36 5 44 -14 51 c-12 4 -23 -2 -36 -4c-10 -2 -14 11 -12 22c1 7 5 13 12 15l192 56c26 8 13 -18 13 -18zM362 645c5 24 -13 43 -37 43s-49 -19 -54 -43s12 -43 36 -43s50 19 55 43zM309 443l-68 -16c8 -15 8 -39 0 -74l-50 -238c-6 -28 -17 -54 -30 -75h76c-4 21 -4 46 3 75"],8521:[728,218,493,6,511,"463 476l-98 -461c-32 -152 -136 -233 -261 -233c-65 0 -104 30 -96 67c6 27 36 61 67 61c35 0 42 -21 59 -47c12 -18 9 -25 23 -25c12 0 23 7 31 15c15 18 22 42 38 117l82 387c7 35 6 50 -13 50c-10 0 -42 -6 -42 -6c-16 -3 -23 8 -21 20c2 8 8 15 19 19l189 55 c5 1 8 2 11 2c11 0 15 -7 12 -21zM108 -178c-9 17 -11 48 -39 48c-13 0 -20 -8 -23 -21c-4 -18 31 -25 62 -27zM417 448l-73 -17c10 -14 12 -37 4 -74l-82 -387c-10 -45 -18 -74 -27 -95c31 32 73 80 86 140zM510 645c-10 -46 -58 -83 -104 -83s-77 37 -67 83s57 83 103 83 s78 -37 68 -83zM470 645c5 24 -13 43 -37 43s-49 -19 -54 -43s12 -43 36 -43s50 19 55 43"],120120:[714,0,923,80,843,"843 22c0 -11 -7 -22 -20 -22h-263c-13 0 -20 9 -20 20s6 21 19 21c44 0 53 6 53 23c0 15 -8 38 -19 66l-49 102h-269l-51 -124c-7 -16 -13 -28 -13 -37c0 -10 4 -31 55 -31c12 0 18 -11 17 -20c0 -10 -9 -20 -23 -20h-158c-14 0 -22 11 -22 21c0 9 6 19 19 19 c42 0 62 28 121 163l212 499c3 7 10 12 18 12h28c8 0 15 -5 18 -12l254 -577c31 -65 39 -83 74 -83c13 0 19 -9 19 -20zM751 40c-11 15 -22 37 -37 68l-250 568l-41 -94l206 -435c16 -34 23 -64 23 -83c0 -9 -1 -17 -3 -24h102zM524 274l-121 259l-110 -259h231"],120121:[702,0,806,80,726,"726 196c0 -52 -22 -102 -62 -137c-39 -35 -126 -59 -209 -59h-355c-13 0 -20 10 -20 21s6 20 19 20c67 0 80 18 80 82v456c0 65 -14 82 -80 82c-13 0 -19 10 -19 21s7 20 20 20h300c187 0 291 -64 291 -186c0 -45 -18 -87 -45 -110c-20 -17 -43 -28 -77 -37 c47 -13 78 -26 103 -49c33 -31 54 -76 54 -124zM651 516c0 70 -41 111 -120 138c44 -32 60 -83 60 -142c0 -41 -9 -78 -33 -106c27 8 46 16 62 30c19 17 31 47 31 80zM551 512c0 86 -56 150 -168 150h-45c-10 0 -12 -7 -12 -20v-254h87c90 0 138 50 138 124zM686 196 c0 36 -16 69 -40 94c-21 18 -46 29 -83 40c36 -33 50 -79 50 -135c0 -72 -24 -113 -85 -150c44 8 88 24 110 44c30 27 48 67 48 107zM573 195c0 60 -23 108 -78 131c-33 14 -77 18 -169 19v-274c0 -26 13 -31 54 -31c66 0 106 28 138 45c38 23 55 58 55 110zM290 40 c-3 9 -4 19 -4 31v571c0 7 0 15 1 20h-80c10 -18 12 -44 12 -83v-456c0 -38 -2 -65 -12 -83h83"],120123:[702,0,869,80,789,"789 354c0 -200 -158 -354 -386 -354h-303c-13 0 -20 7 -20 20v2c0 12 6 20 18 20c63 0 72 19 72 81v456c0 64 -7 81 -72 81c-12 0 -18 8 -18 20v2c0 13 7 20 20 20h288c261 0 401 -133 401 -348zM749 354c0 124 -53 215 -152 265c63 -65 83 -163 83 -272 c0 -97 -12 -176 -48 -235c73 58 117 143 117 242zM640 347c0 172 -55 315 -281 315c-32 0 -42 -4 -42 -29v-562c0 -25 10 -31 42 -31c230 0 281 116 281 307zM280 40c-2 9 -3 19 -3 31v562c0 11 1 21 2 29h-80c9 -17 11 -43 11 -83v-456c0 -39 -3 -65 -12 -83h82"],120124:[702,0,795,80,714,"714 170l-41 -155c-2 -9 -9 -15 -19 -15h-554c-13 0 -20 11 -20 22c0 10 6 20 18 20c63 0 72 19 72 81v456c0 62 -12 81 -72 81c-12 0 -18 8 -18 20v2c0 13 7 20 20 20h552c13 0 20 -7 20 -20l3 -128c0 -9 -10 -18 -18 -18c-11 0 -22 4 -22 14c-3 104 -26 111 -154 111 h-140c-19 0 -24 -4 -24 -24v-249h149c75 0 109 7 109 78c0 12 12 20 20 19s20 -9 20 -20v-196c0 -11 -12 -19 -20 -20s-20 10 -20 20c0 53 -24 79 -109 79h-149v-275c0 -14 0 -21 4 -24c9 -7 48 -9 95 -9h28c186 0 205 19 233 144c2 9 13 13 23 11c11 -2 17 -14 14 -25z M281 40c-2 8 -4 19 -4 33v564c0 10 0 18 1 25h-81c10 -18 13 -44 13 -83v-456c0 -39 -3 -65 -13 -83h84"],120125:[702,0,756,80,676,"676 555c1 -14 -8 -22 -18 -22c-9 0 -21 4 -22 17c-10 91 -3 111 -156 111h-141c-19 0 -22 -4 -22 -24v-249h139c92 0 109 11 109 80c0 12 10 19 19 19c10 1 21 -7 21 -22v-196c0 -14 -10 -21 -20 -21c-9 0 -20 6 -20 18c0 67 -20 82 -109 82h-139v-225 c0 -63 11 -78 75 -82c13 -1 19 -7 19 -20v-1c0 -13 -7 -20 -20 -20h-291c-13 0 -20 7 -20 20v2c0 13 6 20 19 20c64 0 71 19 71 92v445c0 61 -10 81 -72 81c-12 0 -18 8 -18 20v2c0 13 7 20 20 20h551c13 0 20 -6 20 -19zM290 40c-10 18 -13 45 -13 83v514c0 10 1 19 3 25 h-83c10 -18 13 -44 13 -83v-445c0 -45 -3 -75 -13 -94h93"],120126:[719,14,897,80,817,"817 365c0 -11 -6 -21 -18 -21c-47 0 -54 -6 -54 -67v-203c0 -5 -3 -13 -7 -16c-46 -36 -183 -72 -272 -72c-212 0 -386 132 -386 359c0 216 162 371 373 371c47 0 107 -7 154 -24c16 -6 38 -10 47 -10c16 0 30 9 36 22c4 10 12 15 19 15c10 0 18 -8 19 -22l8 -198 c1 -14 -10 -22 -21 -22c-9 0 -19 6 -19 19c-5 109 -70 178 -225 178c-135 0 -237 -143 -237 -328c0 -184 92 -319 254 -319c66 0 116 41 116 71v167c0 70 -5 79 -71 79c-13 0 -19 10 -19 21s7 20 20 20h263c13 0 20 -9 20 -20zM714 345h-85c9 -17 15 -43 15 -80v-167 c0 -14 -6 -30 -18 -47c32 10 61 21 79 34v192c0 31 2 52 9 68zM308 646c-113 -52 -188 -162 -188 -301c0 -138 72 -235 177 -284c-66 63 -103 164 -103 285c0 127 45 234 114 300"],120128:[702,0,517,80,437,"437 21c0 -11 -7 -21 -20 -21h-317c-13 0 -20 10 -20 21s6 20 19 20c72 0 84 16 84 82v456c0 66 -9 82 -84 82c-13 0 -19 10 -19 21s7 20 20 20h317c13 0 20 -9 20 -20s-6 -21 -19 -21c-74 0 -85 -18 -85 -82v-456c0 -64 14 -82 85 -82c13 0 19 -9 19 -20zM307 40 c-11 18 -14 45 -14 83v456c0 38 3 65 13 83h-95c10 -18 12 -44 12 -83v-456c0 -38 -3 -65 -12 -83h96"],120129:[702,14,600,80,520,"520 682c0 -11 -6 -22 -18 -22c-73 0 -79 -16 -79 -81v-380c0 -134 -76 -213 -218 -213c-67 0 -125 26 -125 85c0 31 20 72 64 72c47 0 66 -23 81 -58c10 -22 6 -55 20 -55c24 0 30 34 30 74v475c0 65 -6 81 -80 81c-12 0 -18 10 -18 22c0 11 7 20 20 20h303 c13 0 20 -9 20 -20zM207 24c-7 10 -12 31 -18 45c-9 19 -18 34 -45 34c-18 0 -24 -19 -24 -32c0 -37 53 -47 87 -47zM395 662h-92c10 -18 12 -44 12 -83v-475c0 -20 -3 -39 -8 -54c50 26 76 78 76 149v380c0 39 2 65 12 83"],120130:[702,0,929,80,849,"849 21c0 -10 -7 -21 -20 -21h-325c-13 0 -20 11 -20 22s7 20 20 20c45 0 52 2 52 12c0 24 -54 93 -130 167l-107 107v-205c0 -63 9 -76 73 -81c13 -1 19 -9 19 -20c0 -12 -7 -22 -20 -22h-291c-13 0 -20 11 -20 22s6 20 19 20c65 0 73 19 73 92v445c0 62 -6 81 -74 81 c-12 0 -18 10 -18 22c0 11 7 20 20 20h293c13 0 20 -9 20 -20c0 -12 -6 -22 -18 -22c-67 0 -76 -17 -76 -81v-184l183 165c55 50 67 66 67 80c0 17 -11 20 -50 20c-13 0 -20 11 -20 22s7 20 20 20h241c13 0 20 -9 20 -20c0 -12 -7 -22 -20 -22c-80 0 -94 -5 -126 -34 l-212 -194l263 -283c85 -92 96 -108 145 -108c13 0 19 -9 19 -20zM736 40c-21 18 -46 43 -81 81l-264 285l-54 -40l117 -117c85 -85 142 -167 142 -195c0 -5 -1 -10 -2 -14h142zM291 40c-9 18 -12 44 -12 83v456c0 39 2 65 12 83h-92c10 -18 13 -44 13 -83v-445 c0 -45 -2 -75 -13 -94h92"],120131:[702,0,795,80,714,"291 662h-94c10 -18 13 -44 13 -83v-456c0 -39 -3 -65 -13 -83h84c-3 9 -4 20 -4 32v507c0 39 3 65 14 83zM714 170l-41 -155c-2 -9 -9 -15 -19 -15h-554c-13 0 -20 11 -20 22c0 10 6 20 18 20c67 0 72 19 72 81v456c0 62 -4 81 -72 81c-12 0 -18 11 -18 22s7 20 20 20 h294c13 0 20 -11 20 -22s-6 -20 -19 -20c-72 0 -78 -18 -78 -81v-506c0 -31 15 -33 109 -33h28c179 0 185 12 223 144c2 9 13 13 23 11c11 -2 17 -14 14 -25"],120132:[702,0,1037,80,957,"957 22c0 -11 -7 -22 -20 -22h-288c-13 0 -20 11 -20 22s6 20 19 20c68 0 74 19 74 92v386l-259 -509c-4 -7 -9 -9 -14 -9s-10 2 -14 10l-216 476v-326c0 -93 9 -120 87 -120c13 0 19 -11 19 -22s-7 -20 -20 -20h-205c-13 0 -20 11 -20 22s6 20 19 20c70 0 80 26 80 120 v417c0 71 -10 82 -78 82c-13 0 -19 10 -19 21s7 20 20 20h153c8 0 15 -5 18 -12l234 -504l256 505c3 7 11 11 18 11h156c13 0 20 -11 20 -22c0 -10 -6 -20 -18 -20c-65 0 -71 -12 -71 -81v-456c0 -61 10 -81 71 -81c12 0 18 -10 18 -20zM841 40c-10 18 -13 44 -13 83v456 c0 39 3 65 13 83h-48l-31 -61v-467c0 -45 -3 -75 -13 -94h92zM484 141l-241 521h-38c9 -8 14 -42 14 -78l232 -508"],120134:[716,14,873,80,793,"793 347c0 -213 -153 -361 -362 -361c-181 0 -351 157 -351 365c0 213 155 365 357 365c190 0 356 -147 356 -369zM753 347c0 134 -66 237 -162 289c53 -64 88 -163 88 -288c0 -90 -22 -205 -83 -281c96 53 157 154 157 280zM639 348c0 196 -89 328 -202 328 c-116 0 -203 -132 -203 -327c0 -185 85 -323 197 -323c164 0 208 193 208 322zM283 639c-98 -53 -163 -158 -163 -288c0 -122 66 -225 158 -281c-51 65 -84 163 -84 279c0 125 35 226 89 290"],120138:[716,17,679,79,599,"599 184c0 -111 -127 -198 -254 -198c-42 0 -86 8 -127 24c-17 7 -33 11 -46 11c-14 0 -23 -5 -23 -18c0 -9 -7 -20 -21 -20c-15 0 -18 13 -19 21l-29 199c-2 12 8 26 16 26c15 0 21 -7 22 -15c10 -54 17 -90 27 -105c34 -54 130 -82 198 -82c70 0 99 60 99 122 c0 93 -68 120 -164 171c-123 63 -169 125 -169 209c0 106 125 187 219 187c38 0 77 -8 116 -23c12 -5 27 -9 40 -9c14 0 26 4 31 17c3 9 12 15 19 15c8 0 19 -8 20 -18l21 -200c1 -11 -6 -24 -17 -24c-15 0 -21 9 -22 16c-6 57 -10 76 -31 112c-18 32 -81 73 -175 73 c-51 0 -80 -56 -80 -106c0 -54 43 -96 148 -151c144 -77 201 -146 201 -234zM559 184c0 76 -55 131 -179 198c-125 67 -170 123 -170 187c0 27 7 55 19 78c-45 -26 -80 -68 -80 -118c0 -72 44 -120 147 -173c114 -61 186 -98 186 -207c0 -35 -8 -69 -23 -97 c57 28 100 75 100 132"],120139:[702,0,800,79,720,"720 527c1 -14 -9 -25 -20 -25s-21 9 -21 21c-2 51 -6 100 -22 118c-17 19 -29 21 -137 21h-45v-539c0 -64 12 -82 80 -82c13 0 19 -10 19 -21s-7 -20 -20 -20h-306c-13 0 -20 10 -20 21s6 20 19 20c69 0 78 18 78 93v528h-45c-67 0 -120 -2 -137 -21 c-16 -18 -20 -67 -22 -118c0 -12 -11 -17 -21 -17c-11 0 -21 7 -20 21l6 156c0 13 7 19 20 19h588c13 0 19 -6 20 -19zM448 40c-10 18 -13 45 -13 83v539h-70v-528c0 -45 -3 -75 -13 -94h96"],120140:[702,14,911,80,831,"831 680c0 -10 -6 -20 -18 -20c-87 0 -93 -8 -93 -120v-268c0 -216 -69 -286 -259 -286c-182 0 -289 66 -289 273v320c0 72 -7 81 -74 81c-12 0 -18 11 -18 22s7 20 20 20h292c13 0 21 -9 21 -20c0 -14 -7 -22 -19 -22c-69 0 -75 -10 -75 -81v-328 c0 -145 56 -224 143 -224c159 0 218 61 218 236v277c0 112 -9 120 -91 120c-12 0 -18 11 -18 22s7 20 20 20h220c13 0 20 -11 20 -22zM340 42c-38 44 -61 114 -61 209v328c0 40 2 65 12 83h-91c10 -18 12 -44 12 -83v-320c0 -125 46 -189 128 -217"],120141:[702,13,892,80,812,"812 682c0 -12 -7 -22 -19 -22c-50 0 -56 -11 -86 -88l-224 -570c-4 -10 -13 -15 -24 -15c-8 1 -16 7 -19 14l-250 559c-36 80 -43 99 -90 100c-13 0 -20 8 -20 22c0 11 7 20 20 20h275c13 0 20 -9 20 -20c0 -12 -6 -22 -19 -22c-55 0 -58 -4 -58 -22 c0 -15 9 -37 41 -110l153 -341l137 350c12 29 30 75 30 92c0 25 -27 31 -66 31c-13 0 -19 11 -19 22s7 20 20 20h178c13 0 20 -9 20 -20zM492 136l-169 376c-38 83 -45 109 -45 126c0 9 0 17 1 24h-99c13 -19 27 -46 46 -85l234 -523"],120142:[702,14,1167,80,1087,"1087 682c0 -11 -5 -22 -16 -22c-46 0 -63 -4 -84 -65l-206 -593c-4 -11 -12 -16 -24 -16c-14 0 -19 8 -22 16l-158 417l-150 -417c-4 -12 -12 -16 -25 -16s-19 8 -22 16l-195 546c-31 86 -45 112 -87 112c-12 0 -18 10 -18 22c0 11 7 20 20 20h241c13 0 20 -9 20 -20 s-6 -21 -18 -21c-27 0 -38 -5 -38 -22c0 -10 4 -26 11 -44l145 -380l94 264l-38 97c-28 72 -31 85 -74 85c-13 0 -19 10 -19 21s7 20 20 20h264c13 0 20 -10 20 -21s-6 -20 -19 -20c-39 0 -60 -6 -60 -25c0 -11 7 -28 15 -48l13 -32l134 -344l119 342c12 35 19 59 19 74 c0 29 -21 32 -68 32c-12 0 -18 11 -18 22s7 20 20 20h184c13 0 20 -9 20 -20zM441 158l-162 423c-8 22 -13 44 -13 58c0 8 1 16 3 23h-95c16 -20 31 -52 50 -100l181 -506zM791 153l-163 420c-12 28 -18 48 -18 63c0 9 2 18 6 26h-94c11 -16 21 -39 34 -72l202 -532"],120143:[702,0,914,80,834,"834 22c0 -11 -7 -22 -20 -22h-296c-13 0 -20 11 -20 22s6 20 19 20c47 0 50 3 50 20c0 15 -20 47 -52 95l-88 130l-114 -139c-37 -45 -55 -67 -55 -82c0 -19 13 -24 75 -24c12 0 18 -11 18 -22s-7 -20 -20 -20h-231c-13 0 -20 11 -20 22c0 10 6 20 18 20 c58 0 85 11 168 112l138 168l-124 182c-92 133 -112 157 -170 157c-12 0 -18 10 -18 21s7 20 20 20h302c13 0 20 -9 20 -20s-8 -21 -19 -21c-39 0 -49 -5 -49 -20c0 -22 29 -63 87 -149l48 -71l123 152c27 35 49 51 49 66c0 16 -11 22 -74 22c-13 0 -29 7 -29 21 c0 11 7 20 20 20h216c13 0 20 -9 20 -20s-6 -22 -19 -22c-50 0 -63 -2 -137 -94l-144 -180l192 -273c39 -52 45 -71 98 -71c12 0 18 -10 18 -20zM726 40c-12 12 -24 28 -40 49l-265 380c-69 95 -95 146 -95 172c0 8 1 15 3 21h-123c27 -25 58 -66 106 -136l237 -347 c38 -58 58 -98 58 -117c0 -8 0 -15 -1 -22h120"],120144:[702,0,903,80,823,"823 682c0 -11 -7 -22 -20 -22c-51 0 -67 -6 -141 -131l-132 -222v-184c0 -67 10 -82 87 -82c13 0 19 -10 19 -21s-7 -20 -20 -20h-320c-13 0 -20 10 -20 21s6 20 19 20c79 0 85 16 85 93v175l-133 195c-101 149 -108 156 -148 156c-13 0 -19 11 -19 22s7 20 20 20h292 c13 0 20 -9 20 -20c0 -12 -6 -22 -18 -22c-36 0 -66 -5 -66 -28c0 -9 4 -20 14 -34l167 -249l141 235c15 24 21 41 21 52c0 22 -24 25 -60 25c-13 0 -19 10 -19 21s7 20 20 20h191c13 0 20 -9 20 -20zM503 40c-10 18 -13 45 -13 83v182l-181 270c-17 25 -25 44 -25 59 c0 10 4 19 10 28h-118c24 -25 56 -67 104 -136l137 -199c1 -2 3 -11 3 -11v-182c0 -45 -2 -75 -12 -94h95"],120146:[500,10,630,80,550,"550 57c0 -3 -3 -11 -5 -13c-38 -41 -62 -54 -100 -54c-39 0 -83 14 -93 68c-66 -51 -106 -68 -147 -68c-71 0 -125 50 -125 122c0 37 16 75 41 98c44 40 67 49 226 112v56c0 49 -24 76 -69 76c-35 0 -63 -17 -63 -41c0 -6 2 -12 4 -18c2 -7 4 -14 4 -23 c0 -28 -32 -54 -63 -54c-30 0 -55 25 -55 55c0 29 18 63 47 87c30 24 83 40 139 40c69 0 123 -9 160 -65c24 -37 22 -56 22 -112v-203c0 -36 1 -49 20 -49c10 0 18 2 28 8c5 3 10 4 13 4c10 0 16 -8 16 -22v-4zM183 376c0 17 -6 22 -10 28c-2 4 -3 10 -1 20 c-16 -15 -27 -34 -27 -51c0 -8 7 -15 15 -15c13 0 23 4 23 18zM347 139v134c-112 -42 -149 -73 -149 -128v-4c0 -38 25 -69 56 -69c20 0 47 7 71 21c18 11 22 19 22 46zM233 34c-60 25 -70 64 -73 87c-1 9 -2 17 -2 25c0 12 2 25 6 44c-28 -17 -44 -57 -44 -78 c0 -40 31 -81 85 -81c9 0 18 1 28 3zM470 34c-27 2 -37 29 -37 86v203c0 81 -22 105 -76 127c23 -16 30 -43 30 -72l-1 -205c0 -39 0 -69 1 -76c4 -50 30 -67 58 -67c9 0 17 1 25 4"],120147:[723,10,695,80,615,"615 260c0 -153 -120 -270 -263 -270c-90 0 -202 43 -202 76v532c0 35 -7 42 -40 42c-22 0 -30 9 -30 19c0 9 7 19 17 21c4 1 23 4 23 4c49 13 97 22 139 38c18 7 20 -18 20 -32v-256c31 36 81 59 133 59c108 0 203 -101 203 -233zM574 279c0 68 -60 174 -161 174 c-13 0 -27 -2 -42 -6c94 0 162 -89 162 -234c0 -34 -4 -70 -12 -96c16 29 53 44 53 162zM493 213c0 117 -46 194 -122 194c-47 0 -92 -21 -92 -56v-268c0 -23 42 -49 90 -49c79 0 124 73 124 179zM268 36c-26 21 -29 26 -29 73v562c-44 -15 -48 -8 -62 -13 c7 -12 13 -33 13 -60v-519c0 -21 58 -43 78 -43"],120148:[500,10,608,80,528,"475 382c0 28 -24 51 -59 65c4 -8 8 -18 11 -30l6 -24c4 -14 11 -25 22 -25c10 0 20 6 20 14zM380 47c-11 -2 -24 -1 -24 -1c-114 0 -192 93 -192 232c0 33 9 83 27 126c-48 -41 -71 -120 -71 -173c0 -115 70 -201 171 -201c8 0 34 1 57 5c13 3 25 6 32 12zM528 162 c0 -3 -1 -7 -3 -11c-19 -42 -55 -88 -86 -114c-47 -39 -99 -47 -148 -47c-123 0 -211 102 -211 241c0 160 141 269 262 269c96 0 173 -56 173 -118c0 -28 -26 -54 -60 -54c-27 0 -52 21 -60 55l-6 23c-10 34 -21 53 -53 53c-81 0 -134 -79 -134 -181 c0 -113 62 -192 154 -192c54 0 91 24 134 85c5 8 13 11 20 11c9 -1 18 -9 18 -20"],120149:[723,8,699,80,619,"619 62c0 -9 -5 -16 -13 -19l-167 -51c-14 -5 -18 12 -18 18v34c-39 -40 -76 -52 -123 -52c-120 0 -218 93 -218 231c0 152 117 271 242 271c35 0 60 -7 99 -34v139c0 33 -7 41 -38 41c-10 0 -17 1 -17 1c-13 2 -19 10 -19 19c0 8 5 17 17 20l159 42c17 5 26 -2 26 -19 v-573c0 -38 6 -48 35 -48c3 0 4 0 13 1c15 2 22 -5 22 -20v-1zM525 58c-11 13 -16 35 -16 72v546l-63 -13c11 -12 15 -32 15 -64v-556zM421 112v240c0 50 -46 106 -96 106c-74 0 -119 -87 -119 -195c0 -117 52 -201 133 -201c27 0 50 10 67 28c8 8 15 17 15 22zM298 32 c-78 20 -132 106 -132 231c0 47 8 96 28 136c-37 -32 -74 -113 -74 -176c0 -112 79 -190 178 -191"],120150:[500,10,624,80,544,"542 162c-46 -112 -127 -172 -230 -172c-126 0 -232 93 -232 244c0 158 119 266 256 266c57 0 109 -24 142 -63c27 -32 38 -62 47 -126c2 -15 -5 -23 -20 -23h-302c3 -60 10 -91 29 -127c29 -53 70 -78 124 -78c62 0 103 27 150 98c3 5 10 9 18 9c13 -1 25 -11 18 -28z M482 328c-7 39 -16 61 -34 83c-16 19 -37 33 -62 41c25 -24 36 -64 40 -124h56zM385 329c-4 65 -24 122 -80 122c-54 0 -85 -50 -99 -122h179zM388 45c-10 -1 -21 -2 -32 -2c-70 0 -123 32 -160 99c-23 44 -34 83 -34 165c0 20 11 60 24 93c-41 -36 -66 -115 -66 -166 c0 -125 88 -204 192 -204c27 0 53 5 76 15"],120151:[723,0,583,80,503,"503 649c0 -30 -22 -53 -65 -53c-19 0 -37 10 -56 43c-16 26 -17 34 -37 34c-34 0 -49 -28 -49 -80v-118h109c13 0 20 -10 20 -21s-7 -20 -20 -20h-108v-314c0 -67 42 -74 79 -80c11 -2 17 -10 17 -20s-5 -20 -17 -20h-276c-13 0 -20 10 -20 21s6 19 19 20 c60 3 68 16 68 79v314h-66c-13 0 -20 10 -20 21s7 20 20 20h66c3 81 13 126 39 168c28 50 107 80 177 80c71 0 120 -33 120 -74zM462 649c0 20 -22 31 -64 34c8 -5 14 -17 19 -27c5 -12 13 -22 24 -22s21 1 21 15zM267 40c-7 18 -10 43 -10 80l1 473c0 9 0 32 6 62 c-25 -34 -57 -63 -57 -201v-334c0 -37 -2 -62 -10 -80h70"],120152:[500,218,632,80,552,"552 436c0 -13 -7 -20 -20 -20h-69c15 -29 32 -48 32 -87c0 -55 -27 -94 -64 -124c-33 -30 -77 -46 -119 -46c-6 0 -41 2 -66 5c-20 -17 -25 -17 -25 -34c0 -13 43 -16 71 -17l135 -6c71 -4 116 -71 116 -141c0 -42 -19 -77 -63 -112c-56 -44 -138 -72 -219 -72 c-106 0 -181 52 -181 110c0 36 12 75 81 131c-38 20 -44 30 -44 49c0 23 12 47 51 79l34 32c-66 37 -99 77 -99 139c0 99 92 178 194 178c30 0 57 -6 89 -21c40 -17 55 -22 75 -22h71c13 0 20 -7 20 -20v-1zM455 329c0 25 -25 99 -73 109c30 -55 42 -101 42 -149 c0 -14 -6 -42 -8 -54c32 29 39 61 39 94zM384 289c0 38 -12 84 -31 118c-14 27 -38 43 -66 43c-42 0 -67 -34 -67 -89c0 -92 38 -157 96 -157c42 0 68 34 68 85zM218 220c-24 34 -38 83 -38 141c0 0 2 35 5 48c-20 -23 -42 -54 -42 -87c0 -45 28 -74 75 -102zM499 7 c-18 37 -23 53 -91 63c-44 6 -69 5 -117 7c-42 2 -112 -4 -104 36c-6 -7 -29 -17 -29 -41c0 -29 103 -38 217 -41c50 -1 91 -4 124 -24zM492 -49c0 33 -33 40 -118 40c-46 0 -121 5 -164 13c-38 -45 -26 -57 -26 -78c0 -41 58 -64 142 -64s166 33 166 89zM303 -181 c-111 14 -161 56 -161 107c0 0 -1 7 2 17c-12 -14 -24 -38 -24 -51c0 -44 61 -74 141 -74c7 0 33 0 42 1"],120153:[721,0,725,80,645,"645 18c0 -12 -11 -18 -22 -18h-213c-11 0 -23 6 -23 18c0 11 6 18 21 20c46 5 42 20 42 77v203c0 64 -21 108 -67 108c-35 0 -65 -28 -103 -70l-1 -241c0 -62 -1 -69 42 -77c16 -3 23 -9 23 -20c0 -12 -12 -18 -23 -18h-216c-11 0 -22 6 -22 18c0 11 4 18 19 20 c47 7 49 17 49 77v483c0 35 -6 41 -42 41c-20 0 -29 9 -29 19s8 20 23 22l18 3c59 17 104 24 133 36c27 11 25 -18 25 -18v-277c50 53 91 69 141 69c90 0 158 -60 158 -174v-204c0 -58 2 -69 45 -77c16 -3 22 -9 22 -20zM546 40c-6 16 -8 40 -8 75v204 c0 86 -48 135 -116 135c-3 0 -11 -1 -14 -1c50 -12 82 -56 82 -135v-203c0 -34 -2 -58 -9 -75h65zM244 40c-4 17 -5 41 -5 75v556c-12 -3 -42 -8 -58 -12c8 -12 10 -31 10 -61v-483c0 -35 -1 -59 -7 -75h60"],120154:[728,0,455,79,375,"305 645c0 -46 -40 -83 -86 -83s-85 37 -85 83s39 83 85 83s86 -37 86 -83zM375 19c1 -12 -8 -19 -21 -19h-253c-13 0 -22 7 -21 19c1 11 7 16 20 18c32 4 66 16 66 78v238c0 36 -4 44 -25 51c-13 4 -23 -2 -35 -4c-9 -2 -17 11 -17 22c0 7 3 13 9 15l180 56 c24 8 17 -18 17 -18v-360c0 -62 27 -70 60 -78c13 -2 19 -7 20 -18zM265 645c0 24 -22 43 -46 43s-45 -19 -45 -43s21 -43 45 -43s46 19 46 43zM268 40c-8 21 -13 46 -13 75v328l-65 -16c11 -15 16 -39 16 -74v-238c0 -28 -5 -54 -14 -75h76"],120155:[728,218,493,80,413,"402 15c0 -152 -87 -233 -212 -233c-65 0 -110 30 -110 67c0 27 23 61 54 61c35 0 47 -21 69 -47c16 -18 14 -25 28 -25c12 0 22 7 28 15c11 18 13 42 13 117v387c0 35 -5 50 -24 50c-10 0 -40 -6 -40 -6c-16 -3 -25 8 -25 20c0 8 4 15 14 19l178 55c4 1 8 2 11 2 c10 0 16 -7 16 -21v-461zM186 -178c-13 17 -21 48 -49 48c-13 0 -19 -8 -19 -21c0 -18 36 -25 68 -27zM362 15v433l-70 -17c13 -14 20 -37 20 -74v-387c0 -45 -2 -74 -6 -95c24 32 56 80 56 140zM413 645c0 -46 -40 -83 -86 -83s-85 37 -85 83s39 83 85 83s86 -37 86 -83z M373 645c0 24 -22 43 -46 43s-45 -19 -45 -43s21 -43 45 -43s46 19 46 43"],120156:[723,0,754,79,674,"674 19c0 -10 -8 -19 -22 -19h-245c-13 0 -20 10 -20 20s7 20 20 20h11c6 0 11 1 11 5c0 8 -19 26 -19 26l-120 136v-125c0 -29 4 -40 38 -41l12 -1c13 -1 19 -10 19 -19c1 -10 -7 -21 -21 -21l-236 1c-15 0 -23 11 -22 21c0 9 7 17 19 19c58 9 61 13 61 57v492 c0 39 -7 51 -34 51c-10 0 -21 -2 -21 -2c-15 -3 -24 8 -24 19c0 8 5 17 15 20l168 44c17 5 26 -2 26 -19v-390l155 101c12 10 20 19 20 26c0 10 -9 0 -32 1c-13 1 -20 11 -20 20c0 10 7 20 20 20l194 1c14 0 20 -10 20 -20s-6 -20 -20 -20c-17 0 -37 -2 -51 -5 c-30 -8 -83 -46 -168 -100l-36 -23l176 -203c40 -45 66 -67 106 -71c13 -1 21 -11 20 -21zM256 41c-4 11 -6 24 -6 41v594l-66 -13c11 -14 16 -36 16 -73v-492c0 -26 0 -44 -5 -57h61zM563 40c-14 12 -29 27 -45 45l-179 210l-47 -25l148 -173s33 -33 42 -57h81"],120157:[722,0,460,80,380,"380 20c0 -10 -7 -20 -21 -20h-252c-14 0 -21 10 -21 20c0 9 6 19 19 20c52 5 64 16 64 62v488c0 38 -7 51 -34 51c-8 0 -21 -1 -32 -2c-15 -1 -23 9 -23 20c0 8 5 16 16 19l178 43c16 4 25 -2 25 -19v-603c0 -47 10 -56 61 -59c13 -1 20 -11 20 -20zM266 40 c-5 14 -7 33 -7 59v577l-68 -13c12 -13 18 -36 18 -73v-488c0 -27 -2 -47 -10 -62h67"],120158:[502,0,1022,80,942,"942 20c0 -10 -7 -20 -22 -20h-216c-14 0 -22 10 -22 20c0 8 6 17 18 20c47 10 42 16 42 64v217c0 77 -15 113 -66 113c-43 0 -60 -9 -101 -53v-269v-29c0 -31 4 -39 46 -43c13 -1 20 -10 20 -20s-8 -20 -22 -20h-211c-14 0 -21 10 -21 20s6 19 19 20c44 4 41 17 41 63 v223c0 64 -17 108 -57 108c-43 0 -50 -6 -109 -51v-300c0 -34 5 -36 43 -43c13 -2 18 -11 18 -20c0 -10 -7 -20 -22 -20h-219c-14 0 -21 10 -21 20c0 9 6 18 18 20c43 7 55 16 55 61v261c0 40 -4 56 -25 56h-10c-15 0 -24 11 -24 21c0 7 4 14 14 17c47 13 99 24 146 43 c5 2 8 3 12 3c10 0 15 -8 15 -22v-50c78 59 101 69 143 69c51 0 112 -21 138 -79c57 58 102 79 158 79c83 0 149 -65 149 -194v-213c0 -35 15 -46 54 -52c13 -2 19 -11 19 -20zM839 40c-7 13 -10 30 -10 52v213c0 99 -46 156 -109 156l-21 -2c55 -6 83 -51 83 -138v-217 c0 -30 -1 -50 -7 -64h64zM542 40c-6 16 -7 39 -7 72v268c-19 57 -60 81 -102 81l-20 -1c72 -15 74 -57 74 -134v-223c0 -28 -2 -48 -8 -63h63zM247 40c-5 11 -7 24 -7 43v367c-15 -6 -48 -11 -62 -15c9 -15 15 -38 15 -73v-261c0 -28 -3 -47 -10 -61h64"],120159:[499,0,713,80,633,"633 21c1 -10 -7 -21 -21 -21h-207c-14 0 -21 9 -21 19s6 20 19 21c39 4 38 22 38 75v216c0 61 -21 103 -66 103c-31 0 -55 -20 -100 -61v-291c0 -30 3 -39 40 -42c13 -1 18 -10 18 -19c1 -10 -6 -21 -20 -21h-210c-14 0 -21 9 -21 19s6 20 19 21c39 4 46 19 46 66v256 c0 41 -3 56 -27 56c-11 0 -15 -1 -15 -1c-16 -4 -25 8 -25 20c0 8 5 16 16 19l153 42c16 5 26 -2 26 -19v-50c47 47 84 70 141 70c91 0 153 -61 153 -166v-237c0 -39 9 -52 45 -56c13 -1 19 -10 19 -19zM537 40c-6 14 -8 32 -8 56v237c0 77 -44 129 -113 129 c-4 0 -17 -1 -21 -2c58 -3 86 -51 86 -129v-216c0 -34 -3 -58 -11 -75h67zM240 40c-4 11 -6 25 -6 42v369c-12 -4 -46 -9 -62 -14c10 -14 15 -38 15 -75v-256c0 -30 -2 -51 -9 -66h62"],120160:[501,11,661,80,581,"581 249c0 -150 -115 -260 -252 -260s-249 115 -249 262c0 150 109 250 251 250c140 0 250 -109 250 -252zM541 249c0 79 -49 161 -106 185c38 -49 61 -132 61 -221c0 -45 -11 -95 -23 -127c38 38 68 102 68 163zM456 213c0 57 -10 109 -27 151c-25 57 -63 95 -112 95 c-69 0 -112 -65 -112 -157c0 -72 16 -153 45 -205c20 -38 55 -66 91 -66c74 0 115 72 115 182zM236 47c-23 32 -48 83 -58 130c-9 40 -13 83 -13 125c0 36 6 69 17 97c-38 -35 -62 -88 -62 -148c0 -83 48 -180 116 -204"],120161:[500,217,702,80,622,"622 270c0 -155 -115 -275 -243 -275c-17 0 -53 7 -95 35v-141c0 -55 21 -56 76 -66c13 -2 18 -12 18 -21c-1 -10 -8 -19 -22 -19h-253c-14 0 -23 9 -23 19c0 9 6 19 19 21c50 9 57 16 57 59v480c0 38 -4 48 -32 48c-8 0 -13 -1 -13 -1c-15 -3 -25 8 -25 19 c0 9 5 17 16 20l154 49c4 2 8 3 12 3c10 0 16 -8 16 -21v-46c49 49 91 66 140 66c105 0 198 -95 198 -229zM582 270c0 108 -64 192 -158 192c-10 0 -35 -2 -45 -5c108 -3 158 -95 158 -227c0 -48 -8 -98 -36 -148c39 32 81 122 81 188zM497 230c0 111 -45 196 -117 196 c-42 0 -64 -16 -96 -42v-304c26 -21 55 -42 98 -42c70 0 115 85 115 192zM257 -177c-9 14 -13 35 -13 66v561c-12 -5 -47 -11 -63 -17c11 -13 15 -35 15 -71v-480c0 -27 -1 -45 -7 -59h68"],120162:[501,217,698,80,618,"618 -198c-1 -10 -10 -19 -24 -19h-247c-14 0 -21 10 -21 20s6 19 19 20c59 5 75 18 75 66v171c-52 -45 -101 -63 -153 -63c-104 0 -187 95 -187 231c0 154 115 273 251 273c38 0 70 -8 119 -36l67 30c4 3 8 4 12 4c11 0 19 -11 19 -22v-605c0 -34 4 -40 50 -49 c13 -2 20 -12 20 -21zM513 -177c-4 12 -5 27 -5 49v570c-10 -6 -41 -13 -48 -17v-536c0 -29 -3 -50 -13 -66h66zM420 108v321c0 8 -32 30 -86 30c-84 0 -133 -80 -133 -194c0 -65 21 -126 52 -155c19 -19 44 -39 73 -39c40 0 94 23 94 37zM306 42c-32 4 -60 16 -81 39 c-37 35 -64 107 -64 184c0 37 4 94 35 143c-39 -39 -76 -90 -76 -180c0 -110 63 -191 147 -191c13 0 26 2 39 5"],120163:[501,0,562,80,482,"267 40c-13 15 -20 35 -20 67v343c-13 -5 -50 -12 -68 -19c12 -14 18 -36 18 -73v-258c0 -28 -1 -46 -8 -60h78zM442 434c0 16 -22 25 -39 25c-13 0 -31 -5 -42 -15c9 0 17 -5 26 -12c14 -11 24 -24 33 -24c22 0 22 16 22 26zM482 434c0 -36 -21 -68 -52 -68 s-48 12 -59 23c-9 7 -14 14 -21 14c-23 0 -63 -38 -63 -46v-250c0 -53 22 -55 75 -68c11 -3 17 -11 17 -19c0 -12 -7 -20 -22 -20h-255c-14 0 -22 9 -22 19c0 9 5 19 18 21c52 10 59 18 59 60v258c0 36 -5 51 -25 51c-11 0 -23 -3 -23 -3c-15 -3 -27 4 -27 17 c0 8 4 17 15 21l162 54c4 2 8 3 12 3c10 0 16 -8 16 -21v-58c49 62 78 77 116 77c43 0 79 -25 79 -65"],120164:[503,14,497,80,417,"417 130c0 -78 -73 -144 -159 -144c-23 0 -52 5 -82 11c-24 6 -34 11 -46 11c-7 0 -10 -2 -12 -6c-5 -9 -12 -13 -19 -13c-9 0 -18 9 -18 23v144c0 14 9 22 19 23c9 0 18 -6 20 -18c16 -93 41 -133 136 -133c46 0 66 27 66 66c0 29 -27 50 -61 69l-62 34 c-94 53 -119 106 -119 167c0 82 63 139 157 139c27 0 52 -4 75 -12c10 -5 21 -8 26 -8c3 0 4 2 12 8c5 4 10 7 15 7c10 1 17 -9 17 -23v-124c0 -14 -11 -21 -21 -21s-16 6 -17 16c-8 90 -51 116 -106 116c-42 0 -71 -26 -71 -63c0 -24 31 -46 60 -64l115 -72 c50 -31 75 -77 75 -133zM383 130c0 42 -9 66 -62 99l-114 71c-41 26 -77 62 -77 105c0 4 0 9 1 13c-11 -19 -17 -37 -17 -55c0 -59 47 -99 105 -131l62 -34c48 -27 81 -61 81 -104c0 -5 -1 -21 -5 -31c13 10 26 48 26 67"],120165:[601,14,471,80,391,"391 80c0 -4 -1 -9 -4 -13c-31 -46 -87 -81 -145 -81c-69 0 -114 51 -114 146v299h-25c-14 0 -23 7 -23 23c0 10 10 18 25 27c26 15 96 73 112 98c7 11 18 21 25 22c10 0 16 -7 16 -16v-114h89c14 0 20 -10 20 -20s-6 -20 -20 -20h-89v-284c0 -57 11 -82 46 -82 c19 0 31 0 52 26c6 8 13 10 19 10c9 0 16 -10 16 -21zM279 28c-43 16 -61 50 -61 119v304v72c-12 -13 -43 -43 -62 -52c11 -2 12 -9 12 -20v-319c0 -65 27 -108 74 -108c6 0 13 1 37 4"],120166:[486,13,713,79,633,"318 26c-58 3 -86 51 -86 129v291h-56c6 -14 8 -32 8 -56v-237c0 -77 44 -129 113 -129c4 0 17 1 21 2zM541 49c-10 14 -15 38 -15 75v322h-53c4 -11 6 -25 6 -42v-369c12 4 46 9 62 14zM633 49c0 -8 -5 -16 -16 -19l-153 -42c-16 -5 -26 2 -26 19v50 c-47 -47 -84 -70 -141 -70c-91 0 -153 61 -153 166v237c0 39 -9 52 -45 56c-13 1 -19 10 -19 19c-1 10 7 21 21 21h155c11 0 15 -9 15 -16l1 -315c0 -61 21 -103 66 -103c31 0 55 20 100 61v291c0 30 -3 39 -40 42c-13 1 -18 10 -18 19c-1 10 6 21 20 21h149 c12 0 16 -6 16 -16v-346c0 -41 4 -56 28 -56c11 0 15 1 15 1c15 4 25 -8 25 -20"],120167:[490,14,690,80,610,"610 472c0 -10 -4 -22 -19 -23c-22 -2 -33 -8 -61 -72l-132 -333c-19 -44 -33 -58 -50 -58c-21 0 -38 36 -47 58l-124 294c-42 100 -48 110 -77 112c-14 1 -20 11 -20 21c1 10 8 19 21 19h195c14 0 21 -9 21 -19c1 -9 -5 -19 -18 -21c-22 -3 -21 -6 -21 -18 c0 -9 4 -20 9 -34l105 -259l104 263c4 9 6 17 6 26c0 15 -10 19 -31 21c-13 1 -20 11 -19 21c0 10 7 19 21 19h116c12 0 21 -8 21 -17zM370 85l-120 298c-8 20 -12 36 -12 49c0 6 1 12 2 18h-74c13 -20 27 -50 47 -96l137 -329"],120168:[490,14,936,80,856,"856 473c0 -8 -3 -18 -15 -22c-14 -5 -35 -14 -50 -48l-141 -359c-20 -50 -35 -58 -49 -58s-28 5 -46 51l-84 221l-104 -225c-15 -33 -28 -47 -45 -47c-15 0 -33 15 -48 52l-139 356c-19 45 -22 55 -35 56s-20 11 -20 20c0 10 7 20 21 20h176c13 0 20 -8 21 -17 c2 -10 -4 -20 -18 -23c-16 -3 -20 -8 -20 -22c0 -9 2 -18 5 -27l103 -270l83 180l-30 75c-17 49 -25 62 -49 64c-13 1 -19 10 -19 19c0 10 7 21 21 21h195c14 0 21 -9 21 -19c1 -9 -4 -20 -18 -21c-21 -2 -33 -9 -33 -24c0 -12 1 -14 18 -59l86 -230l79 201 c14 36 24 59 24 95c0 12 -13 13 -34 17c-13 2 -17 12 -17 21c0 10 7 19 21 19h118c13 0 22 -8 22 -17zM620 80l-101 273c-21 55 -20 55 -20 71c0 10 1 18 3 26h-65c8 -12 14 -29 22 -50l141 -368zM342 90l-114 296c-7 15 -8 27 -8 42c0 8 1 15 3 22h-70c6 -11 12 -24 19 -41 l147 -368"],120169:[487,0,677,79,597,"597 20c0 -9 -6 -20 -21 -20h-205c-14 0 -21 9 -21 19c0 9 4 19 17 21s20 2 20 14c0 4 -1 8 -5 13l-77 127l-73 -109c-12 -17 -17 -32 -17 -37c0 -9 9 -7 19 -8c12 -1 19 -10 19 -19c0 -10 -7 -21 -22 -21h-117c-15 0 -22 11 -22 20c0 8 6 16 17 19c30 8 48 7 73 45 l100 147l-109 162c-30 46 -75 54 -75 54c-13 3 -19 13 -18 22c0 9 8 18 21 18h207c14 0 21 -10 21 -20c0 -9 -4 -19 -17 -20c-15 -2 -19 1 -19 -9c0 -11 22 -53 58 -102c28 39 57 76 57 95c0 11 -2 13 -19 16c-13 2 -19 12 -18 21c0 10 7 19 21 19h136c13 0 21 -9 22 -19 s-5 -20 -19 -21c0 0 -58 -4 -74 -27l-82 -118l133 -205c27 -39 47 -51 73 -58c11 -3 16 -11 16 -19zM503 40c-9 9 -18 20 -28 35l-141 216c-43 65 -81 132 -81 147v9h-74c10 -9 19 -19 28 -32l209 -326c8 -13 11 -23 11 -35v-14h76"],120170:[490,218,704,80,624,"624 472c0 -11 -4 -21 -19 -22s-41 -11 -52 -39l-160 -418c-59 -153 -134 -211 -207 -211c-49 0 -97 30 -97 70c0 31 17 66 65 66c29 0 52 -6 69 -13c30 -12 46 -29 59 -29c7 0 13 5 20 18c16 28 33 68 41 91c-5 15 -27 69 -35 83l-172 357c-7 14 -21 22 -37 25 c-13 3 -19 13 -19 22s9 18 22 18h206c13 0 21 -9 21 -19s-5 -20 -19 -21c-23 -2 -33 -3 -33 -17c0 -10 4 -21 10 -34l119 -257l107 280c2 7 6 10 6 15c0 9 -10 13 -28 13c-13 0 -20 9 -20 20c0 10 7 20 20 20h112c12 0 21 -9 21 -18zM387 89l-26 57l-110 236 c-10 21 -14 37 -14 51c0 6 1 12 2 17h-71l185 -390c3 -6 7 -17 11 -28zM252 -154c-16 5 -36 14 -54 23c-11 5 -25 9 -44 9c-27 0 -25 -17 -25 -26c0 -20 32 -30 57 -30c21 0 51 3 66 24"],120171:[490,0,620,80,540,"540 142l-13 -124c-1 -12 -8 -18 -20 -18h-404c-15 0 -23 7 -23 16c0 5 2 10 6 15l278 419h-144c-55 0 -58 -25 -67 -87c-2 -11 -9 -17 -20 -17h-1c-14 0 -20 7 -20 21l3 104c0 13 7 19 20 19h373c14 0 22 -7 22 -16c0 -5 -2 -10 -5 -15l-280 -419h154 c62 0 80 20 101 109c2 10 9 15 19 15h1c15 0 22 -7 20 -22zM470 450h-57l-272 -410h55"],120792:[716,14,672,80,592,"592 350c0 -127 -52 -250 -113 -308c-40 -37 -87 -56 -143 -56c-63 0 -119 26 -160 74c-50 59 -96 181 -96 296c0 123 52 244 113 304c40 39 87 56 147 56c141 0 252 -148 252 -366zM552 350c0 127 -45 230 -105 284c34 -60 54 -155 54 -286c0 -125 -18 -217 -50 -276 c55 53 101 163 101 278zM461 348c0 206 -39 320 -124 320c-86 0 -126 -112 -126 -321c0 -205 39 -313 125 -313s125 108 125 314zM227 638c-55 -46 -107 -167 -107 -282c0 -117 44 -236 102 -286c-32 58 -51 150 -51 277c0 135 21 232 56 291"],120793:[716,0,503,80,423,"423 20c0 -10 -7 -20 -20 -20h-296c-12 0 -19 10 -19 20s6 20 18 20c17 0 48 5 62 12c14 9 21 28 21 57v462c0 25 -5 38 -22 38c-9 0 -27 -7 -44 -14c-4 -2 -13 -8 -13 -8c-5 -3 -10 -4 -14 -4c-9 0 -16 8 -16 22v2c0 7 4 15 11 18l202 88c5 2 9 3 13 3 c10 0 16 -7 16 -21v-606c0 -40 49 -49 81 -49c14 0 20 -10 20 -20zM289 40c-5 13 -7 29 -7 49v574l-77 -32c14 -11 24 -28 24 -60v-462c0 -29 -7 -52 -18 -69h78"],120794:[716,-1,659,80,579,"578 159l-62 -146c-3 -7 -10 -12 -18 -12h-391c-19 0 -25 6 -25 13s6 15 11 20l193 192c86 86 112 181 112 259c0 79 -56 124 -136 124c-66 0 -100 -31 -139 -120c-4 -10 -12 -14 -22 -12l-5 1c-14 3 -18 11 -15 25c17 70 32 102 67 136c40 43 97 77 157 77 c116 0 214 -84 214 -192c0 -82 -46 -163 -141 -262l-142 -141h223c41 0 46 11 86 56c5 5 11 7 16 7c12 0 22 -13 17 -25zM479 524c0 86 -82 152 -174 152c-29 0 -57 -17 -82 -30c12 2 25 3 39 3c104 0 176 -61 176 -164c0 -32 -6 -81 -18 -117c35 44 59 110 59 156zM505 86 c-13 -4 -27 -5 -46 -5h-262l-41 -40h329"],120795:[718,14,610,80,530,"446 573c0 54 -42 108 -136 107c-14 0 -29 -3 -44 -7c49 -3 74 -14 98 -34c30 -25 46 -60 46 -105c0 -13 -7 -44 -18 -58c35 20 54 65 54 97zM490 246c0 45 -31 85 -58 106c-20 15 -36 26 -84 48c-12 -10 -26 -19 -43 -27c8 -2 15 -4 23 -7c77 -27 125 -95 125 -179 c0 -15 -4 -56 -16 -78c38 37 53 103 53 137zM530 246c0 -145 -143 -260 -310 -260c-81 0 -140 32 -140 75c0 28 30 58 65 58c24 0 50 -10 86 -36c28 -20 39 -47 59 -47c56 0 123 71 123 151c0 66 -38 120 -99 141c-24 10 -47 11 -98 11c-12 0 -20 8 -20 17c0 7 5 14 14 20 c40 25 160 48 160 158c0 58 -43 99 -104 99c-63 0 -101 -36 -144 -97c-6 -9 -14 -13 -20 -13c-9 0 -17 8 -17 19c0 3 1 6 2 10c30 77 115 166 213 166c103 0 189 -53 189 -143c0 -67 -35 -100 -102 -150c110 -53 143 -118 143 -179zM237 27c-28 24 -69 52 -94 52 c-13 0 -25 -8 -25 -18c0 -29 50 -37 98 -37c6 0 15 2 21 3"],120796:[716,0,723,80,643,"643 196c0 -12 -9 -24 -28 -24h-86v-152c0 -13 -7 -20 -20 -20h-92c-13 0 -20 7 -20 20v152h-265c-41 0 -52 15 -52 28c0 8 3 16 6 20l353 488c3 4 11 8 16 8h54c13 0 20 -7 20 -20v-477h86c19 0 28 -11 28 -23zM489 40v628h-30l-23 -32v-596h53zM396 218v360l-262 -360 h262"],120797:[727,14,607,80,527,"527 708c0 -3 -1 -7 -3 -11l-55 -111c-7 -14 -10 -16 -33 -16h-222l-33 -68c119 -16 214 -38 258 -81c54 -53 84 -94 84 -171c0 -81 -32 -138 -82 -186c-54 -54 -133 -78 -223 -78c-86 0 -138 32 -138 75c0 28 30 58 65 58c24 0 50 -10 86 -36c28 -20 39 -47 59 -47 c66 0 129 72 129 165c0 97 -64 137 -177 174c-26 8 -56 9 -82 9c-19 0 -35 -1 -47 -1c-15 -1 -22 5 -22 16c0 4 1 8 3 13l133 280c3 7 10 11 18 11h212c15 0 23 3 33 15c5 6 12 9 18 9c10 0 19 -8 19 -19zM462 663h-204l-25 -53h203zM483 251c0 65 -26 97 -72 142 c-41 40 -172 72 -248 71l-19 -42c29 -2 71 -1 107 -12c135 -43 208 -93 208 -208c0 -18 -4 -56 -17 -84c23 40 41 94 41 133zM237 27c-28 24 -69 52 -94 52c-13 0 -25 -8 -25 -18c0 -29 50 -37 98 -37c6 0 15 2 21 3"],120798:[723,14,672,80,592,"592 231c0 -148 -113 -245 -248 -245c-67 0 -132 27 -173 74c-47 53 -91 145 -91 238c0 141 84 261 198 343c75 51 163 82 252 82c10 0 24 0 24 -17c0 -15 -12 -23 -20 -23c-30 0 -99 -27 -141 -55c-67 -45 -117 -111 -142 -202c55 30 77 35 116 35 c127 0 225 -92 225 -230zM552 231c0 102 -71 176 -158 188c66 -28 105 -102 105 -218c0 -48 -6 -99 -29 -138c51 43 82 104 82 168zM322 622c-111 -63 -202 -188 -202 -324c0 -83 40 -165 81 -212c9 -11 24 -20 35 -28c-36 49 -58 124 -58 223c0 130 54 246 144 341z M459 201c0 121 -46 191 -131 191c-34 0 -64 -8 -84 -23c-19 -14 -26 -40 -26 -88c0 -151 51 -245 138 -245c67 0 103 60 103 165"],120799:[703,8,630,80,550,"550 683l-1 -7l-221 -670c-3 -9 -10 -14 -19 -14h-3c-17 0 -24 10 -19 26l183 552h-233c-45 0 -96 -9 -118 -36c-8 -10 -17 -11 -26 -7c-10 4 -16 15 -11 27l58 137c3 7 10 12 18 12h372c13 0 20 -7 20 -20zM503 663h-332l-27 -65c14 11 54 12 93 12h248"],120800:[716,14,599,80,519,"519 170c0 -111 -85 -184 -217 -184c-125 0 -222 75 -222 180c0 69 13 101 125 184c-108 94 -109 128 -109 193c0 98 90 173 210 173c112 0 201 -68 201 -157c0 -65 -30 -122 -125 -168c120 -92 137 -144 137 -221zM465 559c0 41 -31 77 -55 99c18 -22 34 -60 34 -95 c0 -49 -5 -75 -23 -106c19 14 44 66 44 102zM404 560c0 65 -42 116 -106 116c-60 0 -103 -47 -103 -101c0 -53 59 -98 146 -155c47 30 63 85 63 140zM418 138c0 80 -77 109 -178 183c-46 -61 -54 -88 -54 -147c0 -82 53 -148 127 -148c62 0 105 52 105 112zM183 53 c-18 25 -35 73 -35 123c0 23 4 49 10 77c-22 -19 -41 -54 -41 -87c0 -42 30 -98 66 -113zM479 170c0 102 -41 115 -164 212c-106 83 -160 128 -160 193c0 14 4 38 12 56c-26 -22 -41 -57 -41 -88c0 -61 6 -76 114 -170c76 -66 218 -123 218 -235c0 -9 -2 -22 -3 -30 c8 15 24 34 24 62"],120801:[716,21,672,80,592,"592 404c0 -141 -84 -261 -198 -343c-75 -51 -163 -82 -252 -82c-10 0 -24 0 -24 17c0 15 12 23 20 23c30 0 99 27 141 55c67 45 117 111 142 202c-55 -30 -77 -35 -116 -35c-127 0 -225 92 -225 230c0 148 113 245 248 245c67 0 132 -27 173 -74c47 -53 91 -145 91 -238 zM278 283c-66 28 -105 102 -105 218c0 48 6 99 29 138c-51 -43 -82 -104 -82 -168c0 -102 71 -176 158 -188zM552 404c0 83 -40 165 -81 212c-9 11 -24 20 -35 28c36 -49 58 -124 58 -223c0 -130 -54 -246 -144 -341c111 63 202 188 202 324zM454 421 c0 151 -51 245 -138 245c-67 0 -103 -60 -103 -165c0 -121 46 -191 131 -191c34 0 64 8 84 23c19 14 26 40 26 88"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/DoubleStruck/Regular/Main.js");
| him2him2/cdnjs | ajax/libs/mathjax/2.3.0/jax/output/SVG/fonts/Gyre-Termes/DoubleStruck/Regular/Main.js | JavaScript | mit | 44,323 |
/*
* /MathJax/jax/output/SVG/fonts/STIX-Web/Main/BoldItalic/Main.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed 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.
*/
MathJax.OutputJax.SVG.FONTDATA.FONTS["STIXMathJax_Main-bold-italic"]={directory:"Main/BoldItalic",family:"STIXMathJax_Main",weight:"bold",style:"italic",id:"STIXWEBMAINBI",32:[0,0,250,0,0,""],33:[684,13,389,67,370,"196 204l-29 9c30 157 47 273 52 353c3 60 15 118 79 118c50 0 72 -29 72 -73c0 -27 -6 -41 -30 -89c-57 -113 -102 -209 -144 -318zM213 58c0 -40 -33 -71 -74 -71c-42 0 -72 30 -72 71c0 42 32 75 73 75c38 0 73 -35 73 -75"],34:[685,-398,555,136,536,"396 398l15 214c3 38 41 73 80 73c25 0 45 -22 45 -49c0 -14 -2 -21 -13 -47l-85 -191h-42zM136 398l15 214c3 38 41 73 80 73c25 0 45 -22 45 -49c0 -12 -1 -20 -13 -47l-85 -191h-42"],35:[700,0,500,-32,532,"532 490l-20 -73h-96l-54 -134h86l-20 -73h-96l-85 -210h-78l85 210h-113l-85 -210h-78l85 210h-95l20 73h105l54 134h-95l20 73h104l87 210h77l-86 -210h113l87 210h77l-86 -210h87zM338 417h-113l-54 -134h113"],36:[733,100,500,-20,497,"497 598l-42 -134l-21 5c1 11 1 25 1 31c0 69 -19 105 -84 125l-59 -215c112 -97 140 -141 140 -212c0 -117 -92 -198 -254 -198l-28 -100h-52l29 107c-63 15 -98 32 -147 80l42 141l22 -6c3 -108 19 -143 93 -180l74 261c-106 81 -132 122 -132 190 c0 110 84 177 196 177c8 0 16 0 38 -2l18 65h50l-20 -72c33 -6 87 -24 136 -63zM248 436l55 199c-5 2 -9 2 -15 2c-67 0 -110 -37 -110 -95c0 -40 17 -66 70 -106zM253 274l-67 -242c76 0 137 40 137 129c0 47 -13 74 -70 113"],37:[706,29,757,80,707,"707 214c0 -70 -28 -143 -73 -190c-25 -27 -61 -42 -99 -42c-76 0 -128 56 -128 138c0 113 91 213 195 213c66 0 105 -45 105 -119zM682 220c0 46 -25 80 -59 80c-21 0 -41 -15 -62 -46c-32 -48 -56 -125 -56 -178c0 -43 17 -66 50 -66c30 0 55 16 79 51 c28 43 48 108 48 159zM645 706l-438 -735h-48l388 655c-40 -30 -73 -42 -113 -42c-21 0 -35 3 -60 13c2 -19 3 -29 3 -42c0 -71 -28 -147 -70 -189c-28 -28 -65 -44 -101 -44c-74 0 -126 57 -126 139c0 114 92 213 197 213c26 0 45 -8 71 -29c29 -23 47 -30 83 -30 c66 0 115 27 166 91h48zM351 560c0 34 -6 44 -32 54c-7 3 -10 4 -21 11s-15 9 -20 9c-42 0 -102 -127 -102 -216c0 -42 18 -66 50 -66c64 0 125 101 125 208"],38:[682,19,849,76,771,"745 101l26 -21c-61 -74 -102 -98 -168 -98c-55 0 -98 18 -142 62c-62 -47 -128 -63 -198 -63c-115 0 -187 58 -187 161c0 177 157 224 240 242c-9 46 -11 67 -11 92c0 127 79 206 189 206c84 0 134 -47 134 -114c0 -72 -59 -126 -182 -172c10 -76 45 -161 86 -227 c59 70 74 101 74 129c0 22 -13 31 -56 38v25h212v-25c-59 -4 -68 -24 -205 -203c37 -51 71 -72 110 -72c27 0 49 11 78 40zM548 582c0 42 -19 67 -52 67c-45 0 -70 -44 -70 -113c0 -25 2 -46 11 -102c86 46 111 88 111 148zM433 80c-60 85 -86 155 -109 263 c-84 -41 -115 -83 -115 -153c0 -79 52 -138 125 -138c31 0 63 6 99 28"],39:[685,-398,278,128,268,"128 398l16 215c3 47 40 72 79 72c25 0 45 -22 45 -49c0 -14 -4 -23 -15 -48l-83 -190h-42"],40:[685,179,333,28,344,"326 685l18 -20c-81 -74 -118 -119 -155 -200c-45 -99 -67 -218 -67 -346c0 -119 16 -186 71 -283l-23 -15c-101 138 -142 238 -142 386c0 122 41 231 117 321c41 48 97 95 181 157"],41:[685,179,333,-44,271,"105 670l23 15c55 -75 78 -111 102 -172c28 -70 41 -144 41 -214c0 -97 -25 -179 -68 -251c-51 -86 -129 -158 -230 -227l-17 20c92 82 122 126 161 222c39 95 60 218 60 331c0 114 -21 187 -72 276"],42:[685,-252,500,101,492,"312 468l11 -6c33 -18 42 -23 88 -23c36 0 81 -11 81 -51c0 -29 -25 -54 -52 -54c-25 0 -39 11 -60 47c-22 36 -31 49 -65 67l-11 6v-12c0 -32 7 -54 26 -87c13 -22 17 -37 17 -52c0 -31 -20 -51 -51 -51c-30 0 -50 20 -50 52c0 14 4 29 17 51c19 33 26 55 26 87v12 l-11 -6c-34 -18 -43 -31 -65 -67c-21 -36 -35 -47 -60 -47c-27 0 -52 25 -52 54c0 40 45 51 81 51c46 0 55 5 88 23l11 6l-11 6c-33 18 -44 22 -88 23c-38 0 -81 12 -81 52c0 28 24 54 49 54c24 0 41 -12 63 -47c24 -38 35 -51 65 -68l11 -6v12c0 33 -7 56 -26 88 c-13 22 -17 36 -17 51c0 32 20 52 50 52c31 0 51 -20 51 -52c0 -15 -4 -29 -17 -51c-19 -32 -26 -55 -26 -88v-12l11 6c30 17 41 30 65 68c22 35 39 47 63 47c26 0 49 -26 49 -54c0 -40 -43 -52 -81 -52c-44 -1 -55 -5 -88 -23"],43:[506,0,570,33,537,"537 209h-208v-209h-88v209h-208v88h208v209h88v-209h208v-88"],44:[134,182,250,-60,144,"-47 -182l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222"],45:[282,-166,333,2,271,"271 282l-23 -116h-246l24 116h245"],46:[135,13,250,-9,139,"139 61c0 -42 -33 -74 -75 -74c-41 0 -73 32 -73 73c0 43 32 75 75 75c40 0 73 -33 73 -74"],47:[685,18,278,-64,342,"342 685l-319 -703h-87l319 703h87"],48:[683,14,500,17,477,"477 442c0 -153 -73 -317 -166 -401c-41 -37 -81 -55 -134 -55c-104 0 -160 87 -160 220c0 154 64 306 152 407c46 53 103 70 158 70c96 0 150 -95 150 -241zM374 582c0 45 -18 72 -49 72c-28 0 -49 -25 -76 -83c-60 -133 -129 -409 -129 -490c0 -40 20 -66 50 -66 c42 0 71 40 106 144c31 95 98 318 98 423"],49:[683,0,500,5,419,"419 683l-154 -560c-7 -26 -14 -48 -14 -63c0 -28 22 -35 99 -37v-23h-345v23c76 4 103 19 121 82l124 445c2 9 6 24 6 30c0 22 -17 33 -48 33c-19 0 -36 -1 -62 -5l2 23c115 15 180 30 271 52"],50:[683,0,500,-27,446,"86 507l-22 12c40 98 116 164 218 164c104 0 164 -73 164 -168c0 -79 -43 -151 -144 -237l-196 -167h138c86 0 117 14 151 80h24l-80 -191h-366v24l89 92c184 191 250 273 250 360c0 69 -25 117 -92 117c-52 0 -93 -25 -134 -86"],51:[683,13,500,-14,450,"117 537l-21 13c60 97 126 133 207 133c80 0 147 -58 147 -136c0 -60 -30 -115 -119 -149v-2c57 -43 77 -80 77 -146c0 -141 -123 -263 -290 -263c-82 0 -132 31 -132 80c0 34 22 58 59 58c49 0 63 -57 90 -84c8 -8 24 -14 40 -14c61 0 110 79 110 162 c0 48 -12 85 -36 112c-33 37 -68 43 -122 46l4 22c129 27 190 76 190 153c0 55 -25 90 -87 90c-47 0 -76 -18 -117 -75"],52:[683,0,500,-15,503,"503 683l-119 -435h70l-27 -98h-69l-42 -150h-128l41 150h-244l28 105l427 428h63zM335 528l-282 -280h203"],53:[669,13,500,-11,486,"486 669l-36 -109h-253l-34 -77c106 -20 127 -26 176 -67c47 -40 73 -98 73 -165c0 -141 -121 -264 -286 -264c-85 0 -137 31 -137 79c0 34 24 58 59 58c30 0 52 -16 71 -54c18 -36 37 -43 59 -43c63 0 129 76 129 162c0 65 -37 123 -101 155c-37 19 -68 25 -133 28 l131 297h282"],54:[679,15,500,23,509,"503 679l6 -24c-129 -45 -214 -128 -278 -246c21 9 42 13 62 13c93 0 150 -58 150 -171c0 -156 -109 -266 -246 -266c-112 0 -174 77 -174 204c0 138 65 267 176 360c92 77 158 102 304 130zM319 315c0 46 -17 67 -68 67c-28 0 -39 -6 -55 -44c-36 -84 -61 -185 -61 -243 c0 -53 18 -78 55 -78c26 0 42 9 61 39c38 60 68 189 68 259"],55:[669,0,500,52,525,"525 669l-381 -669h-92l332 556h-127c-113 0 -136 -12 -173 -77h-26l87 190h380"],56:[683,13,500,3,476,"183 341v4c-56 59 -74 96 -74 154c0 114 87 184 191 184c56 0 99 -17 130 -44c28 -25 46 -54 46 -99c0 -71 -39 -120 -143 -160v-4c66 -74 86 -119 86 -183c0 -128 -99 -206 -228 -206c-115 0 -188 67 -188 166c0 87 60 143 180 188zM383 544c0 64 -34 106 -77 106 c-52 0 -86 -37 -86 -98c0 -50 19 -92 90 -149c58 60 73 90 73 141zM306 140c0 52 -10 89 -97 181c-76 -48 -109 -98 -109 -180c0 -77 38 -124 96 -124c62 0 110 53 110 123"],57:[683,10,500,-12,475,"-6 -10l-6 25c122 37 216 120 277 244c-25 -11 -38 -14 -61 -14c-90 0 -151 67 -151 167c0 152 108 271 246 271c50 0 89 -15 118 -44c37 -38 58 -97 58 -163c0 -146 -81 -292 -212 -384c-77 -55 -138 -78 -269 -102zM363 582c0 46 -16 69 -49 69c-32 0 -59 -22 -79 -63 c-31 -63 -58 -172 -58 -236c0 -41 23 -64 66 -64c42 0 50 9 77 89c32 95 43 147 43 205"],58:[459,13,333,23,264,"264 385c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74zM171 61c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74"],59:[459,183,333,-25,264,"264 385c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74zM-12 -183l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -41 38 -41 65c0 48 33 73 74 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222"],60:[518,12,570,31,539,"539 -12l-508 223v84l508 223v-96l-385 -169l385 -169v-96"],61:[399,-107,570,33,537,"537 311h-504v88h504v-88zM537 107h-504v88h504v-88"],62:[518,12,570,31,539,"539 211l-508 -223v96l385 169l-385 169v96l508 -223v-84"],63:[684,13,500,79,470,"196 208l-29 8c4 55 22 115 112 209c49 51 64 101 64 149c0 49 -26 79 -69 79c-32 0 -62 -18 -62 -38c0 -26 29 -26 29 -67c0 -33 -27 -62 -61 -62c-35 0 -61 34 -61 72c0 67 79 126 181 126c95 0 170 -52 170 -144c0 -63 -33 -117 -126 -171 c-103 -60 -120 -91 -148 -161zM227 61c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74"],64:[685,18,939,118,825,"703 77l13 -35c-95 -49 -158 -60 -231 -60c-212 0 -367 161 -367 343c0 207 165 360 373 360c189 0 334 -117 334 -298c0 -132 -68 -244 -187 -245c-49 0 -91 34 -93 75c-35 -46 -79 -74 -122 -74c-58 0 -96 47 -96 114c0 117 76 258 201 258c36 0 49 -10 72 -52l11 38 h71l-61 -243c-2 -10 -6 -23 -6 -34c0 -29 17 -44 41 -44c81 0 123 139 123 206c0 146 -130 260 -287 260c-165 0 -283 -134 -283 -327c0 -164 115 -291 287 -291c70 0 138 8 207 49zM583 402c0 40 -13 64 -42 65c-84 1 -138 -111 -138 -192c0 -52 23 -85 59 -85 c29 0 60 25 82 68c21 41 39 100 39 144"],65:[683,0,667,-68,593,"593 0h-303v25c53 4 77 19 77 49c0 5 -1 9 -2 15l-12 119h-215l-57 -96c-11 -18 -17 -35 -17 -50c0 -24 16 -37 64 -37v-25h-195l-1 25c37 4 55 27 86 76l370 582h25l94 -560c14 -82 23 -94 86 -98v-25zM346 248l-37 243l-148 -243h185"],66:[669,0,667,-25,624,"118 669h265c161 0 241 -50 241 -146c0 -109 -86 -138 -189 -168v-1c96 -27 137 -73 137 -148c0 -134 -112 -206 -295 -206h-302v25c48 6 68 24 84 83l119 438c7 25 11 47 11 57c0 39 -32 41 -71 41v25zM334 577l-57 -209c69 5 116 5 153 40c30 28 47 72 47 128 c0 67 -29 101 -87 101c-32 0 -41 -4 -56 -60zM269 338l-64 -236c-5 -19 -7 -29 -7 -37c0 -23 18 -33 57 -33c53 0 90 21 121 59c29 35 43 88 43 138c0 37 -12 67 -35 85c-21 16 -50 22 -115 24"],67:[685,18,667,32,677,"677 685l-51 -235l-32 6c2 13 3 23 3 36c0 93 -46 158 -131 158c-53 0 -107 -30 -145 -73c-77 -87 -135 -220 -135 -368c0 -109 61 -174 155 -174c87 0 138 43 204 119l31 -22c-32 -44 -49 -63 -78 -85c-57 -43 -128 -65 -199 -65c-163 0 -267 101 -267 252 c0 148 62 276 159 358c69 58 156 93 249 93c41 0 86 -7 131 -21c15 -5 30 -8 38 -8c15 0 24 7 38 29h30"],68:[669,0,722,-46,685,"94 669h290c189 0 301 -101 301 -264c0 -109 -44 -218 -119 -288c-79 -73 -191 -117 -324 -117h-288v25c48 6 66 22 83 84l115 422c13 46 15 61 15 71c0 24 -9 33 -39 37l-34 5v25zM318 600l-126 -465c-11 -39 -15 -55 -15 -67c0 -24 20 -34 58 -34c87 0 156 34 210 105 c62 81 93 193 93 318c0 122 -54 181 -165 181c-33 0 -47 -10 -55 -38"],69:[669,0,667,-27,653,"653 669l-43 -190l-27 5c-3 71 -4 96 -45 123c-30 19 -76 30 -137 30c-41 0 -55 -6 -67 -51l-59 -216c132 0 158 13 205 107l28 -4l-74 -274l-28 4c3 19 4 30 4 44c0 69 -31 91 -144 91l-63 -234c-5 -20 -8 -31 -8 -38c0 -24 18 -34 61 -34c88 0 157 19 214 61 c37 27 57 50 91 106l25 -5l-60 -194h-553v25c52 8 65 19 82 80l119 432c9 33 12 55 12 70c0 20 -10 29 -41 33l-33 4v25h541"],70:[669,0,667,-13,660,"660 669l-43 -190l-27 5c0 51 -4 80 -20 100c-32 40 -73 53 -157 53c-41 0 -52 -10 -63 -48l-61 -219c131 1 156 13 198 107l28 -4l-74 -274l-28 5c3 19 4 30 4 44c0 68 -30 88 -137 90l-55 -206c-8 -30 -15 -50 -15 -63c0 -31 15 -40 71 -44v-25h-294v25 c58 6 67 24 82 79l121 442c6 23 10 46 10 61c0 20 -11 29 -42 33l-31 4v25h533"],71:[685,18,722,21,705,"705 330v-26c-50 -4 -60 -14 -82 -96l-44 -167l-28 -13c-57 -27 -156 -46 -234 -46c-176 0 -296 104 -296 274c0 130 63 254 163 337c74 61 162 92 264 92c46 0 81 -6 124 -21c19 -7 27 -9 36 -9c20 0 31 8 42 30h31l-51 -221l-29 4c-2 61 -8 91 -24 119 c-23 40 -63 62 -115 62c-69 0 -129 -42 -173 -98c-67 -87 -112 -211 -112 -335c0 -130 58 -196 164 -196c39 0 81 11 94 30l31 104c22 75 27 89 27 114c0 9 -6 20 -12 24c-11 6 -20 8 -63 12v26h287"],72:[669,0,778,-24,799,"799 669v-25c-49 0 -68 -21 -82 -74l-111 -408c-15 -57 -22 -81 -22 -96c0 -29 18 -39 73 -41v-25h-316v25c67 4 85 16 102 79l62 225h-239l-54 -197c-10 -36 -12 -52 -12 -67s7 -35 71 -40v-25h-295v25c50 7 65 16 81 74l121 447c8 28 11 46 11 58c0 22 -11 32 -42 36 l-31 4v25h316v-25c-65 -2 -84 -15 -102 -80l-52 -191h239l47 173c5 19 10 49 10 61c0 20 -10 29 -41 33l-31 4v25h297"],73:[669,0,389,-32,406,"406 669v-25c-49 -5 -67 -17 -84 -80l-112 -412c-14 -51 -17 -71 -17 -87c0 -28 14 -37 71 -40v-25h-296v25c49 6 64 11 83 82l117 429c8 29 14 59 14 71c0 20 -15 30 -42 33l-32 4v25h298"],74:[669,99,500,-46,524,"524 669v-25c-49 -6 -65 -11 -85 -85l-122 -457c-36 -135 -115 -201 -215 -201c-88 0 -148 36 -148 101c0 40 28 72 64 72c35 0 63 -25 63 -65c0 -31 -23 -36 -23 -54c0 -12 8 -18 27 -18c37 0 51 30 88 170l114 432c10 39 13 53 13 64c0 18 -11 31 -41 36l-33 5v25h298"],75:[669,0,667,-21,702,"702 669v-25c-43 -6 -51 -9 -94 -48l-216 -199l157 -333c11 -24 25 -35 63 -39v-25h-280l1 25l26 4c27 4 38 9 38 23c0 12 -5 27 -15 49l-111 236l-67 -249c-1 -5 -2 -11 -2 -17c0 -33 13 -42 65 -46v-25h-288v25c45 5 65 15 79 68l123 453c8 28 11 46 11 58 c0 22 -10 32 -41 36l-33 4v25h311v-25c-59 -5 -80 -20 -94 -72l-62 -227l197 175c59 52 77 78 77 97c0 15 -10 23 -35 25l-21 2v25h211"],76:[669,0,611,-22,590,"590 195l-60 -195h-552v25c55 7 67 24 82 78l121 443c5 19 11 49 11 61c0 20 -10 28 -41 32c-11 2 -24 4 -34 5v25h318v-25c-66 -4 -85 -17 -99 -70l-129 -473c-4 -16 -6 -31 -6 -39c0 -21 27 -30 72 -30c70 0 127 14 178 45c52 31 76 59 115 123"],77:[669,12,889,-29,917,"917 669v-25c-51 -6 -67 -19 -84 -81l-119 -438c-5 -17 -10 -45 -10 -57c0 -32 12 -43 71 -43v-25h-311v25c69 4 85 21 101 79l123 457l-375 -573h-28l-67 559l-101 -369c-14 -50 -20 -75 -20 -92c0 -45 16 -55 80 -61v-25h-206v25c54 12 67 33 103 157l107 369 c7 26 11 44 11 58c0 28 -7 35 -71 35v25h219l54 -480l311 480h212"],78:[669,15,722,-27,748,"748 669v-25c-56 -11 -66 -24 -102 -153l-143 -506h-28l-257 547l-99 -354c-12 -42 -19 -75 -19 -94c0 -39 20 -54 79 -59v-25h-206v25c55 11 60 17 101 155l120 407c-19 44 -27 52 -82 57v25h193l216 -467l81 289c11 41 19 75 19 94c0 38 -21 59 -81 59v25h208"],79:[685,18,722,27,691,"691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM547 528c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120c-60 -101 -113 -269 -113 -388 c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],80:[669,0,611,-28,613,"112 669h282c147 0 219 -54 219 -155c0 -53 -21 -98 -59 -131c-48 -42 -122 -66 -214 -66c-27 0 -46 1 -81 5l-54 -199c-5 -17 -11 -48 -11 -58c0 -27 16 -37 72 -40v-25h-294v25c52 8 66 17 84 82l117 426c11 39 13 59 13 74c0 20 -10 29 -41 33l-33 4v25zM330 584 l-61 -229c17 -3 29 -3 42 -3c62 0 96 18 123 62c22 35 33 93 33 136c0 53 -31 87 -84 87c-35 0 -41 -9 -53 -53"],81:[685,208,722,27,691,"203 -17l2 4c-5 2 -8 3 -16 6c-101 36 -162 108 -162 218c0 150 74 293 180 381c71 59 155 93 242 93c140 0 242 -98 242 -233c0 -124 -56 -256 -155 -351c-87 -84 -143 -112 -284 -118l-44 -47v-3c43 -2 113 -9 186 -35c37 -13 58 -16 85 -16c61 0 97 18 155 78l21 -19 c-79 -115 -150 -149 -259 -149c-41 0 -74 6 -136 26c-52 16 -75 21 -104 21c-32 0 -58 -6 -114 -28l-14 24zM547 532c0 71 -41 119 -101 119c-63 0 -114 -38 -162 -119c-60 -101 -113 -286 -113 -396c0 -73 39 -119 102 -119c68 0 125 57 169 137c57 105 105 272 105 378"],82:[669,0,667,-28,623,"110 669h286c147 0 227 -47 227 -143c0 -69 -36 -114 -96 -151c-24 -15 -50 -23 -96 -32l85 -254c16 -49 31 -59 87 -64v-25h-202l-107 331h-30l-52 -182c-14 -48 -18 -68 -18 -82c0 -30 14 -38 72 -42v-25h-294v25c49 6 66 25 82 84l120 437c5 19 10 49 10 61 c0 20 -9 31 -42 34l-32 3v25zM330 583l-57 -220c62 1 101 8 127 25c44 27 72 88 72 154c0 61 -29 95 -82 95c-31 0 -48 -8 -60 -54"],83:[685,18,556,2,526,"526 681l-40 -202l-27 4c-5 42 -9 76 -22 101c-23 46 -64 66 -116 66c-53 0 -98 -40 -98 -105c0 -60 36 -86 107 -137c106 -77 138 -127 138 -217c0 -84 -41 -150 -110 -184c-33 -16 -74 -25 -120 -25c-40 0 -73 7 -122 24c-23 8 -36 11 -46 11c-19 0 -26 -6 -38 -35h-30 l36 225l29 -2c8 -66 16 -103 48 -139c27 -31 62 -50 106 -50c38 0 67 11 89 34c23 23 37 47 37 92c0 59 -34 96 -115 154s-130 114 -130 198c0 114 90 191 204 191c88 0 108 -30 146 -30c21 0 35 8 44 26h30"],84:[669,0,611,49,650,"650 669l-36 -192l-27 2c0 114 -38 155 -138 155l-135 -489c-7 -24 -17 -53 -17 -74c0 -29 23 -46 83 -46v-25h-331v25h15c46 0 77 20 91 72l148 537c-102 -2 -167 -37 -218 -143l-25 7l39 171h551"],85:[669,18,722,67,744,"744 669v-25c-55 -11 -65 -13 -102 -147l-65 -234c-30 -107 -62 -187 -121 -234c-39 -31 -92 -47 -166 -47c-131 0 -223 56 -223 163c0 40 14 101 37 189l51 193c10 37 15 66 15 78c0 22 -9 33 -41 36l-32 3v25h311v-25c-62 -3 -78 -17 -94 -76l-81 -294 c-26 -94 -28 -107 -28 -135c0 -72 46 -101 122 -101c55 0 94 17 123 47c43 44 67 114 90 197l57 209c12 44 19 79 19 96c0 36 -22 57 -79 57v25h207"],86:[669,18,667,66,715,"715 669v-25c-30 -6 -50 -25 -62 -44l-390 -618h-32l-76 513c-20 136 -27 149 -89 149v25h296v-25c-68 -6 -75 -11 -75 -45c0 -5 1 -17 2 -23l50 -394l187 297c43 69 63 107 63 129c0 19 -13 32 -41 34l-24 2v25h191"],87:[669,18,889,64,940,"940 669v-24c-42 -6 -55 -15 -88 -82l-282 -581h-29l-59 489l-233 -489h-29l-78 572c-10 71 -14 80 -78 91v24h278v-25c-47 -6 -61 -19 -61 -50c0 -6 0 -14 1 -19l40 -349l149 314c0 79 -10 97 -70 105v24h267v-25c-53 -5 -62 -16 -62 -54c0 -12 3 -34 7 -73l33 -291 l155 327c12 26 15 34 15 46c0 36 -7 41 -63 45v25h187"],88:[669,0,667,-24,694,"694 669v-25c-36 -5 -56 -16 -99 -61l-199 -205l75 -237c27 -86 43 -108 115 -116v-25h-307v25c57 5 67 12 67 38c0 22 -11 63 -37 141l-20 60l-130 -144c-23 -25 -32 -42 -32 -55c0 -23 18 -36 63 -40v-25h-214v25c56 10 82 47 231 210l68 74l-83 269 c-17 55 -33 60 -93 66v25h305v-25l-29 -3c-33 -3 -45 -10 -45 -33c0 -15 12 -59 35 -132l17 -55l94 99c52 55 70 80 70 98c0 15 -10 22 -33 24l-21 2v25h202"],89:[669,0,611,71,659,"659 669v-25c-38 -5 -60 -27 -92 -72l-189 -264l-52 -191c-5 -20 -10 -37 -10 -51c0 -28 17 -41 79 -41v-25h-323v25c66 6 87 15 104 78l57 208l-87 270c-16 48 -23 52 -75 63v25h285v-25c-55 -2 -69 -9 -69 -39c0 -18 8 -44 29 -110l46 -143l128 183c21 30 28 49 28 67 c0 31 -13 40 -66 42v25h207"],90:[669,0,611,-12,589,"589 640l-434 -605h75c92 0 147 12 199 50c36 27 69 69 97 114l27 -5l-60 -194h-505v29l434 605h-83c-105 0 -168 -36 -247 -147l-28 4l58 178h467v-29"],91:[674,159,333,-37,362,"362 674l-7 -35h-69c-36 0 -39 -6 -53 -66l-155 -667c-1 -3 -1 -7 -1 -9c0 -15 13 -21 34 -21h78l-7 -35h-219l199 833h200"],92:[685,18,278,-1,279,"279 -18h-84l-196 703h85"],93:[674,157,333,-56,343,"343 674l-200 -831h-199l7 35h68c36 0 37 5 51 63l157 667c1 5 1 10 1 10c0 13 -14 21 -34 21h-78l7 35h220"],94:[669,-304,570,67,503,"503 304h-89l-129 272l-129 -272h-89l178 365h80"],95:[-75,125,500,0,500,"500 -125h-500v50h500v-50"],96:[697,-516,333,85,297,"297 516h-46l-132 88c-22 15 -34 32 -34 48c0 24 21 45 45 45c19 0 38 -9 56 -33"],97:[462,14,500,-21,456,"435 127l21 -15c-58 -94 -109 -126 -156 -126c-37 0 -63 21 -63 64c0 14 2 28 14 69c-56 -95 -103 -132 -164 -132c-65 0 -108 51 -108 127c0 80 36 164 87 231c53 70 121 117 186 117c43 0 65 -21 74 -72h1l17 59l111 7l-75 -251c-24 -79 -30 -108 -30 -133 c0 -9 4 -15 12 -15c16 0 32 15 73 70zM303 373c0 27 -15 47 -37 47c-42 0 -80 -58 -108 -115c-35 -71 -56 -152 -56 -190c0 -40 17 -57 43 -57c27 0 59 26 86 75c39 69 72 180 72 240"],98:[699,13,500,-14,444,"284 699l-91 -326c48 66 93 89 144 89c64 0 107 -58 107 -131c0 -179 -152 -344 -320 -344c-66 0 -138 24 -138 61c0 6 10 45 20 81l94 327c27 94 39 143 39 156c0 20 -16 30 -46 30h-19v27c89 10 140 17 210 30zM319 325c0 46 -12 69 -41 69c-33 0 -66 -29 -92 -84 c-22 -48 -45 -124 -62 -182c-10 -34 -15 -73 -15 -81c0 -16 13 -27 31 -27c40 0 74 28 108 78c41 60 71 169 71 227"],99:[462,13,444,-5,392,"318 142l28 -18c-38 -52 -70 -96 -115 -119c-23 -12 -50 -18 -83 -18c-91 0 -153 53 -153 151c0 92 43 177 105 239c51 52 113 85 180 85c60 0 112 -37 112 -90c0 -42 -25 -71 -62 -71c-34 0 -58 23 -58 53s21 36 21 58c0 10 -12 17 -24 17c-38 0 -65 -37 -93 -88 c-33 -61 -53 -134 -53 -201c0 -58 29 -89 73 -89c43 0 74 24 122 91"],100:[699,13,500,-21,517,"517 699l-117 -421c-35 -126 -51 -194 -51 -203c0 -6 5 -15 11 -15c15 0 40 26 68 71l22 -16c-55 -88 -101 -126 -150 -126c-38 0 -60 23 -60 61c0 16 2 29 11 68c-52 -94 -105 -131 -166 -131s-106 42 -106 125c0 99 58 212 131 282c43 42 93 68 138 68 c29 0 53 -8 75 -33l18 64c25 88 29 113 29 122c0 18 -15 28 -41 28h-21v27c100 8 149 15 209 29zM308 371c0 28 -15 49 -37 49c-43 1 -85 -54 -114 -112c-33 -66 -54 -144 -54 -186c0 -36 16 -63 41 -63c29 0 59 25 86 74c36 64 78 194 78 238"],101:[462,13,444,5,398,"317 143l29 -17c-56 -100 -118 -139 -195 -139c-87 0 -146 48 -146 147c0 165 143 328 288 328c65 0 105 -36 105 -87c0 -43 -29 -88 -69 -122c-43 -36 -91 -54 -188 -71c-4 -20 -6 -33 -6 -49c0 -54 22 -82 64 -82c43 0 72 23 118 92zM306 390c0 23 -7 39 -31 39 c-48 0 -91 -76 -127 -215c90 20 158 93 158 176"],102:[698,205,333,-169,446,"47 449h74c20 71 43 135 79 181c34 42 79 68 147 68c60 0 99 -31 99 -80c0 -31 -20 -54 -51 -54c-28 0 -49 22 -49 50c0 23 16 28 16 42c0 8 -8 13 -18 13c-34 0 -68 -56 -92 -154l-16 -66h91l-9 -42h-89c-56 -265 -68 -313 -95 -394c-31 -92 -54 -137 -90 -172 c-32 -31 -70 -46 -114 -46c-56 0 -99 31 -99 79c0 31 24 55 51 55c26 0 50 -20 50 -49c0 -25 -16 -28 -16 -42c0 -8 8 -12 18 -12c40 0 59 41 90 189c6 29 38 172 88 392h-74"],103:[462,203,500,-52,477,"477 373h-66c6 -12 6 -26 6 -42c0 -53 -25 -99 -71 -132s-88 -46 -145 -46c-17 0 -39 4 -51 8c-13 0 -28 -14 -28 -36c0 -16 22 -33 54 -41l50 -12c110 -26 149 -62 149 -123c0 -81 -88 -152 -237 -152c-115 0 -190 33 -190 101c0 89 80 107 133 109 c-44 15 -62 34 -62 66c0 37 21 67 96 97c-54 23 -80 58 -80 110c0 104 95 182 218 182c46 0 83 -7 114 -33h110v-56zM300 372c0 35 -12 59 -45 59c-22 0 -42 -14 -57 -32c-33 -41 -47 -110 -47 -156c0 -38 15 -59 42 -59c31 0 57 23 78 69c17 37 29 85 29 119zM266 -100 c0 24 -14 44 -42 58c-22 10 -97 35 -109 36c-9 -1 -38 -17 -51 -30c-20 -19 -29 -36 -29 -55c0 -46 46 -78 113 -78c72 0 118 34 118 69"],104:[699,9,556,-13,498,"476 142l22 -15c-66 -103 -106 -136 -167 -136c-39 0 -66 24 -66 64c0 41 11 77 61 225l20 59c5 15 7 24 7 30c0 16 -8 21 -20 21c-27 0 -63 -31 -106 -94c-49 -72 -68 -121 -119 -296h-121l152 562c6 22 10 38 10 47c0 23 -13 33 -42 33h-22v27c81 7 132 15 209 30 l-108 -416c99 141 145 179 213 179c49 0 76 -28 76 -75c0 -19 -9 -56 -29 -118l-59 -182c-3 -8 -3 -9 -3 -12c0 -7 9 -16 17 -16c13 0 32 21 75 83"],105:[684,9,278,2,262,"262 616c0 -37 -30 -66 -68 -66s-66 30 -66 69c0 34 31 65 65 65c38 0 69 -31 69 -68zM216 142l22 -14c-66 -108 -108 -137 -168 -137c-41 0 -68 20 -68 63c0 14 5 40 15 76l55 203c6 24 8 37 8 45c0 19 -16 29 -46 29h-14v27c78 6 149 16 203 28l-91 -334 c-5 -17 -9 -42 -9 -51c0 -12 7 -16 15 -16c15 0 37 23 64 61"],106:[685,207,278,-189,279,"279 617c0 -37 -31 -67 -69 -67c-37 0 -66 30 -66 69c0 35 31 66 66 66c38 0 69 -31 69 -68zM239 462l-116 -444c-42 -160 -107 -225 -207 -225c-63 0 -105 33 -105 77c0 29 22 53 49 53c29 0 49 -19 49 -49c0 -21 -15 -21 -15 -35c0 -10 12 -15 24 -15 c28 0 49 36 74 136l89 350c8 30 12 54 12 67c0 21 -12 30 -41 30h-22v27c112 10 149 15 209 28"],107:[699,8,500,-23,483,"483 449v-25c-46 -6 -67 -14 -135 -76l-64 -58c39 -195 57 -227 79 -227c19 0 37 16 64 64l22 -11c-45 -95 -88 -124 -138 -124c-62 0 -90 48 -123 223l-39 -27l-50 -188h-122l157 566c7 24 7 32 7 42c0 28 -10 34 -30 34h-34v27c77 4 132 13 209 30l-124 -461 c126 99 165 137 165 163c0 16 -11 21 -50 23v25h206"],108:[699,9,278,2,290,"290 699l-145 -523c-15 -54 -22 -86 -22 -100c0 -8 5 -15 15 -15c18 0 39 21 79 80l22 -14c-69 -105 -105 -136 -169 -136c-41 0 -68 27 -68 63c0 23 14 84 34 155l74 259c21 73 34 121 34 145c0 20 -15 30 -42 30c-5 0 -11 0 -22 -1v27c75 7 124 14 210 30"],109:[462,9,778,-14,723,"701 135l22 -13c-52 -97 -99 -131 -161 -131c-43 0 -67 20 -67 66c0 29 15 87 37 151l44 130c4 13 7 24 7 30c0 11 -11 21 -23 21c-30 0 -70 -41 -112 -116c-36 -63 -43 -81 -101 -273h-120l65 207c32 102 45 143 45 160c0 16 -8 22 -18 22c-15 0 -43 -21 -65 -47 c-57 -68 -94 -153 -147 -342h-121l66 232c28 97 36 135 36 150c0 16 -12 25 -38 25h-18v27c113 9 137 12 200 27l-63 -199h1c48 74 77 115 104 142c32 32 74 58 114 58c42 0 67 -25 67 -67c0 -28 -6 -53 -26 -105c81 132 126 172 198 172c48 0 77 -30 77 -71 c0 -26 -8 -66 -23 -109l-45 -128c-18 -51 -21 -59 -21 -77c0 -12 7 -18 16 -18c13 0 35 21 58 58c4 7 8 13 12 18"],110:[462,9,556,-6,494,"472 135l22 -13c-55 -97 -100 -131 -160 -131c-43 0 -68 19 -68 60c0 26 10 77 26 125l55 165c3 10 7 25 7 28c0 17 -12 21 -25 21c-18 0 -49 -27 -69 -54c-62 -81 -99 -162 -145 -336h-121l57 204c33 120 45 167 45 179c0 19 -13 23 -55 24v27c56 2 135 13 199 27 l-62 -198h1c67 99 85 123 122 158c27 26 63 41 100 41c51 0 73 -28 73 -77c0 -24 -12 -69 -28 -116l-35 -104c-19 -56 -24 -79 -24 -89s6 -17 14 -17c17 0 31 14 71 76"],111:[462,13,500,-3,441,"280 462h4c97 0 157 -59 157 -151c0 -94 -44 -188 -105 -249c-49 -49 -108 -75 -175 -75c-94 0 -164 50 -164 148c0 100 40 191 100 250c51 50 115 77 183 77zM322 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322c0 -44 19 -64 49 -64 c26 0 50 15 71 49c49 80 86 220 86 307"],112:[462,205,500,-120,446,"177 347h1c56 87 101 115 158 115c72 0 110 -47 110 -121c0 -185 -135 -354 -277 -354c-21 0 -46 6 -68 22l-12 -41c-19 -66 -24 -100 -24 -114c0 -24 15 -31 65 -32v-27h-250v27c48 0 59 10 78 86l96 380c13 52 22 84 22 94c0 19 -9 23 -54 25v27c52 6 90 12 192 28z M321 336c0 40 -15 55 -39 55c-31 0 -61 -32 -87 -71c-18 -27 -22 -40 -44 -113c-27 -91 -38 -132 -38 -149c0 -20 17 -36 39 -36s43 12 62 30c67 66 107 223 107 284"],113:[462,205,500,1,471,"471 449l-129 -461c-20 -73 -36 -127 -36 -138c0 -20 17 -28 49 -28h17v-27h-268v27c61 0 75 13 92 69l61 207c-44 -82 -94 -111 -154 -111c-65 0 -102 48 -102 130c0 55 19 117 54 178c59 103 142 167 218 167c23 0 47 -9 57 -22c9 -11 12 -22 17 -50l15 59h109z M325 371c0 28 -12 48 -35 48c-39 0 -86 -65 -111 -115c-32 -66 -53 -140 -53 -188c0 -38 13 -57 39 -57c31 0 59 24 88 74c35 62 72 180 72 238"],114:[462,0,389,-21,389,"160 253h1c79 159 117 209 171 209c34 0 57 -26 57 -66c0 -42 -25 -73 -58 -73c-39 0 -41 38 -61 38c-14 0 -38 -27 -65 -76c-26 -47 -41 -81 -74 -186l-31 -99h-121c71 240 102 357 102 382c0 19 -12 25 -56 25v27c121 10 140 13 200 28"],115:[462,13,389,-19,333,"333 461l-23 -154l-27 2c-16 83 -42 120 -88 120c-32 0 -53 -21 -53 -53c0 -23 18 -54 57 -99c60 -70 80 -114 80 -162c0 -75 -66 -128 -148 -128c-21 0 -42 3 -64 12c-13 5 -23 8 -30 8c-13 0 -23 -6 -29 -20h-27l22 166l27 -3c11 -88 42 -133 93 -133c40 0 60 22 60 54 c0 30 -16 59 -56 104c-68 77 -80 107 -80 161c0 80 53 126 134 126c20 0 41 -4 58 -12s27 -10 37 -10c15 0 19 4 28 21h29"],116:[594,9,278,-11,281,"281 407h-83l-34 -119c-35 -122 -53 -185 -53 -209c0 -13 8 -18 16 -18c16 0 42 27 76 80l23 -15c-66 -103 -110 -135 -170 -135c-42 0 -67 21 -67 65c0 18 10 63 25 115l67 236h-52v35c82 28 130 67 184 152h35l-39 -145h72v-42"],117:[462,9,556,15,493,"471 133l22 -13c-52 -89 -99 -129 -159 -129c-44 0 -68 19 -68 60c0 29 8 55 26 110h-1c-94 -138 -133 -170 -198 -170c-50 0 -78 26 -78 79c0 25 8 56 22 106l37 128c8 29 17 59 17 75c0 15 -12 25 -58 28v27c51 1 149 15 210 28l-93 -302c-14 -45 -16 -57 -16 -72 c0 -17 10 -25 24 -25c18 0 40 16 70 55c58 76 88 131 142 331h118l-78 -266c-13 -46 -25 -91 -25 -103c0 -10 3 -21 14 -21c17 0 37 20 72 74"],118:[462,13,444,15,401,"15 408v27c82 11 107 15 156 27c21 -67 31 -146 31 -334c99 113 126 154 126 189c0 11 -5 19 -20 36c-18 20 -25 36 -25 53c0 31 27 56 57 56c38 0 61 -32 61 -67c0 -42 -20 -96 -60 -154c-55 -80 -103 -133 -230 -254h-26c5 91 5 173 5 177c0 108 -9 193 -25 225 c-7 13 -19 19 -50 19"],119:[462,13,667,15,614,"387 462l31 -333c88 103 120 157 120 187c0 10 -6 22 -20 38c-17 19 -22 33 -22 48c0 40 27 60 57 60c33 0 61 -29 61 -62c0 -84 -89 -223 -272 -413h-27l-23 285c-34 -63 -70 -135 -114 -201l-56 -84h-27v46c0 13 1 32 1 62c0 121 -18 284 -38 302c-8 7 -18 10 -43 10 v27c80 13 115 19 156 28c23 -86 33 -154 33 -274l156 274h27"],120:[462,13,500,-45,469,"41 438l165 24c19 -28 31 -53 47 -138c78 114 111 138 158 138c31 0 58 -29 58 -61c0 -29 -26 -53 -56 -53c-24 0 -34 20 -57 20s-60 -37 -92 -94l32 -157c8 -39 18 -53 37 -53c18 0 28 9 67 59l21 -14c-61 -88 -103 -122 -151 -122c-50 0 -75 40 -97 155l-24 -39 c-59 -96 -81 -116 -131 -116c-38 0 -63 24 -63 59c0 32 23 57 54 57c30 0 41 -22 62 -22c18 0 26 6 47 40l44 71l-29 152c-9 49 -25 69 -57 69c-9 0 -16 0 -35 -2v27"],121:[462,205,444,-94,392,"239 110h2c70 134 87 176 87 207c0 13 -7 19 -25 34c-22 18 -31 29 -31 54s21 57 58 57c33 0 62 -30 62 -64c0 -101 -119 -338 -249 -497c-55 -67 -120 -106 -175 -106c-35 0 -62 26 -62 60c0 29 24 56 50 56c47 0 58 -36 94 -36c17 0 46 22 67 52c17 24 25 48 25 71 c0 31 -16 126 -50 288c-13 59 -24 97 -40 113c-11 11 -15 12 -40 12v27c65 6 102 12 150 24c18 -47 48 -149 66 -274"],122:[449,78,389,-43,368,"368 439l-281 -335c39 -17 61 -35 86 -69c21 -29 39 -84 68 -84c13 0 22 8 22 17c0 16 -20 17 -20 45s23 53 50 53c28 0 53 -25 53 -53c0 -62 -49 -91 -110 -91c-41 0 -80 15 -129 50c-35 25 -54 33 -74 33c-11 0 -17 -3 -32 -14c-6 -5 -12 -10 -19 -14l-25 22l292 354 h-136c-37 0 -58 -14 -73 -61l-27 3l44 154h311v-10"],123:[686,187,348,4,436,"436 686l-3 -12c-82 -15 -118 -48 -138 -124l-45 -171c-22 -85 -54 -111 -152 -130c75 -20 93 -34 93 -76c0 -23 -10 -70 -29 -130c-19 -63 -30 -113 -30 -140c0 -46 22 -67 81 -78l-3 -12c-139 3 -182 25 -182 91c0 30 16 103 35 159c16 49 26 92 26 116 c0 35 -23 54 -85 70c89 19 119 41 138 116l46 179c28 109 89 142 248 142"],124:[685,18,220,66,154,"154 -18h-88v703h88v-703"],125:[686,187,348,-129,303,"94 674l3 12c94 -2 133 -10 158 -32c16 -14 24 -33 24 -56c0 -31 -16 -105 -35 -162c-16 -49 -26 -92 -26 -116c0 -35 23 -54 85 -70c-89 -20 -119 -44 -138 -116l-46 -179c-28 -111 -89 -142 -248 -142l3 12c82 15 118 48 138 124l45 171c22 85 54 111 152 130 c-75 20 -93 34 -93 76c0 23 8 64 28 130c20 69 31 115 31 141c0 44 -23 66 -81 77"],126:[331,-175,570,54,516,"461 308l55 -48c-46 -64 -77 -85 -123 -85c-33 0 -60 7 -105 33c-46 26 -77 35 -112 35c-29 0 -45 -10 -69 -42l-53 46c33 58 71 84 121 84c36 0 60 -7 136 -41c49 -22 64 -27 82 -27c24 0 43 13 68 45"],160:[0,0,250,0,0,""],163:[683,12,500,-32,510,"45 370h105c25 124 49 182 98 237c42 49 96 76 153 76c63 0 109 -39 109 -91c0 -38 -26 -68 -61 -68c-30 0 -53 22 -53 51c0 10 2 22 4 34c2 7 3 14 3 19c0 12 -10 21 -24 21c-29 0 -50 -27 -60 -77l-39 -202h114l-10 -60h-115c-13 -58 -37 -127 -64 -169l-11 -17 c59 -23 92 -32 125 -32c48 0 68 14 90 63h25c-12 -58 -24 -86 -45 -114c-26 -33 -65 -53 -106 -53c-42 0 -76 16 -127 61c-27 -43 -55 -60 -98 -60c-53 0 -90 35 -90 86c0 52 39 87 96 87c21 0 35 -3 61 -14c7 66 9 79 19 162h-109zM113 90c-24 22 -42 30 -64 30 c-31 0 -51 -20 -51 -50s23 -51 56 -51c30 0 48 22 59 71"],165:[669,0,500,33,628,"628 669v-25c-40 -8 -61 -25 -93 -69l-166 -233h135l-13 -50h-150l-21 -78h152l-14 -50h-152l-3 -11c-12 -44 -16 -66 -16 -85c0 -33 14 -40 81 -43v-25h-322v25c77 5 93 17 109 72l19 67h-141l14 50h141l22 78h-142l14 50h125l-79 239c-17 52 -27 56 -82 63v25h280v-25 c-57 -2 -75 -9 -75 -32c0 -9 2 -20 6 -32l80 -236l135 194c21 30 26 42 26 60c0 35 -14 44 -70 46v25h200"],167:[685,143,500,36,459,"221 419l2 3c-36 40 -55 85 -55 129c0 79 63 134 155 134c79 0 136 -41 136 -98c0 -35 -25 -62 -58 -62c-30 0 -55 25 -55 55c0 40 36 37 36 55c0 15 -28 28 -59 28c-50 0 -85 -30 -85 -73c0 -32 19 -63 69 -122l69 -81c39 -45 59 -97 59 -144c0 -81 -53 -122 -117 -122 c-10 0 -18 1 -30 4l-2 -4c43 -54 59 -88 59 -130c0 -75 -72 -134 -164 -134c-82 0 -145 46 -145 105c0 35 24 61 58 61c33 0 56 -22 56 -51c0 -32 -35 -35 -35 -63c0 -15 33 -29 67 -29c51 0 86 31 86 76c0 33 -13 51 -84 137l-66 80c-35 43 -50 83 -50 126 c0 84 46 126 104 126c13 0 36 -3 49 -6zM364 206c0 67 -111 194 -169 194c-32 0 -56 -25 -56 -58c0 -21 11 -51 29 -76c25 -35 57 -72 79 -91c23 -20 37 -27 58 -27c32 0 59 27 59 58"],168:[655,-525,333,55,397,"397 589c0 -35 -30 -64 -66 -64c-34 0 -64 30 -64 64c0 36 29 66 64 66c36 0 66 -30 66 -66zM185 589c0 -35 -30 -64 -66 -64c-34 0 -64 30 -64 64c0 36 29 66 64 66c36 0 66 -30 66 -66"],175:[623,-553,333,51,393,"393 623l-16 -70h-326l17 70h325"],176:[688,-402,400,83,369,"369 545c0 -79 -64 -143 -143 -143s-143 64 -143 143s64 143 143 143s143 -64 143 -143zM314 545c0 49 -39 88 -88 88s-88 -39 -88 -88s39 -88 88 -88s88 39 88 88"],180:[697,-516,333,139,379,"139 516l122 131c36 38 52 50 70 50c26 0 48 -21 48 -47c0 -19 -9 -30 -39 -47l-152 -87h-49"],181:[449,207,576,-60,516,"516 449l-104 -336c-3 -10 -5 -20 -5 -27c0 -8 5 -14 12 -14c15 0 33 17 63 62l22 -16c-73 -105 -110 -131 -166 -131c-37 0 -63 26 -63 63c0 18 2 30 11 68c-53 -90 -85 -118 -132 -118c-24 0 -52 9 -62 24c-14 -43 -23 -89 -23 -133c0 -62 -29 -98 -79 -98 c-37 0 -50 27 -50 66c0 51 41 103 74 215l111 375h135l-93 -312c-4 -14 -7 -31 -7 -42c0 -16 7 -25 19 -25c42 0 117 106 151 215l51 164h135"],183:[405,-257,250,51,199,"199 331c0 -42 -33 -74 -75 -74s-73 32 -73 74s32 74 75 74c40 0 73 -34 73 -74"],240:[699,13,500,-3,454,"454 664l-107 -56c68 -74 94 -137 94 -228c0 -209 -119 -393 -286 -393c-94 0 -158 63 -158 147c0 175 137 328 275 328c31 0 54 -12 71 -42l2 4c-4 54 -23 100 -62 150l-119 -62l-33 31l122 64c-40 38 -77 58 -117 65l45 27c49 -7 89 -25 132 -60l107 57zM322 375 c0 36 -18 58 -46 58c-88 0 -160 -239 -160 -347c0 -47 16 -70 49 -70c51 0 84 63 109 129c27 73 48 173 48 230"],295:[699,9,556,-13,498,"65 514l12 44h61c7 25 11 42 11 51c0 23 -13 33 -42 33h-22v27c81 7 132 15 209 30l-37 -141h159l-12 -44h-158l-60 -231c99 141 145 179 213 179c49 0 76 -28 76 -75c0 -19 -9 -56 -29 -118l-59 -182c-3 -8 -3 -9 -3 -12c0 -7 9 -16 17 -16c13 0 32 21 75 83l22 -15 c-66 -103 -106 -136 -167 -136c-39 0 -66 24 -66 64c0 41 11 77 61 225l20 59c5 15 7 24 7 30c0 16 -8 21 -20 21c-27 0 -63 -31 -106 -94c-49 -72 -68 -121 -119 -296h-121l139 514h-61"],305:[462,9,278,2,238,"216 142l22 -14c-66 -108 -108 -137 -168 -137c-41 0 -68 20 -68 63c0 14 5 40 15 76l55 203c6 24 8 37 8 45c0 19 -16 29 -46 29h-14v27c78 6 149 16 203 28l-91 -334c-5 -17 -9 -42 -9 -51c0 -12 7 -16 15 -16c15 0 37 23 64 61"],567:[462,207,278,-189,239,"239 462l-116 -444c-42 -160 -107 -225 -207 -225c-63 0 -105 33 -105 77c0 29 22 53 49 53c29 0 49 -19 49 -49c0 -21 -15 -21 -15 -35c0 -10 12 -15 24 -15c28 0 49 36 74 136l89 350c8 30 12 54 12 67c0 21 -12 30 -41 30h-22v27c112 10 149 15 209 28"],710:[690,-516,333,40,367,"367 516h-51l-88 95l-131 -95h-57l160 174h81"],711:[690,-516,333,79,411,"411 690l-162 -174h-82l-88 174h51l90 -97l134 97h57"],728:[678,-516,333,71,387,"348 678h39c-21 -103 -81 -162 -178 -162c-93 0 -138 54 -138 149v13h43c5 -57 35 -90 99 -90c66 0 104 24 135 90"],729:[655,-525,333,163,293,"293 589c0 -35 -30 -64 -66 -64c-34 0 -64 30 -64 64c0 36 29 66 64 66c36 0 66 -30 66 -66"],730:[754,-541,333,127,340,"340 648c0 -59 -48 -107 -107 -107c-64 0 -106 45 -106 108c0 59 49 105 107 105c63 0 106 -47 106 -106zM292 646c0 33 -27 60 -60 60c-31 0 -57 -27 -57 -59s26 -58 57 -58c33 0 60 26 60 57"],732:[655,-536,333,48,407,"366 655h41c-22 -84 -57 -119 -117 -119c-19 0 -30 2 -57 13l-59 23c-13 5 -27 8 -38 8c-22 0 -35 -11 -48 -43h-40c13 72 59 118 116 118c25 0 56 -8 97 -26c27 -11 42 -16 54 -16c23 0 36 10 51 42"],913:[683,0,667,-68,593,"593 0h-303v25c53 4 77 19 77 49c0 5 -1 9 -2 15l-12 119h-215l-57 -96c-11 -18 -17 -35 -17 -50c0 -24 16 -37 64 -37v-25h-195l-1 25c37 4 55 27 86 76l370 582h25l94 -560c14 -82 23 -94 86 -98v-25zM346 248l-37 243l-148 -243h185"],914:[669,0,667,-25,624,"118 669h265c161 0 241 -50 241 -146c0 -109 -86 -138 -189 -168v-1c96 -27 137 -73 137 -148c0 -134 -112 -206 -295 -206h-302v25c48 6 68 24 84 83l119 438c7 25 11 47 11 57c0 39 -32 41 -71 41v25zM334 577l-57 -209c69 5 116 5 153 40c30 28 47 72 47 128 c0 67 -29 101 -87 101c-32 0 -41 -4 -56 -60zM269 338l-64 -236c-5 -19 -7 -29 -7 -37c0 -23 18 -33 57 -33c53 0 90 21 121 59c29 35 43 88 43 138c0 37 -12 67 -35 85c-21 16 -50 22 -115 24"],915:[669,0,585,-13,670,"670 669l-43 -190l-27 5c0 51 -4 80 -20 100c-32 40 -83 53 -167 53c-41 0 -53 -10 -63 -48l-125 -457c-8 -30 -15 -50 -15 -63c0 -31 15 -40 71 -44v-25h-294v25c58 6 67 24 82 79l121 442c6 23 10 46 10 61c0 20 -11 29 -42 33l-31 4v25h543"],916:[683,0,667,-65,549,"549 0h-614l453 683h25zM384 124l-75 367l-240 -367h315"],917:[669,0,667,-27,653,"653 669l-43 -190l-27 5c-3 71 -4 96 -45 123c-30 19 -76 30 -137 30c-41 0 -55 -6 -67 -51l-59 -216c132 0 158 13 205 107l28 -4l-74 -274l-28 4c3 19 4 30 4 44c0 69 -31 91 -144 91l-63 -234c-5 -20 -8 -31 -8 -38c0 -24 18 -34 61 -34c88 0 157 19 214 61 c37 27 57 50 91 106l25 -5l-60 -194h-553v25c52 8 65 19 82 80l119 432c9 33 12 55 12 70c0 20 -10 29 -41 33l-33 4v25h541"],918:[669,0,611,-12,589,"589 640l-434 -605h75c92 0 147 12 199 50c36 27 69 69 97 114l27 -5l-60 -194h-505v29l434 605h-83c-105 0 -168 -36 -247 -147l-28 4l58 178h467v-29"],919:[669,0,778,-24,799,"799 669v-25c-49 0 -68 -21 -82 -74l-111 -408c-15 -57 -22 -81 -22 -96c0 -29 18 -39 73 -41v-25h-316v25c67 4 85 16 102 79l62 225h-239l-54 -197c-10 -36 -12 -52 -12 -67s7 -35 71 -40v-25h-295v25c50 7 65 16 81 74l121 447c8 28 11 46 11 58c0 22 -11 32 -42 36 l-31 4v25h316v-25c-65 -2 -84 -15 -102 -80l-52 -191h239l47 173c5 19 10 49 10 61c0 20 -10 29 -41 33l-31 4v25h297"],920:[685,18,718,27,691,"466 457l28 -4c-35 -76 -50 -173 -59 -254l-27 3c0 49 -3 65 -42 65h-41c-48 0 -59 -15 -86 -65l-26 10c36 74 51 163 56 241l29 4c1 -54 6 -70 57 -70h34c41 0 51 13 77 70zM691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239 c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM547 528c0 83 -41 123 -101 123c-63 0 -112 -16 -162 -100c-60 -101 -113 -289 -113 -408c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],921:[669,0,389,-32,406,"406 669v-25c-49 -5 -67 -17 -84 -80l-112 -412c-14 -51 -17 -71 -17 -87c0 -28 14 -37 71 -40v-25h-296v25c49 6 64 11 83 82l117 429c8 29 14 59 14 71c0 20 -15 30 -42 33l-32 4v25h298"],922:[669,0,667,-21,702,"702 669v-25c-43 -6 -51 -9 -94 -48l-216 -199l157 -333c11 -24 25 -35 63 -39v-25h-280l1 25l26 4c27 4 38 9 38 23c0 12 -5 27 -15 49l-111 236l-67 -249c-1 -5 -2 -11 -2 -17c0 -33 13 -42 65 -46v-25h-288v25c45 5 65 15 79 68l123 453c8 28 11 46 11 58 c0 22 -10 32 -41 36l-33 4v25h311v-25c-59 -5 -80 -20 -94 -72l-62 -227l197 175c59 52 77 78 77 97c0 15 -10 23 -35 25l-21 2v25h211"],923:[683,0,655,-68,581,"581 0h-303v25c53 4 77 19 77 49c0 5 -1 9 -2 15l-50 399h-2l-220 -376c-11 -18 -17 -35 -17 -50c0 -24 16 -37 64 -37v-25h-195l-1 25c37 4 55 27 86 76l364 582h25l88 -560c13 -82 23 -94 86 -98v-25"],924:[669,12,889,-29,917,"917 669v-25c-51 -6 -67 -19 -84 -81l-119 -438c-5 -17 -10 -45 -10 -57c0 -32 12 -43 71 -43v-25h-311v25c69 4 85 21 101 79l123 457l-375 -573h-28l-67 559l-101 -369c-14 -50 -20 -75 -20 -92c0 -45 16 -55 80 -61v-25h-206v25c54 12 67 33 103 157l107 369 c7 26 11 44 11 58c0 28 -7 35 -71 35v25h219l54 -480l311 480h212"],925:[669,15,722,-27,748,"748 669v-25c-56 -11 -66 -24 -102 -153l-143 -506h-28l-257 547l-99 -354c-12 -42 -19 -75 -19 -94c0 -39 20 -54 79 -59v-25h-206v25c55 11 60 17 101 155l120 407c-19 44 -27 52 -82 57v25h193l216 -467l81 289c11 41 19 75 19 94c0 38 -21 59 -81 59v25h208"],926:[669,0,746,25,740,"740 669l-28 -183l-25 5c0 53 -21 58 -92 58h-301c-42 0 -58 -7 -96 -63l-26 7l58 176h510zM618 462l-64 -231l-25 3c0 43 -12 59 -57 59h-161c-57 0 -68 -15 -88 -62l-25 3l64 236l25 -2c0 -41 5 -61 56 -61h159c39 0 71 4 91 61zM653 199l-64 -199h-564l41 205l25 6 c0 -62 33 -81 89 -81h320c69 0 89 10 128 75"],927:[685,18,722,27,691,"691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM547 528c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120c-60 -101 -113 -269 -113 -388 c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],928:[669,0,778,-24,799,"799 669v-25c-49 0 -68 -21 -82 -74l-111 -408c-15 -57 -22 -81 -22 -96c0 -29 18 -39 73 -41v-25h-316v25c67 4 85 16 102 79l144 525h-239l-136 -497c-10 -36 -12 -52 -12 -67s7 -35 71 -40v-25h-295v25c50 7 65 16 81 74l121 447c8 28 11 46 11 58c0 22 -11 32 -42 36 l-31 4v25h683"],929:[669,0,611,-28,613,"112 669h282c147 0 219 -54 219 -155c0 -53 -21 -98 -59 -131c-48 -42 -122 -66 -214 -66c-27 0 -46 1 -81 5l-54 -199c-5 -17 -11 -48 -11 -58c0 -27 16 -37 72 -40v-25h-294v25c52 8 66 17 84 82l117 426c11 39 13 59 13 74c0 20 -10 29 -41 33l-33 4v25zM330 584 l-61 -229c17 -3 29 -3 42 -3c62 0 96 18 123 62c22 35 33 93 33 136c0 53 -31 87 -84 87c-35 0 -41 -9 -53 -53"],931:[669,0,633,-11,619,"619 669l-37 -181l-25 4c0 93 -37 142 -127 142h-152l146 -262l-260 -238h225c84 0 106 14 144 79l26 -5l-61 -208h-509v28l313 287l-186 325v29h503"],932:[669,0,611,49,650,"650 669l-36 -192l-27 2c0 114 -38 155 -138 155l-135 -489c-7 -24 -17 -53 -17 -74c0 -29 23 -46 83 -46v-25h-331v25h15c46 0 77 20 91 72l148 537c-102 -2 -167 -37 -218 -143l-25 7l39 171h551"],933:[685,0,611,21,697,"697 628l-17 -19c-24 20 -51 26 -75 26c-42 0 -81 -26 -119 -79c-30 -42 -68 -109 -106 -248l-53 -192c-5 -17 -10 -36 -10 -49c0 -31 17 -42 79 -42v-25h-323v25c66 6 87 16 104 78l56 209c0 84 -17 304 -126 304c-21 0 -38 -6 -68 -29l-18 18c40 61 95 80 150 80 c144 0 185 -144 185 -274h4c44 134 137 266 243 266c38 0 70 -11 94 -49"],934:[669,0,771,26,763,"538 581l-4 -18c124 -1 229 -50 229 -176c0 -205 -234 -292 -355 -292c-3 -12 -4 -20 -4 -29c0 -28 17 -41 79 -41v-25h-311v25c64 6 71 12 87 70h-8c-134 0 -225 69 -225 194c0 179 195 274 347 274h15c4 19 7 36 7 44c0 20 -18 30 -45 33l-35 4v25h311v-25 c-56 0 -79 -23 -88 -63zM521 529l-108 -400c114 0 206 132 206 259c0 66 -30 123 -98 141zM272 129l109 400c-119 0 -211 -142 -211 -274c0 -70 23 -126 102 -126"],935:[669,0,667,-24,694,"694 669v-25c-36 -5 -56 -16 -99 -61l-199 -205l75 -237c27 -86 43 -108 115 -116v-25h-307v25c57 5 67 12 67 38c0 22 -11 63 -37 141l-20 60l-130 -144c-23 -25 -32 -42 -32 -55c0 -23 18 -36 63 -40v-25h-214v25c56 10 82 47 231 210l68 74l-83 269 c-17 55 -33 60 -93 66v25h305v-25l-29 -3c-33 -3 -45 -10 -45 -33c0 -15 12 -59 35 -132l17 -55l94 99c52 55 70 80 70 98c0 15 -10 22 -33 24l-21 2v25h202"],936:[685,0,661,17,780,"780 685v-25c-70 0 -80 -74 -87 -125c-25 -177 -202 -226 -313 -226l-52 -192c-5 -20 -10 -37 -10 -51c0 -28 17 -41 79 -41v-25h-323v25c60 6 87 15 104 78l56 206c-100 0 -212 27 -212 157c0 61 29 96 29 156c0 22 -6 37 -34 38v25h36c79 0 127 -50 127 -128 c0 -33 -14 -78 -14 -110c0 -57 24 -104 77 -104l53 193c8 29 14 59 14 71c0 20 -15 30 -42 33l-34 4v25h305v-25c-43 0 -70 -13 -81 -54l-68 -247c65 0 123 66 142 146c36 155 119 196 215 196h33"],937:[685,0,808,25,774,"279 124v32c-119 48 -150 118 -150 211c0 94 64 201 174 264c63 36 141 54 231 54c160 0 240 -83 240 -216c0 -148 -103 -271 -282 -315l-9 -30h111c69 0 89 10 128 75l25 -6l-64 -193h-295l60 192c110 24 182 161 182 289c0 89 -20 170 -107 170 c-128 0 -250 -162 -250 -313c0 -71 13 -113 67 -146l-29 -192h-286l41 199l25 6c0 -62 33 -81 89 -81h99"],945:[462,13,576,-3,574,"574 449l-158 -255c0 -72 14 -135 38 -135c21 0 43 26 58 77l24 -7c-12 -69 -56 -140 -121 -140c-57 0 -85 41 -92 79c-55 -61 -100 -81 -168 -81c-39 0 -73 8 -100 25c-36 23 -58 73 -58 133c0 158 113 317 274 317c76 0 119 -43 135 -94l44 81h124zM312 285 c0 71 -5 148 -51 148c-52 0 -145 -166 -145 -345c0 -51 23 -71 45 -71c55 0 142 118 143 192c4 22 8 48 8 76"],946:[698,205,500,-79,480,"-50 -122l135 505c31 117 138 315 280 315c58 0 115 -25 115 -104c0 -75 -53 -157 -115 -184v-2c31 -6 84 -45 84 -122c0 -129 -101 -299 -274 -299c-33 0 -57 10 -75 22l-36 -138c-6 -24 -17 -61 -25 -76h-118c8 15 23 59 29 83zM216 454l-101 -388c0 -28 15 -44 40 -44 c100 0 169 190 169 296c0 41 -9 69 -32 69c-17 0 -17 -6 -28 -6c-20 0 -27 11 -27 21c0 17 16 31 38 31c12 0 25 -4 39 -4c43 0 62 125 62 175c0 54 -14 65 -31 65c-48 0 -103 -113 -129 -215"],947:[462,204,438,3,461,"461 449l-263 -411c0 -77 -18 -242 -112 -242c-44 0 -52 41 -52 63c0 60 63 141 118 229c10 73 12 86 12 141c0 68 -17 136 -66 136c-18 0 -52 -4 -68 -68h-27c16 88 64 165 125 165c71 0 78 -65 78 -135c0 -33 -2 -102 -5 -135l136 257h124"],948:[698,13,496,-3,456,"236 429v2c-61 27 -106 55 -106 121c0 91 122 146 192 146c48 0 134 -17 134 -79c0 -24 -7 -44 -48 -44c-64 0 -43 79 -111 79c-26 0 -72 -8 -72 -60c0 -48 40 -80 99 -114s117 -82 117 -167c0 -67 -26 -156 -79 -224c-46 -59 -112 -102 -201 -102 c-110 0 -164 70 -164 149c0 48 6 102 31 143c46 76 113 133 208 150zM322 342c0 51 -29 59 -52 59c-92 -10 -154 -165 -154 -279c0 -67 9 -106 47 -106s69 35 102 106c25 54 57 162 57 220"],949:[462,13,454,-5,408,"83 234v1c-32 18 -44 43 -44 71c0 85 120 156 251 156c60 0 118 -34 118 -90c0 -40 -25 -71 -62 -71c-34 0 -58 23 -58 53c0 29 21 36 21 58c0 10 -18 17 -30 17c-44 0 -104 -54 -104 -120c0 -33 10 -52 43 -52c11 0 22 9 48 9c17 0 35 -5 35 -23c0 -23 -18 -34 -53 -34 c-10 0 -18 6 -33 6c-56 0 -92 -50 -92 -95c0 -36 24 -69 73 -69c44 0 95 16 143 83l28 -18c-37 -54 -104 -129 -207 -129c-123 0 -165 60 -165 120c0 64 38 105 88 127"],950:[698,205,415,-5,473,"283 698l6 -26c-61 -20 -81 -65 -81 -86c0 -39 27 -46 39 -49c57 37 109 77 163 77c35 0 63 -17 63 -49c0 -60 -59 -93 -201 -93c-91 -64 -168 -159 -168 -293c0 -57 36 -86 106 -86c97 0 147 -34 147 -109c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59 c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96c0 33 -10 47 -53 47c-23 0 -65 -11 -95 -11c-88 0 -140 65 -140 151c1 131 66 228 202 352c-63 11 -87 47 -87 87c0 60 68 116 173 121"],951:[462,205,488,-7,474,"178 263h1c67 99 85 123 122 158c27 26 63 41 100 41c51 0 73 -28 73 -77c0 -24 -12 -69 -26 -121l-68 -258c-13 -50 -30 -140 -30 -173c0 -13 0 -26 5 -38h-112c-13 21 -13 32 -13 50c0 39 42 209 108 448c6 23 11 58 11 76c0 17 -7 21 -20 21c-18 0 -49 -27 -69 -54 c-62 -81 -99 -162 -145 -336h-121l87 309c6 23 12 40 12 55c0 17 -6 21 -17 21c-20 0 -43 -26 -63 -49l-20 18c42 62 101 101 167 101c48 0 58 -25 58 -47c0 -15 -10 -55 -18 -78"],952:[698,13,501,-3,488,"488 508c0 -186 -75 -328 -146 -417c-57 -73 -122 -104 -191 -104c-90 0 -154 60 -154 203c0 157 71 308 141 395c59 73 132 113 202 113c97 0 148 -73 148 -190zM158 368h178c20 74 33 158 33 222c0 46 -10 79 -36 79c-22 0 -49 -28 -71 -59c-37 -52 -76 -147 -104 -242 zM325 326h-179c-19 -74 -30 -154 -30 -221c0 -51 14 -89 40 -89c27 0 57 36 83 86c29 57 61 141 86 224"],953:[462,9,278,2,238,"216 142l22 -14c-66 -108 -108 -137 -168 -137c-41 0 -68 20 -68 63c0 14 5 40 15 76l55 203c6 24 8 37 8 45c0 19 -16 29 -46 29h-14v27c78 6 149 16 203 28l-91 -334c-5 -17 -9 -42 -9 -51c0 -12 7 -16 15 -16c15 0 37 23 64 61"],954:[462,12,500,-23,504,"163 244h1c144 177 208 218 269 218c52 0 71 -38 71 -72c0 -29 -18 -62 -59 -62c-53 0 -55 47 -79 47c-10 0 -45 -10 -126 -102l118 -196c24 -40 35 -50 94 -50v-27c-29 -9 -72 -12 -95 -12c-91 0 -118 66 -138 98l-68 111l-52 -197h-122l92 334c6 23 9 36 9 44 c0 19 -16 29 -46 29h-14v27c78 6 150 16 204 28"],955:[698,18,484,-34,459,"432 150h27c-8 -110 -40 -168 -122 -168c-52 0 -69 54 -69 120c0 63 4 138 12 188l-190 -290h-124l314 444l-4 51c-6 80 -32 105 -65 105c-18 0 -47 -16 -62 -68h-27c20 88 41 166 112 166c62 0 76 -73 80 -158l17 -363c4 -84 20 -97 44 -97c14 0 48 1 57 70"],956:[449,205,523,-82,483,"460 133l23 -13c-49 -89 -95 -133 -155 -133c-44 0 -70 21 -70 64c0 8 2 33 12 80h-1c-76 -135 -107 -141 -177 -141l-33 -122c-6 -22 -18 -56 -24 -73h-117c8 15 19 46 27 75l155 579h121l-77 -289c-5 -20 -10 -40 -10 -60c0 -21 11 -37 27 -37c38 0 92 84 131 168 l58 218h119l-71 -266c-12 -46 -22 -91 -22 -103c0 -11 4 -23 15 -23c17 0 36 22 69 76"],957:[462,13,469,-23,441,"414 462l27 -5c-41 -287 -265 -430 -437 -470h-27l93 346c4 14 8 36 8 44c0 22 -21 30 -60 30v27c45 1 139 14 203 28l-92 -340h2c125 25 237 131 283 340"],958:[698,205,415,-5,426,"275 698l5 -27c-58 -21 -83 -47 -83 -76c0 -13 2 -23 15 -32c42 33 104 62 150 62c45 0 64 -16 64 -36c0 -56 -71 -95 -177 -95c-39 0 -64 -33 -64 -65c0 -16 6 -31 20 -42c37 21 91 36 141 36c42 0 63 -19 63 -42c0 -50 -61 -79 -138 -79c-20 0 -54 3 -72 6 c-61 -25 -95 -69 -95 -129c0 -57 36 -86 106 -86c97 0 147 -34 147 -109c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96c0 33 -10 47 -53 47c-23 0 -65 -11 -95 -11c-88 0 -140 55 -140 141c0 88 43 161 132 216v2 c-20 10 -40 41 -40 68c0 39 21 70 55 93v2c-17 4 -45 25 -45 64c0 72 77 112 178 125"],959:[462,13,500,-3,441,"280 462h4c97 0 157 -59 157 -151c0 -94 -44 -188 -105 -249c-49 -49 -108 -75 -175 -75c-94 0 -164 50 -164 148c0 100 40 191 100 250c51 50 115 77 183 77zM322 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322c0 -44 19 -64 49 -64 c26 0 50 15 71 49c49 80 86 220 86 307"],960:[449,15,558,-6,570,"570 449l-21 -100h-108c-17 -47 -53 -164 -53 -227c0 -25 10 -61 34 -61c16 0 42 13 65 71l23 -12c-22 -66 -69 -129 -157 -129c-56 0 -89 41 -89 83c0 73 51 189 89 275h-89c-17 -72 -63 -210 -110 -294c-24 -42 -55 -70 -99 -70s-61 17 -61 51c0 23 9 44 42 56 c31 11 49 29 68 62c37 65 70 138 86 195h-35c-36 0 -83 -24 -104 -55h-27c54 95 110 155 223 155h323"],961:[462,205,495,-81,447,"-52 -122l74 279c20 76 65 171 129 234c43 42 103 71 159 71c59 0 137 -15 137 -125c0 -92 -50 -213 -116 -277c-42 -41 -93 -73 -158 -73c-30 0 -59 10 -75 22l-34 -138c-6 -23 -19 -60 -27 -76h-118c9 16 22 56 29 83zM151 219l-37 -153c0 -28 13 -44 39 -44 c35 0 68 33 95 76c45 71 74 177 74 253c0 62 -16 82 -37 82s-47 -20 -68 -52c-26 -39 -50 -97 -66 -162"],962:[462,205,415,-5,447,"447 393c0 -40 -27 -69 -69 -69c-64 0 -77 49 -128 49c-104 0 -146 -77 -146 -184c0 -67 36 -96 106 -96c97 0 147 -34 147 -109c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96c0 33 -10 47 -53 47 c-23 0 -65 -11 -95 -11c-88 0 -140 65 -140 151c0 79 38 153 92 208c73 74 175 116 257 116c54 0 103 -22 103 -69"],963:[449,13,499,-3,536,"536 449l-21 -100h-187c29 -67 113 -61 113 -146c0 -120 -131 -216 -280 -216c-101 0 -164 56 -164 148c0 139 121 314 320 314h219zM322 222c0 66 -24 111 -46 127c-82 0 -160 -135 -160 -268c0 -24 5 -65 49 -65c78 0 157 98 157 206"],964:[449,9,415,4,455,"455 449l-23 -100h-126c-51 -129 -62 -217 -62 -235c0 -28 9 -53 32 -53c16 0 42 14 67 73l24 -11c-17 -68 -81 -132 -151 -132c-68 0 -96 40 -96 88c0 42 5 82 91 270h-46c-43 0 -107 -28 -134 -88h-27c20 75 85 188 251 188h200"],965:[462,13,536,-7,477,"300 435v27c35 0 64 -4 88 -13c60 -22 89 -71 89 -138c0 -171 -130 -324 -275 -324c-112 0 -160 46 -160 128c0 25 5 54 13 86l24 91c6 22 14 49 15 66c0 16 -3 27 -17 27c-20 0 -45 -26 -64 -49l-20 18c34 52 98 101 168 101c40 0 57 -19 57 -48c0 -13 -6 -45 -12 -67 l-38 -144c-7 -27 -16 -91 -16 -111c0 -50 24 -69 52 -69c96 0 154 268 154 356c0 57 -24 63 -58 63"],966:[462,205,678,-3,619,"195 16l37 139c21 79 59 166 117 226c37 38 83 69 139 69c75 0 131 -38 131 -139c0 -89 -39 -190 -113 -259c-48 -45 -111 -65 -205 -65l-51 -192h-114l51 192c-120 0 -190 48 -190 148c0 151 96 327 306 327h40v-27c-62 0 -120 -9 -166 -82c-43 -69 -61 -163 -61 -231 c0 -87 40 -106 79 -106zM369 253l-60 -237c29 0 77 18 102 47c59 70 89 158 89 255c0 63 -8 103 -32 103c-49 0 -85 -114 -99 -168"],967:[462,205,404,-136,515,"515 449l-300 -372l10 -88c8 -72 32 -96 52 -96c24 0 53 10 64 70h27c-8 -111 -52 -168 -117 -168c-57 0 -70 81 -73 162l-3 90l-187 -236h-124l307 373l-6 78c-7 85 -29 102 -62 102c-21 0 -52 -17 -61 -68h-27c8 62 35 166 120 166c54 0 66 -53 72 -157l5 -85l179 229 h124"],968:[462,205,652,-5,715,"715 462v-27c-70 -6 -111 -84 -130 -155c-38 -141 -108 -293 -293 -293l-51 -192h-114l51 192c-97 0 -161 58 -161 147c0 92 42 157 42 217c0 40 -17 77 -64 84v27h57c102 0 120 -55 120 -116c0 -60 -36 -199 -36 -265c0 -43 18 -65 51 -65l116 433h114l-116 -433 c25 0 46 9 67 38c99 135 78 408 302 408h45"],969:[462,13,735,-3,676,"473 435v27c114 0 162 -34 186 -81c11 -21 17 -45 17 -72c0 -119 -84 -274 -212 -313c-19 -6 -41 -9 -62 -9c-49 0 -96 16 -112 62c-30 -42 -87 -62 -141 -62c-31 0 -62 6 -86 20c-41 23 -66 68 -66 120c0 117 43 202 103 260c50 47 112 75 220 75v-27 c-44 0 -76 -6 -101 -34c-65 -71 -103 -201 -103 -318c0 -35 13 -67 47 -67c49 0 86 49 108 109c0 12 -1 29 -1 49c0 81 37 197 106 197c24 0 37 -27 37 -65c0 -19 -4 -42 -10 -65c-11 -40 -47 -103 -54 -115c-2 -13 -3 -26 -3 -38c0 -42 15 -72 53 -72 c106 0 158 271 158 334c0 20 -2 37 -8 52c-9 23 -32 33 -76 33"],976:[696,12,500,42,479,"479 617c0 -123 -201 -131 -288 -130c-39 -57 -65 -121 -87 -186c52 49 103 87 177 87c95 0 151 -93 151 -180c0 -121 -102 -220 -222 -220c-131 0 -168 132 -168 240c0 132 61 342 175 422c31 22 96 46 134 46c53 0 128 -11 128 -79zM413 640c0 13 -1 32 -19 32 c-70 0 -151 -100 -184 -155c55 1 122 12 164 51c19 18 39 45 39 72zM363 268c0 35 -22 73 -61 73c-63 0 -182 -173 -182 -232c0 -34 19 -77 58 -77c58 0 185 180 185 236"],977:[698,13,582,8,589,"589 235l-5 -31c-39 2 -64 6 -97 12c-48 -121 -110 -229 -234 -229c-112 0 -160 46 -160 128c0 39 16 76 16 107c0 16 -3 27 -17 27c-20 0 -45 -26 -64 -49l-20 18c34 52 96 101 166 101c40 0 59 -19 59 -48c0 -13 -6 -49 -11 -67c-19 -73 -19 -99 -19 -119 c0 -49 23 -69 50 -69c51 0 96 109 128 228c-148 54 -204 152 -204 252c0 137 100 202 194 202c46 0 62 -8 94 -26c61 -34 80 -111 80 -190c0 -76 -20 -158 -44 -228c29 -8 51 -15 88 -19zM429 541c0 67 -15 119 -60 119c-48 0 -80 -64 -80 -149c0 -30 0 -145 105 -212 c13 55 35 159 35 242"],978:[685,0,611,21,696,"356 411h4c36 109 104 272 237 272c73 0 99 -47 99 -93c0 -37 -27 -73 -67 -73c-45 0 -66 26 -66 55c0 26 11 42 24 54c0 5 -4 9 -15 9c-38 0 -79 -46 -107 -93c-30 -52 -61 -143 -86 -235l-52 -191c-5 -17 -10 -36 -10 -49c0 -31 17 -42 79 -42v-25h-323v25 c66 6 87 16 104 78l56 209c0 84 -17 304 -126 304c-21 0 -38 -6 -68 -29l-18 18c40 61 95 80 150 80c144 0 185 -144 185 -274"],981:[699,205,678,-3,619,"494 699l-65 -237c121 0 190 -42 190 -151c0 -90 -46 -194 -117 -259c-49 -45 -106 -65 -200 -65l-51 -192h-115l51 192c-119 0 -190 47 -190 148c0 149 99 327 317 327l62 237h118zM421 433l-113 -417c30 0 75 18 99 47c59 70 93 160 93 275c0 71 -30 95 -79 95zM195 16 l112 417c-56 0 -89 -18 -128 -80c-38 -60 -63 -147 -63 -230c0 -90 39 -107 79 -107"],982:[449,13,828,-2,844,"844 449l-21 -100h-60c5 -15 7 -41 7 -58c0 -143 -119 -304 -270 -304c-55 0 -88 24 -105 62c-36 -40 -82 -62 -132 -62c-36 0 -66 4 -90 18c-45 27 -62 76 -62 130c0 82 38 175 75 213h-22c-59 0 -108 -18 -139 -81h-27c23 81 84 182 248 182h598zM651 349h-364 c-32 -62 -57 -166 -57 -245c0 -51 17 -88 43 -88c43 0 80 46 102 106c-1 5 -3 30 -3 36c0 65 21 144 92 144c30 0 45 -24 45 -50c0 -53 -39 -111 -57 -138c-1 -10 -2 -17 -2 -26c0 -42 15 -72 53 -72c93 0 148 272 148 333"],984:[685,200,722,27,691,"166 -93l23 84c-99 24 -162 104 -162 230c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241c0 -128 -73 -271 -180 -366c-52 -46 -111 -76 -176 -89l-10 -37c-14 -51 -17 -71 -17 -87c0 -28 14 -37 71 -40v-25h-296v25c49 6 64 11 83 82zM547 528 c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120c-60 -101 -113 -269 -113 -388c0 -75 39 -127 102 -127c64 0 108 41 157 114c67 99 117 285 117 398"],985:[462,205,500,-3,441,"280 462h4c97 0 157 -59 157 -151c0 -94 -44 -188 -105 -249c-36 -36 -78 -60 -124 -69l-54 -198h-115l56 201c-62 17 -102 64 -102 139c0 100 40 191 100 250c51 50 115 77 183 77zM322 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322 c0 -44 19 -64 49 -64c26 0 50 15 71 49c49 80 86 220 86 307"],986:[685,205,669,32,665,"98 -120l26 24c27 -44 71 -63 114 -63c75 0 151 56 151 131c0 50 -54 78 -157 94c-108 17 -200 67 -200 189c0 254 229 430 472 430c82 0 161 -27 161 -86c0 -49 -26 -75 -64 -75c-90 0 -63 105 -178 105c-113 0 -271 -134 -271 -283c0 -184 239 -141 341 -226 c32 -27 45 -62 45 -98c0 -62 -38 -128 -87 -164c-55 -41 -126 -63 -198 -63c-58 0 -121 23 -155 85"],987:[492,205,475,-5,509,"486 492h23c-23 -182 -120 -228 -247 -233c-64 -3 -128 5 -167 -25c-26 -20 -38 -45 -38 -69c0 -45 25 -77 70 -77c27 0 81 18 114 18c75 0 116 -56 116 -122c0 -80 -106 -189 -196 -189c-53 0 -76 28 -76 59c0 21 12 54 56 54c47 0 38 -53 69 -53c40 0 73 49 73 96 c0 33 -10 47 -53 47c-23 0 -65 -11 -95 -11c-88 0 -140 45 -140 131c0 139 150 239 288 253c146 15 181 62 203 121"],988:[669,0,667,-13,670,"670 669l-43 -190l-27 5c0 51 -4 80 -20 100c-32 40 -83 53 -167 53c-41 0 -53 -10 -63 -48l-60 -219h220l-13 -44h-219l-53 -194c-8 -30 -15 -50 -15 -63c0 -31 15 -40 71 -44v-25h-294v25c58 6 67 24 82 79l121 442c6 23 10 46 10 61c0 20 -11 29 -42 33l-31 4v25h543"],989:[450,190,525,32,507,"507 450l-20 -84h-203l-53 -231h153l-12 -50h-153l-63 -275h-124l148 640h327"],990:[793,18,757,-7,758,"758 570l-322 -425c-17 -23 -28 -40 -28 -62c0 -19 15 -29 33 -29c24 0 53 12 77 30l10 -20c-70 -56 -122 -82 -176 -82c-70 0 -95 36 -95 75c0 52 35 88 105 151l178 160v6l-538 -184l-9 15l321 425c13 17 28 42 28 64c0 19 -13 29 -31 29c-24 0 -55 -14 -79 -32l-10 20 c70 56 122 82 176 82c70 0 96 -35 96 -74c0 -43 -20 -75 -106 -152l-178 -159v-6l538 184"],991:[698,0,485,16,466,"466 399l-301 -399h-140l279 299h-288l301 399h140l-289 -299h298"],992:[685,205,734,27,710,"52 503l-25 28c127 115 229 154 381 154c217 0 302 -146 302 -317c0 -276 -227 -546 -503 -573v40c190 52 351 282 351 499c0 29 -4 56 -11 81c-114 -44 -211 -246 -236 -415h-161c30 186 197 395 388 456c-28 91 -111 163 -215 163c-10 0 -20 0 -29 -2l-64 -274h-46 l60 262c-70 -11 -132 -47 -192 -102"],993:[639,205,530,47,467,"47 605l24 34c241 -22 396 -242 396 -441c0 -152 -46 -296 -136 -403l-36 4c13 29 23 58 30 86c14 53 20 104 20 153c0 45 -5 89 -13 131l-181 -91l-12 38l185 92c-12 42 -24 81 -38 122l-184 -92l-12 38l180 90c-44 101 -109 190 -223 239"],1008:[462,15,569,-50,592,"592 449l-154 -146c-21 -43 -46 -129 -46 -170c0 -26 14 -36 36 -36c40 0 57 -26 57 -51s-16 -61 -69 -61c-59 0 -81 51 -81 105c0 46 17 113 39 153l-260 -243h-164l157 147c21 43 46 126 46 167c0 26 -14 36 -36 36c-40 0 -57 26 -57 51s16 61 69 61 c59 0 81 -51 81 -105c0 -46 -17 -110 -38 -150l256 242h164"],1009:[462,206,517,-12,458,"303 -206h-25c1 4 2 7 2 10c0 42 -90 -13 -205 69c-62 45 -87 116 -87 192c0 121 62 256 126 320c51 50 116 77 184 77c97 0 160 -59 160 -151c0 -94 -44 -188 -105 -249c-49 -49 -107 -75 -175 -75c-66 0 -107 34 -127 90h-2c0 -109 57 -151 133 -151c27 0 58 3 81 3 c45 0 77 -16 77 -54c0 -36 -8 -47 -37 -81zM339 372c0 38 -18 61 -47 61c-21 0 -41 -10 -60 -31c-60 -67 -99 -220 -99 -322c0 -44 19 -64 49 -64c26 0 50 15 71 49c49 80 86 220 86 307"],1012:[685,18,722,27,691,"691 444c0 -128 -73 -271 -180 -366c-70 -62 -155 -96 -248 -96c-141 0 -236 84 -236 239c0 135 75 282 186 372c72 58 152 92 236 92c137 0 242 -95 242 -241zM209 359h314c15 61 24 121 24 169c0 83 -41 123 -101 123c-63 0 -112 -36 -162 -120 c-28 -47 -55 -108 -75 -172zM511 315h-315c-16 -60 -25 -121 -25 -172c0 -75 39 -127 102 -127c64 0 108 41 157 114c32 47 60 115 81 185"],1013:[462,13,466,-3,429,"429 462l-26 -152h-27c0 52 -6 115 -80 115c-73 0 -132 -94 -152 -168h177l-10 -42h-177c-7 -21 -9 -43 -9 -66c0 -68 28 -98 73 -98c44 0 85 16 133 83l29 -18c-38 -53 -103 -129 -199 -129c-119 0 -164 68 -164 157c0 153 135 313 283 318c64 2 73 -31 93 -31 c10 0 28 17 33 31h23"],1014:[460,15,486,-5,427,"93 313l-29 18c38 53 103 129 199 129c119 0 164 -68 164 -157c0 -153 -135 -313 -283 -318c-64 -2 -73 31 -93 31c-10 0 -28 -17 -33 -31h-23l26 152h27c0 -52 6 -115 80 -115c73 0 132 94 152 168h-177l10 42h177c7 21 9 43 9 66c0 68 -28 98 -73 98 c-44 0 -85 -16 -133 -83"],8211:[269,-178,500,-40,477,"477 269l-17 -91h-500l17 91h500"],8212:[269,-178,1000,-40,977,"977 269l-17 -91h-1000l17 91h1000"],8216:[685,-369,333,128,332,"319 685l13 -25c-79 -42 -118 -80 -118 -116c0 -14 6 -24 30 -37c32 -18 40 -38 40 -65c0 -48 -32 -73 -73 -73c-53 0 -83 40 -83 94c0 89 72 172 191 222"],8217:[685,-369,333,98,302,"111 369l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222"],8220:[685,-369,500,53,513,"500 685l13 -25c-79 -42 -118 -80 -118 -116c0 -14 6 -24 30 -37c32 -18 40 -38 40 -65c0 -48 -32 -73 -73 -73c-53 0 -83 40 -83 94c0 89 72 172 191 222zM244 685l13 -25c-79 -42 -118 -80 -118 -116c0 -14 6 -24 30 -37c32 -18 40 -38 40 -65c0 -48 -32 -73 -73 -73 c-53 0 -83 40 -83 94c0 89 72 172 191 222"],8221:[685,-369,500,53,513,"322 369l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94c0 -89 -72 -172 -191 -222zM66 369l-13 25c79 42 118 80 118 116c0 14 -6 24 -30 37c-32 18 -40 38 -40 65c0 48 32 73 73 73c53 0 83 -40 83 -94 c0 -89 -72 -172 -191 -222"],8224:[685,145,500,91,494,"352 560l-15 -19c-14 -18 -21 -37 -29 -74c31 1 44 4 82 23c25 12 35 16 50 16c33 0 54 -20 54 -52c0 -31 -24 -52 -58 -52c-12 0 -23 4 -46 17c-31 18 -51 24 -76 24h-11c-4 -23 -6 -38 -6 -56c0 -37 7 -70 26 -118c-39 -49 -75 -141 -109 -281 c-15 -63 -19 -76 -35 -133h-23l28 173c7 43 13 123 13 172c0 24 -1 44 -6 78c44 39 78 104 87 165c-35 -1 -40 -2 -75 -20c-28 -15 -41 -19 -61 -19c-31 0 -51 20 -51 51s20 51 52 51c16 0 29 -4 56 -17c40 -19 51 -22 83 -22c6 21 9 37 9 54c0 11 -2 22 -9 45 c-7 26 -10 42 -10 58c0 38 21 61 56 61c32 0 56 -23 56 -54c0 -22 -9 -42 -32 -71"],8225:[685,139,500,10,493,"268 471h13c5 21 6 33 6 55c0 20 -2 33 -8 58c-5 21 -6 31 -6 42c0 38 19 59 54 59c31 0 54 -22 54 -51c0 -17 -7 -33 -28 -62c-30 -42 -35 -53 -50 -102c40 4 50 6 93 23c23 9 36 13 47 13c28 0 50 -20 50 -47c0 -29 -23 -52 -53 -52c-12 0 -26 4 -51 16 c-42 19 -51 22 -89 25c-6 -23 -7 -35 -7 -68c0 -55 4 -72 24 -107c-50 -46 -67 -80 -91 -176c32 0 50 5 88 24c23 11 29 15 42 15h5c34 -1 52 -20 52 -49c0 -30 -21 -49 -53 -49c-13 0 -25 5 -49 16c-33 16 -53 21 -77 21h-12c-5 -20 -6 -32 -6 -55c0 -21 1 -32 8 -58 c6 -21 6 -31 6 -42c0 -38 -20 -59 -54 -59c-31 0 -54 21 -54 51c0 18 7 33 28 62c29 42 35 53 50 102c-40 -4 -52 -5 -93 -23c-23 -10 -36 -13 -47 -13c-28 0 -50 20 -50 47c0 29 23 52 52 52c13 0 27 -5 52 -16c42 -20 51 -22 89 -25c6 24 7 36 7 70c0 52 -4 70 -24 105 c50 46 67 80 91 176c-33 -1 -50 -5 -88 -24c-23 -11 -29 -15 -42 -15h-5c-33 1 -52 19 -52 49c0 29 21 49 52 49c14 0 26 -5 50 -16c33 -16 53 -21 76 -21"],8254:[838,-766,500,0,500,"500 766h-500v72h500v-72"],8260:[688,12,183,-168,345,"345 688l-439 -700h-74l441 700h72"],8467:[699,14,500,43,632,"43 429l26 38c40 -27 107 -51 128 -53c127 186 236 285 325 285c58 0 110 -25 110 -85c0 -77 -51 -147 -128 -194c-58 -36 -132 -59 -208 -65c-50 -84 -129 -215 -129 -286c0 -27 13 -33 25 -33c32 0 100 35 194 162l36 -27c-94 -132 -167 -185 -250 -185 c-68 0 -112 40 -112 121c0 70 49 172 103 255c-35 8 -96 43 -120 67zM333 421l1 -1c99 22 208 92 208 201c0 16 -5 28 -25 28c-57 0 -145 -155 -184 -228"],8706:[686,10,559,44,559,"234 627l2 23c30 25 79 36 119 36c130 0 204 -80 204 -256c0 -171 -103 -440 -328 -440c-120 0 -187 66 -187 176c0 159 139 293 298 293c50 0 115 -24 133 -70h4v8c1 9 2 18 2 27c0 114 -20 221 -154 221c-26 0 -58 -8 -93 -18zM423 293c0 91 -43 126 -89 126 c-88 0 -174 -152 -174 -265c0 -97 28 -124 88 -124c92 0 175 135 175 263"],9416:[690,19,695,0,695,"490 524l-22 -121h-15c-3 24 -6 43 -15 58c-13 22 -36 31 -65 31s-47 -17 -47 -47c0 -29 17 -44 57 -70c62 -42 93 -72 93 -127c0 -75 -72 -114 -137 -114c-24 0 -48 4 -75 13c-13 5 -21 6 -26 6c-10 0 -14 -3 -21 -19h-20l18 133h17c7 -59 42 -101 97 -101 c34 0 61 17 61 58c0 30 -20 49 -67 80c-48 31 -79 63 -79 112c0 68 56 108 119 108c31 0 47 -5 60 -10c8 -3 15 -6 23 -6c12 0 19 7 24 16h20zM695 335c0 -200 -151 -354 -346 -354c-199 0 -349 154 -349 357c0 200 153 352 354 352c190 0 341 -156 341 -355zM643 338 c0 168 -128 300 -299 300c-162 0 -292 -136 -292 -303c0 -168 130 -302 296 -302c168 0 295 135 295 305"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Main/BoldItalic/Main.js");
| ddeveloperr/cdnjs | ajax/libs/mathjax/2.3/jax/output/SVG/fonts/STIX-Web/Main/BoldItalic/Main.js | JavaScript | mit | 61,663 |
/*!
* Connect - directory
* Copyright(c) 2011 Sencha Inc.
* Copyright(c) 2011 TJ Holowaychuk
* MIT Licensed
*/
// TODO: icon / style for directories
// TODO: arrow key navigation
// TODO: make icons extensible
/**
* Module dependencies.
*/
var fs = require('fs')
, parse = require('url').parse
, utils = require('../utils')
, path = require('path')
, normalize = path.normalize
, extname = path.extname
, join = path.join;
/*!
* Icon cache.
*/
var cache = {};
/**
* Directory:
*
* Serve directory listings with the given `root` path.
*
* Options:
*
* - `hidden` display hidden (dot) files. Defaults to false.
* - `icons` display icons. Defaults to false.
* - `filter` Apply this filter function to files. Defaults to false.
*
* @param {String} root
* @param {Object} options
* @return {Function}
* @api public
*/
exports = module.exports = function directory(root, options){
options = options || {};
// root required
if (!root) throw new Error('directory() root path required');
var hidden = options.hidden
, icons = options.icons
, filter = options.filter
, root = normalize(root);
return function directory(req, res, next) {
if ('GET' != req.method && 'HEAD' != req.method) return next();
var accept = req.headers.accept || 'text/plain'
, url = parse(req.url)
, dir = decodeURIComponent(url.pathname)
, path = normalize(join(root, dir))
, originalUrl = parse(req.originalUrl)
, originalDir = decodeURIComponent(originalUrl.pathname)
, showUp = path != root && path != root + '/';
// null byte(s), bad request
if (~path.indexOf('\0')) return next(utils.error(400));
// malicious path, forbidden
if (0 != path.indexOf(root)) return next(utils.error(403));
// check if we have a directory
fs.stat(path, function(err, stat){
if (err) return 'ENOENT' == err.code
? next()
: next(err);
if (!stat.isDirectory()) return next();
// fetch files
fs.readdir(path, function(err, files){
if (err) return next(err);
if (!hidden) files = removeHidden(files);
if (filter) files = files.filter(filter);
files.sort();
// content-negotiation
for (var key in exports) {
if (~accept.indexOf(key) || ~accept.indexOf('*/*')) {
exports[key](req, res, files, next, originalDir, showUp, icons);
return;
}
}
// not acceptable
next(utils.error(406));
});
});
};
};
/**
* Respond with text/html.
*/
exports.html = function(req, res, files, next, dir, showUp, icons){
fs.readFile(__dirname + '/../public/directory.html', 'utf8', function(err, str){
if (err) return next(err);
fs.readFile(__dirname + '/../public/style.css', 'utf8', function(err, style){
if (err) return next(err);
if (showUp) files.unshift('..');
str = str
.replace('{style}', style)
.replace('{files}', html(files, dir, icons))
.replace('{directory}', dir)
.replace('{linked-path}', htmlPath(dir));
res.setHeader('Content-Type', 'text/html');
res.setHeader('Content-Length', str.length);
res.end(str);
});
});
};
/**
* Respond with application/json.
*/
exports.json = function(req, res, files){
files = JSON.stringify(files);
res.setHeader('Content-Type', 'application/json');
res.setHeader('Content-Length', files.length);
res.end(files);
};
/**
* Respond with text/plain.
*/
exports.plain = function(req, res, files){
files = files.join('\n') + '\n';
res.setHeader('Content-Type', 'text/plain');
res.setHeader('Content-Length', files.length);
res.end(files);
};
/**
* Map html `dir`, returning a linked path.
*/
function htmlPath(dir) {
var curr = [];
return dir.split('/').map(function(part){
curr.push(part);
return '<a href="' + curr.join('/') + '">' + part + '</a>';
}).join(' / ');
}
/**
* Map html `files`, returning an html unordered list.
*/
function html(files, dir, useIcons) {
return '<ul id="files">' + files.map(function(file){
var icon = ''
, classes = [];
if (useIcons && '..' != file) {
icon = icons[extname(file)] || icons.default;
icon = '<img src="data:image/png;base64,' + load(icon) + '" />';
classes.push('icon');
}
return '<li><a href="'
+ join(dir, file)
+ '" class="'
+ classes.join(' ') + '"'
+ ' title="' + file + '">'
+ icon + file + '</a></li>';
}).join('\n') + '</ul>';
}
/**
* Load and cache the given `icon`.
*
* @param {String} icon
* @return {String}
* @api private
*/
function load(icon) {
if (cache[icon]) return cache[icon];
return cache[icon] = fs.readFileSync(__dirname + '/../public/icons/' + icon, 'base64');
}
/**
* Filter "hidden" `files`, aka files
* beginning with a `.`.
*
* @param {Array} files
* @return {Array}
* @api private
*/
function removeHidden(files) {
return files.filter(function(file){
return '.' != file[0];
});
}
/**
* Icon map.
*/
var icons = {
'.js': 'page_white_code_red.png'
, '.c': 'page_white_c.png'
, '.h': 'page_white_h.png'
, '.cc': 'page_white_cplusplus.png'
, '.php': 'page_white_php.png'
, '.rb': 'page_white_ruby.png'
, '.cpp': 'page_white_cplusplus.png'
, '.swf': 'page_white_flash.png'
, '.pdf': 'page_white_acrobat.png'
, 'default': 'page_white.png'
};
| TylerFisher/optimization | node_modules/grunt-contrib-connect/node_modules/connect/lib/middleware/directory.js | JavaScript | mit | 5,453 |
/*
Version: 3.2 Timestamp: Mon Sep 10 10:38:04 PDT 2012
*/
.select2-container {
position: relative;
display: inline-block;
/* inline-block for ie7 */
zoom: 1;
*display: inline;
vertical-align: top;
}
.select2-container,
.select2-drop,
.select2-search,
.select2-search input{
/*
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info : http://www.quirksmode.org/css/box.html
*/
-moz-box-sizing: border-box; /* firefox */
-ms-box-sizing: border-box; /* ie */
-webkit-box-sizing: border-box; /* webkit */
-khtml-box-sizing: border-box; /* konqueror */
box-sizing: border-box; /* css3 */
}
.select2-container .select2-choice {
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.5, white));
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 50%);
background-image: -o-linear-gradient(bottom, #eeeeee 0%, #ffffff 50%);
background-image: -ms-linear-gradient(top, #eeeeee 0%, #ffffff 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#ffffff', GradientType = 0);
background-image: linear-gradient(top, #eeeeee 0%, #ffffff 50%);
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #aaa;
display: block;
overflow: hidden;
white-space: nowrap;
position: relative;
height: 26px;
line-height: 26px;
padding: 0 0 0 8px;
color: #444;
text-decoration: none;
}
.select2-container.select2-drop-above .select2-choice
{
border-bottom-color: #aaa;
-webkit-border-radius:0px 0px 4px 4px;
-moz-border-radius:0px 0px 4px 4px;
border-radius:0px 0px 4px 4px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eeeeee), color-stop(0.9, white));
background-image: -webkit-linear-gradient(center bottom, #eeeeee 0%, white 90%);
background-image: -moz-linear-gradient(center bottom, #eeeeee 0%, white 90%);
background-image: -o-linear-gradient(bottom, #eeeeee 0%, white 90%);
background-image: -ms-linear-gradient(top, #eeeeee 0%,#ffffff 90%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff',GradientType=0 );
background-image: linear-gradient(top, #eeeeee 0%,#ffffff 90%);
}
.select2-container .select2-choice span {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
-o-text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
text-overflow: ellipsis;
}
.select2-container .select2-choice abbr {
display: block;
position: absolute;
right: 26px;
top: 8px;
width: 12px;
height: 12px;
font-size: 1px;
background: url('select2.png') right top no-repeat;
cursor: pointer;
text-decoration: none;
border:0;
outline: 0;
}
.select2-container .select2-choice abbr:hover {
background-position: right -11px;
cursor: pointer;
}
.select2-drop {
background: #fff;
color: #000;
border: 1px solid #aaa;
border-top: 0;
position: absolute;
top: 100%;
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
-o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
z-index: 9999;
width:100%;
margin-top:-1px;
-webkit-border-radius: 0 0 4px 4px;
-moz-border-radius: 0 0 4px 4px;
border-radius: 0 0 4px 4px;
}
.select2-drop.select2-drop-above {
-webkit-border-radius: 4px 4px 0px 0px;
-moz-border-radius: 4px 4px 0px 0px;
border-radius: 4px 4px 0px 0px;
margin-top:1px;
border-top: 1px solid #aaa;
border-bottom: 0;
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
-o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
}
.select2-container .select2-choice div {
-webkit-border-radius: 0 4px 4px 0;
-moz-border-radius: 0 4px 4px 0;
border-radius: 0 4px 4px 0;
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
background: #ccc;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #ccc), color-stop(0.6, #eee));
background-image: -webkit-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -moz-linear-gradient(center bottom, #ccc 0%, #eee 60%);
background-image: -o-linear-gradient(bottom, #ccc 0%, #eee 60%);
background-image: -ms-linear-gradient(top, #cccccc 0%, #eeeeee 60%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#cccccc', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(top, #cccccc 0%, #eeeeee 60%);
border-left: 1px solid #aaa;
position: absolute;
right: 0;
top: 0;
display: block;
height: 100%;
width: 18px;
}
.select2-container .select2-choice div b {
background: url('select2.png') no-repeat 0 1px;
display: block;
width: 100%;
height: 100%;
}
.select2-search {
display: inline-block;
white-space: nowrap;
z-index: 10000;
min-height: 26px;
width: 100%;
margin: 0;
padding-left: 4px;
padding-right: 4px;
}
.select2-search-hidden {
display: block;
position: absolute;
left: -10000px;
}
.select2-search input {
background: #fff url('select2.png') no-repeat 100% -22px;
background: url('select2.png') no-repeat 100% -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('select2.png') no-repeat 100% -22px, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('select2.png') no-repeat 100% -22px, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('select2.png') no-repeat 100% -22px, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('select2.png') no-repeat 100% -22px, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
background: url('select2.png') no-repeat 100% -22px, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
padding: 4px 20px 4px 5px;
outline: 0;
border: 1px solid #aaa;
font-family: sans-serif;
font-size: 1em;
width:100%;
margin:0;
height:auto !important;
min-height: 26px;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
border-radius: 0;
-moz-border-radius: 0;
-webkit-border-radius: 0;
}
.select2-drop.select2-drop-above .select2-search input
{
margin-top:4px;
}
.select2-search input.select2-active {
background: #fff url('spinner.gif') no-repeat 100%;
background: url('spinner.gif') no-repeat 100%, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, white), color-stop(0.99, #eeeeee));
background: url('spinner.gif') no-repeat 100%, -webkit-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('spinner.gif') no-repeat 100%, -moz-linear-gradient(center bottom, white 85%, #eeeeee 99%);
background: url('spinner.gif') no-repeat 100%, -o-linear-gradient(bottom, white 85%, #eeeeee 99%);
background: url('spinner.gif') no-repeat 100%, -ms-linear-gradient(top, #ffffff 85%, #eeeeee 99%);
background: url('spinner.gif') no-repeat 100%, linear-gradient(top, #ffffff 85%, #eeeeee 99%);
}
.select2-container-active .select2-choice,
.select2-container-active .select2-choices {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
box-shadow : 0 0 5px rgba(0,0,0,.3);
border: 1px solid #5897fb;
outline: none;
}
.select2-dropdown-open .select2-choice {
border: 1px solid #aaa;
border-bottom-color: transparent;
-webkit-box-shadow: 0 1px 0 #fff inset;
-moz-box-shadow : 0 1px 0 #fff inset;
-o-box-shadow : 0 1px 0 #fff inset;
box-shadow : 0 1px 0 #fff inset;
background-color: #eee;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, white), color-stop(0.5, #eeeeee));
background-image: -webkit-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -moz-linear-gradient(center bottom, white 0%, #eeeeee 50%);
background-image: -o-linear-gradient(bottom, white 0%, #eeeeee 50%);
background-image: -ms-linear-gradient(top, #ffffff 0%,#eeeeee 50%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee',GradientType=0 );
background-image: linear-gradient(top, #ffffff 0%,#eeeeee 50%);
-webkit-border-bottom-left-radius : 0;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomleft : 0;
-moz-border-radius-bottomright: 0;
border-bottom-left-radius : 0;
border-bottom-right-radius: 0;
}
.select2-dropdown-open .select2-choice div {
background: transparent;
border-left: none;
}
.select2-dropdown-open .select2-choice div b {
background-position: -18px 1px;
}
/* results */
.select2-results {
margin: 4px 4px 4px 0;
padding: 0 0 0 4px;
position: relative;
overflow-x: hidden;
overflow-y: auto;
max-height: 200px;
}
.select2-results ul.select2-result-sub {
margin: 0 0 0 0;
}
.select2-results ul.select2-result-sub > li .select2-result-label { padding-left: 20px }
.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 40px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 60px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 80px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 100px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 110px }
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label { padding-left: 120px }
.select2-results li {
list-style: none;
display: list-item;
}
.select2-results li.select2-result-with-children > .select2-result-label {
font-weight: bold;
}
.select2-results .select2-result-label {
padding: 3px 7px 4px;
margin: 0;
cursor: pointer;
}
.select2-results .select2-highlighted {
background: #3875d7;
color: #fff;
}
.select2-results li em {
background: #feffde;
font-style: normal;
}
.select2-results .select2-highlighted em {
background: transparent;
}
.select2-results .select2-no-results,
.select2-results .select2-searching,
.select2-results .select2-selection-limit {
background: #f4f4f4;
display: list-item;
}
/*
disabled look for already selected choices in the results dropdown
.select2-results .select2-disabled.select2-highlighted {
color: #666;
background: #f4f4f4;
display: list-item;
cursor: default;
}
.select2-results .select2-disabled {
background: #f4f4f4;
display: list-item;
cursor: default;
}
*/
.select2-results .select2-disabled {
display: none;
}
.select2-more-results.select2-active {
background: #f4f4f4 url('spinner.gif') no-repeat 100%;
}
.select2-more-results {
background: #f4f4f4;
display: list-item;
}
/* disabled styles */
.select2-container.select2-container-disabled .select2-choice {
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container.select2-container-disabled .select2-choice div {
background-color: #f4f4f4;
background-image: none;
border-left: 0;
}
/* multiselect */
.select2-container-multi .select2-choices {
background-color: #fff;
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
border: 1px solid #aaa;
margin: 0;
padding: 0;
cursor: text;
overflow: hidden;
height: auto !important;
height: 1%;
position: relative;
}
.select2-container-multi .select2-choices {
min-height: 26px;
}
.select2-container-multi.select2-container-active .select2-choices {
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
box-shadow : 0 0 5px rgba(0,0,0,.3);
border: 1px solid #5897fb;
outline: none;
}
.select2-container-multi .select2-choices li {
float: left;
list-style: none;
}
.select2-container-multi .select2-choices .select2-search-field {
white-space: nowrap;
margin: 0;
padding: 0;
}
.select2-container-multi .select2-choices .select2-search-field input {
color: #666;
background: transparent !important;
font-family: sans-serif;
font-size: 100%;
height: 15px;
padding: 5px;
margin: 1px 0;
outline: 0;
border: 0;
-webkit-box-shadow: none;
-moz-box-shadow : none;
-o-box-shadow : none;
box-shadow : none;
}
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
background: #fff url('spinner.gif') no-repeat 100% !important;
}
.select2-default {
color: #999 !important;
}
.select2-container-multi .select2-choices .select2-search-choice {
-webkit-border-radius: 3px;
-moz-border-radius : 3px;
border-radius : 3px;
-moz-background-clip : padding;
-webkit-background-clip: padding-box;
background-clip : padding-box;
background-color: #e4e4e4;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0 );
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: -ms-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
-webkit-box-shadow: 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
-moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
color: #333;
border: 1px solid #aaaaaa;
line-height: 13px;
padding: 3px 5px 3px 18px;
margin: 3px 0 3px 5px;
position: relative;
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice span {
cursor: default;
}
.select2-container-multi .select2-choices .select2-search-choice-focus {
background: #d4d4d4;
}
.select2-search-choice-close {
display: block;
position: absolute;
right: 3px;
top: 4px;
width: 12px;
height: 13px;
font-size: 1px;
background: url('select2.png') right top no-repeat;
outline: none;
}
.select2-container-multi .select2-search-choice-close {
left: 3px;
}
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
background-position: right -11px;
}
.select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
background-position: right -11px;
}
/* disabled styles */
.select2-container-multi.select2-container-disabled .select2-choices{
background-color: #f4f4f4;
background-image: none;
border: 1px solid #ddd;
cursor: default;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
background-image: none;
background-color: #f4f4f4;
border: 1px solid #ddd;
padding: 3px 5px 3px 5px;
}
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
display: none;
}
/* end multiselect */
.select2-result-selectable .select2-match,
.select2-result-unselectable .select2-result-selectable .select2-match { text-decoration: underline; }
.select2-result-unselectable .select2-match { text-decoration: none; }
.select2-offscreen { position: absolute; left: -10000px; }
/* Retina-ize icons */
@media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
background-image: url(select2x2.png) !important;
background-repeat: no-repeat !important;
background-size: 60px 40px !important;
}
.select2-search input {
background-position: 100% -21px !important;
}
}
| jrbasso/cdnjs | ajax/libs/x-editable/1.4.1/inputs/select2/lib/select2.css | CSS | mit | 17,682 |
/* Flot plugin for drawing all elements of a plot on the canvas.
Copyright (c) 2007-2013 IOLA and Ole Laursen.
Licensed under the MIT license.
Flot normally produces certain elements, like axis labels and the legend, using
HTML elements. This permits greater interactivity and customization, and often
looks better, due to cross-browser canvas text inconsistencies and limitations.
It can also be desirable to render the plot entirely in canvas, particularly
if the goal is to save it as an image, or if Flot is being used in a context
where the HTML DOM does not exist, as is the case within Node.js. This plugin
switches out Flot's standard drawing operations for canvas-only replacements.
Currently the plugin supports only axis labels, but it will eventually allow
every element of the plot to be rendered directly to canvas.
The plugin supports these options:
{
canvas: boolean
}
The "canvas" option controls whether full canvas drawing is enabled, making it
possible to toggle on and off. This is useful when a plot uses HTML text in the
browser, but needs to redraw with canvas text when exporting as an image.
*/
(function($) {
var options = {
canvas: true
};
var render, getTextInfo, addText;
// Cache the prototype hasOwnProperty for faster access
var hasOwnProperty = Object.prototype.hasOwnProperty;
function init(plot, classes) {
var Canvas = classes.Canvas;
// We only want to replace the functions once; the second time around
// we would just get our new function back. This whole replacing of
// prototype functions is a disaster, and needs to be changed ASAP.
if (render == null) {
getTextInfo = Canvas.prototype.getTextInfo,
addText = Canvas.prototype.addText,
render = Canvas.prototype.render;
}
// Finishes rendering the canvas, including overlaid text
Canvas.prototype.render = function() {
if (!plot.getOptions().canvas) {
return render.call(this);
}
var context = this.context,
cache = this._textCache;
// For each text layer, render elements marked as active
context.save();
context.textBaseline = "middle";
for (var layerKey in cache) {
if (hasOwnProperty.call(cache, layerKey)) {
var layerCache = cache[layerKey];
for (var styleKey in layerCache) {
if (hasOwnProperty.call(layerCache, styleKey)) {
var styleCache = layerCache[styleKey],
updateStyles = true;
for (var key in styleCache) {
if (hasOwnProperty.call(styleCache, key)) {
var info = styleCache[key],
positions = info.positions,
lines = info.lines;
// Since every element at this level of the cache have the
// same font and fill styles, we can just change them once
// using the values from the first element.
if (updateStyles) {
context.fillStyle = info.font.color;
context.font = info.font.definition;
updateStyles = false;
}
for (var i = 0, position; position = positions[i]; i++) {
if (position.active) {
for (var j = 0, line; line = position.lines[j]; j++) {
context.fillText(lines[j].text, line[0], line[1]);
}
} else {
positions.splice(i--, 1);
}
}
if (positions.length == 0) {
delete styleCache[key];
}
}
}
}
}
}
}
context.restore();
};
// Creates (if necessary) and returns a text info object.
//
// When the canvas option is set, the object looks like this:
//
// {
// width: Width of the text's bounding box.
// height: Height of the text's bounding box.
// positions: Array of positions at which this text is drawn.
// lines: [{
// height: Height of this line.
// widths: Width of this line.
// text: Text on this line.
// }],
// font: {
// definition: Canvas font property string.
// color: Color of the text.
// },
// }
//
// The positions array contains objects that look like this:
//
// {
// active: Flag indicating whether the text should be visible.
// lines: Array of [x, y] coordinates at which to draw the line.
// x: X coordinate at which to draw the text.
// y: Y coordinate at which to draw the text.
// }
Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) {
if (!plot.getOptions().canvas) {
return getTextInfo.call(this, layer, text, font, angle, width);
}
var textStyle, layerCache, styleCache, info;
// Cast the value to a string, in case we were given a number
text = "" + text;
// If the font is a font-spec object, generate a CSS definition
if (typeof font === "object") {
textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family;
} else {
textStyle = font;
}
// Retrieve (or create) the cache for the text's layer and styles
layerCache = this._textCache[layer];
if (layerCache == null) {
layerCache = this._textCache[layer] = {};
}
styleCache = layerCache[textStyle];
if (styleCache == null) {
styleCache = layerCache[textStyle] = {};
}
info = styleCache[text];
if (info == null) {
var context = this.context;
// If the font was provided as CSS, create a div with those
// classes and examine it to generate a canvas font spec.
if (typeof font !== "object") {
var element = $("<div> </div>")
.css("position", "absolute")
.addClass(typeof font === "string" ? font : null)
.appendTo(this.getTextLayer(layer));
font = {
lineHeight: element.height(),
style: element.css("font-style"),
variant: element.css("font-variant"),
weight: element.css("font-weight"),
family: element.css("font-family"),
color: element.css("color")
};
// Setting line-height to 1, without units, sets it equal
// to the font-size, even if the font-size is abstract,
// like 'smaller'. This enables us to read the real size
// via the element's height, working around browsers that
// return the literal 'smaller' value.
font.size = element.css("line-height", 1).height();
element.remove();
}
textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px " + font.family;
// Create a new info object, initializing the dimensions to
// zero so we can count them up line-by-line.
info = styleCache[text] = {
width: 0,
height: 0,
positions: [],
lines: [],
font: {
definition: textStyle,
color: font.color
}
};
context.save();
context.font = textStyle;
// Canvas can't handle multi-line strings; break on various
// newlines, including HTML brs, to build a list of lines.
// Note that we could split directly on regexps, but IE < 9 is
// broken; revisit when we drop IE 7/8 support.
var lines = (text + "").replace(/<br ?\/?>|\r\n|\r/g, "\n").split("\n");
for (var i = 0; i < lines.length; ++i) {
var lineText = lines[i],
measured = context.measureText(lineText);
info.width = Math.max(measured.width, info.width);
info.height += font.lineHeight;
info.lines.push({
text: lineText,
width: measured.width,
height: font.lineHeight
});
}
context.restore();
}
return info;
};
// Adds a text string to the canvas text overlay.
Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) {
if (!plot.getOptions().canvas) {
return addText.call(this, layer, x, y, text, font, angle, width, halign, valign);
}
var info = this.getTextInfo(layer, text, font, angle, width),
positions = info.positions,
lines = info.lines;
// Text is drawn with baseline 'middle', which we need to account
// for by adding half a line's height to the y position.
y += info.height / lines.length / 2;
// Tweak the initial y-position to match vertical alignment
if (valign == "middle") {
y = Math.round(y - info.height / 2);
} else if (valign == "bottom") {
y = Math.round(y - info.height);
} else {
y = Math.round(y);
}
// FIXME: LEGACY BROWSER FIX
// AFFECTS: Opera < 12.00
// Offset the y coordinate, since Opera is off pretty
// consistently compared to the other browsers.
if (!!(window.opera && window.opera.version().split(".")[0] < 12)) {
y -= 2;
}
// Determine whether this text already exists at this position.
// If so, mark it for inclusion in the next render pass.
for (var i = 0, position; position = positions[i]; i++) {
if (position.x == x && position.y == y) {
position.active = true;
return;
}
}
// If the text doesn't exist at this position, create a new entry
position = {
active: true,
lines: [],
x: x,
y: y
};
positions.push(position);
// Fill in the x & y positions of each line, adjusting them
// individually for horizontal alignment.
for (var i = 0, line; line = lines[i]; i++) {
if (halign == "center") {
position.lines.push([Math.round(x - line.width / 2), y]);
} else if (halign == "right") {
position.lines.push([Math.round(x - line.width), y]);
} else {
position.lines.push([Math.round(x), y]);
}
y += line.height;
}
};
}
$.plot.plugins.push({
init: init,
options: options,
name: "canvas",
version: "1.0"
});
})(jQuery);
| kmungai/AdminLTE | plugins/flot/jquery.flot.canvas.js | JavaScript | mit | 9,599 |
var Negotiator = require('negotiator')
var mime = require('mime-types')
var slice = [].slice
module.exports = Accepts
function Accepts(req) {
if (!(this instanceof Accepts))
return new Accepts(req)
this.headers = req.headers
this.negotiator = Negotiator(req)
}
/**
* Check if the given `type(s)` is acceptable, returning
* the best match when true, otherwise `undefined`, in which
* case you should respond with 406 "Not Acceptable".
*
* The `type` value may be a single mime type string
* such as "application/json", the extension name
* such as "json" or an array `["json", "html", "text/plain"]`. When a list
* or array is given the _best_ match, if any is returned.
*
* Examples:
*
* // Accept: text/html
* this.types('html');
* // => "html"
*
* // Accept: text/*, application/json
* this.types('html');
* // => "html"
* this.types('text/html');
* // => "text/html"
* this.types('json', 'text');
* // => "json"
* this.types('application/json');
* // => "application/json"
*
* // Accept: text/*, application/json
* this.types('image/png');
* this.types('png');
* // => undefined
*
* // Accept: text/*;q=.5, application/json
* this.types(['html', 'json']);
* this.types('html', 'json');
* // => "json"
*
* @param {String|Array} type(s)...
* @return {String|Array|Boolean}
* @api public
*/
Accepts.prototype.type =
Accepts.prototype.types = function (types) {
if (!Array.isArray(types)) types = slice.call(arguments);
var n = this.negotiator;
if (!types.length) return n.mediaTypes();
if (!this.headers.accept) return types[0];
var mimes = types.map(extToMime);
var accepts = n.mediaTypes(mimes.filter(validMime));
var first = accepts[0];
if (!first) return false;
return types[mimes.indexOf(first)];
}
/**
* Return accepted encodings or best fit based on `encodings`.
*
* Given `Accept-Encoding: gzip, deflate`
* an array sorted by quality is returned:
*
* ['gzip', 'deflate']
*
* @param {String|Array} encoding(s)...
* @return {String|Array}
* @api public
*/
Accepts.prototype.encoding =
Accepts.prototype.encodings = function (encodings) {
if (!Array.isArray(encodings)) encodings = slice.call(arguments);
var n = this.negotiator;
if (!encodings.length) return n.encodings();
return n.encodings(encodings)[0] || false;
}
/**
* Return accepted charsets or best fit based on `charsets`.
*
* Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5`
* an array sorted by quality is returned:
*
* ['utf-8', 'utf-7', 'iso-8859-1']
*
* @param {String|Array} charset(s)...
* @return {String|Array}
* @api public
*/
Accepts.prototype.charset =
Accepts.prototype.charsets = function (charsets) {
if (!Array.isArray(charsets)) charsets = [].slice.call(arguments);
var n = this.negotiator;
if (!charsets.length) return n.charsets();
if (!this.headers['accept-charset']) return charsets[0];
return n.charsets(charsets)[0] || false;
}
/**
* Return accepted languages or best fit based on `langs`.
*
* Given `Accept-Language: en;q=0.8, es, pt`
* an array sorted by quality is returned:
*
* ['es', 'pt', 'en']
*
* @param {String|Array} lang(s)...
* @return {Array|String}
* @api public
*/
Accepts.prototype.lang =
Accepts.prototype.langs =
Accepts.prototype.language =
Accepts.prototype.languages = function (langs) {
if (!Array.isArray(langs)) langs = slice.call(arguments);
var n = this.negotiator;
if (!langs.length) return n.languages();
if (!this.headers['accept-language']) return langs[0];
return n.languages(langs)[0] || false;
}
/**
* Convert extnames to mime.
*
* @param {String} type
* @return {String}
* @api private
*/
function extToMime(type) {
if (~type.indexOf('/')) return type;
return mime.lookup(type);
}
/**
* Check if mime is valid.
*
* @param {String} type
* @return {String}
* @api private
*/
function validMime(type) {
return typeof type === 'string';
}
| junaidmasoodi/projx | node_modules/compression/node_modules/accepts/index.js | JavaScript | mit | 4,024 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form\Extension\Core\EventListener;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\Util\StringUtil;
/**
* Trims string data.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class TrimListener implements EventSubscriberInterface
{
public function preSubmit(FormEvent $event)
{
$data = $event->getData();
if (!is_string($data)) {
return;
}
$event->setData(StringUtil::trim($data));
}
/**
* Alias of {@link preSubmit()}.
*
* @deprecated since version 2.3, to be removed in 3.0.
* Use {@link preSubmit()} instead.
*/
public function preBind(FormEvent $event)
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED);
$this->preSubmit($event);
}
public static function getSubscribedEvents()
{
return array(FormEvents::PRE_SUBMIT => 'preSubmit');
}
}
| 0x73/symfony | src/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php | PHP | mit | 1,398 |
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../iron-meta/iron-meta.html">
<script>
/**
* Singleton IronMeta instance.
*/
Polymer.IronValidatableBehaviorMeta = null;
/**
* `Use Polymer.IronValidatableBehavior` to implement an element that validates user input.
* Use the related `Polymer.IronValidatorBehavior` to add custom validation logic to an iron-input.
*
* By default, an `<iron-form>` element validates its fields when the user presses the submit button.
* To validate a form imperatively, call the form's `validate()` method, which in turn will
* call `validate()` on all its children. By using `Polymer.IronValidatableBehavior`, your
* custom element will get a public `validate()`, which
* will return the validity of the element, and a corresponding `invalid` attribute,
* which can be used for styling.
*
* To implement the custom validation logic of your element, you must override
* the protected `_getValidity()` method of this behaviour, rather than `validate()`.
* See [this](https://github.com/PolymerElements/iron-form/blob/master/demo/simple-element.html)
* for an example.
*
* ### Accessibility
*
* Changing the `invalid` property, either manually or by calling `validate()` will update the
* `aria-invalid` attribute.
*
* @demo demo/index.html
* @polymerBehavior
*/
Polymer.IronValidatableBehavior = {
properties: {
/**
* Name of the validator to use.
*/
validator: {
type: String
},
/**
* True if the last call to `validate` is invalid.
*/
invalid: {
notify: true,
reflectToAttribute: true,
type: Boolean,
value: false
},
/**
* This property is deprecated and should not be used. Use the global
* validator meta singleton, `Polymer.IronValidatableBehaviorMeta` instead.
*/
_validatorMeta: {
type: Object
},
/**
* Namespace for this validator. This property is deprecated and should
* not be used. For all intents and purposes, please consider it a
* read-only, config-time property.
*/
validatorType: {
type: String,
value: 'validator'
},
_validator: {
type: Object,
computed: '__computeValidator(validator)'
}
},
observers: [
'_invalidChanged(invalid)'
],
registered: function() {
Polymer.IronValidatableBehaviorMeta = new Polymer.IronMeta({type: 'validator'});
},
_invalidChanged: function() {
if (this.invalid) {
this.setAttribute('aria-invalid', 'true');
} else {
this.removeAttribute('aria-invalid');
}
},
/**
* @return {boolean} True if the validator `validator` exists.
*/
hasValidator: function() {
return this._validator != null;
},
/**
* Returns true if the `value` is valid, and updates `invalid`. If you want
* your element to have custom validation logic, do not override this method;
* override `_getValidity(value)` instead.
* @param {Object} value The value to be validated. By default, it is passed
* to the validator's `validate()` function, if a validator is set.
* @return {boolean} True if `value` is valid.
*/
validate: function(value) {
this.invalid = !this._getValidity(value);
return !this.invalid;
},
/**
* Returns true if `value` is valid. By default, it is passed
* to the validator's `validate()` function, if a validator is set. You
* should override this method if you want to implement custom validity
* logic for your element.
*
* @param {Object} value The value to be validated.
* @return {boolean} True if `value` is valid.
*/
_getValidity: function(value) {
if (this.hasValidator()) {
return this._validator.validate(value);
}
return true;
},
__computeValidator: function() {
return Polymer.IronValidatableBehaviorMeta &&
Polymer.IronValidatableBehaviorMeta.byKey(this.validator);
}
};
</script>
| alejost848/polytipe | app/bower_components/iron-validatable-behavior/iron-validatable-behavior.html | HTML | mit | 4,713 |
define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/tokenizer","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./xml").Mode,u=e("./html").Mode,a=e("../tokenizer").Tokenizer,f=e("./markdown_highlight_rules").MarkdownHighlightRules,l=e("./folding/markdown").FoldMode,c=function(){var e=new f;this.$tokenizer=new a(e.getRules()),this.$embeds=e.getEmbeds(),this.createModeDelegates({"js-":s,"xml-":o,"html-":u}),this.foldingRules=new l};r.inherits(c,i),function(){this.lineCommentStart=">",this.getNextLineIndent=function(e,t,n){if(e=="listblock"){var r=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(t);if(!r)return"";var i=r[2];return i||(i=parseInt(r[3],10)+1+"."),r[1]+i+r[4]}return this.$getIndent(t)}}.call(c.prototype),t.Mode=c}),define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../range").Range,f=e("../worker/worker_client").WorkerClient,l=e("./behaviour/cstyle").CstyleBehaviour,c=e("./folding/cstyle").FoldMode,h=function(){this.$tokenizer=new s((new o).getRules()),this.$outdent=new u,this.$behaviour=new l,this.foldingRules=new c};r.inherits(h,i),function(){this.lineCommentStart="//",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e),s=i.tokens,o=i.state;if(s.length&&s[s.length-1].type=="comment")return r;if(e=="start"||e=="no_regex"){var u=t.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);u&&(r+=n)}else if(e=="doc-start"){if(o=="start"||o=="no_regex")return"";var u=t.match(/^\s*(\/?)\*/);u&&(u[1]&&(r+=" "),r+="* ")}return r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new f(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");return t.attachToDocument(e.getDocument()),t.on("jslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(h.prototype),t.Mode=h}),define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./doc_comment_highlight_rules").DocCommentHighlightRules,s=e("./text_highlight_rules").TextHighlightRules,o=function(){var e=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",keyword:"const|yield|import|get|set|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier"),t="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void",n="[a-zA-Z\\$_¡-][a-zA-Z\\d\\$_¡-]*\\b",r="\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)";this.$rules={no_regex:[{token:"comment",regex:/\/\/.*$/},i.getStartRule("doc-start"),{token:"comment",regex:/\/\*/,next:"comment"},{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0[xX][0-9a-fA-F]+\b/},{token:"constant.numeric",regex:/[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+n+")(\\.)(prototype)(\\.)("+n+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+n+")(\\.)("+n+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+n+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+n+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+t+")\\b",next:"start"},{token:["punctuation.operator","support.function"],regex:/(\.)(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:opzzzz|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:["punctuation.operator","support.function.dom"],regex:/(\.)(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:["punctuation.operator","support.constant"],regex:/(\.)(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|timeEnd|assert)\b/},{token:e,regex:n},{token:"keyword.operator",regex:/--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,next:"start"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"keyword.operator",regex:/\/=?/,next:"start"},{token:"comment",regex:/^#!.*$/}],start:[i.getStartRule("doc-start"),{token:"comment",regex:"\\/\\*",next:"comment_regex_allowed"},{token:"comment",regex:"\\/\\/.*$",next:"start"},{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],regex:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/\\w*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],regex_character_class:[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],function_arguments:[{token:"variable.parameter",regex:n},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],comment_regex_allowed:[{token:"comment",regex:"\\*\\/",next:"start"},{defaultToken:"comment"}],comment:[{token:"comment",regex:"\\*\\/",next:"no_regex"},{defaultToken:"comment"}],qqstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],qstring:[{token:"constant.language.escape",regex:r},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]},this.embedRules(i,"doc-",[i.getEndRule("no_regex")])};r.inherits(o,s),t.JavaScriptHighlightRules=o}),define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=function(){this.$rules={start:[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},{token:"comment.doc.tag",regex:"\\bTODO\\b"},{defaultToken:"comment.doc"}]}};r.inherits(s,i),s.getStartRule=function(e){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:e}},s.getEndRule=function(e){return{token:"comment.doc",regex:"\\*\\/",next:e}},t.DocCommentHighlightRules=s}),define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(e,t,n){var r=e("../range").Range,i=function(){};(function(){this.checkOutdent=function(e,t){return/^\s+$/.test(e)?/^\s*\}/.test(t):!1},this.autoOutdent=function(e,t){var n=e.getLine(t),i=n.match(/^(\s*\})/);if(!i)return 0;var s=i[1].length,o=e.findMatchingBracket({row:t,column:s});if(!o||o.row==t)return 0;var u=this.$getIndent(e.getLine(o.row));e.replace(new r(t,0,t,s-1),u)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(i.prototype),t.MatchingBraceOutdent=i}),define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,o=e("../../lib/lang"),u=["text","paren.rparen","punctuation.operator"],a=["text","paren.rparen","punctuation.operator","comment"],f=0,l=-1,c="",h=0,p=-1,d="",v="",m=function(){m.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),r=new s(t,n.row,n.column);if(!this.$matchTokenType(r.getCurrentToken()||"text",u)){var i=new s(t,n.row,n.column+1);if(!this.$matchTokenType(i.getCurrentToken()||"text",u))return!1}return r.stepForward(),r.getCurrentTokenRow()!==n.row||this.$matchTokenType(r.getCurrentToken()||"text",a)},m.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},m.recordAutoInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isAutoInsertedClosing(r,i,c[0])||(f=0),l=r.row,c=n+i.substr(r.column),f++},m.recordMaybeInsert=function(e,t,n){var r=e.getCursorPosition(),i=t.doc.getLine(r.row);this.isMaybeInsertedClosing(r,i)||(h=0),p=r.row,d=i.substr(0,r.column)+n,v=i.substr(r.column),h++},m.isAutoInsertedClosing=function(e,t,n){return f>0&&e.row===l&&n===c[0]&&t.substr(e.column)===c},m.isMaybeInsertedClosing=function(e,t){return h>0&&e.row===p&&t.substr(e.column)===v&&t.substr(0,e.column)==d},m.popAutoInsertedClosing=function(){c=c.substr(1),f--},m.clearMaybeInsertedClosing=function(){h=0,p=-1},this.add("braces","insertion",function(e,t,n,r,i){var s=n.getCursorPosition(),u=r.doc.getLine(s.row);if(i=="{"){var a=n.getSelectionRange(),f=r.doc.getTextRange(a);if(f!==""&&f!=="{"&&n.getWrapBehavioursEnabled())return{text:"{"+f+"}",selection:!1};if(m.isSaneInsertion(n,r))return/[\]\}\)]/.test(u[s.column])?(m.recordAutoInsert(n,r,"}"),{text:"{}",selection:[1,1]}):(m.recordMaybeInsert(n,r,"{"),{text:"{",selection:[1,1]})}else if(i=="}"){var l=u.substring(s.column,s.column+1);if(l=="}"){var c=r.$findOpeningBracket("}",{column:s.column+1,row:s.row});if(c!==null&&m.isAutoInsertedClosing(s,u,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}else if(i=="\n"||i=="\r\n"){var p="";m.isMaybeInsertedClosing(s,u)&&(p=o.stringRepeat("}",h),m.clearMaybeInsertedClosing());var l=u.substring(s.column,s.column+1);if(l=="}"||p!==""){var d=r.findMatchingBracket({row:s.row,column:s.column},"}");if(!d)return null;var v=this.getNextLineIndent(e,u.substring(0,s.column),r.getTabString()),g=this.$getIndent(u);return{text:"\n"+v+"\n"+g+p,selection:[1,v.length,1,v.length]}}}}),this.add("braces","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="{"){var o=r.doc.getLine(i.start.row),u=o.substring(i.end.column,i.end.column+1);if(u=="}")return i.end.column++,i;h--}}),this.add("parens","insertion",function(e,t,n,r,i){if(i=="("){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"("+o+")",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,")"),{text:"()",selection:[1,1]}}else if(i==")"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f==")"){var l=r.$findOpeningBracket(")",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("parens","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="("){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==")")return i.end.column++,i}}),this.add("brackets","insertion",function(e,t,n,r,i){if(i=="["){var s=n.getSelectionRange(),o=r.doc.getTextRange(s);if(o!==""&&n.getWrapBehavioursEnabled())return{text:"["+o+"]",selection:!1};if(m.isSaneInsertion(n,r))return m.recordAutoInsert(n,r,"]"),{text:"[]",selection:[1,1]}}else if(i=="]"){var u=n.getCursorPosition(),a=r.doc.getLine(u.row),f=a.substring(u.column,u.column+1);if(f=="]"){var l=r.$findOpeningBracket("]",{column:u.column+1,row:u.row});if(l!==null&&m.isAutoInsertedClosing(u,a,i))return m.popAutoInsertedClosing(),{text:"",selection:[1,1]}}}}),this.add("brackets","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s=="["){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u=="]")return i.end.column++,i}}),this.add("string_dquotes","insertion",function(e,t,n,r,i){if(i=='"'||i=="'"){var s=i,o=n.getSelectionRange(),u=r.doc.getTextRange(o);if(u!==""&&u!=="'"&&u!='"'&&n.getWrapBehavioursEnabled())return{text:s+u+s,selection:!1};var a=n.getCursorPosition(),f=r.doc.getLine(a.row),l=f.substring(a.column-1,a.column);if(l=="\\")return null;var c=r.getTokens(o.start.row),h=0,p,d=-1;for(var v=0;v<c.length;v++){p=c[v],p.type=="string"?d=-1:d<0&&(d=p.value.indexOf(s));if(p.value.length+h>o.start.column)break;h+=c[v].value.length}if(!p||d<0&&p.type!=="comment"&&(p.type!=="string"||o.start.column!==p.value.length+h-1&&p.value.lastIndexOf(s)===p.value.length-1)){if(!m.isSaneInsertion(n,r))return;return{text:s+s,selection:[1,1]}}if(p&&p.type==="string"){var g=f.substring(a.column,a.column+1);if(g==s)return{text:"",selection:[1,1]}}}}),this.add("string_dquotes","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&(s=='"'||s=="'")){var o=r.doc.getLine(i.start.row),u=o.substring(i.start.column+1,i.start.column+2);if(u==s)return i.end.column++,i}})};r.inherits(m,i),t.CstyleBehaviour=m}),define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../range").Range,s=e("./fold_mode").FoldMode,o=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};r.inherits(o,s),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.getFoldWidgetRange=function(e,t,n){var r=e.getLine(n),i=r.match(this.foldingStartMarker);if(i){var s=i.index;return i[1]?this.openingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s+i[0].length,1)}if(t!=="markbeginend")return;var i=r.match(this.foldingStopMarker);if(i){var s=i.index+i[0].length;return i[1]?this.closingBracketBlock(e,i[1],n,s):e.getCommentFoldRange(n,s,-1)}}}.call(o.prototype)}),define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./xml_highlight_rules").XmlHighlightRules,u=e("./behaviour/xml").XmlBehaviour,a=e("./folding/xml").FoldMode,f=function(){this.$tokenizer=new s((new o).getRules()),this.$behaviour=new u,this.foldingRules=new a};r.inherits(f,i),function(){this.blockComment={start:"<!--",end:"-->"}}.call(f.prototype),t.Mode=f}),define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/xml_util","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("./xml_util"),s=e("./text_highlight_rules").TextHighlightRules,o=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml-pe",regex:"<\\?.*?\\?>"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"xml-pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<\\/?",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"},{token:"text",regex:"\\s+"},{token:"text",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{token:"comment",regex:".+"}]},i.tag(this.$rules,"tag","start")};r.inherits(o,s),t.XmlHighlightRules=o}),define("ace/mode/xml_util",["require","exports","module"],function(e,t,n){function r(e){return[{token:"string",regex:'"',next:e+"_qqstring"},{token:"string",regex:"'",next:e+"_qstring"}]}function i(e,t){return[{token:"string",regex:e,next:t},{token:"constant.language.escape",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"},{defaultToken:"string"}]}t.tag=function(e,t,n,s){e[t]=[{token:"text",regex:"\\s+"},{token:s?function(e){return s[e]?"meta.tag.tag-name."+s[e]:"meta.tag.tag-name"}:"meta.tag.tag-name",regex:"[-_a-zA-Z0-9:]+",next:t+"_embed_attribute_list"},{token:"empty",regex:"",next:t+"_embed_attribute_list"}],e[t+"_qstring"]=i("'",t+"_embed_attribute_list"),e[t+"_qqstring"]=i('"',t+"_embed_attribute_list"),e[t+"_embed_attribute_list"]=[{token:"meta.tag.r",regex:"/?>",next:n},{token:"keyword.operator",regex:"="},{token:"entity.other.attribute-name",regex:"[-_a-zA-Z0-9:]+"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"text",regex:"\\s+"}].concat(r(t))}}),define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){function u(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.forEach(function(e){if(r.indexOf(e)==-1)return n=!1,!1}),n}var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,a=function(){this.inherit(s,["string_dquotes"]),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var s=n.getCursorPosition(),a=new o(r,s.row,s.column),f=a.getCurrentToken(),l=!1;if(!f||!u(f,"meta.tag")&&(!u(f,"text")||!f.value.match("/"))){do f=a.stepBackward();while(f&&(u(f,"string")||u(f,"keyword.operator")||u(f,"entity.attribute-name")||u(f,"text")))}else l=!0;if(!f||!u(f,"meta.tag-name")||a.stepBackward().value.match("/"))return;var c=f.value;if(l)var c=c.substring(0,s.column-f.start);return{text:"></"+c+">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,i){if(i=="\n"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+2);if(u=="</"){var a=this.$getIndent(r.doc.getLine(s.row))+r.getTabString(),f=this.$getIndent(r.doc.getLine(s.row));return{text:"\n"+a+"\n"+f,selection:[1,a.length,1,a.length]}}}})};r.inherits(a,i),t.XmlBehaviour=a}),define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"],function(e,t,n){var r=e("../../lib/oop"),i=e("../../lib/lang"),s=e("../../range").Range,o=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,a=t.FoldMode=function(e){o.call(this),this.voidElements=e||{}};r.inherits(a,o),function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r.closing?t=="markbeginend"?"end":"":!r.tagName||this.voidElements[r.tagName.toLowerCase()]?"":r.selfClosing?"":r.value.indexOf("/"+r.tagName)!==-1?"":"start"},this._getFirstTagInLine=function(e,t){var n=e.getTokens(t),r="";for(var s=0;s<n.length;s++){var o=n[s];o.type.indexOf("meta.tag")===0?r+=o.value:r+=i.stringRepeat(" ",o.value.length)}return this._parseTag(r)},this.tagRe=/^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/,this._parseTag=function(e){var t=e.match(this.tagRe),n=0;return{value:e,match:t?t[2]:"",closing:t?!!t[3]:!1,selfClosing:t?!!t[5]||t[2]=="/>":!1,tagName:t?t[4]:"",column:t[1]?n+t[1].length:n}},this._readTagForward=function(e){var t=e.getCurrentToken();if(!t)return null;var n="",r;do if(t.type.indexOf("meta.tag")===0){if(!r)var r={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()};n+=t.value;if(n.indexOf(">")!==-1){var i=this._parseTag(n);return i.start=r,i.end={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()+t.value.length},e.stepForward(),i}}while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n="",r;do if(t.type.indexOf("meta.tag")===0){r||(r={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()+t.value.length}),n=t.value+n;if(n.indexOf("<")!==-1){var i=this._parseTag(n);return i.end=r,i.start={row:e.getCurrentTokenRow(),column:e.getCurrentTokenColumn()},e.stepBackward(),i}}while(t=e.stepBackward());return null},this._pop=function(e,t){while(e.length){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.voidElements[t.tagName])return;if(this.voidElements[n.tagName]){e.pop();continue}return null}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r.match)return null;var i=r.closing||r.selfClosing,o=[],a;if(!i){var f=new u(e,n,r.column),l={row:n,column:r.column+r.tagName.length+2};while(a=this._readTagForward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(a.closing){this._pop(o,a);if(o.length==0)return s.fromPoints(l,a.start)}else o.push(a)}}else{var f=new u(e,n,r.column+r.match.length),c={row:n,column:r.column};while(a=this._readTagBackward(f)){if(a.selfClosing){if(!o.length)return a.start.column+=a.tagName.length+2,a.end.column-=2,s.fromPoints(a.start,a.end);continue}if(!a.closing){this._pop(o,a);if(o.length==0)return a.start.column+=a.tagName.length+2,s.fromPoints(a.start,c)}else o.push(a)}}}}.call(a.prototype)}),define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/tokenizer","ace/mode/html_highlight_rules","ace/mode/behaviour/html","ace/mode/folding/html"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("./javascript").Mode,o=e("./css").Mode,u=e("../tokenizer").Tokenizer,a=e("./html_highlight_rules").HtmlHighlightRules,f=e("./behaviour/html").HtmlBehaviour,l=e("./folding/html").FoldMode,c=function(){var e=new a;this.$tokenizer=new u(e.getRules()),this.$behaviour=new f,this.$embeds=e.getEmbeds(),this.createModeDelegates({"js-":s,"css-":o}),this.foldingRules=new l};r.inherits(c,i),function(){this.blockComment={start:"<!--",end:"-->"},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1}}.call(c.prototype),t.Mode=c}),define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../lib/oop"),i=e("./text").Mode,s=e("../tokenizer").Tokenizer,o=e("./css_highlight_rules").CssHighlightRules,u=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,f=e("./behaviour/css").CssBehaviour,l=e("./folding/cstyle").FoldMode,c=function(){this.$tokenizer=new s((new o).getRules()),this.$outdent=new u,this.$behaviour=new f,this.foldingRules=new l};r.inherits(c,i),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var r=this.$getIndent(t),i=this.$tokenizer.getLineTokens(t,e).tokens;if(i.length&&i[i.length-1].type=="comment")return r;var s=t.match(/^.*\{\s*$/);return s&&(r+=n),r},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("csslint",function(t){e.setAnnotations(t.data)}),t.on("terminate",function(){e.clearAnnotations()}),t}}.call(c.prototype),t.Mode=c}),define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./text_highlight_rules").TextHighlightRules,o=t.supportType="animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index",u=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero",f=t.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow",l=t.supportConstantFonts="arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",c=t.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))",h=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",p=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",d=function(){var e=this.createKeywordMapper({"support.function":u,"support.constant":a,"support.type":o,"support.constant.color":f,"support.constant.fonts":l},"text",!0),t=[{token:"comment",regex:"\\/\\*",next:"ruleset_comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+c+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:"constant.numeric",regex:c},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:h},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:p},{token:["support.function","string","support.function"],regex:"(url\\()(.*)(\\))"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],n=i.copyArray(t);n.unshift({token:"paren.rparen",regex:"\\}",next:"start"});var r=i.copyArray(t);r.unshift({token:"paren.rparen",regex:"\\}",next:"media"});var s=[{token:"comment",regex:".+"}],d=i.copyArray(s);d.unshift({token:"comment",regex:".*?\\*\\/",next:"start"});var v=i.copyArray(s);v.unshift({token:"comment",regex:".*?\\*\\/",next:"media"});var m=i.copyArray(s);m.unshift({token:"comment",regex:".*?\\*\\/",next:"ruleset"}),this.$rules={start:[{token:"comment",regex:"\\/\\*",next:"comment"},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"string",regex:"@.*?{",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{token:"comment",regex:"\\/\\*",next:"media_comment"},{token:"paren.lparen",regex:"\\{",next:"media_ruleset"},{token:"string",regex:"\\}",next:"start"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],comment:d,ruleset:n,ruleset_comment:m,media_ruleset:r,media_comment:v}};r.inherits(d,s),t.CssHighlightRules=d}),define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){var r=e("../../lib/oop"),i=e("../behaviour").Behaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=function(){this.inherit(s),this.add("colon","insertion",function(e,t,n,r,i){if(i===":"){var s=n.getCursorPosition(),u=new o(r,s.row,s.column),a=u.getCurrentToken();a&&a.value.match(/\s+/)&&(a=u.stepBackward());if(a&&a.type==="support.type"){var f=r.doc.getLine(s.row),l=f.substring(s.column,s.column+1);if(l===":")return{text:"",selection:[1,1]};if(!f.substring(s.column).match(/^\s*;/))return{text:":;",selection:[1,1]}}}}),this.add("colon","deletion",function(e,t,n,r,i){var s=r.doc.getTextRange(i);if(!i.isMultiLine()&&s===":"){var u=n.getCursorPosition(),a=new o(r,u.row,u.column),f=a.getCurrentToken();f&&f.value.match(/\s+/)&&(f=a.stepBackward());if(f&&f.type==="support.type"){var l=r.doc.getLine(i.start.row),c=l.substring(i.end.column,i.end.column+1);if(c===";")return i.end.column++,i}}}),this.add("semicolon","insertion",function(e,t,n,r,i){if(i===";"){var s=n.getCursorPosition(),o=r.doc.getLine(s.row),u=o.substring(s.column,s.column+1);if(u===";")return{text:"",selection:[1,1]}}})};r.inherits(u,s),t.CssBehaviour=u}),define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_util","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),i=e("../lib/lang"),s=e("./css_highlight_rules").CssHighlightRules,o=e("./javascript_highlight_rules").JavaScriptHighlightRules,u=e("./xml_util"),a=e("./text_highlight_rules").TextHighlightRules,f=i.createMap({a:"anchor",button:"form",form:"form",img:"image",input:"form",label:"form",script:"script",select:"form",textarea:"form",style:"style",table:"table",tbody:"table",td:"table",tfoot:"table",th:"table",tr:"table"}),l=function(){this.$rules={start:[{token:"text",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:"xml-pe",regex:"<\\?.*?\\?>"},{token:"comment",regex:"<\\!--",next:"comment"},{token:"xml-pe",regex:"<\\!.*?>"},{token:"meta.tag",regex:"<(?=script\\b)",next:"script"},{token:"meta.tag",regex:"<(?=style\\b)",next:"style"},{token:"meta.tag",regex:"<\\/?(?=\\S)",next:"tag"},{token:"text",regex:"\\s+"},{token:"constant.character.entity",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],cdata:[{token:"text",regex:"\\]\\]>",next:"start"}],comment:[{token:"comment",regex:".*?-->",next:"start"},{defaultToken:"comment"}]},u.tag(this.$rules,"tag","start",f),u.tag(this.$rules,"style","css-start",f),u.tag(this.$rules,"script","js-start",f),this.embedRules(o,"js-",[{token:"comment",regex:"\\/\\/.*(?=<\\/script>)",next:"tag"},{token:"meta.tag",regex:"<\\/(?=script)",next:"tag"}]),this.embedRules(s,"css-",[{token:"meta.tag",regex:"<\\/(?=style)",next:"tag"}])};r.inherits(l,a),t.HtmlHighlightRules=l}),define("ace/mode/behaviour/html",["require","exports","module","ace/lib/oop","ace/mode/behaviour/xml","ace/mode/behaviour/cstyle","ace/token_iterator"],function(e,t,n){function a(e,t){var n=!0,r=e.type.split("."),i=t.split(".");return i.forEach(function(e){if(r.indexOf(e)==-1)return n=!1,!1}),n}var r=e("../../lib/oop"),i=e("../behaviour/xml").XmlBehaviour,s=e("./cstyle").CstyleBehaviour,o=e("../../token_iterator").TokenIterator,u=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],f=function(){this.inherit(i),this.add("autoclosing","insertion",function(e,t,n,r,i){if(i==">"){var s=n.getCursorPosition(),f=new o(r,s.row,s.column),l=f.getCurrentToken();if(a(l,"string")&&f.getCurrentTokenColumn()+l.value.length>s.column)return;var c=!1;if(!l||!a(l,"meta.tag")&&(!a(l,"text")||!l.value.match("/"))){do l=f.stepBackward();while(l&&(a(l,"string")||a(l,"keyword.operator")||a(l,"entity.attribute-name")||a(l,"text")))}else c=!0;if(!l||!a(l,"meta.tag-name")||f.stepBackward().value.match("/"))return;var h=l.value;if(c)var h=h.substring(0,s.column-l.start);if(u.indexOf(h)!==-1)return;return{text:"></"+h+">",selection:[1,1]}}})};r.inherits(f,i),t.HtmlBehaviour=f}),define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"],function(e,t,n){var r=e("../../lib/oop"),i=e("./mixed").FoldMode,s=e("./xml").FoldMode,o=e("./cstyle").FoldMode,u=t.FoldMode=function(){i.call(this,new s({area:1,base:1,br:1,col:1,command:1,embed:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1,li:1,dt:1,dd:1,p:1,rt:1,rp:1,optgroup:1,option:1,colgroup:1,td:1,th:1}),{"js-":new o,"css-":new o})};r.inherits(u,i)}),define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=t.FoldMode=function(e,t){this.defaultMode=e,this.subModes=t};r.inherits(s,i),function(){this.$getMode=function(e){for(var t in this.subModes)if(e.indexOf(t)===0)return this.subModes[t];return null},this.$tryMode=function(e,t,n,r){var i=this.$getMode(e);return i?i.getFoldWidget(t,n,r):""},this.getFoldWidget=function(e,t,n){return this.$tryMode(e.getState(n-1),e,t,n)||this.$tryMode(e.getState(n),e,t,n)||this.defaultMode.getFoldWidget(e,t,n)},this.getFoldWidgetRange=function(e,t,n){var r=this.$getMode(e.getState(n-1));if(!r||!r.getFoldWidget(e,t,n))r=this.$getMode(e.getState(n));if(!r||!r.getFoldWidget(e,t,n))r=this.defaultMode;return r.getFoldWidgetRange(e,t,n)}}.call(s.prototype)}),define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"],function(e,t,n){function f(e,t){return{token:"support.function",regex:"^```"+e+"\\s*$",next:t+"start"}}var r=e("../lib/oop"),i=e("./text_highlight_rules").TextHighlightRules,s=e("./javascript_highlight_rules").JavaScriptHighlightRules,o=e("./xml_highlight_rules").XmlHighlightRules,u=e("./html_highlight_rules").HtmlHighlightRules,a=e("./css_highlight_rules").CssHighlightRules,l=function(){this.$rules={basic:[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:'^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:["][^"]+["])?(\\s*))$'},{token:["text","string","text","constant","text"],regex:"(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:'(\\[)(\\[[^\\]]*\\]|[^\\[\\]]*)(\\]\\([ \\t]*)(<?(?:(?:[^\\(]*?\\([^\\)]*?\\)\\S*?)|(?:.*?))>?)((?:[ ]*"(?:.*?)"[ \\t]*)?)(\\))'},{token:"string",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)((?:https?|ftp|dict):[^'\">\\s]+|(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+)(>)"}],allowBlock:[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty",regex:"",next:"start"}],start:[{token:"empty_line",regex:"^$",next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(e){return"markup.heading."+e.length},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},f("(?:javascript|js)","js-"),f("xml","xml-"),f("html","html-"),f("css","css-"),{token:"support.function",regex:"^```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string",regex:"^>[ ].+$",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"}],header:[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"markup.heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],listblock:[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:!0},{defaultToken:"markup.list"}],blockquote:[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string",regex:".+"}],githubblock:[{token:"support.function",regex:"^```",next:"start"},{token:"support.function",regex:".+"}]},this.embedRules(s,"js-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(u,"html-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(a,"css-",[{token:"support.function",regex:"^```",next:"start"}]),this.embedRules(o,"xml-",[{token:"support.function",regex:"^```",next:"start"}]);var e=(new u).getRules();for(var t in e)this.$rules[t]?this.$rules[t]=this.$rules[t].concat(e[t]):this.$rules[t]=e[t];this.normalizeRules()};r.inherits(l,i),t.MarkdownHighlightRules=l}),define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(e,t,n){var r=e("../../lib/oop"),i=e("./fold_mode").FoldMode,s=e("../../range").Range,o=t.FoldMode=function(){};r.inherits(o,i),function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/,this.getFoldWidget=function(e,t,n){var r=e.getLine(n);return this.foldingStartMarker.test(r)?r[0]=="`"?e.bgTokenizer.getState(n)=="start"?"end":"start":"start":""},this.getFoldWidgetRange=function(e,t,n){function l(t){return f=e.getTokens(t)[0],f&&f.type.lastIndexOf(c,0)===0}function h(){var e=f.value[0];return e=="="?6:e=="-"?5:7-f.value.search(/[^#]/)}var r=e.getLine(n),i=r.length,o=e.getLength(),u=n,a=n;if(!r.match(this.foldingStartMarker))return;if(r[0]=="`"){if(e.bgTokenizer.getState(n)!=="start"){while(++n<o){r=e.getLine(n);if(r[0]=="`"&r.substring(0,3)=="```")break}return new s(u,i,n,0)}while(n-->0){r=e.getLine(n);if(r[0]=="`"&r.substring(0,3)=="```")break}return new s(n,r.length,u,0)}var f,c="markup.heading";if(l(n)){var p=h();while(++n<o){if(!l(n))continue;var d=h();if(d>=p)break}a=n-(!f||["=","-"].indexOf(f.value[0])==-1?1:2);if(a>u)while(a>u&&/^\s*$/.test(e.getLine(a)))a--;if(a>u){var v=e.getLine(a).length;return new s(u,i,a,v)}}}}.call(o.prototype)}) | gereon/cdnjs | ajax/libs/ace/1.1.1/mode-markdown.js | JavaScript | mit | 48,932 |
.c3 svg{font:10px sans-serif}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:gray;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:.75}.c3-chart-arcs-title{font-size:1.3em}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #CCC}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#FFF}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max,.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000} | CrossEye/cdnjs | ajax/libs/c3/0.4.7/c3.min.css | CSS | mit | 1,947 |
/*
* /MathJax/jax/output/SVG/fonts/TeX/Size2/Regular/Main.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed 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.
*/
MathJax.OutputJax.SVG.FONTDATA.FONTS.MathJax_Size2={directory:"Size2/Regular",family:"MathJax_Size2",id:"MJSZ2",32:[0,0,250,0,0,""],40:[1150,649,597,180,561,"180 96T180 250T205 541T266 770T353 944T444 1069T527 1150H555Q561 1144 561 1141Q561 1137 545 1120T504 1072T447 995T386 878T330 721T288 513T272 251Q272 133 280 56Q293 -87 326 -209T399 -405T475 -531T536 -609T561 -640Q561 -643 555 -649H527Q483 -612 443 -568T353 -443T266 -270T205 -41"],41:[1150,649,597,35,417,"35 1138Q35 1150 51 1150H56H69Q113 1113 153 1069T243 944T330 771T391 541T416 250T391 -40T330 -270T243 -443T152 -568T69 -649H56Q43 -649 39 -647T35 -637Q65 -607 110 -548Q283 -316 316 56Q324 133 324 251Q324 368 316 445Q278 877 48 1123Q36 1137 35 1138"],47:[1150,649,811,56,754,"78 -649Q56 -646 56 -625Q56 -614 382 261T712 1140Q716 1150 732 1150Q754 1147 754 1126Q754 1116 428 240T98 -639Q94 -649 78 -649"],91:[1150,649,472,224,455,"224 -649V1150H455V1099H275V-598H455V-649H224"],92:[1150,649,811,54,754,"754 -625Q754 -649 731 -649Q715 -649 712 -639Q709 -635 383 242T55 1124Q54 1135 61 1142T80 1150Q92 1150 98 1140Q101 1137 427 262T754 -625"],93:[1150,649,472,16,247,"16 1099V1150H247V-649H16V-598H196V1099H16"],123:[1150,649,667,119,547,"547 -643L541 -649H528Q515 -649 503 -645Q324 -582 293 -466Q289 -449 289 -428T287 -200L286 42L284 53Q274 98 248 135T196 190T146 222L121 235Q119 239 119 250Q119 262 121 266T133 273Q262 336 284 449L286 460L287 701Q287 737 287 794Q288 949 292 963Q293 966 293 967Q325 1080 508 1148Q516 1150 527 1150H541L547 1144V1130Q547 1117 546 1115T536 1109Q480 1086 437 1046T381 950L379 940L378 699Q378 657 378 594Q377 452 374 438Q373 437 373 436Q350 348 243 282Q192 257 186 254L176 251L188 245Q211 236 234 223T287 189T340 135T373 65Q373 64 374 63Q377 49 378 -93Q378 -156 378 -198L379 -438L381 -449Q393 -504 436 -544T536 -608Q544 -611 545 -613T547 -629V-643"],125:[1150,649,667,119,547,"119 1130Q119 1144 121 1147T135 1150H139Q151 1150 182 1138T252 1105T326 1046T373 964Q378 942 378 702Q378 469 379 462Q386 394 439 339Q482 296 535 272Q544 268 545 266T547 251Q547 241 547 238T542 231T531 227T510 217T477 194Q390 129 379 39Q378 32 378 -201Q378 -441 373 -463Q342 -580 165 -644Q152 -649 139 -649Q125 -649 122 -646T119 -629Q119 -622 119 -619T121 -614T124 -610T132 -607T143 -602Q195 -579 235 -539T285 -447Q286 -435 287 -199T289 51Q294 74 300 91T329 138T390 197Q412 213 436 226T475 244L489 250L472 258Q455 265 430 279T377 313T327 366T293 434Q289 451 289 472T287 699Q286 941 285 948Q279 978 262 1005T227 1048T184 1080T151 1100T129 1109L127 1110Q119 1113 119 1130"],710:[772,-565,1000,-5,1004,"1004 603Q1004 600 999 583T991 565L960 574Q929 582 866 599T745 631L500 698Q497 698 254 631Q197 616 134 599T39 574L8 565Q5 565 0 582T-5 603L26 614Q58 624 124 646T248 687L499 772Q999 604 1004 603"],732:[750,-611,1000,0,999,"296 691Q258 691 216 683T140 663T79 639T34 619T16 611Q13 619 8 628L0 644L36 662Q206 749 321 749Q410 749 517 710T703 670Q741 670 783 678T859 698T920 722T965 742T983 750Q986 742 991 733L999 717L963 699Q787 611 664 611Q594 611 484 651T296 691"],770:[772,-565,0,-1005,4,"4 603Q4 600 -1 583T-9 565L-40 574Q-71 582 -134 599T-255 631L-500 698Q-503 698 -746 631Q-803 616 -866 599T-961 574L-992 565Q-995 565 -1000 582T-1005 603L-974 614Q-942 624 -876 646T-752 687L-501 772Q-1 604 4 603"],771:[750,-611,0,-1000,-1,"-704 691Q-742 691 -784 683T-860 663T-921 639T-966 619T-984 611Q-987 619 -992 628L-1000 644L-964 662Q-794 749 -679 749Q-590 749 -483 710T-297 670Q-259 670 -217 678T-141 698T-80 722T-35 742T-17 750Q-14 742 -9 733L-1 717L-37 699Q-213 611 -336 611Q-405 611 -515 651T-704 691"],8719:[950,450,1278,56,1221,"220 812Q220 813 218 819T214 829T208 840T199 853T185 866T166 878T140 887T107 893T66 896H56V950H1221V896H1211Q1080 896 1058 812V-311Q1076 -396 1211 -396H1221V-450H725V-396H735Q864 -396 888 -314Q889 -312 889 -311V896H388V292L389 -311Q405 -396 542 -396H552V-450H56V-396H66Q195 -396 219 -314Q220 -312 220 -311V812"],8720:[950,450,1278,56,1221,"220 812Q220 813 218 819T214 829T208 840T199 853T185 866T166 878T140 887T107 893T66 896H56V950H552V896H542Q411 896 389 812L388 208V-396H889V812Q889 813 887 819T883 829T877 840T868 853T854 866T835 878T809 887T776 893T735 896H725V950H1221V896H1211Q1080 896 1058 812V-311Q1076 -396 1211 -396H1221V-450H56V-396H66Q195 -396 219 -314Q220 -312 220 -311V812"],8721:[950,450,1444,55,1388,"60 948Q63 950 665 950H1267L1325 815Q1384 677 1388 669H1348L1341 683Q1320 724 1285 761Q1235 809 1174 838T1033 881T882 898T699 902H574H543H251L259 891Q722 258 724 252Q725 250 724 246Q721 243 460 -56L196 -356Q196 -357 407 -357Q459 -357 548 -357T676 -358Q812 -358 896 -353T1063 -332T1204 -283T1307 -196Q1328 -170 1348 -124H1388Q1388 -125 1381 -145T1356 -210T1325 -294L1267 -449L666 -450Q64 -450 61 -448Q55 -446 55 -439Q55 -437 57 -433L590 177Q590 178 557 222T452 366T322 544L56 909L55 924Q55 945 60 948"],8730:[1150,650,1000,111,1020,"1001 1150Q1017 1150 1020 1132Q1020 1127 741 244L460 -643Q453 -650 436 -650H424Q423 -647 423 -645T421 -640T419 -631T415 -617T408 -594T399 -560T385 -512T367 -448T343 -364T312 -259L203 119L138 41L111 67L212 188L264 248L472 -474L983 1140Q988 1150 1001 1150"],8747:[1361,862,556,55,944,"114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q439 292 523 655T645 1127Q651 1145 655 1157T672 1201T699 1257T733 1306T777 1346T828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q819 1323 807 1311T775 1255T736 1139T689 936T633 628Q574 293 510 -5T410 -437T355 -629Q278 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798"],8748:[1361,862,1084,55,1472,"114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q439 292 523 655T645 1127Q651 1145 655 1157T672 1201T699 1257T733 1306T777 1346T828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q819 1323 807 1311T775 1255T736 1139T689 936T633 628Q574 293 510 -5T410 -437T355 -629Q278 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798ZM642 -798Q660 -824 693 -824H695Q723 -824 751 -764T803 -600T848 -391T890 -164Q893 -143 895 -133Q967 292 1051 655T1173 1127Q1179 1145 1183 1157T1200 1201T1227 1257T1261 1306T1305 1346T1356 1360Q1412 1360 1440 1325T1472 1245Q1472 1220 1460 1205T1437 1186T1415 1183Q1394 1183 1377 1198T1360 1239Q1360 1287 1413 1296L1410 1300Q1407 1303 1402 1307T1394 1313Q1379 1323 1361 1323Q1347 1323 1335 1311T1303 1255T1264 1139T1217 936T1161 628Q1102 293 1038 -5T938 -437T883 -629Q806 -862 693 -862Q653 -862 620 -831T583 -746Q583 -711 602 -698T640 -685Q661 -685 678 -700T695 -741Q695 -789 642 -798"],8749:[1361,862,1592,55,1980,"114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q439 292 523 655T645 1127Q651 1145 655 1157T672 1201T699 1257T733 1306T777 1346T828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q819 1323 807 1311T775 1255T736 1139T689 936T633 628Q574 293 510 -5T410 -437T355 -629Q278 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798ZM642 -798Q660 -824 693 -824H695Q723 -824 751 -764T803 -600T848 -391T890 -164Q893 -143 895 -133Q967 292 1051 655T1173 1127Q1179 1145 1183 1157T1200 1201T1227 1257T1261 1306T1305 1346T1356 1360Q1412 1360 1440 1325T1472 1245Q1472 1220 1460 1205T1437 1186T1415 1183Q1394 1183 1377 1198T1360 1239Q1360 1287 1413 1296L1410 1300Q1407 1303 1402 1307T1394 1313Q1379 1323 1361 1323Q1347 1323 1335 1311T1303 1255T1264 1139T1217 936T1161 628Q1102 293 1038 -5T938 -437T883 -629Q806 -862 693 -862Q653 -862 620 -831T583 -746Q583 -711 602 -698T640 -685Q661 -685 678 -700T695 -741Q695 -789 642 -798ZM1150 -798Q1168 -824 1201 -824H1203Q1231 -824 1259 -764T1311 -600T1356 -391T1398 -164Q1401 -143 1403 -133Q1475 292 1559 655T1681 1127Q1687 1145 1691 1157T1708 1201T1735 1257T1769 1306T1813 1346T1864 1360Q1920 1360 1948 1325T1980 1245Q1980 1220 1968 1205T1945 1186T1923 1183Q1902 1183 1885 1198T1868 1239Q1868 1287 1921 1296L1918 1300Q1915 1303 1910 1307T1902 1313Q1887 1323 1869 1323Q1855 1323 1843 1311T1811 1255T1772 1139T1725 936T1669 628Q1610 293 1546 -5T1446 -437T1391 -629Q1314 -862 1201 -862Q1161 -862 1128 -831T1091 -746Q1091 -711 1110 -698T1148 -685Q1169 -685 1186 -700T1203 -741Q1203 -789 1150 -798"],8750:[1360,862,556,55,944,"114 -798Q132 -824 165 -824H167Q195 -824 223 -764T275 -600T320 -391T362 -164Q365 -143 367 -133Q382 -52 390 2Q314 40 276 99Q230 167 230 249Q230 363 305 436T484 519H494L503 563Q587 939 632 1087T727 1298Q774 1360 828 1360Q884 1360 912 1325T944 1245Q944 1220 932 1205T909 1186T887 1183Q866 1183 849 1198T832 1239Q832 1287 885 1296L882 1300Q879 1303 874 1307T866 1313Q851 1323 833 1323Q766 1323 688 929Q662 811 610 496Q770 416 770 249Q770 147 701 68T516 -21H506L497 -65Q407 -464 357 -623T237 -837Q203 -862 165 -862Q125 -862 92 -831T55 -746Q55 -711 74 -698T112 -685Q133 -685 150 -700T167 -741Q167 -789 114 -798ZM480 478Q460 478 435 470T380 444T327 401T287 335T271 249Q271 124 375 56L397 43L431 223L485 478H480ZM519 20Q545 20 578 33T647 72T706 144T730 249Q730 383 603 455Q603 454 597 421T582 343T569 276Q516 22 515 20H519"],8896:[950,450,1111,55,1055,"1055 -401Q1055 -419 1042 -434T1007 -450Q977 -450 963 -423Q959 -417 757 167L555 750L353 167Q151 -417 147 -423Q134 -450 104 -450Q84 -450 70 -436T55 -401Q55 -394 56 -390Q59 -381 284 270T512 925Q525 950 555 950Q583 950 597 926Q599 923 825 270T1054 -391Q1055 -394 1055 -401"],8897:[950,450,1111,55,1055,"55 900Q55 919 69 934T103 950Q134 950 147 924Q152 913 353 333L555 -250L757 333Q958 913 963 924Q978 950 1007 950Q1028 950 1041 935T1055 901Q1055 894 1054 891Q1052 884 826 231T597 -426Q583 -450 556 -450Q527 -450 512 -424Q510 -421 285 229T56 890Q55 893 55 900"],8898:[949,451,1111,55,1055,"57 516Q68 602 104 675T190 797T301 882T423 933T542 949Q594 949 606 948Q780 928 901 815T1048 545Q1053 516 1053 475T1055 49Q1055 -406 1054 -410Q1051 -427 1037 -438T1006 -450T976 -439T958 -411Q957 -407 957 37Q957 484 956 494Q945 643 831 747T554 852Q481 852 411 826Q301 786 232 696T154 494Q153 484 153 37Q153 -407 152 -411Q148 -428 135 -439T104 -450T73 -439T56 -410Q55 -406 55 49Q56 505 57 516"],8899:[950,449,1111,55,1055,"56 911Q58 926 71 938T103 950Q120 950 134 939T152 911Q153 907 153 463Q153 16 154 6Q165 -143 279 -247T556 -352Q716 -352 830 -248T956 6Q957 16 957 463Q957 907 958 911Q962 928 975 939T1006 950T1037 939T1054 911Q1055 906 1055 451Q1054 -5 1053 -16Q1029 -207 889 -328T555 -449Q363 -449 226 -331T62 -45Q57 -16 57 25T55 451Q55 906 56 911"],8968:[1150,649,528,224,511,"224 -649V1150H511V1099H275V-649H224"],8969:[1150,649,528,16,303,"16 1099V1150H303V-649H252V1099H16"],8970:[1150,649,528,224,511,"224 -649V1150H275V-598H511V-649H224"],8971:[1150,649,528,16,303,"252 -598V1150H303V-649H16V-598H252"],10216:[1150,649,611,112,524,"112 244V258L473 1130Q482 1150 498 1150Q511 1150 517 1142T523 1125V1118L344 685Q304 587 257 473T187 305L165 251L344 -184L523 -616V-623Q524 -634 517 -641T499 -649Q484 -649 473 -629L112 244"],10217:[1150,649,611,85,498,"112 -649Q103 -649 95 -642T87 -623V-616L266 -184L445 251Q445 252 356 466T178 898T86 1123Q85 1134 93 1142T110 1150Q126 1150 133 1137Q134 1136 317 695L498 258V244L317 -194Q134 -635 133 -636Q126 -649 112 -649"],10752:[949,449,1511,56,1454,"668 944Q697 949 744 949Q803 949 814 948Q916 937 1006 902T1154 826T1262 730T1336 638T1380 563Q1454 415 1454 250Q1454 113 1402 -14T1258 -238T1036 -391T755 -449Q608 -449 477 -392T255 -240T110 -16T56 250Q56 387 105 510T239 723T434 871T668 944ZM755 -352Q922 -352 1061 -269T1278 -48T1356 250Q1356 479 1202 652T809 850Q798 851 747 851Q634 851 527 806T337 682T204 491T154 251Q154 128 201 17T329 -176T521 -304T755 -352ZM665 250Q665 290 692 315T758 341Q792 339 818 315T845 250Q845 211 819 186T755 160Q716 160 691 186T665 250"],10753:[949,449,1511,56,1454,"668 944Q697 949 744 949Q803 949 814 948Q916 937 1006 902T1154 826T1262 730T1336 638T1380 563Q1454 415 1454 250Q1454 113 1402 -14T1258 -238T1036 -391T755 -449Q608 -449 477 -392T255 -240T110 -16T56 250Q56 387 105 510T239 723T434 871T668 944ZM706 299V850H704Q519 832 386 725T198 476Q181 433 169 379T156 300Q156 299 431 299H706ZM1116 732Q1054 778 982 807T871 842T810 849L804 850V299H1079Q1354 299 1354 300Q1354 311 1352 329T1336 402T1299 506T1228 620T1116 732ZM706 -350V201H431Q156 201 156 200Q156 189 158 171T174 98T211 -6T282 -120T395 -232Q428 -257 464 -277T527 -308T587 -328T636 -339T678 -346T706 -350ZM1354 200Q1354 201 1079 201H804V-350Q808 -349 838 -345T887 -338T940 -323T1010 -295Q1038 -282 1067 -265T1144 -208T1229 -121T1301 0T1349 158Q1354 188 1354 200"],10754:[949,449,1511,56,1454,"668 944Q697 949 744 949Q803 949 814 948Q916 937 1006 902T1154 826T1262 730T1336 638T1380 563Q1454 415 1454 250Q1454 113 1402 -14T1258 -238T1036 -391T755 -449Q608 -449 477 -392T255 -240T110 -16T56 250Q56 387 105 510T239 723T434 871T668 944ZM1143 709Q1138 714 1129 722T1086 752T1017 791T925 826T809 850Q798 851 747 851H728Q659 851 571 823T408 741Q367 713 367 709L755 320L1143 709ZM297 639Q296 639 282 622T247 570T205 491T169 382T154 250T168 118T204 9T247 -70T282 -122L297 -139L685 250L297 639ZM1213 -139Q1214 -139 1228 -122T1263 -70T1305 9T1341 118T1356 250T1342 382T1306 491T1263 570T1228 622L1213 639L825 250L1213 -139ZM367 -209Q373 -215 384 -224T434 -258T514 -302T622 -336T755 -352T887 -338T996 -302T1075 -259T1126 -224L1143 -209L755 180Q754 180 561 -14T367 -209"],10756:[950,449,1111,55,1055,"56 911Q58 926 71 938T103 950Q120 950 134 939T152 911Q153 907 153 463Q153 16 154 6Q165 -143 279 -247T556 -352Q716 -352 830 -248T956 6Q957 16 957 463Q957 907 958 911Q962 928 975 939T1006 950T1037 939T1054 911Q1055 906 1055 451Q1054 -5 1053 -16Q1029 -207 889 -328T555 -449Q363 -449 226 -331T62 -45Q57 -16 57 25T55 451Q55 906 56 911ZM507 554Q511 570 523 581T554 593Q571 593 585 582T603 554Q604 551 604 443V338H709Q817 338 820 337Q835 334 847 321T859 290Q859 254 819 241Q816 240 709 240H604V134Q604 48 604 34T598 11Q583 -15 555 -15Q526 -15 512 11Q507 20 507 34T506 134V240H401H344Q292 240 278 246Q251 259 251 290Q251 309 264 321T290 337Q293 338 401 338H506V443Q506 551 507 554"],10758:[950,450,1111,54,1056,"56 911Q60 927 72 938T103 950Q120 950 134 939T152 911Q153 907 153 277V-352H957V277Q957 907 958 911Q962 928 975 939T1006 950T1036 939T1054 911V891Q1054 871 1054 836T1054 754T1054 647T1055 525T1055 390T1055 250T1055 111T1055 -24T1055 -147T1054 -253T1054 -335T1054 -391V-411Q1047 -442 1016 -449Q1011 -450 552 -450L94 -449Q63 -439 56 -411V-391Q56 -371 56 -336T56 -254T56 -147T55 -25T55 110T55 250T55 389T55 524T55 647T56 753T56 835T56 891V911"]};MathJax.Ajax.loadComplete(MathJax.OutputJax.SVG.fontDir+"/Size2/Regular/Main.js");
| BenjaminVanRyseghem/cdnjs | ajax/libs/mathjax/2.3.0/jax/output/SVG/fonts/TeX/Size2/Regular/Main.js | JavaScript | mit | 15,579 |
/*
* /MathJax/jax/output/SVG/fonts/Asana-Math/fontdata.js
*
* Copyright (c) 2009-2013 The MathJax Consortium
*
* Licensed 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(z,e,E,o){var B="2.3";var c="AsanaMathJax_Alphabets",w="AsanaMathJax_Arrows",y="AsanaMathJax_DoubleStruck",C="AsanaMathJax_Fraktur",h="AsanaMathJax_Latin",v="AsanaMathJax_Main",n="AsanaMathJax_Marks",x="AsanaMathJax_Misc",F="AsanaMathJax_Monospace",A="AsanaMathJax_NonUnicode",s="AsanaMathJax_Normal",D="AsanaMathJax_Operators",a="AsanaMathJax_SansSerif",q="AsanaMathJax_Script",b="AsanaMathJax_Shapes",m="AsanaMathJax_Size1",l="AsanaMathJax_Size2",k="AsanaMathJax_Size3",i="AsanaMathJax_Size4",g="AsanaMathJax_Size5",f="AsanaMathJax_Size6",u="AsanaMathJax_Symbols",p="AsanaMathJax_Variants";var r="H",d="V",t={load:"extra",dir:r},j={load:"extra",dir:d};z.Augment({FONTDATA:{version:B,baselineskip:1200,lineH:800,lineD:200,FONTS:{AsanaMathJax_Alphabets:"Alphabets/Regular/Main.js",AsanaMathJax_Arrows:"Arrows/Regular/Main.js",AsanaMathJax_DoubleStruck:"DoubleStruck/Regular/Main.js",AsanaMathJax_Fraktur:"Fraktur/Regular/Main.js",AsanaMathJax_Latin:"Latin/Regular/Main.js",AsanaMathJax_Main:"Main/Regular/Main.js",AsanaMathJax_Marks:"Marks/Regular/Main.js",AsanaMathJax_Misc:"Misc/Regular/Main.js",AsanaMathJax_Monospace:"Monospace/Regular/Main.js",AsanaMathJax_NonUnicode:"NonUnicode/Regular/Main.js",AsanaMathJax_Normal:"Normal/Regular/Main.js",AsanaMathJax_Operators:"Operators/Regular/Main.js",AsanaMathJax_SansSerif:"SansSerif/Regular/Main.js",AsanaMathJax_Script:"Script/Regular/Main.js",AsanaMathJax_Shapes:"Shapes/Regular/Main.js",AsanaMathJax_Size1:"Size1/Regular/Main.js",AsanaMathJax_Size2:"Size2/Regular/Main.js",AsanaMathJax_Size3:"Size3/Regular/Main.js",AsanaMathJax_Size4:"Size4/Regular/Main.js",AsanaMathJax_Size5:"Size5/Regular/Main.js",AsanaMathJax_Size6:"Size6/Regular/Main.js",AsanaMathJax_Symbols:"Symbols/Regular/Main.js",AsanaMathJax_Variants:"Variants/Regular/Main.js"},VARIANT:{normal:{fonts:[v,s,F,h,c,n,w,D,u,b,x,p,A,m]},bold:{fonts:[v,s,F,h,c,n,w,D,u,b,x,p,A,m],bold:true,offsetA:119808,offsetG:120488,offsetN:120782},italic:{fonts:[v,s,F,h,c,n,w,D,u,b,x,p,A,m],italic:true,offsetA:119860,offsetG:120546,remap:{119893:8462}},bolditalic:{fonts:[v,s,F,h,c,n,w,D,u,b,x,p,A,m],bold:true,italic:true,offsetA:119912,offsetG:120604},"double-struck":{fonts:[y],offsetA:120120,offsetN:120792,remap:{120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484}},fraktur:{fonts:[C],offsetA:120068,remap:{120070:8493,120075:8460,120076:8465,120085:8476,120093:8488}},"bold-fraktur":{fonts:[C],bold:true,offsetA:120172},script:{fonts:[q],italic:true,offsetA:119964,remap:{119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500}},"bold-script":{fonts:[q],bold:true,italic:true,offsetA:120016},"sans-serif":{fonts:[a],offsetA:120224,offsetN:120802},"bold-sans-serif":{fonts:[a],bold:true,offsetA:120276,offsetN:120812,offsetG:120662},"sans-serif-italic":{fonts:[a],italic:true,offsetA:120328},"sans-serif-bold-italic":{fonts:[a],bold:true,italic:true,offsetA:120380,offsetG:120720},monospace:{fonts:[F],offsetA:120432,offsetN:120822},"-Asana-Math-variant":{fonts:[v,s,F,h,c,n,w,D,u,b,x,p,A,m]},"-tex-caligraphic":{offsetA:57866,noLowerCase:1,fonts:[p,v,s,F,h,c,n,w,D,u,b,x,A,m],italic:true},"-tex-oldstyle":{offsetN:57856,fonts:[p,v,s,F,h,c,n,w,D,u,b,x,A,m]},"-tex-caligraphic-bold":{offsetA:57892,noLowerCase:1,fonts:[p,v,s,F,h,c,n,w,D,u,b,x,A,m],italic:true,bold:true},"-tex-oldstyle-bold":{fonts:[v,s,F,h,c,n,w,D,u,b,x,p,A,m],bold:true},"-tex-mathit":{fonts:[v,s,F,h,c,n,w,D,u,b,x,p,A,m],italic:true,noIC:true},"-largeOp":{fonts:[m,v]},"-smallOp":{}},RANGES:[{name:"alpha",low:97,high:122,offset:"A",add:26},{name:"Alpha",low:65,high:90,offset:"A"},{name:"number",low:48,high:57,offset:"N"},{name:"greek",low:945,high:969,offset:"G",add:26},{name:"Greek",low:913,high:1014,offset:"G",remap:{1013:52,977:53,1008:54,981:55,1009:56,982:57,1012:17}}],RULECHAR:773,REMAP:{9666:9664,9667:9665,65080:9183,12296:10216,12297:10217,9642:9632,175:772,8432:42,10072:8739,978:933,9652:9650,9653:9651,65079:9182,9656:9654,697:8242,9662:9660,9663:9661},REMAPACCENT:{"\u007E":"\u0303","\u2192":"\u20D7","\u0060":"\u0300","\u005E":"\u0302","\u00B4":"\u0301","\u2032":"\u0301","\u2035":"\u0300"},REMAPACCENTUNDER:{},DELIMITERS:{40:{dir:d,HW:[[941,v],[1471,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{bot:[9117,u],ext:[9116,u],top:[9115,u]}},41:{dir:d,HW:[[941,v],[1471,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{bot:[9120,u],ext:[9119,u],top:[9118,u]}},45:{alias:773,dir:r},47:{alias:8260,dir:r},61:{dir:r,HW:[[539,v]],stretch:{rep:[61,v]}},91:{dir:d,HW:[[910,v],[1476,m],[2045,l],[2556,k],[2615,k,1.023]],stretch:{bot:[9123,u],ext:[9122,u],top:[9121,u]}},92:{dir:d,HW:[[883,v],[1270,v,1.439],[1719,v,1.946],[2167,v,2.454],[2615,v,2.961]]},93:{dir:d,HW:[[910,v],[1476,m],[2045,l],[2556,k],[2615,k,1.023]],stretch:{bot:[9126,u],ext:[9125,u],top:[9124,u]}},94:{alias:770,dir:r},95:{alias:818,dir:r},123:{dir:d,HW:[[901,v],[1471,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{bot:[9129,u],ext:[9130,u],mid:[9128,u],top:[9127,u]}},124:{dir:d,HW:[[885,v],[1275,m],[1555,l],[1897,k],[2315,i],[2712,g],[3177,f]],stretch:{ext:[57344,f],top:[57344,f]}},125:{dir:d,HW:[[901,v],[1471,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{bot:[9133,u],ext:[9130,u],mid:[9132,u],top:[9131,u]}},126:{alias:771,dir:r},175:{alias:773,dir:r},710:{alias:770,dir:r},713:{alias:773,dir:r},732:{alias:771,dir:r},770:{dir:r,HW:[[312,v],[453,m],[633,l],[1055,k],[2017,i],[3026,g]]},771:{dir:r,HW:[[330,v],[701,m],[1053,l],[1403,k],[1865,i],[2797,g]]},773:{dir:r,HW:[[433,n],[511,m],[675,l],[1127,k]],stretch:{rep:[57345,f],right:[57345,f]}},774:t,780:{dir:r,HW:[[312,v],[737,m],[1105,l],[1474,k],[1960,i],[2940,g]]},818:{dir:r,HW:[[433,n],[511,m],[675,l],[1127,k]],stretch:{rep:[57346,f],right:[57346,f]}},819:t,831:t,8213:{alias:773,dir:r},8214:{dir:d,HW:[[885,v],[1275,m],[1555,l],[1897,k],[2315,i]],stretch:{ext:[57349,f],top:[57349,f]}},8215:{alias:773,dir:r},8254:{alias:773,dir:r},8260:{dir:d,HW:[[837,v],[1205,m],[1471,l],[1795,k],[2189,i],[2615,i,1.195]]},8261:j,8262:j,8400:t,8401:t,8406:t,8407:t,8417:t,8425:t,8430:t,8431:t,8592:{dir:r,HW:[[884,v]],stretch:{left:[57363,f],rep:[9135,u],right:[57364,f]}},8593:{dir:d,HW:[[885,v]],stretch:{ext:[57365,f],top:[8593,v]}},8594:{dir:r,HW:[[884,v]],stretch:{left:[57366,f],rep:[9135,u],right:[57367,f]}},8595:{dir:d,HW:[[885,v]],stretch:{bot:[8595,v],ext:[57365,f]}},8596:{dir:r,HW:[[884,v]],stretch:{left:[57363,f],rep:[9135,u],right:[57367,f]}},8597:{dir:d,HW:[[884,v]],stretch:{top:[8593,v],ext:[57365,f],bot:[8595,v]}},8612:{dir:r,HW:[[942,w]],stretch:{left:[57363,f],rep:[9135,u],right:[57368,f]}},8614:{dir:r,HW:[[942,v]],stretch:{left:[57369,f],rep:[9135,u],right:[57367,f]}},8617:t,8618:t,8656:{dir:r,HW:[[884,v]],stretch:{left:[57372,f],rep:[57373,f],right:[57374,f]}},8657:{dir:d,HW:[[885,v]],stretch:{ext:[57375,f],top:[8657,v]}},8658:{dir:r,HW:[[884,v]],stretch:{left:[57376,f],rep:[57373,f],right:[57377,f]}},8659:{dir:d,HW:[[885,v]],stretch:{bot:[8659,v],ext:[57375,f]}},8660:{dir:r,HW:[[895,v]],stretch:{left:[57372,f],rep:[57373,f],right:[57377,f]}},8661:{dir:d,HW:[[884,v,null,8597]],stretch:{top:[8657,v],ext:[57375,f],bot:[8659,v]}},8719:{dir:d,HW:[[937,D],[1349,m],[1942,l],[2797,k]]},8720:j,8721:j,8722:{alias:773,dir:r},8725:{alias:8260,dir:d},8730:{dir:d,HW:[[1138,v],[1280,m],[1912,l],[2543,k],[3175,i]],stretch:{bot:[9143,u],ext:[8403,n],top:[57378,f]}},8739:{dir:d,HW:[[885,v]],stretch:{ext:[8739,v],top:[8739,v]}},8741:{dir:d,HW:[[885,v]],stretch:{ext:[8741,v],top:[8741,v]}},8745:j,8747:j,8748:j,8749:j,8750:j,8751:j,8752:j,8753:j,8754:j,8755:j,8896:j,8897:j,8898:j,8899:j,8968:{dir:d,HW:[[885,v],[1470,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{ext:[9122,u],top:[9121,u]}},8969:{dir:d,HW:[[885,v],[1470,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{ext:[9125,u],top:[9124,u]}},8970:{dir:d,HW:[[885,v],[1470,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{bot:[9123,u],ext:[9122,u]}},8971:{dir:d,HW:[[885,v],[1470,m],[2041,l],[2552,k],[2615,k,1.025]],stretch:{bot:[9126,u],ext:[9125,u]}},9001:{alias:10216,dir:d},9002:{alias:10217,dir:d},9130:{dir:d,HW:[[688,u]],stretch:{ext:[9130,u]}},9135:{dir:r,HW:[[638,u]],stretch:{rep:[9135,u]}},9136:{alias:10182,dir:d},9137:{alias:10181,dir:d},9140:t,9141:t,9168:{dir:d,HW:[[885,v,null,124],[1270,v,1.435,124],[1719,v,1.942,124],[2167,v,2.448,124],[2615,v,2.955,124]],stretch:{ext:[124,v]}},9180:t,9181:t,9182:{dir:r,HW:[[902,v],[1471,m],[2041,l],[2552,k]],stretch:{left:[57382,f],rep:[57383,f],mid:[57388,f],right:[57384,f]}},9183:{dir:r,HW:[[902,v],[1471,m],[2041,l],[2552,k]],stretch:{left:[57385,f],rep:[57386,f],mid:[57389,f],right:[57387,f]}},9184:t,9185:t,9472:{alias:773,dir:r},10072:{alias:8739,dir:d},10181:{dir:d,HW:[[910,u],[1020,m],[1531,l],[2041,k],[2552,i],[3063,g]]},10182:{dir:d,HW:[[910,u],[1020,m],[1531,l],[2041,k],[2552,i],[3063,g]]},10214:j,10215:j,10216:{dir:d,HW:[[885,v],[1020,m],[1270,m,1.244],[2041,l],[2552,k],[2615,k,1.025]]},10217:{dir:d,HW:[[885,v],[1020,m],[1270,m,1.244],[2041,l],[2552,k],[2615,k,1.025]]},10218:j,10219:j,10222:{alias:40,dir:d},10223:{alias:41,dir:d},10229:{alias:8592,dir:r},10230:{alias:8594,dir:r},10231:{alias:8596,dir:r},10232:{alias:8656,dir:r},10233:{alias:8658,dir:r},10234:{alias:8660,dir:r},10235:{alias:8612,dir:r},10236:{alias:8614,dir:r},10237:{alias:10502,dir:r},10238:{alias:10503,dir:r},10502:{dir:r,HW:[[884,w]],stretch:{left:[57372,f],rep:[57373,f],right:[57390,f]}},10503:{dir:r,HW:[[884,w]],stretch:{left:[57391,f],rep:[57373,f],right:[57377,f]}},10748:j,10749:j,10752:j,10753:j,10754:j,10755:j,10756:j,10757:j,10758:j,10759:j,10760:j,10761:j,10764:j,10765:j,10766:j,10767:j,10768:j,10769:j,10770:j,10771:j,10772:j,10773:j,10774:j,10775:j,10776:j,10777:j,10778:j,10779:j,10780:j,12296:{alias:10216,dir:d},12297:{alias:10217,dir:d},65079:{alias:9182,dir:r},65080:{alias:9183,dir:r}}}});MathJax.Hub.Register.LoadHook(z.fontDir+"/Size6/Regular/Main.js",function(){var G;G=z.FONTDATA.DELIMITERS[9182].stretch.rep[0];z.FONTDATA.FONTS[f][G][0]+=100;z.FONTDATA.FONTS[f][G][1]+=100;G=z.FONTDATA.DELIMITERS[9183].stretch.rep[0];z.FONTDATA.FONTS[f][G][0]+=100;z.FONTDATA.FONTS[f][G][1]+=100});MathJax.Hub.Register.LoadHook(z.fontDir+"/Size1/Regular/Main.js",function(){var G;z.FONTDATA.FONTS[m][8747][2]-=300;for(G=8748;G<=8755;G++){z.FONTDATA.FONTS[m][G][2]-=420}for(G=10764;G<=10780;G++){z.FONTDATA.FONTS[m][G][2]-=420}});E.loadComplete(z.fontDir+"/fontdata.js")})(MathJax.OutputJax.SVG,MathJax.ElementJax.mml,MathJax.Ajax,MathJax.Hub);
| CyrusSUEN/cdnjs | ajax/libs/mathjax/2.3/jax/output/SVG/fonts/Asana-Math/fontdata.js | JavaScript | mit | 11,190 |
(function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):e(jQuery,moment)})(function(e,t){var n="jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),a="jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_");t.lang("nl",{months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:function(e,t){return/-MMM-/.test(t)?a[e.month()]:n[e.month()]},weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"Zo_Ma_Di_Wo_Do_Vr_Za".split("_"),longDateFormat:{LT:"HH:mm",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY LT",LLLL:"dddd D MMMM YYYY LT"},calendar:{sameDay:"[vandaag om] LT",nextDay:"[morgen om] LT",nextWeek:"dddd [om] LT",lastDay:"[gisteren om] LT",lastWeek:"[afgelopen] dddd [om] LT",sameElse:"L"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"},ordinal:function(e){return e+(1===e||8===e||e>=20?"ste":"de")},week:{dow:1,doy:4}}),e.fullCalendar.datepickerLang("nl","nl",{closeText:"Sluiten",prevText:"←",nextText:"→",currentText:"Vandaag",monthNames:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthNamesShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],dayNames:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],dayNamesShort:["zon","maa","din","woe","don","vri","zat"],dayNamesMin:["zo","ma","di","wo","do","vr","za"],weekHeader:"Wk",dateFormat:"dd-mm-yy",firstDay:1,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""}),e.fullCalendar.lang("nl",{defaultButtonText:{month:"Maand",week:"Week",day:"Dag",list:"Agenda"},allDayText:"Hele dag"})}); | danut007ro/cdnjs | ajax/libs/fullcalendar/2.0.1/lang/nl.js | JavaScript | mit | 1,943 |
YUI.add('base-core', function (Y, NAME) {
/**
* The base module provides the Base class, which objects requiring attribute and custom event support can extend.
* The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides
* plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions.
*
* @module base
*/
/**
* <p>The base-core module provides the BaseCore class, the lightest version of Base,
* which provides Base's basic lifecycle management and ATTRS construction support,
* but doesn't fire init/destroy or attribute change events.</p>
*
* <p>It mixes in AttributeCore, which is the lightest version of Attribute</p>
*
* @module base
* @submodule base-core
*/
var O = Y.Object,
L = Y.Lang,
DOT = ".",
INITIALIZED = "initialized",
DESTROYED = "destroyed",
INITIALIZER = "initializer",
VALUE = "value",
OBJECT_CONSTRUCTOR = Object.prototype.constructor,
DEEP = "deep",
SHALLOW = "shallow",
DESTRUCTOR = "destructor",
AttributeCore = Y.AttributeCore,
_wlmix = function(r, s, wlhash) {
var p;
for (p in s) {
if(wlhash[p]) {
r[p] = s[p];
}
}
return r;
};
/**
* The BaseCore class, is the lightest version of Base, and provides Base's
* basic lifecycle management and ATTRS construction support, but doesn't
* fire init/destroy or attribute change events.
*
* BaseCore also handles the chaining of initializer and destructor methods across
* the hierarchy as part of object construction and destruction. Additionally, attributes
* configured through the static <a href="#property_BaseCore.ATTRS">ATTRS</a>
* property for each class in the hierarchy will be initialized by BaseCore.
*
* Classes which require attribute support, but don't intend to use/expose attribute
* change events can extend BaseCore instead of Base for optimal kweight and
* runtime performance.
*
* **3.11.0 BACK COMPAT NOTE FOR COMPONENT DEVELOPERS**
*
* Prior to version 3.11.0, ATTRS would get added a class at a time. That is:
*
* <pre>
* for each (class in the hierarchy) {
* Call the class Extension constructors.
*
* Add the class ATTRS.
*
* Call the class initializer
* Call the class Extension initializers.
* }
* </pre>
*
* As of 3.11.0, ATTRS from all classes in the hierarchy are added in one `addAttrs` call
* before **any** initializers are called. That is, the flow becomes:
*
* <pre>
* for each (class in the hierarchy) {
* Call the class Extension constructors.
* }
*
* Add ATTRS for all classes
*
* for each (class in the hierarchy) {
* Call the class initializer.
* Call the class Extension initializers.
* }
* </pre>
*
* Adding all ATTRS at once fixes subtle edge-case issues with subclass ATTRS overriding
* superclass `setter`, `getter` or `valueFn` definitions and being unable to get/set attributes
* defined by the subclass. It also leaves us with a cleaner order of operation flow moving
* forward.
*
* However, it may require component developers to upgrade their components, for the following
* scenarios:
*
* 1. It impacts components which may have `setter`, `getter` or `valueFn` code which
* expects a superclass' initializer to have run.
*
* This is expected to be rare, but to support it, Base now supports a `_preAddAttrs()`, method
* hook (same signature as `addAttrs`). Components can implement this method on their prototype
* for edge cases which do require finer control over the order in which attributes are added
* (see widget-htmlparser for example).
*
* 2. Extension developers may need to move code from Extension constructors to `initializer`s
*
* Older extensions, which were written before `initializer` support was added, had a lot of
* initialization code in their constructors. For example, code which acccessed superclass
* attributes. With the new flow this code would not be able to see attributes. The recommendation
* is to move this initialization code to an `initializer` on the Extension, which was the
* recommendation for anything created after `initializer` support for Extensions was added.
*
* @class BaseCore
* @constructor
* @uses AttributeCore
* @param {Object} cfg Object with configuration property name/value pairs.
* The object can be used to provide initial values for the objects published
* attributes.
*/
function BaseCore(cfg) {
if (!this._BaseInvoked) {
this._BaseInvoked = true;
this._initBase(cfg);
}
}
/**
* The list of properties which can be configured for each attribute
* (e.g. setter, getter, writeOnce, readOnly etc.)
*
* @property _ATTR_CFG
* @type Array
* @static
* @private
*/
BaseCore._ATTR_CFG = AttributeCore._ATTR_CFG.concat("cloneDefaultValue");
/**
* The array of non-attribute configuration properties supported by this class.
*
* For example `BaseCore` defines a "plugins" configuration property which
* should not be set up as an attribute. This property is primarily required so
* that when <a href="#property__allowAdHocAttrs">`_allowAdHocAttrs`</a> is enabled by a class,
* non-attribute configuration properties don't get added as ad-hoc attributes.
*
* @property _NON_ATTRS_CFG
* @type Array
* @static
* @private
*/
BaseCore._NON_ATTRS_CFG = ["plugins"];
/**
* This property controls whether or not instances of this class should
* allow users to add ad-hoc attributes through the constructor configuration
* hash.
*
* AdHoc attributes are attributes which are not defined by the class, and are
* not handled by the MyClass._NON_ATTRS_CFG
*
* @property _allowAdHocAttrs
* @type boolean
* @default undefined (false)
* @protected
*/
/**
* The string to be used to identify instances of this class.
*
* Classes extending BaseCore, should define their own
* static NAME property, which should be camelCase by
* convention (e.g. MyClass.NAME = "myClass";).
*
* @property NAME
* @type String
* @static
*/
BaseCore.NAME = "baseCore";
/**
* The default set of attributes which will be available for instances of this class, and
* their configuration. In addition to the configuration properties listed by
* AttributeCore's <a href="AttributeCore.html#method_addAttr">addAttr</a> method,
* the attribute can also be configured with a "cloneDefaultValue" property, which
* defines how the statically defined value field should be protected
* ("shallow", "deep" and false are supported values).
*
* By default if the value is an object literal or an array it will be "shallow"
* cloned, to protect the default value.
*
* @property ATTRS
* @type Object
* @static
*/
BaseCore.ATTRS = {
/**
* Flag indicating whether or not this object
* has been through the init lifecycle phase.
*
* @attribute initialized
* @readonly
* @default false
* @type boolean
*/
initialized: {
readOnly:true,
value:false
},
/**
* Flag indicating whether or not this object
* has been through the destroy lifecycle phase.
*
* @attribute destroyed
* @readonly
* @default false
* @type boolean
*/
destroyed: {
readOnly:true,
value:false
}
};
/**
Provides a way to safely modify a `Y.BaseCore` subclass' static `ATTRS`
after the class has been defined or created.
BaseCore-based classes cache information about the class hierarchy in order
to efficiently create instances. This cache includes includes the aggregated
`ATTRS` configs. If the static `ATTRS` configs need to be modified after the
class has been defined or create, then use this method which will make sure
to clear any cached data before making any modifications.
@method modifyAttrs
@param {Function} [ctor] The constructor function whose `ATTRS` should be
modified. If a `ctor` function is not specified, then `this` is assumed
to be the constructor which hosts the `ATTRS`.
@param {Object} configs The collection of `ATTRS` configs to mix with the
existing attribute configurations.
@static
@since 3.10.0
**/
BaseCore.modifyAttrs = function (ctor, configs) {
// When called without a constructor, assume `this` is the constructor.
if (typeof ctor !== 'function') {
configs = ctor;
ctor = this;
}
var attrs, attr, name;
// Eagerly create the `ATTRS` object if it doesn't already exist.
attrs = ctor.ATTRS || (ctor.ATTRS = {});
if (configs) {
// Clear cache because it has ATTRS aggregation data which is about
// to be modified.
ctor._CACHED_CLASS_DATA = null;
for (name in configs) {
if (configs.hasOwnProperty(name)) {
attr = attrs[name] || (attrs[name] = {});
Y.mix(attr, configs[name], true);
}
}
}
};
BaseCore.prototype = {
/**
* Internal construction logic for BaseCore.
*
* @method _initBase
* @param {Object} config The constructor configuration object
* @private
*/
_initBase : function(config) {
Y.stamp(this);
this._initAttribute(config);
// If Plugin.Host has been augmented [ through base-pluginhost ], setup it's
// initial state, but don't initialize Plugins yet. That's done after initialization.
var PluginHost = Y.Plugin && Y.Plugin.Host;
if (this._initPlugins && PluginHost) {
PluginHost.call(this);
}
if (this._lazyAddAttrs !== false) { this._lazyAddAttrs = true; }
/**
* The string used to identify the class of this object.
*
* @deprecated Use this.constructor.NAME
* @property name
* @type String
*/
this.name = this.constructor.NAME;
this.init.apply(this, arguments);
},
/**
* Initializes AttributeCore
*
* @method _initAttribute
* @private
*/
_initAttribute: function() {
AttributeCore.call(this);
},
/**
* Init lifecycle method, invoked during construction. Sets up attributes
* and invokes initializers for the class hierarchy.
*
* @method init
* @chainable
* @param {Object} cfg Object with configuration property name/value pairs
* @return {BaseCore} A reference to this object
*/
init: function(cfg) {
this._baseInit(cfg);
return this;
},
/**
* Internal initialization implementation for BaseCore
*
* @method _baseInit
* @private
*/
_baseInit: function(cfg) {
this._initHierarchy(cfg);
if (this._initPlugins) {
// Need to initPlugins manually, to handle constructor parsing, static Plug parsing
this._initPlugins(cfg);
}
this._set(INITIALIZED, true);
},
/**
* Destroy lifecycle method. Invokes destructors for the class hierarchy.
*
* @method destroy
* @return {BaseCore} A reference to this object
* @chainable
*/
destroy: function() {
this._baseDestroy();
return this;
},
/**
* Internal destroy implementation for BaseCore
*
* @method _baseDestroy
* @private
*/
_baseDestroy : function() {
if (this._destroyPlugins) {
this._destroyPlugins();
}
this._destroyHierarchy();
this._set(DESTROYED, true);
},
/**
* Returns the class hierarchy for this object, with BaseCore being the last class in the array.
*
* @method _getClasses
* @protected
* @return {Function[]} An array of classes (constructor functions), making up the class hierarchy for this object.
* This value is cached the first time the method, or _getAttrCfgs, is invoked. Subsequent invocations return the
* cached value.
*/
_getClasses : function() {
if (!this._classes) {
this._initHierarchyData();
}
return this._classes;
},
/**
* Returns an aggregated set of attribute configurations, by traversing
* the class hierarchy.
*
* @method _getAttrCfgs
* @protected
* @return {Object} The hash of attribute configurations, aggregated across classes in the hierarchy
* This value is cached the first time the method, or _getClasses, is invoked. Subsequent invocations return
* the cached value.
*/
_getAttrCfgs : function() {
if (!this._attrs) {
this._initHierarchyData();
}
return this._attrs;
},
/**
* A helper method used to isolate the attrs config for this instance to pass to `addAttrs`,
* from the static cached ATTRS for the class.
*
* @method _getInstanceAttrCfgs
* @private
*
* @param {Object} allCfgs The set of all attribute configurations for this instance.
* Attributes will be removed from this set, if they belong to the filtered class, so
* that by the time all classes are processed, allCfgs will be empty.
*
* @return {Object} The set of attributes to be added for this instance, suitable
* for passing through to `addAttrs`.
*/
_getInstanceAttrCfgs : function(allCfgs) {
var cfgs = {},
cfg,
val,
subAttr,
subAttrs,
subAttrPath,
attr,
attrCfg,
allSubAttrs = allCfgs._subAttrs,
attrCfgProperties = this._attrCfgHash();
for (attr in allCfgs) {
if (allCfgs.hasOwnProperty(attr) && attr !== "_subAttrs") {
attrCfg = allCfgs[attr];
// Need to isolate from allCfgs, because we're going to set values etc.
cfg = cfgs[attr] = _wlmix({}, attrCfg, attrCfgProperties);
val = cfg.value;
if (val && (typeof val === "object")) {
this._cloneDefaultValue(attr, cfg);
}
if (allSubAttrs && allSubAttrs.hasOwnProperty(attr)) {
subAttrs = allCfgs._subAttrs[attr];
for (subAttrPath in subAttrs) {
subAttr = subAttrs[subAttrPath];
if (subAttr.path) {
O.setValue(cfg.value, subAttr.path, subAttr.value);
}
}
}
}
}
return cfgs;
},
/**
* @method _filterAdHocAttrs
* @private
*
* @param {Object} allAttrs The set of all attribute configurations for this instance.
* Attributes will be removed from this set, if they belong to the filtered class, so
* that by the time all classes are processed, allCfgs will be empty.
* @param {Object} userVals The config object passed in by the user, from which adhoc attrs are to be filtered.
* @return {Object} The set of adhoc attributes passed in, in the form
* of an object with attribute name/configuration pairs.
*/
_filterAdHocAttrs : function(allAttrs, userVals) {
var adHocs,
nonAttrs = this._nonAttrs,
attr;
if (userVals) {
adHocs = {};
for (attr in userVals) {
if (!allAttrs[attr] && !nonAttrs[attr] && userVals.hasOwnProperty(attr)) {
adHocs[attr] = {
value:userVals[attr]
};
}
}
}
return adHocs;
},
/**
* A helper method used by _getClasses and _getAttrCfgs, which determines both
* the array of classes and aggregate set of attribute configurations
* across the class hierarchy for the instance.
*
* @method _initHierarchyData
* @private
*/
_initHierarchyData : function() {
var ctor = this.constructor,
cachedClassData = ctor._CACHED_CLASS_DATA,
c,
i,
l,
attrCfg,
attrCfgHash,
needsAttrCfgHash = !ctor._ATTR_CFG_HASH,
nonAttrsCfg,
nonAttrs = {},
classes = [],
attrs = [];
// Start with `this` instance's constructor.
c = ctor;
if (!cachedClassData) {
while (c) {
// Add to classes
classes[classes.length] = c;
// Add to attributes
if (c.ATTRS) {
attrs[attrs.length] = c.ATTRS;
}
// Aggregate ATTR cfg whitelist.
if (needsAttrCfgHash) {
attrCfg = c._ATTR_CFG;
attrCfgHash = attrCfgHash || {};
if (attrCfg) {
for (i = 0, l = attrCfg.length; i < l; i += 1) {
attrCfgHash[attrCfg[i]] = true;
}
}
}
// Commenting out the if. We always aggregate, since we don't
// know if we'll be needing this on the instance or not.
// if (this._allowAdHocAttrs) {
nonAttrsCfg = c._NON_ATTRS_CFG;
if (nonAttrsCfg) {
for (i = 0, l = nonAttrsCfg.length; i < l; i++) {
nonAttrs[nonAttrsCfg[i]] = true;
}
}
//}
c = c.superclass ? c.superclass.constructor : null;
}
// Cache computed `_ATTR_CFG_HASH` on the constructor.
if (needsAttrCfgHash) {
ctor._ATTR_CFG_HASH = attrCfgHash;
}
cachedClassData = ctor._CACHED_CLASS_DATA = {
classes : classes,
nonAttrs : nonAttrs,
attrs : this._aggregateAttrs(attrs)
};
}
this._classes = cachedClassData.classes;
this._attrs = cachedClassData.attrs;
this._nonAttrs = cachedClassData.nonAttrs;
},
/**
* Utility method to define the attribute hash used to filter/whitelist property mixes for
* this class for iteration performance reasons.
*
* @method _attrCfgHash
* @private
*/
_attrCfgHash: function() {
return this.constructor._ATTR_CFG_HASH;
},
/**
* This method assumes that the value has already been checked to be an object.
* Since it's on a critical path, we don't want to re-do the check.
*
* @method _cloneDefaultValue
* @param {Object} cfg
* @private
*/
_cloneDefaultValue : function(attr, cfg) {
var val = cfg.value,
clone = cfg.cloneDefaultValue;
if (clone === DEEP || clone === true) {
cfg.value = Y.clone(val);
} else if (clone === SHALLOW) {
cfg.value = Y.merge(val);
} else if ((clone === undefined && (OBJECT_CONSTRUCTOR === val.constructor || L.isArray(val)))) {
cfg.value = Y.clone(val);
}
// else if (clone === false), don't clone the static default value.
// It's intended to be used by reference.
},
/**
* A helper method, used by _initHierarchyData to aggregate
* attribute configuration across the instances class hierarchy.
*
* The method will protect the attribute configuration value to protect the statically defined
* default value in ATTRS if required (if the value is an object literal, array or the
* attribute configuration has cloneDefaultValue set to shallow or deep).
*
* @method _aggregateAttrs
* @private
* @param {Array} allAttrs An array of ATTRS definitions across classes in the hierarchy
* (subclass first, Base last)
* @return {Object} The aggregate set of ATTRS definitions for the instance
*/
_aggregateAttrs : function(allAttrs) {
var attr,
attrs,
subAttrsHash,
cfg,
path,
i,
cfgPropsHash = this._attrCfgHash(),
aggAttr,
aggAttrs = {};
if (allAttrs) {
for (i = allAttrs.length-1; i >= 0; --i) {
attrs = allAttrs[i];
for (attr in attrs) {
if (attrs.hasOwnProperty(attr)) {
// PERF TODO: Do we need to merge here, since we're merging later in getInstanceAttrCfgs
// Should we move this down to only merge if we hit the path or valueFn ifs below?
cfg = _wlmix({}, attrs[attr], cfgPropsHash);
path = null;
if (attr.indexOf(DOT) !== -1) {
path = attr.split(DOT);
attr = path.shift();
}
aggAttr = aggAttrs[attr];
if (path && aggAttr && aggAttr.value) {
subAttrsHash = aggAttrs._subAttrs;
if (!subAttrsHash) {
subAttrsHash = aggAttrs._subAttrs = {};
}
if (!subAttrsHash[attr]) {
subAttrsHash[attr] = {};
}
subAttrsHash[attr][path.join(DOT)] = {
value: cfg.value,
path : path
};
} else if (!path) {
if (!aggAttr) {
aggAttrs[attr] = cfg;
} else {
if (aggAttr.valueFn && VALUE in cfg) {
aggAttr.valueFn = null;
}
// Mix into existing config.
_wlmix(aggAttr, cfg, cfgPropsHash);
}
}
}
}
}
}
return aggAttrs;
},
/**
* Initializes the class hierarchy for the instance, which includes
* initializing attributes for each class defined in the class's
* static <a href="#property_BaseCore.ATTRS">ATTRS</a> property and
* invoking the initializer method on the prototype of each class in the hierarchy.
*
* @method _initHierarchy
* @param {Object} userVals Object with configuration property name/value pairs
* @private
*/
_initHierarchy : function(userVals) {
var lazy = this._lazyAddAttrs,
constr,
constrProto,
i,
l,
ci,
ei,
el,
ext,
extProto,
exts,
instanceAttrs,
initializers = [],
classes = this._getClasses(),
attrCfgs = this._getAttrCfgs(),
cl = classes.length - 1;
// Constructors
for (ci = cl; ci >= 0; ci--) {
constr = classes[ci];
constrProto = constr.prototype;
exts = constr._yuibuild && constr._yuibuild.exts;
// Using INITIALIZER in hasOwnProperty check, for performance reasons (helps IE6 avoid GC thresholds when
// referencing string literals). Not using it in apply, again, for performance "." is faster.
if (constrProto.hasOwnProperty(INITIALIZER)) {
// Store initializer while we're here and looping
initializers[initializers.length] = constrProto.initializer;
}
if (exts) {
for (ei = 0, el = exts.length; ei < el; ei++) {
ext = exts[ei];
// Ext Constructor
ext.apply(this, arguments);
extProto = ext.prototype;
if (extProto.hasOwnProperty(INITIALIZER)) {
// Store initializer while we're here and looping
initializers[initializers.length] = extProto.initializer;
}
}
}
}
// ATTRS
instanceAttrs = this._getInstanceAttrCfgs(attrCfgs);
if (this._preAddAttrs) {
this._preAddAttrs(instanceAttrs, userVals, lazy);
}
if (this._allowAdHocAttrs) {
this.addAttrs(this._filterAdHocAttrs(attrCfgs, userVals), userVals, lazy);
}
this.addAttrs(instanceAttrs, userVals, lazy);
// Initializers
for (i = 0, l = initializers.length; i < l; i++) {
initializers[i].apply(this, arguments);
}
},
/**
* Destroys the class hierarchy for this instance by invoking
* the destructor method on the prototype of each class in the hierarchy.
*
* @method _destroyHierarchy
* @private
*/
_destroyHierarchy : function() {
var constr,
constrProto,
ci, cl, ei, el, exts, extProto,
classes = this._getClasses();
for (ci = 0, cl = classes.length; ci < cl; ci++) {
constr = classes[ci];
constrProto = constr.prototype;
exts = constr._yuibuild && constr._yuibuild.exts;
if (exts) {
for (ei = 0, el = exts.length; ei < el; ei++) {
extProto = exts[ei].prototype;
if (extProto.hasOwnProperty(DESTRUCTOR)) {
extProto.destructor.apply(this, arguments);
}
}
}
if (constrProto.hasOwnProperty(DESTRUCTOR)) {
constrProto.destructor.apply(this, arguments);
}
}
},
/**
* Default toString implementation. Provides the constructor NAME
* and the instance guid, if set.
*
* @method toString
* @return {String} String representation for this object
*/
toString: function() {
return this.name + "[" + Y.stamp(this, true) + "]";
}
};
// Straightup augment, no wrapper functions
Y.mix(BaseCore, AttributeCore, false, null, 1);
// Fix constructor
BaseCore.prototype.constructor = BaseCore;
Y.BaseCore = BaseCore;
}, '@VERSION@', {"requires": ["attribute-core"]});
| hhbyyh/cdnjs | ajax/libs/yui/3.12.0/base-core/base-core.js | JavaScript | mit | 29,398 |
YUI.add('node-flick', function(Y) {
/**
* Provide a simple Flick plugin, which can be used along with the "flick" gesture event, to
* animate the motion of the host node in response to a (mouse or touch) flick gesture.
*
* <p>The current implementation is designed to move the node, relative to the bounds of a parent node and is suitable
* for scroll/carousel type implementations. Future versions will remove that constraint, to allow open ended movement within
* the document.</p>
*
* @module node-flick
*/
var HOST = "host",
PARENT_NODE = "parentNode",
BOUNDING_BOX = "boundingBox",
OFFSET_HEIGHT = "offsetHeight",
OFFSET_WIDTH = "offsetWidth",
SCROLL_HEIGHT = "scrollHeight",
SCROLL_WIDTH = "scrollWidth",
BOUNCE = "bounce",
MIN_DISTANCE = "minDistance",
MIN_VELOCITY = "minVelocity",
BOUNCE_DISTANCE = "bounceDistance",
DECELERATION = "deceleration",
STEP = "step",
DURATION = "duration",
EASING = "easing",
FLICK = "flick",
getClassName = Y.ClassNameManager.getClassName;
/**
* A plugin class which can be used to animate the motion of a node, in response to a flick gesture.
*
* @class Flick
* @namespace Plugin
* @param {Object} config The initial attribute values for the plugin
*/
function Flick(config) {
Flick.superclass.constructor.apply(this, arguments);
}
Flick.ATTRS = {
/**
* Drag coefficent for inertial scrolling. The closer to 1 this
* value is, the less friction during scrolling.
*
* @attribute deceleration
* @default 0.98
*/
deceleration : {
value: 0.98
},
/**
* Drag coefficient for intertial scrolling at the upper
* and lower boundaries of the scrollview. Set to 0 to
* disable "rubber-banding".
*
* @attribute bounce
* @type Number
* @default 0.7
*/
bounce : {
value: 0.7
},
/**
* The bounce distance in pixels
*
* @attribute bounceDistance
* @type Number
* @default 150
*/
bounceDistance : {
value: 150
},
/**
* The minimum flick gesture velocity (px/ms) at which to trigger the flick response
*
* @attribute minVelocity
* @type Number
* @default 0
*/
minVelocity : {
value: 0
},
/**
* The minimum flick gesture distance (px) for which to trigger the flick response
*
* @attribute minVelocity
* @type Number
* @default 10
*/
minDistance : {
value: 10
},
/**
* The constraining box relative to which the flick animation and bounds should be calculated.
*
* @attribute boundingBox
* @type Node
* @default parentNode
*/
boundingBox : {
valueFn : function() {
return this.get(HOST).get(PARENT_NODE);
}
},
/**
* The constraining box relative to which the flick animation and bounds should be calculated.
*
* @attribute boundingBox
* @type Node
* @default parentNode
*/
step : {
value:10
},
/**
* The custom duration to apply to the flick animation. By default,
* the animation duration is controlled by the deceleration factor.
*
* @attribute duration
* @type Number
* @default null
*/
duration : {
value:null
},
/**
* The custom transition easing to use for the flick animation. If not
* provided defaults to internally to Flick.EASING, or Flick.SNAP_EASING based
* on whether or not we're animating the flick or bounce step.
*
* @attribute easing
* @type String
* @default null
*/
easing : {
value:null
}
};
/**
* The NAME of the Flick class. Used to prefix events generated
* by the plugin.
*
* @property NAME
* @static
* @type String
* @default "pluginFlick"
*/
Flick.NAME = "pluginFlick";
/**
* The namespace for the plugin. This will be the property on the node, which will
* reference the plugin instance, when it's plugged in.
*
* @property NS
* @static
* @type String
* @default "flick"
*/
Flick.NS = "flick";
Y.extend(Flick, Y.Plugin.Base, {
/**
* The initializer lifecycle implementation.
*
* @method initializer
* @param {Object} config The user configuration for the plugin
*/
initializer : function(config) {
this._node = this.get(HOST);
this._renderClasses();
this.setBounds();
this._node.on(FLICK, Y.bind(this._onFlick, this), {
minDistance : this.get(MIN_DISTANCE),
minVelocity : this.get(MIN_VELOCITY)
});
},
/**
* Sets the min/max boundaries for the flick animation,
* based on the boundingBox dimensions.
*
* @method setBounds
*/
setBounds : function () {
var box = this.get(BOUNDING_BOX),
node = this._node,
boxHeight = box.get(OFFSET_HEIGHT),
boxWidth = box.get(OFFSET_WIDTH),
contentHeight = node.get(SCROLL_HEIGHT),
contentWidth = node.get(SCROLL_WIDTH);
if (contentHeight > boxHeight) {
this._maxY = contentHeight - boxHeight;
this._minY = 0;
this._scrollY = true;
}
if (contentWidth > boxWidth) {
this._maxX = contentWidth - boxWidth;
this._minX = 0;
this._scrollX = true;
}
this._x = this._y = 0;
node.set("top", this._y + "px");
node.set("left", this._x + "px");
},
/**
* Adds the CSS classes, necessary to set up overflow/position properties on the
* node and boundingBox.
*
* @method _renderClasses
* @protected
*/
_renderClasses : function() {
this.get(BOUNDING_BOX).addClass(Flick.CLASS_NAMES.box);
this._node.addClass(Flick.CLASS_NAMES.content);
},
/**
* The flick event listener. Kicks off the flick animation.
*
* @method _onFlick
* @param e {EventFacade} The flick event facade, containing e.flick.distance, e.flick.velocity etc.
* @protected
*/
_onFlick: function(e) {
this._v = e.flick.velocity;
this._flick = true;
this._flickAnim();
},
/**
* Executes a single frame in the flick animation
*
* @method _flickFrame
* @protected
*/
_flickAnim: function() {
var y = this._y,
x = this._x,
maxY = this._maxY,
minY = this._minY,
maxX = this._maxX,
minX = this._minX,
velocity = this._v,
step = this.get(STEP),
deceleration = this.get(DECELERATION),
bounce = this.get(BOUNCE);
this._v = (velocity * deceleration);
this._snapToEdge = false;
if (this._scrollX) {
x = x - (velocity * step);
}
if (this._scrollY) {
y = y - (velocity * step);
}
if (Math.abs(velocity).toFixed(4) <= Flick.VELOCITY_THRESHOLD) {
this._flick = false;
this._killTimer(!(this._exceededYBoundary || this._exceededXBoundary));
if (this._scrollX) {
if (x < minX) {
this._snapToEdge = true;
this._setX(minX);
} else if (x > maxX) {
this._snapToEdge = true;
this._setX(maxX);
}
}
if (this._scrollY) {
if (y < minY) {
this._snapToEdge = true;
this._setY(minY);
} else if (y > maxY) {
this._snapToEdge = true;
this._setY(maxY);
}
}
} else {
if (this._scrollX && (x < minX || x > maxX)) {
this._exceededXBoundary = true;
this._v *= bounce;
}
if (this._scrollY && (y < minY || y > maxY)) {
this._exceededYBoundary = true;
this._v *= bounce;
}
if (this._scrollX) {
this._setX(x);
}
if (this._scrollY) {
this._setY(y);
}
this._flickTimer = Y.later(step, this, this._flickAnim);
}
},
/**
* Internal utility method to set the X offset position
*
* @method _setX
* @param {Number} val
* @private
*/
_setX : function(val) {
this._move(val, null, this.get(DURATION), this.get(EASING));
},
/**
* Internal utility method to set the Y offset position
*
* @method _setY
* @param {Number} val
* @private
*/
_setY : function(val) {
this._move(null, val, this.get(DURATION), this.get(EASING));
},
/**
* Internal utility method to move the node to a given XY position,
* using transitions, if specified.
*
* @method _move
* @param {Number} x The X offset position
* @param {Number} y The Y offset position
* @param {Number} duration The duration to use for the transition animation
* @param {String} easing The easing to use for the transition animation.
*
* @private
*/
_move: function(x, y, duration, easing) {
if (x !== null) {
x = this._bounce(x);
} else {
x = this._x;
}
if (y !== null) {
y = this._bounce(y);
} else {
y = this._y;
}
duration = duration || this._snapToEdge ? Flick.SNAP_DURATION : 0;
easing = easing || this._snapToEdge ? Flick.SNAP_EASING : Flick.EASING;
this._x = x;
this._y = y;
this._anim(x, y, duration, easing);
},
/**
* Internal utility method to perform the transition step
*
* @method _anim
* @param {Number} x The X offset position
* @param {Number} y The Y offset position
* @param {Number} duration The duration to use for the transition animation
* @param {String} easing The easing to use for the transition animation.
*
* @private
*/
_anim : function(x, y, duration, easing) {
var xn = x * -1,
yn = y * -1,
transition = {
duration : duration / 1000,
easing : easing
};
Y.log("Transition: duration, easing:" + transition.duration, transition.easing, "node-flick");
if (Y.Transition.useNative) {
transition.transform = 'translate('+ (xn) + 'px,' + (yn) +'px)';
} else {
transition.left = xn + 'px';
transition.top = yn + 'px';
}
this._node.transition(transition);
},
/**
* Internal utility method to constrain the offset value
* based on the bounce criteria.
*
* @method _bounce
* @param {Number} x The offset value to constrain.
* @param {Number} max The max offset value.
*
* @private
*/
_bounce : function(val, max) {
var bounce = this.get(BOUNCE),
dist = this.get(BOUNCE_DISTANCE),
min = bounce ? -dist : 0;
max = bounce ? max + dist : max;
if(!bounce) {
if(val < min) {
val = min;
} else if(val > max) {
val = max;
}
}
return val;
},
/**
* Stop the animation timer
*
* @method _killTimer
* @private
*/
_killTimer: function() {
if(this._flickTimer) {
this._flickTimer.cancel();
}
}
}, {
/**
* The threshold used to determine when the decelerated velocity of the node
* is practically 0.
*
* @property VELOCITY_THRESHOLD
* @static
* @type Number
* @default 0.015
*/
VELOCITY_THRESHOLD : 0.015,
/**
* The duration to use for the bounce snap-back transition
*
* @property SNAP_DURATION
* @static
* @type Number
* @default 400
*/
SNAP_DURATION : 400,
/**
* The default easing to use for the main flick movement transition
*
* @property EASING
* @static
* @type String
* @default 'cubic-bezier(0, 0.1, 0, 1.0)'
*/
EASING : 'cubic-bezier(0, 0.1, 0, 1.0)',
/**
* The default easing to use for the bounce snap-back transition
*
* @property SNAP_EASING
* @static
* @type String
* @default 'ease-out'
*/
SNAP_EASING : 'ease-out',
/**
* The default CSS class names used by the plugin
*
* @property CLASS_NAMES
* @static
* @type Object
*/
CLASS_NAMES : {
box: getClassName(Flick.NS),
content: getClassName(Flick.NS, "content")
}
});
Y.Plugin.Flick = Flick;
}, '@VERSION@' ,{requires:['classnamemanager', 'transition', 'event-flick', 'plugin']});
| r3x/cdnjs | ajax/libs/yui/3.4.1/node-flick/node-flick-debug.js | JavaScript | mit | 14,797 |
YUI.add('dataschema-base', function(Y) {
/**
* The DataSchema utility provides a common configurable interface for widgets to
* apply a given schema to a variety of data.
*
* @module dataschema
* @main dataschema
*/
/**
* Provides the base DataSchema implementation, which can be extended to
* create DataSchemas for specific data formats, such XML, JSON, text and
* arrays.
*
* @module dataschema
* @submodule dataschema-base
*/
var LANG = Y.Lang,
/**
* Base class for the YUI DataSchema Utility.
* @class DataSchema.Base
* @static
*/
SchemaBase = {
/**
* Overridable method returns data as-is.
*
* @method apply
* @param schema {Object} Schema to apply.
* @param data {Object} Data.
* @return {Object} Schema-parsed data.
* @static
*/
apply: function(schema, data) {
return data;
},
/**
* Applies field parser, if defined
*
* @method parse
* @param value {Object} Original value.
* @param field {Object} Field.
* @return {Object} Type-converted value.
*/
parse: function(value, field) {
if(field.parser) {
var parser = (LANG.isFunction(field.parser)) ?
field.parser : Y.Parsers[field.parser+''];
if(parser) {
value = parser.call(this, value);
}
else {
}
}
return value;
}
};
Y.namespace("DataSchema").Base = SchemaBase;
Y.namespace("Parsers");
}, '@VERSION@' ,{requires:['base']});
| johan-gorter/cdnjs | ajax/libs/yui/3.5.1/dataschema-base/dataschema-base.js | JavaScript | mit | 1,536 |
/*! jQuery v1.12.0 | (c) jQuery Foundation | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb,tb,ub=n.expr.attrHandle,vb=/^(?:checked|selected)$/i,wb=l.getSetAttribute,xb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?tb:sb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?xb&&wb||!vb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(wb?c:d)}}),tb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):xb&&wb||!vb.test(c)?a.setAttribute(!wb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ub[b]||n.find.attr;xb&&wb||!vb.test(b)?ub[b]=function(a,b,d){var e,f;return d||(f=ub[b],ub[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ub[b]=f),e}:ub[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),xb&&wb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):sb&&sb.set(a,b,c)}}),wb||(sb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ub.id=ub.name=ub.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:sb.set},n.attrHooks.contenteditable={set:function(a,b,c){sb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var yb=/^(?:input|select|textarea|button|object)$/i,zb=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):yb.test(a.nodeName)||zb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Ab=/[\t\r\n\f]/g;function Bb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Bb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=Bb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Bb(c)+" ").replace(Ab," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Cb=a.location,Db=n.now(),Eb=/\?/,Fb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Fb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Gb=/#.*$/,Hb=/([?&])_=[^&]*/,Ib=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Jb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kb=/^(?:GET|HEAD)$/,Lb=/^\/\//,Mb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nb={},Ob={},Pb="*/".concat("*"),Qb=Cb.href,Rb=Mb.exec(Qb.toLowerCase())||[];function Sb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Tb(a,b,c,d){var e={},f=a===Ob;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ub(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Vb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Wb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Qb,type:"GET",isLocal:Jb.test(Rb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ub(Ub(a,n.ajaxSettings),b):Ub(n.ajaxSettings,a)},ajaxPrefilter:Sb(Nb),ajaxTransport:Sb(Ob),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Ib.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Qb)+"").replace(Gb,"").replace(Lb,Rb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Mb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Rb[1]&&d[2]===Rb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Rb[3]||("http:"===Rb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Tb(Nb,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Kb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Eb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Hb.test(f)?f.replace(Hb,"$1_="+Db++):f+(Eb.test(f)?"&":"?")+"_="+Db++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Pb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Tb(Ob,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Vb(l,w,d)),v=Wb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Xb(a){return a.style&&a.style.display||n.css(a,"display")}function Yb(a){while(a&&1===a.nodeType){if("none"===Xb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Yb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Zb=/%20/g,$b=/\[\]$/,_b=/\r?\n/g,ac=/^(?:submit|button|image|reset|file)$/i,bc=/^(?:input|select|textarea|keygen)/i;function cc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||$b.test(a)?d(a,e):cc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)cc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)cc(c,a[c],b,e);return d.join("&").replace(Zb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&bc.test(this.nodeName)&&!ac.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(_b,"\r\n")}}):{name:b.name,value:c.replace(_b,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?hc():d.documentMode>8?gc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&gc()||hc()}:gc;var dc=0,ec={},fc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ec)ec[a](void 0,!0)}),l.cors=!!fc&&"withCredentials"in fc,fc=l.ajax=!!fc,fc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++dc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ec[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ec[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function gc(){try{return new a.XMLHttpRequest}catch(b){}}function hc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ic=[],jc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||n.expando+"_"+Db++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(jc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&jc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(jc,"$1"+e):b.jsonp!==!1&&(b.url+=(Eb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ic.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){if(!d.implementation.createHTMLDocument)return!1;var a=d.implementation.createHTMLDocument("");return a.body.innerHTML="<form></form><form></form>",2===a.body.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var kc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&kc)return kc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function lc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=lc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0)-a.scrollTop(),c.left+=n.css(a[0],"borderLeftWidth",!0)-a.scrollLeft()),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=lc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){
n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n});
| flochntrl/flochntrl.github.io | assets/js/jquery-1.12.0.min.js | JavaScript | mit | 97,362 |
YUI.add('plugin', function(Y) {
/**
* Provides the base Plugin class, which plugin developers should extend, when creating custom plugins
*
* @module plugin
*/
/**
* The base class for all Plugin instances.
*
* @class Plugin.Base
* @extends Base
* @param {Object} config Configuration object with property name/value pairs.
*/
function Plugin(config) {
if (! (this.hasImpl && this.hasImpl(Y.Plugin.Base)) ) {
Plugin.superclass.constructor.apply(this, arguments);
} else {
Plugin.prototype.initializer.apply(this, arguments);
}
}
/**
* Object defining the set of attributes supported by the Plugin.Base class
*
* @property ATTRS
* @type Object
* @static
*/
Plugin.ATTRS = {
/**
* The plugin's host object.
*
* @attribute host
* @writeonce
* @type Plugin.Host
*/
host : {
writeOnce: true
}
};
/**
* The string identifying the Plugin.Base class. Plugins extending
* Plugin.Base should set their own NAME value.
*
* @property NAME
* @type String
* @static
*/
Plugin.NAME = 'plugin';
/**
* The name of the property the the plugin will be attached to
* when plugged into a Plugin Host. Plugins extending Plugin.Base,
* should set their own NS value.
*
* @property NS
* @type String
* @static
*/
Plugin.NS = 'plugin';
Y.extend(Plugin, Y.Base, {
/**
* The list of event handles for event listeners or AOP injected methods
* applied by the plugin to the host object.
*
* @property _handles
* @private
* @type Array
* @value null
*/
_handles: null,
/**
* Initializer lifecycle implementation.
*
* @method initializer
* @param {Object} config Configuration object with property name/value pairs.
*/
initializer : function(config) {
if (!this.get("host")) { Y.log('No host defined for plugin ' + this, 'warn', 'Plugin');}
this._handles = [];
Y.log('Initializing: ' + this.constructor.NAME, 'info', 'Plugin');
},
/**
* Destructor lifecycle implementation.
*
* Removes any event listeners or injected methods applied by the Plugin
*
* @method destructor
*/
destructor: function() {
// remove all handles
if (this._handles) {
for (var i = 0, l = this._handles.length; i < l; i++) {
this._handles[i].detach();
}
}
},
/**
* Listens for the "on" moment of events fired by the host,
* or injects code "before" a given method on the host.
*
* @method doBefore
*
* @param strMethod {String} The event to listen for, or method to inject logic before.
* @param fn {Function} The handler function. For events, the "on" moment listener. For methods, the function to execute before the given method is executed.
* @param context {Object} An optional context to call the handler with. The default context is the plugin instance.
* @return handle {EventHandle} The detach handle for the handler.
*/
doBefore: function(strMethod, fn, context) {
var host = this.get("host"), handle;
if (strMethod in host) { // method
handle = this.beforeHostMethod(strMethod, fn, context);
} else if (host.on) { // event
handle = this.onHostEvent(strMethod, fn, context);
}
return handle;
},
/**
* Listens for the "after" moment of events fired by the host,
* or injects code "after" a given method on the host.
*
* @method doAfter
*
* @param strMethod {String} The event to listen for, or method to inject logic after.
* @param fn {Function} The handler function. For events, the "after" moment listener. For methods, the function to execute after the given method is executed.
* @param context {Object} An optional context to call the handler with. The default context is the plugin instance.
* @return handle {EventHandle} The detach handle for the listener.
*/
doAfter: function(strMethod, fn, context) {
var host = this.get("host"), handle;
if (strMethod in host) { // method
handle = this.afterHostMethod(strMethod, fn, context);
} else if (host.after) { // event
handle = this.afterHostEvent(strMethod, fn, context);
}
return handle;
},
/**
* Listens for the "on" moment of events fired by the host object.
*
* Listeners attached through this method will be detached when the plugin is unplugged.
*
* @method onHostEvent
* @param {String | Object} type The event type.
* @param {Function} fn The listener.
* @param {Object} context The execution context. Defaults to the plugin instance.
* @return handle {EventHandle} The detach handle for the listener.
*/
onHostEvent : function(type, fn, context) {
var handle = this.get("host").on(type, fn, context || this);
this._handles.push(handle);
return handle;
},
/**
* Listens for the "after" moment of events fired by the host object.
*
* Listeners attached through this method will be detached when the plugin is unplugged.
*
* @method afterHostEvent
* @param {String | Object} type The event type.
* @param {Function} fn The listener.
* @param {Object} context The execution context. Defaults to the plugin instance.
* @return handle {EventHandle} The detach handle for the listener.
*/
afterHostEvent : function(type, fn, context) {
var handle = this.get("host").after(type, fn, context || this);
this._handles.push(handle);
return handle;
},
/**
* Injects a function to be executed before a given method on host object.
*
* The function will be detached when the plugin is unplugged.
*
* @method beforeHostMethod
* @param {String} method The name of the method to inject the function before.
* @param {Function} fn The function to inject.
* @param {Object} context The execution context. Defaults to the plugin instance.
* @return handle {EventHandle} The detach handle for the injected function.
*/
beforeHostMethod : function(strMethod, fn, context) {
var handle = Y.Do.before(fn, this.get("host"), strMethod, context || this);
this._handles.push(handle);
return handle;
},
/**
* Injects a function to be executed after a given method on host object.
*
* The function will be detached when the plugin is unplugged.
*
* @method afterHostMethod
* @param {String} method The name of the method to inject the function after.
* @param {Function} fn The function to inject.
* @param {Object} context The execution context. Defaults to the plugin instance.
* @return handle {EventHandle} The detach handle for the injected function.
*/
afterHostMethod : function(strMethod, fn, context) {
var handle = Y.Do.after(fn, this.get("host"), strMethod, context || this);
this._handles.push(handle);
return handle;
},
toString: function() {
return this.constructor.NAME + '[' + this.constructor.NS + ']';
}
});
Y.namespace("Plugin").Base = Plugin;
}, '@VERSION@' ,{requires:['base-base']});
| arkaindas/cdnjs | ajax/libs/yui/3.4.1/plugin/plugin-debug.js | JavaScript | mit | 8,171 |
//mIRC mode by Ford_Lawnmower :: Based on Velocity mode by Steve O'Hara
CodeMirror.defineMIME("text/mirc", "mirc");
CodeMirror.defineMode("mirc", function() {
function parseWords(str) {
var obj = {}, words = str.split(" ");
for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
return obj;
}
var specials = parseWords("$! $$ $& $? $+ $abook $abs $active $activecid " +
"$activewid $address $addtok $agent $agentname $agentstat $agentver " +
"$alias $and $anick $ansi2mirc $aop $appactive $appstate $asc $asctime " +
"$asin $atan $avoice $away $awaymsg $awaytime $banmask $base $bfind " +
"$binoff $biton $bnick $bvar $bytes $calc $cb $cd $ceil $chan $chanmodes " +
"$chantypes $chat $chr $cid $clevel $click $cmdbox $cmdline $cnick $color " +
"$com $comcall $comchan $comerr $compact $compress $comval $cos $count " +
"$cr $crc $creq $crlf $ctime $ctimer $ctrlenter $date $day $daylight " +
"$dbuh $dbuw $dccignore $dccport $dde $ddename $debug $decode $decompress " +
"$deltok $devent $dialog $did $didreg $didtok $didwm $disk $dlevel $dll " +
"$dllcall $dname $dns $duration $ebeeps $editbox $emailaddr $encode $error " +
"$eval $event $exist $feof $ferr $fgetc $file $filename $filtered $finddir " +
"$finddirn $findfile $findfilen $findtok $fline $floor $fopen $fread $fserve " +
"$fulladdress $fulldate $fullname $fullscreen $get $getdir $getdot $gettok $gmt " +
"$group $halted $hash $height $hfind $hget $highlight $hnick $hotline " +
"$hotlinepos $ial $ialchan $ibl $idle $iel $ifmatch $ignore $iif $iil " +
"$inelipse $ini $inmidi $inpaste $inpoly $input $inrect $inroundrect " +
"$insong $instok $int $inwave $ip $isalias $isbit $isdde $isdir $isfile " +
"$isid $islower $istok $isupper $keychar $keyrpt $keyval $knick $lactive " +
"$lactivecid $lactivewid $left $len $level $lf $line $lines $link $lock " +
"$lock $locked $log $logstamp $logstampfmt $longfn $longip $lower $ltimer " +
"$maddress $mask $matchkey $matchtok $md5 $me $menu $menubar $menucontext " +
"$menutype $mid $middir $mircdir $mircexe $mircini $mklogfn $mnick $mode " +
"$modefirst $modelast $modespl $mouse $msfile $network $newnick $nick $nofile " +
"$nopath $noqt $not $notags $notify $null $numeric $numok $oline $onpoly " +
"$opnick $or $ord $os $passivedcc $pic $play $pnick $port $portable $portfree " +
"$pos $prefix $prop $protect $puttok $qt $query $rand $r $rawmsg $read $readomo " +
"$readn $regex $regml $regsub $regsubex $remove $remtok $replace $replacex " +
"$reptok $result $rgb $right $round $scid $scon $script $scriptdir $scriptline " +
"$sdir $send $server $serverip $sfile $sha1 $shortfn $show $signal $sin " +
"$site $sline $snick $snicks $snotify $sock $sockbr $sockerr $sockname " +
"$sorttok $sound $sqrt $ssl $sreq $sslready $status $strip $str $stripped " +
"$syle $submenu $switchbar $tan $target $ticks $time $timer $timestamp " +
"$timestampfmt $timezone $tip $titlebar $toolbar $treebar $trust $ulevel " +
"$ulist $upper $uptime $url $usermode $v1 $v2 $var $vcmd $vcmdstat $vcmdver " +
"$version $vnick $vol $wid $width $wildsite $wildtok $window $wrap $xor");
var keywords = parseWords("abook ajinvite alias aline ame amsg anick aop auser autojoin avoice " +
"away background ban bcopy beep bread break breplace bset btrunc bunset bwrite " +
"channel clear clearall cline clipboard close cnick color comclose comopen " +
"comreg continue copy creq ctcpreply ctcps dcc dccserver dde ddeserver " +
"debug dec describe dialog did didtok disable disconnect dlevel dline dll " +
"dns dqwindow drawcopy drawdot drawfill drawline drawpic drawrect drawreplace " +
"drawrot drawsave drawscroll drawtext ebeeps echo editbox emailaddr enable " +
"events exit fclose filter findtext finger firewall flash flist flood flush " +
"flushini font fopen fseek fsend fserve fullname fwrite ghide gload gmove " +
"gopts goto gplay gpoint gqreq groups gshow gsize gstop gtalk gunload hadd " +
"halt haltdef hdec hdel help hfree hinc hload hmake hop hsave ial ialclear " +
"ialmark identd if ignore iline inc invite iuser join kick linesep links list " +
"load loadbuf localinfo log mdi me menubar mkdir mnick mode msg nick noop notice " +
"notify omsg onotice part partall pdcc perform play playctrl pop protect pvoice " +
"qme qmsg query queryn quit raw reload remini remote remove rename renwin " +
"reseterror resetidle return rlevel rline rmdir run ruser save savebuf saveini " +
"say scid scon server set showmirc signam sline sockaccept sockclose socklist " +
"socklisten sockmark sockopen sockpause sockread sockrename sockudp sockwrite " +
"sound speak splay sreq strip switchbar timer timestamp titlebar tnick tokenize " +
"toolbar topic tray treebar ulist unload unset unsetall updatenl url uwho " +
"var vcadd vcmd vcrem vol while whois window winhelp write writeint if isalnum " +
"isalpha isaop isavoice isban ischan ishop isignore isin isincs isletter islower " +
"isnotify isnum ison isop isprotect isreg isupper isvoice iswm iswmcs " +
"elseif else goto menu nicklist status title icon size option text edit " +
"button check radio box scroll list combo link tab item");
var functions = parseWords("if elseif else and not or eq ne in ni for foreach while switch");
var isOperatorChar = /[+\-*&%=<>!?^\/\|]/;
function chain(stream, state, f) {
state.tokenize = f;
return f(stream, state);
}
function tokenBase(stream, state) {
var beforeParams = state.beforeParams;
state.beforeParams = false;
var ch = stream.next();
if (/[\[\]{}\(\),\.]/.test(ch)) {
if (ch == "(" && beforeParams) state.inParams = true;
else if (ch == ")") state.inParams = false;
return null;
}
else if (/\d/.test(ch)) {
stream.eatWhile(/[\w\.]/);
return "number";
}
else if (ch == "\\") {
stream.eat("\\");
stream.eat(/./);
return "number";
}
else if (ch == "/" && stream.eat("*")) {
return chain(stream, state, tokenComment);
}
else if (ch == ";" && stream.match(/ *\( *\(/)) {
return chain(stream, state, tokenUnparsed);
}
else if (ch == ";" && !state.inParams) {
stream.skipToEnd();
return "comment";
}
else if (ch == '"') {
stream.eat(/"/);
return "keyword";
}
else if (ch == "$") {
stream.eatWhile(/[$_a-z0-9A-Z\.:]/);
if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) {
return "keyword";
}
else {
state.beforeParams = true;
return "builtin";
}
}
else if (ch == "%") {
stream.eatWhile(/[^,^\s^\(^\)]/);
state.beforeParams = true;
return "string";
}
else if (isOperatorChar.test(ch)) {
stream.eatWhile(isOperatorChar);
return "operator";
}
else {
stream.eatWhile(/[\w\$_{}]/);
var word = stream.current().toLowerCase();
if (keywords && keywords.propertyIsEnumerable(word))
return "keyword";
if (functions && functions.propertyIsEnumerable(word)) {
state.beforeParams = true;
return "keyword";
}
return null;
}
}
function tokenComment(stream, state) {
var maybeEnd = false, ch;
while (ch = stream.next()) {
if (ch == "/" && maybeEnd) {
state.tokenize = tokenBase;
break;
}
maybeEnd = (ch == "*");
}
return "comment";
}
function tokenUnparsed(stream, state) {
var maybeEnd = 0, ch;
while (ch = stream.next()) {
if (ch == ";" && maybeEnd == 2) {
state.tokenize = tokenBase;
break;
}
if (ch == ")")
maybeEnd++;
else if (ch != " ")
maybeEnd = 0;
}
return "meta";
}
return {
startState: function() {
return {
tokenize: tokenBase,
beforeParams: false,
inParams: false
};
},
token: function(stream, state) {
if (stream.eatSpace()) return null;
return state.tokenize(stream, state);
}
};
});
| freak3dot/cdnjs | ajax/libs/codemirror/3.17.0/mode/mirc/mirc.js | JavaScript | mit | 9,620 |
CodeMirror.defineMode('z80', function() {
var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i;
var keywords2 = /^(call|j[pr]|ret[in]?)\b/i;
var keywords3 = /^b_?(call|jump)\b/i;
var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i;
var variables2 = /^(n?[zc]|p[oe]?|m)\b/i;
var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i;
var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i;
return {
startState: function() {
return {context: 0};
},
token: function(stream, state) {
if (!stream.column())
state.context = 0;
if (stream.eatSpace())
return null;
var w;
if (stream.eatWhile(/\w/)) {
w = stream.current();
if (stream.indentation()) {
if (state.context == 1 && variables1.test(w))
return 'variable-2';
if (state.context == 2 && variables2.test(w))
return 'variable-3';
if (keywords1.test(w)) {
state.context = 1;
return 'keyword';
} else if (keywords2.test(w)) {
state.context = 2;
return 'keyword';
} else if (keywords3.test(w)) {
state.context = 3;
return 'keyword';
}
if (errors.test(w))
return 'error';
} else if (numbers.test(w)) {
return 'number';
} else {
return null;
}
} else if (stream.eat(';')) {
stream.skipToEnd();
return 'comment';
} else if (stream.eat('"')) {
while (w = stream.next()) {
if (w == '"')
break;
if (w == '\\')
stream.next();
}
return 'string';
} else if (stream.eat('\'')) {
if (stream.match(/\\?.'/))
return 'number';
} else if (stream.eat('.') || stream.sol() && stream.eat('#')) {
state.context = 4;
if (stream.eatWhile(/\w/))
return 'def';
} else if (stream.eat('$')) {
if (stream.eatWhile(/[\da-f]/i))
return 'number';
} else if (stream.eat('%')) {
if (stream.eatWhile(/[01]/))
return 'number';
} else {
stream.next();
}
return null;
}
};
});
CodeMirror.defineMIME("text/x-z80", "z80");
| theironcook/cdnjs | ajax/libs/codemirror/3.24.0/mode/z80/z80.js | JavaScript | mit | 2,419 |
YUI.add('cache-base', function (Y, NAME) {
/**
* The Cache utility provides a common configurable interface for components to
* cache and retrieve data from a local JavaScript struct.
*
* @module cache
* @main
*/
/**
* Provides the base class for the YUI Cache utility.
*
* @submodule cache-base
*/
var LANG = Y.Lang,
isDate = Y.Lang.isDate,
/**
* Base class for the YUI Cache utility.
* @class Cache
* @extends Base
* @constructor
*/
Cache = function() {
Cache.superclass.constructor.apply(this, arguments);
};
/////////////////////////////////////////////////////////////////////////////
//
// Cache static properties
//
/////////////////////////////////////////////////////////////////////////////
Y.mix(Cache, {
/**
* Class name.
*
* @property NAME
* @type String
* @static
* @final
* @value "cache"
*/
NAME: "cache",
ATTRS: {
/////////////////////////////////////////////////////////////////////////////
//
// Cache Attributes
//
/////////////////////////////////////////////////////////////////////////////
/**
* @attribute max
* @description Maximum number of entries the Cache can hold.
* Set to 0 to turn off caching.
* @type Number
* @default 0
*/
max: {
value: 0,
setter: "_setMax"
},
/**
* @attribute size
* @description Number of entries currently cached.
* @type Number
*/
size: {
readOnly: true,
getter: "_getSize"
},
/**
* @attribute uniqueKeys
* @description Validate uniqueness of stored keys. Default is false and
* is more performant.
* @type Boolean
*/
uniqueKeys: {
value: false
},
/**
* @attribute expires
* @description Absolute Date when data expires or
* relative number of milliseconds. Zero disables expiration.
* @type Date | Number
* @default 0
*/
expires: {
value: 0,
validator: function(v) {
return Y.Lang.isDate(v) || (Y.Lang.isNumber(v) && v >= 0);
}
},
/**
* @attribute entries
* @description Cached entries.
* @type Array
*/
entries: {
readOnly: true,
getter: "_getEntries"
}
}
});
Y.extend(Cache, Y.Base, {
/////////////////////////////////////////////////////////////////////////////
//
// Cache private properties
//
/////////////////////////////////////////////////////////////////////////////
/**
* Array of request/response objects indexed chronologically.
*
* @property _entries
* @type Object[]
* @private
*/
_entries: null,
/////////////////////////////////////////////////////////////////////////////
//
// Cache private methods
//
/////////////////////////////////////////////////////////////////////////////
/**
* @method initializer
* @description Internal init() handler.
* @param config {Object} Config object.
* @private
*/
initializer: function(config) {
/**
* @event add
* @description Fired when an entry is added.
* @param e {Event.Facade} Event Facade with the following properties:
* <dl>
* <dt>entry (Object)</dt> <dd>The cached entry.</dd>
* </dl>
* @preventable _defAddFn
*/
this.publish("add", {defaultFn: this._defAddFn});
/**
* @event flush
* @description Fired when the cache is flushed.
* @param e {Event.Facade} Event Facade object.
* @preventable _defFlushFn
*/
this.publish("flush", {defaultFn: this._defFlushFn});
/**
* @event request
* @description Fired when an entry is requested from the cache.
* @param e {Event.Facade} Event Facade with the following properties:
* <dl>
* <dt>request (Object)</dt> <dd>The request object.</dd>
* </dl>
*/
/**
* @event retrieve
* @description Fired when an entry is retrieved from the cache.
* @param e {Event.Facade} Event Facade with the following properties:
* <dl>
* <dt>entry (Object)</dt> <dd>The retrieved entry.</dd>
* </dl>
*/
// Initialize internal values
this._entries = [];
},
/**
* @method destructor
* @description Internal destroy() handler.
* @private
*/
destructor: function() {
this._entries = [];
},
/////////////////////////////////////////////////////////////////////////////
//
// Cache protected methods
//
/////////////////////////////////////////////////////////////////////////////
/**
* Sets max.
*
* @method _setMax
* @protected
*/
_setMax: function(value) {
// If the cache is full, make room by removing stalest element (index=0)
var entries = this._entries;
if(value > 0) {
if(entries) {
while(entries.length > value) {
entries.shift();
}
}
}
else {
value = 0;
this._entries = [];
}
return value;
},
/**
* Gets size.
*
* @method _getSize
* @protected
*/
_getSize: function() {
return this._entries.length;
},
/**
* Gets all entries.
*
* @method _getEntries
* @protected
*/
_getEntries: function() {
return this._entries;
},
/**
* Adds entry to cache.
*
* @method _defAddFn
* @param e {Event.Facade} Event Facade with the following properties:
* <dl>
* <dt>entry (Object)</dt> <dd>The cached entry.</dd>
* </dl>
* @protected
*/
_defAddFn: function(e) {
var entries = this._entries,
entry = e.entry,
max = this.get("max"),
pos;
// If uniqueKeys is true and item exists with this key, then remove it.
if (this.get("uniqueKeys")) {
pos = this._position(e.entry.request);
if (LANG.isValue(pos)) {
entries.splice(pos, 1);
}
}
// If the cache at or over capacity, make room by removing stalest
// element(s) starting at index-0.
while (max && entries.length >= max) {
entries.shift();
}
// Add entry to cache in the newest position, at the end of the array
entries[entries.length] = entry;
},
/**
* Flushes cache.
*
* @method _defFlushFn
* @param e {Event.Facade} Event Facade object.
* @protected
*/
_defFlushFn: function(e) {
var entries = this._entries,
details = e.details[0],
pos;
//passed an item, flush only that
if(details && LANG.isValue(details.request)) {
pos = this._position(details.request);
if(LANG.isValue(pos)) {
entries.splice(pos,1);
}
}
//no item, flush everything
else {
this._entries = [];
}
},
/**
* Default overridable method compares current request with given cache entry.
* Returns true if current request matches the cached request, otherwise
* false. Implementers should override this method to customize the
* cache-matching algorithm.
*
* @method _isMatch
* @param request {Object} Request object.
* @param entry {Object} Cached entry.
* @return {Boolean} True if current request matches given cached request, false otherwise.
* @protected
*/
_isMatch: function(request, entry) {
if(!entry.expires || new Date() < entry.expires) {
return (request === entry.request);
}
return false;
},
/**
* Returns position of a request in the entries array, otherwise null.
*
* @method _position
* @param request {Object} Request object.
* @return {Number} Array position if found, null otherwise.
* @protected
*/
_position: function(request) {
// If cache is enabled...
var entries = this._entries,
length = entries.length,
i = length-1;
if((this.get("max") === null) || this.get("max") > 0) {
// Loop through each cached entry starting from the newest
for(; i >= 0; i--) {
// Execute matching function
if(this._isMatch(request, entries[i])) {
return i;
}
}
}
return null;
},
/////////////////////////////////////////////////////////////////////////////
//
// Cache public methods
//
/////////////////////////////////////////////////////////////////////////////
/**
* Adds a new entry to the cache of the format
* {request:request, response:response, cached:cached, expires:expires}.
* If cache is full, evicts the stalest entry before adding the new one.
*
* @method add
* @param request {Object} Request value.
* @param response {Object} Response value.
*/
add: function(request, response) {
var expires = this.get("expires");
if(this.get("initialized") && ((this.get("max") === null) || this.get("max") > 0) &&
(LANG.isValue(request) || LANG.isNull(request) || LANG.isUndefined(request))) {
this.fire("add", {entry: {
request:request,
response:response,
cached: new Date(),
expires: isDate(expires) ? expires :
(expires ? new Date(new Date().getTime() + this.get("expires")) : null)
}});
}
else {
}
},
/**
* Flushes cache.
*
* @method flush
*/
flush: function(request) {
this.fire("flush", { request: (LANG.isValue(request) ? request : null) });
},
/**
* Retrieves cached object for given request, if available, and refreshes
* entry in the cache. Returns null if there is no cache match.
*
* @method retrieve
* @param request {Object} Request object.
* @return {Object} Cached object with the properties request and response, or null.
*/
retrieve: function(request) {
// If cache is enabled...
var entries = this._entries,
length = entries.length,
entry = null,
pos;
if((length > 0) && ((this.get("max") === null) || (this.get("max") > 0))) {
this.fire("request", {request: request});
pos = this._position(request);
if(LANG.isValue(pos)) {
entry = entries[pos];
this.fire("retrieve", {entry: entry});
// Refresh the position of the cache hit
if(pos < length-1) {
// Remove element from its original location
entries.splice(pos,1);
// Add as newest
entries[entries.length] = entry;
}
return entry;
}
}
return null;
}
});
Y.Cache = Cache;
}, '@VERSION@', {"requires": ["base"]});
| tomalec/cdnjs | ajax/libs/yui/3.11.0/cache-base/cache-base.js | JavaScript | mit | 11,576 |
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.registerHelper("fold", "indent", function(cm, start) {
var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
if (!/\S/.test(firstLine)) return;
var getIndent = function(line) {
return CodeMirror.countColumn(line, null, tabSize);
};
var myIndent = getIndent(firstLine);
var lastLineInFold = null;
// Go through lines until we find a line that definitely doesn't belong in
// the block we're folding, or to the end.
for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) {
var curLine = cm.getLine(i);
var curIndent = getIndent(curLine);
if (curIndent > myIndent) {
// Lines with a greater indent are considered part of the block.
lastLineInFold = i;
} else if (!/\S/.test(curLine)) {
// Empty lines might be breaks within the block we're trying to fold.
} else {
// A non-empty line at an indent equal to or less than ours marks the
// start of another block.
break;
}
}
if (lastLineInFold) return {
from: CodeMirror.Pos(start.line, firstLine.length),
to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length)
};
});
});
| maruilian11/cdnjs | ajax/libs/codemirror/4.7.0/addon/fold/indent-fold.js | JavaScript | mit | 1,627 |
;(function () { // closure for web browsers
if (typeof module === 'object' && module.exports) {
module.exports = LRUCache
} else {
// just set the global for non-node platforms.
this.LRUCache = LRUCache
}
function hOP (obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key)
}
function naiveLength () { return 1 }
function LRUCache (options) {
if (!(this instanceof LRUCache))
return new LRUCache(options)
if (typeof options === 'number')
options = { max: options }
if (!options)
options = {}
this._max = options.max
// Kind of weird to have a default max of Infinity, but oh well.
if (!this._max || !(typeof this._max === "number") || this._max <= 0 )
this._max = Infinity
this._lengthCalculator = options.length || naiveLength
if (typeof this._lengthCalculator !== "function")
this._lengthCalculator = naiveLength
this._allowStale = options.stale || false
this._maxAge = options.maxAge || null
this._dispose = options.dispose
this.reset()
}
// resize the cache when the max changes.
Object.defineProperty(LRUCache.prototype, "max",
{ set : function (mL) {
if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity
this._max = mL
if (this._length > this._max) trim(this)
}
, get : function () { return this._max }
, enumerable : true
})
// resize the cache when the lengthCalculator changes.
Object.defineProperty(LRUCache.prototype, "lengthCalculator",
{ set : function (lC) {
if (typeof lC !== "function") {
this._lengthCalculator = naiveLength
this._length = this._itemCount
for (var key in this._cache) {
this._cache[key].length = 1
}
} else {
this._lengthCalculator = lC
this._length = 0
for (var key in this._cache) {
this._cache[key].length = this._lengthCalculator(this._cache[key].value)
this._length += this._cache[key].length
}
}
if (this._length > this._max) trim(this)
}
, get : function () { return this._lengthCalculator }
, enumerable : true
})
Object.defineProperty(LRUCache.prototype, "length",
{ get : function () { return this._length }
, enumerable : true
})
Object.defineProperty(LRUCache.prototype, "itemCount",
{ get : function () { return this._itemCount }
, enumerable : true
})
LRUCache.prototype.forEach = function (fn, thisp) {
thisp = thisp || this
var i = 0;
for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
i++
var hit = this._lruList[k]
if (this._maxAge && (Date.now() - hit.now > this._maxAge)) {
del(this, hit)
if (!this._allowStale) hit = undefined
}
if (hit) {
fn.call(thisp, hit.value, hit.key, this)
}
}
}
LRUCache.prototype.keys = function () {
var keys = new Array(this._itemCount)
var i = 0
for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
var hit = this._lruList[k]
keys[i++] = hit.key
}
return keys
}
LRUCache.prototype.values = function () {
var values = new Array(this._itemCount)
var i = 0
for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
var hit = this._lruList[k]
values[i++] = hit.value
}
return values
}
LRUCache.prototype.reset = function () {
if (this._dispose && this._cache) {
for (var k in this._cache) {
this._dispose(k, this._cache[k].value)
}
}
this._cache = Object.create(null) // hash of items by key
this._lruList = Object.create(null) // list of items in order of use recency
this._mru = 0 // most recently used
this._lru = 0 // least recently used
this._length = 0 // number of items in the list
this._itemCount = 0
}
// Provided for debugging/dev purposes only. No promises whatsoever that
// this API stays stable.
LRUCache.prototype.dump = function () {
return this._cache
}
LRUCache.prototype.dumpLru = function () {
return this._lruList
}
LRUCache.prototype.set = function (key, value) {
if (hOP(this._cache, key)) {
// dispose of the old one before overwriting
if (this._dispose) this._dispose(key, this._cache[key].value)
if (this._maxAge) this._cache[key].now = Date.now()
this._cache[key].value = value
this.get(key)
return true
}
var len = this._lengthCalculator(value)
var age = this._maxAge ? Date.now() : 0
var hit = new Entry(key, value, this._mru++, len, age)
// oversized objects fall out of cache automatically.
if (hit.length > this._max) {
if (this._dispose) this._dispose(key, value)
return false
}
this._length += hit.length
this._lruList[hit.lu] = this._cache[key] = hit
this._itemCount ++
if (this._length > this._max) trim(this)
return true
}
LRUCache.prototype.has = function (key) {
if (!hOP(this._cache, key)) return false
var hit = this._cache[key]
if (this._maxAge && (Date.now() - hit.now > this._maxAge)) {
return false
}
return true
}
LRUCache.prototype.get = function (key) {
return get(this, key, true)
}
LRUCache.prototype.peek = function (key) {
return get(this, key, false)
}
LRUCache.prototype.pop = function () {
var hit = this._lruList[this._lru]
del(this, hit)
return hit || null
}
LRUCache.prototype.del = function (key) {
del(this, this._cache[key])
}
function get (self, key, doUse) {
var hit = self._cache[key]
if (hit) {
if (self._maxAge && (Date.now() - hit.now > self._maxAge)) {
del(self, hit)
if (!self._allowStale) hit = undefined
} else {
if (doUse) use(self, hit)
}
if (hit) hit = hit.value
}
return hit
}
function use (self, hit) {
shiftLU(self, hit)
hit.lu = self._mru ++
self._lruList[hit.lu] = hit
}
function trim (self) {
while (self._lru < self._mru && self._length > self._max)
del(self, self._lruList[self._lru])
}
function shiftLU (self, hit) {
delete self._lruList[ hit.lu ]
while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++
}
function del (self, hit) {
if (hit) {
if (self._dispose) self._dispose(hit.key, hit.value)
self._length -= hit.length
self._itemCount --
delete self._cache[ hit.key ]
shiftLU(self, hit)
}
}
// classy, since V8 prefers predictable objects.
function Entry (key, value, lu, length, now) {
this.key = key
this.value = value
this.lu = lu
this.length = length
this.now = now
}
})()
| venoma333/eveapp | node_modules/gulp/node_modules/liftoff/node_modules/findup-sync/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js | JavaScript | mit | 6,445 |
// different ways to id objects
// use a req/res pair, since it's crazy deep and cyclical
// sparseFE10 and sigmund are usually pretty close, which is to be expected,
// since they are essentially the same algorithm, except that sigmund handles
// regular expression objects properly.
var http = require('http')
var util = require('util')
var sigmund = require('./sigmund.js')
var sreq, sres, creq, cres, test
http.createServer(function (q, s) {
sreq = q
sres = s
sres.end('ok')
this.close(function () { setTimeout(function () {
start()
}, 200) })
}).listen(1337, function () {
creq = http.get({ port: 1337 })
creq.on('response', function (s) { cres = s })
})
function start () {
test = [sreq, sres, creq, cres]
// test = sreq
// sreq.sres = sres
// sreq.creq = creq
// sreq.cres = cres
for (var i in exports.compare) {
console.log(i)
var hash = exports.compare[i]()
console.log(hash)
console.log(hash.length)
console.log('')
}
require('bench').runMain()
}
function customWs (obj, md, d) {
d = d || 0
var to = typeof obj
if (to === 'undefined' || to === 'function' || to === null) return ''
if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '')
if (Array.isArray(obj)) {
return obj.map(function (i, _, __) {
return customWs(i, md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
var keys = Object.keys(obj)
return keys.map(function (k, _, __) {
return k + ':' + customWs(obj[k], md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
function custom (obj, md, d) {
d = d || 0
var to = typeof obj
if (to === 'undefined' || to === 'function' || to === null) return ''
if (d > md || !obj || to !== 'object') return '' + obj
if (Array.isArray(obj)) {
return obj.map(function (i, _, __) {
return custom(i, md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
var keys = Object.keys(obj)
return keys.map(function (k, _, __) {
return k + ':' + custom(obj[k], md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
function sparseFE2 (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
Object.keys(v).forEach(function (k, _, __) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') return
var to = typeof v[k]
if (to === 'function' || to === 'undefined') return
soFar += k + ':'
ch(v[k], depth + 1)
})
soFar += '}'
}
ch(obj, 0)
return soFar
}
function sparseFE (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
Object.keys(v).forEach(function (k, _, __) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') return
var to = typeof v[k]
if (to === 'function' || to === 'undefined') return
soFar += k
ch(v[k], depth + 1)
})
}
ch(obj, 0)
return soFar
}
function sparse (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
for (var k in v) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') continue
var to = typeof v[k]
if (to === 'function' || to === 'undefined') continue
soFar += k
ch(v[k], depth + 1)
}
}
ch(obj, 0)
return soFar
}
function noCommas (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
for (var k in v) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') continue
var to = typeof v[k]
if (to === 'function' || to === 'undefined') continue
soFar += k + ':'
ch(v[k], depth + 1)
}
soFar += '}'
}
ch(obj, 0)
return soFar
}
function flatten (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
for (var k in v) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') continue
var to = typeof v[k]
if (to === 'function' || to === 'undefined') continue
soFar += k + ':'
ch(v[k], depth + 1)
soFar += ','
}
soFar += '}'
}
ch(obj, 0)
return soFar
}
exports.compare =
{
// 'custom 2': function () {
// return custom(test, 2, 0)
// },
// 'customWs 2': function () {
// return customWs(test, 2, 0)
// },
'JSON.stringify (guarded)': function () {
var seen = []
return JSON.stringify(test, function (k, v) {
if (typeof v !== 'object' || !v) return v
if (seen.indexOf(v) !== -1) return undefined
seen.push(v)
return v
})
},
'flatten 10': function () {
return flatten(test, 10)
},
// 'flattenFE 10': function () {
// return flattenFE(test, 10)
// },
'noCommas 10': function () {
return noCommas(test, 10)
},
'sparse 10': function () {
return sparse(test, 10)
},
'sparseFE 10': function () {
return sparseFE(test, 10)
},
'sparseFE2 10': function () {
return sparseFE2(test, 10)
},
sigmund: function() {
return sigmund(test, 10)
},
// 'util.inspect 1': function () {
// return util.inspect(test, false, 1, false)
// },
// 'util.inspect undefined': function () {
// util.inspect(test)
// },
// 'util.inspect 2': function () {
// util.inspect(test, false, 2, false)
// },
// 'util.inspect 3': function () {
// util.inspect(test, false, 3, false)
// },
// 'util.inspect 4': function () {
// util.inspect(test, false, 4, false)
// },
// 'util.inspect Infinity': function () {
// util.inspect(test, false, Infinity, false)
// }
}
/** results
**/
| carlosmarte/grunt-git-ftp | node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js | JavaScript | mit | 6,918 |
// different ways to id objects
// use a req/res pair, since it's crazy deep and cyclical
// sparseFE10 and sigmund are usually pretty close, which is to be expected,
// since they are essentially the same algorithm, except that sigmund handles
// regular expression objects properly.
var http = require('http')
var util = require('util')
var sigmund = require('./sigmund.js')
var sreq, sres, creq, cres, test
http.createServer(function (q, s) {
sreq = q
sres = s
sres.end('ok')
this.close(function () { setTimeout(function () {
start()
}, 200) })
}).listen(1337, function () {
creq = http.get({ port: 1337 })
creq.on('response', function (s) { cres = s })
})
function start () {
test = [sreq, sres, creq, cres]
// test = sreq
// sreq.sres = sres
// sreq.creq = creq
// sreq.cres = cres
for (var i in exports.compare) {
console.log(i)
var hash = exports.compare[i]()
console.log(hash)
console.log(hash.length)
console.log('')
}
require('bench').runMain()
}
function customWs (obj, md, d) {
d = d || 0
var to = typeof obj
if (to === 'undefined' || to === 'function' || to === null) return ''
if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '')
if (Array.isArray(obj)) {
return obj.map(function (i, _, __) {
return customWs(i, md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
var keys = Object.keys(obj)
return keys.map(function (k, _, __) {
return k + ':' + customWs(obj[k], md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
function custom (obj, md, d) {
d = d || 0
var to = typeof obj
if (to === 'undefined' || to === 'function' || to === null) return ''
if (d > md || !obj || to !== 'object') return '' + obj
if (Array.isArray(obj)) {
return obj.map(function (i, _, __) {
return custom(i, md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
var keys = Object.keys(obj)
return keys.map(function (k, _, __) {
return k + ':' + custom(obj[k], md, d + 1)
}).reduce(function (a, b) { return a + b }, '')
}
function sparseFE2 (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
Object.keys(v).forEach(function (k, _, __) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') return
var to = typeof v[k]
if (to === 'function' || to === 'undefined') return
soFar += k + ':'
ch(v[k], depth + 1)
})
soFar += '}'
}
ch(obj, 0)
return soFar
}
function sparseFE (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
Object.keys(v).forEach(function (k, _, __) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') return
var to = typeof v[k]
if (to === 'function' || to === 'undefined') return
soFar += k
ch(v[k], depth + 1)
})
}
ch(obj, 0)
return soFar
}
function sparse (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
for (var k in v) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') continue
var to = typeof v[k]
if (to === 'function' || to === 'undefined') continue
soFar += k
ch(v[k], depth + 1)
}
}
ch(obj, 0)
return soFar
}
function noCommas (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
for (var k in v) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') continue
var to = typeof v[k]
if (to === 'function' || to === 'undefined') continue
soFar += k + ':'
ch(v[k], depth + 1)
}
soFar += '}'
}
ch(obj, 0)
return soFar
}
function flatten (obj, maxDepth) {
var seen = []
var soFar = ''
function ch (v, depth) {
if (depth > maxDepth) return
if (typeof v === 'function' || typeof v === 'undefined') return
if (typeof v !== 'object' || !v) {
soFar += v
return
}
if (seen.indexOf(v) !== -1 || depth === maxDepth) return
seen.push(v)
soFar += '{'
for (var k in v) {
// pseudo-private values. skip those.
if (k.charAt(0) === '_') continue
var to = typeof v[k]
if (to === 'function' || to === 'undefined') continue
soFar += k + ':'
ch(v[k], depth + 1)
soFar += ','
}
soFar += '}'
}
ch(obj, 0)
return soFar
}
exports.compare =
{
// 'custom 2': function () {
// return custom(test, 2, 0)
// },
// 'customWs 2': function () {
// return customWs(test, 2, 0)
// },
'JSON.stringify (guarded)': function () {
var seen = []
return JSON.stringify(test, function (k, v) {
if (typeof v !== 'object' || !v) return v
if (seen.indexOf(v) !== -1) return undefined
seen.push(v)
return v
})
},
'flatten 10': function () {
return flatten(test, 10)
},
// 'flattenFE 10': function () {
// return flattenFE(test, 10)
// },
'noCommas 10': function () {
return noCommas(test, 10)
},
'sparse 10': function () {
return sparse(test, 10)
},
'sparseFE 10': function () {
return sparseFE(test, 10)
},
'sparseFE2 10': function () {
return sparseFE2(test, 10)
},
sigmund: function() {
return sigmund(test, 10)
},
// 'util.inspect 1': function () {
// return util.inspect(test, false, 1, false)
// },
// 'util.inspect undefined': function () {
// util.inspect(test)
// },
// 'util.inspect 2': function () {
// util.inspect(test, false, 2, false)
// },
// 'util.inspect 3': function () {
// util.inspect(test, false, 3, false)
// },
// 'util.inspect 4': function () {
// util.inspect(test, false, 4, false)
// },
// 'util.inspect Infinity': function () {
// util.inspect(test, false, Infinity, false)
// }
}
/** results
**/
| infsci2560sp16/full-stack-web-project-Yishi1215 | node_modules/grunt-contrib-jshint/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js | JavaScript | mit | 6,918 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Doctrine;
use Doctrine\Common\EventArgs;
use Doctrine\Common\EventManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Allows lazy loading of listener services.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class ContainerAwareEventManager extends EventManager
{
/**
* Map of registered listeners.
*
* <event> => <listeners>
*
* @var array
*/
private $listeners = array();
private $initialized = array();
private $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
/**
* Dispatches an event to all registered listeners.
*
* @param string $eventName The name of the event to dispatch. The name of the event is
* the name of the method that is invoked on listeners.
* @param EventArgs $eventArgs The event arguments to pass to the event handlers/listeners.
* If not supplied, the single empty EventArgs instance is used.
*
* @return bool
*/
public function dispatchEvent($eventName, EventArgs $eventArgs = null)
{
if (isset($this->listeners[$eventName])) {
$eventArgs = null === $eventArgs ? EventArgs::getEmptyInstance() : $eventArgs;
$initialized = isset($this->initialized[$eventName]);
foreach ($this->listeners[$eventName] as $hash => $listener) {
if (!$initialized && is_string($listener)) {
$this->listeners[$eventName][$hash] = $listener = $this->container->get($listener);
}
$listener->$eventName($eventArgs);
}
$this->initialized[$eventName] = true;
}
}
/**
* Gets the listeners of a specific event or all listeners.
*
* @param string $event The name of the event
*
* @return array The event listeners for the specified event, or all event listeners
*/
public function getListeners($event = null)
{
return $event ? $this->listeners[$event] : $this->listeners;
}
/**
* Checks whether an event has any registered listeners.
*
* @param string $event
*
* @return bool TRUE if the specified event has any listeners, FALSE otherwise
*/
public function hasListeners($event)
{
return isset($this->listeners[$event]) && $this->listeners[$event];
}
/**
* Adds an event listener that listens on the specified events.
*
* @param string|array $events The event(s) to listen on
* @param object|string $listener The listener object
*
* @throws \RuntimeException
*/
public function addEventListener($events, $listener)
{
if (is_string($listener)) {
if ($this->initialized) {
throw new \RuntimeException('Adding lazy-loading listeners after construction is not supported.');
}
$hash = '_service_'.$listener;
} else {
// Picks the hash code related to that listener
$hash = spl_object_hash($listener);
}
foreach ((array) $events as $event) {
// Overrides listener if a previous one was associated already
// Prevents duplicate listeners on same event (same instance only)
$this->listeners[$event][$hash] = $listener;
}
}
/**
* Removes an event listener from the specified events.
*
* @param string|array $events
* @param object|string $listener
*/
public function removeEventListener($events, $listener)
{
if (is_string($listener)) {
$hash = '_service_'.$listener;
} else {
// Picks the hash code related to that listener
$hash = spl_object_hash($listener);
}
foreach ((array) $events as $event) {
// Check if actually have this listener associated
if (isset($this->listeners[$event][$hash])) {
unset($this->listeners[$event][$hash]);
}
}
}
}
| adiIspas/Hootsuite_Backend_API | web_server/code/vendor/symfony/symfony/src/Symfony/Bridge/Doctrine/ContainerAwareEventManager.php | PHP | mit | 4,418 |
// Type definitions for jQuery Sortable v0.9.12
// Project: http://johnny.github.io/jquery-sortable/
// Definitions by: Nathan Pitman <https://github.com/Seltzer>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
declare module JQuerySortable {
interface Position {
top: number;
left: number;
}
type Dimensions = number[];
interface ContainerGroup {
$document: JQuery;
containerDimensions: Dimensions[]
containers: Container[];
delayMet: boolean;
dragInitDone: boolean;
dragProxy: any;
dragging: boolean;
dropProxy: any;
item: JQuery;
itemContainer: Container;
lastAppendedItem: JQuery;
lastPointer: Position;
lastRelativePointer: Position;
offsetParent: JQuery;
options: Options;
placeholder: JQuery;
pointer: Position;
relativePointer: Position;
sameResultBox: { bottom: number; left: number; right: number; top: number; };
scrollProxy: any;
}
interface Container {
el: JQuery;
options: Options;
group: ContainerGroup;
rootGroup: ContainerGroup;
handle: string;
target: JQuery;
itemDimensions: Dimensions[];
items: HTMLElement[];
}
type GenericEventHandler = ($item?: JQuery, container?: Container, _super?: GenericEventHandler, event?: Event) => void;
type OnDragEventHandler = ($item?: JQuery, position?: Position, _super?: OnDragEventHandler, event?: Event) => void;
type OnMousedownHandler = ($item?: JQuery, _super?: OnMousedownHandler, event?: Event) => void;
type OnCancelHandler = ($item?: JQuery, container?: Container, _super?: OnCancelHandler, event?: Event) => void;
// Deliberately typing $children as an any here as it makes it much easier to use. Actual type is JQuery | any[]
type SerializeFunc = ($parent: JQuery, $children: any, parentIsContainer: boolean) => void;
interface GroupOptions {
afterMove?: ($placeholder: JQuery, container: Container, $closestItemOrContainer: JQuery) => void;
containerPath?: string;
containerSelector?: string;
distance?: number;
delay?: number;
handle?: string;
itemPath?: string;
itemSelector?: string;
isValidTarget?: ($item: JQuery, container: Container) => boolean;
onCancel?: OnCancelHandler;
onDrag?: OnDragEventHandler;
onDragStart?: GenericEventHandler;
onDrop?: GenericEventHandler;
onMousedown?: OnMousedownHandler;
placeholder?: JQuery | any[] | Element | string;
pullPlaceholder?: boolean;
serialize?: SerializeFunc;
tolerance?: number;
}
interface ContainerOptions {
drag?: boolean;
drop?: boolean;
exclude?: string;
nested?: boolean;
vertical?: boolean;
}
interface Options extends GroupOptions, ContainerOptions {
group?: string;
}
}
interface JQuery {
sortable(methodName: 'enable'): JQuery;
sortable(methodName: 'disable'): JQuery;
sortable(methodName: 'refresh'): JQuery;
sortable(methodName: 'destroy'): JQuery;
sortable(methodName: 'serialize'): JQuery;
sortable(methodName: string): JQuery;
sortable(options?: JQuerySortable.Options): JQuery;
}
| kuon/DefinitelyTyped | jquery-sortable/jquery-sortable.d.ts | TypeScript | mit | 3,026 |
/*
*
* 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 argscheck = require('cordova/argscheck'),
exec = require('cordova/exec'),
Camera = require('./Camera');
// XXX: commented out
//CameraPopoverHandle = require('./CameraPopoverHandle');
/**
* @namespace navigator
*/
/**
* @exports camera
*/
var cameraExport = {};
// Tack on the Camera Constants to the base camera plugin.
for (var key in Camera) {
cameraExport[key] = Camera[key];
}
/**
* Callback function that provides an error message.
* @callback module:camera.onError
* @param {string} message - The message is provided by the device's native code.
*/
/**
* Callback function that provides the image data.
* @callback module:camera.onSuccess
* @param {string} imageData - Base64 encoding of the image data, _or_ the image file URI, depending on [`cameraOptions`]{@link module:camera.CameraOptions} in effect.
* @example
* // Show image
* //
* function cameraCallback(imageData) {
* var image = document.getElementById('myImage');
* image.src = "data:image/jpeg;base64," + imageData;
* }
*/
/**
* Optional parameters to customize the camera settings.
* * [Quirks](#CameraOptions-quirks)
* @typedef module:camera.CameraOptions
* @type {Object}
* @property {number} [quality=50] - Quality of the saved image, expressed as a range of 0-100, where 100 is typically full resolution with no loss from file compression. (Note that information about the camera's resolution is unavailable.)
* @property {module:Camera.DestinationType} [destinationType=FILE_URI] - Choose the format of the return value.
* @property {module:Camera.PictureSourceType} [sourceType=CAMERA] - Set the source of the picture.
* @property {Boolean} [allowEdit=true] - Allow simple editing of image before selection.
* @property {module:Camera.EncodingType} [encodingType=JPEG] - Choose the returned image file's encoding.
* @property {number} [targetWidth] - Width in pixels to scale image. Must be used with `targetHeight`. Aspect ratio remains constant.
* @property {number} [targetHeight] - Height in pixels to scale image. Must be used with `targetWidth`. Aspect ratio remains constant.
* @property {module:Camera.MediaType} [mediaType=PICTURE] - Set the type of media to select from. Only works when `PictureSourceType` is `PHOTOLIBRARY` or `SAVEDPHOTOALBUM`.
* @property {Boolean} [correctOrientation] - Rotate the image to correct for the orientation of the device during capture.
* @property {Boolean} [saveToPhotoAlbum] - Save the image to the photo album on the device after capture.
* @property {module:CameraPopoverOptions} [popoverOptions] - iOS-only options that specify popover location in iPad.
* @property {module:Camera.Direction} [cameraDirection=BACK] - Choose the camera to use (front- or back-facing).
*/
/**
* @description Takes a photo using the camera, or retrieves a photo from the device's
* image gallery. The image is passed to the success callback as a
* Base64-encoded `String`, or as the URI for the image file.
*
* The `camera.getPicture` function opens the device's default camera
* application that allows users to snap pictures by default - this behavior occurs,
* when `Camera.sourceType` equals [`Camera.PictureSourceType.CAMERA`]{@link module:Camera.PictureSourceType}.
* Once the user snaps the photo, the camera application closes and the application is restored.
*
* If `Camera.sourceType` is `Camera.PictureSourceType.PHOTOLIBRARY` or
* `Camera.PictureSourceType.SAVEDPHOTOALBUM`, then a dialog displays
* that allows users to select an existing image. The
* `camera.getPicture` function returns a [`CameraPopoverHandle`]{@link module:CameraPopoverHandle} object,
* which can be used to reposition the image selection dialog, for
* example, when the device orientation changes.
*
* The return value is sent to the [`cameraSuccess`]{@link module:camera.onSuccess} callback function, in
* one of the following formats, depending on the specified
* `cameraOptions`:
*
* - A `String` containing the Base64-encoded photo image.
*
* - A `String` representing the image file location on local storage (default).
*
* You can do whatever you want with the encoded image or URI, for
* example:
*
* - Render the image in an `<img>` tag, as in the example below
*
* - Save the data locally (`LocalStorage`, [Lawnchair](http://brianleroux.github.com/lawnchair/), etc.)
*
* - Post the data to a remote server
*
* __NOTE__: Photo resolution on newer devices is quite good. Photos
* selected from the device's gallery are not downscaled to a lower
* quality, even if a `quality` parameter is specified. To avoid common
* memory problems, set `Camera.destinationType` to `FILE_URI` rather
* than `DATA_URL`.
*
* __Supported Platforms__
*
* - Android
* - BlackBerry
* - Browser
* - Firefox
* - FireOS
* - iOS
* - Windows
* - WP8
* - Ubuntu
*
* More examples [here](#camera-getPicture-examples). Quirks [here](#camera-getPicture-quirks).
*
* @example
* navigator.camera.getPicture(cameraSuccess, cameraError, cameraOptions);
* @param {module:camera.onSuccess} successCallback
* @param {module:camera.onError} errorCallback
* @param {module:camera.CameraOptions} options CameraOptions
*/
cameraExport.getPicture = function(successCallback, errorCallback, options) {
argscheck.checkArgs('fFO', 'Camera.getPicture', arguments);
options = options || {};
var getValue = argscheck.getValue;
var quality = getValue(options.quality, 50);
var destinationType = getValue(options.destinationType, Camera.DestinationType.FILE_URI);
var sourceType = getValue(options.sourceType, Camera.PictureSourceType.CAMERA);
var targetWidth = getValue(options.targetWidth, -1);
var targetHeight = getValue(options.targetHeight, -1);
var encodingType = getValue(options.encodingType, Camera.EncodingType.JPEG);
var mediaType = getValue(options.mediaType, Camera.MediaType.PICTURE);
var allowEdit = !!options.allowEdit;
var correctOrientation = !!options.correctOrientation;
var saveToPhotoAlbum = !!options.saveToPhotoAlbum;
var popoverOptions = getValue(options.popoverOptions, null);
var cameraDirection = getValue(options.cameraDirection, Camera.Direction.BACK);
var args = [quality, destinationType, sourceType, targetWidth, targetHeight, encodingType,
mediaType, allowEdit, correctOrientation, saveToPhotoAlbum, popoverOptions, cameraDirection];
exec(successCallback, errorCallback, "Camera", "takePicture", args);
// XXX: commented out
//return new CameraPopoverHandle();
};
/**
* Removes intermediate image files that are kept in temporary storage
* after calling [`camera.getPicture`]{@link module:camera.getPicture}. Applies only when the value of
* `Camera.sourceType` equals `Camera.PictureSourceType.CAMERA` and the
* `Camera.destinationType` equals `Camera.DestinationType.FILE_URI`.
*
* __Supported Platforms__
*
* - iOS
*
* @example
* navigator.camera.cleanup(onSuccess, onFail);
*
* function onSuccess() {
* console.log("Camera cleanup success.")
* }
*
* function onFail(message) {
* alert('Failed because: ' + message);
* }
*/
cameraExport.cleanup = function(successCallback, errorCallback) {
exec(successCallback, errorCallback, "Camera", "cleanup", []);
};
module.exports = cameraExport;
| Zaphyk/crypto-price | plugins/cordova-plugin-camera/www/Camera.js | JavaScript | mit | 8,155 |
require 'test_helper'
class DwollaReturnTest < Test::Unit::TestCase
include ActiveMerchant::Billing::Integrations
def setup
@checkout_failed = Dwolla::Return.new(http_raw_data_failed_checkout, {:credential3 => '62hdv0jBjsBlD+0AmhVn9pQuULSC661AGo2SsksQTpqNUrff7Z'})
@callback_failed = Dwolla::Return.new(http_raw_data_failed_callback, {:credential3 => '62hdv0jBjsBlD+0AmhVn9pQuULSC661AGo2SsksQTpqNUrff7Z'})
@success = Dwolla::Return.new(http_raw_data_success, {:credential3 => '62hdv0jBjsBlD+0AmhVn9pQuULSC661AGo2SsksQTpqNUrff7Z'})
end
def test_success_return
assert @success.success?
end
def test_success_accessors
assert_equal "ac5b910a-7ec1-4b65-9f68-90449ed030f6", @success.checkout_id
assert_equal "3165397", @success.transaction
assert_false @success.test?
end
def test_failed_callback_return
assert_false @callback_failed.success?
end
def test_failed_callback_accessors
assert_equal "ac5b910a-7ec1-4b65-9f68-90449ed030f6", @callback_failed.checkout_id
assert_equal "3165397", @callback_failed.transaction
assert @callback_failed.test?
end
def test_checkout_failed_return
assert_false @callback_failed.success?
end
def test_checkout_failed_accessors
assert_equal "failure", @checkout_failed.error
assert_equal "User Cancelled", @checkout_failed.error_description
end
private
def http_raw_data_success
"signature=7d4c5deaf9178faae7c437fd8693fc0b97b1b22b&orderId=abc123&amount=0.01&checkoutId=ac5b910a-7ec1-4b65-9f68-90449ed030f6&status=Completed&clearingDate=6/8/2013%208:07:41%20PM&transaction=3165397&postback=success"
end
def http_raw_data_failed_callback
"signature=7d4c5deaf9178faae7c437fd8693fc0b97b1b22b&orderId=abc123&amount=0.01&checkoutId=ac5b910a-7ec1-4b65-9f68-90449ed030f6&status=Completed&clearingDate=6/8/2013%208:07:41%20PM&transaction=3165397&postback=failure&test=true"
end
def http_raw_data_failed_checkout
"error=failure&error_description=User+Cancelled"
end
end | sunilgowda/active_merchant | test/unit/integrations/returns/dwolla_return_test.rb | Ruby | mit | 2,010 |
define("ace/theme/dawn",["require","exports","module","ace/lib/dom"],function(e,t,n){t.isDark=!1,t.cssClass="ace-dawn",t.cssText=".ace-dawn .ace_gutter {background: #ebebeb;color: #333}.ace-dawn .ace_print-margin {width: 1px;background: #e8e8e8}.ace-dawn {background-color: #F9F9F9;color: #080808}.ace-dawn .ace_cursor {border-left: 2px solid #000000}.ace-dawn .ace_overwrite-cursors .ace_cursor {border-left: 0px;border-bottom: 1px solid #000000}.ace-dawn .ace_marker-layer .ace_selection {background: rgba(39, 95, 255, 0.30)}.ace-dawn.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px #F9F9F9;border-radius: 2px}.ace-dawn .ace_marker-layer .ace_step {background: rgb(255, 255, 0)}.ace-dawn .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgba(75, 75, 126, 0.50)}.ace-dawn .ace_marker-layer .ace_active-line {background: rgba(36, 99, 180, 0.12)}.ace-dawn .ace_gutter-active-line {background-color : #dcdcdc}.ace-dawn .ace_marker-layer .ace_selected-word {border: 1px solid rgba(39, 95, 255, 0.30)}.ace-dawn .ace_invisible {color: rgba(75, 75, 126, 0.50)}.ace-dawn .ace_keyword,.ace-dawn .ace_meta {color: #794938}.ace-dawn .ace_constant,.ace-dawn .ace_constant.ace_character,.ace-dawn .ace_constant.ace_character.ace_escape,.ace-dawn .ace_constant.ace_other {color: #811F24}.ace-dawn .ace_invalid.ace_illegal {text-decoration: underline;font-style: italic;color: #F8F8F8;background-color: #B52A1D}.ace-dawn .ace_invalid.ace_deprecated {text-decoration: underline;font-style: italic;color: #B52A1D}.ace-dawn .ace_support {color: #691C97}.ace-dawn .ace_support.ace_constant {color: #B4371F}.ace-dawn .ace_fold {background-color: #794938;border-color: #080808}.ace-dawn .ace_markup.ace_list,.ace-dawn .ace_support.ace_function {color: #693A17}.ace-dawn .ace_storage {font-style: italic;color: #A71D5D}.ace-dawn .ace_string {color: #0B6125}.ace-dawn .ace_string.ace_regexp {color: #CF5628}.ace-dawn .ace_comment {font-style: italic;color: #5A525F}.ace-dawn .ace_variable {color: #234A97}.ace-dawn .ace_markup.ace_underline {text-decoration: underline}.ace-dawn .ace_markup.ace_heading {color: #19356D}.ace-dawn .ace_indent-guide {background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGBgYLh/5+x/AAizA4hxNNsZAAAAAElFTkSuQmCC) right repeat-y;}";var r=e("../lib/dom");r.importCssString(t.cssText,t.cssClass)}) | CosmicWebServices/cdnjs | ajax/libs/ace/1.1.1/theme-dawn.js | JavaScript | mit | 2,388 |
.note-editor{border:1px solid #a9a9a9}.note-editor .note-dropzone{position:absolute;z-index:1;display:none;color:#87cefa;background-color:white;border:2px dashed #87cefa;opacity:.95;pointer-event:none}.note-editor .note-dropzone .note-dropzone-message{display:table-cell;font-size:28px;font-weight:bold;text-align:center;vertical-align:middle}.note-editor .note-dropzone.hover{color:#098ddf;border:2px dashed #098ddf}.note-editor.dragover .note-dropzone{display:table}.note-editor.fullscreen{position:fixed;top:0;left:0;z-index:1050;width:100%}.note-editor.fullscreen .note-editable{background-color:white}.note-editor.fullscreen .note-resizebar{display:none}.note-editor.codeview .note-editable{display:none}.note-editor.codeview .note-codable{display:block}.note-editor .note-toolbar{padding-bottom:5px;padding-left:5px;margin:0;background-color:#f5f5f5;border-bottom:1px solid #a9a9a9}.note-editor .note-toolbar>.btn-group{margin-top:5px;margin-right:5px;margin-left:0}.note-editor .note-toolbar .note-table .dropdown-menu{min-width:0;padding:5px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker{font-size:18px}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-mousecatcher{position:absolute!important;z-index:3;width:10em;height:10em;cursor:pointer}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-unhighlighted{position:relative!important;z-index:1;width:5em;height:5em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-editor .note-toolbar .note-table .dropdown-menu .note-dimension-picker .note-dimension-picker-highlighted{position:absolute!important;z-index:2;width:1em;height:1em;background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIjd6vvD2f9LKLW+AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKwNDEVT0AAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC') repeat}.note-editor .note-toolbar .note-style h1,.note-editor .note-toolbar .note-style h2,.note-editor .note-toolbar .note-style h3,.note-editor .note-toolbar .note-style h4,.note-editor .note-toolbar .note-style h5,.note-editor .note-toolbar .note-style h6,.note-editor .note-toolbar .note-style blockquote{margin:0}.note-editor .note-toolbar .note-color .dropdown-toggle{width:20px;padding-left:5px}.note-editor .note-toolbar .note-color .dropdown-menu{min-width:290px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group{margin:0}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group:first-child{margin:0 5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-palette-title{margin:2px 7px;font-size:12px;text-align:center;border-bottom:1px solid #eee}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset{padding:0 3px;margin:5px;font-size:12px;cursor:pointer;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.note-editor .note-toolbar .note-color .dropdown-menu .btn-group .note-color-reset:hover{background:#eee}.note-editor .note-toolbar .note-para .dropdown-menu{min-width:153px;padding:5px}.note-editor .note-toolbar .note-para li:first-child{margin-bottom:5px}.note-editor .note-statusbar{background-color:#f5f5f5}.note-editor .note-statusbar .note-resizebar{width:100%;height:8px;cursor:s-resize;border-top:1px solid #a9a9a9}.note-editor .note-statusbar .note-resizebar .note-icon-bar{width:20px;margin:1px auto;border-top:1px solid #a9a9a9}.note-editor .note-popover .popover{max-width:none}.note-editor .note-popover .popover .popover-content{padding:5px}.note-editor .note-popover .popover .popover-content a{display:inline-block;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}.note-editor .note-popover .popover .popover-content .btn-group+.btn-group{margin-left:5px}.note-editor .note-popover .popover .arrow{left:20px}.note-editor .note-handle .note-control-selection{position:absolute;display:none;border:1px solid black}.note-editor .note-handle .note-control-selection>div{position:absolute}.note-editor .note-handle .note-control-selection .note-control-selection-bg{width:100%;height:100%;background-color:black;-webkit-opacity:.3;-khtml-opacity:.3;-moz-opacity:.3;opacity:.3;-ms-filter:alpha(opacity=30);filter:alpha(opacity=30)}.note-editor .note-handle .note-control-selection .note-control-handle{width:7px;height:7px;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-holder{width:7px;height:7px;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-sizing{width:7px;height:7px;background-color:white;border:1px solid black}.note-editor .note-handle .note-control-selection .note-control-nw{top:-5px;left:-5px;border-right:0;border-bottom:0}.note-editor .note-handle .note-control-selection .note-control-ne{top:-5px;right:-5px;border-bottom:0;border-left:none}.note-editor .note-handle .note-control-selection .note-control-sw{bottom:-5px;left:-5px;border-top:0;border-right:0}.note-editor .note-handle .note-control-selection .note-control-se{right:-5px;bottom:-5px;cursor:se-resize}.note-editor .note-handle .note-control-selection .note-control-selection-info{right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:white;background-color:black;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-opacity:.7;-khtml-opacity:.7;-moz-opacity:.7;opacity:.7;-ms-filter:alpha(opacity=70);filter:alpha(opacity=70)}.note-editor .note-dialog>div{display:none}.note-editor .note-dialog .note-image-dialog .note-dropzone{min-height:100px;margin-bottom:10px;font-size:30px;line-height:4;color:lightgray;text-align:center;border:4px dashed lightgray}.note-editor .note-dialog .note-help-dialog{font-size:12px;color:#ccc;background:transparent;background-color:#222!important;border:0;-webkit-opacity:.9;-khtml-opacity:.9;-moz-opacity:.9;opacity:.9;-ms-filter:alpha(opacity=90);filter:alpha(opacity=90)}.note-editor .note-dialog .note-help-dialog .modal-content{background:transparent;border:1px solid white;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.note-editor .note-dialog .note-help-dialog a{font-size:12px;color:white}.note-editor .note-dialog .note-help-dialog .title{padding-bottom:5px;font-size:14px;font-weight:bold;color:white;border-bottom:white 1px solid}.note-editor .note-dialog .note-help-dialog .modal-close{font-size:14px;color:#dd0;cursor:pointer}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout{width:100%}.note-editor .note-dialog .note-help-dialog .note-shortcut-layout td{vertical-align:top}.note-editor .note-dialog .note-help-dialog .note-shortcut{margin-top:8px}.note-editor .note-dialog .note-help-dialog .note-shortcut th{font-size:13px;color:#dd0;text-align:left}.note-editor .note-dialog .note-help-dialog .note-shortcut td:first-child{min-width:110px;padding-right:10px;font-family:"Courier New";color:#dd0;text-align:right}.note-editor .note-editable{padding:10px;overflow:scroll;outline:0}.note-editor .note-codable{display:none;width:100%;padding:10px;margin-bottom:0;font-family:Menlo,Monaco,monospace,sans-serif;font-size:14px;color:#ccc;background-color:#222;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;box-shadow:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;resize:none}.note-editor .dropdown-menu{min-width:90px}.note-editor .dropdown-menu.right{right:0;left:auto}.note-editor .dropdown-menu.right::before{right:9px;left:auto!important}.note-editor .dropdown-menu.right::after{right:10px;left:auto!important}.note-editor .dropdown-menu li a i{color:deepskyblue;visibility:hidden}.note-editor .dropdown-menu li a.checked i{visibility:visible}.note-editor .note-fontsize-10{font-size:10px}.note-editor .note-color-palette{line-height:1}.note-editor .note-color-palette div .note-color-btn{width:17px;height:17px;padding:0;margin:0;border:1px solid #fff}.note-editor .note-color-palette div .note-color-btn:hover{border:1px solid #000} | is00hcw/cdnjs | ajax/libs/summernote/0.5.0/summernote.css | CSS | mit | 8,437 |
YUI.add("widget-buttons",function(e,t){function p(e){return!!e.getDOMNode}function d(){this._buttonsHandles={}}var n=e.Array,r=e.Lang,i=e.Object,s=e.Plugin.Button,o=e.Widget,u=e.WidgetStdMod,a=e.ClassNameManager.getClassName,f=r.isArray,l=r.isNumber,c=r.isString,h=r.isValue;d.ATTRS={buttons:{getter:"_getButtons",setter:"_setButtons",value:{}},defaultButton:{readOnly:!0,value:null}},d.CLASS_NAMES={button:a("button"),buttons:o.getClassName("buttons"),primary:a("button","primary")},d.HTML_PARSER={buttons:function(e){return this._parseButtons(e)}},d.NON_BUTTON_NODE_CFG=["action","classNames","context","events","isDefault","section"],d.prototype={BUTTONS:{},BUTTONS_TEMPLATE:"<span />",DEFAULT_BUTTONS_SECTION:u.FOOTER,initializer:function(){this._stdModNode||e.error("WidgetStdMod must be added to a Widget before WidgetButtons."),this._mapButtons(this.get("buttons")),this._updateDefaultButton(),this.after({buttonsChange:e.bind("_afterButtonsChange",this),defaultButtonChange:e.bind("_afterDefaultButtonChange",this)}),e.after(this._bindUIButtons,this,"bindUI"),e.after(this._syncUIButtons,this,"syncUI")},destructor:function(){i.each(this._buttonsHandles,function(e){e.detach()}),delete this._buttonsHandles,delete this._buttonsMap,delete this._defaultButton},addButton:function(e,t,r){var i=this.get("buttons"),s,o;return p(e)||(e=this._mergeButtonConfig(e),t||(t=e.section)),t||(t=this.DEFAULT_BUTTONS_SECTION),s=i[t]||(i[t]=[]),l(r)||(r=s.length),s.splice(r,0,e),o=n.indexOf(s,e),this.set("buttons",i,{button:e,section:t,index:o,src:"add"}),this},getButton:function(e,t){if(!h(e))return;var n=this._buttonsMap,r;return t||(t=this.DEFAULT_BUTTONS_SECTION),l(e)?(r=this.get("buttons"),r[t]&&r[t][e]):arguments.length>1?n[t+":"+e]:n[e]},removeButton:function(e,t){if(!h(e))return this;var r=this.get("buttons"),s;return l(e)?(t||(t=this.DEFAULT_BUTTONS_SECTION),s=e,e=r[t][s]):(c(e)&&(e=this.getButton.apply(this,arguments)),i.some(r,function(r,i){s=n.indexOf(r,e);if(s>-1)return t=i,!0})),e&&s>-1&&(r[t].splice(s,1),this.set("buttons",r,{button:e,section:t,index:s,src:"remove"})),this},_bindUIButtons:function(){var t=e.bind("_afterContentChangeButtons",this);this.after({visibleChange:e.bind("_afterVisibleChangeButtons",this),headerContentChange:t,bodyContentChange:t,footerContentChange:t})},_createButton:function(t){var r,i,o,u,a,f,l,h;if(p(t))return e.one(t.getDOMNode()).plug(s);r=e.merge({context:this,events:"click",label:t.value},t),i=e.merge(r),o=d.NON_BUTTON_NODE_CFG;for(u=0,a=o.length;u<a;u+=1)delete i[o[u]];return t=s.createNode(i),l=r.context,f=r.action,c(f)&&(f=e.bind(f,l)),h=t.on(r.events,f,l),this._buttonsHandles[e.stamp(t,!0)]=h,t.setData("name",this._getButtonName(r)),t.setData("default",this._getButtonDefault(r)),n.each(n(r.classNames),t.addClass,t),t},_getButtonContainer:function(t,n){var r=u.SECTION_CLASS_NAMES[t],i=d.CLASS_NAMES.buttons,s=this.get("contentBox"),o,a;return o="."+r+" ."+i,a=s.one(o),!a&&n&&(a=e.Node.create(this.BUTTONS_TEMPLATE),a.addClass(i)),a},_getButtonDefault:function(e){var t=p(e)?e.getData("default"):e.isDefault;return c(t)?t.toLowerCase()==="true":!!t},_getButtonName:function(e){var t;return p(e)?t=e.getData("name")||e.get("name"):t=e&&(e.name||e.type),t},_getButtons:function(e){var t={};return i.each(e,function(e,n){t[n]=e.concat()}),t},_mapButton:function(e,t){var n=this._buttonsMap,r=this._getButtonName(e),i=this._getButtonDefault(e);r&&(n[r]=e,n[t+":"+r]=e),i&&(this._defaultButton=e)},_mapButtons:function(e){this._buttonsMap={},this._defaultButton=null,i.each(e,function(e,t){var n,r;for(n=0,r=e.length;n<r;n+=1)this._mapButton(e[n],t)},this)},_mergeButtonConfig:function(t){var n,r,i,s,o,u;return t=c(t)?{name:t}:e.merge(t),t.srcNode&&(s=t.srcNode,o=s.get("tagName").toLowerCase(),u=s.get(o==="input"?"value":"text"),n={disabled:!!s.get("disabled"),isDefault:this._getButtonDefault(s),name:this._getButtonName(s)},u&&(n.label=u),e.mix(t,n,!1,null,0,!0)),i=this._getButtonName(t),r=this.BUTTONS&&this.BUTTONS[i],r&&e.mix(t,r,!1,null,0,!0),t},_parseButtons:function(e){var t="."+d.CLASS_NAMES.button,r=["header","body","footer"],i=null;return n.each(r,function(e){var n=this._getButtonContainer(e),r=n&&n.all(t),s;if(!r||r.isEmpty())return;s=[],r.each(function(e){s.push({srcNode:e})}),i||(i={}),i[e]=s},this),i},_setButtons:function(e){function r(e,r){if(!f(e))return;var i,s,o,u;for(i=0,s=e.length;i<s;i+=1)o=e[i],u=r,p(o)||(o=this._mergeButtonConfig(o),u||(u=o.section)),o=this._createButton(o),u||(u=t),(n[u]||(n[u]=[])).push(o)}var t=this.DEFAULT_BUTTONS_SECTION,n={};return f(e)?r.call(this,e):i.each(e,r,this),n},_syncUIButtons:function(){this._uiSetButtons(this.get("buttons")),this._uiSetDefaultButton(this.get("defaultButton")),this._uiSetVisibleButtons(this.get("visible"))},_uiInsertButton:function(e,t,n){var r=d.CLASS_NAMES.button,i=this._getButtonContainer(t,!0),s=i.all("."+r);i.insertBefore(e,s.item(n)),this.setStdModContent(t,i,"after")},_uiRemoveButton:function(t,n,r){var i=e.stamp(t,this),s=this._buttonsHandles,o=s[i],u,a;o&&o.detach(),delete s[i],t.remove(),r||(r={}),r.preserveContent||(u=this._getButtonContainer(n),a=d.CLASS_NAMES.button,u&&u.all("."+a).isEmpty()&&(u.remove(),this._updateContentButtons(n)))},_uiSetButtons:function(e){var t=d.CLASS_NAMES.button,r=["header","body","footer"];n.each(r,function(n){var r=e[n]||[],i=r.length,s=this._getButtonContainer(n,i),o=!1,u,a,f,l;if(!s)return;u=s.all("."+t);for(a=0;a<i;a+=1)f=r[a],l=u.indexOf(f),l>-1?(u.splice(l,1),l!==a&&(s.insertBefore(f,a+1),o=!0)):(s.appendChild(f),o=!0);u.each(function(e){this._uiRemoveButton(e,n,{preserveContent:!0}),o=!0},this);if(i===0){s.remove(),this._updateContentButtons(n);return}o&&this.setStdModContent(n,s,"after")},this)},_uiSetDefaultButton:function(e,t){var n=d.CLASS_NAMES.primary;e&&e.addClass(n),t&&t.removeClass(n)},_uiSetVisibleButtons:function(e){if(!e)return;var t=this.get("defaultButton");t&&t.focus()},_unMapButton:function(e,t){var n=this._buttonsMap,r=this._getButtonName(e),i;r&&(n[r]===e&&delete
n[r],i=t+":"+r,n[i]===e&&delete n[i]),this._defaultButton===e&&(this._defaultButton=null)},_updateDefaultButton:function(){var e=this._defaultButton;this.get("defaultButton")!==e&&this._set("defaultButton",e)},_updateContentButtons:function(e){var t=this.getStdModNode(e).get("childNodes");this.set(e+"Content",t.isEmpty()?null:t,{src:"buttons"})},_afterButtonsChange:function(e){var t=e.newVal,n=e.section,r=e.index,i=e.src,s;if(i==="add"){s=t[n][r],this._mapButton(s,n),this._updateDefaultButton(),this._uiInsertButton(s,n,r);return}if(i==="remove"){s=e.button,this._unMapButton(s,n),this._updateDefaultButton(),this._uiRemoveButton(s,n);return}this._mapButtons(t),this._updateDefaultButton(),this._uiSetButtons(t)},_afterContentChangeButtons:function(e){var t=e.src,n=e.stdModPosition,r=!n||n===u.REPLACE;r&&t!=="buttons"&&t!==o.UI_SRC&&this._uiSetButtons(this.get("buttons"))},_afterDefaultButtonChange:function(e){this._uiSetDefaultButton(e.newVal,e.prevVal)},_afterVisibleChangeButtons:function(e){this._uiSetVisibleButtons(e.newVal)}},e.WidgetButtons=d},"@VERSION@",{requires:["button-plugin","cssbutton","widget-stdmod"]});
| JimBobSquarePants/cdnjs | ajax/libs/yui/3.13.0/widget-buttons/widget-buttons-min.js | JavaScript | mit | 7,143 |
YUI.add("widget-htmlparser",function(e,t){var n=e.Widget,r=e.Node,i=e.Lang,s="srcNode",o="contentBox";n.HTML_PARSER={},n._buildCfg={aggregates:["HTML_PARSER"]},n.ATTRS[s]={value:null,setter:r.one,getter:"_getSrcNode",writeOnce:!0},e.mix(n.prototype,{_getSrcNode:function(e){return e||this.get(o)},_preAddAttrs:function(e,t,n){var r={id:e.id,boundingBox:e.boundingBox,contentBox:e.contentBox,srcNode:e.srcNode};this.addAttrs(r,t,n),delete e.boundingBox,delete e.contentBox,delete e.srcNode,delete e.id,this._applyParser&&this._applyParser(t)},_applyParsedConfig:function(t,n,r){return r?e.mix(n,r,!1):n},_applyParser:function(t){var n=this,r=this._getNodeToParse(),s=n._getHtmlParser(),o,u;s&&r&&e.Object.each(s,function(e,t,s){u=null,i.isFunction(e)?u=e.call(n,r):i.isArray(e)?(u=r.all(e[0]),u.isEmpty()&&(u=null)):u=r.one(e),u!==null&&u!==undefined&&(o=o||{},o[t]=u)}),t=n._applyParsedConfig(r,t,o)},_getNodeToParse:function(){var e=this.get("srcNode");return this._cbFromTemplate?null:e},_getHtmlParser:function(){var t=this._getClasses(),n={},r,i;for(r=t.length-1;r>=0;r--)i=t[r].HTML_PARSER,i&&e.mix(n,i,!0);return n}})},"@VERSION@",{requires:["widget-base"]});
| zpao/cdnjs | ajax/libs/yui/3.13.0/widget-htmlparser/widget-htmlparser-min.js | JavaScript | mit | 1,166 |
/* Ion.RangeSlider, Nice Skin
// css version 1.5.6
// by Denis Ineshin | ionden.com
// ===================================================================================================================*/
/* =====================================================================================================================
// Skin details */
.irs-line-mid,
.irs-line-left,
.irs-line-right,
.irs-diapason,
.irs-slider {
background: url(../img/sprite-skin-nice.png) repeat-x;
}
.irs {
height: 40px;
}
.irs-line {
height: 8px; top: 25px;
}
.irs-line-left {
height: 8px;
background-position: 0 -30px;
}
.irs-line-mid {
height: 8px;
background-position: 0 0;
}
.irs-line-right {
height: 8px;
background-position: 100% -30px;
}
.irs-diapason {
height: 8px; top: 25px;
background-position: 0 -60px;
}
.irs-slider {
width: 22px; height: 22px;
top: 17px;
background-position: 0 -90px;
}
#irs-active-slider, .irs-slider:hover {
background-position: 0 -120px;
}
.irs-min, .irs-max {
color: #999;
font-size: 10px;
text-shadow: none;
top: 0; padding: 1px 3px;
background: rgba(0,0,0,0.1);
border-radius: 3px;
}
.lt-ie9 .irs-min, .lt-ie9 .irs-max {
background: #ccc;
}
.irs-from, .irs-to, .irs-single {
color: #fff;
font-size: 10px;
text-shadow: none;
padding: 1px 5px;
background: rgba(0,0,0,0.3);
border-radius: 3px;
}
.lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single {
background: #999;
} | dc-js/cdnjs | ajax/libs/ion-rangeslider/2.0.12/css/ion.rangeSlider.skinNice.css | CSS | mit | 1,558 |
YUI.add('arraylist-add', function(Y) {
/**
* Collection utilities beyond what is provided in the YUI core
* @module collection
* @submodule arraylist-add
*/
/**
* Adds methods add and remove to Y.ArrayList
* @class ArrayList~add
*/
Y.mix( Y.ArrayList.prototype, {
/**
* Add a single item to the ArrayList. Does not prevent duplicates.
*
* @method add
* @param item { mixed } Item presumably of the same type as others in the
* ArrayList
* @param index {Number} (Optional.) Number representing the position at
* which the item should be inserted.
* @return {ArrayList} the instance
* @chainable
*/
add: function ( item, index ) {
var items = this._items;
if (Y.Lang.isNumber(index)) {
items.splice(index, 0, item);
}
else {
items.push(item);
}
return this;
},
/**
* Removes first or all occurrences of an item to the ArrayList. If a
* comparitor is not provided, uses itemsAreEqual method to determine
* matches.
*
* @method remove
* @param needle { mixed } Item to find and remove from the list
* @param all { Boolean } If true, remove all occurrences
* @param comparitor { Function } optional a/b function to test equivalence
* @return {ArrayList} the instance
* @chainable
*/
remove: function ( needle, all, comparitor ) {
comparitor = comparitor || this.itemsAreEqual;
for (var i = this._items.length - 1; i >= 0; --i) {
if ( comparitor.call( this, needle, this.item( i ) ) ) {
this._items.splice( i, 1 );
if ( !all ) {
break;
}
}
}
return this;
},
/**
* Default comparitor for items stored in this list. Used by remove().
*
* @method itemsAreEqual
* @param a { mixed } item to test equivalence with
* @param b { mixed } other item to test equivalance
* @return { Boolean } true if items are deemed equivalent
*/
itemsAreEqual: function ( a, b ) {
return a === b;
}
} );
}, '@VERSION@' ,{requires:['arraylist']});
| AlexisArce/cdnjs | ajax/libs/yui/3.1.0/collection/arraylist-add-debug.js | JavaScript | mit | 2,243 |
// moment.js language configuration
// language : Lithuanian (lt)
// author : Mindaugas Mozūras : https://github.com/mmozuras
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'object') {
module.exports = factory(require('../moment')); // Node
} else {
factory(window.moment); // Browser global
}
}(function (moment) {
var units = {
"m" : "minutė_minutės_minutę",
"mm": "minutės_minučių_minutes",
"h" : "valanda_valandos_valandą",
"hh": "valandos_valandų_valandas",
"d" : "diena_dienos_dieną",
"dd": "dienos_dienų_dienas",
"M" : "mėnuo_mėnesio_mėnesį",
"MM": "mėnesiai_mėnesių_mėnesius",
"y" : "metai_metų_metus",
"yy": "metai_metų_metus"
},
weekDays = "pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis_sekmadienis".split("_");
function translateSeconds(number, withoutSuffix, key, isFuture) {
if (withoutSuffix) {
return "kelios sekundės";
} else {
return isFuture ? "kelių sekundžių" : "kelias sekundes";
}
}
function translateSingular(number, withoutSuffix, key, isFuture) {
return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
}
function special(number) {
return number % 10 === 0 || (number > 10 && number < 20);
}
function forms(key) {
return units[key].split("_");
}
function translate(number, withoutSuffix, key, isFuture) {
var result = number + " ";
if (number === 1) {
return result + translateSingular(number, withoutSuffix, key[0], isFuture);
} else if (withoutSuffix) {
return result + (special(number) ? forms(key)[1] : forms(key)[0]);
} else {
if (isFuture) {
return result + forms(key)[1];
} else {
return result + (special(number) ? forms(key)[1] : forms(key)[2]);
}
}
}
function relativeWeekDay(moment, format) {
var nominative = format.indexOf('dddd LT') === -1,
weekDay = weekDays[moment.weekday()];
return nominative ? weekDay : weekDay.substring(0, weekDay.length - 2) + "į";
}
return moment.lang("lt", {
months : "sausio_vasario_kovo_balandžio_gegužės_biržėlio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),
monthsShort : "sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),
weekdays : relativeWeekDay,
weekdaysShort : "Sek_Pir_Ant_Tre_Ket_Pen_Šeš".split("_"),
weekdaysMin : "S_P_A_T_K_Pn_Š".split("_"),
longDateFormat : {
LT : "HH:mm",
L : "YYYY-MM-DD",
LL : "YYYY [m.] MMMM D [d.]",
LLL : "YYYY [m.] MMMM D [d.], LT [val.]",
LLLL : "YYYY [m.] MMMM D [d.], dddd, LT [val.]",
l : "YYYY-MM-DD",
ll : "YYYY [m.] MMMM D [d.]",
lll : "YYYY [m.] MMMM D [d.], LT [val.]",
llll : "YYYY [m.] MMMM D [d.], ddd, LT [val.]"
},
calendar : {
sameDay : "[Šiandien] LT",
nextDay : "[Rytoj] LT",
nextWeek : "dddd LT",
lastDay : "[Vakar] LT",
lastWeek : "[Praėjusį] dddd LT",
sameElse : "L"
},
relativeTime : {
future : "po %s",
past : "prieš %s",
s : translateSeconds,
m : translateSingular,
mm : translate,
h : translateSingular,
hh : translate,
d : translateSingular,
dd : translate,
M : translateSingular,
MM : translate,
y : translateSingular,
yy : translate
},
ordinal : function (number) {
return number + '-oji';
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 4 // The week that contains Jan 4th is the first week of the year.
}
});
}));
| saitheexplorer/cdnjs | ajax/libs/moment.js/2.5.1/lang/lt.js | JavaScript | mit | 4,213 |
intellisense.annotate(jQuery, {
'ajax': function() {
/// <signature>
/// <summary>Perform an asynchronous HTTP (Ajax) request.</summary>
/// <param name="url" type="String">A string containing the URL to which the request is sent.</param>
/// <param name="settings" type="PlainObject">A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings.</param>
/// <returns type="jqXHR" />
/// </signature>
/// <signature>
/// <summary>Perform an asynchronous HTTP (Ajax) request.</summary>
/// <param name="settings" type="PlainObject">A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup().</param>
/// <returns type="jqXHR" />
/// </signature>
},
'ajaxPrefilter': function() {
/// <signature>
/// <summary>Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().</summary>
/// <param name="dataTypes" type="String">An optional string containing one or more space-separated dataTypes</param>
/// <param name="handler(options, originalOptions, jqXHR)" type="Function">A handler to set default values for future Ajax requests.</param>
/// </signature>
},
'ajaxSetup': function() {
/// <signature>
/// <summary>Set default values for future Ajax requests.</summary>
/// <param name="options" type="PlainObject">A set of key/value pairs that configure the default Ajax request. All options are optional.</param>
/// </signature>
},
'ajaxTransport': function() {
/// <signature>
/// <summary>Creates an object that handles the actual transmission of Ajax data.</summary>
/// <param name="dataType" type="String">A string identifying the data type to use</param>
/// <param name="handler(options, originalOptions, jqXHR)" type="Function">A handler to return the new transport object to use with the data type provided in the first argument.</param>
/// </signature>
},
'boxModel': function() {
/// <summary>Deprecated in jQuery 1.3 (see jQuery.support). States if the current page, in the user's browser, is being rendered using the W3C CSS Box Model.</summary>
/// <returns type="Boolean" />
},
'browser': function() {
/// <summary>Contains flags for the useragent, read from navigator.userAgent. We recommend against using this property; please try to use feature detection instead (see jQuery.support). jQuery.browser may be moved to a plugin in a future release of jQuery.</summary>
/// <returns type="PlainObject" />
},
'browser.version': function() {
/// <summary>The version number of the rendering engine for the user's browser.</summary>
/// <returns type="String" />
},
'Callbacks': function() {
/// <signature>
/// <summary>A multi-purpose callbacks list object that provides a powerful way to manage callback lists.</summary>
/// <param name="flags" type="String">An optional list of space-separated flags that change how the callback list behaves.</param>
/// <returns type="Callbacks" />
/// </signature>
},
'contains': function() {
/// <signature>
/// <summary>Check to see if a DOM element is a descendant of another DOM element.</summary>
/// <param name="container" type="Element">The DOM element that may contain the other element.</param>
/// <param name="contained" type="Element">The DOM element that may be contained by (a descendant of) the other element.</param>
/// <returns type="Boolean" />
/// </signature>
},
'cssHooks': function() {
/// <summary>Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties.</summary>
/// <returns type="Object" />
},
'data': function() {
/// <signature>
/// <summary>Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.</summary>
/// <param name="element" type="Element">The DOM element to query for the data.</param>
/// <param name="key" type="String">Name of the data stored.</param>
/// <returns type="Object" />
/// </signature>
/// <signature>
/// <summary>Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.</summary>
/// <param name="element" type="Element">The DOM element to query for the data.</param>
/// <returns type="Object" />
/// </signature>
},
'Deferred': function() {
/// <signature>
/// <summary>A constructor function that returns a chainable utility object with methods to register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.</summary>
/// <param name="beforeStart" type="Function">A function that is called just before the constructor returns.</param>
/// <returns type="Deferred" />
/// </signature>
},
'dequeue': function() {
/// <signature>
/// <summary>Execute the next function on the queue for the matched element.</summary>
/// <param name="element" type="Element">A DOM element from which to remove and execute a queued function.</param>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// </signature>
},
'each': function() {
/// <signature>
/// <summary>A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.</summary>
/// <param name="collection" type="Object">The object or array to iterate over.</param>
/// <param name="callback(indexInArray, valueOfElement)" type="Function">The function that will be executed on every object.</param>
/// <returns type="Object" />
/// </signature>
},
'error': function() {
/// <signature>
/// <summary>Takes a string and throws an exception containing it.</summary>
/// <param name="message" type="String">The message to send out.</param>
/// </signature>
},
'extend': function() {
/// <signature>
/// <summary>Merge the contents of two or more objects together into the first object.</summary>
/// <param name="target" type="Object">An object that will receive the new properties if additional objects are passed in or that will extend the jQuery namespace if it is the sole argument.</param>
/// <param name="object1" type="Object">An object containing additional properties to merge in.</param>
/// <param name="objectN" type="Object">Additional objects containing properties to merge in.</param>
/// <returns type="Object" />
/// </signature>
/// <signature>
/// <summary>Merge the contents of two or more objects together into the first object.</summary>
/// <param name="deep" type="Boolean">If true, the merge becomes recursive (aka. deep copy).</param>
/// <param name="target" type="Object">The object to extend. It will receive the new properties.</param>
/// <param name="object1" type="Object">An object containing additional properties to merge in.</param>
/// <param name="objectN" type="Object">Additional objects containing properties to merge in.</param>
/// <returns type="Object" />
/// </signature>
},
'get': function() {
/// <signature>
/// <summary>Load data from the server using a HTTP GET request.</summary>
/// <param name="url" type="String">A string containing the URL to which the request is sent.</param>
/// <param name="data" type="String">A plain object or string that is sent to the server with the request.</param>
/// <param name="success(data, textStatus, jqXHR)" type="Function">A callback function that is executed if the request succeeds.</param>
/// <param name="dataType" type="String">The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).</param>
/// <returns type="jqXHR" />
/// </signature>
},
'getJSON': function() {
/// <signature>
/// <summary>Load JSON-encoded data from the server using a GET HTTP request.</summary>
/// <param name="url" type="String">A string containing the URL to which the request is sent.</param>
/// <param name="data" type="PlainObject">A plain object or string that is sent to the server with the request.</param>
/// <param name="success(data, textStatus, jqXHR)" type="Function">A callback function that is executed if the request succeeds.</param>
/// <returns type="jqXHR" />
/// </signature>
},
'getScript': function() {
/// <signature>
/// <summary>Load a JavaScript file from the server using a GET HTTP request, then execute it.</summary>
/// <param name="url" type="String">A string containing the URL to which the request is sent.</param>
/// <param name="success(script, textStatus, jqXHR)" type="Function">A callback function that is executed if the request succeeds.</param>
/// <returns type="jqXHR" />
/// </signature>
},
'globalEval': function() {
/// <signature>
/// <summary>Execute some JavaScript code globally.</summary>
/// <param name="code" type="String">The JavaScript code to execute.</param>
/// </signature>
},
'grep': function() {
/// <signature>
/// <summary>Finds the elements of an array which satisfy a filter function. The original array is not affected.</summary>
/// <param name="array" type="Array">The array to search through.</param>
/// <param name="function(elementOfArray, indexInArray)" type="Function">The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.</param>
/// <param name="invert" type="Boolean">If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.</param>
/// <returns type="Array" />
/// </signature>
},
'hasData': function() {
/// <signature>
/// <summary>Determine whether an element has any jQuery data associated with it.</summary>
/// <param name="element" type="Element">A DOM element to be checked for data.</param>
/// <returns type="Boolean" />
/// </signature>
},
'holdReady': function() {
/// <signature>
/// <summary>Holds or releases the execution of jQuery's ready event.</summary>
/// <param name="hold" type="Boolean">Indicates whether the ready hold is being requested or released</param>
/// </signature>
},
'inArray': function() {
/// <signature>
/// <summary>Search for a specified value within an array and return its index (or -1 if not found).</summary>
/// <param name="value" type="Anything">The value to search for.</param>
/// <param name="array" type="Array">An array through which to search.</param>
/// <param name="fromIndex" type="Number">The index of the array at which to begin the search. The default is 0, which will search the whole array.</param>
/// <returns type="Number" />
/// </signature>
},
'isArray': function() {
/// <signature>
/// <summary>Determine whether the argument is an array.</summary>
/// <param name="obj" type="Object">Object to test whether or not it is an array.</param>
/// <returns type="boolean" />
/// </signature>
},
'isEmptyObject': function() {
/// <signature>
/// <summary>Check to see if an object is empty (contains no enumerable properties).</summary>
/// <param name="object" type="Object">The object that will be checked to see if it's empty.</param>
/// <returns type="Boolean" />
/// </signature>
},
'isFunction': function() {
/// <signature>
/// <summary>Determine if the argument passed is a Javascript function object.</summary>
/// <param name="obj" type="PlainObject">Object to test whether or not it is a function.</param>
/// <returns type="boolean" />
/// </signature>
},
'isNumeric': function() {
/// <signature>
/// <summary>Determines whether its argument is a number.</summary>
/// <param name="value" type="PlainObject">The value to be tested.</param>
/// <returns type="Boolean" />
/// </signature>
},
'isPlainObject': function() {
/// <signature>
/// <summary>Check to see if an object is a plain object (created using "{}" or "new Object").</summary>
/// <param name="object" type="PlainObject">The object that will be checked to see if it's a plain object.</param>
/// <returns type="Boolean" />
/// </signature>
},
'isWindow': function() {
/// <signature>
/// <summary>Determine whether the argument is a window.</summary>
/// <param name="obj" type="PlainObject">Object to test whether or not it is a window.</param>
/// <returns type="boolean" />
/// </signature>
},
'isXMLDoc': function() {
/// <signature>
/// <summary>Check to see if a DOM node is within an XML document (or is an XML document).</summary>
/// <param name="node" type="Element">The DOM node that will be checked to see if it's in an XML document.</param>
/// <returns type="Boolean" />
/// </signature>
},
'makeArray': function() {
/// <signature>
/// <summary>Convert an array-like object into a true JavaScript array.</summary>
/// <param name="obj" type="PlainObject">Any object to turn into a native Array.</param>
/// <returns type="Array" />
/// </signature>
},
'map': function() {
/// <signature>
/// <summary>Translate all items in an array or object to new array of items.</summary>
/// <param name="array" type="Array">The Array to translate.</param>
/// <param name="callback(elementOfArray, indexInArray)" type="Function">The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.</param>
/// <returns type="Array" />
/// </signature>
/// <signature>
/// <summary>Translate all items in an array or object to new array of items.</summary>
/// <param name="arrayOrObject" type="Object">The Array or Object to translate.</param>
/// <param name="callback( value, indexOrKey )" type="Function">The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object.</param>
/// <returns type="Array" />
/// </signature>
},
'merge': function() {
/// <signature>
/// <summary>Merge the contents of two arrays together into the first array.</summary>
/// <param name="first" type="Array">The first array to merge, the elements of second added.</param>
/// <param name="second" type="Array">The second array to merge into the first, unaltered.</param>
/// <returns type="Array" />
/// </signature>
},
'noConflict': function() {
/// <signature>
/// <summary>Relinquish jQuery's control of the $ variable.</summary>
/// <param name="removeAll" type="Boolean">A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).</param>
/// <returns type="Object" />
/// </signature>
},
'noop': function() {
/// <summary>An empty function.</summary>
},
'now': function() {
/// <summary>Return a number representing the current time.</summary>
/// <returns type="Number" />
},
'param': function() {
/// <signature>
/// <summary>Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.</summary>
/// <param name="obj" type="Object">An array or object to serialize.</param>
/// <returns type="String" />
/// </signature>
/// <signature>
/// <summary>Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.</summary>
/// <param name="obj" type="Object">An array or object to serialize.</param>
/// <param name="traditional" type="Boolean">A Boolean indicating whether to perform a traditional "shallow" serialization.</param>
/// <returns type="String" />
/// </signature>
},
'parseHTML': function() {
/// <signature>
/// <summary>Parses a string into an array of DOM nodes.</summary>
/// <param name="data" type="String">HTML string to be parsed</param>
/// <param name="context" type="Element">DOM element to serve as the context in which the HTML fragment will be created</param>
/// <param name="keepScripts" type="Boolean">A Boolean indicating whether to include scripts passed in the HTML string</param>
/// <returns type="Array" />
/// </signature>
},
'parseJSON': function() {
/// <signature>
/// <summary>Takes a well-formed JSON string and returns the resulting JavaScript object.</summary>
/// <param name="json" type="String">The JSON string to parse.</param>
/// <returns type="Object" />
/// </signature>
},
'parseXML': function() {
/// <signature>
/// <summary>Parses a string into an XML document.</summary>
/// <param name="data" type="String">a well-formed XML string to be parsed</param>
/// <returns type="XMLDocument" />
/// </signature>
},
'post': function() {
/// <signature>
/// <summary>Load data from the server using a HTTP POST request.</summary>
/// <param name="url" type="String">A string containing the URL to which the request is sent.</param>
/// <param name="data" type="String">A plain object or string that is sent to the server with the request.</param>
/// <param name="success(data, textStatus, jqXHR)" type="Function">A callback function that is executed if the request succeeds.</param>
/// <param name="dataType" type="String">The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).</param>
/// <returns type="jqXHR" />
/// </signature>
},
'proxy': function() {
/// <signature>
/// <summary>Takes a function and returns a new one that will always have a particular context.</summary>
/// <param name="function" type="Function">The function whose context will be changed.</param>
/// <param name="context" type="PlainObject">The object to which the context (this) of the function should be set.</param>
/// <returns type="Function" />
/// </signature>
/// <signature>
/// <summary>Takes a function and returns a new one that will always have a particular context.</summary>
/// <param name="context" type="PlainObject">The object to which the context of the function should be set.</param>
/// <param name="name" type="String">The name of the function whose context will be changed (should be a property of the context object).</param>
/// <returns type="Function" />
/// </signature>
/// <signature>
/// <summary>Takes a function and returns a new one that will always have a particular context.</summary>
/// <param name="function" type="Function">The function whose context will be changed.</param>
/// <param name="context" type="PlainObject">The object to which the context (this) of the function should be set.</param>
/// <param name="additionalArguments" type="Anything">Any number of arguments to be passed to the function referenced in the function argument.</param>
/// <returns type="Function" />
/// </signature>
/// <signature>
/// <summary>Takes a function and returns a new one that will always have a particular context.</summary>
/// <param name="context" type="PlainObject">The object to which the context of the function should be set.</param>
/// <param name="name" type="String">The name of the function whose context will be changed (should be a property of the context object).</param>
/// <param name="additionalArguments" type="Anything">Any number of arguments to be passed to the function named in the name argument.</param>
/// <returns type="Function" />
/// </signature>
},
'queue': function() {
/// <signature>
/// <summary>Manipulate the queue of functions to be executed on the matched element.</summary>
/// <param name="element" type="Element">A DOM element where the array of queued functions is attached.</param>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// <param name="newQueue" type="Array">An array of functions to replace the current queue contents.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Manipulate the queue of functions to be executed on the matched element.</summary>
/// <param name="element" type="Element">A DOM element on which to add a queued function.</param>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// <param name="callback()" type="Function">The new function to add to the queue.</param>
/// <returns type="jQuery" />
/// </signature>
},
'removeData': function() {
/// <signature>
/// <summary>Remove a previously-stored piece of data.</summary>
/// <param name="element" type="Element">A DOM element from which to remove data.</param>
/// <param name="name" type="String">A string naming the piece of data to remove.</param>
/// <returns type="jQuery" />
/// </signature>
},
'sub': function() {
/// <summary>Creates a new copy of jQuery whose properties and methods can be modified without affecting the original jQuery object.</summary>
/// <returns type="jQuery" />
},
'support': function() {
/// <summary>A collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance.</summary>
/// <returns type="Object" />
},
'trim': function() {
/// <signature>
/// <summary>Remove the whitespace from the beginning and end of a string.</summary>
/// <param name="str" type="String">The string to trim.</param>
/// <returns type="String" />
/// </signature>
},
'type': function() {
/// <signature>
/// <summary>Determine the internal JavaScript [[Class]] of an object.</summary>
/// <param name="obj" type="PlainObject">Object to get the internal JavaScript [[Class]] of.</param>
/// <returns type="String" />
/// </signature>
},
'unique': function() {
/// <signature>
/// <summary>Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.</summary>
/// <param name="array" type="Array">The Array of DOM elements.</param>
/// <returns type="Array" />
/// </signature>
},
'when': function() {
/// <signature>
/// <summary>Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.</summary>
/// <param name="deferreds" type="Deferred">One or more Deferred objects, or plain JavaScript objects.</param>
/// <returns type="Promise" />
/// </signature>
},
});
var _1228819969 = jQuery.Callbacks;
jQuery.Callbacks = function(flags) {
var _object = _1228819969(flags);
intellisense.annotate(_object, {
'add': function() {
/// <signature>
/// <summary>Add a callback or a collection of callbacks to a callback list.</summary>
/// <param name="callbacks" type="Array">A function, or array of functions, that are to be added to the callback list.</param>
/// <returns type="Callbacks" />
/// </signature>
},
'disable': function() {
/// <summary>Disable a callback list from doing anything more.</summary>
/// <returns type="Callbacks" />
},
'disabled': function() {
/// <summary>Determine if the callbacks list has been disabled.</summary>
/// <returns type="Boolean" />
},
'empty': function() {
/// <summary>Remove all of the callbacks from a list.</summary>
/// <returns type="Callbacks" />
},
'fire': function() {
/// <signature>
/// <summary>Call all of the callbacks with the given arguments</summary>
/// <param name="arguments" type="Anything">The argument or list of arguments to pass back to the callback list.</param>
/// <returns type="Callbacks" />
/// </signature>
},
'fired': function() {
/// <summary>Determine if the callbacks have already been called at least once.</summary>
/// <returns type="Boolean" />
},
'fireWith': function() {
/// <signature>
/// <summary>Call all callbacks in a list with the given context and arguments.</summary>
/// <param name="context" type="">A reference to the context in which the callbacks in the list should be fired.</param>
/// <param name="args" type="">An argument, or array of arguments, to pass to the callbacks in the list.</param>
/// <returns type="Callbacks" />
/// </signature>
},
'has': function() {
/// <signature>
/// <summary>Determine whether a supplied callback is in a list</summary>
/// <param name="callback" type="Function">The callback to search for.</param>
/// <returns type="Boolean" />
/// </signature>
},
'lock': function() {
/// <summary>Lock a callback list in its current state.</summary>
/// <returns type="Callbacks" />
},
'locked': function() {
/// <summary>Determine if the callbacks list has been locked.</summary>
/// <returns type="Boolean" />
},
'remove': function() {
/// <signature>
/// <summary>Remove a callback or a collection of callbacks from a callback list.</summary>
/// <param name="callbacks" type="Array">A function, or array of functions, that are to be removed from the callback list.</param>
/// <returns type="Callbacks" />
/// </signature>
},
});
return _object;
};
intellisense.redirectDefinition(jQuery.Callbacks, _1228819969);
var _731531622 = jQuery.Deferred;
jQuery.Deferred = function(func) {
var _object = _731531622(func);
intellisense.annotate(_object, {
'always': function() {
/// <signature>
/// <summary>Add handlers to be called when the Deferred object is either resolved or rejected.</summary>
/// <param name="alwaysCallbacks" type="Function">A function, or array of functions, that is called when the Deferred is resolved or rejected.</param>
/// <param name="alwaysCallbacks" type="Function">Optional additional functions, or arrays of functions, that are called when the Deferred is resolved or rejected.</param>
/// <returns type="Deferred" />
/// </signature>
},
'done': function() {
/// <signature>
/// <summary>Add handlers to be called when the Deferred object is resolved.</summary>
/// <param name="doneCallbacks" type="Function">A function, or array of functions, that are called when the Deferred is resolved.</param>
/// <param name="doneCallbacks" type="Function">Optional additional functions, or arrays of functions, that are called when the Deferred is resolved.</param>
/// <returns type="Deferred" />
/// </signature>
},
'fail': function() {
/// <signature>
/// <summary>Add handlers to be called when the Deferred object is rejected.</summary>
/// <param name="failCallbacks" type="Function">A function, or array of functions, that are called when the Deferred is rejected.</param>
/// <param name="failCallbacks" type="Function">Optional additional functions, or arrays of functions, that are called when the Deferred is rejected.</param>
/// <returns type="Deferred" />
/// </signature>
},
'isRejected': function() {
/// <summary>Determine whether a Deferred object has been rejected.</summary>
/// <returns type="Boolean" />
},
'isResolved': function() {
/// <summary>Determine whether a Deferred object has been resolved.</summary>
/// <returns type="Boolean" />
},
'notify': function() {
/// <signature>
/// <summary>Call the progressCallbacks on a Deferred object with the given args.</summary>
/// <param name="args" type="Object">Optional arguments that are passed to the progressCallbacks.</param>
/// <returns type="Deferred" />
/// </signature>
},
'notifyWith': function() {
/// <signature>
/// <summary>Call the progressCallbacks on a Deferred object with the given context and args.</summary>
/// <param name="context" type="Object">Context passed to the progressCallbacks as the this object.</param>
/// <param name="args" type="Object">Optional arguments that are passed to the progressCallbacks.</param>
/// <returns type="Deferred" />
/// </signature>
},
'pipe': function() {
/// <signature>
/// <summary>Utility method to filter and/or chain Deferreds.</summary>
/// <param name="doneFilter" type="Function">An optional function that is called when the Deferred is resolved.</param>
/// <param name="failFilter" type="Function">An optional function that is called when the Deferred is rejected.</param>
/// <returns type="Promise" />
/// </signature>
/// <signature>
/// <summary>Utility method to filter and/or chain Deferreds.</summary>
/// <param name="doneFilter" type="Function">An optional function that is called when the Deferred is resolved.</param>
/// <param name="failFilter" type="Function">An optional function that is called when the Deferred is rejected.</param>
/// <param name="progressFilter" type="Function">An optional function that is called when progress notifications are sent to the Deferred.</param>
/// <returns type="Promise" />
/// </signature>
},
'progress': function() {
/// <signature>
/// <summary>Add handlers to be called when the Deferred object generates progress notifications.</summary>
/// <param name="progressCallbacks" type="Function">A function, or array of functions, that is called when the Deferred generates progress notifications.</param>
/// <returns type="Deferred" />
/// </signature>
},
'promise': function() {
/// <signature>
/// <summary>Return a Deferred's Promise object.</summary>
/// <param name="target" type="Object">Object onto which the promise methods have to be attached</param>
/// <returns type="Promise" />
/// </signature>
},
'reject': function() {
/// <signature>
/// <summary>Reject a Deferred object and call any failCallbacks with the given args.</summary>
/// <param name="args" type="Object">Optional arguments that are passed to the failCallbacks.</param>
/// <returns type="Deferred" />
/// </signature>
},
'rejectWith': function() {
/// <signature>
/// <summary>Reject a Deferred object and call any failCallbacks with the given context and args.</summary>
/// <param name="context" type="Object">Context passed to the failCallbacks as the this object.</param>
/// <param name="args" type="Array">An optional array of arguments that are passed to the failCallbacks.</param>
/// <returns type="Deferred" />
/// </signature>
},
'resolve': function() {
/// <signature>
/// <summary>Resolve a Deferred object and call any doneCallbacks with the given args.</summary>
/// <param name="args" type="Object">Optional arguments that are passed to the doneCallbacks.</param>
/// <returns type="Deferred" />
/// </signature>
},
'resolveWith': function() {
/// <signature>
/// <summary>Resolve a Deferred object and call any doneCallbacks with the given context and args.</summary>
/// <param name="context" type="Object">Context passed to the doneCallbacks as the this object.</param>
/// <param name="args" type="Array">An optional array of arguments that are passed to the doneCallbacks.</param>
/// <returns type="Deferred" />
/// </signature>
},
'state': function() {
/// <summary>Determine the current state of a Deferred object.</summary>
/// <returns type="String" />
},
'then': function() {
/// <signature>
/// <summary>Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.</summary>
/// <param name="doneFilter" type="Function">A function that is called when the Deferred is resolved.</param>
/// <param name="failFilter" type="Function">An optional function that is called when the Deferred is rejected.</param>
/// <param name="progressFilter" type="Function">An optional function that is called when progress notifications are sent to the Deferred.</param>
/// <returns type="Promise" />
/// </signature>
/// <signature>
/// <summary>Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.</summary>
/// <param name="doneCallbacks" type="Function">A function, or array of functions, called when the Deferred is resolved.</param>
/// <param name="failCallbacks" type="Function">A function, or array of functions, called when the Deferred is rejected.</param>
/// <returns type="Promise" />
/// </signature>
/// <signature>
/// <summary>Add handlers to be called when the Deferred object is resolved, rejected, or still in progress.</summary>
/// <param name="doneCallbacks" type="Function">A function, or array of functions, called when the Deferred is resolved.</param>
/// <param name="failCallbacks" type="Function">A function, or array of functions, called when the Deferred is rejected.</param>
/// <param name="progressCallbacks" type="Function">A function, or array of functions, called when the Deferred notifies progress.</param>
/// <returns type="Promise" />
/// </signature>
},
});
return _object;
};
intellisense.redirectDefinition(jQuery.Callbacks, _731531622);
intellisense.annotate(jQuery.Event.prototype, {
'currentTarget': function() {
/// <summary>The current DOM element within the event bubbling phase.</summary>
/// <returns type="Element" />
},
'data': function() {
/// <summary>An optional object of data passed to an event method when the current executing handler is bound.</summary>
/// <returns type="Object" />
},
'delegateTarget': function() {
/// <summary>The element where the currently-called jQuery event handler was attached.</summary>
/// <returns type="Element" />
},
'isDefaultPrevented': function() {
/// <summary>Returns whether event.preventDefault() was ever called on this event object.</summary>
/// <returns type="Boolean" />
},
'isImmediatePropagationStopped': function() {
/// <summary>Returns whether event.stopImmediatePropagation() was ever called on this event object.</summary>
/// <returns type="Boolean" />
},
'isPropagationStopped': function() {
/// <summary>Returns whether event.stopPropagation() was ever called on this event object.</summary>
/// <returns type="Boolean" />
},
'metaKey': function() {
/// <summary>Indicates whether the META key was pressed when the event fired.</summary>
/// <returns type="Boolean" />
},
'namespace': function() {
/// <summary>The namespace specified when the event was triggered.</summary>
/// <returns type="String" />
},
'pageX': function() {
/// <summary>The mouse position relative to the left edge of the document.</summary>
/// <returns type="Number" />
},
'pageY': function() {
/// <summary>The mouse position relative to the top edge of the document.</summary>
/// <returns type="Number" />
},
'preventDefault': function() {
/// <summary>If this method is called, the default action of the event will not be triggered.</summary>
},
'relatedTarget': function() {
/// <summary>The other DOM element involved in the event, if any.</summary>
/// <returns type="Element" />
},
'result': function() {
/// <summary>The last value returned by an event handler that was triggered by this event, unless the value was undefined.</summary>
/// <returns type="Object" />
},
'stopImmediatePropagation': function() {
/// <summary>Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.</summary>
},
'stopPropagation': function() {
/// <summary>Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.</summary>
},
'target': function() {
/// <summary>The DOM element that initiated the event.</summary>
/// <returns type="Element" />
},
'timeStamp': function() {
/// <summary>The difference in milliseconds between the time the browser created the event and January 1, 1970.</summary>
/// <returns type="Number" />
},
'type': function() {
/// <summary>Describes the nature of the event.</summary>
/// <returns type="String" />
},
'which': function() {
/// <summary>For key or mouse events, this property indicates the specific key or button that was pressed.</summary>
/// <returns type="Number" />
},
});
intellisense.annotate(jQuery.fn, {
'add': function() {
/// <signature>
/// <summary>Add elements to the set of matched elements.</summary>
/// <param name="selector" type="String">A string representing a selector expression to find additional elements to add to the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add elements to the set of matched elements.</summary>
/// <param name="elements" type="Array">One or more elements to add to the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add elements to the set of matched elements.</summary>
/// <param name="html" type="String">An HTML fragment to add to the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add elements to the set of matched elements.</summary>
/// <param name="jQuery object" type="jQuery object ">An existing jQuery object to add to the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add elements to the set of matched elements.</summary>
/// <param name="selector" type="String">A string representing a selector expression to find additional elements to add to the set of matched elements.</param>
/// <param name="context" type="Element">The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.</param>
/// <returns type="jQuery" />
/// </signature>
},
'addBack': function() {
/// <signature>
/// <summary>Add the previous set of elements on the stack to the current set, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match the current set of elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'addClass': function() {
/// <signature>
/// <summary>Adds the specified class(es) to each of the set of matched elements.</summary>
/// <param name="className" type="String">One or more space-separated classes to be added to the class attribute of each matched element.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Adds the specified class(es) to each of the set of matched elements.</summary>
/// <param name="function(index, currentClass)" type="Function">A function returning one or more space-separated class names to be added to the existing class name(s). Receives the index position of the element in the set and the existing class name(s) as arguments. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'after': function() {
/// <signature>
/// <summary>Insert content, specified by the parameter, after each element in the set of matched elements.</summary>
/// <param name="content" type="jQuery">HTML string, DOM element, or jQuery object to insert after each element in the set of matched elements.</param>
/// <param name="content" type="jQuery">One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Insert content, specified by the parameter, after each element in the set of matched elements.</summary>
/// <param name="function(index)" type="Function">A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'ajaxComplete': function() {
/// <signature>
/// <summary>Register a handler to be called when Ajax requests complete. This is an AjaxEvent.</summary>
/// <param name="handler(event, XMLHttpRequest, ajaxOptions)" type="Function">The function to be invoked.</param>
/// <returns type="jQuery" />
/// </signature>
},
'ajaxError': function() {
/// <signature>
/// <summary>Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.</summary>
/// <param name="handler(event, jqXHR, ajaxSettings, thrownError)" type="Function">The function to be invoked.</param>
/// <returns type="jQuery" />
/// </signature>
},
'ajaxSend': function() {
/// <signature>
/// <summary>Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.</summary>
/// <param name="handler(event, jqXHR, ajaxOptions)" type="Function">The function to be invoked.</param>
/// <returns type="jQuery" />
/// </signature>
},
'ajaxStart': function() {
/// <signature>
/// <summary>Register a handler to be called when the first Ajax request begins. This is an Ajax Event.</summary>
/// <param name="handler()" type="Function">The function to be invoked.</param>
/// <returns type="jQuery" />
/// </signature>
},
'ajaxStop': function() {
/// <signature>
/// <summary>Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.</summary>
/// <param name="handler()" type="Function">The function to be invoked.</param>
/// <returns type="jQuery" />
/// </signature>
},
'ajaxSuccess': function() {
/// <signature>
/// <summary>Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.</summary>
/// <param name="handler(event, XMLHttpRequest, ajaxOptions)" type="Function">The function to be invoked.</param>
/// <returns type="jQuery" />
/// </signature>
},
'all': function() {
/// <summary>Selects all elements.</summary>
},
'andSelf': function() {
/// <summary>Add the previous set of elements on the stack to the current set.</summary>
/// <returns type="jQuery" />
},
'animate': function() {
/// <signature>
/// <summary>Perform a custom animation of a set of CSS properties.</summary>
/// <param name="properties" type="PlainObject">An object of CSS properties and values that the animation will move toward.</param>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Perform a custom animation of a set of CSS properties.</summary>
/// <param name="properties" type="PlainObject">An object of CSS properties and values that the animation will move toward.</param>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
},
'animated': function() {
/// <summary>Select all elements that are in the progress of an animation at the time the selector is run.</summary>
},
'append': function() {
/// <signature>
/// <summary>Insert content, specified by the parameter, to the end of each element in the set of matched elements.</summary>
/// <param name="content" type="jQuery">DOM element, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.</param>
/// <param name="content" type="jQuery">One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Insert content, specified by the parameter, to the end of each element in the set of matched elements.</summary>
/// <param name="function(index, html)" type="Function">A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'appendTo': function() {
/// <signature>
/// <summary>Insert every element in the set of matched elements to the end of the target.</summary>
/// <param name="target" type="jQuery">A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.</param>
/// <returns type="jQuery" />
/// </signature>
},
'attr': function() {
/// <signature>
/// <summary>Set one or more attributes for the set of matched elements.</summary>
/// <param name="attributeName" type="String">The name of the attribute to set.</param>
/// <param name="value" type="Number">A value to set for the attribute.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set one or more attributes for the set of matched elements.</summary>
/// <param name="attributes" type="PlainObject">An object of attribute-value pairs to set.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set one or more attributes for the set of matched elements.</summary>
/// <param name="attributeName" type="String">The name of the attribute to set.</param>
/// <param name="function(index, attr)" type="Function">A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old attribute value as arguments.</param>
/// <returns type="jQuery" />
/// </signature>
},
'attributeContains': function() {
/// <signature>
/// <summary>Selects elements that have the specified attribute with a value containing the a given substring.</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// <param name="value" type="String">An attribute value. Can be either an unquoted single word or a quoted string.</param>
/// </signature>
},
'attributeContainsPrefix': function() {
/// <signature>
/// <summary>Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// <param name="value" type="String">An attribute value. Can be either an unquoted single word or a quoted string.</param>
/// </signature>
},
'attributeContainsWord': function() {
/// <signature>
/// <summary>Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// <param name="value" type="String">An attribute value. Can be either an unquoted single word or a quoted string.</param>
/// </signature>
},
'attributeEndsWith': function() {
/// <signature>
/// <summary>Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// <param name="value" type="String">An attribute value. Can be either an unquoted single word or a quoted string.</param>
/// </signature>
},
'attributeEquals': function() {
/// <signature>
/// <summary>Selects elements that have the specified attribute with a value exactly equal to a certain value.</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// <param name="value" type="String">An attribute value. Can be either an unquoted single word or a quoted string.</param>
/// </signature>
},
'attributeHas': function() {
/// <signature>
/// <summary>Selects elements that have the specified attribute, with any value.</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// </signature>
},
'attributeMultiple': function() {
/// <signature>
/// <summary>Matches elements that match all of the specified attribute filters.</summary>
/// <param name="attributeFilter1" type="String">An attribute filter.</param>
/// <param name="attributeFilter2" type="String">Another attribute filter, reducing the selection even more</param>
/// <param name="attributeFilterN" type="String">As many more attribute filters as necessary</param>
/// </signature>
},
'attributeNotEqual': function() {
/// <signature>
/// <summary>Select elements that either don't have the specified attribute, or do have the specified attribute but not with a certain value.</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// <param name="value" type="String">An attribute value. Can be either an unquoted single word or a quoted string.</param>
/// </signature>
},
'attributeStartsWith': function() {
/// <signature>
/// <summary>Selects elements that have the specified attribute with a value beginning exactly with a given string.</summary>
/// <param name="attribute" type="String">An attribute name.</param>
/// <param name="value" type="String">An attribute value. Can be either an unquoted single word or a quoted string.</param>
/// </signature>
},
'before': function() {
/// <signature>
/// <summary>Insert content, specified by the parameter, before each element in the set of matched elements.</summary>
/// <param name="content" type="jQuery">HTML string, DOM element, or jQuery object to insert before each element in the set of matched elements.</param>
/// <param name="content" type="jQuery">One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Insert content, specified by the parameter, before each element in the set of matched elements.</summary>
/// <param name="function" type="Function">A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'bind': function() {
/// <signature>
/// <summary>Attach a handler to an event for the elements.</summary>
/// <param name="eventType" type="String">A string containing one or more DOM event types, such as "click" or "submit," or custom event names.</param>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach a handler to an event for the elements.</summary>
/// <param name="eventType" type="String">A string containing one or more DOM event types, such as "click" or "submit," or custom event names.</param>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="preventBubble" type="Boolean">Setting the third argument to false will attach a function that prevents the default action from occurring and stops the event from bubbling. The default is true.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach a handler to an event for the elements.</summary>
/// <param name="events" type="Object">An object containing one or more DOM event types and functions to execute for them.</param>
/// <returns type="jQuery" />
/// </signature>
},
'blur': function() {
/// <signature>
/// <summary>Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'button': function() {
/// <summary>Selects all button elements and elements of type button.</summary>
},
'change': function() {
/// <signature>
/// <summary>Bind an event handler to the "change" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "change" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'checkbox': function() {
/// <summary>Selects all elements of type checkbox.</summary>
},
'checked': function() {
/// <summary>Matches all elements that are checked.</summary>
},
'child': function() {
/// <signature>
/// <summary>Selects all direct child elements specified by "child" of elements specified by "parent".</summary>
/// <param name="parent" type="String">Any valid selector.</param>
/// <param name="child" type="String">A selector to filter the child elements.</param>
/// </signature>
},
'children': function() {
/// <signature>
/// <summary>Get the children of each element in the set of matched elements, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'class': function() {
/// <signature>
/// <summary>Selects all elements with the given class.</summary>
/// <param name="class" type="String">A class to search for. An element can have multiple classes; only one of them must match.</param>
/// </signature>
},
'clearQueue': function() {
/// <signature>
/// <summary>Remove from the queue all items that have not yet been run.</summary>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// <returns type="jQuery" />
/// </signature>
},
'click': function() {
/// <signature>
/// <summary>Bind an event handler to the "click" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "click" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'clone': function() {
/// <signature>
/// <summary>Create a deep copy of the set of matched elements.</summary>
/// <param name="withDataAndEvents" type="Boolean">A Boolean indicating whether event handlers should be copied along with the elements. As of jQuery 1.4, element data will be copied as well.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Create a deep copy of the set of matched elements.</summary>
/// <param name="withDataAndEvents" type="Boolean">A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back to false in 1.5.1 and up.</param>
/// <param name="deepWithDataAndEvents" type="Boolean">A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).</param>
/// <returns type="jQuery" />
/// </signature>
},
'closest': function() {
/// <signature>
/// <summary>For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <param name="context" type="Element">A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.</summary>
/// <param name="jQuery object" type="jQuery">A jQuery object to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.</summary>
/// <param name="element" type="Element">An element to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'contains': function() {
/// <signature>
/// <summary>Select all elements that contain the specified text.</summary>
/// <param name="text" type="String">A string of text to look for. It's case sensitive.</param>
/// </signature>
},
'contents': function() {
/// <summary>Get the children of each element in the set of matched elements, including text and comment nodes.</summary>
/// <returns type="jQuery" />
},
'context': function() {
/// <summary>The DOM node context originally passed to jQuery(); if none was passed then context will likely be the document.</summary>
/// <returns type="Element" />
},
'css': function() {
/// <signature>
/// <summary>Set one or more CSS properties for the set of matched elements.</summary>
/// <param name="propertyName" type="String">A CSS property name.</param>
/// <param name="value" type="Number">A value to set for the property.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set one or more CSS properties for the set of matched elements.</summary>
/// <param name="propertyName" type="String">A CSS property name.</param>
/// <param name="function(index, value)" type="Function">A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set one or more CSS properties for the set of matched elements.</summary>
/// <param name="properties" type="PlainObject">An object of property-value pairs to set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'data': function() {
/// <signature>
/// <summary>Store arbitrary data associated with the matched elements.</summary>
/// <param name="key" type="String">A string naming the piece of data to set.</param>
/// <param name="value" type="Object">The new data value; it can be any Javascript type including Array or Object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Store arbitrary data associated with the matched elements.</summary>
/// <param name="obj" type="Object">An object of key-value pairs of data to update.</param>
/// <returns type="jQuery" />
/// </signature>
},
'dblclick': function() {
/// <signature>
/// <summary>Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'delay': function() {
/// <signature>
/// <summary>Set a timer to delay execution of subsequent items in the queue.</summary>
/// <param name="duration" type="Number">An integer indicating the number of milliseconds to delay execution of the next item in the queue.</param>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// <returns type="jQuery" />
/// </signature>
},
'delegate': function() {
/// <signature>
/// <summary>Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.</summary>
/// <param name="selector" type="String">A selector to filter the elements that trigger the event.</param>
/// <param name="eventType" type="String">A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute at the time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.</summary>
/// <param name="selector" type="String">A selector to filter the elements that trigger the event.</param>
/// <param name="eventType" type="String">A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names.</param>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute at the time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.</summary>
/// <param name="selector" type="String">A selector to filter the elements that trigger the event.</param>
/// <param name="events" type="PlainObject">A plain object of one or more event types and functions to execute for them.</param>
/// <returns type="jQuery" />
/// </signature>
},
'dequeue': function() {
/// <signature>
/// <summary>Execute the next function on the queue for the matched elements.</summary>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// <returns type="jQuery" />
/// </signature>
},
'descendant': function() {
/// <signature>
/// <summary>Selects all elements that are descendants of a given ancestor.</summary>
/// <param name="ancestor" type="String">Any valid selector.</param>
/// <param name="descendant" type="String">A selector to filter the descendant elements.</param>
/// </signature>
},
'detach': function() {
/// <signature>
/// <summary>Remove the set of matched elements from the DOM.</summary>
/// <param name="selector" type="String">A selector expression that filters the set of matched elements to be removed.</param>
/// <returns type="jQuery" />
/// </signature>
},
'die': function() {
/// <signature>
/// <summary>Remove event handlers previously attached using .live() from the elements.</summary>
/// <param name="eventType" type="String">A string containing a JavaScript event type, such as click or keydown.</param>
/// <param name="handler" type="String">The function that is no longer to be executed.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove event handlers previously attached using .live() from the elements.</summary>
/// <param name="events" type="PlainObject">A plain object of one or more event types, such as click or keydown and their corresponding functions that are no longer to be executed.</param>
/// <returns type="jQuery" />
/// </signature>
},
'disabled': function() {
/// <summary>Selects all elements that are disabled.</summary>
},
'each': function() {
/// <signature>
/// <summary>Iterate over a jQuery object, executing a function for each matched element.</summary>
/// <param name="function(index, Element)" type="Function">A function to execute for each matched element.</param>
/// <returns type="jQuery" />
/// </signature>
},
'element': function() {
/// <signature>
/// <summary>Selects all elements with the given tag name.</summary>
/// <param name="element" type="String">An element to search for. Refers to the tagName of DOM nodes.</param>
/// </signature>
},
'empty': function() {
/// <summary>Select all elements that have no children (including text nodes).</summary>
},
'enabled': function() {
/// <summary>Selects all elements that are enabled.</summary>
},
'end': function() {
/// <summary>End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.</summary>
/// <returns type="jQuery" />
},
'eq': function() {
/// <signature>
/// <summary>Select the element at index n within the matched set.</summary>
/// <param name="index" type="Number">Zero-based index of the element to match.</param>
/// </signature>
/// <signature>
/// <summary>Select the element at index n within the matched set.</summary>
/// <param name="-index" type="Number">Zero-based index of the element to match, counting backwards from the last element.</param>
/// </signature>
},
'error': function() {
/// <signature>
/// <summary>Bind an event handler to the "error" JavaScript event.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute when the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "error" JavaScript event.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'even': function() {
/// <summary>Selects even elements, zero-indexed. See also odd.</summary>
},
'fadeIn': function() {
/// <signature>
/// <summary>Display the matched elements by fading them to opaque.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display the matched elements by fading them to opaque.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display the matched elements by fading them to opaque.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'fadeOut': function() {
/// <signature>
/// <summary>Hide the matched elements by fading them to transparent.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Hide the matched elements by fading them to transparent.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Hide the matched elements by fading them to transparent.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'fadeTo': function() {
/// <signature>
/// <summary>Adjust the opacity of the matched elements.</summary>
/// <param name="duration" type="Number">A string or number determining how long the animation will run.</param>
/// <param name="opacity" type="Number">A number between 0 and 1 denoting the target opacity.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Adjust the opacity of the matched elements.</summary>
/// <param name="duration" type="Number">A string or number determining how long the animation will run.</param>
/// <param name="opacity" type="Number">A number between 0 and 1 denoting the target opacity.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'fadeToggle': function() {
/// <signature>
/// <summary>Display or hide the matched elements by animating their opacity.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display or hide the matched elements by animating their opacity.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
},
'file': function() {
/// <summary>Selects all elements of type file.</summary>
},
'filter': function() {
/// <signature>
/// <summary>Reduce the set of matched elements to those that match the selector or pass the function's test.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match the current set of elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Reduce the set of matched elements to those that match the selector or pass the function's test.</summary>
/// <param name="function(index)" type="Function">A function used as a test for each element in the set. this is the current DOM element.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Reduce the set of matched elements to those that match the selector or pass the function's test.</summary>
/// <param name="element" type="Element">An element to match the current set of elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Reduce the set of matched elements to those that match the selector or pass the function's test.</summary>
/// <param name="jQuery object" type="Object">An existing jQuery object to match the current set of elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'find': function() {
/// <signature>
/// <summary>Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.</summary>
/// <param name="jQuery object" type="Object">A jQuery object to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.</summary>
/// <param name="element" type="Element">An element to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'finish': function() {
/// <signature>
/// <summary>Stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements.</summary>
/// <param name="queue" type="String">The name of the queue in which to stop animations.</param>
/// <returns type="jQuery" />
/// </signature>
},
'first': function() {
/// <summary>Selects the first matched element.</summary>
},
'first-child': function() {
/// <summary>Selects all elements that are the first child of their parent.</summary>
},
'first-of-type': function() {
/// <summary>Selects all elements that are the first among siblings of the same element name.</summary>
},
'focus': function() {
/// <signature>
/// <summary>Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'focusin': function() {
/// <signature>
/// <summary>Bind an event handler to the "focusin" event.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "focusin" event.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'focusout': function() {
/// <signature>
/// <summary>Bind an event handler to the "focusout" JavaScript event.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "focusout" JavaScript event.</summary>
/// <param name="eventData" type="Object">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'get': function() {
/// <signature>
/// <summary>Retrieve the DOM elements matched by the jQuery object.</summary>
/// <param name="index" type="Number">A zero-based integer indicating which element to retrieve.</param>
/// <returns type="Element, Array" />
/// </signature>
},
'gt': function() {
/// <signature>
/// <summary>Select all elements at an index greater than index within the matched set.</summary>
/// <param name="index" type="Number">Zero-based index.</param>
/// </signature>
},
'has': function() {
/// <signature>
/// <summary>Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.</summary>
/// <param name="contained" type="Element">A DOM element to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'hasClass': function() {
/// <signature>
/// <summary>Determine whether any of the matched elements are assigned the given class.</summary>
/// <param name="className" type="String">The class name to search for.</param>
/// <returns type="Boolean" />
/// </signature>
},
'header': function() {
/// <summary>Selects all elements that are headers, like h1, h2, h3 and so on.</summary>
},
'height': function() {
/// <signature>
/// <summary>Set the CSS height of every matched element.</summary>
/// <param name="value" type="Number">An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set the CSS height of every matched element.</summary>
/// <param name="function(index, height)" type="Function">A function returning the height to set. Receives the index position of the element in the set and the old height as arguments. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'hidden': function() {
/// <summary>Selects all elements that are hidden.</summary>
},
'hide': function() {
/// <signature>
/// <summary>Hide the matched elements.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Hide the matched elements.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Hide the matched elements.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'hover': function() {
/// <signature>
/// <summary>Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.</summary>
/// <param name="handlerIn(eventObject)" type="Function">A function to execute when the mouse pointer enters the element.</param>
/// <param name="handlerOut(eventObject)" type="Function">A function to execute when the mouse pointer leaves the element.</param>
/// <returns type="jQuery" />
/// </signature>
},
'html': function() {
/// <signature>
/// <summary>Set the HTML contents of each element in the set of matched elements.</summary>
/// <param name="htmlString" type="String">A string of HTML to set as the content of each matched element.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set the HTML contents of each element in the set of matched elements.</summary>
/// <param name="function(index, oldhtml)" type="Function">A function returning the HTML content to set. Receives the index position of the element in the set and the old HTML value as arguments. jQuery empties the element before calling the function; use the oldhtml argument to reference the previous content. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'id': function() {
/// <signature>
/// <summary>Selects a single element with the given id attribute.</summary>
/// <param name="id" type="String">An ID to search for, specified via the id attribute of an element.</param>
/// </signature>
},
'image': function() {
/// <summary>Selects all elements of type image.</summary>
},
'index': function() {
/// <signature>
/// <summary>Search for a given element from among the matched elements.</summary>
/// <param name="selector" type="String">A selector representing a jQuery collection in which to look for an element.</param>
/// <returns type="Number" />
/// </signature>
/// <signature>
/// <summary>Search for a given element from among the matched elements.</summary>
/// <param name="element" type="jQuery">The DOM element or first element within the jQuery object to look for.</param>
/// <returns type="Number" />
/// </signature>
},
'init': function() {
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="selector" type="String">A string containing a selector expression</param>
/// <param name="context" type="jQuery">A DOM Element, Document, or jQuery to use as context</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="element" type="Element">A DOM element to wrap in a jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="elementArray" type="Array">An array containing a set of DOM elements to wrap in a jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="object" type="PlainObject">A plain object to wrap in a jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="jQuery object" type="PlainObject">An existing jQuery object to clone.</param>
/// <returns type="jQuery" />
/// </signature>
},
'innerHeight': function() {
/// <summary>Get the current computed height for the first element in the set of matched elements, including padding but not border.</summary>
/// <returns type="Integer" />
},
'innerWidth': function() {
/// <summary>Get the current computed width for the first element in the set of matched elements, including padding but not border.</summary>
/// <returns type="Integer" />
},
'input': function() {
/// <summary>Selects all input, textarea, select and button elements.</summary>
},
'insertAfter': function() {
/// <signature>
/// <summary>Insert every element in the set of matched elements after the target.</summary>
/// <param name="target" type="jQuery">A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.</param>
/// <returns type="jQuery" />
/// </signature>
},
'insertBefore': function() {
/// <signature>
/// <summary>Insert every element in the set of matched elements before the target.</summary>
/// <param name="target" type="jQuery">A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.</param>
/// <returns type="jQuery" />
/// </signature>
},
'is': function() {
/// <signature>
/// <summary>Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="Boolean" />
/// </signature>
/// <signature>
/// <summary>Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.</summary>
/// <param name="function(index)" type="Function">A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element.</param>
/// <returns type="Boolean" />
/// </signature>
/// <signature>
/// <summary>Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.</summary>
/// <param name="jQuery object" type="Object">An existing jQuery object to match the current set of elements against.</param>
/// <returns type="Boolean" />
/// </signature>
/// <signature>
/// <summary>Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.</summary>
/// <param name="element" type="Element">An element to match the current set of elements against.</param>
/// <returns type="Boolean" />
/// </signature>
},
'jquery': function() {
/// <summary>A string containing the jQuery version number.</summary>
/// <returns type="String" />
},
'keydown': function() {
/// <signature>
/// <summary>Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'keypress': function() {
/// <signature>
/// <summary>Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'keyup': function() {
/// <signature>
/// <summary>Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'lang': function() {
/// <signature>
/// <summary>Selects all elements of the specified language.</summary>
/// <param name="language" type="String">A language code.</param>
/// </signature>
},
'last': function() {
/// <summary>Selects the last matched element.</summary>
},
'last-child': function() {
/// <summary>Selects all elements that are the last child of their parent.</summary>
},
'last-of-type': function() {
/// <summary>Selects all elements that are the last among siblings of the same element name.</summary>
},
'length': function() {
/// <summary>The number of elements in the jQuery object.</summary>
/// <returns type="Number" />
},
'live': function() {
/// <signature>
/// <summary>Attach an event handler for all elements which match the current selector, now and in the future.</summary>
/// <param name="events" type="String">A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute at the time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach an event handler for all elements which match the current selector, now and in the future.</summary>
/// <param name="events" type="String">A string containing a JavaScript event type, such as "click" or "keydown." As of jQuery 1.4 the string can contain multiple, space-separated event types or custom event names.</param>
/// <param name="data" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute at the time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach an event handler for all elements which match the current selector, now and in the future.</summary>
/// <param name="events" type="PlainObject">A plain object of one or more JavaScript event types and functions to execute for them.</param>
/// <returns type="jQuery" />
/// </signature>
},
'load': function() {
/// <signature>
/// <summary>Bind an event handler to the "load" JavaScript event.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute when the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "load" JavaScript event.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'lt': function() {
/// <signature>
/// <summary>Select all elements at an index less than index within the matched set.</summary>
/// <param name="index" type="Number">Zero-based index.</param>
/// </signature>
},
'map': function() {
/// <signature>
/// <summary>Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.</summary>
/// <param name="callback(index, domElement)" type="Function">A function object that will be invoked for each element in the current set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'mousedown': function() {
/// <signature>
/// <summary>Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'mouseenter': function() {
/// <signature>
/// <summary>Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'mouseleave': function() {
/// <signature>
/// <summary>Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'mousemove': function() {
/// <signature>
/// <summary>Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'mouseout': function() {
/// <signature>
/// <summary>Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'mouseover': function() {
/// <signature>
/// <summary>Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'mouseup': function() {
/// <signature>
/// <summary>Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'multiple': function() {
/// <signature>
/// <summary>Selects the combined results of all the specified selectors.</summary>
/// <param name="selector1" type="String">Any valid selector.</param>
/// <param name="selector2" type="String">Another valid selector.</param>
/// <param name="selectorN" type="String">As many more valid selectors as you like.</param>
/// </signature>
},
'next': function() {
/// <signature>
/// <summary>Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'next adjacent': function() {
/// <signature>
/// <summary>Selects all next elements matching "next" that are immediately preceded by a sibling "prev".</summary>
/// <param name="prev" type="String">Any valid selector.</param>
/// <param name="next" type="String">A selector to match the element that is next to the first selector.</param>
/// </signature>
},
'next siblings': function() {
/// <signature>
/// <summary>Selects all sibling elements that follow after the "prev" element, have the same parent, and match the filtering "siblings" selector.</summary>
/// <param name="prev" type="String">Any valid selector.</param>
/// <param name="siblings" type="String">A selector to filter elements that are the following siblings of the first selector.</param>
/// </signature>
},
'nextAll': function() {
/// <signature>
/// <summary>Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'nextUntil': function() {
/// <signature>
/// <summary>Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.</summary>
/// <param name="selector" type="String">A string containing a selector expression to indicate where to stop matching following sibling elements.</param>
/// <param name="filter" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.</summary>
/// <param name="element" type="Element">A DOM node or jQuery object indicating where to stop matching following sibling elements.</param>
/// <param name="filter" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'not': function() {
/// <signature>
/// <summary>Remove elements from the set of matched elements.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove elements from the set of matched elements.</summary>
/// <param name="elements" type="Array">One or more DOM elements to remove from the matched set.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove elements from the set of matched elements.</summary>
/// <param name="function(index)" type="Function">A function used as a test for each element in the set. this is the current DOM element.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove elements from the set of matched elements.</summary>
/// <param name="jQuery object" type="PlainObject">An existing jQuery object to match the current set of elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'nth-child': function() {
/// <signature>
/// <summary>Selects all elements that are the nth-child of their parent.</summary>
/// <param name="index" type="String">The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-child(even), :nth-child(4n) )</param>
/// </signature>
},
'nth-last-child': function() {
/// <signature>
/// <summary>Selects all elements that are the nth-child of their parent, counting from the last element to the first.</summary>
/// <param name="index" type="String">The index of each child to match, starting with the last one (1), the string even or odd, or an equation ( eg. :nth-last-child(even), :nth-last-child(4n) )</param>
/// </signature>
},
'nth-last-of-type': function() {
/// <signature>
/// <summary>Selects all elements that are the nth-child of their parent, counting from the last element to the first.</summary>
/// <param name="index" type="String">The index of each child to match, starting with the last one (1), the string even or odd, or an equation ( eg. :nth-last-of-type(even), :nth-last-of-type(4n) )</param>
/// </signature>
},
'nth-of-type': function() {
/// <signature>
/// <summary>Selects all elements that are the nth child of their parent in relation to siblings with the same element name.</summary>
/// <param name="index" type="String">The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-of-type(even), :nth-of-type(4n) )</param>
/// </signature>
},
'odd': function() {
/// <summary>Selects odd elements, zero-indexed. See also even.</summary>
},
'off': function() {
/// <signature>
/// <summary>Remove an event handler.</summary>
/// <param name="events" type="String">One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".</param>
/// <param name="selector" type="String">A selector which should match the one originally passed to .on() when attaching event handlers.</param>
/// <param name="handler(eventObject)" type="Function">A handler function previously attached for the event(s), or the special value false.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove an event handler.</summary>
/// <param name="events" type="PlainObject">An object where the string keys represent one or more space-separated event types and optional namespaces, and the values represent handler functions previously attached for the event(s).</param>
/// <param name="selector" type="String">A selector which should match the one originally passed to .on() when attaching event handlers.</param>
/// <returns type="jQuery" />
/// </signature>
},
'offset': function() {
/// <signature>
/// <summary>Set the current coordinates of every element in the set of matched elements, relative to the document.</summary>
/// <param name="coordinates" type="PlainObject">An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set the current coordinates of every element in the set of matched elements, relative to the document.</summary>
/// <param name="function(index, coords)" type="Function">A function to return the coordinates to set. Receives the index of the element in the collection as the first argument and the current coordinates as the second argument. The function should return an object with the new top and left properties.</param>
/// <returns type="jQuery" />
/// </signature>
},
'offsetParent': function() {
/// <summary>Get the closest ancestor element that is positioned.</summary>
/// <returns type="jQuery" />
},
'on': function() {
/// <signature>
/// <summary>Attach an event handler function for one or more events to the selected elements.</summary>
/// <param name="events" type="String">One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".</param>
/// <param name="selector" type="String">A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.</param>
/// <param name="data" type="Anything">Data to be passed to the handler in event.data when an event is triggered.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach an event handler function for one or more events to the selected elements.</summary>
/// <param name="events" type="PlainObject">An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).</param>
/// <param name="selector" type="String">A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.</param>
/// <param name="data" type="Anything">Data to be passed to the handler in event.data when an event occurs.</param>
/// <returns type="jQuery" />
/// </signature>
},
'one': function() {
/// <signature>
/// <summary>Attach a handler to an event for the elements. The handler is executed at most once per element.</summary>
/// <param name="events" type="String">A string containing one or more JavaScript event types, such as "click" or "submit," or custom event names.</param>
/// <param name="data" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute at the time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach a handler to an event for the elements. The handler is executed at most once per element.</summary>
/// <param name="events" type="String">One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".</param>
/// <param name="selector" type="String">A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.</param>
/// <param name="data" type="Anything">Data to be passed to the handler in event.data when an event is triggered.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Attach a handler to an event for the elements. The handler is executed at most once per element.</summary>
/// <param name="events" type="PlainObject">An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event(s).</param>
/// <param name="selector" type="String">A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element.</param>
/// <param name="data" type="Anything">Data to be passed to the handler in event.data when an event occurs.</param>
/// <returns type="jQuery" />
/// </signature>
},
'only-child': function() {
/// <summary>Selects all elements that are the only child of their parent.</summary>
},
'only-of-type': function() {
/// <summary>Selects all elements that have no siblings with the same element name.</summary>
},
'outerHeight': function() {
/// <signature>
/// <summary>Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.</summary>
/// <param name="includeMargin" type="Boolean">A Boolean indicating whether to include the element's margin in the calculation.</param>
/// <returns type="Integer" />
/// </signature>
},
'outerWidth': function() {
/// <signature>
/// <summary>Get the current computed width for the first element in the set of matched elements, including padding and border.</summary>
/// <param name="includeMargin" type="Boolean">A Boolean indicating whether to include the element's margin in the calculation.</param>
/// <returns type="Integer" />
/// </signature>
},
'parent': function() {
/// <signature>
/// <summary>Get the parent of each element in the current set of matched elements, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'parents': function() {
/// <signature>
/// <summary>Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'parentsUntil': function() {
/// <signature>
/// <summary>Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.</summary>
/// <param name="selector" type="String">A string containing a selector expression to indicate where to stop matching ancestor elements.</param>
/// <param name="filter" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.</summary>
/// <param name="element" type="Element">A DOM node or jQuery object indicating where to stop matching ancestor elements.</param>
/// <param name="filter" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'password': function() {
/// <summary>Selects all elements of type password.</summary>
},
'position': function() {
/// <summary>Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.</summary>
/// <returns type="Object" />
},
'prepend': function() {
/// <signature>
/// <summary>Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.</summary>
/// <param name="content" type="jQuery">DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.</param>
/// <param name="content" type="jQuery">One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.</summary>
/// <param name="function(index, html)" type="Function">A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'prependTo': function() {
/// <signature>
/// <summary>Insert every element in the set of matched elements to the beginning of the target.</summary>
/// <param name="target" type="jQuery">A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.</param>
/// <returns type="jQuery" />
/// </signature>
},
'prev': function() {
/// <signature>
/// <summary>Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'prevAll': function() {
/// <signature>
/// <summary>Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'prevUntil': function() {
/// <signature>
/// <summary>Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.</summary>
/// <param name="selector" type="String">A string containing a selector expression to indicate where to stop matching preceding sibling elements.</param>
/// <param name="filter" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.</summary>
/// <param name="element" type="Element">A DOM node or jQuery object indicating where to stop matching preceding sibling elements.</param>
/// <param name="filter" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'promise': function() {
/// <signature>
/// <summary>Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.</summary>
/// <param name="type" type="String">The type of queue that needs to be observed.</param>
/// <param name="target" type="PlainObject">Object onto which the promise methods have to be attached</param>
/// <returns type="Promise" />
/// </signature>
},
'prop': function() {
/// <signature>
/// <summary>Set one or more properties for the set of matched elements.</summary>
/// <param name="propertyName" type="String">The name of the property to set.</param>
/// <param name="value" type="Boolean">A value to set for the property.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set one or more properties for the set of matched elements.</summary>
/// <param name="properties" type="PlainObject">An object of property-value pairs to set.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set one or more properties for the set of matched elements.</summary>
/// <param name="propertyName" type="String">The name of the property to set.</param>
/// <param name="function(index, oldPropertyValue)" type="Function">A function returning the value to set. Receives the index position of the element in the set and the old property value as arguments. Within the function, the keyword this refers to the current element.</param>
/// <returns type="jQuery" />
/// </signature>
},
'pushStack': function() {
/// <signature>
/// <summary>Add a collection of DOM elements onto the jQuery stack.</summary>
/// <param name="elements" type="Array">An array of elements to push onto the stack and make into a new jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add a collection of DOM elements onto the jQuery stack.</summary>
/// <param name="elements" type="Array">An array of elements to push onto the stack and make into a new jQuery object.</param>
/// <param name="name" type="String">The name of a jQuery method that generated the array of elements.</param>
/// <param name="arguments" type="Array">The arguments that were passed in to the jQuery method (for serialization).</param>
/// <returns type="jQuery" />
/// </signature>
},
'queue': function() {
/// <signature>
/// <summary>Manipulate the queue of functions to be executed, once for each matched element.</summary>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// <param name="newQueue" type="Array">An array of functions to replace the current queue contents.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Manipulate the queue of functions to be executed, once for each matched element.</summary>
/// <param name="queueName" type="String">A string containing the name of the queue. Defaults to fx, the standard effects queue.</param>
/// <param name="callback( next )" type="Function">The new function to add to the queue, with a function to call that will dequeue the next item.</param>
/// <returns type="jQuery" />
/// </signature>
},
'radio': function() {
/// <summary>Selects all elements of type radio.</summary>
},
'ready': function() {
/// <signature>
/// <summary>Specify a function to execute when the DOM is fully loaded.</summary>
/// <param name="handler" type="Function">A function to execute after the DOM is ready.</param>
/// <returns type="jQuery" />
/// </signature>
},
'remove': function() {
/// <signature>
/// <summary>Remove the set of matched elements from the DOM.</summary>
/// <param name="selector" type="String">A selector expression that filters the set of matched elements to be removed.</param>
/// <returns type="jQuery" />
/// </signature>
},
'removeAttr': function() {
/// <signature>
/// <summary>Remove an attribute from each element in the set of matched elements.</summary>
/// <param name="attributeName" type="String">An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.</param>
/// <returns type="jQuery" />
/// </signature>
},
'removeClass': function() {
/// <signature>
/// <summary>Remove a single class, multiple classes, or all classes from each element in the set of matched elements.</summary>
/// <param name="className" type="String">One or more space-separated classes to be removed from the class attribute of each matched element.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove a single class, multiple classes, or all classes from each element in the set of matched elements.</summary>
/// <param name="function(index, class)" type="Function">A function returning one or more space-separated class names to be removed. Receives the index position of the element in the set and the old class value as arguments.</param>
/// <returns type="jQuery" />
/// </signature>
},
'removeData': function() {
/// <signature>
/// <summary>Remove a previously-stored piece of data.</summary>
/// <param name="name" type="String">A string naming the piece of data to delete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove a previously-stored piece of data.</summary>
/// <param name="list" type="String">An array or space-separated string naming the pieces of data to delete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'removeProp': function() {
/// <signature>
/// <summary>Remove a property for the set of matched elements.</summary>
/// <param name="propertyName" type="String">The name of the property to remove.</param>
/// <returns type="jQuery" />
/// </signature>
},
'replaceAll': function() {
/// <signature>
/// <summary>Replace each target element with the set of matched elements.</summary>
/// <param name="target" type="String">A selector expression indicating which element(s) to replace.</param>
/// <returns type="jQuery" />
/// </signature>
},
'replaceWith': function() {
/// <signature>
/// <summary>Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.</summary>
/// <param name="newContent" type="jQuery">The content to insert. May be an HTML string, DOM element, or jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Replace each element in the set of matched elements with the provided new content and return the set of elements that was removed.</summary>
/// <param name="function" type="Function">A function that returns content with which to replace the set of matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
},
'reset': function() {
/// <summary>Selects all elements of type reset.</summary>
},
'resize': function() {
/// <signature>
/// <summary>Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'root': function() {
/// <signature>
/// <summary>Selects the element that is the root of the document.</summary>
/// <param name="index" type="String">The index of each child to match, starting with 1, the string even or odd, or an equation ( eg. :nth-last-child(even), :nth-last-child(4n) )</param>
/// </signature>
},
'scroll': function() {
/// <signature>
/// <summary>Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'scrollLeft': function() {
/// <signature>
/// <summary>Set the current horizontal position of the scroll bar for each of the set of matched elements.</summary>
/// <param name="value" type="Number">An integer indicating the new position to set the scroll bar to.</param>
/// <returns type="jQuery" />
/// </signature>
},
'scrollTop': function() {
/// <signature>
/// <summary>Set the current vertical position of the scroll bar for each of the set of matched elements.</summary>
/// <param name="value" type="Number">An integer indicating the new position to set the scroll bar to.</param>
/// <returns type="jQuery" />
/// </signature>
},
'select': function() {
/// <signature>
/// <summary>Bind an event handler to the "select" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "select" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'selected': function() {
/// <summary>Selects all elements that are selected.</summary>
},
'selector': function() {
/// <summary>A selector representing selector originally passed to jQuery().</summary>
/// <returns type="String" />
},
'serialize': function() {
/// <summary>Encode a set of form elements as a string for submission.</summary>
/// <returns type="String" />
},
'serializeArray': function() {
/// <summary>Encode a set of form elements as an array of names and values.</summary>
/// <returns type="Array" />
},
'show': function() {
/// <signature>
/// <summary>Display the matched elements.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display the matched elements.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display the matched elements.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'siblings': function() {
/// <signature>
/// <summary>Get the siblings of each element in the set of matched elements, optionally filtered by a selector.</summary>
/// <param name="selector" type="String">A string containing a selector expression to match elements against.</param>
/// <returns type="jQuery" />
/// </signature>
},
'size': function() {
/// <summary>Return the number of elements in the jQuery object.</summary>
/// <returns type="Number" />
},
'slice': function() {
/// <signature>
/// <summary>Reduce the set of matched elements to a subset specified by a range of indices.</summary>
/// <param name="start" type="Number">An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.</param>
/// <param name="end" type="Number">An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'slideDown': function() {
/// <signature>
/// <summary>Display the matched elements with a sliding motion.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display the matched elements with a sliding motion.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display the matched elements with a sliding motion.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'slideToggle': function() {
/// <signature>
/// <summary>Display or hide the matched elements with a sliding motion.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display or hide the matched elements with a sliding motion.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display or hide the matched elements with a sliding motion.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'slideUp': function() {
/// <signature>
/// <summary>Hide the matched elements with a sliding motion.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Hide the matched elements with a sliding motion.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Hide the matched elements with a sliding motion.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
},
'stop': function() {
/// <signature>
/// <summary>Stop the currently-running animation on the matched elements.</summary>
/// <param name="clearQueue" type="Boolean">A Boolean indicating whether to remove queued animation as well. Defaults to false.</param>
/// <param name="jumpToEnd" type="Boolean">A Boolean indicating whether to complete the current animation immediately. Defaults to false.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Stop the currently-running animation on the matched elements.</summary>
/// <param name="queue" type="String">The name of the queue in which to stop animations.</param>
/// <param name="clearQueue" type="Boolean">A Boolean indicating whether to remove queued animation as well. Defaults to false.</param>
/// <param name="jumpToEnd" type="Boolean">A Boolean indicating whether to complete the current animation immediately. Defaults to false.</param>
/// <returns type="jQuery" />
/// </signature>
},
'submit': function() {
/// <signature>
/// <summary>Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.</summary>
/// <param name="eventData" type="PlainObject">An object containing data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'target': function() {
/// <summary>Selects the target element indicated by the fragment identifier of the document's URI.</summary>
},
'text': function() {
/// <signature>
/// <summary>Set the content of each element in the set of matched elements to the specified text.</summary>
/// <param name="textString" type="String">A string of text to set as the content of each matched element.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set the content of each element in the set of matched elements to the specified text.</summary>
/// <param name="function(index, text)" type="Function">A function returning the text content to set. Receives the index position of the element in the set and the old text value as arguments.</param>
/// <returns type="jQuery" />
/// </signature>
},
'toArray': function() {
/// <summary>Retrieve all the DOM elements contained in the jQuery set, as an array.</summary>
/// <returns type="Array" />
},
'toggle': function() {
/// <signature>
/// <summary>Display or hide the matched elements.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display or hide the matched elements.</summary>
/// <param name="options" type="PlainObject">A map of additional options to pass to the method.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display or hide the matched elements.</summary>
/// <param name="duration" type="">A string or number determining how long the animation will run.</param>
/// <param name="easing" type="String">A string indicating which easing function to use for the transition.</param>
/// <param name="complete" type="Function">A function to call once the animation is complete.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Display or hide the matched elements.</summary>
/// <param name="showOrHide" type="Boolean">A Boolean indicating whether to show or hide the elements.</param>
/// <returns type="jQuery" />
/// </signature>
},
'toggleClass': function() {
/// <signature>
/// <summary>Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.</summary>
/// <param name="className" type="String">One or more class names (separated by spaces) to be toggled for each element in the matched set.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.</summary>
/// <param name="className" type="String">One or more class names (separated by spaces) to be toggled for each element in the matched set.</param>
/// <param name="switch" type="Boolean">A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.</summary>
/// <param name="switch" type="Boolean">A boolean value to determine whether the class should be added or removed.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.</summary>
/// <param name="function(index, class, switch)" type="Function">A function that returns class names to be toggled in the class attribute of each element in the matched set. Receives the index position of the element in the set, the old class value, and the switch as arguments.</param>
/// <param name="switch" type="Boolean">A boolean value to determine whether the class should be added or removed.</param>
/// <returns type="jQuery" />
/// </signature>
},
'trigger': function() {
/// <signature>
/// <summary>Execute all handlers and behaviors attached to the matched elements for the given event type.</summary>
/// <param name="eventType" type="String">A string containing a JavaScript event type, such as click or submit.</param>
/// <param name="extraParameters" type="PlainObject">Additional parameters to pass along to the event handler.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Execute all handlers and behaviors attached to the matched elements for the given event type.</summary>
/// <param name="event" type="Event">A jQuery.Event object.</param>
/// <returns type="jQuery" />
/// </signature>
},
'triggerHandler': function() {
/// <signature>
/// <summary>Execute all handlers attached to an element for an event.</summary>
/// <param name="eventType" type="String">A string containing a JavaScript event type, such as click or submit.</param>
/// <param name="extraParameters" type="Array">An array of additional parameters to pass along to the event handler.</param>
/// <returns type="Object" />
/// </signature>
},
'unbind': function() {
/// <signature>
/// <summary>Remove a previously-attached event handler from the elements.</summary>
/// <param name="eventType" type="String">A string containing a JavaScript event type, such as click or submit.</param>
/// <param name="handler(eventObject)" type="Function">The function that is to be no longer executed.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove a previously-attached event handler from the elements.</summary>
/// <param name="eventType" type="String">A string containing a JavaScript event type, such as click or submit.</param>
/// <param name="false" type="Boolean">Unbinds the corresponding 'return false' function that was bound using .bind( eventType, false ).</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove a previously-attached event handler from the elements.</summary>
/// <param name="event" type="Object">A JavaScript event object as passed to an event handler.</param>
/// <returns type="jQuery" />
/// </signature>
},
'undelegate': function() {
/// <signature>
/// <summary>Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.</summary>
/// <param name="selector" type="String">A selector which will be used to filter the event results.</param>
/// <param name="eventType" type="String">A string containing a JavaScript event type, such as "click" or "keydown"</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.</summary>
/// <param name="selector" type="String">A selector which will be used to filter the event results.</param>
/// <param name="eventType" type="String">A string containing a JavaScript event type, such as "click" or "keydown"</param>
/// <param name="handler(eventObject)" type="Function">A function to execute at the time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.</summary>
/// <param name="selector" type="String">A selector which will be used to filter the event results.</param>
/// <param name="events" type="PlainObject">An object of one or more event types and previously bound functions to unbind from them.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.</summary>
/// <param name="namespace" type="String">A string containing a namespace to unbind all events from.</param>
/// <returns type="jQuery" />
/// </signature>
},
'unload': function() {
/// <signature>
/// <summary>Bind an event handler to the "unload" JavaScript event.</summary>
/// <param name="handler(eventObject)" type="Function">A function to execute when the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Bind an event handler to the "unload" JavaScript event.</summary>
/// <param name="eventData" type="Object">A plain object of data that will be passed to the event handler.</param>
/// <param name="handler(eventObject)" type="Function">A function to execute each time the event is triggered.</param>
/// <returns type="jQuery" />
/// </signature>
},
'unwrap': function() {
/// <summary>Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.</summary>
/// <returns type="jQuery" />
},
'val': function() {
/// <signature>
/// <summary>Set the value of each element in the set of matched elements.</summary>
/// <param name="value" type="Array">A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set the value of each element in the set of matched elements.</summary>
/// <param name="function(index, value)" type="Function">A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments.</param>
/// <returns type="jQuery" />
/// </signature>
},
'visible': function() {
/// <summary>Selects all elements that are visible.</summary>
},
'width': function() {
/// <signature>
/// <summary>Set the CSS width of each element in the set of matched elements.</summary>
/// <param name="value" type="Number">An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Set the CSS width of each element in the set of matched elements.</summary>
/// <param name="function(index, width)" type="Function">A function returning the width to set. Receives the index position of the element in the set and the old width as arguments. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'wrap': function() {
/// <signature>
/// <summary>Wrap an HTML structure around each element in the set of matched elements.</summary>
/// <param name="wrappingElement" type="jQuery">An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Wrap an HTML structure around each element in the set of matched elements.</summary>
/// <param name="function(index)" type="Function">A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
'wrapAll': function() {
/// <signature>
/// <summary>Wrap an HTML structure around all elements in the set of matched elements.</summary>
/// <param name="wrappingElement" type="jQuery">An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
},
'wrapInner': function() {
/// <signature>
/// <summary>Wrap an HTML structure around the content of each element in the set of matched elements.</summary>
/// <param name="wrappingElement" type="String">An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Wrap an HTML structure around the content of each element in the set of matched elements.</summary>
/// <param name="function(index)" type="Function">A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set.</param>
/// <returns type="jQuery" />
/// </signature>
},
});
intellisense.annotate(window, {
'$': function() {
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="selector" type="String">A string containing a selector expression</param>
/// <param name="context" type="jQuery">A DOM Element, Document, or jQuery to use as context</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="element" type="Element">A DOM element to wrap in a jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="elementArray" type="Array">An array containing a set of DOM elements to wrap in a jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="object" type="PlainObject">A plain object to wrap in a jQuery object.</param>
/// <returns type="jQuery" />
/// </signature>
/// <signature>
/// <summary>Accepts a string containing a CSS selector which is then used to match a set of elements.</summary>
/// <param name="jQuery object" type="PlainObject">An existing jQuery object to clone.</param>
/// <returns type="jQuery" />
/// </signature>
},
});
| Lowz/SPA-TestReady | Scripts/jquery-1.9.1.intellisense.js | JavaScript | mit | 161,599 |
/*
Skin Name: Nivo Slider Default Theme
Skin URI: http://nivo.dev7studios.com
Description: The default skin for the Nivo Slider.
Version: 1.3
Author: Gilbert Pellegrom
Author URI: http://dev7studios.com
Supports Thumbs: true
*/
.theme-default .nivoSlider {
position:relative;
background:#fff url(loading.gif) no-repeat 50% 50%;
margin-bottom:10px;
-webkit-box-shadow: 0px 1px 5px 0px #4a4a4a;
-moz-box-shadow: 0px 1px 5px 0px #4a4a4a;
box-shadow: 0px 1px 5px 0px #4a4a4a;
}
.theme-default .nivoSlider img {
position:absolute;
top:0px;
left:0px;
display:none;
}
.theme-default .nivoSlider a {
border:0;
display:block;
}
.theme-default .nivo-controlNav {
text-align: center;
padding: 20px 0;
}
.theme-default .nivo-controlNav a {
display:inline-block;
width:22px;
height:22px;
background:url(bullets.png) no-repeat;
text-indent:-9999px;
border:0;
margin: 0 2px;
}
.theme-default .nivo-controlNav a.active {
background-position:0 -22px;
}
.theme-default .nivo-directionNav a {
display:block;
width:30px;
height:30px;
background:url(arrows.png) no-repeat;
text-indent:-9999px;
border:0;
opacity: 0;
-webkit-transition: all 200ms ease-in-out;
-moz-transition: all 200ms ease-in-out;
-o-transition: all 200ms ease-in-out;
transition: all 200ms ease-in-out;
}
.theme-default:hover .nivo-directionNav a { opacity: 1; }
.theme-default a.nivo-nextNav {
background-position:-30px 0;
right:15px;
}
.theme-default a.nivo-prevNav {
left:15px;
}
.theme-default .nivo-caption {
font-family: Helvetica, Arial, sans-serif;
}
.theme-default .nivo-caption a {
color:#fff;
border-bottom:1px dotted #fff;
}
.theme-default .nivo-caption a:hover {
color:#fff;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled {
width: 100%;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled a {
width: auto;
height: auto;
background: none;
margin-bottom: 5px;
}
.theme-default .nivo-controlNav.nivo-thumbs-enabled img {
display: block;
width: 120px;
height: auto;
} | khorep/jsdelivr | files/nivoslider/3.1/themes/default/default.css | CSS | mit | 2,111 |
#!/bin/sh
set -e
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
> "$RESOURCES_TO_COPY"
XCASSET_FILES=()
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
1)
TARGET_DEVICE_ARGS="--target-device iphone"
;;
2)
TARGET_DEVICE_ARGS="--target-device ipad"
;;
*)
TARGET_DEVICE_ARGS="--target-device mac"
;;
esac
realpath() {
DIRECTORY="$(cd "${1%/*}" && pwd)"
FILENAME="${1##*/}"
echo "$DIRECTORY/$FILENAME"
}
install_resource()
{
if [[ "$1" = /* ]] ; then
RESOURCE_PATH="$1"
else
RESOURCE_PATH="${PODS_ROOT}/$1"
fi
if [[ ! -e "$RESOURCE_PATH" ]] ; then
cat << EOM
error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script.
EOM
exit 1
fi
case $RESOURCE_PATH in
*.storyboard)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
;;
*.xib)
echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}"
;;
*.framework)
echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
;;
*.xcdatamodel)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom"
;;
*.xcdatamodeld)
echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\""
xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd"
;;
*.xcmappingmodel)
echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\""
xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm"
;;
*.xcassets)
ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH")
XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE")
;;
*)
echo "$RESOURCE_PATH"
echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY"
;;
esac
}
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
while read line; do
if [[ $line != "`realpath $PODS_ROOT`*" ]]; then
XCASSET_FILES+=("$line")
fi
done <<<"$OTHER_XCASSETS"
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi
| attheodo/ATHExtensions | Example/Pods/Target Support Files/Pods-ATHExtensions_Tests/Pods-ATHExtensions_Tests-resources.sh | Shell | mit | 5,093 |
/*
* jQuery UI Accordion @VERSION
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Accordion#theming
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; } | hametan/baiducdnstatic | libs/jqueryui/1.8.5/themes/sunny/jquery.ui.accordion.css | CSS | mit | 1,067 |
!function(a){var b=window.webshims;setTimeout(function(){b.isReady("geolocation",!0)});var c=function(){setTimeout(function(){throw"document.write is overwritten by geolocation shim. This method is incompatible with this plugin"},1)},d=0,e=b.cfg.geolocation||{};navigator.geolocation||(navigator.geolocation={}),a.extend(navigator.geolocation,function(){var f,g={getCurrentPosition:function(d,g,h){var i,j,k,l=2,m=function(){if(!k)if(f){if(k=!0,d(a.extend({timestamp:(new Date).getTime()},f)),o(),window.JSON&&window.sessionStorage)try{sessionStorage.setItem("storedGeolocationData654321",JSON.stringify(f))}catch(b){}}else g&&!l&&(k=!0,o(),g({code:2,message:"POSITION_UNAVAILABLE"}))},n=function(){l--,p(),m()},o=function(){a(document).off("google-loader",o),clearTimeout(j),clearTimeout(i)},p=function(){if(f||!window.google||!google.loader||!google.loader.ClientLocation)return!1;var b=google.loader.ClientLocation;return f={coords:{latitude:b.latitude,longitude:b.longitude,altitude:null,accuracy:43e3,altitudeAccuracy:null,heading:parseInt("NaN",10),velocity:null},address:a.extend({streetNumber:"",street:"",premises:"",county:"",postalCode:""},b.address)},!0},q=function(){if(!f&&(p(),!f&&window.JSON&&window.sessionStorage))try{f=sessionStorage.getItem("storedGeolocationData654321"),f=f?JSON.parse(f):!1,f.coords||(f=!1)}catch(a){f=!1}};return q(),f?void setTimeout(m,1):e.confirmText&&!confirm(e.confirmText.replace("{location}",location.hostname))?void(g&&g({code:1,message:"PERMISSION_DENIED"})):(a.ajax({url:"http://freegeoip.net/json/",dataType:"jsonp",cache:!0,jsonp:"callback",success:function(a){l--,a&&(f=f||{coords:{latitude:a.latitude,longitude:a.longitude,altitude:null,accuracy:43e3,altitudeAccuracy:null,heading:parseInt("NaN",10),velocity:null},address:{city:a.city,country:a.country_name,countryCode:a.country_code,county:"",postalCode:a.zipcode,premises:"",region:a.region_name,street:"",streetNumber:""}},m())},error:function(){l--,m()}}),clearTimeout(j),window.google&&window.google.loader?l--:j=setTimeout(function(){e.destroyWrite&&(document.write=c,document.writeln=c),a(document).one("google-loader",n),b.loader.loadScript("http://www.google.com/jsapi",!1,"google-loader")},800),void(i=h&&h.timeout?setTimeout(function(){o(),g&&g({code:3,message:"TIMEOUT"})},h.timeout):setTimeout(function(){l=0,m()},1e4)))},clearWatch:a.noop};return g.watchPosition=function(a,b,c){return g.getCurrentPosition(a,b,c),d++,d},g}()),b.isReady("geolocation",!0)}(webshims.$),webshims.register("details",function(a,b,c,d,e,f){var g=function(b){var c=a(b).parent("details");return c[0]&&c.children(":first").get(0)===b?c:void 0},h=function(b,c){b=a(b),c=a(c);var d=a.data(c[0],"summaryElement");a.data(b[0],"detailsElement",c),d&&b[0]===d[0]||(d&&(d.hasClass("fallback-summary")?d.remove():d.off(".summaryPolyfill").removeData("detailsElement").removeAttr("role").removeAttr("tabindex").removeAttr("aria-expanded").removeClass("summary-button").find("span.details-open-indicator").remove()),a.data(c[0],"summaryElement",b),c.prop("open",c.prop("open")))},i=function(b){var c=a.data(b,"summaryElement");return c||(c=a(b).children("summary:first-child"),c[0]?h(c,b):(a(b).prependPolyfill('<summary class="fallback-summary">'+f.text+"</summary>"),c=a.data(b,"summaryElement"))),c};b.createElement("summary",function(){var c=g(this);if(c&&!a.data(this,"detailsElement")){var d,e,f=a.attr(this,"tabIndex")||"0";h(this,c),a(this).on({"focus.summaryPolyfill":function(){a(this).addClass("summary-has-focus")},"blur.summaryPolyfill":function(){a(this).removeClass("summary-has-focus")},"mouseenter.summaryPolyfill":function(){a(this).addClass("summary-has-hover")},"mouseleave.summaryPolyfill":function(){a(this).removeClass("summary-has-hover")},"click.summaryPolyfill":function(b){var c=g(this);if(c){if(!e&&b.originalEvent)return e=!0,b.stopImmediatePropagation(),b.preventDefault(),a(this).trigger("click"),e=!1,!1;clearTimeout(d),d=setTimeout(function(){b.isDefaultPrevented()||c.prop("open",!c.prop("open"))},0)}},"keydown.summaryPolyfill":function(b){13!=b.keyCode&&32!=b.keyCode||b.isDefaultPrevented()||(e=!0,b.preventDefault(),a(this).trigger("click"),e=!1)}}).attr({tabindex:f,role:"button"}).prepend('<span class="details-open-indicator" />'),b.moveToFirstEvent(this,"click")}});var j;b.defineNodeNamesBooleanProperty("details","open",function(b){var c=a(a.data(this,"summaryElement"));if(c){var d=b?"removeClass":"addClass",e=a(this);if(!j&&f.animate){e.stop().css({width:"",height:""});var g={width:e.width(),height:e.height()}}if(c.attr("aria-expanded",""+b),e[d]("closed-details-summary").children().not(c[0])[d]("closed-details-child"),!j&&f.animate){var h={width:e.width(),height:e.height()};e.css(g).animate(h,{complete:function(){a(this).css({width:"",height:""})}})}}}),b.createElement("details",function(){j=!0;i(this);a.prop(this,"open",a.prop(this,"open")),j=!1})}),webshims.register("mediaelement-jaris",function(a,b,c,d,e,f){"use strict";var g=b.mediaelement,h=c.swfmini,i=b.support,j=i.mediaelement,k=h.hasFlashPlayerVersion("11.3"),l=0,m="ActiveXObject"in c&&j,n={paused:!0,ended:!1,currentSrc:"",duration:c.NaN,readyState:0,networkState:0,videoHeight:0,videoWidth:0,seeking:!1,error:null,buffered:{start:function(a){return a?void b.error("buffered index size error"):0},end:function(a){return a?void b.error("buffered index size error"):0},length:0}},o=Object.keys(n),p={currentTime:0,volume:1,muted:!1},q=(Object.keys(p),a.extend({isActive:"html5",activating:"html5",wasSwfReady:!1,_usermedia:null,_bufferedEnd:0,_bufferedStart:0,currentTime:0,lastCalledTime:-500,_ppFlag:e,_calledMeta:!1,lastDuration:0,_timeDif:.3},n,p)),r=function(a){try{a.nodeName}catch(c){return null}var d=b.data(a,"mediaelement");return d&&"third"==d.isActive?d:null},s=function(b,c){c=a.Event(c),c.preventDefault(),a.event.trigger(c,e,b)},t=f.playerPath||b.cfg.basePath+"swf/"+(f.playerName||"JarisFLVPlayer.swf");b.extendUNDEFProp(f.params,{allowscriptaccess:"always",allowfullscreen:"true",wmode:"transparent",allowNetworking:"all"}),b.extendUNDEFProp(f.vars,{controltype:"1",jsapi:"1"}),b.extendUNDEFProp(f.attrs,{bgcolor:"#000000"}),f.playerPath=t;var u=function(a,b){3>a&&clearTimeout(b._canplaythroughTimer),a>=3&&b.readyState<3&&(b.readyState=a,s(b._elem,"canplay"),b.paused||s(b._elem,"playing"),clearTimeout(b._canplaythroughTimer),b._canplaythroughTimer=setTimeout(function(){u(4,b)},4e3)),a>=4&&b.readyState<4&&(b.readyState=a,s(b._elem,"canplaythrough")),b.readyState=a},v=function(b){b.seeking&&Math.abs(b.currentTime-b._lastSeektime)<2&&(b.seeking=!1,a(b._elem).triggerHandler("seeked"))};g.jarisEvent=g.jarisEvent||{};var w,x={onPlayPause:function(a,b,c){var d,e,f=b.paused||b.ended;if(null==c)try{d=b.api.api_get("isPlaying")}catch(g){}else d=c;(d==f||null==d)&&(b.paused=!d,e=b.paused?"pause":"play",b._ppFlag=!0,s(b._elem,e)),b.paused&&d!=f&&null!=d||b.readyState<3&&u(3,b),b.paused||s(b._elem,"playing")},onSeek:function(b,c){c._lastSeektime=b.seekTime,c.seeking=!0,a(c._elem).triggerHandler("seeking"),clearTimeout(c._seekedTimer),c._seekedTimer=setTimeout(function(){v(c),c.seeking=!1},300)},onConnectionFailed:function(a,b){g.setError(b._elem,"flash connection error")},onNotBuffering:function(a,b){u(3,b)},onDataInitialized:function(a,b){var c,d=b.duration;b.duration=a.duration,d==b.duration||isNaN(b.duration)||b._calledMeta&&(c=Math.abs(b.lastDuration-b.duration))<2||(b.videoHeight=a.height,b.videoWidth=a.width,b.networkState||(b.networkState=2),b.readyState<1&&u(1,b),clearTimeout(b._durationChangeTimer),b._calledMeta&&b.duration?b._durationChangeTimer=setTimeout(function(){b.lastDuration=b.duration,s(b._elem,"durationchange")},c>50?0:c>9?9:99):(b.lastDuration=b.duration,b.duration&&s(b._elem,"durationchange"),b._calledMeta||s(b._elem,"loadedmetadata"),b._timeDif=b.duration>1&&b.duration<140?.2:b.duration<600?.25:.3),b._calledMeta=!0)},onBuffering:function(a,b){b.ended&&(b.ended=!1),u(1,b),s(b._elem,"waiting")},onTimeUpdate:function(b,c){var d=c.currentTime-c.lastCalledTime;c.ended&&(c.ended=!1),c.readyState<3&&(u(3,c),s(c._elem,"playing")),c.seeking&&v(c),(d>c._timeDif||-.3>d)&&(c.lastCalledTime=c.currentTime,a.event.trigger("timeupdate",e,c._elem,!0))},onProgress:function(b,c){if(c.ended&&(c.ended=!1),c.duration&&!isNaN(c.duration)){var d=b.loaded/b.total;d>.02&&.2>d?u(3,c):d>.2&&(d>.95&&(d=1,c.networkState=1),u(4,c)),c._bufferedEnd&&c._bufferedEnd>d&&(c._bufferedStart=c.currentTime||0),c._bufferedEnd=d,c.buffered.length=1,a.event.trigger("progress",e,c._elem,!0)}},onPlaybackFinished:function(a,b){b.readyState<4&&u(4,b),b.ended=!0,s(b._elem,"ended")},onVolumeChange:function(a,b){(b.volume!=a.volume||b.muted!=a.mute)&&(b.volume=a.volume,b.muted=a.mute,s(b._elem,"volumechange"))},ready:function(){var c=function(a){var b=!0;try{a.api.api_get("volume")}catch(c){b=!1}return b};return function(d,e){var f=0,g=function(){return f>9?void(e.tryedReframeing=0):(f++,e.tryedReframeing++,void(c(e)?(e.wasSwfReady=!0,e.tryedReframeing=0,z(e),y(e)):e.tryedReframeing<6?e.tryedReframeing<3?(e.reframeTimer=setTimeout(g,9),e.shadowElem.css({overflow:"visible"}),setTimeout(function(){e.shadowElem.css({overflow:"hidden"})},1)):(e.shadowElem.css({overflow:"hidden"}),a(e._elem).mediaLoad()):(clearTimeout(e.reframeTimer),b.error("reframing error"))))};e&&e.api&&(e.tryedReframeing||(e.tryedReframeing=0),clearTimeout(w),clearTimeout(e.reframeTimer),e.shadowElem.removeClass("flashblocker-assumed"),f?e.reframeTimer=setTimeout(g,9):g())}}()};x.onMute=x.onVolumeChange,g.onEvent=x;var y=function(a){var c,d=a.actionQueue.length,e=0;if(d&&"third"==a.isActive)for(;a.actionQueue.length&&d>e;){e++,c=a.actionQueue.shift();try{a.api[c.fn].apply(a.api,c.args)}catch(f){b.warn(f)}}a.actionQueue.length&&(a.actionQueue=[])},z=function(b){b&&((b._ppFlag===e&&a.prop(b._elem,"autoplay")||!b.paused)&&setTimeout(function(){if("third"==b.isActive&&(b._ppFlag===e||!b.paused))try{a(b._elem).play(),b._ppFlag=!0}catch(c){}},1),b.muted&&a.prop(b._elem,"muted",!0),1!=b.volume&&a.prop(b._elem,"volume",b.volume))},A=a.noop;if(j){var B={play:1,playing:1},C=["play","pause","playing","loadstart","canplay","progress","waiting","ended","loadedmetadata","durationchange","emptied"],D=C.map(function(a){return a+".webshimspolyfill"}).join(" "),E=function(c){var d=b.data(c.target,"mediaelement");if(d){var e=c.originalEvent&&c.originalEvent.type===c.type;e==("third"==d.activating)&&(c.stopImmediatePropagation(),B[c.type]&&(d.isActive!=d.activating?a(c.target).pause():e&&(a.prop(c.target,"pause")._supvalue||a.noop).apply(c.target)))}};A=function(c){a(c).off(D).on(D,E),C.forEach(function(a){b.moveToFirstEvent(c,a)})},A(d)}g.setActive=function(c,d,e){if(e||(e=b.data(c,"mediaelement")),e&&e.isActive!=d){"html5"!=d&&"third"!=d&&b.warn("wrong type for mediaelement activating: "+d);var f=b.data(c,"shadowData");e.activating=d,a(c).pause(),e.isActive=d,"third"==d?(f.shadowElement=f.shadowFocusElement=e.shadowElem[0],a(c).addClass("swf-api-active nonnative-api-active").hide().getShadowElement().show()):(a(c).removeClass("swf-api-active nonnative-api-active").show().getShadowElement().hide(),f.shadowElement=f.shadowFocusElement=!1),a(c).trigger("mediaelementapichange")}};var F=function(){var a=["_calledMeta","lastDuration","_bufferedEnd","lastCalledTime","_usermedia","_bufferedStart","_ppFlag","currentSrc","currentTime","duration","ended","networkState","paused","seeking","videoHeight","videoWidth"],b=a.length;return function(c){if(c){clearTimeout(c._seekedTimer);var d=b,e=c.networkState;for(u(0,c),clearTimeout(c._durationChangeTimer);--d>-1;)delete c[a[d]];c.actionQueue=[],c.buffered.length=0,e&&s(c._elem,"emptied")}}}(),G=function(){var e={},f=function(b){var c,f,g;return e[b.currentSrc]?c=e[b.currentSrc]:b.videoHeight&&b.videoWidth?(e[b.currentSrc]={width:b.videoWidth,height:b.videoHeight},c=e[b.currentSrc]):(f=a.attr(b._elem,"poster"))&&(c=e[f],c||(g=d.createElement("img"),g.onload=function(){e[f]={width:this.width,height:this.height},e[f].height&&e[f].width?H(b,a.prop(b._elem,"controls")):delete e[f],g.onload=null},g.src=f,g.complete&&g.onload&&g.onload())),c||{width:300,height:"video"==b._elemNodeName?150:50}},g=function(a,b){return a.style[b]||a.currentStyle&&a.currentStyle[b]||c.getComputedStyle&&(c.getComputedStyle(a,null)||{})[b]||""},h=["minWidth","maxWidth","minHeight","maxHeight"],i=function(a,b){var c,d,e=!1;for(c=0;4>c;c++)d=g(a,h[c]),parseFloat(d,10)&&(e=!0,b[h[c]]=d);return e},j=function(c){var d,e,h=c._elem,j={width:"auto"==g(h,"width"),height:"auto"==g(h,"height")},k={width:!j.width&&a(h).width(),height:!j.height&&a(h).height()};return(j.width||j.height)&&(d=f(c),e=d.width/d.height,j.width&&j.height?(k.width=d.width,k.height=d.height):j.width?k.width=k.height*e:j.height&&(k.height=k.width/e),i(h,k)&&(c.shadowElem.css(k),j.width&&(k.width=c.shadowElem.height()*e),j.height&&(k.height=(j.width?k.width:c.shadowElem.width())/e),j.width&&j.height&&(c.shadowElem.css(k),k.height=c.shadowElem.width()/e,k.width=k.height*e,c.shadowElem.css(k),k.width=c.shadowElem.height()*e,k.height=k.width/e),b.support.mediaelement||(k.width=c.shadowElem.width(),k.height=c.shadowElem.height()))),k};return j}(),H=function(b,c){var d,e=b.shadowElem;a(b._elem)[c?"addClass":"removeClass"]("webshims-controls"),("third"==b.isActive||"third"==b.activating)&&("audio"!=b._elemNodeName||c?(b._elem.style.display="",d=G(b),b._elem.style.display="none",e.css(d)):e.css({width:0,height:0}))},I=function(){var b={"":1,auto:1};return function(c){var d=a.attr(c,"preload");return null==d||"none"==d||a.prop(c,"autoplay")?!1:(d=a.prop(c,"preload"),!!(b[d]||"metadata"==d&&a(c).is(".preload-in-doubt, video:not([poster])")))}}(),J={A:/&/g,a:/&/g,e:/\=/g,q:/\?/g},K=function(a){return a.replace?a.replace(J.A,"%26").replace(J.a,"%26").replace(J.e,"%3D").replace(J.q,"%3F"):a};if("matchMedia"in c){var L=!1;try{L=c.matchMedia("only all").matches}catch(M){}L&&(g.sortMedia=function(a,b){try{a=!a.media||matchMedia(a.media).matches,b=!b.media||matchMedia(b.media).matches}catch(c){return 0}return a==b?0:a?-1:1})}g.resetSwfProps=F,g.createSWF=function(c,e,f){if(!k)return void setTimeout(function(){a(c).mediaLoad()},1);var h={};1>l?l=1:l++,f||(f=b.data(c,"mediaelement")),((h.height=a.attr(c,"height")||"")||(h.width=a.attr(c,"width")||""))&&(a(c).css(h),b.warn("width or height content attributes used. Webshims prefers the usage of CSS (computed styles or inline styles) to detect size of a video/audio. It's really more powerfull."));var i,m=e.streamrequest,n="jarisplayer/stream"==e.type,o=a.prop(c,"controls"),p="jarisplayer-"+b.getID(c),r=c.nodeName.toLowerCase(),t=function(){"third"==f.isActive&&H(f,a.prop(c,"controls"))};return n&&!m?void webshim.usermedia.attach(c,e,f):(f&&f.swfCreated?(g.setActive(c,"third",f),f.currentSrc="",f.shadowElem.html('<div id="'+p+'">'),f.api=!1,f.actionQueue=[],i=f.shadowElem,F(f),f.currentSrc=e.srcProp):(a(d.getElementById("wrapper-"+p)).remove(),i=a('<div class="polyfill-'+r+" polyfill-mediaelement "+b.shadowClass+'" id="wrapper-'+p+'"><div id="'+p+'"></div>').css({position:"relative",overflow:"hidden"}),f=b.data(c,"mediaelement",b.objectCreate(q,{actionQueue:{value:[]},shadowElem:{value:i},_elemNodeName:{value:r},_elem:{value:c},currentSrc:{value:m?"":e.srcProp},swfCreated:{value:!0},id:{value:p.replace(/-/g,"")},buffered:{value:{start:function(a){return a>=f.buffered.length?void b.error("buffered index size error"):0},end:function(a){return a>=f.buffered.length?void b.error("buffered index size error"):(f.duration-f._bufferedStart)*f._bufferedEnd+f._bufferedStart},length:0}}})),i.insertBefore(c),j&&a.extend(f,{volume:a.prop(c,"volume"),muted:a.prop(c,"muted"),paused:a.prop(c,"paused")}),b.addShadowDom(c,i),b.data(c,"mediaelement")||b.data(c,"mediaelement",f),A(c),g.setActive(c,"third",f),H(f,o),a(c).on({"updatemediaelementdimensions loadedmetadata emptied":t,remove:function(a){!a.originalEvent&&g.jarisEvent[f.id]&&g.jarisEvent[f.id].elem==c&&(delete g.jarisEvent[f.id],clearTimeout(w),clearTimeout(f.flashBlock))}}).onWSOff("updateshadowdom",t)),g.jarisEvent[f.id]&&g.jarisEvent[f.id].elem!=c?void b.error("something went wrong"):(g.jarisEvent[f.id]||(g.jarisEvent[f.id]=function(a){if("ready"==a.type){var b=function(){f.api&&(f.paused||f.api.api_play(),I(c)&&f.api.api_preload(),x.ready(a,f))};f.api?b():setTimeout(b,9)}else f.currentTime=a.position,f.api&&(!f._calledMeta&&isNaN(a.duration)&&f.duration!=a.duration&&isNaN(f.duration)&&x.onDataInitialized(a,f),f._ppFlag||"onPlayPause"==a.type||x.onPlayPause(a,f),x[a.type]&&x[a.type](a,f)),f.duration=a.duration},g.jarisEvent[f.id].elem=c),N(c,e,f,p,o,r),void(m||s(f._elem,"loadstart"))))};var N=function(c,d,e,g,i,j){var k,l,m,n,o="audio/rtmp"==d.type||"video/rtmp"==d.type,p="jarisplayer/stream"==d.type;k=a.extend({},f.vars,{poster:K(a.attr(c,"poster")&&a.prop(c,"poster")||""),source:K(d.streamId||d.srcProp),server:K(d.server||"")}),l=a(c).data("vars")||{},a.extend(k,{id:g,evtId:e.id,controls:""+(!p&&i),autostart:"false",nodename:j},l),o?k.streamtype="rtmp":p?k.streamtype="usermedia":"audio/mpeg"==d.type||"audio/mp3"==d.type?(k.type="audio",k.streamtype="file"):"video/youtube"==d.type&&(k.streamtype="youtube"),n=a.extend({},f.attrs,{name:g,id:g},a(c).data("attrs")),m=a.extend({},f.params,a(c).data("params")),f.changeSWF(k,c,d,e,"embed"),clearTimeout(e.flashBlock),h.embedSWF(t,g,"100%","100%","11.3",!1,k,m,n,function(f){if(f.success){var g=function(){(!f.ref.parentNode&&box[0].parentNode||"none"==f.ref.style.display)&&(box.addClass("flashblocker-assumed"),a(c).trigger("flashblocker"),b.warn("flashblocker assumed")),a(f.ref).css({minHeight:"2px",minWidth:"2px",display:"block"})};e.api=f.ref,i||a(f.ref).attr("tabindex","-1").css("outline","none"),e.flashBlock=setTimeout(g,99),w||(clearTimeout(w),w=setTimeout(function(){g();var c=a(f.ref);c[0].offsetWidth>1&&c[0].offsetHeight>1&&0===location.protocol.indexOf("file:")?b.error("Add your local development-directory to the local-trusted security sandbox: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html"):(c[0].offsetWidth<2||c[0].offsetHeight<2)&&b.warn("JS-SWF connection can't be established on hidden or unconnected flash objects"),c=null},8e3)),p&&webshim.usermedia.request(c,d,e)}})},O=function(a,b,c,d){return d=d||r(a),d?(d.api&&d.api[b]?d.api[b].apply(d.api,c||[]):(d.actionQueue.push({fn:b,args:c}),d.actionQueue.length>10&&setTimeout(function(){d.actionQueue.length>5&&d.actionQueue.shift()},99)),d):!1};g.queueSwfMethod=O,["audio","video"].forEach(function(c){var d,e={},f=function(a){("audio"!=c||"videoHeight"!=a&&"videoWidth"!=a)&&(e[a]={get:function(){var b=r(this);return b?b[a]:j&&d[a].prop._supget?d[a].prop._supget.apply(this):q[a]},writeable:!1})},g=function(a,b){f(a),delete e[a].writeable,e[a].set=b};g("seeking"),g("volume",function(a){var c=r(this);if(c)a*=1,isNaN(a)||((0>a||a>1)&&b.error("volume greater or less than allowed "+a/100),O(this,"api_volume",[a],c),c.volume!=a&&(c.volume=a,s(c._elem,"volumechange")),c=null);else if(d.volume.prop._supset)return d.volume.prop._supset.apply(this,arguments)}),g("muted",function(a){var b=r(this);if(b)a=!!a,O(this,"api_muted",[a],b),b.muted!=a&&(b.muted=a,s(b._elem,"volumechange")),b=null;else if(d.muted.prop._supset)return d.muted.prop._supset.apply(this,arguments)}),g("currentTime",function(a){var b=r(this);if(b)a*=1,isNaN(a)||O(this,"api_seek",[a],b);else if(d.currentTime.prop._supset)return d.currentTime.prop._supset.apply(this,arguments)}),["play","pause"].forEach(function(a){e[a]={value:function(){var b=r(this);if(b)b.stopPlayPause&&clearTimeout(b.stopPlayPause),O(this,"play"==a?"api_play":"api_pause",[],b),b._ppFlag=!0,b.paused!=("play"!=a)&&(b.paused="play"!=a,s(b._elem,a));else if(d[a].prop._supvalue)return d[a].prop._supvalue.apply(this,arguments)}}}),o.forEach(f),b.onNodeNamesPropertyModify(c,"controls",function(b,d){var e=r(this);a(this)[d?"addClass":"removeClass"]("webshims-controls"),e&&("audio"==c&&H(e,d),O(this,"api_controls",[d],e))}),b.onNodeNamesPropertyModify(c,"preload",function(){var c,d,e;I(this)&&(c=r(this),c?O(this,"api_preload",[],c):!m||!this.paused||this.error||a.data(this,"mediaerror")||this.readyState||this.networkState||this.autoplay||!a(this).is(":not(.nonnative-api-active)")||(e=this,d=b.data(e,"mediaelementBase")||b.data(e,"mediaelementBase",{}),clearTimeout(d.loadTimer),d.loadTimer=setTimeout(function(){a(e).mediaLoad()},9)))}),d=b.defineNodeNameProperties(c,e,"prop"),i.mediaDefaultMuted||b.defineNodeNameProperties(c,{defaultMuted:{get:function(){return null!=a.attr(this,"muted")},set:function(b){b?a.attr(this,"muted",""):a(this).removeAttr("muted")}}},"prop")});var P=function(){if(!c.CanvasRenderingContext2D)return!1;var a=CanvasRenderingContext2D.prototype.drawImage,d=Array.prototype.slice,e={video:1,VIDEO:1},f={};return a||webshim.error("canvas.drawImage feature is needed. In IE8 flashvanvas pro can be used"),CanvasRenderingContext2D.prototype.drawImage=function(c){var g,h,i,j,k=this;if(e[c.nodeName]&&(g=b.data(c,"mediaelement"))&&"third"==g.isActive&&g.api.api_image){try{j=g.api.api_image()}catch(l){b.error(l)}return f[g.currentSrc]||(f[g.currentSrc]=!0,null==j&&b.error("video has to be same origin or a crossdomain.xml has to be provided. Video has to be visible for flash API")),i=d.call(arguments,1),h=new Image,h.onload=function(){i.unshift(this),a.apply(k,i),h.onload=null},h.src="data:image/jpeg;base64,"+j,void(h.complete&&h.onload())}return a.apply(this,arguments)},!0};if(P()||b.ready("canvas",P),k&&a.cleanData){var Q=a.cleanData,R=d.createElement("object"),S={SetVariable:1,GetVariable:1,SetReturnValue:1,GetReturnValue:1},T={object:1,OBJECT:1};a.cleanData=function(a){var b,c,d,e=Q.apply(this,arguments);if(a&&(c=a.length)&&l)for(b=0;c>b;b++)if(T[a[b].nodeName]&&"api_destroy"in a[b]){l--;try{if(a[b].api_destroy(),4==a[b].readyState)for(d in a[b])S[d]||R[d]||"function"!=typeof a[b][d]||(a[b][d]=null)}catch(f){console.log(f)}}return e}}if(j?"media"in d.createElement("source")||b.reflectProperties("source",["media"]):(["poster","src"].forEach(function(a){b.defineNodeNamesProperty("src"==a?["audio","video","source"]:["video"],a,{reflect:!0,propType:"src"})}),b.defineNodeNamesProperty(["audio","video"],"preload",{reflect:!0,propType:"enumarated",defaultValue:"",limitedTo:["","auto","metadata","none"]}),b.reflectProperties("source",["type","media"]),["autoplay","controls"].forEach(function(a){b.defineNodeNamesBooleanProperty(["audio","video"],a)}),b.defineNodeNamesProperties(["audio","video"],{HAVE_CURRENT_DATA:{value:2},HAVE_ENOUGH_DATA:{value:4},HAVE_FUTURE_DATA:{value:3},HAVE_METADATA:{value:1},HAVE_NOTHING:{value:0},NETWORK_EMPTY:{value:0},NETWORK_IDLE:{value:1},NETWORK_LOADING:{value:2},NETWORK_NO_SOURCE:{value:3}},"prop"),k&&b.ready("WINDOWLOAD",function(){setTimeout(function(){l||(d.createElement("img").src=t)},9)})),j&&k&&!f.preferFlash){var U={3:1,4:1},V=function(c){var e,g,h;(a(c.target).is("audio, video")||(h=c.target.parentNode)&&a("source",h).last()[0]==c.target)&&(e=a(c.target).closest("audio, video"))&&!e.hasClass("nonnative-api-active")&&(g=e.prop("error"),setTimeout(function(){e.hasClass("nonnative-api-active")||(g&&U[g.code]&&(f.preferFlash=!0,d.removeEventListener("error",V,!0),a("audio, video").each(function(){b.mediaelement.selectSource(this)}),b.error("switching mediaelements option to 'preferFlash', due to an error with native player: "+c.target.currentSrc+" Mediaerror: "+e.prop("error")+" error.code: "+g.code)),b.warn("There was a mediaelement error. Run the following line in your console to get more info: webshim.mediaelement.loadDebugger();"))}))};d.addEventListener("error",V,!0),setTimeout(function(){a("audio, video").each(function(){var b=a.prop(this,"error");b&&U[b]&&V({target:this})})})}}),webshims.register("track",function(a,b,c,d){"use strict";function e(a,c,e){3!=arguments.length&&b.error("wrong arguments.length for VTTCue.constructor"),this.startTime=a,this.endTime=c,this.text=e,this.onenter=null,this.onexit=null,this.pauseOnExit=!1,this.track=null,this.id=null,this.getCueAsHTML=function(){var a,b="",c="";return function(){var e,g;if(a||(a=d.createDocumentFragment()),b!=this.text)for(b=this.text,c=f.parseCueTextToHTML(b),t.innerHTML=c,e=0,g=t.childNodes.length;g>e;e++)a.appendChild(t.childNodes[e].cloneNode(!0));return a.cloneNode(!0)}}()}var f=b.mediaelement,g=((new Date).getTime(),{subtitles:1,captions:1,descriptions:1}),h=a("<track />"),i=b.support,j=i.ES5&&i.objectAccessor,k=function(a){var c={};return a.addEventListener=function(a,d){c[a]&&b.error("always use $.on to the shimed event: "+a+" already bound fn was: "+c[a]+" your fn was: "+d),c[a]=d},a.removeEventListener=function(a,d){c[a]&&c[a]!=d&&b.error("always use $.on/$.off to the shimed event: "+a+" already bound fn was: "+c[a]+" your fn was: "+d),c[a]&&delete c[a]},a},l={getCueById:function(a){for(var b=null,c=0,d=this.length;d>c;c++)if(this[c].id===a){b=this[c];break}return b}},m={0:"disabled",1:"hidden",2:"showing"},n={shimActiveCues:null,_shimActiveCues:null,activeCues:null,cues:null,kind:"subtitles",label:"",language:"",id:"",mode:"disabled",oncuechange:null,toString:function(){return"[object TextTrack]"},addCue:function(a){if(this.cues){var c=this.cues[this.cues.length-1];c&&c.startTime>a.startTime&&b.error("cue startTime higher than previous cue's startTime")}else this.cues=f.createCueList();a.track&&a.track.removeCue&&a.track.removeCue(a),a.track=this,this.cues.push(a)},removeCue:function(a){var c=this.cues||[],d=0,e=c.length;if(a.track!=this)return void b.error("cue not part of track");for(;e>d;d++)if(c[d]===a){c.splice(d,1),a.track=null;break}return a.track?void b.error("cue not part of track"):void 0}},o=["kind","label","srclang"],p={srclang:"language"},q=function(c,d){var e,f,g=[],h=[],i=[];if(c||(c=b.data(this,"mediaelementBase")||b.data(this,"mediaelementBase",{})),d||(c.blockTrackListUpdate=!0,d=a.prop(this,"textTracks"),c.blockTrackListUpdate=!1),clearTimeout(c.updateTrackListTimer),a("track",this).each(function(){var b=a.prop(this,"track");i.push(b),-1==d.indexOf(b)&&h.push(b)}),c.scriptedTextTracks)for(e=0,f=c.scriptedTextTracks.length;f>e;e++)i.push(c.scriptedTextTracks[e]),-1==d.indexOf(c.scriptedTextTracks[e])&&h.push(c.scriptedTextTracks[e]);for(e=0,f=d.length;f>e;e++)-1==i.indexOf(d[e])&&g.push(d[e]);if(g.length||h.length){for(d.splice(0),e=0,f=i.length;f>e;e++)d.push(i[e]);for(e=0,f=g.length;f>e;e++)a([d]).triggerHandler(a.Event({type:"removetrack",track:g[e]}));for(e=0,f=h.length;f>e;e++)a([d]).triggerHandler(a.Event({type:"addtrack",track:h[e]}));(c.scriptedTextTracks||g.length)&&a(this).triggerHandler("updatetrackdisplay")}},r=function(c,d){d||(d=b.data(c,"trackData")),d&&!d.isTriggering&&(d.isTriggering=!0,setTimeout(function(){a(c).closest("audio, video").triggerHandler("updatetrackdisplay"),d.isTriggering=!1},1))},s=function(){var c={subtitles:{subtitles:1,captions:1},descriptions:{descriptions:1},chapters:{chapters:1}};return c.captions=c.subtitles,function(d){var e,f,g=a.prop(d,"default");return g&&"metadata"!=(e=a.prop(d,"kind"))&&(f=a(d).parent().find("track[default]").filter(function(){return!!c[e][a.prop(this,"kind")]})[0],f!=d&&(g=!1,b.error("more than one default track of a specific kind detected. Fall back to default = false"))),g}}(),t=a("<div />")[0];c.VTTCue=e,c.TextTrackCue=function(){b.error("Use VTTCue constructor instead of abstract TextTrackCue constructor."),e.apply(this,arguments)},c.TextTrackCue.prototype=e.prototype,f.createCueList=function(){return a.extend([],l)},f.parseCueTextToHTML=function(){var a=/(<\/?[^>]+>)/gi,b=/^(?:c|v|ruby|rt|b|i|u)/,c=/\<\s*\//,d=function(a,b,d,e){var f;return c.test(e)?f="</"+a+">":(d.splice(0,1),f="<"+a+" "+b+'="'+d.join(" ").replace(/\"/g,""")+'">'),f},e=function(a){var c=a.replace(/[<\/>]+/gi,"").split(/[\s\.]+/);return c[0]&&(c[0]=c[0].toLowerCase(),b.test(c[0])?"c"==c[0]?a=d("span","class",c,a):"v"==c[0]&&(a=d("q","title",c,a)):a=""),a};return function(b){return b.replace(a,e)}}();var u=function(b){var c=b+"",d=this.getAttribute("begin")||"",e=this.getAttribute("end")||"",f=a.trim(a.text(this));return/\./.test(d)||(d+=".000"),/\./.test(e)||(e+=".000"),c+="\n",c+=d+" --> "+e+"\n",c+=f},v=function(b){return b=a.parseXML(b)||[],a(b).find("[begin][end]").map(u).get().join("\n\n")||""},w=0;f.loadTextTrack=function(c,d,e,h){var i="play playing loadedmetadata loadstart",j=e.track,k=function(){var g,h,l,m="disabled"==j.mode,n=!(!(a.prop(c,"readyState")>0||2==a.prop(c,"networkState"))&&a.prop(c,"paused")),o=(!m||n)&&a.attr(d,"src")&&a.prop(d,"src");if(o&&(a(c).off(i,k).off("updatetrackdisplay",k),!e.readyState)){g=function(){w--,e.readyState=3,j.cues=null,j.activeCues=j.shimActiveCues=j._shimActiveCues=null,a(d).triggerHandler("error")},e.readyState=1;try{j.cues=f.createCueList(),j.activeCues=j.shimActiveCues=j._shimActiveCues=f.createCueList(),w++,l=function(){h=a.ajax({dataType:"text",url:o,success:function(i){w--;var k=h.getResponseHeader("content-type")||"";k.indexOf("application/xml")?k.indexOf("text/vtt")&&b.error("set the mime-type of your WebVTT files to text/vtt. see: http://dev.w3.org/html5/webvtt/#text/vtt"):i=v(i),f.parseCaptions(i,j,function(b){b&&"length"in b?(e.readyState=2,a(d).triggerHandler("load"),a(c).triggerHandler("updatetrackdisplay")):g()})},error:g})},m?setTimeout(l,2*w):l()}catch(p){g(),b.error(p)}}};e.readyState=0,j.shimActiveCues=null,j._shimActiveCues=null,j.activeCues=null,j.cues=null,a(c).on(i,k),h?(j.mode=g[j.kind]?"showing":"hidden",k()):a(c).on("updatetrackdisplay",k)},f.createTextTrack=function(c,d){var e,g;return d.nodeName&&(g=b.data(d,"trackData"),g&&(r(d,g),e=g.track)),e||(e=k(b.objectCreate(n)),j||o.forEach(function(b){var c=a.prop(d,b);c&&(e[p[b]||b]=c)}),d.nodeName?(j&&o.forEach(function(c){b.defineProperty(e,p[c]||c,{get:function(){return a.prop(d,c)}})}),e.id=a(d).prop("id"),g=b.data(d,"trackData",{track:e}),f.loadTextTrack(c,d,g,s(d))):(j&&o.forEach(function(a){b.defineProperty(e,p[a]||a,{value:d[a],writeable:!1})}),e.cues=f.createCueList(),e.activeCues=e._shimActiveCues=e.shimActiveCues=f.createCueList(),e.mode="hidden",e.readyState=2),"subtitles"!=e.kind||e.language||b.error("you must provide a language for track in subtitles state"),e.__wsmode=e.mode,b.defineProperty(e,"_wsUpdateMode",{value:function(){a(c).triggerHandler("updatetrackdisplay")},enumerable:!1})),e},a.propHooks.mode||(a.propHooks.mode={set:function(a,b){return a.mode=b,a._wsUpdateMode&&a._wsUpdateMode.call&&a._wsUpdateMode(),a.mode}}),f.parseCaptionChunk=function(){var a=/^(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s*(.*)/,c=/^(DEFAULTS|DEFAULT)\s+\-\-\>\s+(.*)/g,d=/^(STYLE|STYLES)\s+\-\-\>\s*\n([\s\S]*)/g,f=/^(COMMENT|COMMENTS)\s+\-\-\>\s+(.*)/g,g=/^(\d{2})?:?(\d{2}):(\d{2})[\.\,](\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})[\.\,](\d+)\s*(.*)/;return function(h){var i,j,k,l,m,n,o,p,q;if(c.exec(h)||f.exec(h)||d.exec(h))return null;for(i=h.split(/\n/g);!i[0].replace(/\s+/gi,"").length&&i.length>0;)i.shift();for(i[0].match(/^\s*[a-z0-9-\_]+\s*$/gi)&&(o=String(i.shift().replace(/\s*/gi,""))),n=0;n<i.length;n++){var r=i[n];((p=a.exec(r))||(p=g.exec(r)))&&(m=p.slice(1),j=parseInt(60*(m[0]||0)*60,10)+parseInt(60*(m[1]||0),10)+parseInt(m[2]||0,10)+parseFloat("0."+(m[3]||0)),k=parseInt(60*(m[4]||0)*60,10)+parseInt(60*(m[5]||0),10)+parseInt(m[6]||0,10)+parseFloat("0."+(m[7]||0))),i=i.slice(0,n).concat(i.slice(n+1));break}return j||k?(l=i.join("\n"),q=new e(j,k,l),o&&(q.id=o),q):(b.warn("couldn't extract time information: "+[j,k,i.join("\n"),o].join(" ; ")),null)}}(),f.parseCaptions=function(a,c,d){var e,g,h,i,j;f.createCueList(),a?(h=/^WEBVTT(\s*FILE)?/gi,g=function(k,l){for(;l>k;k++)if(e=a[k],h.test(e)?j=!0:e.replace(/\s*/gi,"").length&&(e=f.parseCaptionChunk(e,k),e&&c.addCue(e)),i<(new Date).getTime()-30){k++,setTimeout(function(){i=(new Date).getTime(),g(k,l)},90);break}k>=l&&(j||b.error("please use WebVTT format. This is the standard"),d(c.cues))},a=a.replace(/\r\n/g,"\n"),setTimeout(function(){a=a.replace(/\r/g,"\n"),setTimeout(function(){i=(new Date).getTime(),a=a.split(/\n\n+/g),g(0,a.length)
},9)},9)):b.error("Required parameter captionData not supplied.")},f.createTrackList=function(c,d){return d=d||b.data(c,"mediaelementBase")||b.data(c,"mediaelementBase",{}),d.textTracks||(d.textTracks=[],b.defineProperties(d.textTracks,{onaddtrack:{value:null},onremovetrack:{value:null},onchange:{value:null},getTrackById:{value:function(a){for(var b=null,c=0;c<d.textTracks.length;c++)if(a==d.textTracks[c].id){b=d.textTracks[c];break}return b}}}),k(d.textTracks),a(c).on("updatetrackdisplay",function(){for(var b,c=0;c<d.textTracks.length;c++)b=d.textTracks[c],b.__wsmode!=b.mode&&(b.__wsmode=b.mode,a([d.textTracks]).triggerHandler("change"))})),d.textTracks},i.track||(b.defineNodeNamesBooleanProperty(["track"],"default"),b.reflectProperties(["track"],["srclang","label"]),b.defineNodeNameProperties("track",{src:{reflect:!0,propType:"src"}})),b.defineNodeNameProperties("track",{kind:{attr:i.track?{set:function(a){var c=b.data(this,"trackData");this.setAttribute("data-kind",a),c&&(c.attrKind=a)},get:function(){var a=b.data(this,"trackData");return a&&"attrKind"in a?a.attrKind:this.getAttribute("kind")}}:{},reflect:!0,propType:"enumarated",defaultValue:"subtitles",limitedTo:["subtitles","captions","descriptions","chapters","metadata"]}}),a.each(o,function(c,d){var e=p[d]||d;b.onNodeNamesPropertyModify("track",d,function(){var c=b.data(this,"trackData");c&&("kind"==d&&r(this,c),j||(c.track[e]=a.prop(this,d)))})}),b.onNodeNamesPropertyModify("track","src",function(c){if(c){var d,e=b.data(this,"trackData");e&&(d=a(this).closest("video, audio"),d[0]&&f.loadTextTrack(d,this,e))}}),b.defineNodeNamesProperties(["track"],{ERROR:{value:3},LOADED:{value:2},LOADING:{value:1},NONE:{value:0},readyState:{get:function(){return(b.data(this,"trackData")||{readyState:0}).readyState},writeable:!1},track:{get:function(){return f.createTextTrack(a(this).closest("audio, video")[0],this)},writeable:!1}},"prop"),b.defineNodeNamesProperties(["audio","video"],{textTracks:{get:function(){var a=this,c=b.data(a,"mediaelementBase")||b.data(a,"mediaelementBase",{}),d=f.createTrackList(a,c);return c.blockTrackListUpdate||q.call(a,c,d),d},writeable:!1},addTextTrack:{value:function(a,c,d){var e=f.createTextTrack(this,{kind:h.prop("kind",a||"").prop("kind"),label:c||"",srclang:d||""}),g=b.data(this,"mediaelementBase")||b.data(this,"mediaelementBase",{});return g.scriptedTextTracks||(g.scriptedTextTracks=[]),g.scriptedTextTracks.push(e),q.call(this),e}}},"prop");var x=function(c){if(a(c.target).is("audio, video")){var d=b.data(c.target,"mediaelementBase");d&&(clearTimeout(d.updateTrackListTimer),d.updateTrackListTimer=setTimeout(function(){q.call(c.target,d)},0))}},y=function(a,b){return b.readyState||a.readyState},z=function(a){a.originalEvent&&a.stopImmediatePropagation()},A=function(){if(b.implement(this,"track")){var c,d=this.track;d&&(b.bugs.track||!d.mode&&!y(this,d)||(a.prop(this,"track").mode=m[d.mode]||d.mode),c=a.prop(this,"kind"),d.mode="string"==typeof d.mode?"disabled":0,this.kind="metadata",a(this).attr({kind:c})),a(this).on("load error",z)}};b.addReady(function(c,d){var e=d.filter("video, audio, track").closest("audio, video");a("video, audio",c).add(e).each(function(){q.call(this)}).on("emptied updatetracklist wsmediareload",x).each(function(){if(i.track){var c=a.prop(this,"textTracks"),d=this.textTracks;c.length!=d.length&&b.warn("textTracks couldn't be copied"),a("track",this).each(A)}}),e.each(function(){var a=this,c=b.data(a,"mediaelementBase");c&&(clearTimeout(c.updateTrackListTimer),c.updateTrackListTimer=setTimeout(function(){q.call(a,c)},9))})}),i.texttrackapi&&a("video, audio").trigger("trackapichange")}); | emmy41124/cdnjs | ajax/libs/webshim/1.15.0-RC1/minified/shims/combos/21.js | JavaScript | mit | 35,802 |
/*! SWFMini - a SWFObject 2.2 cut down version for webshims
*
* based on SWFObject v2.2 <http://code.google.com/p/swfobject/>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfmini = function() {
var wasRemoved = function(){webshims.error('This method was removed from swfmini');};
var UNDEF = "undefined",
OBJECT = "object",
webshims = window.webshims,
SHOCKWAVE_FLASH = "Shockwave Flash",
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
FLASH_MIME_TYPE = "application/x-shockwave-flash",
win = window,
doc = document,
nav = navigator,
plugin = false,
domLoadFnArr = [main],
isDomLoaded = false,
autoHideShow = true,
/* Centralized function for browser feature detection
- User agent string detection is only used when no good alternative is possible
- Is executed directly for optimal performance
*/
ua = function() {
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
u = nav.userAgent.toLowerCase(),
p = nav.platform.toLowerCase(),
windows = p ? /win/.test(p) : /win/.test(u),
mac = p ? /mac/.test(p) : /mac/.test(u),
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
playerVersion = [0,0,0],
d = null;
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
d = nav.plugins[SHOCKWAVE_FLASH].description;
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
plugin = true;
ie = false; // cascaded feature detection for Internet Explorer
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
}
}
else if (typeof win.ActiveXObject != UNDEF) {
try {
var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
if (a) { // a will return null when ActiveX is disabled
d = a.GetVariable("$version");
if (d) {
ie = true; // cascaded feature detection for Internet Explorer
d = d.split(" ")[1].split(",");
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
}
catch(e) {}
}
return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
}();
function callDomLoadFunctions() {
if (isDomLoaded) { return; }
isDomLoaded = true;
var dl = domLoadFnArr.length;
for (var i = 0; i < dl; i++) {
domLoadFnArr[i]();
}
}
function addDomLoadEvent(fn) {
if (isDomLoaded) {
fn();
}
else {
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
}
}
/* Main function
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
*/
function main() {
if (plugin) {
testPlayerVersion();
}
}
/* Detect the Flash Player version for non-Internet Explorer browsers
- Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
a. Both release and build numbers can be detected
b. Avoid wrong descriptions by corrupt installers provided by Adobe
c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
- Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
*/
function testPlayerVersion() {
var b = doc.getElementsByTagName("body")[0];
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
var t = b.appendChild(o);
if (t) {
var counter = 0;
(function(){
if (typeof t.GetVariable != UNDEF) {
var d = t.GetVariable("$version");
if (d) {
d = d.split(" ")[1].split(",");
ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
else if (counter < 10) {
counter++;
setTimeout(arguments.callee, 10);
return;
}
b.removeChild(o);
t = null;
})();
}
}
function createElement(el) {
return doc.createElement(el);
}
/* Flash Player and SWF content version matching
*/
function hasPlayerVersion(rv) {
var pv = ua.pv, v = rv.split(".");
v[0] = parseInt(v[0], 10);
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
v[2] = parseInt(v[2], 10) || 0;
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
}
webshims.ready('DOM', callDomLoadFunctions);
webshims.loader.addModule('swfmini-embed', {d: ['swfmini']});
var loadEmbed = hasPlayerVersion('9.0.0') ?
function(){
webshims.loader.loadList(['swfmini-embed']);
return true;
} :
webshims.$.noop
;
if(!webshims.support.mediaelement){
loadEmbed();
} else {
webshims.ready('WINDOWLOAD', loadEmbed);
}
return {
/* Public API
- Reference: http://code.google.com/p/swfobject/wiki/documentation
*/
registerObject: wasRemoved,
getObjectById: wasRemoved,
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
var args = arguments;
if(loadEmbed()){
webshims.ready('swfmini-embed', function(){
swfmini.embedSWF.apply(swfmini, args);
});
} else if(callbackFn) {
callbackFn({success:false, id:replaceElemIdStr});
}
},
switchOffAutoHideShow: function() {
autoHideShow = false;
},
ua: ua,
getFlashPlayerVersion: function() {
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
},
hasFlashPlayerVersion: hasPlayerVersion,
createSWF: function(attObj, parObj, replaceElemIdStr) {
if (ua.w3) {
return createSWF(attObj, parObj, replaceElemIdStr);
}
else {
return undefined;
}
},
showExpressInstall: wasRemoved,
removeSWF: wasRemoved,
createCSS: wasRemoved,
addDomLoadEvent: addDomLoadEvent,
addLoadEvent: wasRemoved,
// For internal usage only
expressInstallCallback: wasRemoved
};
}();
webshims.isReady('swfmini', true);
;(function(webshims){
"use strict";
var support = webshims.support;
var hasNative = support.mediaelement;
var supportsLoop = false;
var bugs = webshims.bugs;
var swfType = 'mediaelement-jaris';
var loadSwf = function(){
webshims.ready(swfType, function(){
if(!webshims.mediaelement.createSWF){
webshims.mediaelement.loadSwf = true;
webshims.reTest([swfType], hasNative);
}
});
};
var wsCfg = webshims.cfg;
var options = wsCfg.mediaelement;
var isIE = navigator.userAgent.indexOf('MSIE') != -1;
if(!options){
webshims.error("mediaelement wasn't implemented but loaded");
return;
}
if(hasNative){
var videoElem = document.createElement('video');
support.videoBuffered = ('buffered' in videoElem);
support.mediaDefaultMuted = ('defaultMuted' in videoElem);
supportsLoop = ('loop' in videoElem);
support.mediaLoop = supportsLoop;
webshims.capturingEvents(['play', 'playing', 'waiting', 'paused', 'ended', 'durationchange', 'loadedmetadata', 'canplay', 'volumechange']);
if( !support.videoBuffered || !supportsLoop || (!support.mediaDefaultMuted && isIE && 'ActiveXObject' in window) ){
webshims.addPolyfill('mediaelement-native-fix', {
d: ['dom-support']
});
webshims.loader.loadList(['mediaelement-native-fix']);
}
}
if(support.track && !bugs.track){
(function(){
if(!bugs.track){
if(window.VTTCue && !window.TextTrackCue){
window.TextTrackCue = window.VTTCue;
} else if(!window.VTTCue){
window.VTTCue = window.TextTrackCue;
}
try {
new VTTCue(2, 3, '');
} catch(e){
bugs.track = true;
}
}
})();
}
webshims.register('mediaelement-core', function($, webshims, window, document, undefined, options){
var hasSwf = swfmini.hasFlashPlayerVersion('11.3');
var mediaelement = webshims.mediaelement;
var allowYtLoading = false;
mediaelement.parseRtmp = function(data){
var src = data.src.split('://');
var paths = src[1].split('/');
var i, len, found;
data.server = src[0]+'://'+paths[0]+'/';
data.streamId = [];
for(i = 1, len = paths.length; i < len; i++){
if(!found && paths[i].indexOf(':') !== -1){
paths[i] = paths[i].split(':')[1];
found = true;
}
if(!found){
data.server += paths[i]+'/';
} else {
data.streamId.push(paths[i]);
}
}
if(!data.streamId.length){
webshims.error('Could not parse rtmp url');
}
data.streamId = data.streamId.join('/');
};
var getSrcObj = function(elem, nodeName){
elem = $(elem);
var src = {src: elem.attr('src') || '', elem: elem, srcProp: elem.prop('src')};
var tmp;
if(!src.src){return src;}
tmp = elem.attr('data-server');
if(tmp != null){
src.server = tmp;
}
tmp = elem.attr('type') || elem.attr('data-type');
if(tmp){
src.type = tmp;
src.container = $.trim(tmp.split(';')[0]);
} else {
if(!nodeName){
nodeName = elem[0].nodeName.toLowerCase();
if(nodeName == 'source'){
nodeName = (elem.closest('video, audio')[0] || {nodeName: 'video'}).nodeName.toLowerCase();
}
}
if(src.server){
src.type = nodeName+'/rtmp';
src.container = nodeName+'/rtmp';
} else {
tmp = mediaelement.getTypeForSrc( src.src, nodeName, src );
if(tmp){
src.type = tmp;
src.container = tmp;
}
}
}
tmp = elem.attr('media');
if(tmp){
src.media = tmp;
}
if(src.type == 'audio/rtmp' || src.type == 'video/rtmp'){
if(src.server){
src.streamId = src.src;
} else {
mediaelement.parseRtmp(src);
}
}
return src;
};
var hasYt = !hasSwf && ('postMessage' in window) && hasNative;
var loadTrackUi = function(){
if(loadTrackUi.loaded){return;}
loadTrackUi.loaded = true;
if(!options.noAutoTrack){
webshims.ready('WINDOWLOAD', function(){
loadThird();
webshims.loader.loadList(['track-ui']);
});
}
};
var loadYt = (function(){
var loaded;
return function(){
if(loaded || !hasYt){return;}
loaded = true;
if(allowYtLoading){
webshims.loader.loadScript("https://www.youtube.com/player_api");
}
$(function(){
webshims._polyfill(["mediaelement-yt"]);
});
};
})();
var loadThird = function(){
if(hasSwf){
loadSwf();
} else {
loadYt();
}
};
webshims.addPolyfill('mediaelement-yt', {
test: !hasYt,
d: ['dom-support']
});
mediaelement.mimeTypes = {
audio: {
//ogm shouldn´t be used!
'audio/ogg': ['ogg','oga', 'ogm'],
'audio/ogg;codecs="opus"': 'opus',
'audio/mpeg': ['mp2','mp3','mpga','mpega'],
'audio/mp4': ['mp4','mpg4', 'm4r', 'm4a', 'm4p', 'm4b', 'aac'],
'audio/wav': ['wav'],
'audio/3gpp': ['3gp','3gpp'],
'audio/webm': ['webm'],
'audio/fla': ['flv', 'f4a', 'fla'],
'application/x-mpegURL': ['m3u8', 'm3u']
},
video: {
//ogm shouldn´t be used!
'video/ogg': ['ogg','ogv', 'ogm'],
'video/mpeg': ['mpg','mpeg','mpe'],
'video/mp4': ['mp4','mpg4', 'm4v'],
'video/quicktime': ['mov','qt'],
'video/x-msvideo': ['avi'],
'video/x-ms-asf': ['asf', 'asx'],
'video/flv': ['flv', 'f4v'],
'video/3gpp': ['3gp','3gpp'],
'video/webm': ['webm'],
'application/x-mpegURL': ['m3u8', 'm3u'],
'video/MP2T': ['ts']
}
}
;
mediaelement.mimeTypes.source = $.extend({}, mediaelement.mimeTypes.audio, mediaelement.mimeTypes.video);
mediaelement.getTypeForSrc = function(src, nodeName){
if(src.indexOf('youtube.com/watch?') != -1 || src.indexOf('youtube.com/v/') != -1){
return 'video/youtube';
}
if(!src.indexOf('mediastream:') || !src.indexOf('blob:http')){
return 'usermedia';
}
if(!src.indexOf('webshimstream')){
return 'jarisplayer/stream';
}
if(!src.indexOf('rtmp')){
return nodeName+'/rtmp';
}
src = src.split('?')[0].split('#')[0].split('.');
src = src[src.length - 1];
var mt;
$.each(mediaelement.mimeTypes[nodeName], function(mimeType, exts){
if(exts.indexOf(src) !== -1){
mt = mimeType;
return false;
}
});
return mt;
};
mediaelement.srces = function(mediaElem){
var srces = [];
mediaElem = $(mediaElem);
var nodeName = mediaElem[0].nodeName.toLowerCase();
var src = getSrcObj(mediaElem, nodeName);
if(!src.src){
$('source', mediaElem).each(function(){
src = getSrcObj(this, nodeName);
if(src.src){srces.push(src);}
});
} else {
srces.push(src);
}
return srces;
};
mediaelement.swfMimeTypes = ['video/3gpp', 'video/x-msvideo', 'video/quicktime', 'video/x-m4v', 'video/mp4', 'video/m4p', 'video/x-flv', 'video/flv', 'audio/mpeg', 'audio/aac', 'audio/mp4', 'audio/x-m4a', 'audio/m4a', 'audio/mp3', 'audio/x-fla', 'audio/fla', 'youtube/flv', 'video/jarisplayer', 'jarisplayer/jarisplayer', 'jarisplayer/stream', 'video/youtube', 'video/rtmp', 'audio/rtmp'];
mediaelement.canThirdPlaySrces = function(mediaElem, srces){
var ret = '';
if(hasSwf || hasYt){
mediaElem = $(mediaElem);
srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){
if(src.container && src.src && ((hasSwf && mediaelement.swfMimeTypes.indexOf(src.container) != -1) || (hasYt && src.container == 'video/youtube'))){
ret = src;
return false;
}
});
}
return ret;
};
var nativeCanPlayType = {};
mediaelement.canNativePlaySrces = function(mediaElem, srces){
var ret = '';
if(hasNative){
mediaElem = $(mediaElem);
var nodeName = (mediaElem[0].nodeName || '').toLowerCase();
var nativeCanPlay = (nativeCanPlayType[nodeName] || {prop: {_supvalue: false}}).prop._supvalue || mediaElem[0].canPlayType;
if(!nativeCanPlay){return ret;}
srces = srces || mediaelement.srces(mediaElem);
$.each(srces, function(i, src){
if(src.type == 'usermedia' || (src.type && nativeCanPlay.call(mediaElem[0], src.type)) ){
ret = src;
return false;
}
});
}
return ret;
};
var emptyType = (/^\s*application\/octet\-stream\s*$/i);
var getRemoveEmptyType = function(){
var ret = emptyType.test($.attr(this, 'type') || '');
if(ret){
$(this).removeAttr('type');
}
return ret;
};
mediaelement.setError = function(elem, message){
if($('source', elem).filter(getRemoveEmptyType).length){
webshims.error('"application/octet-stream" is a useless mimetype for audio/video. Please change this attribute.');
try {
$(elem).mediaLoad();
} catch(er){}
} else {
if(!message){
message = "can't play sources";
}
$(elem).pause().data('mediaerror', message);
webshims.error('mediaelementError: '+ message +'. Run the following line in your console to get more info: webshim.mediaelement.loadDebugger();');
setTimeout(function(){
if($(elem).data('mediaerror')){
$(elem).addClass('media-error').trigger('mediaerror');
}
}, 1);
}
};
var handleThird = (function(){
var requested;
var readyType = hasSwf ? swfType : 'mediaelement-yt';
return function( mediaElem, ret, data ){
//readd to ready
webshims.ready(readyType, function(){
if(mediaelement.createSWF && $(mediaElem).parent()[0]){
mediaelement.createSWF( mediaElem, ret, data );
} else if(!requested) {
requested = true;
loadThird();
handleThird( mediaElem, ret, data );
}
});
if(!requested && hasYt && !mediaelement.createSWF){
allowYtLoading = true;
loadYt();
}
};
})();
var activate = {
native: function(elem, src, data){
if(data && data.isActive == 'third') {
mediaelement.setActive(elem, 'html5', data);
}
},
third: handleThird
};
var stepSources = function(elem, data, srces){
var i, src;
var testOrder = [{test: 'canNativePlaySrces', activate: 'native'}, {test: 'canThirdPlaySrces', activate: 'third'}];
if(options.preferFlash || (data && data.isActive == 'third') ){
testOrder.reverse();
}
for(i = 0; i < 2; i++){
src = mediaelement[testOrder[i].test](elem, srces);
if(src){
activate[testOrder[i].activate](elem, src, data);
break;
}
}
if(!src){
mediaelement.setError(elem, false);
if(data && data.isActive == 'third') {
mediaelement.setActive(elem, 'html5', data);
}
}
};
var stopParent = /^(?:embed|object|datalist|picture)$/i;
var selectSource = function(elem, data){
var baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {});
var _srces = mediaelement.srces(elem);
var parent = elem.parentNode;
clearTimeout(baseData.loadTimer);
$(elem).removeClass('media-error');
$.data(elem, 'mediaerror', false);
if(!_srces.length || !parent || parent.nodeType != 1 || stopParent.test(parent.nodeName || '')){return;}
data = data || webshims.data(elem, 'mediaelement');
if(mediaelement.sortMedia){
_srces.sort(mediaelement.sortMedia);
}
stepSources(elem, data, _srces);
};
mediaelement.selectSource = selectSource;
$(document).on('ended', function(e){
var data = webshims.data(e.target, 'mediaelement');
if( supportsLoop && (!data || data.isActive == 'html5') && !$.prop(e.target, 'loop')){return;}
setTimeout(function(){
if( $.prop(e.target, 'paused') || !$.prop(e.target, 'loop') ){return;}
$(e.target).prop('currentTime', 0).play();
});
});
var handleMedia = false;
var initMediaElements = function(){
var testFixMedia = function(){
if(webshims.implement(this, 'mediaelement')){
selectSource(this);
if(!support.mediaDefaultMuted && $.attr(this, 'muted') != null){
$.prop(this, 'muted', true);
}
}
};
webshims.ready('dom-support', function(){
handleMedia = true;
if(!supportsLoop){
webshims.defineNodeNamesBooleanProperty(['audio', 'video'], 'loop');
}
['audio', 'video'].forEach(function(nodeName){
var supLoad;
supLoad = webshims.defineNodeNameProperty(nodeName, 'load', {
prop: {
value: function(){
var data = webshims.data(this, 'mediaelement');
selectSource(this, data);
if(hasNative && (!data || data.isActive == 'html5') && supLoad.prop._supvalue){
supLoad.prop._supvalue.apply(this, arguments);
}
if(!loadTrackUi.loaded && this.querySelector('track')){
loadTrackUi();
}
$(this).triggerHandler('wsmediareload');
}
}
});
nativeCanPlayType[nodeName] = webshims.defineNodeNameProperty(nodeName, 'canPlayType', {
prop: {
value: function(type){
var ret = '';
if(hasNative && nativeCanPlayType[nodeName].prop._supvalue){
ret = nativeCanPlayType[nodeName].prop._supvalue.call(this, type);
if(ret == 'no'){
ret = '';
}
}
if(!ret && hasSwf){
type = $.trim((type || '').split(';')[0]);
if(mediaelement.swfMimeTypes.indexOf(type) != -1){
ret = 'maybe';
}
}
if(!ret && hasYt && type == 'video/youtube'){
ret = 'maybe';
}
return ret;
}
}
});
});
webshims.onNodeNamesPropertyModify(['audio', 'video'], ['src', 'poster'], {
set: function(){
var elem = this;
var baseData = webshims.data(elem, 'mediaelementBase') || webshims.data(elem, 'mediaelementBase', {});
clearTimeout(baseData.loadTimer);
baseData.loadTimer = setTimeout(function(){
selectSource(elem);
elem = null;
}, 9);
}
});
webshims.addReady(function(context, insertedElement){
var media = $('video, audio', context)
.add(insertedElement.filter('video, audio'))
.each(testFixMedia)
;
if(!loadTrackUi.loaded && $('track', media).length){
loadTrackUi();
}
media = null;
});
});
if(hasNative && !handleMedia){
webshims.addReady(function(context, insertedElement){
if(!handleMedia){
$('video, audio', context)
.add(insertedElement.filter('video, audio'))
.each(function(){
if(!mediaelement.canNativePlaySrces(this)){
allowYtLoading = true;
loadThird();
handleMedia = true;
return false;
}
})
;
}
});
}
};
mediaelement.loadDebugger = function(){
webshims.ready('dom-support', function(){
webshims.loader.loadScript('mediaelement-debug');
});
};
if(({noCombo: 1, media: 1})[webshims.cfg.debug]){
$(document).on('mediaerror', function(e){
mediaelement.loadDebugger();
});
}
//set native implementation ready, before swf api is retested
if(hasNative){
webshims.isReady('mediaelement-core', true);
initMediaElements();
webshims.ready('WINDOWLOAD mediaelement', loadThird);
} else {
webshims.ready(swfType, initMediaElements);
}
webshims.ready('track', loadTrackUi);
if(document.readyState == 'complete'){
webshims.isReady('WINDOWLOAD', true);
}
});
})(webshims);
;webshims.register('track', function($, webshims, window, document, undefined){
"use strict";
var mediaelement = webshims.mediaelement;
var id = new Date().getTime();
//descriptions are not really shown, but they are inserted into the dom
var showTracks = {subtitles: 1, captions: 1, descriptions: 1};
var dummyTrack = $('<track />');
var support = webshims.support;
var supportTrackMod = support.ES5 && support.objectAccessor;
var createEventTarget = function(obj){
var eventList = {};
obj.addEventListener = function(name, fn){
if(eventList[name]){
webshims.error('always use $.on to the shimed event: '+ name +' already bound fn was: '+ eventList[name] +' your fn was: '+ fn);
}
eventList[name] = fn;
};
obj.removeEventListener = function(name, fn){
if(eventList[name] && eventList[name] != fn){
webshims.error('always use $.on/$.off to the shimed event: '+ name +' already bound fn was: '+ eventList[name] +' your fn was: '+ fn);
}
if(eventList[name]){
delete eventList[name];
}
};
return obj;
};
var cueListProto = {
getCueById: function(id){
var cue = null;
for(var i = 0, len = this.length; i < len; i++){
if(this[i].id === id){
cue = this[i];
break;
}
}
return cue;
}
};
var numericModes = {
0: 'disabled',
1: 'hidden',
2: 'showing'
};
var textTrackProto = {
shimActiveCues: null,
_shimActiveCues: null,
activeCues: null,
cues: null,
kind: 'subtitles',
label: '',
language: '',
id: '',
mode: 'disabled',
oncuechange: null,
toString: function() {
return "[object TextTrack]";
},
addCue: function(cue){
if(!this.cues){
this.cues = mediaelement.createCueList();
} else {
var lastCue = this.cues[this.cues.length-1];
if(lastCue && lastCue.startTime > cue.startTime){
webshims.error("cue startTime higher than previous cue's startTime");
}
}
if(cue.track && cue.track.removeCue){
cue.track.removeCue(cue);
}
cue.track = this;
this.cues.push(cue);
},
//ToDo: make it more dynamic
removeCue: function(cue){
var cues = this.cues || [];
var i = 0;
var len = cues.length;
if(cue.track != this){
webshims.error("cue not part of track");
return;
}
for(; i < len; i++){
if(cues[i] === cue){
cues.splice(i, 1);
cue.track = null;
break;
}
}
if(cue.track){
webshims.error("cue not part of track");
return;
}
}/*,
DISABLED: 'disabled',
OFF: 'disabled',
HIDDEN: 'hidden',
SHOWING: 'showing',
ERROR: 3,
LOADED: 2,
LOADING: 1,
NONE: 0*/
};
var copyProps = ['kind', 'label', 'srclang'];
var copyName = {srclang: 'language'};
var updateMediaTrackList = function(baseData, trackList){
var removed = [];
var added = [];
var newTracks = [];
var i, len;
if(!baseData){
baseData = webshims.data(this, 'mediaelementBase') || webshims.data(this, 'mediaelementBase', {});
}
if(!trackList){
baseData.blockTrackListUpdate = true;
trackList = $.prop(this, 'textTracks');
baseData.blockTrackListUpdate = false;
}
clearTimeout(baseData.updateTrackListTimer);
$('track', this).each(function(){
var track = $.prop(this, 'track');
newTracks.push(track);
if(trackList.indexOf(track) == -1){
added.push(track);
}
});
if(baseData.scriptedTextTracks){
for(i = 0, len = baseData.scriptedTextTracks.length; i < len; i++){
newTracks.push(baseData.scriptedTextTracks[i]);
if(trackList.indexOf(baseData.scriptedTextTracks[i]) == -1){
added.push(baseData.scriptedTextTracks[i]);
}
}
}
for(i = 0, len = trackList.length; i < len; i++){
if(newTracks.indexOf(trackList[i]) == -1){
removed.push(trackList[i]);
}
}
if(removed.length || added.length){
trackList.splice(0);
for(i = 0, len = newTracks.length; i < len; i++){
trackList.push(newTracks[i]);
}
for(i = 0, len = removed.length; i < len; i++){
$([trackList]).triggerHandler($.Event({type: 'removetrack', track: removed[i]}));
}
for(i = 0, len = added.length; i < len; i++){
$([trackList]).triggerHandler($.Event({type: 'addtrack', track: added[i]}));
}
if(baseData.scriptedTextTracks || removed.length){
$(this).triggerHandler('updatetrackdisplay');
}
}
};
var refreshTrack = function(track, trackData){
if(!trackData){
trackData = webshims.data(track, 'trackData');
}
if(trackData && !trackData.isTriggering){
trackData.isTriggering = true;
setTimeout(function(){
$(track).closest('audio, video').triggerHandler('updatetrackdisplay');
trackData.isTriggering = false;
}, 1);
}
};
var isDefaultTrack = (function(){
var defaultKinds = {
subtitles: {
subtitles: 1,
captions: 1
},
descriptions: {descriptions: 1},
chapters: {chapters: 1}
};
defaultKinds.captions = defaultKinds.subtitles;
return function(track){
var kind, firstDefaultTrack;
var isDefault = $.prop(track, 'default');
if(isDefault && (kind = $.prop(track, 'kind')) != 'metadata'){
firstDefaultTrack = $(track)
.parent()
.find('track[default]')
.filter(function(){
return !!(defaultKinds[kind][$.prop(this, 'kind')]);
})[0]
;
if(firstDefaultTrack != track){
isDefault = false;
webshims.error('more than one default track of a specific kind detected. Fall back to default = false');
}
}
return isDefault;
};
})();
var emptyDiv = $('<div />')[0];
function VTTCue(startTime, endTime, text){
if(arguments.length != 3){
webshims.error("wrong arguments.length for VTTCue.constructor");
}
this.startTime = startTime;
this.endTime = endTime;
this.text = text;
this.onenter = null;
this.onexit = null;
this.pauseOnExit = false;
this.track = null;
this.id = null;
this.getCueAsHTML = (function(){
var lastText = "";
var parsedText = "";
var fragment;
return function(){
var i, len;
if(!fragment){
fragment = document.createDocumentFragment();
}
if(lastText != this.text){
lastText = this.text;
parsedText = mediaelement.parseCueTextToHTML(lastText);
emptyDiv.innerHTML = parsedText;
for(i = 0, len = emptyDiv.childNodes.length; i < len; i++){
fragment.appendChild(emptyDiv.childNodes[i].cloneNode(true));
}
}
return fragment.cloneNode(true);
};
})();
}
window.VTTCue = VTTCue;
window.TextTrackCue = function(){
webshims.error("Use VTTCue constructor instead of abstract TextTrackCue constructor.");
VTTCue.apply(this, arguments);
};
window.TextTrackCue.prototype = VTTCue.prototype;
mediaelement.createCueList = function(){
return $.extend([], cueListProto);
};
mediaelement.parseCueTextToHTML = (function(){
var tagSplits = /(<\/?[^>]+>)/ig;
var allowedTags = /^(?:c|v|ruby|rt|b|i|u)/;
var regEnd = /\<\s*\//;
var addToTemplate = function(localName, attribute, tag, html){
var ret;
if(regEnd.test(html)){
ret = '</'+ localName +'>';
} else {
tag.splice(0, 1);
ret = '<'+ localName +' '+ attribute +'="'+ (tag.join(' ').replace(/\"/g, '"')) +'">';
}
return ret;
};
var replacer = function(html){
var tag = html.replace(/[<\/>]+/ig,"").split(/[\s\.]+/);
if(tag[0]){
tag[0] = tag[0].toLowerCase();
if(allowedTags.test(tag[0])){
if(tag[0] == 'c'){
html = addToTemplate('span', 'class', tag, html);
} else if(tag[0] == 'v'){
html = addToTemplate('q', 'title', tag, html);
}
} else {
html = "";
}
}
return html;
};
return function(cueText){
return cueText.replace(tagSplits, replacer);
};
})();
var mapTtmlToVtt = function(i){
var content = i+'';
var begin = this.getAttribute('begin') || '';
var end = this.getAttribute('end') || '';
var text = $.trim($.text(this));
if(!/\./.test(begin)){
begin += '.000';
}
if(!/\./.test(end)){
end += '.000';
}
content += '\n';
content += begin +' --> '+end+'\n';
content += text;
return content;
};
var ttmlTextToVTT = function(ttml){
ttml = $.parseXML(ttml) || [];
return $(ttml).find('[begin][end]').map(mapTtmlToVtt).get().join('\n\n') || '';
};
var loadingTracks = 0;
mediaelement.loadTextTrack = function(mediaelem, track, trackData, _default){
var loadEvents = 'play playing loadedmetadata loadstart';
var obj = trackData.track;
var load = function(){
var error, ajax, createAjax;
var isDisabled = obj.mode == 'disabled';
var videoState = !!($.prop(mediaelem, 'readyState') > 0 || $.prop(mediaelem, 'networkState') == 2 || !$.prop(mediaelem, 'paused'));
var src = (!isDisabled || videoState) && ($.attr(track, 'src') && $.prop(track, 'src'));
if(src){
$(mediaelem).off(loadEvents, load).off('updatetrackdisplay', load);
if(!trackData.readyState){
error = function(){
loadingTracks--;
trackData.readyState = 3;
obj.cues = null;
obj.activeCues = obj.shimActiveCues = obj._shimActiveCues = null;
$(track).triggerHandler('error');
};
trackData.readyState = 1;
try {
obj.cues = mediaelement.createCueList();
obj.activeCues = obj.shimActiveCues = obj._shimActiveCues = mediaelement.createCueList();
loadingTracks++;
createAjax = function(){
ajax = $.ajax({
dataType: 'text',
url: src,
success: function(text){
loadingTracks--;
var contentType = ajax.getResponseHeader('content-type') || '';
if(!contentType.indexOf('application/xml')){
text = ttmlTextToVTT(text);
} else if(contentType.indexOf('text/vtt')){
webshims.error('set the mime-type of your WebVTT files to text/vtt. see: http://dev.w3.org/html5/webvtt/#text/vtt');
}
mediaelement.parseCaptions(text, obj, function(cues){
if(cues && 'length' in cues){
trackData.readyState = 2;
$(track).triggerHandler('load');
$(mediaelem).triggerHandler('updatetrackdisplay');
} else {
error();
}
});
},
error: error
});
};
if(isDisabled){
setTimeout(createAjax, loadingTracks * 2);
} else {
createAjax();
}
} catch(er){
error();
webshims.error(er);
}
}
}
};
trackData.readyState = 0;
obj.shimActiveCues = null;
obj._shimActiveCues = null;
obj.activeCues = null;
obj.cues = null;
$(mediaelem).on(loadEvents, load);
if(_default){
obj.mode = showTracks[obj.kind] ? 'showing' : 'hidden';
load();
} else {
$(mediaelem).on('updatetrackdisplay', load);
}
};
mediaelement.createTextTrack = function(mediaelem, track){
var obj, trackData;
if(track.nodeName){
trackData = webshims.data(track, 'trackData');
if(trackData){
refreshTrack(track, trackData);
obj = trackData.track;
}
}
if(!obj){
obj = createEventTarget(webshims.objectCreate(textTrackProto));
if(!supportTrackMod){
copyProps.forEach(function(copyProp){
var prop = $.prop(track, copyProp);
if(prop){
obj[copyName[copyProp] || copyProp] = prop;
}
});
}
if(track.nodeName){
if(supportTrackMod){
copyProps.forEach(function(copyProp){
webshims.defineProperty(obj, copyName[copyProp] || copyProp, {
get: function(){
return $.prop(track, copyProp);
}
});
});
}
obj.id = $(track).prop('id');
trackData = webshims.data(track, 'trackData', {track: obj});
mediaelement.loadTextTrack(mediaelem, track, trackData, isDefaultTrack(track));
} else {
if(supportTrackMod){
copyProps.forEach(function(copyProp){
webshims.defineProperty(obj, copyName[copyProp] || copyProp, {
value: track[copyProp],
writeable: false
});
});
}
obj.cues = mediaelement.createCueList();
obj.activeCues = obj._shimActiveCues = obj.shimActiveCues = mediaelement.createCueList();
obj.mode = 'hidden';
obj.readyState = 2;
}
if(obj.kind == 'subtitles' && !obj.language){
webshims.error('you must provide a language for track in subtitles state');
}
obj.__wsmode = obj.mode;
webshims.defineProperty(obj, '_wsUpdateMode', {
value: function(){
$(mediaelem).triggerHandler('updatetrackdisplay');
},
enumerable: false
});
}
return obj;
};
if(!$.propHooks.mode){
$.propHooks.mode = {
set: function(obj, value){
obj.mode = value;
if(obj._wsUpdateMode && obj._wsUpdateMode.call){
obj._wsUpdateMode();
}
return obj.mode;
}
};
}
/*
taken from:
Captionator 0.5.1 [CaptionCrunch]
Christopher Giffard, 2011
Share and enjoy
https://github.com/cgiffard/Captionator
modified for webshims
*/
mediaelement.parseCaptionChunk = (function(){
// Set up timestamp parsers
var WebVTTTimestampParser = /^(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s*(.*)/;
var WebVTTDEFAULTSCueParser = /^(DEFAULTS|DEFAULT)\s+\-\-\>\s+(.*)/g;
var WebVTTSTYLECueParser = /^(STYLE|STYLES)\s+\-\-\>\s*\n([\s\S]*)/g;
var WebVTTCOMMENTCueParser = /^(COMMENT|COMMENTS)\s+\-\-\>\s+(.*)/g;
var SRTTimestampParser = /^(\d{2})?:?(\d{2}):(\d{2})[\.\,](\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})[\.\,](\d+)\s*(.*)/;
return function(subtitleElement,objectCount){
var subtitleParts, timeIn, timeOut, html, timeData, subtitlePartIndex, id;
var timestampMatch, tmpCue;
// WebVTT Special Cue Logic
if (WebVTTDEFAULTSCueParser.exec(subtitleElement) || WebVTTCOMMENTCueParser.exec(subtitleElement) || WebVTTSTYLECueParser.exec(subtitleElement)) {
return null;
}
subtitleParts = subtitleElement.split(/\n/g);
// Trim off any blank lines (logically, should only be max. one, but loop to be sure)
while (!subtitleParts[0].replace(/\s+/ig,"").length && subtitleParts.length > 0) {
subtitleParts.shift();
}
if (subtitleParts[0].match(/^\s*[a-z0-9-\_]+\s*$/ig)) {
// The identifier becomes the cue ID (when *we* load the cues from file. Programatically created cues can have an ID of whatever.)
id = String(subtitleParts.shift().replace(/\s*/ig,""));
}
for (subtitlePartIndex = 0; subtitlePartIndex < subtitleParts.length; subtitlePartIndex ++) {
var timestamp = subtitleParts[subtitlePartIndex];
if ((timestampMatch = WebVTTTimestampParser.exec(timestamp)) || (timestampMatch = SRTTimestampParser.exec(timestamp))) {
// WebVTT
timeData = timestampMatch.slice(1);
timeIn = parseInt((timeData[0]||0) * 60 * 60,10) + // Hours
parseInt((timeData[1]||0) * 60,10) + // Minutes
parseInt((timeData[2]||0),10) + // Seconds
parseFloat("0." + (timeData[3]||0)); // MS
timeOut = parseInt((timeData[4]||0) * 60 * 60,10) + // Hours
parseInt((timeData[5]||0) * 60,10) + // Minutes
parseInt((timeData[6]||0),10) + // Seconds
parseFloat("0." + (timeData[7]||0)); // MS
/*
if (timeData[8]) {
cueSettings = timeData[8];
}
*/
}
// We've got the timestamp - return all the other unmatched lines as the raw subtitle data
subtitleParts = subtitleParts.slice(0,subtitlePartIndex).concat(subtitleParts.slice(subtitlePartIndex+1));
break;
}
if (!timeIn && !timeOut) {
// We didn't extract any time information. Assume the cue is invalid!
webshims.warn("couldn't extract time information: "+[timeIn, timeOut, subtitleParts.join("\n"), id].join(' ; '));
return null;
}
/*
// Consolidate cue settings, convert defaults to object
var compositeCueSettings =
cueDefaults
.reduce(function(previous,current,index,array){
previous[current.split(":")[0]] = current.split(":")[1];
return previous;
},{});
// Loop through cue settings, replace defaults with cue specific settings if they exist
compositeCueSettings =
cueSettings
.split(/\s+/g)
.filter(function(set) { return set && !!set.length; })
// Convert array to a key/val object
.reduce(function(previous,current,index,array){
previous[current.split(":")[0]] = current.split(":")[1];
return previous;
},compositeCueSettings);
// Turn back into string like the VTTCue constructor expects
cueSettings = "";
for (var key in compositeCueSettings) {
if (compositeCueSettings.hasOwnProperty(key)) {
cueSettings += !!cueSettings.length ? " " : "";
cueSettings += key + ":" + compositeCueSettings[key];
}
}
*/
// The remaining lines are the subtitle payload itself (after removing an ID if present, and the time);
html = subtitleParts.join("\n");
tmpCue = new VTTCue(timeIn, timeOut, html);
if(id){
tmpCue.id = id;
}
return tmpCue;
};
})();
mediaelement.parseCaptions = function(captionData, track, complete) {
var cue, lazyProcess, regWevVTT, startDate, isWEBVTT;
mediaelement.createCueList();
if (captionData) {
regWevVTT = /^WEBVTT(\s*FILE)?/ig;
lazyProcess = function(i, len){
for(; i < len; i++){
cue = captionData[i];
if(regWevVTT.test(cue)){
isWEBVTT = true;
} else if(cue.replace(/\s*/ig,"").length){
cue = mediaelement.parseCaptionChunk(cue, i);
if(cue){
track.addCue(cue);
}
}
if(startDate < (new Date().getTime()) - 30){
i++;
setTimeout(function(){
startDate = new Date().getTime();
lazyProcess(i, len);
}, 90);
break;
}
}
if(i >= len){
if(!isWEBVTT){
webshims.error('please use WebVTT format. This is the standard');
}
complete(track.cues);
}
};
captionData = captionData.replace(/\r\n/g,"\n");
setTimeout(function(){
captionData = captionData.replace(/\r/g,"\n");
setTimeout(function(){
startDate = new Date().getTime();
captionData = captionData.split(/\n\n+/g);
lazyProcess(0, captionData.length);
}, 9);
}, 9);
} else {
webshims.error("Required parameter captionData not supplied.");
}
};
mediaelement.createTrackList = function(mediaelem, baseData){
baseData = baseData || webshims.data(mediaelem, 'mediaelementBase') || webshims.data(mediaelem, 'mediaelementBase', {});
if(!baseData.textTracks){
baseData.textTracks = [];
webshims.defineProperties(baseData.textTracks, {
onaddtrack: {value: null},
onremovetrack: {value: null},
onchange: {value: null},
getTrackById: {
value: function(id){
var track = null;
for(var i = 0; i < baseData.textTracks.length; i++){
if(id == baseData.textTracks[i].id){
track = baseData.textTracks[i];
break;
}
}
return track;
}
}
});
createEventTarget(baseData.textTracks);
$(mediaelem).on('updatetrackdisplay', function(){
var track;
for(var i = 0; i < baseData.textTracks.length; i++){
track = baseData.textTracks[i];
if(track.__wsmode != track.mode){
track.__wsmode = track.mode;
$([ baseData.textTracks ]).triggerHandler('change');
}
}
});
}
return baseData.textTracks;
};
if(!support.track){
webshims.defineNodeNamesBooleanProperty(['track'], 'default');
webshims.reflectProperties(['track'], ['srclang', 'label']);
webshims.defineNodeNameProperties('track', {
src: {
//attr: {},
reflect: true,
propType: 'src'
}
});
}
webshims.defineNodeNameProperties('track', {
kind: {
attr: support.track ? {
set: function(value){
var trackData = webshims.data(this, 'trackData');
this.setAttribute('data-kind', value);
if(trackData){
trackData.attrKind = value;
}
},
get: function(){
var trackData = webshims.data(this, 'trackData');
if(trackData && ('attrKind' in trackData)){
return trackData.attrKind;
}
return this.getAttribute('kind');
}
} : {},
reflect: true,
propType: 'enumarated',
defaultValue: 'subtitles',
limitedTo: ['subtitles', 'captions', 'descriptions', 'chapters', 'metadata']
}
});
$.each(copyProps, function(i, copyProp){
var name = copyName[copyProp] || copyProp;
webshims.onNodeNamesPropertyModify('track', copyProp, function(){
var trackData = webshims.data(this, 'trackData');
if(trackData){
if(copyProp == 'kind'){
refreshTrack(this, trackData);
}
if(!supportTrackMod){
trackData.track[name] = $.prop(this, copyProp);
}
}
});
});
webshims.onNodeNamesPropertyModify('track', 'src', function(val){
if(val){
var data = webshims.data(this, 'trackData');
var media;
if(data){
media = $(this).closest('video, audio');
if(media[0]){
mediaelement.loadTextTrack(media, this, data);
}
}
}
});
//
webshims.defineNodeNamesProperties(['track'], {
ERROR: {
value: 3
},
LOADED: {
value: 2
},
LOADING: {
value: 1
},
NONE: {
value: 0
},
readyState: {
get: function(){
return (webshims.data(this, 'trackData') || {readyState: 0}).readyState;
},
writeable: false
},
track: {
get: function(){
return mediaelement.createTextTrack($(this).closest('audio, video')[0], this);
},
writeable: false
}
}, 'prop');
webshims.defineNodeNamesProperties(['audio', 'video'], {
textTracks: {
get: function(){
var media = this;
var baseData = webshims.data(media, 'mediaelementBase') || webshims.data(media, 'mediaelementBase', {});
var tracks = mediaelement.createTrackList(media, baseData);
if(!baseData.blockTrackListUpdate){
updateMediaTrackList.call(media, baseData, tracks);
}
return tracks;
},
writeable: false
},
addTextTrack: {
value: function(kind, label, lang){
var textTrack = mediaelement.createTextTrack(this, {
kind: dummyTrack.prop('kind', kind || '').prop('kind'),
label: label || '',
srclang: lang || ''
});
var baseData = webshims.data(this, 'mediaelementBase') || webshims.data(this, 'mediaelementBase', {});
if (!baseData.scriptedTextTracks) {
baseData.scriptedTextTracks = [];
}
baseData.scriptedTextTracks.push(textTrack);
updateMediaTrackList.call(this);
return textTrack;
}
}
}, 'prop');
//wsmediareload
var thUpdateList = function(e){
if($(e.target).is('audio, video')){
var baseData = webshims.data(e.target, 'mediaelementBase');
if(baseData){
clearTimeout(baseData.updateTrackListTimer);
baseData.updateTrackListTimer = setTimeout(function(){
updateMediaTrackList.call(e.target, baseData);
}, 0);
}
}
};
var getNativeReadyState = function(trackElem, textTrack){
return textTrack.readyState || trackElem.readyState;
};
var stopOriginalEvent = function(e){
if(e.originalEvent){
e.stopImmediatePropagation();
}
};
var hideNativeTracks = function(){
if(webshims.implement(this, 'track')){
var kind;
var origTrack = this.track;
if(origTrack){
if (!webshims.bugs.track && (origTrack.mode || getNativeReadyState(this, origTrack))) {
$.prop(this, 'track').mode = numericModes[origTrack.mode] || origTrack.mode;
}
//disable track from showing + remove UI
kind = $.prop(this, 'kind');
origTrack.mode = (typeof origTrack.mode == 'string') ? 'disabled' : 0;
this.kind = 'metadata';
$(this).attr({kind: kind});
}
$(this).on('load error', stopOriginalEvent);
}
};
webshims.addReady(function(context, insertedElement){
var insertedMedia = insertedElement.filter('video, audio, track').closest('audio, video');
$('video, audio', context)
.add(insertedMedia)
.each(function(){
updateMediaTrackList.call(this);
})
.on('emptied updatetracklist wsmediareload', thUpdateList)
.each(function(){
if(support.track){
var shimedTextTracks = $.prop(this, 'textTracks');
var origTextTracks = this.textTracks;
if(shimedTextTracks.length != origTextTracks.length){
webshims.warn("textTracks couldn't be copied");
}
$('track', this).each(hideNativeTracks);
}
})
;
insertedMedia.each(function(){
var media = this;
var baseData = webshims.data(media, 'mediaelementBase');
if(baseData){
clearTimeout(baseData.updateTrackListTimer);
baseData.updateTrackListTimer = setTimeout(function(){
updateMediaTrackList.call(media, baseData);
}, 9);
}
});
});
if(support.texttrackapi){
$('video, audio').trigger('trackapichange');
}
});
| gogoleva/cdnjs | ajax/libs/webshim/1.15.0-RC1/dev/shims/combos/12.js | JavaScript | mit | 45,935 |
webshims.register('form-number-date-api', function($, webshims, window, document, undefined, options){
"use strict";
if(!webshims.addInputType){
webshims.error("you can not call forms-ext feature after calling forms feature. call both at once instead: $.webshims.polyfill('forms forms-ext')");
}
if(!webshims.getStep){
webshims.getStep = function(elem, type){
var step = $.attr(elem, 'step');
if(step === 'any'){
return step;
}
type = type || getType(elem);
if(!typeModels[type] || !typeModels[type].step){
return step;
}
step = typeProtos.number.asNumber(step);
return ((!isNaN(step) && step > 0) ? step : typeModels[type].step) * (typeModels[type].stepScaleFactor || 1);
};
}
if(!webshims.addMinMaxNumberToCache){
webshims.addMinMaxNumberToCache = function(attr, elem, cache){
if (!(attr+'AsNumber' in cache)) {
cache[attr+'AsNumber'] = typeModels[cache.type].asNumber(elem.attr(attr));
if(isNaN(cache[attr+'AsNumber']) && (attr+'Default' in typeModels[cache.type])){
cache[attr+'AsNumber'] = typeModels[cache.type][attr+'Default'];
}
}
};
}
var nan = parseInt('NaN', 10),
typeModels = webshims.inputTypes,
isNumber = function(string){
return (typeof string == 'number' || (string && string == string * 1));
},
supportsType = function(type){
return ($('<input type="'+type+'" />').prop('type') === type);
},
getType = function(elem){
return (elem.getAttribute('type') || '').toLowerCase();
},
isDateTimePart = function(string){
return (string && !(isNaN(string * 1)));
},
addMinMaxNumberToCache = webshims.addMinMaxNumberToCache,
addleadingZero = function(val, len){
val = ''+val;
len = len - val.length;
for(var i = 0; i < len; i++){
val = '0'+val;
}
return val;
},
EPS = 1e-7,
typeBugs = webshims.bugs.bustedValidity
;
webshims.addValidityRule('stepMismatch', function(input, val, cache, validityState){
if(val === ''){return false;}
if(!('type' in cache)){
cache.type = getType(input[0]);
}
if(cache.type == 'week'){return false;}
var base, attrVal;
var ret = (validityState || {}).stepMismatch || false;
if(typeModels[cache.type] && typeModels[cache.type].step){
if( !('step' in cache) ){
cache.step = webshims.getStep(input[0], cache.type);
}
if(cache.step == 'any'){return false;}
if(!('valueAsNumber' in cache)){
cache.valueAsNumber = typeModels[cache.type].asNumber( val );
}
if(isNaN(cache.valueAsNumber)){return false;}
addMinMaxNumberToCache('min', input, cache);
base = cache.minAsNumber;
if(isNaN(base) && (attrVal = input.prop('defaultValue'))){
base = typeModels[cache.type].asNumber( attrVal );
}
if(isNaN(base)){
base = typeModels[cache.type].stepBase || 0;
}
ret = Math.abs((cache.valueAsNumber - base) % cache.step);
ret = !( ret <= EPS || Math.abs(ret - cache.step) <= EPS );
}
return ret;
});
[{name: 'rangeOverflow', attr: 'max', factor: 1}, {name: 'rangeUnderflow', attr: 'min', factor: -1}].forEach(function(data, i){
webshims.addValidityRule(data.name, function(input, val, cache, validityState) {
var ret = (validityState || {})[data.name] || false;
if(val === ''){return ret;}
if (!('type' in cache)) {
cache.type = getType(input[0]);
}
if (typeModels[cache.type] && typeModels[cache.type].asNumber) {
if(!('valueAsNumber' in cache)){
cache.valueAsNumber = typeModels[cache.type].asNumber( val );
}
if(isNaN(cache.valueAsNumber)){
return false;
}
addMinMaxNumberToCache(data.attr, input, cache);
if(isNaN(cache[data.attr+'AsNumber'])){
return ret;
}
ret = ( cache[data.attr+'AsNumber'] * data.factor < cache.valueAsNumber * data.factor - EPS );
}
return ret;
});
});
webshims.reflectProperties(['input'], ['max', 'min', 'step']);
//IDLs and methods, that aren't part of constrain validation, but strongly tight to it
var valueAsNumberDescriptor = webshims.defineNodeNameProperty('input', 'valueAsNumber', {
prop: {
get: function(){
var elem = this;
var type = getType(elem);
var ret = (typeModels[type] && typeModels[type].asNumber) ?
typeModels[type].asNumber($.prop(elem, 'value')) :
(valueAsNumberDescriptor.prop._supget && valueAsNumberDescriptor.prop._supget.apply(elem, arguments));
if(ret == null){
ret = nan;
}
return ret;
},
set: function(val){
var elem = this;
var type = getType(elem);
if(typeModels[type] && typeModels[type].numberToString){
//is NaN a number?
if(isNaN(val)){
$.prop(elem, 'value', '');
return;
}
var set = typeModels[type].numberToString(val);
if(set !== false){
$.prop(elem, 'value', set);
} else {
webshims.error('INVALID_STATE_ERR: DOM Exception 11');
}
} else if(valueAsNumberDescriptor.prop._supset) {
valueAsNumberDescriptor.prop._supset.apply(elem, arguments);
}
}
}
});
var valueAsDateDescriptor = webshims.defineNodeNameProperty('input', 'valueAsDate', {
prop: {
get: function(){
var elem = this;
var type = getType(elem);
return (typeModels[type] && typeModels[type].asDate && !typeModels[type].noAsDate) ?
typeModels[type].asDate($.prop(elem, 'value')) :
valueAsDateDescriptor.prop._supget && valueAsDateDescriptor.prop._supget.call(elem) || null;
},
set: function(value){
var elem = this;
var type = getType(elem);
if(typeModels[type] && typeModels[type].dateToString && !typeModels[type].noAsDate){
if(value === null){
$.prop(elem, 'value', '');
return '';
}
var set = typeModels[type].dateToString(value);
if(set !== false){
$.prop(elem, 'value', set);
return set;
} else {
webshims.error('INVALID_STATE_ERR: DOM Exception 11');
}
} else {
return valueAsDateDescriptor.prop._supset && valueAsDateDescriptor.prop._supset.apply(elem, arguments) || null;
}
}
}
});
$.each({stepUp: 1, stepDown: -1}, function(name, stepFactor){
var stepDescriptor = webshims.defineNodeNameProperty('input', name, {
prop: {
value: function(factor){
var step, val, valModStep, alignValue, cache, base, attrVal;
var type = getType(this);
if(typeModels[type] && typeModels[type].asNumber){
cache = {type: type};
if(!factor){
factor = 1;
webshims.warn("you should always use a factor for stepUp/stepDown");
}
factor *= stepFactor;
step = webshims.getStep(this, type);
if(step == 'any'){
webshims.info("step is 'any' can't apply stepUp/stepDown");
throw('invalid state error');
}
webshims.addMinMaxNumberToCache('min', $(this), cache);
webshims.addMinMaxNumberToCache('max', $(this), cache);
val = $.prop(this, 'valueAsNumber');
if(factor > 0 && !isNaN(cache.minAsNumber) && (isNaN(val) || cache.minAsNumber > val)){
$.prop(this, 'valueAsNumber', cache.minAsNumber);
return;
} else if(factor < 0 && !isNaN(cache.maxAsNumber) && (isNaN(val) || cache.maxAsNumber < val)){
$.prop(this, 'valueAsNumber', cache.maxAsNumber);
return;
}
if(isNaN(val)){
val = 0;
}
base = cache.minAsNumber;
if(isNaN(base) && (attrVal = $.prop(this, 'defaultValue'))){
base = typeModels[type].asNumber( attrVal );
}
if(!base){
base = 0;
}
step *= factor;
val = (val + step).toFixed(5) * 1;
valModStep = (val - base) % step;
if ( valModStep && (Math.abs(valModStep) > EPS) ) {
alignValue = val - valModStep;
alignValue += ( valModStep > 0 ) ? step : ( -step );
val = alignValue.toFixed(5) * 1;
}
if( (!isNaN(cache.maxAsNumber) && val > cache.maxAsNumber) || (!isNaN(cache.minAsNumber) && val < cache.minAsNumber) ){
webshims.info("max/min overflow can't apply stepUp/stepDown");
return;
}
$.prop(this, 'valueAsNumber', val);
} else if(stepDescriptor.prop && stepDescriptor.prop._supvalue){
return stepDescriptor.prop._supvalue.apply(this, arguments);
} else {
webshims.info("no step method for type: "+ type);
throw('invalid state error');
}
}
}
});
});
/*
* ToDO: WEEK
*/
// var getWeek = function(date){
// var time;
// var checkDate = new Date(date.getTime());
//
// checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
//
// time = checkDate.getTime();
// checkDate.setMonth(0);
// checkDate.setDate(1);
// return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
// };
//
// var setWeek = function(year, week){
// var date = new Date(year, 0, 1);
//
// week = (week - 1) * 86400000 * 7;
// date = new Date(date.getTime() + week);
// date.setDate(date.getDate() + 1 - (date.getDay() || 7));
// return date;
// };
var typeProtos = {
number: {
bad: function(val){
return !(isNumber(val));
},
step: 1,
//stepBase: 0, 0 = default
stepScaleFactor: 1,
asNumber: function(str){
return (isNumber(str)) ? str * 1 : nan;
},
numberToString: function(num){
return (isNumber(num)) ? num : false;
}
},
range: {
minDefault: 0,
maxDefault: 100
},
color: {
bad: (function(){
var cReg = /^\u0023[a-f0-9]{6}$/;
return function(val){
return (!val || val.length != 7 || !(cReg.test(val)));
};
})()
},
date: {
bad: function(val){
if(!val || !val.split || !(/\d$/.test(val))){return true;}
var i;
var valA = val.split(/\u002D/);
if(valA.length !== 3){return true;}
var ret = false;
if(valA[0].length < 4 || valA[1].length != 2 || valA[1] > 12 || valA[2].length != 2 || valA[2] > 33){
ret = true;
} else {
for(i = 0; i < 3; i++){
if(!isDateTimePart(valA[i])){
ret = true;
break;
}
}
}
return ret || (val !== this.dateToString( this.asDate(val, true) ) );
},
step: 1,
//stepBase: 0, 0 = default
stepScaleFactor: 86400000,
asDate: function(val, _noMismatch){
if(!_noMismatch && this.bad(val)){
return null;
}
return new Date(this.asNumber(val, true));
},
asNumber: function(str, _noMismatch){
var ret = nan;
if(_noMismatch || !this.bad(str)){
str = str.split(/\u002D/);
ret = Date.UTC(str[0], str[1] - 1, str[2]);
}
return ret;
},
numberToString: function(num){
return (isNumber(num)) ? this.dateToString(new Date( num * 1)) : false;
},
dateToString: function(date){
return (date && date.getFullYear) ? addleadingZero(date.getUTCFullYear(), 4) +'-'+ addleadingZero(date.getUTCMonth()+1, 2) +'-'+ addleadingZero(date.getUTCDate(), 2) : false;
}
},
/*
* ToDO: WEEK
*/
// week: {
// bad: function(val){
// if(!val || !val.split){return true;}
// var valA = val.split('-W');
// var ret = true;
// if(valA.length == 2 && valA[0].length > 3 && valA.length == 2){
// ret = this.dateToString(setWeek(valA[0], valA[1])) != val;
// }
// return ret;
// },
// step: 1,
// stepScaleFactor: 604800000,
// stepBase: -259200000,
// asDate: function(str, _noMismatch){
// var ret = null;
// if(_noMismatch || !this.bad(str)){
// ret = str.split('-W');
// ret = setWeek(ret[0], ret[1]);
// }
// return ret;
// },
// asNumber: function(str, _noMismatch){
// var ret = nan;
// var date = this.asDate(str, _noMismatch);
// if(date && date.getUTCFullYear){
// ret = date.getTime();
// }
// return ret;
// },
// dateToString: function(date){
// var week, checkDate;
// var ret = false;
// if(date && date.getFullYear){
// week = getWeek(date);
// if(week == 1){
// checkDate = new Date(date.getTime());
// checkDate.setDate(checkDate.getDate() + 7);
// date.setUTCFullYear(checkDate.getUTCFullYear());
// }
// ret = addleadingZero(date.getUTCFullYear(), 4) +'-W'+addleadingZero(week, 2);
// }
// return ret;
// },
// numberToString: function(num){
// return (isNumber(num)) ? this.dateToString(new Date( num * 1)) : false;
// }
// },
time: {
bad: function(val, _getParsed){
if(!val || !val.split || !(/\d$/.test(val))){return true;}
val = val.split(/\u003A/);
if(val.length < 2 || val.length > 3){return true;}
var ret = false,
sFraction;
if(val[2]){
val[2] = val[2].split(/\u002E/);
sFraction = parseInt(val[2][1], 10);
val[2] = val[2][0];
}
$.each(val, function(i, part){
if(!isDateTimePart(part) || part.length !== 2){
ret = true;
return false;
}
});
if(ret){return true;}
if(val[0] > 23 || val[0] < 0 || val[1] > 59 || val[1] < 0){
return true;
}
if(val[2] && (val[2] > 59 || val[2] < 0 )){
return true;
}
if(sFraction && isNaN(sFraction)){
return true;
}
if(sFraction){
if(sFraction < 100){
sFraction *= 100;
} else if(sFraction < 10){
sFraction *= 10;
}
}
return (_getParsed === true) ? [val, sFraction] : false;
},
step: 60,
stepBase: 0,
stepScaleFactor: 1000,
asDate: function(val){
val = new Date(this.asNumber(val));
return (isNaN(val)) ? null : val;
},
asNumber: function(val){
var ret = nan;
val = this.bad(val, true);
if(val !== true){
ret = Date.UTC('1970', 0, 1, val[0][0], val[0][1], val[0][2] || 0);
if(val[1]){
ret += val[1];
}
}
return ret;
},
dateToString: function(date){
if(date && date.getUTCHours){
var str = addleadingZero(date.getUTCHours(), 2) +':'+ addleadingZero(date.getUTCMinutes(), 2),
tmp = date.getSeconds()
;
if(tmp != "0"){
str += ':'+ addleadingZero(tmp, 2);
}
tmp = date.getUTCMilliseconds();
if(tmp != "0"){
str += '.'+ addleadingZero(tmp, 3);
}
return str;
} else {
return false;
}
}
},
month: {
bad: function(val){
return typeProtos.date.bad(val+'-01');
},
step: 1,
stepScaleFactor: false,
//stepBase: 0, 0 = default
asDate: function(val){
return new Date(typeProtos.date.asNumber(val+'-01'));
},
asNumber: function(val){
//1970-01
var ret = nan;
if(val && !this.bad(val)){
val = val.split(/\u002D/);
val[0] = (val[0] * 1) - 1970;
val[1] = (val[1] * 1) - 1;
ret = (val[0] * 12) + val[1];
}
return ret;
},
numberToString: function(num){
var mod;
var ret = false;
if(isNumber(num)){
mod = (num % 12);
num = ((num - mod) / 12) + 1970;
mod += 1;
if(mod < 1){
num -= 1;
mod += 12;
}
ret = addleadingZero(num, 4)+'-'+addleadingZero(mod, 2);
}
return ret;
},
dateToString: function(date){
if(date && date.getUTCHours){
var str = typeProtos.date.dateToString(date);
return (str.split && (str = str.split(/\u002D/))) ? str[0]+'-'+str[1] : false;
} else {
return false;
}
}
}
,'datetime-local': {
bad: function(val, _getParsed){
if(!val || !val.split || (val+'special').split(/\u0054/).length !== 2){return true;}
val = val.split(/\u0054/);
return ( typeProtos.date.bad(val[0]) || typeProtos.time.bad(val[1], _getParsed) );
},
noAsDate: true,
asDate: function(val){
val = new Date(this.asNumber(val));
return (isNaN(val)) ? null : val;
},
asNumber: function(val){
var ret = nan;
var time = this.bad(val, true);
if(time !== true){
val = val.split(/\u0054/)[0].split(/\u002D/);
ret = Date.UTC(val[0], val[1] - 1, val[2], time[0][0], time[0][1], time[0][2] || 0);
if(time[1]){
ret += time[1];
}
}
return ret;
},
dateToString: function(date, _getParsed){
return typeProtos.date.dateToString(date) +'T'+ typeProtos.time.dateToString(date, _getParsed);
}
}
};
if(typeBugs || !supportsType('range') || !supportsType('time') || !supportsType('month') || !supportsType('datetime-local')){
typeProtos.range = $.extend({}, typeProtos.number, typeProtos.range);
typeProtos.time = $.extend({}, typeProtos.date, typeProtos.time);
typeProtos.month = $.extend({}, typeProtos.date, typeProtos.month);
typeProtos['datetime-local'] = $.extend({}, typeProtos.date, typeProtos.time, typeProtos['datetime-local']);
}
//
['number', 'month', 'range', 'date', 'time', 'color', 'datetime-local'].forEach(function(type){
if(typeBugs || !supportsType(type)){
webshims.addInputType(type, typeProtos[type]);
}
});
if($('<input />').prop('labels') == null){
webshims.defineNodeNamesProperty('button, input, keygen, meter, output, progress, select, textarea', 'labels', {
prop: {
get: function(){
if(this.type == 'hidden'){return null;}
var id = this.id;
var labels = $(this)
.closest('label')
.filter(function(){
var hFor = (this.attributes['for'] || {});
return (!hFor.specified || hFor.value == id);
})
;
if(id) {
labels = labels.add('label[for="'+ id +'"]');
}
return labels.get();
},
writeable: false
}
});
}
});
;(function($){
"use strict";
var isNumber = function(string){
return (typeof string == 'number' || (string && string == string * 1));
};
var retDefault = function(val, def){
if(!(typeof val == 'number' || (val && val == val * 1))){
return def;
}
return val * 1;
};
var createOpts = ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex'];
var normalizeTouch = (function(){
var types = {
touchstart: 1,
touchend: 1,
touchmove: 1
};
var normalize = ['pageX', 'pageY'];
return function(e){
if(types[e.type] && e.originalEvent && e.originalEvent.touches && e.originalEvent.touches.length){
for(var i = 0; i < normalize.length; i++){
e[normalize[i]] = e.originalEvent.touches[0][normalize[i]];
}
}
return e;
};
})();
var rangeProto = {
_create: function(){
var i;
this.element.addClass(this.options.baseClass || 'ws-range ws-input').attr({role: 'slider'}).append('<span class="ws-range-rail ws-range-track"><span class="ws-range-min ws-range-progress" /><span class="ws-range-thumb"><span><span data-value="" data-valuetext="" /></span></span></span>');
this.trail = $('.ws-range-track', this.element);
this.range = $('.ws-range-progress', this.element);
this.thumb = $('.ws-range-thumb', this.trail);
this.thumbValue = $('span[data-value]', this.thumb);
this.updateMetrics();
this.orig = this.options.orig;
for(i = 0; i < createOpts.length; i++){
this[createOpts[i]](this.options[createOpts[i]]);
}
this.value = this._value;
this.value(this.options.value);
this.initDataList();
this.element.data('rangeUi', this);
this.addBindings();
this._init = true;
},
value: $.noop,
_value: function(val, _noNormalize, animate){
var left, posDif;
var o = this.options;
var oVal = val;
var thumbStyle = {};
var rangeStyle = {};
if(!_noNormalize && parseFloat(val, 10) != val){
val = o.min + ((o.max - o.min) / 2);
}
if(!_noNormalize){
val = this.normalizeVal(val);
}
left = 100 * ((val - o.min) / (o.max - o.min));
if(this._init && val == o.value && oVal == val){return;}
o.value = val;
if($.fn.stop){
this.thumb.stop();
this.range.stop();
}
rangeStyle[this.dirs.width] = left+'%';
if(this.vertical){
left = Math.abs(left - 100);
}
thumbStyle[this.dirs.left] = left+'%';
if(!animate || !$.fn.animate){
this.thumb[0].style[this.dirs.left] = thumbStyle[this.dirs.left];
this.range[0].style[this.dirs.width] = rangeStyle[this.dirs.width];
} else {
if(typeof animate != 'object'){
animate = {};
} else {
animate = $.extend({}, animate);
}
if(!animate.duration){
posDif = Math.abs(left - parseInt(this.thumb[0].style[this.dirs.left] || 50, 10));
animate.duration = Math.max(Math.min(999, posDif * 5), 99);
}
this.thumb.animate(thumbStyle, animate);
this.range.animate(rangeStyle, animate);
}
if(this.orig && (oVal != val || (!this._init && this.orig.value != val)) ){
this.options._change(val);
}
this._setValueMarkup();
},
_setValueMarkup: function(){
var o = this.options;
var textValue = o.textValue ? o.textValue(this.options.value) : o.options[o.value] || o.value;
this.element[0].setAttribute('aria-valuenow', this.options.value);
this.element[0].setAttribute('aria-valuetext', textValue);
this.thumbValue[0].setAttribute('data-value', this.options.value);
this.thumbValue[0].setAttribute('data-valuetext', textValue);
if(o.selectedOption){
$(o.selectedOption).removeClass('ws-selected-option');
o.selectedOption = null;
}
if(o.value in o.options){
o.selectedOption = $('[data-value="'+o.value+'"].ws-range-ticks', this.trail).addClass('ws-selected-option');
}
},
initDataList: function(){
if(this.orig){
var listTimer;
var that = this;
var updateList = function(){
$(that.orig)
.jProp('list')
.off('updateDatalist', updateList)
.on('updateDatalist', updateList)
;
clearTimeout(listTimer);
listTimer = setTimeout(function(){
if(that.list){
that.list();
}
}, 9);
};
$(this.orig).on('listdatalistchange', updateList);
this.list();
}
},
list: function(opts){
var o = this.options;
var min = o.min;
var max = o.max;
var trail = this.trail;
var that = this;
this.element.attr({'aria-valuetext': o.options[o.value] || o.value});
$('.ws-range-ticks', trail).remove();
$(this.orig).jProp('list').find('option:not([disabled])').each(function(){
o.options[$.prop(this, 'value')] = $.prop(this, 'label') || '';
});
$.each(o.options, function(val, label){
if(!isNumber(val) || val < min || val > max){return;}
var left = 100 * ((val - min) / (max - min));
var attr = 'data-value="'+val+'"';
if(label){
attr += ' data-label="'+label+'"';
if(o.showLabels){
attr += ' title="'+label+'"';
}
}
if(that.vertical){
left = Math.abs(left - 100);
}
that.posCenter(
$('<span class="ws-range-ticks"'+ attr +' style="'+(that.dirs.left)+': '+left+'%;" />').appendTo(trail)
);
});
if(o.value in o.options){
this._setValueMarkup();
}
},
readonly: function(val){
val = !!val;
this.options.readonly = val;
this.element.attr('aria-readonly', ''+val);
if(this._init){
this.updateMetrics();
}
},
disabled: function(val){
val = !!val;
this.options.disabled = val;
if(val){
this.element.attr({tabindex: -1, 'aria-disabled': 'true'});
} else {
this.element.attr({tabindex: this.options.tabindex, 'aria-disabled': 'false'});
}
if(this._init){
this.updateMetrics();
}
},
tabindex: function(val){
this.options.tabindex = val;
if(!this.options.disabled){
this.element.attr({tabindex: val});
}
},
title: function(val){
this.element.prop('title', val);
},
min: function(val){
this.options.min = retDefault(val, 0);
this.element.attr('aria-valuemin', this.options.min);
this.value(this.options.value, true);
},
max: function(val){
this.options.max = retDefault(val, 100);
this.element.attr('aria-valuemax', this.options.max);
this.value(this.options.value, true);
},
step: function(val){
var o = this.options;
var step = val == 'any' ? 'any' : retDefault(val, 1);
if(o.stepping){
webshims.error('stepping was removed. Use stepfactor instead.');
}
if(o.stepfactor && step != 'any'){
step *= o.stepfactor;
}
o.step = step;
this.value(this.options.value);
},
normalizeVal: function(val){
var valModStep, alignValue, step;
var o = this.options;
if(val <= o.min){
val = o.min;
} else if(val >= o.max) {
val = o.max;
} else if(o.step != 'any'){
step = o.step;
valModStep = (val - o.min) % step;
alignValue = val - valModStep;
if ( Math.abs(valModStep) * 2 >= step ) {
alignValue += ( valModStep > 0 ) ? step : ( -step );
}
val = alignValue.toFixed(5) * 1;
}
return val;
},
doStep: function(factor, animate){
var step = retDefault(this.options.step, 1);
if(this.options.step == 'any'){
step = Math.min(step, (this.options.max - this.options.min) / 10);
}
this.value( this.options.value + (step * factor), false, animate );
},
getStepedValueFromPos: function(pos){
var val, valModStep, alignValue, step;
if(pos <= 0){
val = this.options[this.dirs[this.isRtl ? 'max' : 'min']];
} else if(pos > 100) {
val = this.options[this.dirs[this.isRtl ? 'min' : 'max']];
} else {
if(this.vertical || this.isRtl){
pos = Math.abs(pos - 100);
}
val = ((this.options.max - this.options.min) * (pos / 100)) + this.options.min;
step = this.options.step;
if(step != 'any'){
valModStep = (val - this.options.min) % step;
alignValue = val - valModStep;
if ( Math.abs(valModStep) * 2 >= step ) {
alignValue += ( valModStep > 0 ) ? step : ( -step );
}
val = ((alignValue).toFixed(5)) * 1;
}
}
return val;
},
addRemoveClass: function(cName, add){
var isIn = this.element.prop('className').indexOf(cName) != -1;
var action;
if(!add && isIn){
action = 'removeClass';
this.element.removeClass(cName);
this.updateMetrics();
} else if(add && !isIn){
action = 'addClass';
}
if(action){
this.element[action](cName);
if(this._init){
this.updateMetrics();
}
}
},
addBindings: function(){
var leftOffset, widgetUnits, hasFocus, isActive;
var that = this;
var o = this.options;
var eventTimer = (function(){
var events = {};
return {
init: function(name, curVal, fn){
if(!events[name]){
events[name] = {fn: fn};
if(that.orig){
$(that.orig).on(name, function(){
events[name].val = $.prop(that.orig, 'value');
});
}
}
events[name].val = curVal;
},
call: function(name, val){
if(events[name].val != val){
clearTimeout(events[name].timer);
events[name].val = val;
events[name].timer = setTimeout(function(){
events[name].fn(val, that);
}, 0);
}
}
};
})();
var updateValue = function(val, animate){
if(val != o.value){
that.value(val, false, animate);
eventTimer.call('input', val);
}
};
var setValueFromPos = function(e, animate){
if(e.type == 'touchmove'){
e.preventDefault();
normalizeTouch(e);
}
updateValue(that.getStepedValueFromPos((e[that.dirs.mouse] - leftOffset) * widgetUnits), animate);
if(e && e.type == 'mousemove'){
e.preventDefault();
}
};
var remove = function(e){
if(e && (e.type == 'mouseup' || e.type == 'touchend')){
eventTimer.call('input', o.value);
eventTimer.call('change', o.value);
}
that.addRemoveClass('ws-active');
$(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove);
$(window).off('blur', removeWin);
isActive = false;
};
var removeWin = function(e){
if(e.target == window){remove();}
};
var add = function(e){
if(isActive || (e.type == 'touchstart' && (!e.originalEvent || !e.originalEvent.touches || e.originalEvent.touches.length != 1))){
return;
}
e.preventDefault();
$(document).off('mousemove touchmove', setValueFromPos).off('mouseup touchend', remove);
$(window).off('blur', removeWin);
if(!o.readonly && !o.disabled){
eventTimer.init('input', o.value);
eventTimer.init('change', o.value);
normalizeTouch(e);
that.element.trigger('focus');
that.addRemoveClass('ws-active', true);
leftOffset = that.element.offset();
widgetUnits = that.element[that.dirs.innerWidth]();
if(!widgetUnits || !leftOffset){return;}
leftOffset = leftOffset[that.dirs.pos];
widgetUnits = 100 / widgetUnits;
if(e.target.className == 'ws-range-ticks'){
updateValue(e.target.getAttribute('data-value'), o.animate);
} else {
setValueFromPos(e, o.animate);
}
isActive = true;
$(document)
.on(e.type == 'touchstart' ?
{
touchend: remove,
touchmove: setValueFromPos
} :
{
mouseup: remove,
mousemove: setValueFromPos
}
)
;
$(window).on('blur', removeWin);
e.stopPropagation();
}
};
var elementEvts = {
'touchstart mousedown': add,
focus: function(e){
if(!o.disabled && !hasFocus){
if(!isActive){
eventTimer.init('input', o.value);
eventTimer.init('change', o.value);
}
that.addRemoveClass('ws-focus', true);
that.updateMetrics();
}
hasFocus = true;
},
blur: function(e){
that.element.removeClass('ws-focus ws-active');
that.updateMetrics();
hasFocus = false;
eventTimer.init('input', o.value);
eventTimer.call('change', o.value);
},
keyup: function(){
that.addRemoveClass('ws-active');
eventTimer.call('input', o.value);
eventTimer.call('change', o.value);
},
keydown: function(e){
var step = true;
var code = e.keyCode;
if(!o.readonly && !o.disabled){
if(that.isRtl){
if(code == 39){
code = 37;
} else if(code == 37){
code = 39;
}
}
if (code == 39 || code == 38) {
that.doStep(1);
} else if (code == 37 || code == 40) {
that.doStep(-1);
} else if (code == 33) {
that.doStep(10, o.animate);
} else if (code == 34) {
that.doStep(-10, o.animate);
} else if (code == 36) {
that.value(that.options.max, false, o.animate);
} else if (code == 35) {
that.value(that.options.min, false, o.animate);
} else {
step = false;
}
if (step) {
that.addRemoveClass('ws-active', true);
eventTimer.call('input', o.value);
e.preventDefault();
}
}
}
};
eventTimer.init('input', o.value, this.options.input);
eventTimer.init('change', o.value, this.options.change);
elementEvts[$.fn.mwheelIntent ? 'mwheelIntent' : 'mousewheel'] = function(e, delta){
if(delta && hasFocus && !o.readonly && !o.disabled){
that.doStep(delta);
e.preventDefault();
eventTimer.call('input', o.value);
}
};
this.element.on(elementEvts);
this.thumb.on({
mousedown: add
});
if(this.orig){
$(this.orig).jProp('form').on('reset', function(){
var val = $.prop(that.orig, 'value');
that.value(val);
setTimeout(function(){
var val2 = $.prop(that.orig, 'value');
if(val != val2){
that.value(val2);
}
}, 4);
});
}
if (window.webshims) {
webshims.ready('WINDOWLOAD', function(){
webshims.ready('dom-support', function(){
if ($.fn.onWSOff) {
var timer;
var update = function(){
that.updateMetrics();
};
that.element.onWSOff('updateshadowdom', function(){
clearTimeout(timer);
timer = setTimeout(update, 100);
});
}
});
if (!$.fn.onWSOff && webshims._polyfill) {
webshims._polyfill(['dom-support']);
}
});
}
},
posCenter: function(elem, outerWidth){
var temp, eS;
if(this.options.calcCenter && (!this._init || this.element[0].offsetWidth)){
if(!elem){
elem = this.thumb;
}
eS = elem[0].style;
if(!outerWidth){
outerWidth = elem[this.dirs.outerWidth]();
}
outerWidth = outerWidth / -2;
eS[this.dirs.marginLeft] = outerWidth +'px';
if(this.options.calcTrail && elem[0] == this.thumb[0]){
temp = this.element[this.dirs.innerHeight]();
eS[this.dirs.marginTop] = ((elem[this.dirs.outerHeight]() - temp) / -2) + 'px';
this.range[0].style[this.dirs.marginTop] = ((this.range[this.dirs.outerHeight]() - temp) / -2 ) +'px';
this.range[0].style[this.dirs.posLeft] = outerWidth +'px';
outerWidth *= -1;
this.range[0].style[this.dirs.paddingRight] = outerWidth +'px';
this.trail[0].style[this.dirs.left] = outerWidth +'px';
this.trail[0].style[this.dirs.right] = outerWidth +'px';
}
}
},
updateMetrics: function(){
var width = this.element.innerWidth();
this.vertical = (width && this.element.innerHeight() - width > 10);
this.dirs = this.vertical ?
{mouse: 'pageY', pos: 'top', posLeft: 'bottom', paddingRight: 'paddingTop', min: 'max', max: 'min', left: 'top', right: 'bottom', width: 'height', innerWidth: 'innerHeight', innerHeight: 'innerWidth', outerWidth: 'outerHeight', outerHeight: 'outerWidth', marginTop: 'marginLeft', marginLeft: 'marginTop'} :
{mouse: 'pageX', pos: 'left', posLeft: 'left', paddingRight: 'paddingRight', min: 'min', max: 'max', left: 'left', right: 'right', width: 'width', innerWidth: 'innerWidth', innerHeight: 'innerHeight', outerWidth: 'outerWidth', outerHeight: 'outerHeight', marginTop: 'marginTop', marginLeft: 'marginLeft'}
;
if(!this.vertical && this.element.css('direction') == 'rtl'){
this.isRtl = true;
this.dirs.left = 'right';
this.dirs.right = 'left';
this.dirs.marginLeft = 'marginRight';
this.dirs.posLeft = 'right';
}
this.element
[this.vertical ? 'addClass' : 'removeClass']('vertical-range')
[this.isRtl ? 'addClass' : 'removeClass']('ws-is-rtl')
;
this.updateMetrics = this.posCenter;
this.posCenter();
}
};
var oCreate = function (o) {
function F() {}
F.prototype = o;
return new F();
};
$.fn.rangeUI = function(opts){
opts = $.extend({
readonly: false,
disabled: false,
tabindex: 0,
min: 0,
step: 1,
max: 100,
value: 50,
input: $.noop,
change: $.noop,
_change: $.noop,
showLabels: true,
options: {},
calcCenter: true,
calcTrail: true
}, opts);
return this.each(function(){
var obj = $.extend(oCreate(rangeProto), {element: $(this)});
obj.options = opts;
obj._create.call(obj);
});
};
$.fn.rangeUI.normalizeTouch = normalizeTouch;
if(window.webshims && webshims.isReady){
webshims.isReady('range-ui', true);
}
})(window.webshims ? webshims.$ : jQuery);
;webshims.register('form-number-date-ui', function($, webshims, window, document, undefined, options){
"use strict";
var curCfg;
var formcfg = webshims.formcfg;
var hasFormValidation = webshims.support.formvalidation && !webshims.bugs.bustedValidity;
var monthDigits = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'];
var stopPropagation = function(e){
e.stopImmediatePropagation();
};
var getMonthOptions = function(opts){
var selectName = 'monthSelect'+opts.monthNames;
if(!curCfg[selectName]){
var labels = curCfg.date[opts.monthNames] || monthDigits;
curCfg[selectName] = ('<option value=""></option>')+$.map(monthDigits, function(val, i){
return '<option value="'+val+'">'+labels[i]+'</option>';
}).join('');
}
return curCfg[selectName];
};
var daySelect = '<select class="dd"><option value=""></option>'+ (function(){
var i = 1;
var opts = [];
while(i < 32){
opts.push('<option>'+ ((i < 10) ? '0'+ i : i) +'</option>' );
i++;
}
return opts.join('');
})() +'</select>';
var createFormat = function(name){
if(!curCfg.patterns[name+'Obj']){
var obj = {};
$.each(curCfg.patterns[name].split(curCfg[name+'Format']), function(i, name){
obj[name] = i;
});
curCfg.patterns[name+'Obj'] = obj;
}
};
var createYearSelect = function(obj, opts){
var options, nowY, max, min;
if(opts.yearSelect){
nowY = parseInt(opts.value.split('-')[0], 10);
max = opts.max.split('-');
min = opts.min.split('-');
options = webshims.picker.createYearSelect(nowY || parseInt(min[0], 10) || parseInt(max[0], 10) || nowYear, max, min);
options.unshift('<option />');
$(obj.elements)
.filter('select.yy')
.html(options.join(''))
.each(function(){
if(!nowY){
$('option[selected]', this).removeAttr('selected');
$(this).val();
}
})
;
}
};
var numericType = webshims.support.inputtypes.tel && navigator.userAgent.indexOf('Mobile') != -1 && !('inputMode' in document.createElement('input') && !('inputmode' in document.createElement('input'))) ?
'tel' : 'text';
var splitInputs = {
date: {
_create: function(opts){
var obj = {
splits: []
};
if(opts.yearSelect){
obj.splits.push($('<select class="yy"></select>')[0]);
} else {
obj.splits.push($('<input type="'+ numericType +'" class="yy" size="4" inputmode="numeric" maxlength="4" />')[0]);
}
if(opts.monthSelect){
obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
} else {
obj.splits.push($('<input type="'+ numericType +'" class="mm" inputmode="numeric" maxlength="2" size="2" />')[0]);
}
if(opts.daySelect){
obj.splits.push($(daySelect)[0]);
} else {
obj.splits.push($('<input type="'+ numericType +'" class="dd ws-spin" inputmode="numeric" maxlength="2" size="2" />')[0]);
}
obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1], $('<span class="ws-input-seperator" />')[0], obj.splits[2]];
createYearSelect(obj, opts);
return obj;
},
sort: function(element){
createFormat('d');
var i = 0;
var seperators = $('.ws-input-seperator', element).html(curCfg.dFormat);
var inputs = $('input, select', element);
$.each(curCfg.patterns.dObj, function(name, value){
var input = inputs.filter('.'+ name);
if(input[0]){
input.appendTo(element);
if(i < seperators.length){
seperators.eq(i).insertAfter(input);
}
i++;
}
});
}
},
month: {
_create: function(opts){
var obj = {
splits: []
};
if(opts.yearSelect){
obj.splits.push($('<select class="yy"></select>')[0]);
} else {
obj.splits.push($('<input type="'+ numericType +'" class="yy" size="4" inputmode="numeric" maxlength="4" />')[0]);
}
if(opts.monthSelect){
obj.splits.push($('<select class="mm">'+getMonthOptions(opts)+'</select>')[0]);
} else {
obj.splits.push($('<input type="text" class="mm ws-spin" />')[0]);
if(opts.onlyMonthDigits){
$().attr({inputmode: 'numeric', size: 2, maxlength: 2});
try {
obj.splits[1].setAttribute('type', numericType);
} catch(e){}
}
}
obj.elements = [obj.splits[0], $('<span class="ws-input-seperator" />')[0], obj.splits[1]];
createYearSelect(obj, opts);
return obj;
},
sort: function(element){
var seperator = $('.ws-input-seperator', element).html(curCfg.dFormat);
var mm = $('input.mm, select.mm', element);
var action;
if(curCfg.date.showMonthAfterYear){
mm.appendTo(element);
action = 'insertBefore';
} else {
mm.prependTo(element);
action = 'insertAfter';
}
seperator[action](mm);
}
}
};
var nowDate = new Date(new Date().getTime() - (new Date().getTimezoneOffset() * 60 * 1000 ));
var nowYear = nowDate.getFullYear();
nowDate = new Date(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate(), nowDate.getHours()).getTime();
var steps = {
number: {
step: 1
},
// week: {
// step: 1,
// start: new Date(nowDate)
// },
'datetime-local': {
step: 60,
start: new Date(nowDate).getTime()
},
time: {
step: 60
},
month: {
step: 1,
start: new Date(nowDate)
},
date: {
step: 1,
start: new Date(nowDate)
}
};
var labelWidth = (function(){
var getId = function(){
return webshims.getID(this);
};
return function(element, labels, noFocus){
$(element).attr({'aria-labelledby': labels.map(getId).get().join(' ')});
if(!noFocus){
labels.on('click', function(e){
if(!e.isDefaultPrevented()){
element.getShadowFocusElement().focus();
e.preventDefault();
return false;
}
});
}
};
})();
var addZero = function(val){
if(!val){return "";}
val = val+'';
return val.length == 1 ? '0'+val : val;
};
var loadPicker = function(type, name){
type = (type == 'color' ? 'color' : 'forms')+'-picker';
if(!loadPicker[name+'Loaded'+type]){
loadPicker[name+'Loaded'+type] = true;
webshims.ready(name, function(){
webshims.loader.loadList([type]);
});
}
return type;
};
options.addZero = addZero;
webshims.loader.addModule('forms-picker', {
noAutoCallback: true,
css: 'styles/forms-picker.css',
options: options
});
webshims.loader.addModule('color-picker', {
noAutoCallback: true,
css: 'jpicker/jpicker.css',
options: options,
d: ['forms-picker']
});
options.steps = steps;
(function(){
formcfg.de = $.extend(true, {
numberFormat: {
",": ".",
".": ","
},
timeSigns: ":. ",
numberSigns: ',',
dateSigns: '.',
dFormat: ".",
patterns: {
d: "dd.mm.yy"
},
month: {
currentText: 'Aktueller Monat'
},
time: {
currentText: 'Jetzt'
},
date: {
close: 'schließen',
clear: 'Löschen',
prevText: 'Zurück',
nextText: 'Vor',
currentText: 'Heute',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
weekHeader: 'KW',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''
}
}, formcfg.de || {});
formcfg.en = $.extend(true, {
numberFormat: {
".": ".",
",": ","
},
numberSigns: '.',
dateSigns: '/',
timeSigns: ":. ",
dFormat: "/",
patterns: {
d: "mm/dd/yy"
},
meridian: ['AM', 'PM'],
month: {
currentText: 'This month'
},
time: {
"currentText": "Now"
},
date: {
"closeText": "Done",
clear: 'Clear',
"prevText": "Prev",
"nextText": "Next",
"currentText": "Today",
"monthNames": ["January","February","March","April","May","June","July","August","September","October","November","December"],
"monthNamesShort": ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
"dayNames": ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
"dayNamesShort": ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],
"dayNamesMin": ["Su","Mo","Tu","We","Th","Fr","Sa"],
"weekHeader": "Wk",
"firstDay": 0,
"isRTL": false,
"showMonthAfterYear": false,
"yearSuffix": ""
}
}, formcfg.en || {});
if(!formcfg['en-US']){
formcfg['en-US'] = $.extend(true, {}, formcfg['en']);
}
if(!formcfg['en-GB']){
formcfg['en-GB'] = $.extend(true, {}, formcfg.en, {
date: {firstDay: 1},
patterns: {d: "dd/mm/yy"}
});
}
if(!formcfg['en-AU']){
formcfg['en-AU'] = $.extend(true, {}, formcfg['en-GB']);
}
if(!formcfg['']){
formcfg[''] = formcfg['en-US'];
}
curCfg = formcfg[''];
var processLangCFG = function(langCfg){
if(!langCfg.date.monthkeys){
var create = function(i, name){
var strNum;
var num = i + 1;
strNum = (num < 10) ? '0'+num : ''+num;
langCfg.date.monthkeys[num] = strNum;
langCfg.date.monthkeys[name] = strNum;
langCfg.date.monthkeys[name.toLowerCase()] = strNum;
};
langCfg.date.monthkeys = {};
langCfg.date.monthDigits = monthDigits;
langCfg.numberSigns += '-';
if(langCfg.meridian){
langCfg.timeSigns += langCfg.meridian[0] + langCfg.meridian[1] + langCfg.meridian[0].toLowerCase() + langCfg.meridian[1].toLowerCase();
}
$.each(langCfg.date.monthNames, create);
$.each(langCfg.date.monthNamesShort, create);
}
if(!langCfg.colorSigns){
langCfg.colorSigns = '#abcdefABCDEF';
}
if(!langCfg['datetime-localSigns']){
langCfg['datetime-localSigns'] = langCfg.dateSigns+langCfg.timeSigns;
}
if(!langCfg['datetime-local']){
langCfg['datetime-local'] = {};
}
if(!langCfg.time){
langCfg.time = {};
}
if(!langCfg['datetime-local'].currentText && langCfg.time.currentText){
langCfg['datetime-local'].currentText = langCfg.time.currentText;
}
};
var triggerLocaleChange = function(){
processLangCFG(curCfg);
$(document).triggerHandler('wslocalechange');
};
curCfg = webshims.activeLang(formcfg);
triggerLocaleChange();
$(formcfg).on('change', function(){
curCfg = formcfg.__active;
triggerLocaleChange();
});
})();
(function(){
var retDefault = function(val, def){
if(!(typeof val == 'number' || (val && val == val * 1))){
return def;
}
return val * 1;
};
var formatVal = {
number: function(val, o, noCorrect){
var parts, len, i, isNegative;
if(o && o.nogrouping){
return (val+'').replace(/\,/g, '').replace(/\./, curCfg.numberFormat['.']);
}
val += '';
if(val.charAt(0) == '-'){
isNegative = true;
val = val.replace('-', '');
}
parts = val.split('.');
len = parts[0].length;
i = len - 1;
val = "";
while(i >= 0) {
val = parts[0].charAt(i) + val;
if (i > 0 && (len - i) % 3 === 0) {
val = curCfg.numberFormat[','] + val;
}
--i;
}
if(parts[1] != null){
if(!noCorrect){
parts[1] = parts[1].replace(/\-/g, '0');
}
val += curCfg.numberFormat['.'] + parts[1];
}
if(isNegative){
val = '-'+val;
}
return val;
},
time: function(val, o, noCorrect){
var fVal, i;
if(val){
val = val.split(':');
if(curCfg.meridian){
fVal = (val[0] * 1);
if(fVal && fVal >= 12){
val[0] = addZero(fVal - 12+'');
fVal = 1;
} else {
fVal = 0;
}
if(val[0] === '00'){
val[0] = '12';
}
}
if(!noCorrect){
for(i = 0; i < val.length; i++){
val[i] = addZero(val[i]);
}
if(!val[1]){
val[1] = '00';
}
}
val = $.trim(val.join(':'));
if(fVal != null && curCfg.meridian){
val += ' '+curCfg.meridian[fVal];
}
}
return val;
},
'datetime-local': function(val, o){
var fVal = $.trim(val || '').split('T');
if(fVal.length == 2){
val = this.date(fVal[0], o) +' '+this.time(fVal[1], o);
}
return val;
},
// week: function(val){
// return val;
// },
//todo empty val for month/split
month: function(val, options){
var names;
var p = val.split('-');
if(p[0] && p[1]){
if(!options || !options.monthSelect){
names = curCfg.date[options.monthNames] || curCfg.date.monthNames;
p[1] = names[(p[1] * 1) - 1];
}
if(options && options.splitInput){
val = [p[0] || '', p[1] || ''];
} else if(p[1]){
val = curCfg.date.showMonthAfterYear ? p.join(' ') : p[1]+' '+p[0];
}
} else if(options && options.splitInput){
val = [p[0] || '', p[1] || ''];
}
return val;
},
date: function(val, opts){
var p = (val+'').split('-');
if(p[2] && p[1] && p[0]){
if(opts && opts.splitInput){
val = p;
} else {
val = curCfg.patterns.d.replace('yy', p[0] || '');
val = val.replace('mm', p[1] || '');
val = val.replace('dd', p[2] || '');
}
} else if(opts && opts.splitInput){
val = [p[0] || '', p[1] || '', p[2] || ''];
}
return val;
},
color: function(val, opts){
var ret = '#000000';
if(val){
val = val.toLowerCase();
if(val.length == 7 && createHelper('color').isValid(val)) {
ret = val;
}
}
return ret;
}
};
var parseVal = {
number: function(val){
return (val+'').split(curCfg.numberFormat[',']).join('').replace(curCfg.numberFormat['.'], '.');
},
// week: function(val){
// return val;
// },
'datetime-local': function(val, o){
var tmp;
var fVal = $.trim(val || '').split(/\s+/);
if(fVal.length == 2){
if(fVal[0].indexOf(':') != -1 && fVal[1].indexOf(':') == -1){
tmp = fVal[1];
fVal[1] = fVal[0];
fVal[0] = tmp;
}
val = this.date(fVal[0], o) +'T'+ this.time(fVal[1], o);
} else if (fVal.length == 3) {
val = this.date(fVal[0], o) +'T'+ this.time(fVal[1]+fVal[2], o);
}
return val;
},
time: function(val){
var fVal;
if(val && curCfg.meridian){
val = val.toUpperCase();
if(val.substr(0,2) === "12"){
val = "00" + val.substr(2);
}
if(val.indexOf(curCfg.meridian[1]) != -1){
val = val.split(':');
fVal = (val[0].replace(curCfg.meridian[1], '') * 1);
if(!isNaN(fVal)){
val[0] = fVal + 12;
}
val = val.join(':');
}
val = $.trim(val.replace(curCfg.meridian[0], '').replace(curCfg.meridian[1], ''));
}
return val;
},
month: function(val, opts, noCorrect){
var p = (!opts.splitInput) ? val.trim().split(/[\.\s-\/\\]+/) : val;
if(p.length == 2 && p[0] && p[1]){
p[0] = !noCorrect && curCfg.date.monthkeys[p[0]] || p[0];
p[1] = !noCorrect && curCfg.date.monthkeys[p[1]] || p[1];
if(p[1].length == 2 && p[0].length > 3){
val = p[0]+'-'+p[1];
} else if(p[0].length == 2 && p[1].length > 3){
val = p[1]+'-'+p[0];
} else {
val = '';
}
} else if(opts.splitInput) {
val = '';
}
return val;
},
date: function(val, opts, noCorrect){
createFormat('d');
var tmp, obj;
var ret = '';
if(opts.splitInput){
obj = {yy: 0, mm: 1, dd: 2};
} else {
obj = curCfg.patterns.dObj;
val = val.split(curCfg.dFormat);
}
if(val.length == 3 && val[0] && val[1] && val[2] && (!noCorrect || (val[obj.yy].length > 3 && val[obj.mm].length == 2 && val[obj.dd].length == 2))){
if(!opts.noDayMonthSwitch && val[obj.mm] > 12 && val[obj.dd] < 13){
tmp = val[obj.dd];
val[obj.dd] = val[obj.mm];
val[obj.mm] = tmp;
}
if(val[obj.yy].length < 4){
tmp = ((new Date()).getFullYear() +'').substr(0, 4 - val[obj.yy].length);
if(val[obj.yy] > 50){
tmp--;
}
val[obj.yy] = tmp + val[obj.yy];
}
ret = ([addZero(val[obj.yy]), addZero(val[obj.mm]), addZero(val[obj.dd])]).join('-');
}
return ret
;
},
color: function(val, opts){
var ret = '#000000';
if(val){
val = val.toLowerCase();
if (val.indexOf('#') !== 0) {
val = '#' + val;
}
if(val.length == 4){
val = '#' + val.charAt(1) + val.charAt(1) + val.charAt(2) + val.charAt(2) + val.charAt(3) + val.charAt(3);
}
if(val.length == 7 && createHelper('color').isValid(val)) {
ret = val;
}
}
return ret;
}
};
var placeholderFormat = {
date: function(val, opts){
var hintValue = (val || '').split('-');
if(hintValue.length == 3){
hintValue = opts.splitInput ?
hintValue :
curCfg.patterns.d.replace('yy', hintValue[0]).replace('mm', hintValue[1]).replace('dd', hintValue[2]);
} else {
hintValue = opts.splitInput ?
[val, val, val] :
val;
}
return hintValue;
},
month: function(val, opts){
var hintValue = (val || '').split('-');
if(hintValue.length == 2){
hintValue = opts.splitInput ?
hintValue :
curCfg.date.showMonthAfterYear ?
hintValue[0] +' '+hintValue[1] :
hintValue[1] +' '+ hintValue[0];
} else {
hintValue = opts.splitInput ?
[val, val] :
val;
}
return hintValue;
}
};
var createHelper = (function(){
var types = {};
return function(type){
var input;
if(!types[type]){
input = $('<input type="'+type+'" step="any" />');
types[type] = {
asNumber: function(val){
var type = (typeof val == 'object') ? 'valueAsDate' : 'value';
return input.prop(type, val).prop('valueAsNumber');
},
asValue: function(val){
var type = (typeof val == 'object') ? 'valueAsDate' : 'valueAsNumber';
return input.prop(type, val).prop('value');
},
asDate: function(val){
var type = (typeof val == 'number') ? 'valueAsNumber' : 'value';
return input.prop(type, val).prop('valueAsDate');
},
isValid: function(val, attrs){
if(attrs && (attrs.nodeName || attrs.jquery)){
attrs = {
min: $(attrs).prop('min') || '',
max: $(attrs).prop('max') || '',
step: $(attrs).prop('step') || 'any'
};
}
attrs = $.extend({step: 'any', min: '', max: ''}, attrs || {});
return input.attr(attrs).prop('value', val).is(':valid') && input.prop('value') == val;
}
};
}
return types[type];
};
})();
steps.range = steps.number;
var wsWidgetProto = {
_create: function(){
var i, that, timedMirror;
var o = this.options;
var createOpts = this.createOpts;
this.type = o.type;
this.orig = o.orig;
this.buttonWrapper = $('<span class="input-buttons '+this.type+'-input-buttons"></span>').insertAfter(this.element);
this.options.containerElements.push(this.buttonWrapper[0]);
o.mirrorValidity = o.mirrorValidity && this.orig && hasFormValidation;
if(o.splitInput && this._addSplitInputs){
if(o.monthSelect){
this.element.addClass('ws-month-select');
}
this._addSplitInputs();
} else {
this.inputElements = this.element;
}
if( steps[this.type] && typeof steps[this.type].start == 'object'){
steps[this.type].start = this.asNumber(steps[this.type].start);
}
for(i = 0; i < createOpts.length; i++){
if(o[createOpts[i]] != null){
this[createOpts[i]](o[createOpts[i]], o[createOpts[i]]);
}
}
if(this.type == 'color'){
this.inputElements.prop('maxLength', 7);
}
this.addBindings();
$(this.element).data('wsWidget'+o.type, this);
if(o.buttonOnly){
this.inputElements.prop({readOnly: true});
}
this._init = true;
if(o.mirrorValidity){
that = this;
timedMirror = function(){
clearTimeout(timedMirror._timerDealy);
timedMirror._timerDealy = setTimeout(timedMirror._wsexec, 9);
};
timedMirror._wsexec = function(){
clearTimeout(timedMirror._timerDealy);
that.mirrorValidity(true);
};
timedMirror();
$(this.orig).on('change input', function(e){
if(e.type == 'input'){
timedMirror();
} else {
timedMirror._wsexec();
}
});
}
},
mirrorValidity: function(_noTest){
//
if(this._init && this.options.mirrorValidity){
if(!_noTest){
$.prop(this.orig, 'validity');
}
var message = $(this.orig).getErrorMessage();
if(message !== this.lastErrorMessage){
this.inputElements.prop('setCustomValidity', function(i, val){
if(val._supvalue){
val._supvalue.call(this, message);
}
});
this.lastErrorMessage = message;
}
}
},
addBindings: function(){
var that = this;
var o = this.options;
var run = function(){
that._addBindings();
};
if(this._addBindings){
run();
} else {
webshims.ready('forms-picker', run);
loadPicker(this.type, 'WINDOWLOAD');
}
this.inputElements
.add(this.buttonWrapper)
.add(this.element)
.one('mousedown focusin', function(e){
loadPicker(that.type, 'DOM');
})
.on({
'change input focus focusin blur focusout': function(e){
var oVal, nVal;
$(e.target).trigger('ws__'+e.type);
if(o.toFixed && o.type == 'number' && e.type == 'change'){
oVal = that.element.prop('value');
nVal = that.toFixed(oVal, true);
if(oVal != nVal){
that.element[0].value = nVal;
}
}
}
})
;
if(this.type != 'color'){
(function(){
var localeChange, select, selectVal;
if(!o.splitInput){
localeChange = function(){
if(o.value){
that.value(o.value, true);
}
if(placeholderFormat[that.type] && o.placeholder){
that.placeholder(o.placeholder);
}
};
} else {
localeChange = function(){
that.reorderInputs();
if(o.monthSelect){
select = that.inputElements.filter('select.mm');
selectVal = select.prop('value');
select.html(getMonthOptions(o));
select.prop('value', selectVal);
}
};
that.reorderInputs();
}
$(that.orig).onWSOff('wslocalechange', localeChange);
})();
}
},
required: function(val, boolVal){
this.inputElements.attr({'aria-required': ''+boolVal});
this.mirrorValidity();
},
parseValue: function(noCorrect){
var value = this.inputElements.map(function(){
return $.prop(this, 'value');
}).get();
if(!this.options.splitInput){
value = value[0];
}
return parseVal[this.type](value, this.options, noCorrect);
},
formatValue: function(val, noSplit){
return formatVal[this.type](val, noSplit === false ? false : this.options);
},
createOpts: ['readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'],
placeholder: function(val){
var options = this.options;
options.placeholder = val;
var placeholder = val;
if(placeholderFormat[this.type]){
placeholder = placeholderFormat[this.type](val, this.options);
}
if(options.splitInput && typeof placeholder == 'object'){
$.each(this.splits, function(i, elem){
if($.nodeName(elem, 'select')){
$(elem).children('option:first-child').text(placeholder[i]);
} else {
$.prop(elem, 'placeholder', placeholder[i]);
}
});
} else {
this.element.prop('placeholder', placeholder);
}
},
list: function(val){
if(this.type == 'number'){
this.element.attr('list', $.attr(this.orig, 'list'));
}
this.options.list = val;
this._propertyChange('list');
},
_propertyChange: $.noop,
tabindex: function(val){
this.options.tabindex = val;
this.inputElements.prop('tabindex', this.options.tabindex);
$('button', this.buttonWrapper).prop('tabindex', this.options.tabindex);
},
title: function(val){
if(!val && this.orig && $.attr(this.orig, 'title') == null){
val = null;
}
this.options.title = val;
if(val == null){
this.inputElements.removeAttr('title');
} else {
this.inputElements.prop('title', this.options.title);
}
}
};
['defaultValue', 'value'].forEach(function(name){
wsWidgetProto[name] = function(val, force){
if(!this._init || force || val !== this.options[name]){
this.element.prop(name, this.formatValue(val));
this.options[name] = val;
this._propertyChange(name);
this.mirrorValidity();
}
};
});
['readonly', 'disabled'].forEach(function(name){
var isDisabled = name == 'disabled';
wsWidgetProto[name] = function(val, boolVal){
var options = this.options;
if(options[name] != boolVal || !this._init){
options[name] = !!boolVal;
if(!isDisabled && options.buttonOnly){
this.inputElements.attr({'aria-readonly': options[name]});
} else {
this.inputElements.prop(name, options[name]);
}
this.buttonWrapper[options[name] ? 'addClass' : 'removeClass']('ws-'+name);
if(isDisabled){
$('button', this.buttonWrapper).prop('disabled', options[name]);
}
}
};
});
var spinBtnProto = $.extend({}, wsWidgetProto, {
_create: function(){
var o = this.options;
var helper = createHelper(o.type);
this.elemHelper = $('<input type="'+ o.type+'" />');
this.asNumber = helper.asNumber;
this.asValue = helper.asValue;
this.isValid = helper.isValid;
this.asDate = helper.asDate;
wsWidgetProto._create.apply(this, arguments);
this._init = false;
this.buttonWrapper.html('<span unselectable="on" class="step-controls"><span class="step-up step-control"></span><span class="step-down step-control"></span></span>');
if(this.type == 'number'){
this.inputElements.attr('inputmode', 'numeric');
}
if((!o.max && typeof o.relMax == 'number') || (!o.min && typeof o.relMin == 'number')){
webshims.error('relMax/relMin are not supported anymore calculate at set it your own.');
}
if(this.options.relDefaultValue){
webshims.warn('relDefaultValue was removed use startValue instead!');
}
this._init = true;
},
createOpts: ['step', 'min', 'max', 'readonly', 'title', 'disabled', 'tabindex', 'placeholder', 'defaultValue', 'value', 'required'],
_addSplitInputs: function(){
if(!this.inputElements){
var create = splitInputs[this.type]._create(this.options);
this.splits = create.splits;
this.inputElements = $(create.elements).prependTo(this.element).filter('input, select');
}
},
addZero: addZero,
_setStartInRange: function(){
var start = this.options.startValue && this.asNumber( this.options.startValue ) || steps[this.type].start || 0;
if(!isNaN(this.minAsNumber) && start < this.minAsNumber){
start = this.minAsNumber;
} else if(!isNaN(this.maxAsNumber) && start > this.maxAsNumber){
start = this.maxAsNumber;
}
try {
this.elemHelper.prop('valueAsNumber', start);
} catch(e){
webshims.warn('valueAsNumber set: '+e);
}
this.options.defValue = this.elemHelper.prop('value');
},
reorderInputs: function(){
if(splitInputs[this.type]){
var element = this.element.attr('dir', curCfg.date.isRTL ? 'rtl' : 'ltr');
splitInputs[this.type].sort(element, this.options);
setTimeout(function(){
var data = webshims.data(element);
if(data && data.shadowData){
data.shadowData.shadowFocusElement = element.find('input, select')[0] || element[0];
}
}, 9);
}
},
step: function(val){
var defStep = steps[this.type];
this.options.step = val;
this.elemHelper.prop('step', retDefault(val, defStep.step));
this.mirrorValidity();
},
_beforeValue: function(val){
this.valueAsNumber = this.asNumber(val);
this.options.value = val;
if(isNaN(this.valueAsNumber) || (!isNaN(this.minAsNumber) && this.valueAsNumber < this.minAsNumber) || (!isNaN(this.maxAsNumber) && this.valueAsNumber > this.maxAsNumber)){
this._setStartInRange();
} else {
this.elemHelper.prop('value', val);
this.options.defValue = "";
}
},
toFixed: function(val, force){
var o = this.options;
if(o.toFixed && o.type == 'number' && val && !isNaN(this.valueAsNumber) && (force || !this.element.is(':focus')) && (!o.fixOnlyFloat || (this.valueAsNumber % 1))){
val = formatVal[this.type](this.valueAsNumber.toFixed(o.toFixed), this.options);
}
return val;
}
});
['defaultValue', 'value'].forEach(function(name){
var isValue = name == 'value';
spinBtnProto[name] = function(val, force, isLive){
var selectionEnd;
if(!this._init || force || this.options[name] !== val){
if(isValue){
this._beforeValue(val);
} else {
this.elemHelper.prop(name, val);
}
val = formatVal[this.type](val, this.options);
if(this.options.splitInput){
$.each(this.splits, function(i, elem){
var setOption;
if(!(name in elem) && !isValue && $.nodeName(elem, 'select')){
$('option[value="'+ val[i] +'"]', elem).prop('defaultSelected', true);
} else {
$.prop(elem, name, val[i]);
}
});
} else {
val = this.toFixed(val);
if(isLive && this._getSelectionEnd){
selectionEnd = this._getSelectionEnd(val);
}
this.element.prop(name, val);
if(selectionEnd != null){
this.element.prop('selectionEnd', selectionEnd);
}
}
this._propertyChange(name);
this.mirrorValidity();
}
};
});
$.each({min: 1, max: -1}, function(name, factor){
var numName = name +'AsNumber';
spinBtnProto[name] = function(val){
this.elemHelper.prop(name, val);
this[numName] = this.asNumber(val);
if(this.valueAsNumber != null && (isNaN(this.valueAsNumber) || (!isNaN(this[numName]) && (this.valueAsNumber * factor) < (this[numName] * factor)))){
this._setStartInRange();
}
this.options[name] = val;
if(this._init){
createYearSelect({elements: this.inputElements}, this.options);
}
this._propertyChange(name);
this.mirrorValidity();
};
});
$.fn.wsBaseWidget = function(opts){
opts = $.extend({}, opts);
return this.each(function(){
webshims.objectCreate(wsWidgetProto, {
element: {
value: $(this)
}
}, opts);
});
};
$.fn.wsBaseWidget.wsProto = wsWidgetProto;
$.fn.spinbtnUI = function(opts){
opts = $.extend({
monthNames: 'monthNamesShort'
}, opts);
return this.each(function(){
webshims.objectCreate(spinBtnProto, {
element: {
value: $(this)
}
}, opts);
});
};
$.fn.spinbtnUI.wsProto = spinBtnProto;
webshims._format = formatVal;
})();
if(!$.fn.wsTouchClick){
$.fn.wsTouchClick = (function(){
var supportsTouchaction = ('touchAction' in document.documentElement.style);
var addTouch = !supportsTouchaction && ('ontouchstart' in window) && document.addEventListener;
return function(target, handler){
var touchData, touchEnd, touchStart, stopClick, allowClick;
var runHandler = function(){
if(!stopClick){
return handler.apply(this, arguments);
}
};
if(addTouch){
allowClick = function(){
stopClick = false;
};
touchEnd = function(e){
var ret, touch;
e = e.originalEvent || {};
$(this).off('touchend touchcancel', touchEnd);
var changedTouches = e.changedTouches || e.touches;
if(e.type == 'touchcancel' || !touchData || !changedTouches || changedTouches.length != 1){
return;
}
touch = changedTouches[0];
if(Math.abs(touchData.x - touch.pageX) > 40 || Math.abs(touchData.y - touch.pageY) > 40 || Date.now() - touchData.now > 300){
return;
}
e.preventDefault();
stopClick = true;
setTimeout(allowClick, 400);
ret = handler.apply(this, arguments);
return ret;
};
touchStart = function(e){
var touch, elemTarget;
if((!e || e.touches.length != 1)){
return;
}
touch = e.touches[0];
elemTarget = target ? $(touch.target).closest(target) : $(this);
if(!elemTarget.length){
return;
}
touchData = {
x: touch.pageX,
y: touch.pageY,
now: Date.now()
};
elemTarget.on('touchend touchcancel', touchEnd);
};
this.each(function(){
this.addEventListener('touchstart', touchStart, true);
});
} else if(supportsTouchaction){
this.css('touch-action', 'manipulation');
}
if($.isFunction(target)){
handler = target;
target = false;
this.on('click', runHandler);
} else {
this.on('click', target, runHandler);
}
return this;
};
})();
}
(function(){
var picker = {};
var assumeVirtualKeyBoard = (window.Modernizr && (Modernizr.touchevents || Modernizr.touch)) || (/android|iphone|ipad|ipod|blackberry|iemobile/i.test(navigator.userAgent.toLowerCase()));
webshims.inlinePopover = {
_create: function(){
this.element = $('<div class="ws-inline-picker"><div class="ws-po-box" /></div>').data('wspopover', this);
this.contentElement = $('.ws-po-box', this.element);
this.element.insertAfter(this.options.prepareFor);
},
show: $.noop,
hide: $.noop,
preventBlur: $.noop,
isVisible: true
};
picker.isInRange = function(value, max, min){
return !((min[0] && min[0] > value[0]) || (max[0] && max[0] < value[0]));
};
picker.createYearSelect = function(value, max, min, valueAdd, stepper){
if(!stepper){
stepper = {start: value, step: 1, label: value};
}
var temp;
var goUp = true;
var goDown = true;
var options = ['<option selected="">'+ stepper.label + '</option>'];
var i = 0;
var createOption = function(value, add){
var value2, label;
if(stepper.step > 1){
value2 = value + stepper.step - 1;
label = value+' – '+value2;
} else {
label = value;
}
if(picker.isInRange([value], max, min) || (value2 && picker.isInRange([value2], max, min))){
options[add]('<option value="'+ (value+valueAdd) +'">'+ label +'</option>');
return true;
}
};
if(!valueAdd){
valueAdd = '';
}
while(i < 18 && (goUp || goDown)){
i++;
if(goUp){
temp = stepper.start - (i * stepper.step);
goUp = createOption(temp, 'unshift');
}
if(goDown){
temp = stepper.start + (i * stepper.step);
goDown = createOption(temp, 'push');
}
}
return options;
};
picker._genericSetFocus = function(element, _noFocus){
element = $(element || this.activeButton);
if(!this.popover.openedByFocus && !_noFocus){
var that = this;
var setFocus = function(noTrigger){
clearTimeout(that.timer);
that.timer = setTimeout(function(){
if(element[0]){
element.trigger('focus');
if(noTrigger !== true && !element.is(':focus')){
setFocus(true);
}
}
}, that.popover.isVisible ? 0 : 360);
};
this.popover.activateElement(element);
setFocus();
}
};
picker._actions = {
changeInput: function(val, popover, data){
if(!data.options.noChangeDismiss){
picker._actions.cancel(val, popover, data);
}
data.setChange(val);
},
cancel: function(val, popover, data){
if(!data.options.inlinePicker){
popover.stopOpen = true;
if(!popover.openedByFocus && assumeVirtualKeyBoard){
$('button', data.buttonWrapper).trigger('focus');
} else {
data.element.getShadowFocusElement().trigger('focus');
}
setTimeout(function(){
popover.stopOpen = false;
}, 9);
popover.hide();
}
}
};
picker.commonInit = function(data, popover){
if(data._commonInit){return;}
data._commonInit = true;
var tabbable;
popover.isDirty = true;
popover.element.on('updatepickercontent pickerchange', function(){
tabbable = false;
});
if(!data.options.inlinePicker){
popover.contentElement.on({
keydown: function(e){
if(e.keyCode == 9){
if(!tabbable){
tabbable = $('input:not(:disabled), [tabindex="0"]:not(:disabled)', this).filter(':visible');
}
var index = tabbable.index(e.target);
if(e.shiftKey && index <= 0){
tabbable.last().focus();
return false;
}
if(!e.shiftKey && index >= tabbable.length - 1){
tabbable.first().focus();
return false;
}
} else if(e.keyCode == 27){
data.element.getShadowFocusElement().focus();
popover.hide();
return false;
}
}
});
}
data._propertyChange = (function(){
var timer;
var update = function(){
if(popover.isVisible){
popover.element.triggerHandler('updatepickercontent');
}
};
return function(prop){
if(prop == 'value' && (!data.options.inlinePicker || data._handledValue )){return;}
popover.isDirty = true;
if(popover.isVisible){
clearTimeout(timer);
timer = setTimeout(update, 9);
}
};
})();
popover.activeElement = $([]);
popover.activateElement = function(element){
element = $(element);
if(element[0] != popover.activeElement[0]){
popover.activeElement.removeClass('ws-focus');
element.addClass('ws-focus');
}
popover.activeElement = element;
};
popover.element.on({
wspopoverbeforeshow: function(){
data.element.triggerHandler('wsupdatevalue');
popover.element.triggerHandler('updatepickercontent');
}
});
$(data.orig).on('remove', function(e){
if(!e.originalEvent){
$(document).off('wslocalechange', data._propertyChange);
}
});
};
picker._common = function(data){
if(data.options.nopicker){return;}
var options = data.options;
var popover = webshims.objectCreate(options.inlinePicker ? webshims.inlinePopover : webshims.wsPopover, {}, $.extend(options.popover || {}, {prepareFor: options.inlinePicker ? data.buttonWrapper : data.element}));
var opener = $('<button type="button" class="ws-popover-opener"><span /></button>').appendTo(data.buttonWrapper);
var showPickerContent = function(){
(picker[data.type].showPickerContent || picker.showPickerContent)(data, popover);
};
var show = function(){
var type = loadPicker(data.type, 'DOM');
if(!options.disabled && !options.readonly && (options.inlinePicker || !popover.isVisible)){
webshims.ready(type, showPickerContent);
popover.show(data.element);
}
};
var open = function(){
if((options.inlinePicker || popover.isVisible) && popover.activeElement){
popover.openedByFocus = false;
popover.activeElement.focus();
}
show();
};
var toogle = function(){
if(popover.openedByFocus || !popover.isVisible){
open();
} else {
popover.hide();
}
}
options.containerElements.push(popover.element[0]);
popover.element
.addClass(data.type+'-popover input-picker')
.attr({role: 'application'})
.on({
wspopoverhide: function(){
popover.openedByFocus = false;
},
focusin: function(e){
if(popover.activateElement){
popover.openedByFocus = false;
popover.activateElement(e.target);
}
},
focusout: function(){
if(popover.activeElement){
popover.activeElement.removeClass('ws-focus');
}
if(options.inlinePicker){
popover.openedByFocus = true;
}
}
})
;
labelWidth(popover.element.children('div.ws-po-outerbox').attr({role: 'group'}), options.labels, true);
labelWidth(opener, options.labels, true);
if(options.tabindex != null){
opener.attr({tabindex: options.tabindex});
}
if(options.disabled){
opener.prop({disabled: true});
}
opener.wsTouchClick(toogle);
if(options.inlinePicker){
popover.openedByFocus = true;
} else {
opener
.on({
mousedown: function(){
stopPropagation.apply(this, arguments);
popover.preventBlur();
},
keydown: function(e){
if(e.keyCode == 40 && e.altKey){
open();
}
},
'focus mousedown': (function(){
var allowClose = true;
var reset = function(){
allowClose = true;
};
return function(e){
if(e.type == 'mousedown'){
allowClose = false;
setTimeout(reset);
}
if(e.type == 'focus' && allowClose && options.openOnFocus && popover.openedByFocus && (popover.options.appendTo == 'auto' || popover.options.appendTo == 'element')){
popover.hide();
} else {
popover.preventBlur();
}
};
})()
})
;
(function(){
var mouseFocus = false;
var resetMouseFocus = function(){
mouseFocus = false;
};
data.inputElements.on({
keydown: function(e){
if(e.keyCode == 40 && e.altKey && !$.nodeName(e.target, 'select')){
open();
}
},
focus: function(e){
if(!popover.stopOpen && (options.buttonOnly || options.openOnFocus || (mouseFocus && options.openOnMouseFocus)) && !$.nodeName(e.target, 'select')){
popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
show();
} else {
popover.preventBlur();
}
},
mousedown: function(e){
mouseFocus = true;
setTimeout(resetMouseFocus, 9);
if(options.buttonOnly && popover.isVisible && popover.activeElement){
popover.openedByFocus = false;
setTimeout(function(){
popover.openedByFocus = false;
popover.activeElement.focus();
}, 4);
}
if(data.element.is(':focus') && !$.nodeName(e.target, 'select')){
popover.openedByFocus = options.buttonOnly ? false : !options.noInput;
show();
}
popover.preventBlur();
}
});
})();
}
data.popover = popover;
data.opener = opener;
$(data.orig).on('remove', function(e){
if(!e.originalEvent){
setTimeout(function(){
opener.remove();
popover.element.remove();
}, 4);
}
});
if(options.inlinePicker){
show();
}
};
picker.month = picker._common;
picker.date = picker._common;
picker.time = picker._common;
picker['datetime-local'] = picker._common;
// picker.week = picker._common;
picker.color = function(data){
var ret = picker._common.apply(this, arguments);
var alpha = $(data.orig).data('alphacontrol');
var colorIndicator = data.opener
.prepend('<span class="ws-color-indicator-bg"><span class="ws-color-indicator" /></span>')
.find('.ws-color-indicator')
;
var showColor = function(){
colorIndicator.css({backgroundColor: $.prop(this, 'value') || '#000000'});
};
var showOpacity = (function(){
var timer;
var show = function(){
try {
var value = data.alpha.prop('valueAsNumber') / (data.alpha.prop('max') || 1);
if(!isNaN(value)){
colorIndicator.css({opacity: value});
}
} catch(er){}
};
return function(e){
clearTimeout(timer);
timer = setTimeout(show, !e || e.type == 'change' ? 4: 40);
};
})();
data.alpha = (alpha) ? $('#'+alpha) : $([]);
$(data.orig).on('wsupdatevalue change', showColor).each(showColor);
data.alpha.on('wsupdatevalue change input', showOpacity).each(showOpacity);
return ret;
};
webshims.picker = picker;
})();
(function(){
var stopCircular, isCheckValidity;
var supportInputTypes = webshims.support.inputtypes;
var inputTypes = {
};
var boolAttrs = {disabled: 1, required: 1, readonly: 1};
var copyProps = [
'disabled',
'readonly',
'value',
'defaultValue',
'min',
'max',
'step',
'title',
'required',
'placeholder'
];
//
var copyAttrs = ['data-placeholder', 'tabindex'];
$.each(copyProps.concat(copyAttrs), function(i, name){
var fnName = name.replace(/^data\-/, '');
webshims.onNodeNamesPropertyModify('input', name, function(val, boolVal){
if(!stopCircular){
var shadowData = webshims.data(this, 'shadowData');
if(shadowData && shadowData.data && shadowData.nativeElement === this && shadowData.data[fnName]){
if(boolAttrs[fnName]){
shadowData.data[fnName](val, boolVal);
} else {
shadowData.data[fnName](val);
}
}
}
});
});
if(options.replaceUI && 'valueAsNumber' in document.createElement('input')){
var reflectFn = function(){
if(webshims.data(this, 'hasShadow')){
$.prop(this, 'value', $.prop(this, 'value'));
}
};
webshims.onNodeNamesPropertyModify('input', 'valueAsNumber', reflectFn);
webshims.onNodeNamesPropertyModify('input', 'valueAsDate', reflectFn);
$.each({stepUp: 1, stepDown: -1}, function(name, stepFactor){
var stepDescriptor = webshims.defineNodeNameProperty('input', name, {
prop: {
value: function(){
var ret;
if(stepDescriptor.prop && stepDescriptor.prop._supvalue){
ret = stepDescriptor.prop._supvalue.apply(this, arguments);
reflectFn.apply(this, arguments);
}
return ret;
}
}
});
});
}
var extendType = (function(){
return function(name, data){
inputTypes[name] = data;
data.attrs = $.merge([], copyAttrs, data.attrs);
data.props = $.merge([], copyProps, data.props);
};
})();
var isVisible = function(){
return $.css(this, 'display') != 'none';
};
var sizeInput = function(data){
var init, parent, lastWidth, left, right, isRtl, hasButtons;
var oriStyleO = data.orig.style;
var styleO = data.element[0].style;
if($.support.boxSizing == null){
$(function(){
parent = data.orig.parentNode;
});
} else {
parent = data.orig.parentNode;
}
var updateStyles = function(){
var curWidth, marginR, marginL, assignWidth;
var correctWidth = 0.8;
if(parent){
curWidth = parent.offsetWidth;
}
if(!init || (curWidth && curWidth != lastWidth)){
lastWidth = curWidth;
oriStyleO.display = '';
styleO.display = 'none';
if(!init){
hasButtons = data.buttonWrapper && data.buttonWrapper.filter(isVisible).length;
isRtl = hasButtons && data.buttonWrapper.css('direction') == 'rtl';
if(isRtl){
left = 'Right';
right = 'Left';
} else {
left = 'Left';
right = 'Right';
}
if(hasButtons){
data.buttonWrapper[isRtl ? 'addClass' : 'removeClass']('ws-is-rtl');
}
}
marginR = $.css( data.orig, 'margin'+right);
styleO['margin'+left] = $.css( data.orig, 'margin'+left);
styleO['margin'+right] = hasButtons ? '0px' : marginR;
if(hasButtons){
marginL = (parseInt(data.buttonWrapper.css('margin'+left), 10) || 0);
styleO['padding'+right] = '';
if(marginL < 0){
marginR = (parseInt(marginR, 10) || 0) + ((data.buttonWrapper.outerWidth() + marginL) * -1);
data.buttonWrapper[0].style['margin'+right] = marginR+'px';
styleO['padding'+right] = ((parseInt( data.element.css('padding'+right), 10) || 0) + data.buttonWrapper.outerWidth()) +'px';
} else {
data.buttonWrapper[0].style['margin'+right] = marginR;
correctWidth = data.buttonWrapper.outerWidth(true) + correctWidth;
}
}
assignWidth = $(data.orig).outerWidth() - correctWidth;
styleO.display = '';
data.element.outerWidth(assignWidth);
oriStyleO.display = 'none';
init = true;
}
};
oriStyleO.webkitAppearance = 'none';
data.element.onWSOff('updateshadowdom', updateStyles, true);
};
var implementType = function(){
var type = $.prop(this, 'type');
var i, opts, data, optsName, labels, cNames, hasInitialFocus;
if(inputTypes[type] && webshims.implement(this, 'inputwidgets') && (!supportInputTypes[type] || !$(this).hasClass('ws-noreplace'))){
data = {};
optsName = type;
hasInitialFocus = $(this).is(':focus');
labels = $(this).jProp('labels');
opts = $.extend(webshims.getOptions(this, type, [options.widgets, options[type], $($.prop(this, 'form')).data(type)]), {
orig: this,
type: type,
labels: labels,
options: {},
input: function(val){
opts._change(val, 'input');
},
change: function(val){
opts._change(val, 'change');
},
_change: function(val, trigger){
stopCircular = true;
$.prop(opts.orig, 'value', val);
stopCircular = false;
if(trigger){
$(opts.orig).trigger(trigger);
}
},
containerElements: []
});
for(i = 0; i < copyProps.length; i++){
opts[copyProps[i]] = $.prop(this, copyProps[i]);
}
for(i = 0; i < copyAttrs.length; i++){
optsName = copyAttrs[i].replace(/^data\-/, '');
if(optsName == 'placeholder' || !opts[optsName]){
opts[optsName] = $.attr(this, copyAttrs[i]) || opts[optsName];
}
}
if(opts.formatMonthNames){
webshims.error('formatMonthNames was renamded to monthNames');
}
if(opts.onlyMonthDigits){
opts.monthNames = 'monthDigits';
}
data.shim = inputTypes[type]._create(opts);
webshims.addShadowDom(this, data.shim.element, {
data: data.shim || {}
});
data.shim.options.containerElements.push(data.shim.element[0]);
cNames = $.prop(this, 'className');
if(opts.classes){
cNames += ' '+opts.classes;
$(this).addClass(opts.classes);
}
if(opts.splitInput || type == 'range'){
cNames = cNames.replace('form-control', '');
}
data.shim.element.on('change input', stopPropagation).addClass(cNames+' '+webshims.shadowClass);
if(data.shim.buttonWrapper){
data.shim.buttonWrapper.addClass('input-button-size-'+(data.shim.buttonWrapper.children().filter(isVisible).length)+' '+webshims.shadowClass);
if(data.shim.buttonWrapper.filter(isVisible).length){
data.shim.element.addClass('has-input-buttons');
}
}
labelWidth($(this).getShadowFocusElement(), labels);
$(this).on('change', function(e){
if(!stopCircular){
data.shim.value($.prop(this, 'value'));
}
});
(function(){
var has = {
focusin: true,
focus: true
};
var timer;
var hasFocusTriggered = false;
var hasFocus = false;
$(data.shim.options.containerElements)
.on({
'focusin focus focusout blur': function(e){
e.stopImmediatePropagation();
hasFocus = has[e.type];
clearTimeout(timer);
timer = setTimeout(function(){
if(hasFocus != hasFocusTriggered){
hasFocusTriggered = hasFocus;
$(opts.orig).triggerHandler(hasFocus ? 'focus' : 'blur');
$(opts.orig).trigger(hasFocus ? 'focusin' : 'focusout');
}
hasFocusTriggered = hasFocus;
}, 9);
}
})
;
})();
if(hasFormValidation){
$(opts.orig).on('firstinvalid', function(e){
if(!webshims.fromSubmit && isCheckValidity){return;}
$(opts.orig).off('invalid.replacedwidgetbubble').on('invalid.replacedwidgetbubble', function(evt){
if(!evt.isDefaultPrevented()){
webshims.validityAlert.showFor( e.target );
e.preventDefault();
evt.preventDefault();
}
$(opts.orig).off('invalid.replacedwidgetbubble');
});
});
}
if(opts.calculateWidth){
sizeInput(data.shim);
} else {
$(this).css('display', 'none');
}
if(hasInitialFocus){
$(this).getShadowFocusElement().trigger('focus');
}
}
};
if(hasFormValidation){
['input', 'form'].forEach(function(name){
var desc = webshims.defineNodeNameProperty(name, 'checkValidity', {
prop: {
value: function(){
isCheckValidity = true;
var ret = desc.prop._supvalue.apply(this, arguments);
isCheckValidity = false;
return ret;
}
}
});
});
}
var replace = {};
if(options.replaceUI){
$.each($.extend(replace, $.isPlainObject(options.replaceUI) ? options.replaceUI : {
'range': 1,
'number': 1,
'time': 1,
'month': 1,
'date': 1,
'color': 1,
'datetime-local': 1
}), function(name, val){
if(supportInputTypes[name] && val == 'auto'){
replace[name] = webshims._getAutoEnhance(val);
}
});
}
if(supportInputTypes.number && navigator.userAgent.indexOf('Touch') == -1 && ((/MSIE 1[0|1]\.\d/.test(navigator.userAgent)) || (/Trident\/7\.0/.test(navigator.userAgent)))){
replace.number = 1;
}
if(replace.range !== false && (!supportInputTypes.range || replace.range)){
extendType('range', {
_create: function(opts, set){
var data = $('<span />').insertAfter(opts.orig).rangeUI(opts).data('rangeUi');
return data;
}
});
}
['number', 'time', 'month', 'date', 'color', 'datetime-local'].forEach(function(name){
if(replace[name] !== false && (!supportInputTypes[name] || replace[name])){
extendType(name, {
_create: function(opts, set){
if(opts.monthSelect || opts.daySelect || opts.yearSelect){
opts.splitInput = true;
}
if(opts.splitInput && !splitInputs[name]){
webshims.warn('splitInput not supported for '+ name);
opts.splitInput = false;
}
var markup = opts.splitInput ?
'<span class="ws-'+name+' ws-input ws-inputreplace" role="group"></span>' :
'<input class="ws-'+name+' ws-inputreplace" type="text" />';
var data = $(markup).insertAfter(opts.orig);
if(steps[name]){
data = data.spinbtnUI(opts).data('wsWidget'+name);
} else {
data = data.wsBaseWidget(opts).data('wsWidget'+name);
}
if(webshims.picker && webshims.picker[name]){
webshims.picker[name](data);
}
return data;
}
});
}
});
var init = function(){
webshims.addReady(function(context, contextElem){
$('input', context)
.add(contextElem.filter('input'))
.each(implementType)
;
});
};
if($('<input />').prop('labels') == null){
webshims.defineNodeNamesProperty('button, input, keygen, meter, output, progress, select, textarea', 'labels', {
prop: {
get: function(){
if(this.type == 'hidden'){return null;}
var id = this.id;
var labels = $(this)
.closest('label')
.filter(function(){
var hFor = (this.attributes['for'] || {});
return (!hFor.specified || hFor.value == id);
})
;
if(id) {
labels = labels.add('label[for="'+ id +'"]');
}
return labels.get();
},
writeable: false
}
});
}
if(formcfg._isLoading){
$(formcfg).one('change', init);
} else {
init();
}
})();
});
| kennynaoh/cdnjs | ajax/libs/webshim/1.14.6-RC2/dev/shims/combos/17.js | JavaScript | mit | 90,315 |
<?php
/*
* This file is part of the Assetic package, an OpenSky project.
*
* (c) 2010-2013 OpenSky Project Inc
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Assetic\Factory\AssetFactory;
use Assetic\Util\TraversableString;
/**
* Initializes the global Assetic object.
*
* @param AssetFactory $factory The asset factory
*/
function assetic_init(AssetFactory $factory)
{
global $_assetic;
$_assetic = new stdClass();
$_assetic->factory = $factory;
}
/**
* Returns an array of javascript URLs.
*
* @param array|string $inputs Input strings
* @param array|string $filters Filter names
* @param array $options An array of options
*
* @return array An array of javascript URLs
*/
function assetic_javascripts($inputs = array(), $filters = array(), array $options = array())
{
if (!isset($options['output'])) {
$options['output'] = 'js/*.js';
}
return _assetic_urls($inputs, $filters, $options);
}
/**
* Returns an array of stylesheet URLs.
*
* @param array|string $inputs Input strings
* @param array|string $filters Filter names
* @param array $options An array of options
*
* @return array An array of stylesheet URLs
*/
function assetic_stylesheets($inputs = array(), $filters = array(), array $options = array())
{
if (!isset($options['output'])) {
$options['output'] = 'css/*.css';
}
return _assetic_urls($inputs, $filters, $options);
}
/**
* Returns an image URL.
*
* @param string $input An input
* @param array|string $filters Filter names
* @param array $options An array of options
*
* @return string An image URL
*/
function assetic_image($input, $filters = array(), array $options = array())
{
if (!isset($options['output'])) {
$options['output'] = 'images/*';
}
$urls = _assetic_urls($input, $filters, $options);
return current($urls);
}
/**
* Returns an array of asset urls.
*
* @param array|string $inputs Input strings
* @param array|string $filters Filter names
* @param array $options An array of options
*
* @return array An array of URLs
*/
function _assetic_urls($inputs = array(), $filters = array(), array $options = array())
{
global $_assetic;
if (!is_array($inputs)) {
$inputs = array_filter(array_map('trim', explode(',', $inputs)));
}
if (!is_array($filters)) {
$filters = array_filter(array_map('trim', explode(',', $filters)));
}
$coll = $_assetic->factory->createAsset($inputs, $filters, $options);
$debug = isset($options['debug']) ? $options['debug'] : $_assetic->factory->isDebug();
$combine = isset($options['combine']) ? $options['combine'] : !$debug;
$one = $coll->getTargetPath();
if ($combine) {
$many = array($one);
} else {
$many = array();
foreach ($coll as $leaf) {
$many[] = $leaf->getTargetPath();
}
}
return new TraversableString($one, $many);
}
| annonnim/magsoft | vendor/kriswallsmith/assetic/src/functions.php | PHP | mit | 3,062 |
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM;
/**
* Container for all ORM events.
*
* This class cannot be instantiated.
*
* @author Roman Borschel <roman@code-factory.org>
* @since 2.0
*/
final class Events
{
/**
* Private constructor. This class is not meant to be instantiated.
*/
private function __construct()
{
}
/**
* The preRemove event occurs for a given entity before the respective
* EntityManager remove operation for that entity is executed.
*
* This is an entity lifecycle event.
*
* @var string
*/
const preRemove = 'preRemove';
/**
* The postRemove event occurs for an entity after the entity has
* been deleted. It will be invoked after the database delete operations.
*
* This is an entity lifecycle event.
*
* @var string
*/
const postRemove = 'postRemove';
/**
* The prePersist event occurs for a given entity before the respective
* EntityManager persist operation for that entity is executed.
*
* This is an entity lifecycle event.
*
* @var string
*/
const prePersist = 'prePersist';
/**
* The postPersist event occurs for an entity after the entity has
* been made persistent. It will be invoked after the database insert operations.
* Generated primary key values are available in the postPersist event.
*
* This is an entity lifecycle event.
*
* @var string
*/
const postPersist = 'postPersist';
/**
* The preUpdate event occurs before the database update operations to
* entity data.
*
* This is an entity lifecycle event.
*
* @var string
*/
const preUpdate = 'preUpdate';
/**
* The postUpdate event occurs after the database update operations to
* entity data.
*
* This is an entity lifecycle event.
*
* @var string
*/
const postUpdate = 'postUpdate';
/**
* The postLoad event occurs for an entity after the entity has been loaded
* into the current EntityManager from the database or after the refresh operation
* has been applied to it.
*
* Note that the postLoad event occurs for an entity before any associations have been
* initialized. Therefore it is not safe to access associations in a postLoad callback
* or event handler.
*
* This is an entity lifecycle event.
*
* @var string
*/
const postLoad = 'postLoad';
/**
* The loadClassMetadata event occurs after the mapping metadata for a class
* has been loaded from a mapping source (annotations/xml/yaml).
*
* @var string
*/
const loadClassMetadata = 'loadClassMetadata';
/**
* The preFlush event occurs when the EntityManager#flush() operation is invoked,
* but before any changes to managed entities have been calculated. This event is
* always raised right after EntityManager#flush() call.
*/
const preFlush = 'preFlush';
/**
* The onFlush event occurs when the EntityManager#flush() operation is invoked,
* after any changes to managed entities have been determined but before any
* actual database operations are executed. The event is only raised if there is
* actually something to do for the underlying UnitOfWork. If nothing needs to be done,
* the onFlush event is not raised.
*
* @var string
*/
const onFlush = 'onFlush';
/**
* The postFlush event occurs when the EntityManager#flush() operation is invoked and
* after all actual database operations are executed successfully. The event is only raised if there is
* actually something to do for the underlying UnitOfWork. If nothing needs to be done,
* the postFlush event is not raised. The event won't be raised if an error occurs during the
* flush operation.
*
* @var string
*/
const postFlush = 'postFlush';
/**
* The onClear event occurs when the EntityManager#clear() operation is invoked,
* after all references to entities have been removed from the unit of work.
*
* @var string
*/
const onClear = 'onClear';
}
| VictoriaLasso/andresProyect | vendor/doctrine/orm/lib/Doctrine/ORM/Events.php | PHP | mit | 5,202 |
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the MIT license. For more information, see
* <http://www.doctrine-project.org>.
*/
namespace Doctrine\ORM\Id;
use Doctrine\ORM\EntityManager;
/**
* Id generator that obtains IDs from special "identity" columns. These are columns
* that automatically get a database-generated, auto-incremented identifier on INSERT.
* This generator obtains the last insert id after such an insert.
*/
class IdentityGenerator extends AbstractIdGenerator
{
/**
* The name of the sequence to pass to lastInsertId(), if any.
*
* @var string
*/
private $sequenceName;
/**
* Constructor.
*
* @param string|null $sequenceName The name of the sequence to pass to lastInsertId()
* to obtain the last generated identifier within the current
* database session/connection, if any.
*/
public function __construct($sequenceName = null)
{
$this->sequenceName = $sequenceName;
}
/**
* {@inheritdoc}
*/
public function generate(EntityManager $em, $entity)
{
return (int)$em->getConnection()->lastInsertId($this->sequenceName);
}
/**
* {@inheritdoc}
*/
public function isPostInsertGenerator()
{
return true;
}
}
| lugamx/demo-sf | vendor/doctrine/orm/lib/Doctrine/ORM/Id/IdentityGenerator.php | PHP | mit | 2,209 |
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["sourceMap"] = factory();
else
root["sourceMap"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
/*
* Copyright 2009-2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;
exports.SourceMapConsumer = __webpack_require__(7).SourceMapConsumer;
exports.SourceNode = __webpack_require__(10).SourceNode;
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var base64VLQ = __webpack_require__(2);
var util = __webpack_require__(4);
var ArraySet = __webpack_require__(5).ArraySet;
var MappingList = __webpack_require__(6).MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
* being built incrementally. You may pass an object with the following
* properties:
*
* - file: The filename of the generated source.
* - sourceRoot: A root for all relative URLs in this source map.
*/
function SourceMapGenerator(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, 'file', null);
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = new MappingList();
this._sourcesContents = null;
}
SourceMapGenerator.prototype._version = 3;
/**
* Creates a new SourceMapGenerator based on a SourceMapConsumer
*
* @param aSourceMapConsumer The SourceMap.
*/
SourceMapGenerator.fromSourceMap =
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator({
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
});
aSourceMapConsumer.eachMapping(function (mapping) {
var newMapping = {
generated: {
line: mapping.generatedLine,
column: mapping.generatedColumn
}
};
if (mapping.source != null) {
newMapping.source = mapping.source;
if (sourceRoot != null) {
newMapping.source = util.relative(sourceRoot, newMapping.source);
}
newMapping.original = {
line: mapping.originalLine,
column: mapping.originalColumn
};
if (mapping.name != null) {
newMapping.name = mapping.name;
}
}
generator.addMapping(newMapping);
});
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
generator.setSourceContent(sourceFile, content);
}
});
return generator;
};
/**
* Add a single mapping from original source line and column to the generated
* source's line and column for this source map being created. The mapping
* object should have the following properties:
*
* - generated: An object with the generated line and column positions.
* - original: An object with the original line and column positions.
* - source: The original source file (relative to the sourceRoot).
* - name: An optional original token name for this mapping.
*/
SourceMapGenerator.prototype.addMapping =
function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, 'generated');
var original = util.getArg(aArgs, 'original', null);
var source = util.getArg(aArgs, 'source', null);
var name = util.getArg(aArgs, 'name', null);
if (!this._skipValidation) {
this._validateMapping(generated, original, source, name);
}
if (source != null) {
source = String(source);
if (!this._sources.has(source)) {
this._sources.add(source);
}
}
if (name != null) {
name = String(name);
if (!this._names.has(name)) {
this._names.add(name);
}
}
this._mappings.add({
generatedLine: generated.line,
generatedColumn: generated.column,
originalLine: original != null && original.line,
originalColumn: original != null && original.column,
source: source,
name: name
});
};
/**
* Set the source content for a source file.
*/
SourceMapGenerator.prototype.setSourceContent =
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot != null) {
source = util.relative(this._sourceRoot, source);
}
if (aSourceContent != null) {
// Add the source content to the _sourcesContents map.
// Create a new _sourcesContents map if the property is null.
if (!this._sourcesContents) {
this._sourcesContents = Object.create(null);
}
this._sourcesContents[util.toSetString(source)] = aSourceContent;
} else if (this._sourcesContents) {
// Remove the source file from the _sourcesContents map.
// If the _sourcesContents map is empty, set the property to null.
delete this._sourcesContents[util.toSetString(source)];
if (Object.keys(this._sourcesContents).length === 0) {
this._sourcesContents = null;
}
}
};
/**
* Applies the mappings of a sub-source-map for a specific source file to the
* source map being generated. Each mapping to the supplied source file is
* rewritten using the supplied source map. Note: The resolution for the
* resulting mappings is the minimium of this map and the supplied map.
*
* @param aSourceMapConsumer The source map to be applied.
* @param aSourceFile Optional. The filename of the source file.
* If omitted, SourceMapConsumer's file property will be used.
* @param aSourceMapPath Optional. The dirname of the path to the source map
* to be applied. If relative, it is relative to the SourceMapConsumer.
* This parameter is needed when the two source maps aren't in the same
* directory, and the source map to be applied contains relative source
* paths. If so, those relative source paths need to be rewritten
* relative to the SourceMapGenerator.
*/
SourceMapGenerator.prototype.applySourceMap =
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
var sourceFile = aSourceFile;
// If aSourceFile is omitted, we will use the file property of the SourceMap
if (aSourceFile == null) {
if (aSourceMapConsumer.file == null) {
throw new Error(
'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
'or the source map\'s "file" property. Both were omitted.'
);
}
sourceFile = aSourceMapConsumer.file;
}
var sourceRoot = this._sourceRoot;
// Make "sourceFile" relative if an absolute Url is passed.
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
// Applying the SourceMap can add and remove items from the sources and
// the names array.
var newSources = new ArraySet();
var newNames = new ArraySet();
// Find mappings for the "sourceFile"
this._mappings.unsortedForEach(function (mapping) {
if (mapping.source === sourceFile && mapping.originalLine != null) {
// Check if it can be mapped by the source map, then update the mapping.
var original = aSourceMapConsumer.originalPositionFor({
line: mapping.originalLine,
column: mapping.originalColumn
});
if (original.source != null) {
// Copy mapping
mapping.source = original.source;
if (aSourceMapPath != null) {
mapping.source = util.join(aSourceMapPath, mapping.source)
}
if (sourceRoot != null) {
mapping.source = util.relative(sourceRoot, mapping.source);
}
mapping.originalLine = original.line;
mapping.originalColumn = original.column;
if (original.name != null) {
mapping.name = original.name;
}
}
}
var source = mapping.source;
if (source != null && !newSources.has(source)) {
newSources.add(source);
}
var name = mapping.name;
if (name != null && !newNames.has(name)) {
newNames.add(name);
}
}, this);
this._sources = newSources;
this._names = newNames;
// Copy sourcesContents of applied map.
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
if (aSourceMapPath != null) {
sourceFile = util.join(aSourceMapPath, sourceFile);
}
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
this.setSourceContent(sourceFile, content);
}
}, this);
};
/**
* A mapping can have one of the three levels of data:
*
* 1. Just the generated position.
* 2. The Generated position, original position, and original source.
* 3. Generated and original position, original source, as well as a name
* token.
*
* To maintain consistency, we validate that any new mapping being added falls
* in to one of these categories.
*/
SourceMapGenerator.prototype._validateMapping =
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
aName) {
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
&& aGenerated.line > 0 && aGenerated.column >= 0
&& !aOriginal && !aSource && !aName) {
// Case 1.
return;
}
else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
&& aOriginal && 'line' in aOriginal && 'column' in aOriginal
&& aGenerated.line > 0 && aGenerated.column >= 0
&& aOriginal.line > 0 && aOriginal.column >= 0
&& aSource) {
// Cases 2 and 3.
return;
}
else {
throw new Error('Invalid mapping: ' + JSON.stringify({
generated: aGenerated,
source: aSource,
original: aOriginal,
name: aName
}));
}
};
/**
* Serialize the accumulated mappings in to the stream of base 64 VLQs
* specified by the source map format.
*/
SourceMapGenerator.prototype._serializeMappings =
function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
var previousName = 0;
var previousSource = 0;
var result = '';
var next;
var mapping;
var nameIdx;
var sourceIdx;
var mappings = this._mappings.toArray();
for (var i = 0, len = mappings.length; i < len; i++) {
mapping = mappings[i];
next = ''
if (mapping.generatedLine !== previousGeneratedLine) {
previousGeneratedColumn = 0;
while (mapping.generatedLine !== previousGeneratedLine) {
next += ';';
previousGeneratedLine++;
}
}
else {
if (i > 0) {
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
continue;
}
next += ',';
}
}
next += base64VLQ.encode(mapping.generatedColumn
- previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source != null) {
sourceIdx = this._sources.indexOf(mapping.source);
next += base64VLQ.encode(sourceIdx - previousSource);
previousSource = sourceIdx;
// lines are stored 0-based in SourceMap spec version 3
next += base64VLQ.encode(mapping.originalLine - 1
- previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
next += base64VLQ.encode(mapping.originalColumn
- previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name != null) {
nameIdx = this._names.indexOf(mapping.name);
next += base64VLQ.encode(nameIdx - previousName);
previousName = nameIdx;
}
}
result += next;
}
return result;
};
SourceMapGenerator.prototype._generateSourcesContent =
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function (source) {
if (!this._sourcesContents) {
return null;
}
if (aSourceRoot != null) {
source = util.relative(aSourceRoot, source);
}
var key = util.toSetString(source);
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
? this._sourcesContents[key]
: null;
}, this);
};
/**
* Externalize the source map.
*/
SourceMapGenerator.prototype.toJSON =
function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
sources: this._sources.toArray(),
names: this._names.toArray(),
mappings: this._serializeMappings()
};
if (this._file != null) {
map.file = this._file;
}
if (this._sourceRoot != null) {
map.sourceRoot = this._sourceRoot;
}
if (this._sourcesContents) {
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
}
return map;
};
/**
* Render the source map being generated to a string.
*/
SourceMapGenerator.prototype.toString =
function SourceMapGenerator_toString() {
return JSON.stringify(this.toJSON());
};
exports.SourceMapGenerator = SourceMapGenerator;
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*
* Based on the Base 64 VLQ implementation in Closure Compiler:
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
*
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
var base64 = __webpack_require__(3);
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
// the next four bits are the actual value, and the 6th bit is the
// continuation bit. The continuation bit tells us whether there are more
// digits in this value following this digit.
//
// Continuation
// | Sign
// | |
// V V
// 101011
var VLQ_BASE_SHIFT = 5;
// binary: 100000
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
// binary: 011111
var VLQ_BASE_MASK = VLQ_BASE - 1;
// binary: 100000
var VLQ_CONTINUATION_BIT = VLQ_BASE;
/**
* Converts from a two-complement value to a value where the sign bit is
* placed in the least significant bit. For example, as decimals:
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
*/
function toVLQSigned(aValue) {
return aValue < 0
? ((-aValue) << 1) + 1
: (aValue << 1) + 0;
}
/**
* Converts to a two-complement value from a value where the sign bit is
* placed in the least significant bit. For example, as decimals:
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
*/
function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative
? -shifted
: shifted;
}
/**
* Returns the base 64 VLQ encoded value.
*/
exports.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
var vlq = toVLQSigned(aValue);
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
if (vlq > 0) {
// There are still more digits in this value, so we must make sure the
// continuation bit is marked.
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
} while (vlq > 0);
return encoded;
};
/**
* Decodes the next base 64 VLQ value from the given string and returns the
* value and the rest of the string via the out parameter.
*/
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result = 0;
var shift = 0;
var continuation, digit;
do {
if (aIndex >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
}
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result = result + (digit << shift);
shift += VLQ_BASE_SHIFT;
} while (continuation);
aOutParam.value = fromVLQSigned(result);
aOutParam.rest = aIndex;
};
/***/ },
/* 3 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
/**
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
*/
exports.encode = function (number) {
if (0 <= number && number < intToCharMap.length) {
return intToCharMap[number];
}
throw new TypeError("Must be between 0 and 63: " + number);
};
/**
* Decode a single base 64 character code digit to an integer. Returns -1 on
* failure.
*/
exports.decode = function (charCode) {
var bigA = 65; // 'A'
var bigZ = 90; // 'Z'
var littleA = 97; // 'a'
var littleZ = 122; // 'z'
var zero = 48; // '0'
var nine = 57; // '9'
var plus = 43; // '+'
var slash = 47; // '/'
var littleOffset = 26;
var numberOffset = 52;
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
if (bigA <= charCode && charCode <= bigZ) {
return (charCode - bigA);
}
// 26 - 51: abcdefghijklmnopqrstuvwxyz
if (littleA <= charCode && charCode <= littleZ) {
return (charCode - littleA + littleOffset);
}
// 52 - 61: 0123456789
if (zero <= charCode && charCode <= nine) {
return (charCode - zero + numberOffset);
}
// 62: +
if (charCode == plus) {
return 62;
}
// 63: /
if (charCode == slash) {
return 63;
}
// Invalid base64 digit.
return -1;
};
/***/ },
/* 4 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
/**
* This is a helper function for getting values from parameter/options
* objects.
*
* @param args The object we are extracting values from
* @param name The name of the property we are getting.
* @param defaultValue An optional value to return if the property is missing
* from the object. If this is not specified and the property is missing, an
* error will be thrown.
*/
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports.getArg = getArg;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[2],
host: match[3],
port: match[4],
path: match[5]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = '';
if (aParsedUrl.scheme) {
url += aParsedUrl.scheme + ':';
}
url += '//';
if (aParsedUrl.auth) {
url += aParsedUrl.auth + '@';
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports.urlGenerate = urlGenerate;
/**
* Normalizes a path, or the path portion of a URL:
*
* - Replaces consequtive slashes with one slash.
* - Removes unnecessary '.' parts.
* - Removes unnecessary '<dir>/..' parts.
*
* Based on code in the Node.js 'path' core module.
*
* @param aPath The path or url to normalize.
*/
function normalize(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path = url.path;
}
var isAbsolute = exports.isAbsolute(path);
var parts = path.split(/\/+/);
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
part = parts[i];
if (part === '.') {
parts.splice(i, 1);
} else if (part === '..') {
up++;
} else if (up > 0) {
if (part === '') {
// The first part is blank if the path is absolute. Trying to go
// above the root is a no-op. Therefore we can remove all '..' parts
// directly after the root.
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path = parts.join('/');
if (path === '') {
path = isAbsolute ? '/' : '.';
}
if (url) {
url.path = path;
return urlGenerate(url);
}
return path;
}
exports.normalize = normalize;
/**
* Joins two paths/URLs.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be joined with the root.
*
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
* first.
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
* is updated with the result and aRoot is returned. Otherwise the result
* is returned.
* - If aPath is absolute, the result is aPath.
* - Otherwise the two paths are joined with a slash.
* - Joining for example 'http://' and 'www.example.com' is also supported.
*/
function join(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || '/';
}
// `join(foo, '//www.example.org')`
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
// `join('http://', 'www.example.com')`
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === '/'
? aPath
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports.join = join;
exports.isAbsolute = function (aPath) {
return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp);
};
/**
* Make a path relative to a URL or another path.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be made relative to aRoot.
*/
function relative(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, '');
// It is possible for the path to be above the root. In this case, simply
// checking whether the root is a prefix of the path won't work. Instead, we
// need to remove components from the root one by one, until either we find
// a prefix that fits, or we run out of components to remove.
var level = 0;
while (aPath.indexOf(aRoot + '/') !== 0) {
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
// If the only part of the root that is left is the scheme (i.e. http://,
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
// have exhausted all components, so the path is not relative to the root.
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
// Make sure we add a "../" for each component we removed from the root.
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;
var supportsNullProto = (function () {
var obj = Object.create(null);
return !('__proto__' in obj);
}());
function identity (s) {
return s;
}
/**
* Because behavior goes wacky when you set `__proto__` on objects, we
* have to prefix all the strings in our set with an arbitrary character.
*
* See https://github.com/mozilla/source-map/pull/31 and
* https://github.com/mozilla/source-map/issues/30
*
* @param String aStr
*/
function toSetString(aStr) {
if (isProtoString(aStr)) {
return '$' + aStr;
}
return aStr;
}
exports.toSetString = supportsNullProto ? identity : toSetString;
function fromSetString(aStr) {
if (isProtoString(aStr)) {
return aStr.slice(1);
}
return aStr;
}
exports.fromSetString = supportsNullProto ? identity : fromSetString;
function isProtoString(s) {
if (!s) {
return false;
}
var length = s.length;
if (length < 9 /* "__proto__".length */) {
return false;
}
if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
s.charCodeAt(length - 2) !== 95 /* '_' */ ||
s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
s.charCodeAt(length - 4) !== 116 /* 't' */ ||
s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
s.charCodeAt(length - 8) !== 95 /* '_' */ ||
s.charCodeAt(length - 9) !== 95 /* '_' */) {
return false;
}
for (var i = length - 10; i >= 0; i--) {
if (s.charCodeAt(i) !== 36 /* '$' */) {
return false;
}
}
return true;
}
/**
* Comparator between two mappings where the original positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same original source/line/column, but different generated
* line and column the same. Useful when searching for a mapping with a
* stubbed out mapping.
*/
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp = mappingA.source - mappingB.source;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return mappingA.name - mappingB.name;
}
exports.compareByOriginalPositions = compareByOriginalPositions;
/**
* Comparator between two mappings with deflated source and name indices where
* the generated positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same generated line and column, but different
* source/name/original line and column the same. Useful when searching for a
* mapping with a stubbed out mapping.
*/
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = mappingA.source - mappingB.source;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return mappingA.name - mappingB.name;
}
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
function strcmp(aStr1, aStr2) {
if (aStr1 === aStr2) {
return 0;
}
if (aStr1 > aStr2) {
return 1;
}
return -1;
}
/**
* Comparator between two mappings with inflated source and name strings where
* the generated positions are compared.
*/
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(4);
var has = Object.prototype.hasOwnProperty;
/**
* A data structure which is a combination of an array and a set. Adding a new
* member is O(1), testing for membership is O(1), and finding the index of an
* element is O(1). Removing elements from the set is not supported. Only
* strings are supported for membership.
*/
function ArraySet() {
this._array = [];
this._set = Object.create(null);
}
/**
* Static method for creating ArraySet instances from an existing array.
*/
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
var set = new ArraySet();
for (var i = 0, len = aArray.length; i < len; i++) {
set.add(aArray[i], aAllowDuplicates);
}
return set;
};
/**
* Return how many unique items are in this ArraySet. If duplicates have been
* added, than those do not count towards the size.
*
* @returns Number
*/
ArraySet.prototype.size = function ArraySet_size() {
return Object.getOwnPropertyNames(this._set).length;
};
/**
* Add the given string to this set.
*
* @param String aStr
*/
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
var sStr = util.toSetString(aStr);
var isDuplicate = has.call(this._set, sStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
}
if (!isDuplicate) {
this._set[sStr] = idx;
}
};
/**
* Is the given string a member of this set?
*
* @param String aStr
*/
ArraySet.prototype.has = function ArraySet_has(aStr) {
var sStr = util.toSetString(aStr);
return has.call(this._set, sStr);
};
/**
* What is the index of the given string in the array?
*
* @param String aStr
*/
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
var sStr = util.toSetString(aStr);
if (has.call(this._set, sStr)) {
return this._set[sStr];
}
throw new Error('"' + aStr + '" is not in the set.');
};
/**
* What is the element at the given index?
*
* @param Number aIdx
*/
ArraySet.prototype.at = function ArraySet_at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
throw new Error('No element indexed by ' + aIdx);
};
/**
* Returns the array representation of this set (which has the proper indices
* indicated by indexOf). Note that this is a copy of the internal array used
* for storing the members so that no one can mess with internal state.
*/
ArraySet.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
exports.ArraySet = ArraySet;
/***/ },
/* 6 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2014 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(4);
/**
* Determine whether mappingB is after mappingA with respect to generated
* position.
*/
function generatedPositionAfter(mappingA, mappingB) {
// Optimized for most common case
var lineA = mappingA.generatedLine;
var lineB = mappingB.generatedLine;
var columnA = mappingA.generatedColumn;
var columnB = mappingB.generatedColumn;
return lineB > lineA || lineB == lineA && columnB >= columnA ||
util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}
/**
* A data structure to provide a sorted view of accumulated mappings in a
* performance conscious manner. It trades a neglibable overhead in general
* case for a large speedup in case of mappings being added in order.
*/
function MappingList() {
this._array = [];
this._sorted = true;
// Serves as infimum
this._last = {generatedLine: -1, generatedColumn: 0};
}
/**
* Iterate through internal items. This method takes the same arguments that
* `Array.prototype.forEach` takes.
*
* NOTE: The order of the mappings is NOT guaranteed.
*/
MappingList.prototype.unsortedForEach =
function MappingList_forEach(aCallback, aThisArg) {
this._array.forEach(aCallback, aThisArg);
};
/**
* Add the given source mapping.
*
* @param Object aMapping
*/
MappingList.prototype.add = function MappingList_add(aMapping) {
if (generatedPositionAfter(this._last, aMapping)) {
this._last = aMapping;
this._array.push(aMapping);
} else {
this._sorted = false;
this._array.push(aMapping);
}
};
/**
* Returns the flat, sorted array of mappings. The mappings are sorted by
* generated position.
*
* WARNING: This method returns internal data without copying, for
* performance. The return value must NOT be mutated, and should be treated as
* an immutable borrow. If you want to take ownership, you must make your own
* copy.
*/
MappingList.prototype.toArray = function MappingList_toArray() {
if (!this._sorted) {
this._array.sort(util.compareByGeneratedPositionsInflated);
this._sorted = true;
}
return this._array;
};
exports.MappingList = MappingList;
/***/ },
/* 7 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var util = __webpack_require__(4);
var binarySearch = __webpack_require__(8);
var ArraySet = __webpack_require__(5).ArraySet;
var base64VLQ = __webpack_require__(2);
var quickSort = __webpack_require__(9).quickSort;
function SourceMapConsumer(aSourceMap) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === 'string') {
sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
}
return sourceMap.sections != null
? new IndexedSourceMapConsumer(sourceMap)
: new BasicSourceMapConsumer(sourceMap);
}
SourceMapConsumer.fromSourceMap = function(aSourceMap) {
return BasicSourceMapConsumer.fromSourceMap(aSourceMap);
}
/**
* The version of the source mapping spec that we are consuming.
*/
SourceMapConsumer.prototype._version = 3;
// `__generatedMappings` and `__originalMappings` are arrays that hold the
// parsed mapping coordinates from the source map's "mappings" attribute. They
// are lazily instantiated, accessed via the `_generatedMappings` and
// `_originalMappings` getters respectively, and we only parse the mappings
// and create these arrays once queried for a source location. We jump through
// these hoops because there can be many thousands of mappings, and parsing
// them is expensive, so we only want to do it if we must.
//
// Each object in the arrays is of the form:
//
// {
// generatedLine: The line number in the generated code,
// generatedColumn: The column number in the generated code,
// source: The path to the original source file that generated this
// chunk of code,
// originalLine: The line number in the original source that
// corresponds to this chunk of generated code,
// originalColumn: The column number in the original source that
// corresponds to this chunk of generated code,
// name: The name of the original symbol which generated this chunk of
// code.
// }
//
// All properties except for `generatedLine` and `generatedColumn` can be
// `null`.
//
// `_generatedMappings` is ordered by the generated positions.
//
// `_originalMappings` is ordered by the original positions.
SourceMapConsumer.prototype.__generatedMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
get: function () {
if (!this.__generatedMappings) {
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__generatedMappings;
}
});
SourceMapConsumer.prototype.__originalMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
get: function () {
if (!this.__originalMappings) {
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__originalMappings;
}
});
SourceMapConsumer.prototype._charIsMappingSeparator =
function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
var c = aStr.charAt(index);
return c === ";" || c === ",";
};
/**
* Parse the mappings in a string in to a data structure which we can easily
* query (the ordered arrays in the `this.__generatedMappings` and
* `this.__originalMappings` properties).
*/
SourceMapConsumer.prototype._parseMappings =
function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
throw new Error("Subclasses must implement _parseMappings");
};
SourceMapConsumer.GENERATED_ORDER = 1;
SourceMapConsumer.ORIGINAL_ORDER = 2;
SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
SourceMapConsumer.LEAST_UPPER_BOUND = 2;
/**
* Iterate over each mapping between an original source/line/column and a
* generated line/column in this source map.
*
* @param Function aCallback
* The function that is called with each mapping.
* @param Object aContext
* Optional. If specified, this object will be the value of `this` every
* time that `aCallback` is called.
* @param aOrder
* Either `SourceMapConsumer.GENERATED_ORDER` or
* `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
* iterate over the mappings sorted by the generated file's line/column
* order or the original's source/line/column order, respectively. Defaults to
* `SourceMapConsumer.GENERATED_ORDER`.
*/
SourceMapConsumer.prototype.eachMapping =
function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
var context = aContext || null;
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
var mappings;
switch (order) {
case SourceMapConsumer.GENERATED_ORDER:
mappings = this._generatedMappings;
break;
case SourceMapConsumer.ORIGINAL_ORDER:
mappings = this._originalMappings;
break;
default:
throw new Error("Unknown order of iteration.");
}
var sourceRoot = this.sourceRoot;
mappings.map(function (mapping) {
var source = mapping.source === null ? null : this._sources.at(mapping.source);
if (source != null && sourceRoot != null) {
source = util.join(sourceRoot, source);
}
return {
source: source,
generatedLine: mapping.generatedLine,
generatedColumn: mapping.generatedColumn,
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name: mapping.name === null ? null : this._names.at(mapping.name)
};
}, this).forEach(aCallback, context);
};
/**
* Returns all generated line and column information for the original source,
* line, and column provided. If no column is provided, returns all mappings
* corresponding to a either the line we are searching for or the next
* closest line that has any mappings. Otherwise, returns all mappings
* corresponding to the given line and either the column we are searching for
* or the next closest column that has any offsets.
*
* The only argument is an object with the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source.
* - column: Optional. the column number in the original source.
*
* and an array of objects is returned, each with the following properties:
*
* - line: The line number in the generated source, or null.
* - column: The column number in the generated source, or null.
*/
SourceMapConsumer.prototype.allGeneratedPositionsFor =
function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
var line = util.getArg(aArgs, 'line');
// When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
// returns the index of the closest mapping less than the needle. By
// setting needle.originalColumn to 0, we thus find the last mapping for
// the given line, provided such a mapping exists.
var needle = {
source: util.getArg(aArgs, 'source'),
originalLine: line,
originalColumn: util.getArg(aArgs, 'column', 0)
};
if (this.sourceRoot != null) {
needle.source = util.relative(this.sourceRoot, needle.source);
}
if (!this._sources.has(needle.source)) {
return [];
}
needle.source = this._sources.indexOf(needle.source);
var mappings = [];
var index = this._findMapping(needle,
this._originalMappings,
"originalLine",
"originalColumn",
util.compareByOriginalPositions,
binarySearch.LEAST_UPPER_BOUND);
if (index >= 0) {
var mapping = this._originalMappings[index];
if (aArgs.column === undefined) {
var originalLine = mapping.originalLine;
// Iterate until either we run out of mappings, or we run into
// a mapping for a different line than the one we found. Since
// mappings are sorted, this is guaranteed to find all mappings for
// the line we found.
while (mapping && mapping.originalLine === originalLine) {
mappings.push({
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
});
mapping = this._originalMappings[++index];
}
} else {
var originalColumn = mapping.originalColumn;
// Iterate until either we run out of mappings, or we run into
// a mapping for a different line than the one we were searching for.
// Since mappings are sorted, this is guaranteed to find all mappings for
// the line we are searching for.
while (mapping &&
mapping.originalLine === line &&
mapping.originalColumn == originalColumn) {
mappings.push({
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
});
mapping = this._originalMappings[++index];
}
}
}
return mappings;
};
exports.SourceMapConsumer = SourceMapConsumer;
/**
* A BasicSourceMapConsumer instance represents a parsed source map which we can
* query for information about the original file positions by giving it a file
* position in the generated source.
*
* The only parameter is the raw source map (either as a JSON string, or
* already parsed to an object). According to the spec, source maps have the
* following attributes:
*
* - version: Which version of the source map spec this map is following.
* - sources: An array of URLs to the original source files.
* - names: An array of identifiers which can be referrenced by individual mappings.
* - sourceRoot: Optional. The URL root from which all sources are relative.
* - sourcesContent: Optional. An array of contents of the original source files.
* - mappings: A string of base64 VLQs which contain the actual mappings.
* - file: Optional. The generated file this source map is associated with.
*
* Here is an example source map, taken from the source map spec[0]:
*
* {
* version : 3,
* file: "out.js",
* sourceRoot : "",
* sources: ["foo.js", "bar.js"],
* names: ["src", "maps", "are", "fun"],
* mappings: "AA,AB;;ABCDE;"
* }
*
* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
*/
function BasicSourceMapConsumer(aSourceMap) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === 'string') {
sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
}
var version = util.getArg(sourceMap, 'version');
var sources = util.getArg(sourceMap, 'sources');
// Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
// requires the array) to play nice here.
var names = util.getArg(sourceMap, 'names', []);
var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
var mappings = util.getArg(sourceMap, 'mappings');
var file = util.getArg(sourceMap, 'file', null);
// Once again, Sass deviates from the spec and supplies the version as a
// string rather than a number, so we use loose equality checking here.
if (version != this._version) {
throw new Error('Unsupported version: ' + version);
}
sources = sources
.map(String)
// Some source maps produce relative source paths like "./foo.js" instead of
// "foo.js". Normalize these first so that future comparisons will succeed.
// See bugzil.la/1090768.
.map(util.normalize)
// Always ensure that absolute sources are internally stored relative to
// the source root, if the source root is absolute. Not doing this would
// be particularly problematic when the source root is a prefix of the
// source (valid, but why??). See github issue #199 and bugzil.la/1188982.
.map(function (source) {
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
? util.relative(sourceRoot, source)
: source;
});
// Pass `true` below to allow duplicate names and sources. While source maps
// are intended to be compressed and deduplicated, the TypeScript compiler
// sometimes generates source maps with duplicates in them. See Github issue
// #72 and bugzil.la/889492.
this._names = ArraySet.fromArray(names.map(String), true);
this._sources = ArraySet.fromArray(sources, true);
this.sourceRoot = sourceRoot;
this.sourcesContent = sourcesContent;
this._mappings = mappings;
this.file = file;
}
BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
/**
* Create a BasicSourceMapConsumer from a SourceMapGenerator.
*
* @param SourceMapGenerator aSourceMap
* The source map that will be consumed.
* @returns BasicSourceMapConsumer
*/
BasicSourceMapConsumer.fromSourceMap =
function SourceMapConsumer_fromSourceMap(aSourceMap) {
var smc = Object.create(BasicSourceMapConsumer.prototype);
var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
smc.sourceRoot = aSourceMap._sourceRoot;
smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
smc.sourceRoot);
smc.file = aSourceMap._file;
// Because we are modifying the entries (by converting string sources and
// names to indices into the sources and names ArraySets), we have to make
// a copy of the entry or else bad things happen. Shared mutable state
// strikes again! See github issue #191.
var generatedMappings = aSourceMap._mappings.toArray().slice();
var destGeneratedMappings = smc.__generatedMappings = [];
var destOriginalMappings = smc.__originalMappings = [];
for (var i = 0, length = generatedMappings.length; i < length; i++) {
var srcMapping = generatedMappings[i];
var destMapping = new Mapping;
destMapping.generatedLine = srcMapping.generatedLine;
destMapping.generatedColumn = srcMapping.generatedColumn;
if (srcMapping.source) {
destMapping.source = sources.indexOf(srcMapping.source);
destMapping.originalLine = srcMapping.originalLine;
destMapping.originalColumn = srcMapping.originalColumn;
if (srcMapping.name) {
destMapping.name = names.indexOf(srcMapping.name);
}
destOriginalMappings.push(destMapping);
}
destGeneratedMappings.push(destMapping);
}
quickSort(smc.__originalMappings, util.compareByOriginalPositions);
return smc;
};
/**
* The version of the source mapping spec that we are consuming.
*/
BasicSourceMapConsumer.prototype._version = 3;
/**
* The list of original sources.
*/
Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
get: function () {
return this._sources.toArray().map(function (s) {
return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
}, this);
}
});
/**
* Provide the JIT with a nice shape / hidden class.
*/
function Mapping() {
this.generatedLine = 0;
this.generatedColumn = 0;
this.source = null;
this.originalLine = null;
this.originalColumn = null;
this.name = null;
}
/**
* Parse the mappings in a string in to a data structure which we can easily
* query (the ordered arrays in the `this.__generatedMappings` and
* `this.__originalMappings` properties).
*/
BasicSourceMapConsumer.prototype._parseMappings =
function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
var generatedLine = 1;
var previousGeneratedColumn = 0;
var previousOriginalLine = 0;
var previousOriginalColumn = 0;
var previousSource = 0;
var previousName = 0;
var length = aStr.length;
var index = 0;
var cachedSegments = {};
var temp = {};
var originalMappings = [];
var generatedMappings = [];
var mapping, str, segment, end, value;
while (index < length) {
if (aStr.charAt(index) === ';') {
generatedLine++;
index++;
previousGeneratedColumn = 0;
}
else if (aStr.charAt(index) === ',') {
index++;
}
else {
mapping = new Mapping();
mapping.generatedLine = generatedLine;
// Because each offset is encoded relative to the previous one,
// many segments often have the same encoding. We can exploit this
// fact by caching the parsed variable length fields of each segment,
// allowing us to avoid a second parse if we encounter the same
// segment again.
for (end = index; end < length; end++) {
if (this._charIsMappingSeparator(aStr, end)) {
break;
}
}
str = aStr.slice(index, end);
segment = cachedSegments[str];
if (segment) {
index += str.length;
} else {
segment = [];
while (index < end) {
base64VLQ.decode(aStr, index, temp);
value = temp.value;
index = temp.rest;
segment.push(value);
}
if (segment.length === 2) {
throw new Error('Found a source, but no line and column');
}
if (segment.length === 3) {
throw new Error('Found a source and line, but no column');
}
cachedSegments[str] = segment;
}
// Generated column.
mapping.generatedColumn = previousGeneratedColumn + segment[0];
previousGeneratedColumn = mapping.generatedColumn;
if (segment.length > 1) {
// Original source.
mapping.source = previousSource + segment[1];
previousSource += segment[1];
// Original line.
mapping.originalLine = previousOriginalLine + segment[2];
previousOriginalLine = mapping.originalLine;
// Lines are stored 0-based
mapping.originalLine += 1;
// Original column.
mapping.originalColumn = previousOriginalColumn + segment[3];
previousOriginalColumn = mapping.originalColumn;
if (segment.length > 4) {
// Original name.
mapping.name = previousName + segment[4];
previousName += segment[4];
}
}
generatedMappings.push(mapping);
if (typeof mapping.originalLine === 'number') {
originalMappings.push(mapping);
}
}
}
quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
this.__generatedMappings = generatedMappings;
quickSort(originalMappings, util.compareByOriginalPositions);
this.__originalMappings = originalMappings;
};
/**
* Find the mapping that best matches the hypothetical "needle" mapping that
* we are searching for in the given "haystack" of mappings.
*/
BasicSourceMapConsumer.prototype._findMapping =
function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
aColumnName, aComparator, aBias) {
// To return the position we are searching for, we must first find the
// mapping for the given position and then return the opposite position it
// points to. Because the mappings are sorted, we can use binary search to
// find the best mapping.
if (aNeedle[aLineName] <= 0) {
throw new TypeError('Line must be greater than or equal to 1, got '
+ aNeedle[aLineName]);
}
if (aNeedle[aColumnName] < 0) {
throw new TypeError('Column must be greater than or equal to 0, got '
+ aNeedle[aColumnName]);
}
return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
};
/**
* Compute the last column for each generated mapping. The last column is
* inclusive.
*/
BasicSourceMapConsumer.prototype.computeColumnSpans =
function SourceMapConsumer_computeColumnSpans() {
for (var index = 0; index < this._generatedMappings.length; ++index) {
var mapping = this._generatedMappings[index];
// Mappings do not contain a field for the last generated columnt. We
// can come up with an optimistic estimate, however, by assuming that
// mappings are contiguous (i.e. given two consecutive mappings, the
// first mapping ends where the second one starts).
if (index + 1 < this._generatedMappings.length) {
var nextMapping = this._generatedMappings[index + 1];
if (mapping.generatedLine === nextMapping.generatedLine) {
mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
continue;
}
}
// The last mapping for each line spans the entire line.
mapping.lastGeneratedColumn = Infinity;
}
};
/**
* Returns the original source, line, and column information for the generated
* source's line and column positions provided. The only argument is an object
* with the following properties:
*
* - line: The line number in the generated source.
* - column: The column number in the generated source.
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
*
* and an object is returned with the following properties:
*
* - source: The original source file, or null.
* - line: The line number in the original source, or null.
* - column: The column number in the original source, or null.
* - name: The original identifier, or null.
*/
BasicSourceMapConsumer.prototype.originalPositionFor =
function SourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, 'line'),
generatedColumn: util.getArg(aArgs, 'column')
};
var index = this._findMapping(
needle,
this._generatedMappings,
"generatedLine",
"generatedColumn",
util.compareByGeneratedPositionsDeflated,
util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
);
if (index >= 0) {
var mapping = this._generatedMappings[index];
if (mapping.generatedLine === needle.generatedLine) {
var source = util.getArg(mapping, 'source', null);
if (source !== null) {
source = this._sources.at(source);
if (this.sourceRoot != null) {
source = util.join(this.sourceRoot, source);
}
}
var name = util.getArg(mapping, 'name', null);
if (name !== null) {
name = this._names.at(name);
}
return {
source: source,
line: util.getArg(mapping, 'originalLine', null),
column: util.getArg(mapping, 'originalColumn', null),
name: name
};
}
}
return {
source: null,
line: null,
column: null,
name: null
};
};
/**
* Return true if we have the source content for every source in the source
* map, false otherwise.
*/
BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
function BasicSourceMapConsumer_hasContentsOfAllSources() {
if (!this.sourcesContent) {
return false;
}
return this.sourcesContent.length >= this._sources.size() &&
!this.sourcesContent.some(function (sc) { return sc == null; });
};
/**
* Returns the original source content. The only argument is the url of the
* original source file. Returns null if no original source content is
* available.
*/
BasicSourceMapConsumer.prototype.sourceContentFor =
function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
if (!this.sourcesContent) {
return null;
}
if (this.sourceRoot != null) {
aSource = util.relative(this.sourceRoot, aSource);
}
if (this._sources.has(aSource)) {
return this.sourcesContent[this._sources.indexOf(aSource)];
}
var url;
if (this.sourceRoot != null
&& (url = util.urlParse(this.sourceRoot))) {
// XXX: file:// URIs and absolute paths lead to unexpected behavior for
// many users. We can help them out when they expect file:// URIs to
// behave like it would if they were running a local HTTP server. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
if (url.scheme == "file"
&& this._sources.has(fileUriAbsPath)) {
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
}
if ((!url.path || url.path == "/")
&& this._sources.has("/" + aSource)) {
return this.sourcesContent[this._sources.indexOf("/" + aSource)];
}
}
// This function is used recursively from
// IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
// don't want to throw if we can't find the source - we just want to
// return null, so we provide a flag to exit gracefully.
if (nullOnMissing) {
return null;
}
else {
throw new Error('"' + aSource + '" is not in the SourceMap.');
}
};
/**
* Returns the generated line and column information for the original source,
* line, and column positions provided. The only argument is an object with
* the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source.
* - column: The column number in the original source.
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
*
* and an object is returned with the following properties:
*
* - line: The line number in the generated source, or null.
* - column: The column number in the generated source, or null.
*/
BasicSourceMapConsumer.prototype.generatedPositionFor =
function SourceMapConsumer_generatedPositionFor(aArgs) {
var source = util.getArg(aArgs, 'source');
if (this.sourceRoot != null) {
source = util.relative(this.sourceRoot, source);
}
if (!this._sources.has(source)) {
return {
line: null,
column: null,
lastColumn: null
};
}
source = this._sources.indexOf(source);
var needle = {
source: source,
originalLine: util.getArg(aArgs, 'line'),
originalColumn: util.getArg(aArgs, 'column')
};
var index = this._findMapping(
needle,
this._originalMappings,
"originalLine",
"originalColumn",
util.compareByOriginalPositions,
util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
);
if (index >= 0) {
var mapping = this._originalMappings[index];
if (mapping.source === needle.source) {
return {
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
};
}
}
return {
line: null,
column: null,
lastColumn: null
};
};
exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
/**
* An IndexedSourceMapConsumer instance represents a parsed source map which
* we can query for information. It differs from BasicSourceMapConsumer in
* that it takes "indexed" source maps (i.e. ones with a "sections" field) as
* input.
*
* The only parameter is a raw source map (either as a JSON string, or already
* parsed to an object). According to the spec for indexed source maps, they
* have the following attributes:
*
* - version: Which version of the source map spec this map is following.
* - file: Optional. The generated file this source map is associated with.
* - sections: A list of section definitions.
*
* Each value under the "sections" field has two fields:
* - offset: The offset into the original specified at which this section
* begins to apply, defined as an object with a "line" and "column"
* field.
* - map: A source map definition. This source map could also be indexed,
* but doesn't have to be.
*
* Instead of the "map" field, it's also possible to have a "url" field
* specifying a URL to retrieve a source map from, but that's currently
* unsupported.
*
* Here's an example source map, taken from the source map spec[0], but
* modified to omit a section which uses the "url" field.
*
* {
* version : 3,
* file: "app.js",
* sections: [{
* offset: {line:100, column:10},
* map: {
* version : 3,
* file: "section.js",
* sources: ["foo.js", "bar.js"],
* names: ["src", "maps", "are", "fun"],
* mappings: "AAAA,E;;ABCDE;"
* }
* }],
* }
*
* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
*/
function IndexedSourceMapConsumer(aSourceMap) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === 'string') {
sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
}
var version = util.getArg(sourceMap, 'version');
var sections = util.getArg(sourceMap, 'sections');
if (version != this._version) {
throw new Error('Unsupported version: ' + version);
}
this._sources = new ArraySet();
this._names = new ArraySet();
var lastOffset = {
line: -1,
column: 0
};
this._sections = sections.map(function (s) {
if (s.url) {
// The url field will require support for asynchronicity.
// See https://github.com/mozilla/source-map/issues/16
throw new Error('Support for url field in sections not implemented.');
}
var offset = util.getArg(s, 'offset');
var offsetLine = util.getArg(offset, 'line');
var offsetColumn = util.getArg(offset, 'column');
if (offsetLine < lastOffset.line ||
(offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
throw new Error('Section offsets must be ordered and non-overlapping.');
}
lastOffset = offset;
return {
generatedOffset: {
// The offset fields are 0-based, but we use 1-based indices when
// encoding/decoding from VLQ.
generatedLine: offsetLine + 1,
generatedColumn: offsetColumn + 1
},
consumer: new SourceMapConsumer(util.getArg(s, 'map'))
}
});
}
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
/**
* The version of the source mapping spec that we are consuming.
*/
IndexedSourceMapConsumer.prototype._version = 3;
/**
* The list of original sources.
*/
Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
get: function () {
var sources = [];
for (var i = 0; i < this._sections.length; i++) {
for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
sources.push(this._sections[i].consumer.sources[j]);
}
}
return sources;
}
});
/**
* Returns the original source, line, and column information for the generated
* source's line and column positions provided. The only argument is an object
* with the following properties:
*
* - line: The line number in the generated source.
* - column: The column number in the generated source.
*
* and an object is returned with the following properties:
*
* - source: The original source file, or null.
* - line: The line number in the original source, or null.
* - column: The column number in the original source, or null.
* - name: The original identifier, or null.
*/
IndexedSourceMapConsumer.prototype.originalPositionFor =
function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, 'line'),
generatedColumn: util.getArg(aArgs, 'column')
};
// Find the section containing the generated position we're trying to map
// to an original position.
var sectionIndex = binarySearch.search(needle, this._sections,
function(needle, section) {
var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
if (cmp) {
return cmp;
}
return (needle.generatedColumn -
section.generatedOffset.generatedColumn);
});
var section = this._sections[sectionIndex];
if (!section) {
return {
source: null,
line: null,
column: null,
name: null
};
}
return section.consumer.originalPositionFor({
line: needle.generatedLine -
(section.generatedOffset.generatedLine - 1),
column: needle.generatedColumn -
(section.generatedOffset.generatedLine === needle.generatedLine
? section.generatedOffset.generatedColumn - 1
: 0),
bias: aArgs.bias
});
};
/**
* Return true if we have the source content for every source in the source
* map, false otherwise.
*/
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
function IndexedSourceMapConsumer_hasContentsOfAllSources() {
return this._sections.every(function (s) {
return s.consumer.hasContentsOfAllSources();
});
};
/**
* Returns the original source content. The only argument is the url of the
* original source file. Returns null if no original source content is
* available.
*/
IndexedSourceMapConsumer.prototype.sourceContentFor =
function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
for (var i = 0; i < this._sections.length; i++) {
var section = this._sections[i];
var content = section.consumer.sourceContentFor(aSource, true);
if (content) {
return content;
}
}
if (nullOnMissing) {
return null;
}
else {
throw new Error('"' + aSource + '" is not in the SourceMap.');
}
};
/**
* Returns the generated line and column information for the original source,
* line, and column positions provided. The only argument is an object with
* the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source.
* - column: The column number in the original source.
*
* and an object is returned with the following properties:
*
* - line: The line number in the generated source, or null.
* - column: The column number in the generated source, or null.
*/
IndexedSourceMapConsumer.prototype.generatedPositionFor =
function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
for (var i = 0; i < this._sections.length; i++) {
var section = this._sections[i];
// Only consider this section if the requested source is in the list of
// sources of the consumer.
if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) {
continue;
}
var generatedPosition = section.consumer.generatedPositionFor(aArgs);
if (generatedPosition) {
var ret = {
line: generatedPosition.line +
(section.generatedOffset.generatedLine - 1),
column: generatedPosition.column +
(section.generatedOffset.generatedLine === generatedPosition.line
? section.generatedOffset.generatedColumn - 1
: 0)
};
return ret;
}
}
return {
line: null,
column: null
};
};
/**
* Parse the mappings in a string in to a data structure which we can easily
* query (the ordered arrays in the `this.__generatedMappings` and
* `this.__originalMappings` properties).
*/
IndexedSourceMapConsumer.prototype._parseMappings =
function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
this.__generatedMappings = [];
this.__originalMappings = [];
for (var i = 0; i < this._sections.length; i++) {
var section = this._sections[i];
var sectionMappings = section.consumer._generatedMappings;
for (var j = 0; j < sectionMappings.length; j++) {
var mapping = sectionMappings[j];
var source = section.consumer._sources.at(mapping.source);
if (section.consumer.sourceRoot !== null) {
source = util.join(section.consumer.sourceRoot, source);
}
this._sources.add(source);
source = this._sources.indexOf(source);
var name = section.consumer._names.at(mapping.name);
this._names.add(name);
name = this._names.indexOf(name);
// The mappings coming from the consumer for the section have
// generated positions relative to the start of the section, so we
// need to offset them to be relative to the start of the concatenated
// generated file.
var adjustedMapping = {
source: source,
generatedLine: mapping.generatedLine +
(section.generatedOffset.generatedLine - 1),
generatedColumn: mapping.generatedColumn +
(section.generatedOffset.generatedLine === mapping.generatedLine
? section.generatedOffset.generatedColumn - 1
: 0),
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name: name
};
this.__generatedMappings.push(adjustedMapping);
if (typeof adjustedMapping.originalLine === 'number') {
this.__originalMappings.push(adjustedMapping);
}
}
}
quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
quickSort(this.__originalMappings, util.compareByOriginalPositions);
};
exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
/***/ },
/* 8 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
exports.GREATEST_LOWER_BOUND = 1;
exports.LEAST_UPPER_BOUND = 2;
/**
* Recursive implementation of binary search.
*
* @param aLow Indices here and lower do not contain the needle.
* @param aHigh Indices here and higher do not contain the needle.
* @param aNeedle The element being searched for.
* @param aHaystack The non-empty array being searched.
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
*/
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
// This function terminates when one of the following is true:
//
// 1. We find the exact element we are looking for.
//
// 2. We did not find the exact element, but we can return the index of
// the next-closest element.
//
// 3. We did not find the exact element, and there is no next-closest
// element than the one we are searching for, so we return -1.
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
var cmp = aCompare(aNeedle, aHaystack[mid], true);
if (cmp === 0) {
// Found the element we are looking for.
return mid;
}
else if (cmp > 0) {
// Our needle is greater than aHaystack[mid].
if (aHigh - mid > 1) {
// The element is in the upper half.
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
}
// The exact needle element was not found in this haystack. Determine if
// we are in termination case (3) or (2) and return the appropriate thing.
if (aBias == exports.LEAST_UPPER_BOUND) {
return aHigh < aHaystack.length ? aHigh : -1;
} else {
return mid;
}
}
else {
// Our needle is less than aHaystack[mid].
if (mid - aLow > 1) {
// The element is in the lower half.
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
}
// we are in termination case (3) or (2) and return the appropriate thing.
if (aBias == exports.LEAST_UPPER_BOUND) {
return mid;
} else {
return aLow < 0 ? -1 : aLow;
}
}
}
/**
* This is an implementation of binary search which will always try and return
* the index of the closest element if there is no exact hit. This is because
* mappings between original and generated line/col pairs are single points,
* and there is an implicit region between each of them, so a miss just means
* that you aren't on the very start of a region.
*
* @param aNeedle The element you are looking for.
* @param aHaystack The array that is being searched.
* @param aCompare A function which takes the needle and an element in the
* array and returns -1, 0, or 1 depending on whether the needle is less
* than, equal to, or greater than the element, respectively.
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
*/
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
if (aHaystack.length === 0) {
return -1;
}
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
aCompare, aBias || exports.GREATEST_LOWER_BOUND);
if (index < 0) {
return -1;
}
// We have found either the exact element, or the next-closest element than
// the one we are searching for. However, there may be more than one such
// element. Make sure we always return the smallest of these.
while (index - 1 >= 0) {
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
break;
}
--index;
}
return index;
};
/***/ },
/* 9 */
/***/ function(module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
// It turns out that some (most?) JavaScript engines don't self-host
// `Array.prototype.sort`. This makes sense because C++ will likely remain
// faster than JS when doing raw CPU-intensive sorting. However, when using a
// custom comparator function, calling back and forth between the VM's C++ and
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
// worse generated code for the comparator function than would be optimal. In
// fact, when sorting with a comparator, these costs outweigh the benefits of
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
// a ~3500ms mean speed-up in `bench/bench.html`.
/**
* Swap the elements indexed by `x` and `y` in the array `ary`.
*
* @param {Array} ary
* The array.
* @param {Number} x
* The index of the first item.
* @param {Number} y
* The index of the second item.
*/
function swap(ary, x, y) {
var temp = ary[x];
ary[x] = ary[y];
ary[y] = temp;
}
/**
* Returns a random integer within the range `low .. high` inclusive.
*
* @param {Number} low
* The lower bound on the range.
* @param {Number} high
* The upper bound on the range.
*/
function randomIntInRange(low, high) {
return Math.round(low + (Math.random() * (high - low)));
}
/**
* The Quick Sort algorithm.
*
* @param {Array} ary
* An array to sort.
* @param {function} comparator
* Function to use to compare two items.
* @param {Number} p
* Start index of the array
* @param {Number} r
* End index of the array
*/
function doQuickSort(ary, comparator, p, r) {
// If our lower bound is less than our upper bound, we (1) partition the
// array into two pieces and (2) recurse on each half. If it is not, this is
// the empty array and our base case.
if (p < r) {
// (1) Partitioning.
//
// The partitioning chooses a pivot between `p` and `r` and moves all
// elements that are less than or equal to the pivot to the before it, and
// all the elements that are greater than it after it. The effect is that
// once partition is done, the pivot is in the exact place it will be when
// the array is put in sorted order, and it will not need to be moved
// again. This runs in O(n) time.
// Always choose a random pivot so that an input array which is reverse
// sorted does not cause O(n^2) running time.
var pivotIndex = randomIntInRange(p, r);
var i = p - 1;
swap(ary, pivotIndex, r);
var pivot = ary[r];
// Immediately after `j` is incremented in this loop, the following hold
// true:
//
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
//
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
for (var j = p; j < r; j++) {
if (comparator(ary[j], pivot) <= 0) {
i += 1;
swap(ary, i, j);
}
}
swap(ary, i + 1, j);
var q = i + 1;
// (2) Recurse on each half.
doQuickSort(ary, comparator, p, q - 1);
doQuickSort(ary, comparator, q + 1, r);
}
}
/**
* Sort the given array in-place with the given comparator function.
*
* @param {Array} ary
* An array to sort.
* @param {function} comparator
* Function to use to compare two items.
*/
exports.quickSort = function (ary, comparator) {
doQuickSort(ary, comparator, 0, ary.length - 1);
};
/***/ },
/* 10 */
/***/ function(module, exports, __webpack_require__) {
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
var SourceMapGenerator = __webpack_require__(1).SourceMapGenerator;
var util = __webpack_require__(4);
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
var REGEX_NEWLINE = /(\r?\n)/;
// Newline character code for charCodeAt() comparisons
var NEWLINE_CODE = 10;
// Private symbol for identifying `SourceNode`s when multiple versions of
// the source-map library are loaded. This MUST NOT CHANGE across
// versions!
var isSourceNode = "$$$isSourceNode$$$";
/**
* SourceNodes provide a way to abstract over interpolating/concatenating
* snippets of generated JavaScript source code while maintaining the line and
* column information associated with the original source code.
*
* @param aLine The original line number.
* @param aColumn The original column number.
* @param aSource The original source's filename.
* @param aChunks Optional. An array of strings which are snippets of
* generated JS, or other SourceNodes.
* @param aName The original identifier.
*/
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
this.children = [];
this.sourceContents = {};
this.line = aLine == null ? null : aLine;
this.column = aColumn == null ? null : aColumn;
this.source = aSource == null ? null : aSource;
this.name = aName == null ? null : aName;
this[isSourceNode] = true;
if (aChunks != null) this.add(aChunks);
}
/**
* Creates a SourceNode from generated code and a SourceMapConsumer.
*
* @param aGeneratedCode The generated code
* @param aSourceMapConsumer The SourceMap for the generated code
* @param aRelativePath Optional. The path that relative sources in the
* SourceMapConsumer should be relative to.
*/
SourceNode.fromStringWithSourceMap =
function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
// The SourceNode we want to fill with the generated code
// and the SourceMap
var node = new SourceNode();
// All even indices of this array are one line of the generated code,
// while all odd indices are the newlines between two adjacent lines
// (since `REGEX_NEWLINE` captures its match).
// Processed fragments are removed from this array, by calling `shiftNextLine`.
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
var shiftNextLine = function() {
var lineContents = remainingLines.shift();
// The last line of a file might not have a newline.
var newLine = remainingLines.shift() || "";
return lineContents + newLine;
};
// We need to remember the position of "remainingLines"
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
// The generate SourceNodes we need a code range.
// To extract it current and last mapping is used.
// Here we store the last mapping.
var lastMapping = null;
aSourceMapConsumer.eachMapping(function (mapping) {
if (lastMapping !== null) {
// We add the code from "lastMapping" to "mapping":
// First check if there is a new line in between.
if (lastGeneratedLine < mapping.generatedLine) {
// Associate first line with "lastMapping"
addMappingWithCode(lastMapping, shiftNextLine());
lastGeneratedLine++;
lastGeneratedColumn = 0;
// The remaining code is added without mapping
} else {
// There is no new line in between.
// Associate the code between "lastGeneratedColumn" and
// "mapping.generatedColumn" with "lastMapping"
var nextLine = remainingLines[0];
var code = nextLine.substr(0, mapping.generatedColumn -
lastGeneratedColumn);
remainingLines[0] = nextLine.substr(mapping.generatedColumn -
lastGeneratedColumn);
lastGeneratedColumn = mapping.generatedColumn;
addMappingWithCode(lastMapping, code);
// No more remaining code, continue
lastMapping = mapping;
return;
}
}
// We add the generated code until the first mapping
// to the SourceNode without any mapping.
// Each line is added as separate string.
while (lastGeneratedLine < mapping.generatedLine) {
node.add(shiftNextLine());
lastGeneratedLine++;
}
if (lastGeneratedColumn < mapping.generatedColumn) {
var nextLine = remainingLines[0];
node.add(nextLine.substr(0, mapping.generatedColumn));
remainingLines[0] = nextLine.substr(mapping.generatedColumn);
lastGeneratedColumn = mapping.generatedColumn;
}
lastMapping = mapping;
}, this);
// We have processed all mappings.
if (remainingLines.length > 0) {
if (lastMapping) {
// Associate the remaining code in the current line with "lastMapping"
addMappingWithCode(lastMapping, shiftNextLine());
}
// and add the remaining lines without any mapping
node.add(remainingLines.join(""));
}
// Copy sourcesContent into SourceNode
aSourceMapConsumer.sources.forEach(function (sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
if (aRelativePath != null) {
sourceFile = util.join(aRelativePath, sourceFile);
}
node.setSourceContent(sourceFile, content);
}
});
return node;
function addMappingWithCode(mapping, code) {
if (mapping === null || mapping.source === undefined) {
node.add(code);
} else {
var source = aRelativePath
? util.join(aRelativePath, mapping.source)
: mapping.source;
node.add(new SourceNode(mapping.originalLine,
mapping.originalColumn,
source,
code,
mapping.name));
}
}
};
/**
* Add a chunk of generated JS to this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/
SourceNode.prototype.add = function SourceNode_add(aChunk) {
if (Array.isArray(aChunk)) {
aChunk.forEach(function (chunk) {
this.add(chunk);
}, this);
}
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
if (aChunk) {
this.children.push(aChunk);
}
}
else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
/**
* Add a chunk of generated JS to the beginning of this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
if (Array.isArray(aChunk)) {
for (var i = aChunk.length-1; i >= 0; i--) {
this.prepend(aChunk[i]);
}
}
else if (aChunk[isSourceNode] || typeof aChunk === "string") {
this.children.unshift(aChunk);
}
else {
throw new TypeError(
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
);
}
return this;
};
/**
* Walk over the tree of JS snippets in this node and its children. The
* walking function is called once for each snippet of JS and is passed that
* snippet and the its original associated source's line/column location.
*
* @param aFn The traversal function.
*/
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
var chunk;
for (var i = 0, len = this.children.length; i < len; i++) {
chunk = this.children[i];
if (chunk[isSourceNode]) {
chunk.walk(aFn);
}
else {
if (chunk !== '') {
aFn(chunk, { source: this.source,
line: this.line,
column: this.column,
name: this.name });
}
}
}
};
/**
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
* each of `this.children`.
*
* @param aSep The separator.
*/
SourceNode.prototype.join = function SourceNode_join(aSep) {
var newChildren;
var i;
var len = this.children.length;
if (len > 0) {
newChildren = [];
for (i = 0; i < len-1; i++) {
newChildren.push(this.children[i]);
newChildren.push(aSep);
}
newChildren.push(this.children[i]);
this.children = newChildren;
}
return this;
};
/**
* Call String.prototype.replace on the very right-most source snippet. Useful
* for trimming whitespace from the end of a source node, etc.
*
* @param aPattern The pattern to replace.
* @param aReplacement The thing to replace the pattern with.
*/
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
var lastChild = this.children[this.children.length - 1];
if (lastChild[isSourceNode]) {
lastChild.replaceRight(aPattern, aReplacement);
}
else if (typeof lastChild === 'string') {
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
}
else {
this.children.push(''.replace(aPattern, aReplacement));
}
return this;
};
/**
* Set the source content for a source file. This will be added to the SourceMapGenerator
* in the sourcesContent field.
*
* @param aSourceFile The filename of the source file
* @param aSourceContent The content of the source file
*/
SourceNode.prototype.setSourceContent =
function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
};
/**
* Walk over the tree of SourceNodes. The walking function is called for each
* source file content and is passed the filename and source content.
*
* @param aFn The traversal function.
*/
SourceNode.prototype.walkSourceContents =
function SourceNode_walkSourceContents(aFn) {
for (var i = 0, len = this.children.length; i < len; i++) {
if (this.children[i][isSourceNode]) {
this.children[i].walkSourceContents(aFn);
}
}
var sources = Object.keys(this.sourceContents);
for (var i = 0, len = sources.length; i < len; i++) {
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
}
};
/**
* Return the string representation of this source node. Walks over the tree
* and concatenates all the various snippets together to one string.
*/
SourceNode.prototype.toString = function SourceNode_toString() {
var str = "";
this.walk(function (chunk) {
str += chunk;
});
return str;
};
/**
* Returns the string representation of this source node along with a source
* map.
*/
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
var generated = {
code: "",
line: 1,
column: 0
};
var map = new SourceMapGenerator(aArgs);
var sourceMappingActive = false;
var lastOriginalSource = null;
var lastOriginalLine = null;
var lastOriginalColumn = null;
var lastOriginalName = null;
this.walk(function (chunk, original) {
generated.code += chunk;
if (original.source !== null
&& original.line !== null
&& original.column !== null) {
if(lastOriginalSource !== original.source
|| lastOriginalLine !== original.line
|| lastOriginalColumn !== original.column
|| lastOriginalName !== original.name) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
lastOriginalSource = original.source;
lastOriginalLine = original.line;
lastOriginalColumn = original.column;
lastOriginalName = original.name;
sourceMappingActive = true;
} else if (sourceMappingActive) {
map.addMapping({
generated: {
line: generated.line,
column: generated.column
}
});
lastOriginalSource = null;
sourceMappingActive = false;
}
for (var idx = 0, length = chunk.length; idx < length; idx++) {
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
generated.line++;
generated.column = 0;
// Mappings end at eol
if (idx + 1 === length) {
lastOriginalSource = null;
sourceMappingActive = false;
} else if (sourceMappingActive) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
} else {
generated.column++;
}
}
});
this.walkSourceContents(function (sourceFile, sourceContent) {
map.setSourceContent(sourceFile, sourceContent);
});
return { code: generated.code, map: map };
};
exports.SourceNode = SourceNode;
/***/ }
/******/ ])
});
;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vd2VicGFjay91bml2ZXJzYWxNb2R1bGVEZWZpbml0aW9uIiwid2VicGFjazovLy93ZWJwYWNrL2Jvb3RzdHJhcCBlMTM0NGZmMjJhYzA2Zjk0NWVlNCIsIndlYnBhY2s6Ly8vLi9zb3VyY2UtbWFwLmpzIiwid2VicGFjazovLy8uL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LXZscS5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmFzZTY0LmpzIiwid2VicGFjazovLy8uL2xpYi91dGlsLmpzIiwid2VicGFjazovLy8uL2xpYi9hcnJheS1zZXQuanMiLCJ3ZWJwYWNrOi8vLy4vbGliL21hcHBpbmctbGlzdC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW1hcC1jb25zdW1lci5qcyIsIndlYnBhY2s6Ly8vLi9saWIvYmluYXJ5LXNlYXJjaC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvcXVpY2stc29ydC5qcyIsIndlYnBhY2s6Ly8vLi9saWIvc291cmNlLW5vZGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsQ0FBQztBQUNELE87QUNWQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSx1QkFBZTtBQUNmO0FBQ0E7QUFD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ZW5lcmF0ZWRMaW5lKys7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIGVsc2Uge1xuICAgICAgICBpZiAoaSA+IDApIHtcbiAgICAgICAgICBpZiAoIXV0aWwuY29tcGFyZUJ5R2VuZXJhdGVkUG9zaXRpb25zSW5mbGF0ZWQobWFwcGluZywgbWFwcGluZ3NbaSAtIDFdKSkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIG5leHQgKz0gJywnO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIG5leHQgKz0gYmFzZTY0VkxRLmVuY29kZShtYXBwaW5nLmdlbmVyYXRlZENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwcmV2aW91c0dlbmVyYXRlZENvbHVtbik7XG4gICAgICBwcmV2aW91c0dlbmVyYXRlZENvbHVtbiA9IG1hcHBpbmcuZ2VuZXJhdGVkQ29sdW1uO1xuXG4gICAgICBpZiAobWFwcGluZy5zb3VyY2UgIT0gbnVsbCkge1xuICAgICAgICBzb3VyY2VJZHggPSB0aGlzLl9zb3VyY2VzLmluZGV4T2YobWFwcGluZy5zb3VyY2UpO1xuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUoc291cmNlSWR4IC0gcHJldmlvdXNTb3VyY2UpO1xuICAgICAgICBwcmV2aW91c1NvdXJjZSA9IHNvdXJjZUlkeDtcblxuICAgICAgICAvLyBsaW5lcyBhcmUgc3RvcmVkIDAtYmFzZWQgaW4gU291cmNlTWFwIHNwZWMgdmVyc2lvbiAzXG4gICAgICAgIG5leHQgKz0gYmFzZTY0VkxRLmVuY29kZShtYXBwaW5nLm9yaWdpbmFsTGluZSAtIDFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBwcmV2aW91c09yaWdpbmFsTGluZSk7XG4gICAgICAgIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gbWFwcGluZy5vcmlnaW5hbExpb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luZyBmb3JcbiAgICAvLyB0aGUgZ2l2ZW4gbGluZSwgcHJvdmlkZWQgc3VjaCBhIG1hcHBpbmcgZXhpc3RzLlxuICAgIHZhciBuZWVkbGUgPSB7XG4gICAgICBzb3VyY2U6IHV0aWwuZ2V0QXJnKGFBcmdzLCAnc291cmNlJyksXG4gICAgICBvcmlnaW5hbExpbmU6IGxpbmUsXG4gICAgICBvcmlnaW5hbENvbHVtbjogdXRpbC5nZXRBcmcoYUFyZ3MsICdjb2x1bW4nLCAwKVxuICAgIH07XG5cbiAgICBpZiAodGhpcy5zb3VyY2VSb290ICE9IG51bGwpIHtcbiAgICAgIG5lZWRsZS5zb3VyY2UgPSB1dGlsLnJlbGF0aXZlKHRoaXMuc291cmNlUm9vdCwgbmVlZGxlLnNvdXJjZSk7XG4gICAgfVxuICAgIGlmICghdGhpcy5fc291cmNlcy5oYXMobmVlZGxlLnNvdXJjZSkpIHtcbiAgICAgIHJldHVybiBbXTtcbiAgICB9XG4gICAgbmVlZGxlLnNvdXJjZSA9IHRoaXMuX3NvdXJjZXMuaW5kZXhPZihuZWVkbGUuc291cmNlKTtcblxuICAgIHZhciBtYXBwaW5ncyA9IFtdO1xuXG4gICAgdmFyIGluZGV4ID0gdGhpcy5fZmluZE1hcHBpbmcobmVlZGxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX29yaWdpbmFsTWFwcGluZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvcmlnaW5hbExpbmVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIm9yaWdpbmFsQ29sdW1uXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXRpbC5jb21wYXJlQnlPcmlnaW5hbFBvc2l0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaW5hcnlTZWFyY2guTEVBU1RfVVBQRVJfQk9VTkQpO1xuICAgIGlmIChpbm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BpZiAoc2VnbWVudC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgLy8gT3JpZ2luYWwgc291cmNlLlxuICAgICAgICAgIG1hcHBpbmcuc291cmNlID0gcHJldmlvdXNTb3VyY2UgKyBzZWdtZW50WzFdO1xuICAgICAgICAgIHByZXZpb3VzU291cmNlICs9IHNlZ21lbnRbMV07XG5cbiAgICAgICAgICAvLyBPcmlnaW5hbCBsaW5lLlxuICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxMaW5lID0gcHJldmlvdXNPcmlnaW5hbExpbmUgKyBzZWdtZW50WzJdO1xuICAgICAgICAgIHByZXZpb3VzT3JpZ2luYWxMaW5lID0gbWFwcGluZy5vcmlnaW5hbExpbmU7XG4gICAgICAgICAgLy8gTGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkXG4gICAgICAgICAgbWFwcGluZy5vcmlnaW5hbExpbmUgKz0gMTtcblxuICAgICAgICAgIC8vIE9yaWdpbmFsIGNvbHVtbi5cbiAgICAgICAgICBtYXBwaW5nLm9yaWdpbmFsQ29sdW1uID0gcHJldmlvdXNPcmlnaW5hbENvbHVtbiArIHNlZ21lbnRbM107XG4gICAgICAgICAgcHJldmlvdXNPcmlnaW5hbENvbHVtbiA9IG1hcHBpbmcub3JpZ2luYWxDb2x1bW47XG5cbiAgICAgICAgICBpZiAoc2VnbWVudC5sZW5ndGggPiA0KSB7XG4gICAgICAgICAgICAvLyBPcmlnaW5hbCBuYW1lLlxuICAgICAgICAgICAgbWFwcGluZy5uYW1lID0gcHJldmlvdXNOYW1lICsgc2VnbWVudFs0XTtcbiAgICAgICAgICAgIHByZXZpb3VzTmFtZSArPSBzZWdtZW50WzRdO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGdlbmVyYXRlZE1hcHBpbmdzLnB1c2gobWFwcGluZyk7XG4gICAgICAgIGlmICh0eXBlb2YgbWFwcGluZy5vcmlnaW5hbExpbmUgPT09ICdudW1iZXInKSB7XG4gICAgICA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gIHZhciBzb3VyY2UgPSB1dGlsLmdldEFyZyhtYXBwaW5nLCAnc291cmNlJywgbnVsbCk7XG4gICAgICAgIGlmIChzb3VyY2UgIT09IG51bGwpIHtcbiAgICAgICAgICBzb3VyY2UgPSB0aGlzLl9zb3VyY2VzLmF0KHNvdXJjZSk7XG4gICAgICAgICAgaWYgKHRoaXMuc291cmNlUm9vdCAhPSBudWxsKSB7XG4gICAgICAgICAgICBzb3VyY2UgPSB1dGlsLmpvaW4odGhpcy5zb3VyY2VSb290LCBzb3VyY2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICB2YXIgbmFtZSA9IHV0aWwuZ2V0QXJnKG1hcHBpbmcsICduYW1lJywgbnVsbCk7XG4gICAgICAgIGlmIChuYW1lICE9PSBudWxsKSB7XG4gICAgICAgICAgbmFtZSA9IHRoaXMuX25hbWVzLmF0KG5hbWUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgc291cmNlOiBzb3VyY2UsXG4gICAgICAgICAgbGluZTogdXRpbC5nZXRBcmcobWFwcGluZywgJ29yaWdpbmFsTGluZScsIG51bGwpLFxuICAgICAgICAgIGNvbHVtbjogdXRpbC5nZXRBcmcobWFwcGluZywgJ29yaWdpbmFsQ29sdW1uJywgbnVsbCksXG4gICAgICAgICAgbmFtZTogbmFtZVxuICAgICAgICB9O1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBzb3VyY2U6IG51bGwsXG4gICAgICBsaW5lOiBudWxsLFxuICAgICAgY29sdW1uOiBudWxsLFxuICAgICAgbmFtZTogbnVsbFxuICAgIH07XG4gIH07XG5cbi8qKlxuICogUmV0dXJuIHRydWUgaWYgd2UgaGF2ZSB0aGUgc291cmNlIGNvbnRlbnQgZm9yIGV2ZXJ5IHNvdXJjZSBpbiB0aGUgc291cmNlXG4gKiBtYXAsIGZhbHNlIG90aGVyd2lzZS5cbiAqL1xuQmFzaWNTb3VyY2VNYXB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50byBTb3VyY2VOb2RlXG4gICAgYVNvdXJjZU1hcENvbnN1bWVyLnNvdXJjZXMuZm9yRWFjaChmdW5jdGlvbiAoc291cmNlRmlsZSkge1xuICAgICAgdmFyIGNvbnRlbnQgPSBhU291cmNlTWFwQ29uc3VtZXIuc291cmNlQ29udGVudEZvcihzb3VyY2VGaWxlKTtcbiAgICAgIGlmIChjb250ZW50ICE9IG51bGwpIHtcbiAgICAgICAgaWYgKGFSZWxhdGl2ZVBhdGggIT0gbnVsbCkge1xuICAgICAgICAgIHNvdXJjZUZpbGUgPSB1dGlsLmpvaW4oYVJlbGF0aXZlUGF0aCwgc291cmNlRmlsZSk7XG4gICAgICAgIH1cbiAgICAgICAgbm9kZS5zZXRTb3VyY2VDb250ZW50KHNvdXJjZUZpbGUsIGNvbnRlbnQpO1xuICAgICAgfVxuICAgIH0pO1xuXG4gICAgcmV0dXJuIG5vZGU7XG5cbiAgICBmdW5jdGlvbiBhZGRNYXBwaW5nV2l0aENvZGUobWFwcGluZywgY29kZSkge1xuICAgICAgaWYgKG1hcHBpbmcgPT09IG51bGwgfHwgbWFwcGluZy5zb3VyY2UgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBub2RlLmFkZChjb2RlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBzb3VyY2UgPSBhUmVsYXRpdmVQYXRoXG4gICAgICAgICAgPyB1dGlsLmpvaW4oYVJlbGF0aXZlUGF0aCwgbWFwcGluZy5zb3VyY2UpXG4gICAgICAgICAgOiBtYXBwaW5nLnNvdXJjZTtcbiAgICAgICAgbm9kZS5hZGQobmV3IFNvdXJjZU5vZGUobWFwcGluZy5vcmlnaW5hbExpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxDb2x1bW4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSxcbi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mNvbHVtbisrO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG4gIHRoaXMud2Fsa1NvdXJjZUNvbnRlbnRzKGZ1bmN0aW9uIChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KSB7XG4gICAgbWFwLnNldFNvdXJjZUNvbnRlbnQoc291cmNlRmlsZSwgc291cmNlQ29udGVudCk7XG4gIH0pO1xuXG4gIHJldHVybiB7IGNvZGU6IGdlbmVyYXRlZC5jb2RlLCBtYXA6IG1hcCB9O1xufTtcblxuZXhwb3J0cy5Tb3VyY2VOb2RlID0gU291cmNlTm9kZTtcblxuXG5cbi8qKioqKioqKioqKioqKioqKlxuICoqIFdFQlBBQ0sgRk9PVEVSXG4gKiogLi9saWIvc291cmNlLW5vZGUuanNcbiAqKiBtb2R1bGUgaWQgPSAxMFxuICoqIG1vZHVsZSBjaHVua3MgPSAwXG4gKiovIl0sInNvdXJjZVJvb3QiOiIifQ== | mohamedelkadi/node-cms | node_modules/pug/node_modules/pug-filters/node_modules/uglify-js/node_modules/source-map/dist/source-map.debug.js | JavaScript | mit | 256,678 |
<?php
/*
* $Id: DefaultPlatform.php 1262 2009-10-26 20:54:39Z francois $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://propel.phpdb.org>.
*/
require_once 'propel/engine/platform/Platform.php';
include_once 'propel/engine/database/model/Domain.php';
include_once 'propel/engine/database/model/PropelTypes.php';
/**
* Default implementation for the Platform interface.
*
* @author Martin Poeschl <mpoeschl@marmot.at> (Torque)
* @version $Revision: 1262 $
* @package propel.engine.platform
*/
class DefaultPlatform implements Platform {
/**
* Mapping from Propel types to Domain objects.
*
* @var array
*/
private $schemaDomainMap;
/**
* GeneratorConfig object holding build properties.
*
* @var GeneratorConfig
*/
private $generatorConfig;
/**
* @var PDO Database connection.
*/
private $con;
/**
* Default constructor.
* @param PDO $con Optional database connection to use in this platform.
*/
public function __construct(PDO $con = null)
{
if ($con) $this->setConnection($con);
$this->initialize();
}
/**
* Set the database connection to use for this Platform class.
* @param PDO $con Database connection to use in this platform.
*/
public function setConnection(PDO $con = null)
{
$this->con = $con;
}
/**
* Sets the GeneratorConfig to use in the parsing.
*
* @param GeneratorConfig $config
*/
public function setGeneratorConfig(GeneratorConfig $config)
{
$this->generatorConfig = $config;
}
/**
* Gets the GeneratorConfig option.
*
* @return GeneratorConfig
*/
public function getGeneratorConfig()
{
return $this->generatorConfig;
}
/**
* Gets a specific propel (renamed) property from the build.
*
* @param string $name
* @return mixed
*/
protected function getBuildProperty($name)
{
if ($this->generatorConfig !== null) {
return $this->generatorConfig->getBuildProperty($name);
}
return null;
}
/**
* Returns the database connection to use for this Platform class.
* @return PDO The database connection or NULL if none has been set.
*/
public function getConnection()
{
return $this->con;
}
/**
* Initialize the type -> Domain mapping.
*/
protected function initialize()
{
$this->schemaDomainMap = array();
foreach (PropelTypes::getPropelTypes() as $type) {
$this->schemaDomainMap[$type] = new Domain($type);
}
// BU_* no longer needed, so map these to the DATE/TIMESTAMP domains
$this->schemaDomainMap[PropelTypes::BU_DATE] = new Domain(PropelTypes::DATE);
$this->schemaDomainMap[PropelTypes::BU_TIMESTAMP] = new Domain(PropelTypes::TIMESTAMP);
// Boolean is a bit special, since typically it must be mapped to INT type.
$this->schemaDomainMap[PropelTypes::BOOLEAN] = new Domain(PropelTypes::BOOLEAN, "INTEGER");
}
/**
* Adds a mapping entry for specified Domain.
* @param Domain $domain
*/
protected function setSchemaDomainMapping(Domain $domain)
{
$this->schemaDomainMap[$domain->getType()] = $domain;
}
/**
* Returns the short name of the database type that this platform represents.
* For example MysqlPlatform->getDatabaseType() returns 'mysql'.
* @return string
*/
public function getDatabaseType()
{
$clazz = get_class($this);
$pos = strpos($clazz, 'Platform');
return strtolower(substr($clazz,0,$pos));
}
/**
* @see Platform::getMaxColumnNameLength()
*/
public function getMaxColumnNameLength()
{
return 64;
}
/**
* @see Platform::getNativeIdMethod()
*/
public function getNativeIdMethod()
{
return Platform::IDENTITY;
}
/**
* @see Platform::getDomainForType()
*/
public function getDomainForType($propelType)
{
if (!isset($this->schemaDomainMap[$propelType])) {
throw new EngineException("Cannot map unknown Propel type " . var_export($propelType, true) . " to native database type.");
}
return $this->schemaDomainMap[$propelType];
}
/**
* @return string Returns the SQL fragment to use if null values are disallowed.
* @see Platform::getNullString(boolean)
*/
public function getNullString($notNull)
{
return ($notNull ? "NOT NULL" : "");
}
/**
* @see Platform::getAutoIncrement()
*/
public function getAutoIncrement()
{
return "IDENTITY";
}
/**
* @see Platform::hasScale(String)
*/
public function hasScale($sqlType)
{
return true;
}
/**
* @see Platform::hasSize(String)
*/
public function hasSize($sqlType)
{
return true;
}
/**
* @see Platform::quote()
*/
public function quote($text)
{
if ($this->getConnection()) {
return $this->getConnection()->quote($text);
} else {
return "'" . $this->disconnectedEscapeText($text) . "'";
}
}
/**
* Method to escape text when no connection has been set.
*
* The subclasses can implement this using string replacement functions
* or native DB methods.
*
* @param string $text Text that needs to be escaped.
* @return string
*/
protected function disconnectedEscapeText($text)
{
return str_replace("'", "''", $text);
}
/**
* @see Platform::quoteIdentifier()
*/
public function quoteIdentifier($text)
{
return '"' . $text . '"';
}
/**
* @see Platform::supportsNativeDeleteTrigger()
*/
public function supportsNativeDeleteTrigger()
{
return false;
}
/**
* @see Platform::supportsInsertNullPk()
*/
public function supportsInsertNullPk()
{
return true;
}
/**
* Whether the underlying PDO driver for this platform returns BLOB columns as streams (instead of strings).
* @return boolean
*/
public function hasStreamBlobImpl()
{
return false;
}
/**
* @see Platform::getBooleanString()
*/
public function getBooleanString($b)
{
$b = ($b === true || strtolower($b) === 'true' || $b === 1 || $b === '1' || strtolower($b) === 'y' || strtolower($b) === 'yes');
return ($b ? '1' : '0');
}
/**
* Gets the preferred timestamp formatter for setting date/time values.
* @return string
*/
public function getTimestampFormatter()
{
return DateTime::ISO8601;
}
/**
* Gets the preferred time formatter for setting date/time values.
* @return string
*/
public function getTimeFormatter()
{
return 'H:i:s';
}
/**
* Gets the preferred date formatter for setting date/time values.
* @return string
*/
public function getDateFormatter()
{
return 'Y-m-d';
}
}
| maggsta/openzim | lib/vendor/symfony-1.4.18/lib/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/engine/platform/DefaultPlatform.php | PHP | mit | 7,403 |
angular.module('ng-token-auth', ['ngCookies']).provider('$auth', function() {
var config;
config = {
apiUrl: '/api',
signOutUrl: '/auth/sign_out',
emailSignInPath: '/auth/sign_in',
emailRegistrationPath: '/auth',
confirmationSuccessUrl: window.location.href,
passwordResetPath: '/auth/password',
passwordUpdatePath: '/auth/password',
passwordResetSuccessUrl: window.location.href,
tokenValidationPath: '/auth/validate_token',
proxyIf: function() {
return false;
},
proxyUrl: '/proxy',
validateOnPageLoad: true,
forceHardRedirect: false,
storage: 'cookies',
tokenFormat: {
"access-token": "{{ token }}",
"token-type": "Bearer",
client: "{{ clientId }}",
expiry: "{{ expiry }}",
uid: "{{ uid }}"
},
parseExpiry: function(headers) {
return (parseInt(headers['expiry'], 10) * 1000) || null;
},
handleLoginResponse: function(resp) {
return resp.data;
},
handleTokenValidationResponse: function(resp) {
return resp.data;
},
authProviderPaths: {
github: '/auth/github',
facebook: '/auth/facebook',
google: '/auth/google_oauth2'
}
};
return {
configure: function(params) {
return angular.extend(config, params);
},
$get: [
'$http', '$q', '$location', '$cookieStore', '$window', '$timeout', '$rootScope', '$interpolate', (function(_this) {
return function($http, $q, $location, $cookieStore, $window, $timeout, $rootScope, $interpolate) {
return {
header: null,
dfd: null,
config: config,
user: {},
mustResetPassword: false,
listener: null,
initialize: function() {
this.initializeListeners();
return this.addScopeMethods();
},
initializeListeners: function() {
this.listener = this.handlePostMessage.bind(this);
if ($window.addEventListener) {
return $window.addEventListener("message", this.listener, false);
}
},
cancel: function(reason) {
if (this.t != null) {
$timeout.cancel(this.t);
}
if (this.dfd != null) {
this.rejectDfd(reason);
}
return $timeout(((function(_this) {
return function() {
return _this.t = null;
};
})(this)), 0);
},
destroy: function() {
this.cancel();
if ($window.removeEventListener) {
return $window.removeEventListener("message", this.listener, false);
}
},
handlePostMessage: function(ev) {
var error;
if (ev.data.message === 'deliverCredentials') {
delete ev.data.message;
this.handleValidAuth(ev.data, true);
$rootScope.$broadcast('auth:login-success', ev.data);
}
if (ev.data.message === 'authFailure') {
error = {
reason: 'unauthorized',
errors: [ev.data.error]
};
this.cancel(error);
return $rootScope.$broadcast('auth:login-error', error);
}
},
addScopeMethods: function() {
$rootScope.user = this.user;
$rootScope.authenticate = (function(_this) {
return function(provider) {
return _this.authenticate(provider);
};
})(this);
$rootScope.signOut = (function(_this) {
return function() {
return _this.signOut();
};
})(this);
$rootScope.submitRegistration = (function(_this) {
return function(params) {
return _this.submitRegistration(params);
};
})(this);
$rootScope.submitLogin = (function(_this) {
return function(params) {
return _this.submitLogin(params);
};
})(this);
$rootScope.requestPasswordReset = (function(_this) {
return function(params) {
return _this.requestPasswordReset(params);
};
})(this);
$rootScope.updatePassword = (function(_this) {
return function(params) {
return _this.updatePassword(params);
};
})(this);
if (config.validateOnPageLoad) {
return this.validateUser();
}
},
submitRegistration: function(params) {
angular.extend(params, {
confirm_success_url: config.confirmationSuccessUrl
});
return $http.post(this.apiUrl() + config.emailRegistrationPath, params).success(function() {
return $rootScope.$broadcast('auth:registration-email-success', params);
}).error(function(resp) {
return $rootScope.$broadcast('auth:registration-email-error', resp);
});
},
submitLogin: function(params) {
this.initDfd();
$http.post(this.apiUrl() + config.emailSignInPath, params).success((function(_this) {
return function(resp) {
var authData;
authData = config.handleLoginResponse(resp);
_this.handleValidAuth(authData);
return $rootScope.$broadcast('auth:login-success', _this.user);
};
})(this)).error((function(_this) {
return function(resp) {
_this.rejectDfd({
reason: 'unauthorized',
errors: ['Invalid credentials']
});
return $rootScope.$broadcast('auth:login-error', resp);
};
})(this));
return this.dfd.promise;
},
requestPasswordReset: function(params) {
params.redirect_url = config.passwordResetSuccessUrl;
return $http.post(this.apiUrl() + config.passwordResetPath, params).success(function() {
return $rootScope.$broadcast('auth:password-reset-request-success', params);
}).error(function(resp) {
return $rootScope.$broadcast('auth:password-reset-request-error', resp);
});
},
updatePassword: function(params) {
return $http.put(this.apiUrl() + config.passwordUpdatePath, params).success((function(_this) {
return function(resp) {
$rootScope.$broadcast('auth:password-change-success', resp);
return _this.mustResetPassword = false;
};
})(this)).error(function(resp) {
return $rootScope.$broadcast('auth:password-change-error', resp);
});
},
authenticate: function(provider) {
if (this.dfd == null) {
this.initDfd();
this.openAuthWindow(provider);
}
return this.dfd.promise;
},
openAuthWindow: function(provider) {
var authUrl;
authUrl = this.buildAuthUrl(provider);
if (this.useExternalWindow()) {
return this.requestCredentials($window.open(authUrl));
} else {
return $location.replace(authUrl);
}
},
buildAuthUrl: function(provider) {
var authUrl;
authUrl = config.apiUrl;
authUrl += config.authProviderPaths[provider];
authUrl += '?auth_origin_url=';
return authUrl += $location.href;
},
requestCredentials: function(authWindow) {
if (authWindow.closed) {
this.cancel({
reason: 'unauthorized',
errors: ['User canceled login']
});
return $rootScope.$broadcast('auth:window-closed');
} else {
authWindow.postMessage("requestCredentials", "*");
return this.t = $timeout(((function(_this) {
return function() {
return _this.requestCredentials(authWindow);
};
})(this)), 500);
}
},
resolveDfd: function() {
this.dfd.resolve({
id: this.user.id
});
return $timeout(((function(_this) {
return function() {
_this.dfd = null;
if (!$rootScope.$$phase) {
return $rootScope.$digest();
}
};
})(this)), 0);
},
validateUser: function() {
var clientId, token, uid;
if (this.dfd == null) {
this.initDfd();
if (!(this.headers && this.user.id)) {
if ($location.search().token !== void 0) {
token = $location.search().token;
clientId = $location.search().client_id;
uid = $location.search().uid;
this.mustResetPassword = $location.search().reset_password;
this.firstTimeLogin = $location.search().account_confirmation_success;
this.setAuthHeaders(this.buildAuthHeaders({
token: token,
clientId: clientId,
uid: uid
}));
$location.url($location.path() || '/');
} else if (this.retrieveData('auth_headers')) {
this.headers = this.retrieveData('auth_headers');
}
if (!isEmpty(this.headers)) {
this.validateToken();
} else {
this.rejectDfd({
reason: 'unauthorized',
errors: ['No credentials']
});
$rootScope.$broadcast('auth:invalid');
}
} else {
this.resolveDfd();
}
}
return this.dfd.promise;
},
validateToken: function() {
if (!this.tokenHasExpired()) {
return $http.get(this.apiUrl() + config.tokenValidationPath).success((function(_this) {
return function(resp) {
var authData;
authData = config.handleTokenValidationResponse(resp);
_this.handleValidAuth(authData);
if (_this.firstTimeLogin) {
$rootScope.$broadcast('auth:email-confirmation-success', _this.user);
}
if (_this.mustResetPassword) {
$rootScope.$broadcast('auth:password-reset-confirm-success', _this.user);
}
return $rootScope.$broadcast('auth:validation-success', _this.user);
};
})(this)).error((function(_this) {
return function(data) {
if (_this.firstTimeLogin) {
$rootScope.$broadcast('auth:email-confirmation-error', data);
}
if (_this.mustResetPassword) {
$rootScope.$broadcast('auth:password-reset-confirm-error', data);
}
$rootScope.$broadcast('auth:validation-error', data);
return _this.rejectDfd({
reason: 'unauthorized',
errors: data.errors
});
};
})(this));
} else {
return this.rejectDfd({
reason: 'unauthorized',
errors: ['Expired credentials']
});
}
},
tokenHasExpired: function() {
var expiry, now;
expiry = this.getExpiry();
now = new Date().getTime();
if (this.headers && expiry) {
return expiry && expiry < now;
} else {
return null;
}
},
getExpiry: function() {
return config.parseExpiry(this.headers);
},
invalidateTokens: function() {
var key, val, _ref;
_ref = this.user;
for (key in _ref) {
val = _ref[key];
delete this.user[key];
}
this.headers = null;
return this.deleteData('auth_headers');
},
signOut: function() {
return $http["delete"](this.apiUrl() + config.signOutUrl).success((function(_this) {
return function(resp) {
_this.invalidateTokens();
return $rootScope.$broadcast('auth:logout-success');
};
})(this)).error((function(_this) {
return function(resp) {
_this.invalidateTokens();
return $rootScope.$broadcast('auth:logout-error', resp);
};
})(this));
},
handleValidAuth: function(user, setHeader) {
if (setHeader == null) {
setHeader = false;
}
if (this.t != null) {
$timeout.cancel(this.t);
}
angular.extend(this.user, user);
if (setHeader) {
this.setAuthHeaders(this.buildAuthHeaders({
token: this.user.auth_token,
clientId: this.user.client_id,
uid: this.user.uid
}));
}
return this.resolveDfd();
},
buildAuthHeaders: function(ctx) {
var headers, key, val, _ref;
headers = {};
_ref = config.tokenFormat;
for (key in _ref) {
val = _ref[key];
headers[key] = $interpolate(val)(ctx);
}
return headers;
},
persistData: function(key, val) {
switch (config.storage) {
case 'localStorage':
return $window.localStorage.setItem(key, JSON.stringify(val));
default:
return $cookieStore.put(key, val);
}
},
retrieveData: function(key) {
switch (config.storage) {
case 'localStorage':
return JSON.parse($window.localStorage.getItem(key));
default:
return $cookieStore.get(key);
}
},
deleteData: function(key) {
switch (config.storage) {
case 'localStorage':
return $window.localStorage.removeItem(key);
default:
return $cookieStore.remove(key);
}
},
setAuthHeaders: function(headers) {
this.headers = angular.extend(this.headers || {}, headers);
return this.persistData('auth_headers', this.headers);
},
useExternalWindow: function() {
return !(config.forceHardRedirect || $window.isOldIE());
},
initDfd: function() {
return this.dfd = $q.defer();
},
rejectDfd: function(reason) {
this.invalidateTokens();
if (this.dfd != null) {
this.dfd.reject(reason);
return $timeout(((function(_this) {
return function() {
return _this.dfd = null;
};
})(this)), 0);
}
},
apiUrl: function() {
if (config.proxyIf()) {
return config.proxyUrl;
} else {
return config.apiUrl;
}
}
};
};
})(this)
]
};
}).config([
'$httpProvider', function($httpProvider) {
var httpMethods;
$httpProvider.interceptors.push([
'$injector', function($injector) {
return {
request: function(req) {
$injector.invoke([
'$http', '$auth', function($http, $auth) {
var key, val, _ref, _results;
if (req.url.match($auth.config.apiUrl)) {
_ref = $auth.headers;
_results = [];
for (key in _ref) {
val = _ref[key];
_results.push(req.headers[key] = val);
}
return _results;
}
}
]);
return req;
},
response: function(resp) {
$injector.invoke([
'$http', '$auth', function($http, $auth) {
var key, newHeaders, val, _ref;
newHeaders = {};
_ref = $auth.config.tokenFormat;
for (key in _ref) {
val = _ref[key];
if (resp.headers(key)) {
newHeaders[key] = resp.headers(key);
}
}
return $auth.setAuthHeaders(newHeaders);
}
]);
return resp;
}
};
}
]);
httpMethods = ['get', 'post', 'put', 'patch', 'delete'];
return angular.forEach(httpMethods, function(method) {
var _base;
if ((_base = $httpProvider.defaults.headers)[method] == null) {
_base[method] = method;
}
return $httpProvider.defaults.headers[method]['If-Modified-Since'] = '0';
});
}
]).run([
'$auth', '$window', '$rootScope', function($auth, $window, $rootScope) {
return $auth.initialize();
}
]);
window.isOldIE = function() {
var nav, out, version;
out = false;
nav = navigator.userAgent.toLowerCase();
if (nav && nav.indexOf('msie') !== -1) {
version = parseInt(nav.split('msie')[1]);
if (version < 10) {
out = true;
}
}
return out;
};
window.isEmpty = function(obj) {
var key, val;
if (!obj) {
return true;
}
if (obj.length > 0) {
return false;
}
if (obj.length === 0) {
return true;
}
for (key in obj) {
val = obj[key];
if (Object.prototype.hasOwnProperty.call(obj, key)) {
return false;
}
}
return true;
};
| kentcdodds/cdnjs | ajax/libs/ng-token-auth/0.0.20-beta3/ng-token-auth.js | JavaScript | mit | 19,058 |
angular.module("ng-token-auth",["ngCookies"]).provider("$auth",function(){var t;return t={apiUrl:"/api",signOutUrl:"/auth/sign_out",emailSignInPath:"/auth/sign_in",emailRegistrationPath:"/auth",accountUpdatePath:"/auth",accountDeletePath:"/auth",confirmationSuccessUrl:window.location.href,passwordResetPath:"/auth/password",passwordUpdatePath:"/auth/password",passwordResetSuccessUrl:window.location.href,tokenValidationPath:"/auth/validate_token",proxyIf:function(){return!1},proxyUrl:"/proxy",validateOnPageLoad:!0,forceHardRedirect:!1,storage:"cookies",tokenFormat:{"access-token":"{{ token }}","token-type":"Bearer",client:"{{ clientId }}",expiry:"{{ expiry }}",uid:"{{ uid }}"},parseExpiry:function(t){return 1e3*parseInt(t.expiry,10)||null},handleLoginResponse:function(t){return t.data},handleAccountUpdateResponse:function(t){return t.data},handleTokenValidationResponse:function(t){return t.data},authProviderPaths:{github:"/auth/github",facebook:"/auth/facebook",google:"/auth/google_oauth2"}},{configure:function(e){return angular.extend(t,e)},$get:["$http","$q","$location","$cookieStore","$window","$timeout","$rootScope","$interpolate",function(){return function(e,r,n,s,i,a,u,o){return{header:null,dfd:null,config:t,user:{},mustResetPassword:!1,listener:null,initialize:function(){return this.initializeListeners(),this.addScopeMethods()},initializeListeners:function(){return this.listener=this.handlePostMessage.bind(this),i.addEventListener?i.addEventListener("message",this.listener,!1):void 0},cancel:function(t){return null!=this.t&&a.cancel(this.t),null!=this.dfd&&this.rejectDfd(t),a(function(t){return function(){return t.t=null}}(this),0)},destroy:function(){return this.cancel(),i.removeEventListener?i.removeEventListener("message",this.listener,!1):void 0},handlePostMessage:function(t){var e;return"deliverCredentials"===t.data.message&&(delete t.data.message,this.handleValidAuth(t.data,!0),u.$broadcast("auth:login-success",t.data)),"authFailure"===t.data.message?(e={reason:"unauthorized",errors:[t.data.error]},this.cancel(e),u.$broadcast("auth:login-error",e)):void 0},addScopeMethods:function(){return u.user=this.user,u.authenticate=function(t){return function(e,r){return t.authenticate(e,r)}}(this),u.signOut=function(t){return function(){return t.signOut()}}(this),u.destroyAccount=function(t){return function(){return t.destroyAccount()}}(this),u.submitRegistration=function(t){return function(e){return t.submitRegistration(e)}}(this),u.submitLogin=function(t){return function(e){return t.submitLogin(e)}}(this),u.requestPasswordReset=function(t){return function(e){return t.requestPasswordReset(e)}}(this),u.updatePassword=function(t){return function(e){return t.updatePassword(e)}}(this),u.updateAccount=function(t){return function(e){return t.updateAccount(e)}}(this),t.validateOnPageLoad?this.validateUser():void 0},submitRegistration:function(n){var s;return s=r.defer(),angular.extend(n,{confirm_success_url:t.confirmationSuccessUrl}),e.post(this.apiUrl()+t.emailRegistrationPath,n).success(function(t){return u.$broadcast("auth:registration-email-success",n),s.resolve(t)}).error(function(t){return u.$broadcast("auth:registration-email-error",t),s.reject(t)}),s.promise},submitLogin:function(r){return this.initDfd(),e.post(this.apiUrl()+t.emailSignInPath,r).success(function(e){return function(r){var n;return n=t.handleLoginResponse(r),e.handleValidAuth(n),u.$broadcast("auth:login-success",e.user)}}(this)).error(function(t){return function(e){return t.rejectDfd({reason:"unauthorized",errors:["Invalid credentials"]}),u.$broadcast("auth:login-error",e)}}(this)),this.dfd.promise},userIsAuthenticated:function(){return this.headers&&this.user.signedIn},requestPasswordReset:function(n){var s;return n.redirect_url=t.passwordResetSuccessUrl,s=r.defer(),e.post(this.apiUrl()+t.passwordResetPath,n).success(function(t){return u.$broadcast("auth:password-reset-request-success",n),s.resolve(t)}).error(function(t){return u.$broadcast("auth:password-reset-request-error",t),s.reject(t)}),s.promise},updatePassword:function(n){var s;return s=r.defer(),e.put(this.apiUrl()+t.passwordUpdatePath,n).success(function(t){return function(e){return u.$broadcast("auth:password-change-success",e),t.mustResetPassword=!1,s.resolve(e)}}(this)).error(function(t){return u.$broadcast("auth:password-change-error",t),s.reject(t)}),s.promise},updateAccount:function(n){var s;return s=r.defer(),e.put(this.apiUrl()+t.accountUpdatePath,n).success(function(e){return function(r){return angular.extend(e.user,t.handleAccountUpdateResponse(r)),u.$broadcast("auth:account-update-success",r),s.resolve(r)}}(this)).error(function(t){return u.$broadcast("auth:account-update-error",t),s.reject(t)}),s.promise},destroyAccount:function(n){var s;return s=r.defer(),e["delete"](this.apiUrl()+t.accountUpdatePath,n).success(function(t){return function(e){return t.invalidateTokens(),u.$broadcast("auth:account-destroy-success",e),s.resolve(e)}}(this)).error(function(t){return u.$broadcast("auth:account-destroy-error",t),s.reject(t)}),s.promise},authenticate:function(t,e){return null==this.dfd&&(this.initDfd(),this.openAuthWindow(t,e)),this.dfd.promise},openAuthWindow:function(t,e){var r;return r=this.buildAuthUrl(t,e),this.useExternalWindow()?this.requestCredentials(i.open(r)):this.visitUrl(r)},visitUrl:function(t){return i.location.replace(t)},buildAuthUrl:function(e,r){var n,s,i,a;if(null==r&&(r={}),n=t.apiUrl,n+=t.authProviderPaths[e],n+="?auth_origin_url="+window.location.href,null!=r.params){a=r.params;for(s in a)i=a[s],n+="&",n+=encodeURIComponent(s),n+="=",n+=encodeURIComponent(i)}return n},requestCredentials:function(t){return t.closed?(this.cancel({reason:"unauthorized",errors:["User canceled login"]}),u.$broadcast("auth:window-closed")):(t.postMessage("requestCredentials","*"),this.t=a(function(e){return function(){return e.requestCredentials(t)}}(this),500))},resolveDfd:function(){return this.dfd.resolve(this.user),a(function(t){return function(){return t.dfd=null,u.$$phase?void 0:u.$digest()}}(this),0)},validateUser:function(){var t,e,r;return null==this.dfd&&(this.initDfd(),this.userIsAuthenticated()?this.resolveDfd():(void 0!==n.search().token?(e=n.search().token,t=n.search().client_id,r=n.search().uid,this.mustResetPassword=n.search().reset_password,this.firstTimeLogin=n.search().account_confirmation_success,this.setAuthHeaders(this.buildAuthHeaders({token:e,clientId:t,uid:r})),n.url(n.path()||"/")):this.retrieveData("auth_headers")&&(this.headers=this.retrieveData("auth_headers")),isEmpty(this.headers)?(this.rejectDfd({reason:"unauthorized",errors:["No credentials"]}),u.$broadcast("auth:invalid")):this.validateToken())),this.dfd.promise},validateToken:function(){return this.tokenHasExpired()?this.rejectDfd({reason:"unauthorized",errors:["Expired credentials"]}):e.get(this.apiUrl()+t.tokenValidationPath).success(function(e){return function(r){var n;return n=t.handleTokenValidationResponse(r),e.handleValidAuth(n),e.firstTimeLogin&&u.$broadcast("auth:email-confirmation-success",e.user),e.mustResetPassword&&u.$broadcast("auth:password-reset-confirm-success",e.user),u.$broadcast("auth:validation-success",e.user)}}(this)).error(function(t){return function(e){return t.firstTimeLogin&&u.$broadcast("auth:email-confirmation-error",e),t.mustResetPassword&&u.$broadcast("auth:password-reset-confirm-error",e),u.$broadcast("auth:validation-error",e),t.rejectDfd({reason:"unauthorized",errors:e.errors})}}(this))},tokenHasExpired:function(){var t,e;return t=this.getExpiry(),e=(new Date).getTime(),this.headers&&t?t&&e>t:null},getExpiry:function(){return t.parseExpiry(this.headers)},invalidateTokens:function(){var t,e,r;r=this.user;for(t in r)e=r[t],delete this.user[t];return this.headers=null,this.deleteData("auth_headers")},signOut:function(){var n;return n=r.defer(),e["delete"](this.apiUrl()+t.signOutUrl).success(function(t){return function(e){return t.invalidateTokens(),u.$broadcast("auth:logout-success"),n.resolve(e)}}(this)).error(function(t){return function(e){return t.invalidateTokens(),u.$broadcast("auth:logout-error",e),n.reject(e)}}(this)),n.promise},handleValidAuth:function(t,e){return null==e&&(e=!1),null!=this.t&&a.cancel(this.t),angular.extend(this.user,t),this.user.signedIn=!0,e&&this.setAuthHeaders(this.buildAuthHeaders({token:this.user.auth_token,clientId:this.user.client_id,uid:this.user.uid})),this.resolveDfd()},buildAuthHeaders:function(e){var r,n,s,i;r={},i=t.tokenFormat;for(n in i)s=i[n],r[n]=o(s)(e);return r},persistData:function(e,r){switch(t.storage){case"localStorage":return i.localStorage.setItem(e,JSON.stringify(r));default:return s.put(e,r)}},retrieveData:function(e){switch(t.storage){case"localStorage":return JSON.parse(i.localStorage.getItem(e));default:return s.get(e)}},deleteData:function(e){switch(t.storage){case"localStorage":return i.localStorage.removeItem(e);default:return s.remove(e)}},setAuthHeaders:function(t){return this.headers=angular.extend(this.headers||{},t),this.persistData("auth_headers",this.headers)},useExternalWindow:function(){return!(t.forceHardRedirect||i.isIE())},initDfd:function(){return this.dfd=r.defer()},rejectDfd:function(t){return this.invalidateTokens(),null!=this.dfd?(this.dfd.reject(t),a(function(t){return function(){return t.dfd=null}}(this),0)):void 0},apiUrl:function(){return t.proxyIf()?t.proxyUrl:t.apiUrl}}}}(this)]}}).config(["$httpProvider",function(t){var e;return t.interceptors.push(["$injector",function(t){return{request:function(e){return t.invoke(["$http","$auth",function(t,r){var n,s,i,a;if(e.url.match(r.apiUrl())){i=r.headers,a=[];for(n in i)s=i[n],a.push(e.headers[n]=s);return a}}]),e},response:function(e){return t.invoke(["$http","$auth",function(t,r){var n,s,i,a;if(e.config.url.match(r.apiUrl())){s={},a=r.config.tokenFormat;for(n in a)i=a[n],e.headers(n)&&(s[n]=e.headers(n));return r.setAuthHeaders(s)}}]),e}}}]),e=["get","post","put","patch","delete"],angular.forEach(e,function(e){var r;return null==(r=t.defaults.headers)[e]&&(r[e]={}),t.defaults.headers[e]["If-Modified-Since"]="0"})}]).run(["$auth","$window","$rootScope",function(t){return t.initialize()}]),window.isOldIE=function(){var t,e,r;return e=!1,t=navigator.userAgent.toLowerCase(),t&&-1!==t.indexOf("msie")&&(r=parseInt(t.split("msie")[1]),10>r&&(e=!0)),e},window.isIE=function(){var t;return t=navigator.userAgent.toLowerCase(),t&&-1!==t.indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv\:11\./)},window.isEmpty=function(t){var e,r;if(!t)return!0;if(t.length>0)return!1;if(0===t.length)return!0;for(e in t)if(r=t[e],Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}; | yinghunglai/cdnjs | ajax/libs/ng-token-auth/0.0.22-beta2/ng-token-auth.min.js | JavaScript | mit | 10,646 |
"use strict";
exports.__esModule = true;
var _typeof2 = require("babel-runtime/helpers/typeof");
var _typeof3 = _interopRequireDefault(_typeof2);
exports.default = function (loc) {
var relative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
if ((typeof _module2.default === "undefined" ? "undefined" : (0, _typeof3.default)(_module2.default)) === "object") return null;
var relativeMod = relativeModules[relative];
if (!relativeMod) {
relativeMod = new _module2.default();
var filename = _path2.default.join(relative, ".babelrc");
relativeMod.id = filename;
relativeMod.filename = filename;
relativeMod.paths = _module2.default._nodeModulePaths(relative);
relativeModules[relative] = relativeMod;
}
try {
return _module2.default._resolveFilename(loc, relativeMod);
} catch (err) {
return null;
}
};
var _module = require("module");
var _module2 = _interopRequireDefault(_module);
var _path = require("path");
var _path2 = _interopRequireDefault(_path);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var relativeModules = {};
module.exports = exports["default"]; | galenscook/algorithms | javascript/node_modules/babel-register/node_modules/babel-core/lib/helpers/resolve.js | JavaScript | mit | 1,214 |
/*
Copyright (c) 2004-2009, The Dojo Foundation All Rights Reserved.
Available via Academic Free License >= 2.1 OR the modified BSD license.
see: http://dojotoolkit.org/license for details
*/
if(!dojo._hasResource["dojo.i18n"]){
dojo._hasResource["dojo.i18n"]=true;
dojo.provide("dojo.i18n");
dojo.i18n.getLocalization=function(_1,_2,_3){
_3=dojo.i18n.normalizeLocale(_3);
var _4=_3.split("-");
var _5=[_1,"nls",_2].join(".");
var _6=dojo._loadedModules[_5];
if(_6){
var _7;
for(var i=_4.length;i>0;i--){
var _9=_4.slice(0,i).join("_");
if(_6[_9]){
_7=_6[_9];
break;
}
}
if(!_7){
_7=_6.ROOT;
}
if(_7){
var _a=function(){
};
_a.prototype=_7;
return new _a();
}
}
throw new Error("Bundle not found: "+_2+" in "+_1+" , locale="+_3);
};
dojo.i18n.normalizeLocale=function(_b){
var _c=_b?_b.toLowerCase():dojo.locale;
if(_c=="root"){
_c="ROOT";
}
return _c;
};
dojo.i18n._requireLocalization=function(_d,_e,_f,_10){
var _11=dojo.i18n.normalizeLocale(_f);
var _12=[_d,"nls",_e].join(".");
var _13="";
if(_10){
var _14=_10.split(",");
for(var i=0;i<_14.length;i++){
if(_11["indexOf"](_14[i])==0){
if(_14[i].length>_13.length){
_13=_14[i];
}
}
}
if(!_13){
_13="ROOT";
}
}
var _16=_10?_13:_11;
var _17=dojo._loadedModules[_12];
var _18=null;
if(_17){
if(dojo.config.localizationComplete&&_17._built){
return;
}
var _19=_16.replace(/-/g,"_");
var _1a=_12+"."+_19;
_18=dojo._loadedModules[_1a];
}
if(!_18){
_17=dojo["provide"](_12);
var _1b=dojo._getModuleSymbols(_d);
var _1c=_1b.concat("nls").join("/");
var _1d;
dojo.i18n._searchLocalePath(_16,_10,function(loc){
var _1f=loc.replace(/-/g,"_");
var _20=_12+"."+_1f;
var _21=false;
if(!dojo._loadedModules[_20]){
dojo["provide"](_20);
var _22=[_1c];
if(loc!="ROOT"){
_22.push(loc);
}
_22.push(_e);
var _23=_22.join("/")+".js";
_21=dojo._loadPath(_23,null,function(_24){
var _25=function(){
};
_25.prototype=_1d;
_17[_1f]=new _25();
for(var j in _24){
_17[_1f][j]=_24[j];
}
});
}else{
_21=true;
}
if(_21&&_17[_1f]){
_1d=_17[_1f];
}else{
_17[_1f]=_1d;
}
if(_10){
return true;
}
});
}
if(_10&&_11!=_13){
_17[_11.replace(/-/g,"_")]=_17[_13.replace(/-/g,"_")];
}
};
(function(){
var _27=dojo.config.extraLocale;
if(_27){
if(!_27 instanceof Array){
_27=[_27];
}
var req=dojo.i18n._requireLocalization;
dojo.i18n._requireLocalization=function(m,b,_2b,_2c){
req(m,b,_2b,_2c);
if(_2b){
return;
}
for(var i=0;i<_27.length;i++){
req(m,b,_27[i],_2c);
}
};
}
})();
dojo.i18n._searchLocalePath=function(_2e,_2f,_30){
_2e=dojo.i18n.normalizeLocale(_2e);
var _31=_2e.split("-");
var _32=[];
for(var i=_31.length;i>0;i--){
_32.push(_31.slice(0,i).join("-"));
}
_32.push(false);
if(_2f){
_32.reverse();
}
for(var j=_32.length-1;j>=0;j--){
var loc=_32[j]||"ROOT";
var _36=_30(loc);
if(_36){
break;
}
}
};
dojo.i18n._preloadLocalizations=function(_37,_38){
function _39(_3a){
_3a=dojo.i18n.normalizeLocale(_3a);
dojo.i18n._searchLocalePath(_3a,true,function(loc){
for(var i=0;i<_38.length;i++){
if(_38[i]==loc){
dojo["require"](_37+"_"+loc);
return true;
}
}
return false;
});
};
_39();
var _3d=dojo.config.extraLocale||[];
for(var i=0;i<_3d.length;i++){
_39(_3d[i]);
}
};
}
| iskitz/cdnjs | ajax/libs/dojo/1.3.3/i18n.js | JavaScript | mit | 3,100 |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Finder\Tests\Expression;
use Symfony\Component\Finder\Expression\Expression;
class RegexTest extends \PHPUnit_Framework_TestCase
{
/**
* @dataProvider getHasFlagsData
*/
public function testHasFlags($regex, $start, $end)
{
$expr = new Expression($regex);
$this->assertEquals($start, $expr->getRegex()->hasStartFlag());
$this->assertEquals($end, $expr->getRegex()->hasEndFlag());
}
/**
* @dataProvider getHasJokersData
*/
public function testHasJokers($regex, $start, $end)
{
$expr = new Expression($regex);
$this->assertEquals($start, $expr->getRegex()->hasStartJoker());
$this->assertEquals($end, $expr->getRegex()->hasEndJoker());
}
/**
* @dataProvider getSetFlagsData
*/
public function testSetFlags($regex, $start, $end, $expected)
{
$expr = new Expression($regex);
$expr->getRegex()->setStartFlag($start)->setEndFlag($end);
$this->assertEquals($expected, $expr->render());
}
/**
* @dataProvider getSetJokersData
*/
public function testSetJokers($regex, $start, $end, $expected)
{
$expr = new Expression($regex);
$expr->getRegex()->setStartJoker($start)->setEndJoker($end);
$this->assertEquals($expected, $expr->render());
}
public function testOptions()
{
$expr = new Expression('~abc~is');
$expr->getRegex()->removeOption('i')->addOption('m');
$this->assertEquals('~abc~sm', $expr->render());
}
public function testMixFlagsAndJokers()
{
$expr = new Expression('~^.*abc.*$~is');
$expr->getRegex()->setStartFlag(false)->setEndFlag(false)->setStartJoker(false)->setEndJoker(false);
$this->assertEquals('~abc~is', $expr->render());
$expr->getRegex()->setStartFlag(true)->setEndFlag(true)->setStartJoker(true)->setEndJoker(true);
$this->assertEquals('~^.*abc.*$~is', $expr->render());
}
/**
* @dataProvider getReplaceJokersTestData
*/
public function testReplaceJokers($regex, $expected)
{
$expr = new Expression($regex);
$expr = $expr->getRegex()->replaceJokers('@');
$this->assertEquals($expected, $expr->renderPattern());
}
public function getHasFlagsData()
{
return array(
array('~^abc~', true, false),
array('~abc$~', false, true),
array('~abc~', false, false),
array('~^abc$~', true, true),
array('~^abc\\$~', true, false),
);
}
public function getHasJokersData()
{
return array(
array('~.*abc~', true, false),
array('~abc.*~', false, true),
array('~abc~', false, false),
array('~.*abc.*~', true, true),
array('~.*abc\\.*~', true, false),
);
}
public function getSetFlagsData()
{
return array(
array('~abc~', true, false, '~^abc~'),
array('~abc~', false, true, '~abc$~'),
array('~abc~', false, false, '~abc~'),
array('~abc~', true, true, '~^abc$~'),
);
}
public function getSetJokersData()
{
return array(
array('~abc~', true, false, '~.*abc~'),
array('~abc~', false, true, '~abc.*~'),
array('~abc~', false, false, '~abc~'),
array('~abc~', true, true, '~.*abc.*~'),
);
}
public function getReplaceJokersTestData()
{
return array(
array('~.abc~', '@abc'),
array('~\\.abc~', '\\.abc'),
array('~\\\\.abc~', '\\\\@abc'),
array('~\\\\\\.abc~', '\\\\\\.abc'),
);
}
}
| lorocod/GemaAdmin | vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Expression/RegexTest.php | PHP | mit | 4,001 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.