function q(t){throw t}define("keymaster",(function(){return(function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)})({"./keymaster.js":function(t,e,n){(function(e){if(window.key)return e.key=window.key,void(t.exports=e.key);var n,r={},o={16:!1,18:!1,17:!1,91:!1},s="all",i={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},a={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},c=function(t){return a[t]||t.toUpperCase().charCodeAt(0)};for(n=1;n<20;n++)a["f"+n]=111+n;function l(t,e){for(var n=t.length;n--;)if(t[n]===e)return n;return-1}function u(){for(n in o)o.hasOwnProperty(n)&&(o[n]=!1)}function d(t,e,n){var o,s,c,l;for(void 0===n&&(n=e,e="all"),""==(o=(t=t.replace(/\s/g,"")).split(","))[o.length-1]&&(o[o.length-2]+=","),c=0;c1){for(s=t.slice(0,t.length-1),l=0;l0,o)(!o[a]&&l(n.mods,+a)>-1||o[a]&&-1==l(n.mods,+a))&&(u=!1);(0!=n.mods.length||o[16]||o[18]||o[17]||o[91])&&!u||!1===n.method(t,n)&&(t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopPropagation&&t.stopPropagation(),t.cancelBubble&&(t.cancelBubble=!0))}})),y(document,"keyup",(function(t){var e,n=t.keyCode;if(93!=n&&224!=n||(n=91),n in o)for(e in o[n]=!1,i)i[e]==n&&(d[e]=!1)})),y(window,"focus",u),y(document,"contextmenu",u),e.key=d,e.key.setScope=m,e.key.getScope=f,e.key.clear=function(){r={},m(),u()},e.key.clearScope=function(t){for(var e in r)if(r.hasOwnProperty(e))for(var n=0;n1&&(d=h(i)),o=i[i.length-1],o=c(o),void 0===e&&(e=f()),!r[o])return;for(a=0;a_)throw Error("numRounds must a integer >= 1");if("SHA-1"!==t)throw Error("Chosen SHA variant is not supported");f=512,h=g,v=y,m=160,b=function(t){return t.slice()},o=p(t),this.setHMACKey=function(e,n,s){var i;if(!0===A)throw Error("HMAC key already set");if(!0===x)throw Error("Cannot set HMAC key after calling update");if(e=(n=d(n,r=(s||{}).encoding||"UTF8")(e)).binLen,n=n.value,s=(i=f>>>3)/4-1,ie/8){for(;n.length<=s;)n.push(0);n[s]&=4294967040}for(e=0;e<=s;e+=1)C[e]=909522486^n[e],E[e]=1549556828^n[e];o=h(C,o),w=f,A=!0},this.update=function(t){var e,n,r,i=0,a=f>>>5;for(t=(e=s(t,j,k)).binLen,n=e.value,e=t>>>5,r=0;r>>5),k=t%f,x=!0},this.getHash=function(e,n){var r,s,d,f;if(!0===A)throw Error("Cannot call getHash after setting HMAC key");switch(d=u(n),e){case"HEX":r=function(t){return i(t,m,d)};break;case"B64":r=function(t){return a(t,m,d)};break;case"BYTES":r=function(t){return c(t,m)};break;case"ARRAYBUFFER":try{s=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}r=function(t){return l(t,m)};break;default:throw Error("format must be HEX, B64, BYTES, or ARRAYBUFFER")}for(f=v(j.slice(),k,w,b(o),m),s=1;s<_;s+=1)f=v(f,m,0,p(t),m);return r(f)},this.getHMAC=function(e,n){var r,s,d,g;if(!1===A)throw Error("Cannot call getHMAC without first setting HMAC key");switch(d=u(n),e){case"HEX":r=function(t){return i(t,m,d)};break;case"B64":r=function(t){return a(t,m,d)};break;case"BYTES":r=function(t){return c(t,m)};break;case"ARRAYBUFFER":try{r=new ArrayBuffer(0)}catch(t){throw Error("ARRAYBUFFER not supported by this environment")}r=function(t){return l(t,m)};break;default:throw Error("outputFormat must be HEX, B64, BYTES, or ARRAYBUFFER")}return s=v(j.slice(),k,w,b(o),m),g=h(E,p(t)),r(g=v(s,m,f,g,m))}}function n(t,e,n){var r,o,s,i,a,c=t.length;if(e=e||[0],a=(n=n||0)>>>3,0!=c%2)throw Error("String of HEX type must be in byte increments");for(r=0;r>>1)+a)>>>2;e.length<=s;)e.push(0);e[s]|=o<<8*(3-i%4)}return{value:e,binLen:4*c+n}}function r(t,e,n){var r,o,s,i,a=[];a=e||[0];for(o=(n=n||0)>>>3,r=0;r>>2,a.length<=s&&a.push(0),a[s]|=e<<8*(3-i%4);return{value:a,binLen:8*t.length+n}}function o(t,e,n){var r,o,s,i,a,c,l=[],u=0;l=e||[0];if(e=(n=n||0)>>>3,-1===t.search(/^[a-zA-Z0-9=+\/]+$/))throw Error("Invalid character in base-64 string");if(o=t.indexOf("="),t=t.replace(/\=/g,""),-1!==o&&o>>s),a=r<<32-s):a^=r<<32-(s+=6);return 56&s&&o.push(sjcl.bitArray.partial(56&s,a,1)),o}},sjcl.codec.base64url={fromBits:function(t){return sjcl.codec.base64.fromBits(t,1,1)},toBits:function(t){return sjcl.codec.base64.toBits(t,1)}},sjcl.hash.sha256=function(t){this.b[0]||this.D(),t?(this.r=t.r.slice(0),this.o=t.o.slice(0),this.h=t.h):this.reset()},sjcl.hash.sha256.hash=function(t){return(new sjcl.hash.sha256).update(t).finalize()},sjcl.hash.sha256.prototype={blockSize:512,reset:function(){return this.r=this.N.slice(0),this.o=[],this.h=0,this},update:function(t){"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t));var e,n=this.o=sjcl.bitArray.concat(this.o,t);for(e=this.h,t=this.h=e+sjcl.bitArray.bitLength(t),e=512+e&-512;e<=t;e+=512)x(this,n.splice(0,16));return this},finalize:function(){var t,e=this.o,n=this.r;for(t=(e=sjcl.bitArray.concat(e,[sjcl.bitArray.partial(1,1)])).length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this.h/4294967296)),e.push(0|this.h);e.length;)x(this,e.splice(0,16));return this.reset(),n},N:[],b:[],D:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}var e,n=0,r=2;t:for(;64>n;r++){for(e=2;e*e<=r;e++)if(0==r%e)continue t;8>n&&(this.N[n]=t(Math.pow(r,.5))),this.b[n]=t(Math.pow(r,1/3)),n++}}},sjcl.mode.ccm={name:"ccm",encrypt:function(t,e,n,r,o){var s,i=e.slice(0),a=sjcl.bitArray,c=a.bitLength(n)/8,l=a.bitLength(i)/8;for(o=o||64,r=r||[],7>c&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),s=2;4>s&&l>>>8*s;s++);return s<15-c&&(s=15-c),n=a.clamp(n,8*(15-s)),e=sjcl.mode.ccm.L(t,e,n,r,o,s),i=sjcl.mode.ccm.p(t,i,n,e,o,s),a.concat(i.data,i.tag)},decrypt:function(t,e,n,r,o){o=o||64,r=r||[];var s=sjcl.bitArray,i=s.bitLength(n)/8,a=s.bitLength(e),c=s.clamp(e,a-o),l=s.bitSlice(e,a-o);a=(a-o)/8;for(7>i&&q(new sjcl.exception.invalid("ccm: iv must be at least 7 bytes")),e=2;4>e&&a>>>8*e;e++);return e<15-i&&(e=15-i),n=s.clamp(n,8*(15-e)),c=sjcl.mode.ccm.p(t,c,n,l,o,e),t=sjcl.mode.ccm.L(t,c.data,n,r,o,e),s.equal(c.tag,t)||q(new sjcl.exception.corrupt("ccm: tag doesn't match")),c.data},L:function(t,e,n,r,o,s){var i=[],a=sjcl.bitArray,c=a.l;if(((o/=8)%2||4>o||16=(n=a.bitLength(r)/8)?i=[a.partial(16,n)]:4294967295>=n&&(i=a.concat([a.partial(16,65534)],[n])),i=a.concat(i,r),r=0;ro.bitLength(n)&&(a=s(a,r(a)),n=o.concat(n,[-2147483648,0,0,0])),i=s(i,n),t.encrypt(s(r(s(a,r(a))),i))},H:function(t){return[t[0]<<1^t[1]>>>31,t[1]<<1^t[2]>>>31,t[2]<<1^t[3]>>>31,t[3]<<1^135*(t[0]>>>31)]}},sjcl.mode.gcm={name:"gcm",encrypt:function(t,e,n,r,o){var s=e.slice(0);return e=sjcl.bitArray,r=r||[],t=sjcl.mode.gcm.p(!0,t,s,r,n,o||128),e.concat(t.data,t.tag)},decrypt:function(t,e,n,r,o){var s=e.slice(0),i=sjcl.bitArray,a=i.bitLength(s);return r=r||[],(o=o||128)<=a?(e=i.bitSlice(s,a-o),s=i.bitSlice(s,0,a-o)):(e=s,s=[]),t=sjcl.mode.gcm.p(u,t,s,r,n,o),i.equal(t.tag,e)||q(new sjcl.exception.corrupt("gcm: tag doesn't match")),t.data},Z:function(t,e){var n,r,o,s,i,a=sjcl.bitArray.l;for(o=[0,0,0,0],s=e.slice(0),n=0;128>n;n++){for((r=0!=(t[Math.floor(n/32)]&1<<31-n%32))&&(o=a(o,s)),i=0!=(1&s[3]),r=3;0>>1|(1&s[r-1])<<31;s[0]>>>=1,i&&(s[0]^=-520093696)}return o},g:function(t,e,n){var r,o=n.length;for(e=e.slice(0),r=0;ro&&(t=e.hash(t)),n=0;nr||0>n)&&q(sjcl.exception.invalid("invalid params to pbkdf2")),"string"==typeof t&&(t=sjcl.codec.utf8String.toBits(t)),"string"==typeof e&&(e=sjcl.codec.utf8String.toBits(e)),t=new(o=o||sjcl.misc.hmac)(t);var s,i,a,c,l=[],u=sjcl.bitArray;for(c=1;32*l.length<(r||1);c++){for(o=s=t.encrypt(u.concat(e,[c])),i=1;is;s++)r.push(4294967296*Math.random()|0);for(s=0;s=1<this.j&&(this.j=i),this.F++,this.b=sjcl.hash.sha256.hash(this.b.concat(r)),this.A=new sjcl.cipher.aes(this.b),n=0;4>n&&(this.f[n]=this.f[n]+1|0,!this.f[n]);n++);}for(n=0;n>>=1;this.c[a].update([r,this.C++,2,e,i,t.length].concat(t))}break;case"string":e===s&&(e=t.length),this.c[a].update([r,this.C++,3,e,i,t.length]),this.c[a].update(t);break;default:l=1}l&&q(new sjcl.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.i[a]+=e,this.d+=e,c===this.m&&(this.isReady()!==this.m&&C("seeded",Math.max(this.j,this.d)),C("progress",this.getProgress()))},isReady:function(t){return t=this.I[t!==s?t:this.B],this.j&&this.j>=t?this.i[0]>this.R&&(new Date).valueOf()>this.O?this.u|this.t:this.t:this.d>=t?this.u|this.m:this.m},getProgress:function(t){return t=this.I[t||this.B],this.j>=t?1:this.d>t?1:this.d/t},startCollectors:function(){this.q||(this.a={loadTimeCollector:D(this,this.aa),mouseCollector:D(this,this.ba),keyboardCollector:D(this,this.$),accelerometerCollector:D(this,this.U),touchCollector:D(this,this.da)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,u),window.addEventListener("mousemove",this.a.mouseCollector,u),window.addEventListener("keypress",this.a.keyboardCollector,u),window.addEventListener("devicemotion",this.a.accelerometerCollector,u),window.addEventListener("touchmove",this.a.touchCollector,u)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):q(new sjcl.exception.bug("can't attach event")),this.q=!0)},stopCollectors:function(){this.q&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,u),window.removeEventListener("mousemove",this.a.mouseCollector,u),window.removeEventListener("keypress",this.a.keyboardCollector,u),window.removeEventListener("devicemotion",this.a.accelerometerCollector,u),window.removeEventListener("touchmove",this.a.touchCollector,u)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.q=u)},addEventListener:function(t,e){this.w[t][this.V++]=e},removeEventListener:function(t,e){var n,r,o=this.w[t],s=[];for(r in o)o.hasOwnProperty(r)&&o[r]===e&&s.push(r);for(n=0;n=i.iter||64!==i.ts&&96!==i.ts&&128!==i.ts||128!==i.ks&&192!==i.ks&&256!==i.ks||2>i.iv.length||4=e.iter||64!==e.ts&&96!==e.ts&&128!==e.ts||128!==e.ks&&192!==e.ks&&256!==e.ks||!e.iv||2>e.iv.length||4=3)return c(t.getMonth(),3===e.length);r=t.getMonth()+1;break;case"d":r=t.getDate();break;case"h":r=t.getHours()%12||12;break;case"k":r=t.getHours()%12+1;break;case"K":r=t.getHours()%12;break;case"H":r=t.getHours();break;case"m":r=t.getMinutes();break;case"s":r=t.getSeconds();break;case"S":r=t.getMilliseconds();break;case"a":var o=void 0;return o=t.getHours()>=12?1:0,n[o]}return(r=""+r).length=r)return{unit:n,value:Math.floor(t/r)}}return{unit:4,value:0}}function h(t,e,n){return void 0===n&&(n=!0),n?s._("%(month)s %(year)s",{comment:"Like Jun 2012"}).format({month:c(t,!0),year:e}):s._("%(month)s %(year)s",{comment:'Like Jun 2012. If this string begins with a fixed letter, not a placeholder, it should not be capitalized so that it may be inserted into the middle of a sentence. For example, "%(user_name)s viewed %(ago)s", where this string can be substituted for %(ago).'}).format({month:c(t,!0),year:e})}function p(t,e,n,r){void 0===n&&(n=!1),void 0===r&&(r=i.USER_LOCALE||"");var o=r.replace("_","-");return new Intl.DateTimeFormat(o,{year:e?"numeric":void 0,day:"numeric",month:n?"long":"short"}).format(t)}function g(t,e,n,r,o,i){void 0===n&&(n=!0),void 0===r&&(r=!1),void 0===o&&(o=!1),void 0===i&&(i=!1);var c=Number(e)-Number(t);if(c<6e4){if(i){var l=Math.floor(c/1e3);return r?n?s.ungettext("%(secs)s sec ago","%(secs)s secs ago",l).format({secs:l}):s.ungettext("%(secs)s sec ago","%(secs)s secs ago",l,{comment:'If this string begins with a letter, it should not be capitalized so that it may be inserted into the middle of a sentence. For example, "%(user_name)s viewed %(ago)s", where this string can be substituted for %(ago).'}).format({secs:l}):n?s.ungettext("%(secs)s second ago","%(secs)s seconds ago",l).format({secs:l}):s.ungettext("%(secs)s second ago","%(secs)s seconds ago",l,{comment:'If this string begins with a letter, it should not be capitalized so that it may be inserted into the middle of a sentence. For example, "%(user_name)s viewed %(ago)s", where this string can be substituted for %(ago).'}).format({secs:l})}return o?n?s._("A moment ago"):s._("a moment ago"):n?s._("Just now"):s._("just now")}if(c<36e5){var u=Math.floor(c/6e4);return n?s.ungettext("%(mins)s min ago","%(mins)s mins ago",u).format({mins:u}):s.ungettext("%(mins)s min ago","%(mins)s mins ago",u,{comment:'If this string begins with a letter, it should not be capitalized so that it may be inserted into the middle of a sentence. For example, "%(user_name)s viewed %(ago)s", where this string can be substituted for %(ago).'}).format({mins:u})}if(c0&&m<1e3*o)return g(u,l,a,n,e,i);if(f||m<6e4)return e?a?s._("A moment ago",{comment:"Like 'A moment ago'"}):s._("a moment ago",{comment:"Like 'a moment ago'"}):a?s._("Just now",{comment:"Like 'Just now'"}):s._("just now",{comment:"Like 'just now'"});y(u,r.TIMEZONE_OFFSET);var h=(function(t,e){var n=new Date(e.getTime());y(n,r.TIMEZONE_OFFSET);var o=new Date(n.getTime());return o.setUTCDate(o.getUTCDate()-1),{isToday:v(t,n),isYesterday:v(t,o)}})(u,l),b=h.isToday,_=h.isYesterday,w=d(u,r.TIME_FORMAT);if(b)return n?c?a?s._("Today %(time)s",{comment:"Like 'Today 3:00 PM'"}).format({time:w}):s._("today %(time)s",{comment:"Like 'today 3:00 PM'"}).format({time:w}):a?s._("Today, %(time)s",{comment:"Like 'Today, 3:00 PM'"}).format({time:w}):s._("today, %(time)s",{comment:"Like 'today, 3:00 PM'"}).format({time:w}):a?s._("Today at %(time)s",{comment:"Like 'Today at 3:00 PM'"}).format({time:w}):s._("today at %(time)s",{comment:"Like 'today at 3:00 PM'"}).format({time:w});if(_)return n?c?a?s._("Yesterday %(time)s",{comment:"Like 'Yesterday 3:00 PM'"}).format({time:w}):s._("yesterday %(time)s",{comment:"Like 'yesterday 3:00 PM'"}).format({time:w}):a?s._("Yesterday, %(time)s",{comment:"Like 'Yesterday, 3:00 PM'"}).format({time:w}):s._("yesterday, %(time)s",{comment:"Like 'yesterday, 3:00 PM'"}).format({time:w}):a?s._("Yesterday at %(time)s",{comment:"Like 'Yesterday at 3:00 PM'"}).format({time:w}):s._("yesterday at %(time)s",{comment:"Like 'yesterday at 3:00 PM'"}).format({time:w});var j=d(u,r.DATE_FORMAT);return n?c?s._("%(date)s %(time)s",{comment:"Like '08/20/2015 3:00 PM'"}).format({time:w,date:j}):s._("%(date)s, %(time)s",{comment:"Like '08/20/2015, 3:00 PM'"}).format({time:w,date:j}):(j=p(t,u.getUTCFullYear()!==l.getUTCFullYear(),!0),a?s._("On %(date)s",{comment:"Like 'On August 20, 2015'"}).format({date:j}):s._("on %(date)s",{comment:"Like 'on August 20, 2015'"}).format({date:j}))}function _(t,e,n,r,o,s){return null==e&&(e=0),null==n&&(n=0),null==r&&(r=0),null==o&&(o=0),null==s&&(s=0),t.setFullYear(t.getFullYear()+e),t.setMonth(t.getMonth()+n),t.setDate(t.getDate()+r),t.setHours(t.getHours()+o),t.setMinutes(t.getMinutes()+s),t}e.month_names=[s._("January"),s._("February"),s._("March"),s._("April"),s._("May"),s._("June"),s._("July"),s._("August"),s._("September"),s._("October"),s._("November"),s._("December")],e.abbr_month_names=[s._("Jan"),s._("Feb"),s._("Mar"),s._("Apr"),s._("May"),s._("Jun"),s._("Jul"),s._("Aug"),s._("Sep"),s._("Oct"),s._("Nov"),s._("Dec")],e.month_name=c,e.format_date=l,e.format_date_utc=d,e.format_date_timezone_offset=function(t,e){return l(m(t),e)},e.month_abbr_with_day_with_offset=function(t){var e=i.USER_LOCALE.replace("_","-");return m(t).toLocaleDateString(e,{month:"short",day:"numeric"})},e.format_time=function(t){var e=f(t),n=e.unit,r=e.value,i={comment:"time short form, e.g. 1 sec, 3 secs, 35 min, 5 hours, 1 day"},a="";return n>=3?a=s.ungettext("%(value)s sec","%(value)s secs",r,i).format({value:r}):2===n?a=s.ungettext("%(value)s min","%(value)s mins",r,i).format({value:r}):1===n?a=s.ungettext("%(value)s hour","%(value)s hours",r,i).format({value:r}):0===n?a=s.ungettext("%(value)s day","%(value)s days",r,i).format({value:r}):o.assert(!1,"Invalid time"),a},e.format_time_remaining=function(t){var e=f(t),n=e.unit,r=e.value,i={comment:"time remaining short form, e.g. 1 sec left, 3 secs left, 35 min left, 5 hours left, 1 day left"},a="";return n>=3?a=s.ungettext("%(value)s sec left","%(value)s secs left",r,i).format({value:r}):2===n?a=s.ungettext("%(value)s min left","%(value)s mins left",r,i).format({value:r}):1===n?a=s.ungettext("%(value)s hour left","%(value)s hours left",r,i).format({value:r}):0===n?a=s.ungettext("%(value)s day left","%(value)s days left",r,i).format({value:r}):o.assert(!1,"Invalid time"),a},e.formatAudioTime=function(t){var e=Math.floor(t);e<0&&(e=0);var n=function(t){return t<10?"0"+t:t.toString()},r=":"+n(e%60);return r=n((e=Math.floor(e/60))%60)+r,(e=Math.floor(e/60))>0&&(r=e.toString()+":"+r),r},e.getTimeBands=function(t){var e=new Date(t);e.setHours(0,0,0,0);var n=new Date(e.getFullYear(),0,1).getTime(),r=e.getTime(),o=r-864e5,s=new Date(t);0===e.getDay()?s.setDate(e.getDate()-7):s.setDate(e.getDate()-e.getDay()-1),s.setHours(0);var i=s.getTime(),a=i-6048e5;e.setDate(1);var c=e.getTime();e.setMonth(e.getMonth()-1);var l=e.getTime();return e.setMonth(e.getMonth()-3),{today:r,yesterday:o,thisWeek:i,lastWeek:a,thisMonth:c,lastMonth:l,lastThreeMonths:e.getTime(),thisYear:n}},e.month_abbr_with_year=h,e.month_with_year=function(t,e,n){return void 0===n&&(n=!0),n?s._("%(month)s %(year)s",{comment:"Month and Year, like December 2012"}).format({month:c(t,!1),year:e}):s._("%(month)s %(year)s",{comment:'Month and Year, like December 2012. If this string begins with a fixed letter, not a placeholder, it should not be capitalized so that it may be inserted into the middle of a sentence. For example, "%(user_name)s viewed %(ago)s", where this string can be substituted for %(ago).'}).format({month:c(t,!1),year:e})},e.nice_date_with_month_name=p,e.ago=function(t,e,n,r){return void 0===e&&(e=!0),void 0===n&&(n=!1),void 0===r&&(r=!1),g(t,new Date,e,n,r)},e.agoFromDate=g,e.applyTimezoneOffset=y,e.getActingTimeWithAgoEnabled=function(t,e,n,r,o,s,i){return void 0===e&&(e=!1),void 0===n&&(n=!1),void 0===r&&(r=0),void 0===o&&(o=!0),void 0===s&&(s=!1),void 0===i&&(i=!1),0===r&&(r=28800),b(t,e,n,r,o,s,i)},e.getActingTime=b,e.increment_date=_,e.time=function(){return(new Date).getTime()},e.daysAfterToday=function(t){var e=new Date;return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),_(e,0,0,t)},e.secondsFromToday=function(t){return t.getTime()/1e3-Date.now()/1e3},e.datepickerLocalization={firstDayOfWeek:1,months:e.month_names,weekdaysLong:[s._("Sunday"),s._("Monday"),s._("Tuesday"),s._("Wednesday"),s._("Thursday"),s._("Friday"),s._("Saturday")],weekdaysShort:[s._("Su"),s._("Mo"),s._("Tu"),s._("We"),s._("Th"),s._("Fr"),s._("Sa")]}})),define("modules/clean/display_format",["require","exports","modules/core/i18n"],(function(t,e,n){"use strict";function r(t,r,o,s,i){void 0===r&&(r=2),void 0===o&&(o=!0),void 0===s&&(s=!0),void 0===i&&(i=!0),t=i?parseFloat(t):Math.max(0,parseFloat(t));var a,c,l=Math.abs(t);return l<1024?(r=0,a=t,c=n.ungettext("byte","bytes",t),o=!0):l<1024*e.SWITCH_UNIT_THRESHOLD?(a=t/1024,c=n._("KB")):l<1048576*e.SWITCH_UNIT_THRESHOLD?(a=t/1048576,c=n._("MB")):l<1073741824*e.SWITCH_UNIT_THRESHOLD||0===r&&t<1099511627776?(a=t/1073741824,c=n._("GB")):(a=t/1099511627776,c=n._("TB")),""+n.format_number(a,r,s)+(o?" ":"")+c}Object.defineProperty(e,"__esModule",{value:!0}),e.SWITCH_UNIT_THRESHOLD=900,e.format_bytes=r,e.formatGigabytes=function(t,e,n,o){return void 0===e&&(e=2),void 0===n&&(n=!0),void 0===o&&(o=!0),r(1073741824*(t=parseFloat(t)))},e.formatFolderFilesCount=function(t,e){void 0===e&&(e=2);var n=""+t,r="";return t>=1e3&&t<1e6?(t/=1e3,r="K"):t>=1e6&&(t/=1e6,r="M"),n=t.toFixed(e),""+(n=parseFloat(n).toString())+r}})),define("modules/clean/react/modal",["require","exports","tslib","classnames","purify","react","react-dom","react-dom-factories","prop-types","modules/clean/css","modules/core/exception","modules/core/notify","jquery","modules/clean/keycode","modules/clean/react/button","modules/clean/static_urls","modules/core/dom","modules/core/i18n","modules/clean/ux_analytics_utils"],(function(t,e,n,r,o,s,i,a,c,l,u,d,m,f,h,p,g,y,v){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),r=n.__importDefault(r),o=n.__importStar(o),s=n.__importDefault(s),i=n.__importStar(i),a=n.__importStar(a),c=n.__importStar(c),l=n.__importStar(l),m=n.__importDefault(m),g=n.__importStar(g);var b=s.default.createElement;e.MODAL_ROOT_TESTID="react-modal-root";var _=function(t){null==t&&(t=!0);var n="react-modal-root",r=document.getElementById(n);return!r&&t&&((r=document.createElement("div")).id=n,r.setAttribute("data-testid",e.MODAL_ROOT_TESTID),document.body.insertBefore(r,document.body.firstChild||null)),r},w=(function(t){function e(n){var r=t.call(this,n)||this;return r.close=function(){return e.close(r.elementToFocusOnClose)},r._invokeCallbackAndClose=function(t,e,n){if(C(t,"call",(function(t){return t.call(r,e)})),!e.isDefaultPrevented())return r.props.autoClose||n?r.close():void 0},r._dismiss=function(t){r._invokeCallbackAndClose(r.props.onDismiss,t,!0),C(r.props.onDismissCompleted,"call",(function(e){return e.call(r,t)}))},r._accept=function(t){r._invokeCallbackAndClose(r.props.onAccept,t,!1)},r._onClickOnOverlay=function(t){r.props.clickOutToClose&&r._dismiss(t)},r._focus=function(){r.elementToFocusOnClose=document.activeElement;var t=m.default(i.findDOMNode(r.refs.modal));if(r.props.autoFocusPrimaryInput){var e=t.find("input:not(:disabled)").first(),n=null!=r.refs.primaryButton&&m.default(i.findDOMNode(r.refs.primaryButton)),o=null!=r.refs.tertiaryButton&&m.default(i.findDOMNode(r.refs.tertiaryButton));e.length?t=e:n.length&&!n.is(":disabled")?t=m.default(i.findDOMNode(r.refs.primaryButton)):o.length&&!o.is(":disabled")&&(t=m.default(i.findDOMNode(r.refs.tertiaryButton)))}return t.focus()},r._keyDown=function(t){if(r.props.stopKeyDownEventPropagation&&t.stopPropagation(),t.which===f.KeyCode.ESC&&r.props.escapeOrBackspaceToClose&&r._dismiss(t),t.which!==f.KeyCode.BACKSPACE||g.focus_in_input()||(t.preventDefault(),r.props.escapeOrBackspaceToClose&&r._dismiss(t)),r.props.onKeyDown&&r.props.onKeyDown(t),null!=r.refs.modal)return g.keepFocusIn(i.findDOMNode(r.refs.modal),t)},r._trackingId=function(t){return null!=r.props.trackingIdPrefix?r.props.trackingIdPrefix+"-"+t:null},r._renderAcceptButton=function(){return b(h.button,{ref:"primaryButton",key:"primary",className:"dbmodal-button","data-trackingid":r._trackingId("accept"),importance:r.props.acceptButtonImportance,disabled:r.props.acceptButtonDisabled,onClick:r._accept},r.props.acceptButtonText)},r._renderDismissButton=function(){return b(h.button,{ref:"tertiaryButton",key:"tertiary-dismiss",className:"dbmodal-button","data-trackingid":r._trackingId("dismiss"),importance:r.props.dismissButtonImportance,disabled:r.props.dismissButtonDisabled,onClick:r._dismiss},r.props.dismissButtonText)},r._renderHelpLink=function(){return s.default.createElement("div",{className:"dbmodal-extra-link-button"},r.props.helpLink)},r._renderButtons=function(){if(r.props.buttonComponent)return r.props.buttonComponent;var t=[];return r.props.submitting&&t.push(a.span({className:"dbmodal-loading",key:"loading"},a.img({src:p.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:y._("Loading")}))),"default-maestro"===r.props.style?(r.props.dismissButtonText&&t.push(r._renderDismissButton()),r.props.acceptButtonText&&t.push(r._renderAcceptButton())):(r.props.acceptButtonText&&t.push(r._renderAcceptButton()),r.props.dismissButtonText&&t.push(r._renderDismissButton()),r.props.helpLink&&t.push(r._renderHelpLink())),t.length?a.div({className:"db-modal-buttons"},r.props.showButtonDivider?a.hr({}):void 0,t):void 0},r._renderAltAction=function(){if(r.props.altAction)return a.div({className:"db-modal__alt-action"},r.props.altAction)},r._preventEventBubbling=function(t){return t.stopPropagation()},r.state={didCssLoad:!1},r}return n.__extends(e,t),e.showInstance=function(t,e){null==e&&(e=!0);var n=_();return e&&(i.unmountComponentAtNode(n),m.default(n).siblings().not("#accessible-announce").attr("aria-hidden",!0)),i.render(t,n)},e.close=function(t){var e=_();e&&(i.unmountComponentAtNode(e),v.dispatchModalClosed(),m.default(e).siblings().removeAttr("aria-hidden"),null!=t&&t.focus())},e.unhide=function(){var t=_();if(t)return m.default(t).show()},e.hide=function(){var t=_();if(t)return m.default(t).hide()},e.prototype.componentDidMount=function(){return v.dispatchModalOpened(),g.scroll_lock_document(),m.default(i.findDOMNode(this.refs.modal)).on("keydown",this._keyDown),m.default(i.findDOMNode(this.refs.modal)).on("keypress",this._preventEventBubbling),this._focus(),"function"==typeof this.props.onShow?this.props.onShow():void 0},e.prototype.componentWillMount=function(){var t=this;this.props.shouldLoadCss&&l.require_css("/static/css/modal-vflq6DA0h.css",(function(){t.setState({didCssLoad:!0}),t._focus()}),(function(){u.reportStack("modal css not properly loaded",{severity:u.SEVERITY.CRITICAL}),d.Notify.error(y._("There was a problem completing this request."))}))},e.prototype.componentWillUnmount=function(){return v.dispatchModalClosed(),g.scroll_unlock_document(),m.default(i.findDOMNode(this.refs.modal)).off("keydown",this._keyDown),m.default(i.findDOMNode(this.refs.modal)).off("keypress",this._preventEventBubbling)},e.prototype.render=function(){var t={"db-modal-wrapper":!0,"uxa-modal":!0,"clean-react-modal":!0,"db-modal--clean-style":"clean"===this.props.style,"db-modal--simple-style":"simple"===this.props.style,"db-modal--lightbox-style":"lightbox"===this.props.style,"db-modal--bare-style":"bare"===this.props.style,"db-modal--default-maestro-style":"default-maestro"===this.props.style,"db-modal--cancel-style":"cancel"===this.props.style,"db-modal--cancel-confirmation-style":"cancel-confirmation"===this.props.style};this.props.className&&(t[this.props.className]=!0);var e=r.default(t),o=v.getModalId({id:this.props.id,className:this.props.className}),s=this.props.width?{width:this.props.width+"px"}:{},i=!this.props.shouldLoadCss||this.props.shouldLoadCss&&this.state.didCssLoad?{}:{style:{display:"none"}};return a.div(n.__assign({id:o,className:e},i),a.div({className:"db-modal-overlay",onClick:this._onClickOnOverlay}),a.div({ref:"modal",className:"db-modal",tabIndex:-1,style:s,role:"dialog","aria-labelledby":"lightbox"===this.props.style?"":this.props.headerId},a.div({className:"db-modal-box",ref:"modalBox"},["lightbox","bare"].includes(this.props.style)?a.div({className:"db-modal-"+this.props.style},this.props.children):a.div({},!this.props.showX||"default-maestro"===this.props.style&&"change-email-modal--maestro"!==this.props.className?void 0:a.button({className:"db-modal-x",onClick:this._dismiss,"aria-label":y._("Close"),"data-trackingid":this._trackingId("dismiss")}),this.props.title?a.h1({id:"db-modal-title",className:"db-modal-title"},a.div({className:"db-modal-title-text",ref:"title"},this.props.title)):null,a.div({className:"db-modal-content clearfix",ref:"content"},this.props.children,this._renderButtons(),this._renderAltAction())))))},e.displayName="Modal",e.propTypes={id:c.string,width:c.number,submitting:c.bool,title:c.oneOfType([c.oneOfType([c.string,c.element]),c.arrayOf(c.oneOfType([c.string,c.element]))]),acceptButtonText:c.string,dismissButtonText:c.string,acceptButtonImportance:c.string,dismissButtonImportance:c.string,altAction:c.node,trackingIdPrefix:c.string,headerId:c.string,onAccept:c.func,onDismiss:c.func,onDismissCompleted:c.func,onShow:c.func,onKeyDown:c.func,buttonComponent:c.element,autoClose:c.bool,clickOutToClose:c.bool,showX:c.bool,escapeOrBackspaceToClose:c.bool,showButtonDivider:c.bool,acceptButtonDisabled:c.bool,dismissButtonDisabled:c.bool,autoFocusPrimaryInput:c.bool,style:c.oneOf(["default","default-maestro","clean","simple","lightbox","bare","cancel","cancel-confirmation"]),setMaxHeight:c.bool,className:c.string,shouldLoadCss:c.bool,stopKeyDownEventPropagation:c.bool,helpLink:c.oneOfType([c.string,c.element])},e.defaultProps={acceptButtonText:y._("OK"),acceptButtonImportance:"primary",dismissButtonImportance:"tertiary",dismissButtonText:null,buttonComponent:null,headerId:"db-modal-title",onAccept:function(){},onDismiss:function(){},onShow:function(){},autoClose:!0,clickOutToClose:!0,style:"default",showX:!0,escapeOrBackspaceToClose:!0,acceptButtonDisabled:!1,dismissButtonDisabled:!1,autoFocusPrimaryInput:!0,shouldLoadCss:!0,stopKeyDownEventPropagation:!0},e})(s.default.Component);e.Modal=w,e.ReactModal=w;var j=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){var t={};for(var e in this.props){var n=this.props[e];t[e]=n}return t.className=r.default(this.props.className,"db-modal-buttons"),a.div(t)},e.displayName="ModalButtons",e})(s.default.Component);e.ModalButtons=j;var k=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.prototype.render=function(){var t={};for(var e in this.props){var n=this.props[e];t[e]=n}return"button-as-link skip-link"===this.props.className?t.className=this.props.className:t.className=r.default(this.props.className,"dbmodal-button","button-"+this.props.importance),a.button(t)},e.displayName="ModalButton",e.propTypes={importance:c.oneOf(["primary","secondary","tertiary"])},e.defaultProps={importance:"primary"},e})(s.default.Component);e.ModalButton=k;var A={show:function(t){var e={acceptButtonText:t.confirm_text,trackingIdPrefix:t.trackingIdPrefix,onAccept:t.confirm_callback,dismissButtonText:t.cancel_text,onDismiss:t.cancel_callback,onDismissCompleted:t.cancel_completed_callback,title:t.title_text,width:t.width,className:"simple-modal",autoClose:t.autoclose,style:t.style,onShow:t.on_show},n=t.body_react?s.default.createElement("div",{className:"simple-modal-content"},t.body_react):s.default.createElement("div",{className:"simple-modal-content",dangerouslySetInnerHTML:{__html:o.sanitize(t.body_html)}}),r=b(w,e,n);return w.showInstance(r)}};function C(t,e,n){return null!=t&&"function"==typeof t[e]?n(t,e):void 0}e.SimpleModal=A})),define("modules/clean/validators/validators",["require","exports","tslib","external/lodash","jquery","modules/core/i18n"],(function(t,e,n,r,o,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),r=n.__importStar(r),o=n.__importDefault(o);var i={},a=function(t,e){return i[t]=e},c=function(t){var e,n=t[0],r=t.slice(1);if(!i[n])throw new Error("Cannot find validator of type "+n);return new((e=i[n]).bind.apply(e,[void 0].concat(r)))},l=function(t){this.messages=r.assignIn({},this.constructor.messages,null!=t?t.messages:void 0)};a("AllValidator",(function(t){function e(){for(var e=[],n=0;n253)throw new Error(e.nonValidAddressMessage.format({input:t}));if(u.test(t)&&!e.domain_re.test(t))throw new Error(e.nonValidAddressMessage.format({input:t}))},e})(l);h.initClass(),a("UrlValidator",h);var p=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.__extends(e,t),e.initClass=function(){this.messages={empty:s._("Please enter an email address"),noAt:s._("An email address must contain a single @"),badUsername:s._("The username portion of the email address is invalid (the portion before the @: %(username)s)"),badDomain:s._("The domain portion of the email address is invalid (the portion after the @: %(domain)s)")},this.urlValidator=new h(null),this.username_re=/^[\w!#$%&'*+\-\/=?^`{|}~.]+$/},e.prototype.validate=function(t){if(!(t=o.default.trim(t)))throw new Error(this.messages.empty);var n=t.split("@");if(2!==n.length)throw new Error(this.messages.noAt);var r=Array.from(n),s=r[0],i=r[1];if(!e.username_re.test(s))throw new Error(this.messages.badUsername.format({username:s}));try{e.urlValidator.validate(i)}catch(t){throw new Error(this.messages.badDomain.format({domain:i}))}},e})(l);p.initClass(),a("EmailValidator",p);e.validators={create:c,register:a,check:function(t){return function(e,n){var r=!0;try{t.validate(e,n)}catch(t){r=!1}return r}}}})),define("modules/core/i18n",["require","exports","tslib","langpack","modules/core/exception","modules/constants/page_load","sha1"],(function(t,e,n,r,o,s,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),r=n.__importStar(r),s=n.__importStar(s),i=n.__importDefault(i),e.LANGPACK=(function(){if(Array.isArray(r)){for(var t={},e=r,n=0;nr?1:te?1:0}};var j=function(t,e,n){this.msg=t,this.project=e,this.comment=n};e.NoOpTranslated=j,String.prototype.format_sub=function(t){return this.replace(/%(\([a-zA-Z0-9_\-]+\))?(\.\d+)?(.)/g,t.bind(this))};String.prototype.format=function(t){for(var n=[],r=1;r-1,"Cannot mix named and positional indices in string formatting for string '"+this+"'."),a(l])+)?>|<\/\w+>/gi,"")}})); //# sourceMappingURL=pkg-i18n.min.js-vfll5iWSq.map