var B64={alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",lookup:null,ie:/MSIE /.test(navigator.userAgent),ieo:/MSIE [67]/.test(navigator.userAgent),encode:function(e){var t=B64.toUtf8(e),n=-1,r=t.length,i,s,o=[,,,];if(B64.ie){var u=[];while(++n<r){i=t[n+1],s=t[n+2];o[0]=t[n]>>2;o[1]=(t[n]&3)<<4|t[++n]>>4;if(isNaN(i))o[2]=o[3]=64;else{o[2]=(t[n]&15)<<2|t[++n]>>6;o[3]=isNaN(s)?64:t[n]&63}u.push(B64.alphabet[o[0]],B64.alphabet[o[1]],B64.alphabet[o[2]],B64.alphabet[o[3]])}return u.join("")}else{u="";while(++n<r){i=t[n+1],s=t[n+2];o[0]=t[n]>>2;o[1]=(t[n]&3)<<4|t[++n]>>4;if(isNaN(i))o[2]=o[3]=64;else{o[2]=(t[n]&15)<<2|t[++n]>>6;o[3]=isNaN(s)?64:t[n]&63}u+=B64.alphabet[o[0]]+B64.alphabet[o[1]]+B64.alphabet[o[2]]+B64.alphabet[o[3]]}return u}},decode:function(e){var t=B64.fromUtf8(e),n=0,r=t.length;if(B64.ieo){result=[];while(n<r){if(t[n]<128)result.push(String.fromCharCode(t[n++]));else if(t[n]>191&&t[n]<224)result.push(String.fromCharCode((t[n++]&31)<<6|t[n++]&63));else result.push(String.fromCharCode((t[n++]&15)<<12|(t[n++]&63)<<6|t[n++]&63))}return result.join("")}else{result="";while(n<r){if(t[n]<128)result+=String.fromCharCode(t[n++]);else if(t[n]>191&&t[n]<224)result+=String.fromCharCode((t[n++]&31)<<6|t[n++]&63);else result+=String.fromCharCode((t[n++]&15)<<12|(t[n++]&63)<<6|t[n++]&63)}return result}},toUtf8:function(e){var t=-1,n=e.length,r,i=[];if(/^[\x00-\x7f]*$/.test(e))while(++t<n)i.push(e.charCodeAt(t));else while(++t<n){r=e.charCodeAt(t);if(r<128)i.push(r);else if(r<2048)i.push(r>>6|192,r&63|128);else i.push(r>>12|224,r>>6&63|128,r&63|128)}return i},fromUtf8:function(e){var t=-1,n,r=[],i=[,,,];if(!B64.lookup){n=B64.alphabet.length;B64.lookup={};while(++t<n)B64.lookup[B64.alphabet[t]]=t;t=-1}n=e.length;while(t<n){i[0]=B64.lookup[e.charAt(++t)];i[1]=B64.lookup[e.charAt(++t)];r.push(i[0]<<2|i[1]>>4);i[2]=B64.lookup[e.charAt(++t)];if(i[2]==64)break;r.push((i[1]&15)<<4|i[2]>>2);i[3]=B64.lookup[e.charAt(++t)];if(i[3]==64)break;r.push((i[2]&3)<<6|i[3])}return r}}