!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=261)}([function(e,t,n){(function(e){e.exports=function(){"use strict";var t,r;function a(){return t.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function c(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function l(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function f(e,t){var n,r=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+r}a.suppressDeprecationWarnings=!1,a.deprecationHandler=null,v=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var z=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,I=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},k={};function P(e,t,n,r){var a=r;"string"==typeof r&&(a=function(){return this[r]()}),e&&(k[e]=a),t&&(k[t[0]]=function(){return D(a.apply(this,arguments),t[1],t[2])}),n&&(k[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function Y(e,t){return e.isValid()?(t=U(t,e.localeData()),R[t]=R[t]||function(e){var t,n,r,a=e.match(z);for(t=0,n=a.length;t=0&&I.test(e);)e=e.replace(I,r),I.lastIndex=0,n-=1;return e}var W={};function q(e,t){var n=e.toLowerCase();W[n]=W[n+"s"]=W[t]=e}function x(e){return"string"==typeof e?W[e]||W[e.toLowerCase()]:void 0}function H(e){var t,n,r={};for(n in e)s(e,n)&&(t=x(n))&&(r[t]=e[n]);return r}var B={};function j(e,t){B[e]=t}function F(e){return e%4==0&&e%100!=0||e%400==0}function X(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function G(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=X(t)),n}function V(e,t){return function(n){return null!=n?(K(this,e,n),a.updateOffset(this,t),this):J(this,e)}}function J(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function K(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&F(e.year())&&1===e.month()&&29===e.date()?(n=G(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Ae(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var Q,Z=/\d/,$=/\d\d/,ee=/\d{3}/,te=/\d{4}/,ne=/[+-]?\d{6}/,re=/\d\d?/,ae=/\d\d\d\d?/,oe=/\d\d\d\d\d\d?/,ie=/\d{1,3}/,se=/\d{1,4}/,ue=/[+-]?\d{1,6}/,ce=/\d+/,de=/[+-]?\d+/,le=/Z|[+-]\d\d:?\d\d/gi,fe=/Z|[+-]\d\d(?::?\d\d)?/gi,_e=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function pe(e,t,n){Q[e]=O(t)?t:function(e,r){return e&&n?n:t}}function me(e,t){return s(Q,e)?Q[e](t._strict,t._locale):new RegExp(he(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,r,a){return t||n||r||a}))))}function he(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Q={};var Me,be={};function ye(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),d(t)&&(r=function(e,n){n[t]=G(e)}),n=0;n68?1900:2e3)};var Ie=V("FullYear",!0);function Re(e,t,n,r,a,o,i){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,r,a,o,i),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,r,a,o,i),s}function ke(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Pe(e,t,n){var r=7+t-n;return-(7+ke(e,0,r).getUTCDay()-t)%7+r-1}function Ye(e,t,n,r,a){var o,i,s=1+7*(t-1)+(7+n-r)%7+Pe(e,r,a);return s<=0?i=ze(o=e-1)+s:s>ze(e)?(o=e+1,i=s-ze(e)):(o=e,i=s),{year:o,dayOfYear:i}}function Ue(e,t,n){var r,a,o=Pe(e.year(),t,n),i=Math.floor((e.dayOfYear()-o-1)/7)+1;return i<1?r=i+We(a=e.year()-1,t,n):i>We(e.year(),t,n)?(r=i-We(e.year(),t,n),a=e.year()+1):(a=e.year(),r=i),{week:r,year:a}}function We(e,t,n){var r=Pe(e,t,n),a=Pe(e+1,t,n);return(ze(e)-r+a)/7}function qe(e,t){return e.slice(t,7).concat(e.slice(0,t))}P("w",["ww",2],"wo","week"),P("W",["WW",2],"Wo","isoWeek"),q("week","w"),q("isoWeek","W"),j("week",5),j("isoWeek",5),pe("w",re),pe("ww",re,$),pe("W",re),pe("WW",re,$),ge(["w","ww","W","WW"],(function(e,t,n,r){t[r.substr(0,1)]=G(e)})),P("d",0,"do","day"),P("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),P("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),P("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),P("e",0,0,"weekday"),P("E",0,0,"isoWeekday"),q("day","d"),q("weekday","e"),q("isoWeekday","E"),j("day",11),j("weekday",11),j("isoWeekday",11),pe("d",re),pe("e",re),pe("E",re),pe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),pe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),pe("dddd",(function(e,t){return t.weekdaysRegex(e)})),ge(["dd","ddd","dddd"],(function(e,t,n,r){var a=n._locale.weekdaysParse(e,r,n._strict);null!=a?t.d=a:m(n).invalidWeekday=e})),ge(["d","e","E"],(function(e,t,n,r){t[r]=G(e)}));var xe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),He="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Be="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),je=_e,Fe=_e,Xe=_e;function Ge(e,t,n){var r,a,o,i=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=Me.call(this._weekdaysParse,i))?a:null:"ddd"===t?-1!==(a=Me.call(this._shortWeekdaysParse,i))?a:null:-1!==(a=Me.call(this._minWeekdaysParse,i))?a:null:"dddd"===t?-1!==(a=Me.call(this._weekdaysParse,i))||-1!==(a=Me.call(this._shortWeekdaysParse,i))||-1!==(a=Me.call(this._minWeekdaysParse,i))?a:null:"ddd"===t?-1!==(a=Me.call(this._shortWeekdaysParse,i))||-1!==(a=Me.call(this._weekdaysParse,i))||-1!==(a=Me.call(this._minWeekdaysParse,i))?a:null:-1!==(a=Me.call(this._minWeekdaysParse,i))||-1!==(a=Me.call(this._weekdaysParse,i))||-1!==(a=Me.call(this._shortWeekdaysParse,i))?a:null}function Ve(){function e(e,t){return t.length-e.length}var t,n,r,a,o,i=[],s=[],u=[],c=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),r=he(this.weekdaysMin(n,"")),a=he(this.weekdaysShort(n,"")),o=he(this.weekdays(n,"")),i.push(r),s.push(a),u.push(o),c.push(r),c.push(a),c.push(o);i.sort(e),s.sort(e),u.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Je(){return this.hours()%12||12}function Ke(e,t){P(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Qe(e,t){return t._meridiemParse}P("H",["HH",2],0,"hour"),P("h",["hh",2],0,Je),P("k",["kk",2],0,(function(){return this.hours()||24})),P("hmm",0,0,(function(){return""+Je.apply(this)+D(this.minutes(),2)})),P("hmmss",0,0,(function(){return""+Je.apply(this)+D(this.minutes(),2)+D(this.seconds(),2)})),P("Hmm",0,0,(function(){return""+this.hours()+D(this.minutes(),2)})),P("Hmmss",0,0,(function(){return""+this.hours()+D(this.minutes(),2)+D(this.seconds(),2)})),Ke("a",!0),Ke("A",!1),q("hour","h"),j("hour",13),pe("a",Qe),pe("A",Qe),pe("H",re),pe("h",re),pe("k",re),pe("HH",re,$),pe("hh",re,$),pe("kk",re,$),pe("hmm",ae),pe("hmmss",oe),pe("Hmm",ae),pe("Hmmss",oe),ye(["H","HH"],3),ye(["k","kk"],(function(e,t,n){var r=G(e);t[3]=24===r?0:r})),ye(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ye(["h","hh"],(function(e,t,n){t[3]=G(e),m(n).bigHour=!0})),ye("hmm",(function(e,t,n){var r=e.length-2;t[3]=G(e.substr(0,r)),t[4]=G(e.substr(r)),m(n).bigHour=!0})),ye("hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[3]=G(e.substr(0,r)),t[4]=G(e.substr(r,2)),t[5]=G(e.substr(a)),m(n).bigHour=!0})),ye("Hmm",(function(e,t,n){var r=e.length-2;t[3]=G(e.substr(0,r)),t[4]=G(e.substr(r))})),ye("Hmmss",(function(e,t,n){var r=e.length-4,a=e.length-2;t[3]=G(e.substr(0,r)),t[4]=G(e.substr(r,2)),t[5]=G(e.substr(a))}));var Ze,$e=V("Hours",!0),et={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Le,monthsShort:Te,week:{dow:0,doy:6},weekdays:xe,weekdaysMin:Be,weekdaysShort:He,meridiemParse:/[ap]\.?m?\.?/i},tt={},nt={};function rt(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(r=ot(a.slice(0,t).join("-")))return r;if(n&&n.length>=t&&rt(a,n)>=t-1)break;t--}o++}return Ze}(e)}function ct(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>Ae(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,m(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),m(e)._overflowWeeks&&-1===t&&(t=7),m(e)._overflowWeekday&&-1===t&&(t=8),m(e).overflow=t),e}var dt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,lt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ft=/Z|[+-]\d\d(?::?\d\d)?/,_t=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],pt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mt=/^\/?Date\((-?\d+)/i,ht=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Mt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function bt(e){var t,n,r,a,o,i,s=e._i,u=dt.exec(s)||lt.exec(s);if(u){for(m(e).iso=!0,t=0,n=_t.length;t7)&&(u=!0)):(o=e._locale._week.dow,i=e._locale._week.doy,c=Ue(St(),o,i),n=Et(t.gg,e._a[0],c.year),r=Et(t.w,c.week),null!=t.d?((a=t.d)<0||a>6)&&(u=!0):null!=t.e?(a=t.e+o,(t.e<0||t.e>6)&&(u=!0)):a=o),r<1||r>We(n,o,i)?m(e)._overflowWeeks=!0:null!=u?m(e)._overflowWeekday=!0:(s=Ye(n,r,a,o,i),e._a[0]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(i=Et(e._a[0],r[0]),(e._dayOfYear>ze(i)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=ke(i,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=r[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?ke:Re).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(m(e).weekdayMismatch=!0)}}function Lt(e){if(e._f!==a.ISO_8601)if(e._f!==a.RFC_2822){e._a=[],m(e).empty=!0;var t,n,r,o,i,s,u=""+e._i,c=u.length,d=0;for(r=U(e._f,e._locale).match(z)||[],t=0;t0&&m(e).unusedInput.push(i),u=u.slice(u.indexOf(n)+n.length),d+=n.length),k[o]?(n?m(e).empty=!1:m(e).unusedTokens.push(o),Ee(o,n,e)):e._strict&&!n&&m(e).unusedTokens.push(o);m(e).charsLeftOver=c-d,u.length>0&&m(e).unusedInput.push(u),e._a[3]<=12&&!0===m(e).bigHour&&e._a[3]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var r;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((r=e.isPM(n))&&t<12&&(t+=12),r||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(s=m(e).era)&&(e._a[0]=e._locale.erasConvertYear(s,e._a[0])),At(e),ct(e)}else gt(e);else bt(e)}function Tt(e){var t=e._i,n=e._f;return e._locale=e._locale||ut(e._l),null===t||void 0===n&&""===t?M({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),A(t)?new E(ct(t)):(l(t)?e._d=t:o(n)?function(e){var t,n,r,a,o,i,s=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;athis?this:e:M()}));function Nt(e,t){var n,r;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return St();for(n=t[0],r=1;r=0?new Date(e+400,t,n)-126227808e5:new Date(e,t,n).valueOf()}function an(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-126227808e5:Date.UTC(e,t,n)}function on(e,t){return t.erasAbbrRegex(e)}function sn(){var e,t,n=[],r=[],a=[],o=[],i=this.eras();for(e=0,t=i.length;e(o=We(e,r,a))&&(t=o),dn.call(this,e,t,n,r,a))}function dn(e,t,n,r,a){var o=Ye(e,t,n,r,a),i=ke(o.year,0,o.dayOfYear);return this.year(i.getUTCFullYear()),this.month(i.getUTCMonth()),this.date(i.getUTCDate()),this}P("N",0,0,"eraAbbr"),P("NN",0,0,"eraAbbr"),P("NNN",0,0,"eraAbbr"),P("NNNN",0,0,"eraName"),P("NNNNN",0,0,"eraNarrow"),P("y",["y",1],"yo","eraYear"),P("y",["yy",2],0,"eraYear"),P("y",["yyy",3],0,"eraYear"),P("y",["yyyy",4],0,"eraYear"),pe("N",on),pe("NN",on),pe("NNN",on),pe("NNNN",(function(e,t){return t.erasNameRegex(e)})),pe("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ye(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,r){var a=n._locale.erasParse(e,r,n._strict);a?m(n).era=a:m(n).invalidEra=e})),pe("y",ce),pe("yy",ce),pe("yyy",ce),pe("yyyy",ce),pe("yo",(function(e,t){return t._eraYearOrdinalRegex||ce})),ye(["y","yy","yyy","yyyy"],0),ye(["yo"],(function(e,t,n,r){var a;n._locale._eraYearOrdinalRegex&&(a=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[0]=n._locale.eraYearOrdinalParse(e,a):t[0]=parseInt(e,10)})),P(0,["gg",2],0,(function(){return this.weekYear()%100})),P(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),un("gggg","weekYear"),un("ggggg","weekYear"),un("GGGG","isoWeekYear"),un("GGGGG","isoWeekYear"),q("weekYear","gg"),q("isoWeekYear","GG"),j("weekYear",1),j("isoWeekYear",1),pe("G",de),pe("g",de),pe("GG",re,$),pe("gg",re,$),pe("GGGG",se,te),pe("gggg",se,te),pe("GGGGG",ue,ne),pe("ggggg",ue,ne),ge(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,r){t[r.substr(0,2)]=G(e)})),ge(["gg","GG"],(function(e,t,n,r){t[r]=a.parseTwoDigitYear(e)})),P("Q",0,"Qo","quarter"),q("quarter","Q"),j("quarter",7),pe("Q",Z),ye("Q",(function(e,t){t[1]=3*(G(e)-1)})),P("D",["DD",2],"Do","date"),q("date","D"),j("date",9),pe("D",re),pe("DD",re,$),pe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ye(["D","DD"],2),ye("Do",(function(e,t){t[2]=G(e.match(re)[0])}));var ln=V("Date",!0);P("DDD",["DDDD",3],"DDDo","dayOfYear"),q("dayOfYear","DDD"),j("dayOfYear",4),pe("DDD",ie),pe("DDDD",ee),ye(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=G(e)})),P("m",["mm",2],0,"minute"),q("minute","m"),j("minute",14),pe("m",re),pe("mm",re,$),ye(["m","mm"],4);var fn=V("Minutes",!1);P("s",["ss",2],0,"second"),q("second","s"),j("second",15),pe("s",re),pe("ss",re,$),ye(["s","ss"],5);var _n,pn,mn=V("Seconds",!1);for(P("S",0,0,(function(){return~~(this.millisecond()/100)})),P(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),P(0,["SSS",3],0,"millisecond"),P(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),P(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),P(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),P(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),P(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),P(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),q("millisecond","ms"),j("millisecond",16),pe("S",ie,Z),pe("SS",ie,$),pe("SSS",ie,ee),_n="SSSS";_n.length<=9;_n+="S")pe(_n,ce);function hn(e,t){t[6]=G(1e3*("0."+e))}for(_n="S";_n.length<=9;_n+="S")ye(_n,hn);pn=V("Milliseconds",!1),P("z",0,0,"zoneAbbr"),P("zz",0,0,"zoneName");var Mn=E.prototype;function bn(e){return e}Mn.add=Gt,Mn.calendar=function(e,t){1===arguments.length&&(arguments[0]?Kt(arguments[0])?(e=arguments[0],t=void 0):Qt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||St(),r=Yt(n,this).startOf("day"),o=a.calendarFormat(this,r)||"sameElse",i=t&&(O(t[o])?t[o].call(this,n):t[o]);return this.format(i||this.localeData().calendar(o,this,St(n)))},Mn.clone=function(){return new E(this)},Mn.diff=function(e,t,n){var r,a,o;if(!this.isValid())return NaN;if(!(r=Yt(e,this)).isValid())return NaN;switch(a=6e4*(r.utcOffset()-this.utcOffset()),t=x(t)){case"year":o=Zt(this,r)/12;break;case"month":o=Zt(this,r);break;case"quarter":o=Zt(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-a)/864e5;break;case"week":o=(this-r-a)/6048e5;break;default:o=this-r}return n?o:X(o)},Mn.endOf=function(e){var t,n;if(void 0===(e=x(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?an:rn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1}return this._d.setTime(t),a.updateOffset(this,!0),this},Mn.format=function(e){e||(e=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var t=Y(this,e);return this.localeData().postformat(t)},Mn.from=function(e,t){return this.isValid()&&(A(e)&&e.isValid()||St(e).isValid())?Ht({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mn.fromNow=function(e){return this.from(St(),e)},Mn.to=function(e,t){return this.isValid()&&(A(e)&&e.isValid()||St(e).isValid())?Ht({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},Mn.toNow=function(e){return this.to(St(),e)},Mn.get=function(e){return O(this[e=x(e)])?this[e]():this},Mn.invalidAt=function(){return m(this).overflow},Mn.isAfter=function(e,t){var n=A(e)?e:St(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=x(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?Y(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):O(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",Y(n,"Z")):Y(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},Mn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,r="moment",a="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",a="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=a+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(Mn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Mn.toJSON=function(){return this.isValid()?this.toISOString():null},Mn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},Mn.unix=function(){return Math.floor(this.valueOf()/1e3)},Mn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},Mn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},Mn.eraName=function(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mn.isLocal=function(){return!!this.isValid()&&!this._isUTC},Mn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},Mn.isUtc=Wt,Mn.isUTC=Wt,Mn.zoneAbbr=function(){return this._isUTC?"UTC":""},Mn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mn.dates=T("dates accessor is deprecated. Use date instead.",ln),Mn.months=T("months accessor is deprecated. Use month instead",we),Mn.years=T("years accessor is deprecated. Use year instead",Ie),Mn.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),Mn.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e,t={};return g(t,this),(t=Tt(t))._a?(e=t._isUTC?p(t._a):St(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var r,a=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),i=0;for(r=0;r0):this._isDSTShifted=!1,this._isDSTShifted}));var yn=w.prototype;function gn(e,t,n,r){var a=ut(),o=p().set(r,t);return a[n](o,e)}function En(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return gn(e,t,n,"month");var r,a=[];for(r=0;r<12;r++)a[r]=gn(e,r,n,"month");return a}function An(e,t,n,r){"boolean"==typeof e?(d(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,d(t)&&(n=t,t=void 0),t=t||"");var a,o=ut(),i=e?o._week.dow:0,s=[];if(null!=n)return gn(t,(n+i)%7,r,"day");for(a=0;a<7;a++)s[a]=gn(t,(a+i)%7,r,"day");return s}yn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return O(r)?r.call(t,n):r},yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(z).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},yn.invalidDate=function(){return this._invalidDate},yn.ordinal=function(e){return this._ordinal.replace("%d",e)},yn.preparse=bn,yn.postformat=bn,yn.relativeTime=function(e,t,n,r){var a=this._relativeTime[n];return O(a)?a(e,t,n,r):a.replace(/%d/i,e)},yn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return O(n)?n(t):n.replace(/%s/i,t)},yn.set=function(e){var t,n;for(n in e)s(e,n)&&(O(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yn.eras=function(e,t){var n,r,o,i=this._eras||ut("en")._eras;for(n=0,r=i.length;n=0)return u[r]},yn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?a(e.since).year():a(e.since).year()+(t-e.offset)*n},yn.erasAbbrRegex=function(e){return s(this,"_erasAbbrRegex")||sn.call(this),e?this._erasAbbrRegex:this._erasRegex},yn.erasNameRegex=function(e){return s(this,"_erasNameRegex")||sn.call(this),e?this._erasNameRegex:this._erasRegex},yn.erasNarrowRegex=function(e){return s(this,"_erasNarrowRegex")||sn.call(this),e?this._erasNarrowRegex:this._erasRegex},yn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||ve).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},yn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[ve.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yn.monthsParse=function(e,t,n){var r,a,o;if(this._monthsParseExact)return Oe.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(a=p([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},yn.monthsRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||De.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Ce),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},yn.monthsShortRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||De.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Se),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},yn.week=function(e){return Ue(e,this._week.dow,this._week.doy).week},yn.firstDayOfYear=function(){return this._week.doy},yn.firstDayOfWeek=function(){return this._week.dow},yn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?qe(n,this._week.dow):e?n[e.day()]:n},yn.weekdaysMin=function(e){return!0===e?qe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},yn.weekdaysShort=function(e){return!0===e?qe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},yn.weekdaysParse=function(e,t,n){var r,a,o;if(this._weekdaysParseExact)return Ge.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(a=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ve.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=je),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ve.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Fe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ve.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Xe),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},yn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},it("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===G(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),a.lang=T("moment.lang is deprecated. Use moment.locale instead.",it),a.langData=T("moment.langData is deprecated. Use moment.localeData instead.",ut);var Ln=Math.abs;function Tn(e,t,n,r){var a=Ht(t,n);return e._milliseconds+=r*a._milliseconds,e._days+=r*a._days,e._months+=r*a._months,e._bubble()}function vn(e){return e<0?Math.floor(e):Math.ceil(e)}function Sn(e){return 4800*e/146097}function Cn(e){return 146097*e/4800}function On(e){return function(){return this.as(e)}}var Nn=On("ms"),wn=On("s"),Dn=On("m"),zn=On("h"),In=On("d"),Rn=On("w"),kn=On("M"),Pn=On("Q"),Yn=On("y");function Un(e){return function(){return this.isValid()?this._data[e]:NaN}}var Wn=Un("milliseconds"),qn=Un("seconds"),xn=Un("minutes"),Hn=Un("hours"),Bn=Un("days"),jn=Un("months"),Fn=Un("years"),Xn=Math.round,Gn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Vn(e,t,n,r,a){return a.relativeTime(t||1,!!n,e,r)}var Jn=Math.abs;function Kn(e){return(e>0)-(e<0)||+e}function Qn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,r,a,o,i,s,u=Jn(this._milliseconds)/1e3,c=Jn(this._days),d=Jn(this._months),l=this.asSeconds();return l?(e=X(u/60),t=X(e/60),u%=60,e%=60,n=X(d/12),d%=12,r=u?u.toFixed(3).replace(/\.?0+$/,""):"",a=l<0?"-":"",o=Kn(this._months)!==Kn(l)?"-":"",i=Kn(this._days)!==Kn(l)?"-":"",s=Kn(this._milliseconds)!==Kn(l)?"-":"",a+"P"+(n?o+n+"Y":"")+(d?o+d+"M":"")+(c?i+c+"D":"")+(t||e||u?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(u?s+r+"S":"")):"P0D"}var Zn=Dt.prototype;return Zn.isValid=function(){return this._isValid},Zn.abs=function(){var e=this._data;return this._milliseconds=Ln(this._milliseconds),this._days=Ln(this._days),this._months=Ln(this._months),e.milliseconds=Ln(e.milliseconds),e.seconds=Ln(e.seconds),e.minutes=Ln(e.minutes),e.hours=Ln(e.hours),e.months=Ln(e.months),e.years=Ln(e.years),this},Zn.add=function(e,t){return Tn(this,e,t,1)},Zn.subtract=function(e,t){return Tn(this,e,t,-1)},Zn.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=x(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Sn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Cn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},Zn.asMilliseconds=Nn,Zn.asSeconds=wn,Zn.asMinutes=Dn,Zn.asHours=zn,Zn.asDays=In,Zn.asWeeks=Rn,Zn.asMonths=kn,Zn.asQuarters=Pn,Zn.asYears=Yn,Zn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*G(this._months/12):NaN},Zn._bubble=function(){var e,t,n,r,a,o=this._milliseconds,i=this._days,s=this._months,u=this._data;return o>=0&&i>=0&&s>=0||o<=0&&i<=0&&s<=0||(o+=864e5*vn(Cn(s)+i),i=0,s=0),u.milliseconds=o%1e3,e=X(o/1e3),u.seconds=e%60,t=X(e/60),u.minutes=t%60,n=X(t/60),u.hours=n%24,i+=X(n/24),a=X(Sn(i)),s+=a,i-=vn(Cn(a)),r=X(s/12),s%=12,u.days=i,u.months=s,u.years=r,this},Zn.clone=function(){return Ht(this)},Zn.get=function(e){return e=x(e),this.isValid()?this[e+"s"]():NaN},Zn.milliseconds=Wn,Zn.seconds=qn,Zn.minutes=xn,Zn.hours=Hn,Zn.days=Bn,Zn.weeks=function(){return X(this.days()/7)},Zn.months=jn,Zn.years=Fn,Zn.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,r,a=!1,o=Gn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(a=e),"object"==typeof t&&(o=Object.assign({},Gn,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=this.localeData(),r=function(e,t,n,r){var a=Ht(e).abs(),o=Xn(a.as("s")),i=Xn(a.as("m")),s=Xn(a.as("h")),u=Xn(a.as("d")),c=Xn(a.as("M")),d=Xn(a.as("w")),l=Xn(a.as("y")),f=o<=n.ss&&["s",o]||o0,f[4]=r,Vn.apply(null,f)}(this,!a,o,n),a&&(r=n.pastFuture(+this,r)),n.postformat(r)},Zn.toISOString=Qn,Zn.toString=Qn,Zn.toJSON=Qn,Zn.locale=$t,Zn.localeData=tn,Zn.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Qn),Zn.lang=en,P("X",0,0,"unix"),P("x",0,0,"valueOf"),pe("x",de),pe("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ye("x",(function(e,t,n){n._d=new Date(G(e))})), //! moment.js a.version="2.29.0",t=St,a.fn=Mn,a.min=function(){var e=[].slice.call(arguments,0);return Nt("isBefore",e)},a.max=function(){var e=[].slice.call(arguments,0);return Nt("isAfter",e)},a.now=function(){return Date.now?Date.now():+new Date},a.utc=p,a.unix=function(e){return St(1e3*e)},a.months=function(e,t){return En(e,t,"months")},a.isDate=l,a.locale=it,a.invalid=M,a.duration=Ht,a.isMoment=A,a.weekdays=function(e,t,n){return An(e,t,n,"weekdays")},a.parseZone=function(){return St.apply(null,arguments).parseZone()},a.localeData=ut,a.isDuration=zt,a.monthsShort=function(e,t){return En(e,t,"monthsShort")},a.weekdaysMin=function(e,t,n){return An(e,t,n,"weekdaysMin")},a.defineLocale=st,a.updateLocale=function(e,t){if(null!=t){var n,r,a=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(N(tt[e]._config,t)):(null!=(r=ot(e))&&(a=r._config),t=N(a,t),null==r&&(t.abbr=e),(n=new w(t)).parentLocale=tt[e],tt[e]=n),it(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===it()&&it(e)):null!=tt[e]&&delete tt[e]);return tt[e]},a.locales=function(){return v(tt)},a.weekdaysShort=function(e,t,n){return An(e,t,n,"weekdaysShort")},a.normalizeUnits=x,a.relativeTimeRounding=function(e){return void 0===e?Xn:"function"==typeof e&&(Xn=e,!0)},a.relativeTimeThreshold=function(e,t){return void 0!==Gn[e]&&(void 0===t?Gn[e]:(Gn[e]=t,"s"===e&&(Gn.ss=t-1),!0))},a.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},a.prototype=Mn,a.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},a}()}).call(this,n(448)(e))},function(e,t,n){"use strict";n.r(t),n.d(t,"__extends",(function(){return a})),n.d(t,"__assign",(function(){return o})),n.d(t,"__rest",(function(){return i})),n.d(t,"__decorate",(function(){return s})),n.d(t,"__param",(function(){return u})),n.d(t,"__metadata",(function(){return c})),n.d(t,"__awaiter",(function(){return d})),n.d(t,"__generator",(function(){return l})),n.d(t,"__exportStar",(function(){return f})),n.d(t,"__values",(function(){return _})),n.d(t,"__read",(function(){return p})),n.d(t,"__spread",(function(){return m})),n.d(t,"__spreadArrays",(function(){return h})),n.d(t,"__await",(function(){return M})),n.d(t,"__asyncGenerator",(function(){return b})),n.d(t,"__asyncDelegator",(function(){return y})),n.d(t,"__asyncValues",(function(){return g})),n.d(t,"__makeTemplateObject",(function(){return E})),n.d(t,"__importStar",(function(){return A})),n.d(t,"__importDefault",(function(){return L})); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. 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 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}function u(e,t){return function(n,r){t(n,r,e)}}function c(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function d(e,t,n,r){return new(n||(n=Promise))((function(a,o){function i(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?a(e.value):new n((function(t){t(e.value)})).then(i,s)}u((r=r.apply(e,t||[])).next())}))}function l(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(a=2&o[0]?r.return:o[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;switch(r=0,a&&(o=[2&o[0],a.value]),o[0]){case 0:case 1:a=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==o[0]&&2!==o[0])){i=0;continue}if(3===o[0]&&(!a||o[1]>a[0]&&o[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}function m(){for(var e=[],t=0;t1||s(e,t)}))})}function s(e,t){try{(n=a[e](t)).value instanceof M?Promise.resolve(n.value.v).then(u,c):d(o[0][2],n)}catch(e){d(o[0][3],e)}var n}function u(e){s("next",e)}function c(e){s("throw",e)}function d(e,t){e(t),o.shift(),o.length&&s(o[0][0],o[0][1])}}function y(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,a){t[r]=e[r]?function(t){return(n=!n)?{value:M(e[r](t)),done:"return"===r}:a?a(t):t}:a}}function g(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=_(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,a){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,a,(t=e[n](t)).done,t.value)}))}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function L(e){return e&&e.__esModule?e:{default:e}}},function(e,t){e.exports=React},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=r.__importDefault(n(262));t.General=a.default;var o=r.__importDefault(n(263));t.RequestStatus=o.default;var i=r.__importDefault(n(264));t.WebsocketEvents=i.default;var s=r.__importDefault(n(265));t.Preferences=s.default;var u=r.__importDefault(n(266));t.Posts=u.default;var c=r.__importDefault(n(267));t.Files=c.default;var d=r.__importDefault(n(268));t.Teams=d.default;var l=r.__importDefault(n(269));t.Stats=l.default;var f=r.__importDefault(n(270));t.Permissions=f.default;var _=r.__importDefault(n(271));t.Emoji=_.default;var p=r.__importDefault(n(272));t.Plugins=p.default;var m=r.__importDefault(n(273));t.Groups=m.default;var h=r.__importDefault(n(274));t.Users=h.default;var M=r.__importDefault(n(275));t.Roles=M.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!(e instanceof Object)||Array.isArray(e))throw new Error("keyMirror(...): Argument must be an object.");var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=n);return t}},function(e,t){e.exports=PropTypes},function(e,t,n){var r=n(19),a=n(15),o=n(110),i=n(30).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});a(t,e)||i(t,e,{value:o.f(e)})}},function(e,t,n){var r=n(11),a=n(70),o=n(15),i=n(71),s=n(72),u=n(98),c=a("wks"),d=r.Symbol,l=u?d:d&&d.withoutSetter||i;e.exports=function(e){return o(c,e)||(s&&o(d,e)?c[e]=d[e]:c[e]=l("Symbol."+e)),c[e]}},function(e,t,n){"use strict";var r=n(11),a=n(91).f,o=n(282),i=n(19),s=n(66),u=n(23),c=n(15),d=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,l,f,_,p,m,h,M,b=e.target,y=e.global,g=e.stat,E=e.proto,A=y?r:g?r[b]:(r[b]||{}).prototype,L=y?i:i[b]||(i[b]={}),T=L.prototype;for(f in t)n=!o(y?f:b+(g?".":"#")+f,e.forced)&&A&&c(A,f),p=L[f],n&&(m=e.noTargetGet?(M=a(A,f))&&M.value:A[f]),_=n&&m?m:t[f],n&&typeof p==typeof _||(h=e.bind&&n?s(_,r):e.wrap&&n?d(_):E&&"function"==typeof _?s(Function.call,_):_,(e.sham||_&&_.sham||p&&p.sham)&&u(h,"sham",!0),L[f]=h,E&&(c(i,l=b+"Prototype")||u(i,l,{}),i[l][f]=_,e.real&&T&&!T[f]&&u(T,f,_)))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(10),o=n(3),i=n(14);function s(e){return e.entities.general.config}function u(e){return e.entities.general.license}t.getConfig=s,t.getLicense=u,t.getSupportedTimezones=function(e){return e.entities.general.timezones},t.getCurrentUrl=function(e){return e.entities.general.credentials.url},t.warnMetricsStatus=function(e){return e.entities.general.warnMetricsStatus},t.isCompatibleWithJoinViewTeamPermissions=function(e){var t=e.entities.general.serverVersion;return i.isMinimumServerVersion(t,5,10,0)||-1!==t.indexOf("dev")&&i.isMinimumServerVersion(t,5,8,0)||null!==t.match(/^5.8.\d.\d\d\d\d.*$/)&&i.isMinimumServerVersion(t,5,8,0)},t.hasNewPermissions=function(e){var t=e.entities.general.serverVersion;return i.isMinimumServerVersion(t,4,9,0)||-1!==t.indexOf("dev")&&i.isMinimumServerVersion(t,4,8,0)||null!==t.match(/^4.8.\d.\d\d\d\d.*$/)&&i.isMinimumServerVersion(t,4,8,0)},t.canUploadFilesOnMobile=a.createSelector(s,u,(function(e,t){return"false"!==e.EnableFileAttachments&&("false"===t.IsLicensed||"false"===t.Compliance||"false"!==e.EnableMobileFileUpload)})),t.canDownloadFilesOnMobile=a.createSelector(s,u,(function(e,t){return"false"===t.IsLicensed||"false"===t.Compliance||"false"!==e.EnableMobileFileDownload})),t.getAutolinkedUrlSchemes=a.createSelector(s,(function(e){return e.CustomUrlSchemes?r.__spread(o.General.DEFAULT_AUTOLINKED_URL_SCHEMES,e.CustomUrlSchemes.split(",")):o.General.DEFAULT_AUTOLINKED_URL_SCHEMES})),t.getServerVersion=function(e){return e.entities.general.serverVersion}},function(e,t,n){"use strict";function r(e,t){return e===t}function a(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,a=0;a1&&void 0!==arguments[1]?arguments[1]:r,n=null,o=null;return function(){return a(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function i(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}function s(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:u;if("object"!=typeof e)throw new Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var n=Object.keys(e);return t(n.map((function(t){return e[t]})),(function(){for(var e=arguments.length,t=Array(e),r=0;rt||!(on||!(ir||!(s0&&(a=a.filter((function(e){return e.roles.length>0&&u.applyRolesFilters(e,i,null==n?void 0:n[e.id])}))),t.inactive?a=a.filter((function(e){return 0!==e.delete_at})):t.active&&(a=a.filter((function(e){return 0===e.delete_at}))),a.reduce((function(e,t){return e[t.id]=t,e}),{})}function y(e,t){var n=e.findIndex((function(e){return e.id===t}));n>=0&&e.splice(n,1)}function g(){return a.createSelector(o.getUsers,c,o.getMembersInChannel,(function(e,t){return t}),(function(e,t,n){return n}),(function(e,t,n,r,a){void 0===a&&(a={});var o=t[r];return o?M(b(e,a,n),o):[]}))}t.getProfiles=a.createSelector(o.getUsers,(function(e,t){return t}),(function(e,t){return M(b(e,t),"all")})),t.filterProfiles=b,t.getIsManualStatusForUserId=function(e,t){return e.entities.users.isManualStatus[t]},t.getProfilesInCurrentChannel=a.createSelector(o.getUsers,t.getProfileSetInCurrentChannel,(function(e,t){return M(e,t)})),t.getProfilesNotInCurrentChannel=a.createSelector(o.getUsers,t.getProfileSetNotInCurrentChannel,(function(e,t){return M(e,t)})),t.getProfilesInCurrentTeam=a.createSelector(o.getUsers,t.getProfileSetInCurrentTeam,(function(e,t){return M(e,t)})),t.getProfilesInTeam=a.createSelector(o.getUsers,l,o.getMembersInTeam,(function(e,t){return t}),(function(e,t,n){return n}),(function(e,t,n,r,a){return M(b(e,a,n),t[r]||new Set)})),t.getProfilesNotInTeam=a.createSelector(o.getUsers,f,(function(e,t){return t}),(function(e,t,n){return n}),(function(e,t,n,r){return M(b(e,r),t[n]||new Set)})),t.getProfilesNotInCurrentTeam=a.createSelector(o.getUsers,t.getProfileSetNotInCurrentTeam,(function(e,t){return M(e,t)})),t.getProfilesWithoutTeam=a.createSelector(o.getUsers,_,(function(e,t){return t}),(function(e,t,n){return M(b(e,n),t)})),t.getStatusForUserId=function(e,t){return m(e)[t]},t.getTotalUsersStats=function(e){return e.entities.users.stats},t.getFilteredUsersStats=function(e){return e.entities.users.filteredStats},t.searchProfiles=function(e,t,n,r){void 0===n&&(n=!1);var a=o.getUsers(e),i=u.filterProfilesMatchingTerm(Object.keys(a).map((function(e){return a[e]})),t),s=b(u.profileListToMap(i),r),c=Object.keys(s).map((function(e){return s[e]}));return n&&y(c,o.getCurrentUserId(e)),c},t.makeSearchProfilesInChannel=function(){var e=g();return function(t,n,r,a,i){void 0===a&&(a=!1);var s=u.filterProfilesMatchingTerm(e(t,n,i),r);return a&&y(s,o.getCurrentUserId(t)),s}},t.searchProfilesInCurrentChannel=function(e,n,r){void 0===r&&(r=!1);var a=u.filterProfilesMatchingTerm(t.getProfilesInCurrentChannel(e),n);return r&&y(a,o.getCurrentUserId(e)),a},t.searchProfilesNotInCurrentChannel=function(e,n,r){void 0===r&&(r=!1);var a=u.filterProfilesMatchingTerm(t.getProfilesNotInCurrentChannel(e),n);return r&&y(a,o.getCurrentUserId(e)),a},t.searchProfilesInCurrentTeam=function(e,n,r){void 0===r&&(r=!1);var a=u.filterProfilesMatchingTerm(t.getProfilesInCurrentTeam(e),n);return r&&y(a,o.getCurrentUserId(e)),a},t.searchProfilesInTeam=function(e,n,r,a,i){void 0===a&&(a=!1);var s=u.filterProfilesMatchingTerm(t.getProfilesInTeam(e,n,i),r);return a&&y(s,o.getCurrentUserId(e)),s},t.searchProfilesNotInCurrentTeam=function(e,n,r){void 0===r&&(r=!1);var a=u.filterProfilesMatchingTerm(t.getProfilesNotInCurrentTeam(e),n);return r&&y(a,o.getCurrentUserId(e)),a},t.searchProfilesWithoutTeam=function(e,n,r,a){void 0===r&&(r=!1);var i=u.filterProfilesMatchingTerm(t.getProfilesWithoutTeam(e,a),n);return r&&y(i,o.getCurrentUserId(e)),i},t.shouldShowTermsOfService=a.createSelector(i.getConfig,o.getCurrentUser,i.getLicense,(function(e,t,n){var r=t?t.terms_of_service_id:"",a=t?t.terms_of_service_create_at:0,o="true"===n.IsLicensed&&"true"===e.EnableCustomTermsOfService,i=1e3*parseInt(e.CustomTermsOfServiceReAcceptancePeriod,10)*60*60*24,s=(new Date).getTime()-a;return Boolean(t&&o&&(e.CustomTermsOfServiceId!==r||s>i))})),t.getUsersInVisibleDMs=a.createSelector(o.getUsers,s.getDirectShowPreferences,(function(e,t){var n=[];return t.forEach((function(t){"true"===t.value&&e[t.name]&&n.push(e[t.name])})),n})),t.makeGetProfilesForReactions=function(){return a.createSelector(o.getUsers,(function(e,t){return t}),(function(e,t){var n=[];return t.forEach((function(t){e[t.user_id]&&n.push(e[t.user_id])})),n}))},t.makeGetProfilesInChannel=g,t.makeGetProfilesNotInChannel=function(){return a.createSelector(o.getUsers,d,(function(e,t){return t}),(function(e,t,n){return n}),(function(e,t,n,r){void 0===r&&(r={});var a=t[n];return a?M(r?b(e,r):e,a):[]}))},t.makeGetProfilesByIdsAndUsernames=function(){return a.createSelector(o.getUsers,t.getUsersByUsername,(function(e,t){return t.allUserIds}),(function(e,t){return t.allUsernames}),(function(e,t,n,a){var o=[];if(n&&n.length>0){var i=n.filter((function(t){return e[t]})).map((function(t){return e[t]}));i&&i.length>0&&o.push.apply(o,r.__spread(i))}if(a&&a.length>0){var s=a.filter((function(e){return t[e]})).map((function(e){return t[e]}));s&&s.length>0&&o.push.apply(o,r.__spread(s))}return o}))},t.makeGetDisplayName=function(){return a.createSelector((function(e,t){return h(e,t)}),s.getTeammateNameDisplaySetting,(function(e,t,n){return void 0===n&&(n=!0),n}),(function(e,t,n){return u.displayUsername(e,t,n)}))},t.getProfilesInGroup=a.createSelector(o.getUsers,p,(function(e,t){return t}),(function(e,t,n){return n}),(function(e,t,n,r){return M(b(e,r),t[n]||new Set)})),t.searchProfilesInGroup=function(e,n,r,a,i){void 0===a&&(a=!1);var s=u.filterProfilesMatchingTerm(t.getProfilesInGroup(e,n,i),r);return a&&y(s,o.getCurrentUserId(e)),s}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){e.exports={}},function(e,t){e.exports=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){e.exports=n(279)},function(e,t,n){var r=n(12);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){var r=n(22),a=n(30),o=n(43);e.exports=r?function(e,t,n){return a.f(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(19);e.exports=function(e){return r[e+"Prototype"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(13),o=n(16),i=n(33),s=n(27);function u(e,t,n){var r=n().entities.users.currentUserId;"status_code"in e&&401===e.status_code&&e.url&&-1===e.url.indexOf("/login")&&r&&(a.Client4.setToken(""),t({type:o.UserTypes.LOGOUT_SUCCESS,data:{}}))}function c(e,t,n){-1===e.indexOf("SUCCESS")?n(l(e,t)):n(d(e))}function d(e){return{type:e,data:null}}function l(e,t){return{type:e,data:t}}function f(e,t){return{type:e,error:t}}t.forceLogoutIfNecessary=u,t.requestData=d,t.requestSuccess=l,t.requestFailure=f,t.bindClientFunc=function(e){var t=this,n=e.clientFunc,a=e.onRequest,o=e.onSuccess,l=e.onFailure,_=e.params,p=void 0===_?[]:_;return function(e,_){return r.__awaiter(t,void 0,void 0,(function(){var t,m,h;return r.__generator(this,(function(M){switch(M.label){case 0:a&&e(d(a)),t=null,M.label=1;case 1:return M.trys.push([1,3,,4]),[4,n.apply(void 0,r.__spread(p))];case 2:return t=M.sent(),[3,4];case 3:return u(m=M.sent(),e,_),h=[s.logError(m)],l&&h.push(f(l,m)),e(i.batchActions(h)),[2,{error:m}];case 4:return Array.isArray(o)?o.forEach((function(n){c(n,t,e)})):o&&c(o,t,e),[2,{data:t}]}}))}))}},t.debounce=function(e,t,n,r){var a;return function(){for(var o=this,i=[],s=0;s=0;n--)if(t[n].id===e)return t.splice(n,1),t;return t},t.getSuggestionsSplitBy=d,t.getSuggestionsSplitByMultiple=l,t.filterProfilesMatchingTerm=function(e,t){var n=t.toLowerCase();return n.startsWith("@")&&(n=n.substr(1)),e.filter((function(e){if(!e)return!1;var t=[],o=l((e.username||"").toLowerCase(),a.General.AUTOCOMPLETE_SPLIT_CHARACTERS);t.push.apply(t,r.__spread(o));var i=(e.first_name||"").toLowerCase(),s=(e.last_name||"").toLowerCase(),u=i+" "+s;t.push(i,s,u),t.push((e.nickname||"").toLowerCase()),t.push((e.position||"").toLowerCase());var c=(e.email||"").toLowerCase();t.push(c);var d=c.split("@");return d.length>1&&t.push(d[1]),t.filter((function(e){return""!==e})).some((function(e){return e.startsWith(n)}))}))},t.sortByUsername=function(e,t){var n=e.username,r=t.username;return n.localeCompare(r)},t.applyRolesFilters=function(e,t,n){var r=!e.roles.includes(a.General.SYSTEM_ADMIN_ROLE)&&!e.roles.includes(a.General.SYSTEM_GUEST_ROLE);return t.some((function(t){var o=t.includes("system");return o&&e.roles.includes(t)&&(t===a.General.SYSTEM_USER_ROLE&&r||t!==a.General.SYSTEM_USER_ROLE)||!o&&r&&(t===a.General.TEAM_ADMIN_ROLE&&(null==n?void 0:n.scheme_admin)||t===a.General.CHANNEL_ADMIN_ROLE&&(null==n?void 0:n.scheme_admin)||t===a.General.TEAM_USER_ROLE&&(null==n?void 0:n.scheme_user)&&!(null==n?void 0:n.scheme_admin)||t===a.General.CHANNEL_USER_ROLE&&(null==n?void 0:n.scheme_user)&&!(null==n?void 0:n.scheme_admin))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3);function a(e,t){return e+"--"+t}t.getPreferenceKey=a,t.getPreferencesByCategory=function(e,t){var n=t+"--",r=new Map;return Object.keys(e).forEach((function(t){t.startsWith(n)&&r.set(t.substring(n.length),e[t])})),r},t.isChannelFavorite=function(e,t){var n=e[a(r.Preferences.CATEGORY_FAVORITE_CHANNEL,t)];return Boolean(n&&"false"!==n.value)}},function(e,t,n){var r=n(68),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},function(e,t,n){var r=n(22),a=n(12),o=n(15),i=Object.defineProperty,s={},u=function(e){throw e};e.exports=function(e,t){if(o(s,e))return s[e];t||(t={});var n=[][e],c=!!o(t,"ACCESSORS")&&t.ACCESSORS,d=o(t,0)?t[0]:u,l=o(t,1)?t[1]:void 0;return s[e]=!!n&&!a((function(){if(c&&!r)return!0;var e={length:-1};c?i(e,1,{enumerable:!0,get:u}):e[1]=1,n.call(e,d,l)}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(33),o=n(13),i=n(3),s=n(16),u=n(255),c=n(456),d=n(457),l=n(61),f=n(48),_=n(35),p=n(14),m=n(9),h=n(17),M=n(27),b=n(25),y=n(88);function g(e){var t=this;return function(n){return r.__awaiter(t,void 0,void 0,(function(){var t,i;return r.__generator(this,(function(r){switch(r.label){case 0:n({type:s.UserTypes.CHECK_MFA_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.checkUserMfa(e)];case 2:return t=r.sent(),n({type:s.UserTypes.CHECK_MFA_SUCCESS,data:null}),[2,{data:t.mfa_required}];case 3:return i=r.sent(),n(a.batchActions([{type:s.UserTypes.CHECK_MFA_FAILURE,error:i},M.logError(i)])),[2,{error:i}];case 4:return[2]}}))}))}}function E(e){return b.bindClientFunc({clientFunc:o.Client4.generateMfaSecret,params:[e]})}function A(e,t,n,i){var u=this;return void 0===n&&(n=""),void 0===i&&(i=!1),function(c,d){return r.__awaiter(u,void 0,void 0,(function(){var u,l,f;return r.__generator(this,(function(r){switch(r.label){case 0:c({type:s.UserTypes.LOGIN_REQUEST,data:null}),u=d().entities.general.deviceToken,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.login(e,t,n,u,i)];case 2:return l=r.sent(),[3,4];case 3:return f=r.sent(),c(a.batchActions([{type:s.UserTypes.LOGIN_FAILURE,error:f},M.logError(f)])),[2,{error:f}];case 4:return[2,L(l)(c,d)]}}))}))}}function L(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,f,_,h,b,g,E,A,L,T,v,S,C,O,N,w,D,z,I,R,k,P,Y,U,W,q,x,H,B;return r.__generator(this,(function(j){switch(j.label){case 0:n({type:s.UserTypes.RECEIVED_ME,data:e}),o.Client4.setUserId(e.id),o.Client4.setUserRoles(e.roles),j.label=1;case 1:return j.trys.push([1,4,,5]),f=o.Client4.getMyTeamMembers(),_=o.Client4.getMyTeamUnreads(),[4,f];case 2:return t=j.sent(),[4,_];case 3:if(h=j.sent()){b=function(e){var n=t.findIndex((function(t){return t.team_id===e.team_id})),r=t[n];r.mention_count=e.mention_count,r.msg_count=e.msg_count};try{for(g=r.__values(h),E=g.next();!E.done;E=g.next())A=E.value,b(A)}catch(e){P={error:e}}finally{try{E&&!E.done&&(Y=g.return)&&Y.call(g)}finally{if(P)throw P.error}}}return[3,5];case 4:return L=j.sent(),n(a.batchActions([{type:s.UserTypes.LOGIN_FAILURE,error:L},M.logError(L)])),[2,{error:L}];case 5:T=[n(y.getMyPreferences()),n(d.getMyTeams()),n(c.getClientConfig())],v=o.Client4.getServerVersion(),n(c.setServerVersion(v)),p.isMinimumServerVersion(v,4,7)||"true"!==m.getConfig(i()).EnableCustomEmoji||n(u.getAllCustomEmojis()),j.label=6;case 6:return j.trys.push([6,8,,9]),[4,Promise.all(T)];case 7:return j.sent(),[3,9];case 8:return S=j.sent(),n(a.batchActions([{type:s.UserTypes.LOGIN_FAILURE,error:S},M.logError(S)])),[2,{error:S}];case 9:n(a.batchActions([{type:s.TeamTypes.RECEIVED_MY_TEAM_MEMBERS,data:t},{type:s.UserTypes.LOGIN_SUCCESS}])),C=new Set;try{for(O=r.__values(e.roles.split(" ")),N=O.next();!N.done;N=O.next())k=N.value,C.add(k)}catch(e){U={error:e}}finally{try{N&&!N.done&&(W=O.return)&&W.call(O)}finally{if(U)throw U.error}}try{for(w=r.__values(t),D=w.next();!D.done;D=w.next()){z=D.value;try{for(H=void 0,I=r.__values(z.roles.split(" ")),R=I.next();!R.done;R=I.next())k=R.value,C.add(k)}catch(e){H={error:e}}finally{try{R&&!R.done&&(B=I.return)&&B.call(I)}finally{if(H)throw H.error}}}}catch(e){q={error:e}}finally{try{D&&!D.done&&(x=w.return)&&x.call(w)}finally{if(q)throw q.error}}return C.size>0&&n(l.loadRolesIfNeeded(C)),[2,{data:!0}]}}))}))}}function T(){var e=this;return function(t){return r.__awaiter(e,void 0,void 0,(function(){return r.__generator(this,(function(e){switch(e.label){case 0:t({type:s.UserTypes.LOGOUT_REQUEST,data:null}),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,o.Client4.logout()];case 2:return e.sent(),[3,4];case 3:return e.sent(),[3,4];case 4:return t({type:s.UserTypes.LOGOUT_SUCCESS,data:null}),[2,{data:!0}]}}))}))}}function v(){return b.bindClientFunc({clientFunc:o.Client4.getTotalUsersStats,onSuccess:s.UserTypes.RECEIVED_USER_STATS})}function S(e,t,n){var a=this;return void 0===e&&(e=0),void 0===t&&(t=i.General.PROFILE_CHUNK_SIZE),void 0===n&&(n={}),function(i,u){return r.__awaiter(a,void 0,void 0,(function(){var a,c,d;return r.__generator(this,(function(r){switch(r.label){case 0:a=u().entities.users.currentUserId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.getProfiles(e,t,n)];case 2:return c=r.sent(),_.removeUserFromList(a,c),[3,4];case 3:return d=r.sent(),b.forceLogoutIfNecessary(d,i,u),i(M.logError(d)),[2,{error:d}];case 4:return i({type:s.UserTypes.RECEIVED_PROFILES_LIST,data:c}),[2,{data:c}]}}))}))}}function C(e,t){var n=this;return function(a,i){return r.__awaiter(n,void 0,void 0,(function(){var n,u,c;return r.__generator(this,(function(r){switch(r.label){case 0:n=i().entities.users.currentUserId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.getProfilesByIds(e,t)];case 2:return u=r.sent(),_.removeUserFromList(n,u),[3,4];case 3:return c=r.sent(),b.forceLogoutIfNecessary(c,a,i),a(M.logError(c)),[2,{error:c}];case 4:return a({type:s.UserTypes.RECEIVED_PROFILES_LIST,data:u}),[2,{data:u}]}}))}))}}function O(e){var t=this;return function(n,a){return r.__awaiter(t,void 0,void 0,(function(){var t,i,u;return r.__generator(this,(function(r){switch(r.label){case 0:t=a().entities.users.currentUserId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.getProfilesByUsernames(e)];case 2:return i=r.sent(),_.removeUserFromList(t,i),[3,4];case 3:return u=r.sent(),b.forceLogoutIfNecessary(u,n,a),n(M.logError(u)),[2,{error:u}];case 4:return n({type:s.UserTypes.RECEIVED_PROFILES_LIST,data:i}),[2,{data:i}]}}))}))}}function N(e,t,n,u,c){var d=this;return void 0===n&&(n=i.General.PROFILE_CHUNK_SIZE),void 0===u&&(u=""),void 0===c&&(c={}),function(i,l){return r.__awaiter(d,void 0,void 0,(function(){var d,f,p;return r.__generator(this,(function(m){switch(m.label){case 0:d=l().entities.users.currentUserId,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,o.Client4.getProfilesInTeam(e,t,n,u,c)];case 2:return f=m.sent(),[3,4];case 3:return p=m.sent(),b.forceLogoutIfNecessary(p,i,l),i(M.logError(p)),[2,{error:p}];case 4:return i(a.batchActions([{type:s.UserTypes.RECEIVED_PROFILES_LIST_IN_TEAM,data:f,id:e},{type:s.UserTypes.RECEIVED_PROFILES_LIST,data:_.removeUserFromList(d,r.__spread(f))}])),[2,{data:f}]}}))}))}}function w(e,t,n,u){var c=this;return void 0===n&&(n=i.General.PROFILE_CHUNK_SIZE),void 0===u&&(u=""),function(i,d){return r.__awaiter(c,void 0,void 0,(function(){var c,l,f;return r.__generator(this,(function(p){switch(p.label){case 0:c=d().entities.users.currentUserId,p.label=1;case 1:return p.trys.push([1,3,,4]),[4,o.Client4.getProfilesInChannel(e,t,n,u)];case 2:return l=p.sent(),[3,4];case 3:return f=p.sent(),b.forceLogoutIfNecessary(f,i,d),i(M.logError(f)),[2,{error:f}];case 4:return i(a.batchActions([{type:s.UserTypes.RECEIVED_PROFILES_LIST_IN_CHANNEL,data:l,id:e},{type:s.UserTypes.RECEIVED_PROFILES_LIST,data:_.removeUserFromList(c,r.__spread(l))}])),[2,{data:l}]}}))}))}}function D(e,t,n,u,c){var d=this;return void 0===c&&(c=i.General.PROFILE_CHUNK_SIZE),function(i,l){return r.__awaiter(d,void 0,void 0,(function(){var d,f,p,m;return r.__generator(this,(function(h){switch(h.label){case 0:d=l().entities.users.currentUserId,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,o.Client4.getProfilesNotInChannel(e,t,n,u,c)];case 2:return f=h.sent(),[3,4];case 3:return p=h.sent(),b.forceLogoutIfNecessary(p,i,l),i(M.logError(p)),[2,{error:p}];case 4:return m=n?s.UserTypes.RECEIVED_PROFILES_LIST_NOT_IN_CHANNEL_AND_REPLACE:s.UserTypes.RECEIVED_PROFILES_LIST_NOT_IN_CHANNEL,i(a.batchActions([{type:m,data:f,id:t},{type:s.UserTypes.RECEIVED_PROFILES_LIST,data:_.removeUserFromList(d,r.__spread(f))}])),[2,{data:f}]}}))}))}}function z(){var e=this;return function(t,n){return r.__awaiter(e,void 0,void 0,(function(){var e;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,b.bindClientFunc({clientFunc:o.Client4.getMe,onSuccess:s.UserTypes.RECEIVED_ME})(t,n)];case 1:return"error"in(e=r.sent())||"data"in e&&t(l.loadRolesIfNeeded(e.data.roles.split(" "))),[2,e]}}))}))}}function I(e,t){var n=this;return function(a,i){return r.__awaiter(n,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,a(b.bindClientFunc({clientFunc:o.Client4.updateMyTermsOfServiceStatus,params:[e,t]}))];case 1:return"data"in(n=r.sent())?(t&&a({type:s.UserTypes.RECEIVED_TERMS_OF_SERVICE_STATUS,data:{terms_of_service_create_at:(new Date).getTime(),terms_of_service_id:t?e:null,user_id:h.getCurrentUserId(i())}}),[2,{data:n.data}]):[2,{error:n.error}]}}))}))}}function R(){return b.bindClientFunc({clientFunc:o.Client4.getTermsOfService})}function k(e){return b.bindClientFunc({clientFunc:o.Client4.createTermsOfService,params:[e]})}function P(e){return b.bindClientFunc({clientFunc:o.Client4.getUser,onSuccess:s.UserTypes.RECEIVED_PROFILE,params:[e]})}function Y(e){return b.bindClientFunc({clientFunc:o.Client4.getUserByUsername,onSuccess:s.UserTypes.RECEIVED_PROFILE,params:[e]})}t.checkMfa=g,t.generateMfaSecret=E,t.createUser=function(e,t,n,a){var i=this;return function(u,c){return r.__awaiter(i,void 0,void 0,(function(){var i,d,l,f;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.createUser(e,t,n,a)];case 1:return i=r.sent(),[3,3];case 2:return d=r.sent(),b.forceLogoutIfNecessary(d,u,c),u(M.logError(d)),[2,{error:d}];case 3:return(f={})[i.id]=i,l=f,u({type:s.UserTypes.RECEIVED_PROFILES,data:l}),[2,{data:i}]}}))}))}},t.login=A,t.loginById=function(e,t,n){var i=this;return void 0===n&&(n=""),function(u,c){return r.__awaiter(i,void 0,void 0,(function(){var i,d,l;return r.__generator(this,(function(r){switch(r.label){case 0:u({type:s.UserTypes.LOGIN_REQUEST,data:null}),i=c().entities.general.deviceToken,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.loginById(e,t,n,i)];case 2:return d=r.sent(),[3,4];case 3:return l=r.sent(),u(a.batchActions([{type:s.UserTypes.LOGIN_FAILURE,error:l},M.logError(l)])),[2,{error:l}];case 4:return[2,L(d)(u,c)]}}))}))}},t.loadMe=function(){var e=this;return function(t,n){return r.__awaiter(e,void 0,void 0,(function(){var e,a,i,s,l,f,_;return r.__generator(this,(function(r){switch(r.label){case 0:return e=n(),a=m.getConfig(e),(i=e.entities.general.deviceToken)&&o.Client4.attachDevice(i),s=[t(z()),t(y.getMyPreferences()),t(d.getMyTeams()),t(d.getMyTeamMembers()),t(d.getMyTeamUnreads())],l=o.Client4.getServerVersion()||n().entities.general.serverVersion,t(c.setServerVersion(l)),p.isMinimumServerVersion(l,4,7)||"true"!==a.EnableCustomEmoji||t(u.getAllCustomEmojis()),[4,Promise.all(s)];case 1:return r.sent(),f=n().entities.users.currentUserId,_=n().entities.users.profiles[f],f&&o.Client4.setUserId(f),_&&o.Client4.setUserRoles(_.roles),[2,{data:!0}]}}))}))}},t.logout=T,t.getTotalUsersStats=v,t.getFilteredUsersStats=function(e){var t=this;return void 0===e&&(e={}),function(n,a){return r.__awaiter(t,void 0,void 0,(function(){var t,i;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getFilteredUsersStats(e)];case 1:return t=r.sent(),[3,3];case 2:return i=r.sent(),b.forceLogoutIfNecessary(i,n,a),n(M.logError(i)),[2,{error:i}];case 3:return n({type:s.UserTypes.RECEIVED_FILTERED_USER_STATS,data:t}),[2,{data:t}]}}))}))}},t.getProfiles=S,t.getMissingProfilesByIds=function(e){var t=this;return function(n,a){return r.__awaiter(t,void 0,void 0,(function(){var t,o;return r.__generator(this,(function(r){return t=a().entities.users.profiles,o=[],e.forEach((function(e){t[e]||o.push(e)})),o.length>0?(x(o)(n,a),[2,C(o)(n,a)]):[2,{data:[]}]}))}))}},t.getMissingProfilesByUsernames=function(e){var t=this;return function(n,a){return r.__awaiter(t,void 0,void 0,(function(){var t,o,i;return r.__generator(this,(function(r){return t=a().entities.users.profiles,o=Object.values(t).reduce((function(e,t){return e[t.username]=t,e}),{}),i=[],e.forEach((function(e){o[e]||i.push(e)})),i.length>0?[2,O(i)(n,a)]:[2,{data:[]}]}))}))}},t.getProfilesByIds=C,t.getProfilesByUsernames=O,t.getProfilesInTeam=N,t.getProfilesNotInTeam=function(e,t,n,u){var c=this;return void 0===u&&(u=i.General.PROFILE_CHUNK_SIZE),function(i,d){return r.__awaiter(c,void 0,void 0,(function(){var c,l,f;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getProfilesNotInTeam(e,t,n,u)];case 1:return c=r.sent(),[3,3];case 2:return l=r.sent(),b.forceLogoutIfNecessary(l,i,d),i(M.logError(l)),[2,{error:l}];case 3:return f=t?s.UserTypes.RECEIVED_PROFILES_LIST_NOT_IN_TEAM_AND_REPLACE:s.UserTypes.RECEIVED_PROFILES_LIST_NOT_IN_TEAM,i(a.batchActions([{type:f,data:c,id:e},{type:s.UserTypes.RECEIVED_PROFILES_LIST,data:c}])),[2,{data:c}]}}))}))}},t.getProfilesWithoutTeam=function(e,t,n){var u=this;return void 0===t&&(t=i.General.PROFILE_CHUNK_SIZE),void 0===n&&(n={}),function(i,c){return r.__awaiter(u,void 0,void 0,(function(){var u,d;return r.__generator(this,(function(r){switch(r.label){case 0:u=null,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.getProfilesWithoutTeam(e,t,n)];case 2:return u=r.sent(),[3,4];case 3:return d=r.sent(),b.forceLogoutIfNecessary(d,i,c),i(M.logError(d)),[2,{error:d}];case 4:return i(a.batchActions([{type:s.UserTypes.RECEIVED_PROFILES_LIST_WITHOUT_TEAM,data:u},{type:s.UserTypes.RECEIVED_PROFILES_LIST,data:u}])),[2,{data:u}]}}))}))}},t.getProfilesInChannel=w,t.getProfilesInGroupChannels=function(e){var t=this;return function(n,u){return r.__awaiter(t,void 0,void 0,(function(){var t,c,d,l,f,p;return r.__generator(this,(function(m){switch(m.label){case 0:t=u().entities.users.currentUserId,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,o.Client4.getProfilesInGroupChannels(e.slice(0,i.General.MAX_GROUP_CHANNELS_FOR_PROFILES))];case 2:return c=m.sent(),[3,4];case 3:return d=m.sent(),b.forceLogoutIfNecessary(d,n,u),n(M.logError(d)),[2,{error:d}];case 4:for(f in l=[],c)c.hasOwnProperty(f)&&(p=c[f],l.push({type:s.UserTypes.RECEIVED_PROFILES_LIST_IN_CHANNEL,data:p,id:f},{type:s.UserTypes.RECEIVED_PROFILES_LIST,data:_.removeUserFromList(t,r.__spread(p))}));return n(a.batchActions(l)),[2,{data:c}]}}))}))}},t.getProfilesNotInChannel=D,t.getMe=z,t.updateMyTermsOfServiceStatus=I,t.getProfilesInGroup=function(e,t,n){var u=this;return void 0===t&&(t=0),void 0===n&&(n=i.General.PROFILE_CHUNK_SIZE),function(i,c){return r.__awaiter(u,void 0,void 0,(function(){var u,d,l;return r.__generator(this,(function(f){switch(f.label){case 0:u=c().entities.users.currentUserId,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,o.Client4.getProfilesInGroup(e,t,n)];case 2:return d=f.sent(),[3,4];case 3:return l=f.sent(),b.forceLogoutIfNecessary(l,i,c),i(M.logError(l)),[2,{error:l}];case 4:return i(a.batchActions([{type:s.UserTypes.RECEIVED_PROFILES_LIST_IN_GROUP,data:d,id:e},{type:s.UserTypes.RECEIVED_PROFILES_LIST,data:_.removeUserFromList(u,r.__spread(d))}])),[2,{data:d}]}}))}))}},t.getTermsOfService=R,t.promoteGuestToUser=function(e){return b.bindClientFunc({clientFunc:o.Client4.promoteGuestToUser,params:[e]})},t.demoteUserToGuest=function(e){return b.bindClientFunc({clientFunc:o.Client4.demoteUserToGuest,params:[e]})},t.createTermsOfService=k,t.getUser=P,t.getUserByUsername=Y,t.getUserByEmail=function(e){return b.bindClientFunc({clientFunc:o.Client4.getUserByEmail,onSuccess:s.UserTypes.RECEIVED_PROFILE,params:[e]})};var U,W=[],q=b.debounce((function(e,t){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(n){return x(r.__spread(new Set(W)))(e,t),[2]}))}))}),20,!1,(function(){W=[]}));function x(e){return b.bindClientFunc({clientFunc:o.Client4.getStatusesByIds,onSuccess:s.UserTypes.RECEIVED_STATUSES,params:[e]})}function H(e){return b.bindClientFunc({clientFunc:o.Client4.getStatus,onSuccess:s.UserTypes.RECEIVED_STATUS,params:[e]})}function B(e){return b.bindClientFunc({clientFunc:o.Client4.getSessions,onSuccess:s.UserTypes.RECEIVED_SESSIONS,params:[e]})}function j(e,t){var n=this;return function(a,i){return r.__awaiter(n,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.revokeSession(e,t)];case 1:return r.sent(),[3,3];case 2:return n=r.sent(),b.forceLogoutIfNecessary(n,a,i),a(M.logError(n)),[2,{error:n}];case 3:return a({type:s.UserTypes.RECEIVED_REVOKED_SESSION,sessionId:t,data:null}),[2,{data:!0}]}}))}))}}function F(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,u;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.revokeAllSessionsForUser(e)];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),b.forceLogoutIfNecessary(t,n,i),n(M.logError(t)),[2,{error:t}];case 3:return u={isCurrentUser:e===h.getCurrentUserId(i())},n(a.batchActions([{type:s.UserTypes.REVOKE_ALL_USER_SESSIONS_SUCCESS,data:u}])),[2,{data:!0}]}}))}))}}function X(){var e=this;return function(t,n){return r.__awaiter(e,void 0,void 0,(function(){var e;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.revokeSessionsForAllUsers()];case 1:return r.sent(),[3,3];case 2:return e=r.sent(),b.forceLogoutIfNecessary(e,t,n),t(M.logError(e)),[2,{error:e}];case 3:return t({type:s.UserTypes.REVOKE_SESSIONS_FOR_ALL_USERS_SUCCESS,data:null}),[2,{data:!0}]}}))}))}}function G(){var e=this;return function(t,n){return r.__awaiter(e,void 0,void 0,(function(){var e,a,o,i,s,u,c,d,l,_,p,m,h,M;return r.__generator(this,(function(r){for(e=n(),a=e.entities.general.config,o=e.entities.channels,i=o.channels,s=o.myMembers,u=e.entities.preferences.myPreferences,c=e.entities.users,d=c.currentUserId,l=c.profiles,_=Object.values(i),p=0;p<_.length;p++)m=_[p],h=s[m.id],(f.isDirectChannel(m)||f.isGroupChannel(m))&&h&&(h.mention_count>0&&f.isDirectChannel(m)?(M=f.getUserIdFromChannelName(d,m.name),f.isDirectChannelVisible(l[M]||M,a,u,m)||y.makeDirectChannelVisibleIfNecessary(M)(t,n)):(h.mention_count>0||h.msg_countc)return!1;var l=t[o.Preferences.CATEGORY_CHANNEL_OPEN_TIME+"--"+n.id],f=l?parseInt(l.value,10):0;if(n.id!==i&&a&&a>f)return!0;if("true"!==e.CloseUnusedDirectMessages||b(t,n.id))return!1;var _=t[u.getPreferenceKey(o.Preferences.CATEGORY_SIDEBAR_SETTINGS,o.Preferences.CHANNEL_SIDEBAR_AUTOCLOSE_DMS)];if(!_||_.value===o.Preferences.AUTOCLOSE_DMS_ENABLED){if(r&&r>c)return!1;if(f>c)return!1;var p=n.last_post_at;return!p||p0||Boolean(r)&&!a}return!1}function g(e){return e.replace(/[.,'"\/#!$%\^&\*;:{}=\-_`~()]/g,"")}function E(e,t,n){return t.display_name&&n.display_name&&t.display_name!==n.display_name?t.display_name.toLowerCase().localeCompare(n.display_name.toLowerCase(),e,{numeric:!0}):t.name.toLowerCase().localeCompare(n.name.toLowerCase(),e,{numeric:!0})}function A(e){return!(!e||!e.notify_props)&&"mention"===e.notify_props.mark_unread}t.completeDirectChannelInfo=function(e,t,n){if(_(n)){var r=l(e.currentUserId,n.name);return a.__assign(a.__assign({},n),{display_name:c.displayUsername(e.profiles[r],t,!1),teammate_id:r,status:e.statuses[r]||"offline"})}return m(n)?function(e,t,n){var r=e.currentUserId,o=e.profiles,i=e.profilesInChannel[n.id],s=a.__assign({},n);if(i)return s.display_name=M(i,o,r,t),s;var u=s.display_name.split(", "),c=Object.keys(o).map((function(e){return o[e]})),d=[];if(u.forEach((function(e){var t=c.find((function(t){return t.username===e}));t&&d.push(t.id)})),u.length===d.length)return s.display_name=M(d,o,r,t),s;return n}(e,t,n):n},t.completeDirectChannelDisplayName=function(e,t,n,r,o){if(_(o)){var i=a.__assign({},o),s=l(e,o.name);return Object.assign(i,{display_name:c.displayUsername(t[s],r)})}if(m(o)&&n&&n.size>0){var u=M(Array.from(n),t,e,r);return a.__assign(a.__assign({},o),{display_name:u})}return o},t.cleanUpUrlable=function(e){var t=e.trim().replace(/-/g," ").replace(/[^\w\s]/gi,"").toLowerCase().replace(/\s/g,"-");return t=(t=(t=t.replace(/-{2,}/,"-")).replace(/^-+/,"")).replace(/-+$/,"")},t.getChannelByName=function(e,t){for(var n=Object.keys(e),r=0;re?e+"__"+t:t+"__"+e},t.getUserIdFromChannelName=l,t.isAutoClosed=f,t.isDirectChannel=_,t.isDirectChannelVisible=p,t.isGroupChannel=m,t.isGroupChannelVisible=h,t.isGroupOrDirectChannelVisible=function(e,t,n,r,a,o,i,s,u){var c=i[e.id];if(m(e)&&h(n,r,e,c,y(t,e),u))return!0;if(!_(e))return!1;var d=l(a,e.name);return p(o[d]||d,n,r,e,c,y(t,e),s,u)},t.showCreateOption=function(e,t,n,r,a,u,c){if(i.hasNewPermissions(e))return a===o.General.OPEN_CHANNEL?s.haveITeamPermission(e,{team:r,permission:o.Permissions.CREATE_PUBLIC_CHANNEL}):a!==o.General.PRIVATE_CHANNEL||s.haveITeamPermission(e,{team:r,permission:o.Permissions.CREATE_PRIVATE_CHANNEL});if("true"!==n.IsLicensed)return!0;if(a===o.General.OPEN_CHANNEL){if(t.RestrictPublicChannelCreation===o.General.SYSTEM_ADMIN_ROLE&&!c)return!1;if(t.RestrictPublicChannelCreation===o.General.TEAM_ADMIN_ROLE&&!u)return!1}else if(a===o.General.PRIVATE_CHANNEL){if(t.RestrictPrivateChannelCreation===o.General.SYSTEM_ADMIN_ROLE&&!c)return!1;if(t.RestrictPrivateChannelCreation===o.General.TEAM_ADMIN_ROLE&&!u)return!1}return!0},t.showManagementOptions=function(e,t,n,r,a,u,c){if(i.hasNewPermissions(e))return r.type===o.General.OPEN_CHANNEL?s.haveIChannelPermission(e,{channel:r.id,team:r.team_id,permission:o.Permissions.MANAGE_PUBLIC_CHANNEL_PROPERTIES}):r.type!==o.General.PRIVATE_CHANNEL||s.haveIChannelPermission(e,{channel:r.id,team:r.team_id,permission:o.Permissions.MANAGE_PRIVATE_CHANNEL_PROPERTIES});if("true"!==n.IsLicensed)return!0;if(r.type===o.General.OPEN_CHANNEL){if(t.RestrictPublicChannelManagement===o.General.SYSTEM_ADMIN_ROLE&&!u)return!1;if(t.RestrictPublicChannelManagement===o.General.TEAM_ADMIN_ROLE&&!a)return!1;if(t.RestrictPublicChannelManagement===o.General.CHANNEL_ADMIN_ROLE&&!c&&!a)return!1}else if(r.type===o.General.PRIVATE_CHANNEL){if(t.RestrictPrivateChannelManagement===o.General.SYSTEM_ADMIN_ROLE&&!u)return!1;if(t.RestrictPrivateChannelManagement===o.General.TEAM_ADMIN_ROLE&&!a)return!1;if(t.RestrictPrivateChannelManagement===o.General.CHANNEL_ADMIN_ROLE&&!c&&!a)return!1}return!0},t.showDeleteOption=function(e,t,n,r,a,u,c){if(i.hasNewPermissions(e))return r.type===o.General.OPEN_CHANNEL?s.haveIChannelPermission(e,{channel:r.id,team:r.team_id,permission:o.Permissions.DELETE_PUBLIC_CHANNEL}):r.type!==o.General.PRIVATE_CHANNEL||s.haveIChannelPermission(e,{channel:r.id,team:r.team_id,permission:o.Permissions.DELETE_PRIVATE_CHANNEL});if("true"!==n.IsLicensed)return!0;if(r.type===o.General.OPEN_CHANNEL){if(t.RestrictPublicChannelDeletion===o.General.SYSTEM_ADMIN_ROLE&&!u)return!1;if(t.RestrictPublicChannelDeletion===o.General.TEAM_ADMIN_ROLE&&!a)return!1;if(t.RestrictPublicChannelDeletion===o.General.CHANNEL_ADMIN_ROLE&&!c&&!a)return!1}else if(r.type===o.General.PRIVATE_CHANNEL){if(t.RestrictPrivateChannelDeletion===o.General.SYSTEM_ADMIN_ROLE&&!u)return!1;if(t.RestrictPrivateChannelDeletion===o.General.TEAM_ADMIN_ROLE&&!a)return!1;if(t.RestrictPrivateChannelDeletion===o.General.CHANNEL_ADMIN_ROLE&&!c&&!a)return!1}return!0},t.canManageMembersOldPermissions=function(e,t,n,r,a,i){if(e.type===o.General.DM_CHANNEL||e.type===o.General.GM_CHANNEL||e.name===o.General.DEFAULT_CHANNEL)return!1;if("true"!==i.IsLicensed)return!0;if(e.type===o.General.PRIVATE_CHANNEL){var s=t.roles.includes(o.General.SYSTEM_ADMIN_ROLE);if(a.RestrictPrivateChannelManageMembers===o.General.PERMISSIONS_SYSTEM_ADMIN&&!s)return!1;var u=n.roles.includes(o.General.TEAM_ADMIN_ROLE);if(a.RestrictPrivateChannelManageMembers===o.General.PERMISSIONS_TEAM_ADMIN&&!u&&!s)return!1;var c=r.roles.includes(o.General.CHANNEL_ADMIN_ROLE);if(a.RestrictPrivateChannelManageMembers===o.General.PERMISSIONS_CHANNEL_ADMIN&&!c&&!u&&!s)return!1}return!0},t.getChannelsIdForTeam=function(e,t){var n=e.entities.channels.channels;return Object.keys(n).map((function(e){return n[e]})).reduce((function(e,n){return n.team_id===t&&e.push(n.id),e}),[])},t.getGroupDisplayNameFromUserIds=M,t.isFavoriteChannelOld=b,t.isDefault=function(e){return e.name===o.General.DEFAULT_CHANNEL},t.isUnreadChannel=y,t.isOpenChannel=function(e){return e.type===o.General.OPEN_CHANNEL},t.isPrivateChannel=function(e){return e.type===o.General.PRIVATE_CHANNEL},t.sortChannelsByTypeAndDisplayName=function(e,t,n){if(d[t.type]!==d[n.type])return d[t.type]t.last_post_at&&(r=e[t.id].create_at);var a=n.last_post_at;return e[n.id]&&e[n.id].create_at>n.last_post_at&&(a=e[n.id].create_at),a-r},t.isChannelMuted=A,t.areChannelMentionsIgnored=function(e,t){var n=o.Users.IGNORE_CHANNEL_MENTIONS_OFF;t.channel&&"false"===t.channel&&(n=o.Users.IGNORE_CHANNEL_MENTIONS_ON);var r=e&&e.ignore_channel_mentions;return r&&r!==o.Users.IGNORE_CHANNEL_MENTIONS_DEFAULT||(r=n),r!==o.Users.IGNORE_CHANNEL_MENTIONS_OFF},t.filterChannelsMatchingTerm=function(e,t){var n=t.toLowerCase();return e.filter((function(e){if(!e)return!1;var t=(e.name||"").toLowerCase(),r=(e.display_name||"").toLowerCase();return t.startsWith(n)||r.startsWith(n)}))}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a;"undefined"!=typeof window?a=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),a=void 0):a=self;var o=n(458),i=n(459),s=n(460),u=n(463),c=n(257),d=n(464),l=n(466);function f(){}e.exports=function(e,n){return"function"==typeof n?new t.Request("GET",e).end(n):1===arguments.length?new t.Request("GET",e):new t.Request(e,n)};var _=t=e.exports;t.Request=g,_.getXHR=function(){if(a.XMLHttpRequest&&(!a.location||"file:"!==a.location.protocol||!a.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("Browser-only version of superagent could not find XHR")};var p="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function m(e){if(!c(e))return e;var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&h(t,n,e[n]);return t.join("&")}function h(e,t,n){if(void 0!==n)if(null!==n)if(Array.isArray(n))n.forEach((function(n){h(e,t,n)}));else if(c(n))for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&h(e,"".concat(t,"[").concat(r,"]"),n[r]);else e.push(encodeURI(t)+"="+encodeURIComponent(n));else e.push(encodeURI(t))}function M(e){for(var t,n,r={},a=e.split("&"),o=0,i=a.length;o0||e instanceof Object)?t(e):null)},y.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,r="cannot ".concat(t," ").concat(n," (").concat(this.status,")"),a=new Error(r);return a.status=this.status,a.method=t,a.url=n,a},_.Response=y,o(g.prototype),u(g.prototype),g.prototype.type=function(e){return this.set("Content-Type",_.types[e]||e),this},g.prototype.accept=function(e){return this.set("Accept",_.types[e]||e),this},g.prototype.auth=function(e,t,n){1===arguments.length&&(t=""),"object"===r(t)&&null!==t&&(n=t,t=""),n||(n={type:"function"==typeof btoa?"basic":"auto"});var a=function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,n,a)},g.prototype.query=function(e){return"string"!=typeof e&&(e=m(e)),e&&this._query.push(e),this},g.prototype.attach=function(e,t,n){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,n||t.name)}return this},g.prototype._getFormData=function(){return this._formData||(this._formData=new a.FormData),this._formData},g.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var n=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),n(e,t)},g.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},g.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},g.prototype.ca=g.prototype.agent,g.prototype.buffer=g.prototype.ca,g.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},g.prototype.pipe=g.prototype.write,g.prototype._isHost=function(e){return e&&"object"===r(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},g.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||f,this._finalizeQueryString(),this._end()},g.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},g.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=_.getXHR();var t=this.xhr,n=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var n=t.readyState;if(n>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===n){var r;try{r=t.status}catch(e){r=0}if(!r){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var r=function(t,n){n.total>0&&(n.percent=n.loaded/n.total*100,100===n.percent&&clearTimeout(e._uploadTimeoutTimer)),n.direction=t,e.emit("progress",n)};if(this.hasListeners("progress"))try{t.addEventListener("progress",r.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",r.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof n&&!this._isHost(n)){var a=this._header["content-type"],o=this._serializer||_.serialize[a?a.split(";")[0]:""];!o&&b(a)&&(o=_.serialize["application/json"]),o&&(n=o(n))}for(var i in this.header)null!==this.header[i]&&Object.prototype.hasOwnProperty.call(this.header,i)&&t.setRequestHeader(i,this.header[i]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===n?null:n)},_.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(e){l.prototype[e.toLowerCase()]=function(t,n){var r=new _.Request(e,t);return this._setDefaults(r),n&&r.end(n),r}})),l.prototype.del=l.prototype.delete,_.get=function(e,t,n){var r=_("GET",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},_.head=function(e,t,n){var r=_("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&r.query(t),n&&r.end(n),r},_.options=function(e,t,n){var r=_("OPTIONS",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},_.del=E,_.delete=E,_.patch=function(e,t,n){var r=_("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},_.post=function(e,t,n){var r=_("POST",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r},_.put=function(e,t,n){var r=_("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&r.send(t),n&&r.end(n),r}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(18);e.exports=function(e,t){if(!r(e))return e;var n,a;if(t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;if("function"==typeof(n=e.valueOf)&&!r(a=n.call(e)))return a;if(!t&&"function"==typeof(n=e.toString)&&!r(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(284)},function(e,t){e.exports=!0},function(e,t,n){"use strict";var r=n(12);e.exports=function(e,t){var n=[][e];return!!n&&r((function(){n.call(null,t||function(){throw 1},1)}))}},function(e,t){e.exports={}},function(e,t,n){var r=n(70),a=n(71),o=r("keys");e.exports=function(e){return o[e]||(o[e]=a(e))}},function(e,t,n){e.exports=n(370)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CategoryTypes={FAVORITES:"favorites",CHANNELS:"channels",DIRECT_MESSAGES:"direct_messages",CUSTOM:"custom"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a=n(1),o=n(10),i=n(3),s=n(34),u=n(28),c=n(14),d=n(86),l=n(36);function f(e){return e.entities.posts.posts}function _(e,t){return f(e)[t]}function p(e){return e.entities.posts.postsInThread}function m(e){return e.entities.posts.reactions}function h(){return c.createIdsSelector((function(e,t,n){return e.entities.posts.postsInChannel[n]}),(function(e,t){return t}),(function(e,t){var n,r,o;if(!e)return null;try{for(var i=a.__values(e),s=i.next();!s.done;s=i.next()){var u=s.value;-1!==u.order.indexOf(t)&&(o=u)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}))}function M(){var e=h();return c.createIdsSelector((function(t,n,r){return e(t,n,r)}),(function(e,t){return t}),(function(e,t,n,r){return r&&r.postsBeforeCount}),(function(e,t,n,r){return r&&r.postsAfterCount}),(function(e,t,n,r){if(void 0===n&&(n=i.Posts.POST_CHUNK_SIZE/2),void 0===r&&(r=i.Posts.POST_CHUNK_SIZE/2),!e||!e.order)return null;var a=e.order,o=a.indexOf(t),s=-1===r?0:Math.max(o-r,0),u=-1===n?a.length:Math.min(o+n+1,a.length);return a.slice(s,u)}))}function b(e,t,n,r,o,s,u,c){var l,f,_,p=!1,m=!1,h=!1;e.id===c&&(h=!0),e.root_id&&(t&&t.root_id!==e.root_id&&(p=!0,t&&t.id!==e.root_id&&(_=r[e.root_id])),(n-1<0||r[s[n-1]].root_id!==e.root_id)&&(m=!0));var M=!1;t&&t.root_id&&(M=!0);var b=Boolean(e.props&&e.props.from_webhook),y=Boolean(t&&t.props&&t.props.from_webhook),g=!1;!(t&&t.user_id===e.user_id&&e.create_at-t.create_at<=i.Posts.POST_COLLAPSE_TIMEOUT)||b||y||d.isSystemMessage(e)||d.isSystemMessage(t)||(g=!0);var E=!1,A=0,L=!1;if(u){var T=e.root_id||e.id,v=o[T]||[];try{for(var S=a.__values(v),C=S.next();!C.done;C=S.next()){var O=r[C.value];O&&(O.user_id===u.id&&(E=!0),d.isPostEphemeral(O)||(A+=1))}}catch(e){l={error:e}}finally{try{C&&!C.done&&(f=S.return)&&f.call(S)}finally{if(l)throw l.error}}var N=r[T];L=d.isPostCommentMention({post:e,currentUser:u,threadRepliedToByCurrentUser:E,rootPost:N})}return a.__assign(a.__assign({},e),{isFirstReply:p,isLastReply:m,previousPostIsComment:M,commentedOnPost:_,consecutivePostByUser:g,replyCount:A,isCommentMention:L,highlight:h})}function y(){return o.createSelector(f,p,(function(e,t){return A(e,t)}),s.getCurrentUser,u.getMyPreferences,(function(e,t,n){return n||i.Posts.POST_CHUNK_SIZE}),(function(e,t,n,r,a,o){if(!n)return null;for(var s=[],u=a[l.getPreferenceKey(i.Preferences.CATEGORY_ADVANCED_SETTINGS,i.Preferences.ADVANCED_FILTER_JOIN_LEAVE)],c=!u||"false"!==u.value,f=-1===o?n:n.slice(0,o),_=0;_=n&&a.create_at<=n)})):null}t.getAllPosts=f,t.getPost=_,t.getPostRepliesCount=function(e,t){return e.entities.posts.postsReplies[t]||0},t.getPostsInThread=p,t.getReactionsForPosts=m,t.makeGetReactionsForPost=function(){return o.createSelector(m,(function(e,t){return t}),(function(e,t){return e[t]?e[t]:null}))},t.getOpenGraphMetadata=function(e){return e.entities.posts.openGraph},t.getOpenGraphMetadataForUrl=function(e,t,n){var r=e.entities.posts.openGraph[t];return r?r[n]:void 0},t.getPostIdsInCurrentChannel=function(e){return A(e,e.entities.channels.currentChannelId)},t.getPostsInCurrentChannel=(r=y(),function(e){return r(e,e.entities.channels.currentChannelId,-1)}),t.makeGetPostIdsForThread=function(){return c.createIdsSelector(f,(function(e,t){return e.entities.posts.postsInThread[t]||[]}),(function(e,t){return e.entities.posts.posts[t]}),(function(e,t,n){var r=[];return n&&r.push(n),t.forEach((function(t){var n=e[t];n&&r.push(n)})),r.sort(d.comparePosts),r.map((function(e){return e.id}))}))},t.makeGetPostsChunkAroundPost=h,t.makeGetPostIdsAroundPost=M,t.makeGetPostsInChannel=y,t.makeGetPostsAroundPost=function(){var e=M(),t={postsBeforeCount:-1,postsAfterCount:i.Posts.POST_CHUNK_SIZE/2};return o.createSelector((function(n,r,a){return e(n,r,a,t)}),f,p,(function(e,t){return t}),s.getCurrentUser,u.getMyPreferences,(function(e,t,n,r,a,o){if(!e||!a)return null;for(var s=[],u=o[l.getPreferenceKey(i.Preferences.CATEGORY_ADVANCED_SETTINGS,i.Preferences.ADVANCED_FILTER_JOIN_LEAVE)],c=!u||"false"!==u.value,f=0;f=0&&r&&r.length>n?r[n]:""}))},t.makeGetPostsForIds=function(){return c.createIdsSelector(f,(function(e,t){return t}),(function(e,t){return t?t.map((function(t){return e[t]})):[]}))},t.getLastPostPerChannel=o.createSelector(f,(function(e){return e.entities.posts.postsInChannel}),(function(e,t){var n,r,o={};try{for(var i=a.__values(Object.entries(t)),s=i.next();!s.done;s=i.next()){var u=a.__read(s.value,2),c=u[0],d=u[1].find((function(e){return e.recent}));if(d){var l=d.order[0];e.hasOwnProperty(l)&&(o[c]=e[l])}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o})),t.getMostRecentPostIdInChannel=o.createSelector(f,(function(e,t){return A(e,t)}),u.getMyPreferences,(function(e,t,n){if(!t)return"";var r=l.getPreferenceKey(i.Preferences.CATEGORY_ADVANCED_SETTINGS,i.Preferences.ADVANCED_FILTER_JOIN_LEAVE);if(!(!n[r]||"true"===n[r].value)){for(var a=void 0,o=0;o=n?i:L(e,t,n)},t.isPostIdSending=function(e,t){return e.entities.posts.pendingPostIds.some((function(e){return e===t}))},t.makeIsPostCommentMention=function(){return o.createSelector(f,p,s.getCurrentUser,_,(function(e,t,n,r){var o,i;if(!r)return!1;var s=!1,u=!1;if(n){var c=r.root_id||r.id,l=t[c]||[];try{for(var f=a.__values(l),_=f.next();!_.done;_=f.next()){var p=e[_.value];p&&(p.user_id===n.id&&(s=!0))}}catch(e){o={error:e}}finally{try{_&&!_.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var m=e[c];u=d.isPostCommentMention({post:r,currentUser:n,threadRepliedToByCurrentUser:s,rootPost:m})}return u}))},t.getExpandedLink=function(e,t){return e.entities.posts.expandedURLs[t]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(16),o=n(13),i=n(3),s=n(58),u=n(85),c=n(84),d=n(9),l=n(28),f=n(42),_=n(17),p=n(33),m=n(48),h=n(14),M=n(453),b=n(27),y=n(25),g=n(88),E=n(61),A=n(39);function L(e){return{type:a.ChannelTypes.SELECT_CHANNEL,data:e}}function T(e,t){var n=this;return function(s,u){return r.__awaiter(n,void 0,void 0,(function(){var n,c,d,l,f,_,m;return r.__generator(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),[4,o.Client4.createChannel(e)];case 1:return n=h.sent(),[3,3];case 2:return c=h.sent(),y.forceLogoutIfNecessary(c,s,u),s(p.batchActions([{type:a.ChannelTypes.CREATE_CHANNEL_FAILURE,error:c},b.logError(c)])),[2,{error:c}];case 3:return d={channel_id:n.id,user_id:t,roles:i.General.CHANNEL_USER_ROLE+" "+i.General.CHANNEL_ADMIN_ROLE,last_viewed_at:0,msg_count:0,mention_count:0,notify_props:{desktop:"default",mark_unread:"all"},last_update_at:n.create_at},l=[],f=u().entities.channels,_=f.channels,m=f.myMembers,_[n.id]||l.push({type:a.ChannelTypes.RECEIVED_CHANNEL,data:n}),m[n.id]||(l.push({type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:d}),s(E.loadRolesIfNeeded(d.roles.split(" ")))),s(p.batchActions(r.__spread(l,[{type:a.ChannelTypes.CREATE_CHANNEL_SUCCESS}]))),s(M.addChannelToInitialCategory(n,!0)),[2,{data:n}]}}))}))}}function v(e,t){var n=this;return function(s,u){return r.__awaiter(n,void 0,void 0,(function(){var n,c,d,l;return r.__generator(this,(function(r){switch(r.label){case 0:s({type:a.ChannelTypes.CREATE_CHANNEL_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.createDirectChannel([e,t])];case 2:return n=r.sent(),[3,4];case 3:return c=r.sent(),y.forceLogoutIfNecessary(c,s,u),s(p.batchActions([{type:a.ChannelTypes.CREATE_CHANNEL_FAILURE,error:c},b.logError(c)])),[2,{error:c}];case 4:return d={channel_id:n.id,user_id:e,roles:""+i.General.CHANNEL_USER_ROLE,last_viewed_at:0,msg_count:0,mention_count:0,notify_props:{desktop:"default",mark_unread:"all"},last_update_at:n.create_at},l=[{user_id:e,category:i.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW,name:t,value:"true"},{user_id:e,category:i.Preferences.CATEGORY_CHANNEL_OPEN_TIME,name:n.id,value:(new Date).getTime().toString()}],g.savePreferences(e,l)(s),s(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:n},{type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:d},{type:a.PreferenceTypes.RECEIVED_PREFERENCES,data:l},{type:a.ChannelTypes.CREATE_CHANNEL_SUCCESS},{type:a.UserTypes.RECEIVED_PROFILES_LIST_IN_CHANNEL,id:n.id,data:[{id:e},{id:t}]}])),s(M.addChannelToInitialCategory(n)),s(E.loadRolesIfNeeded(d.roles.split(" "))),[2,{data:n}]}}))}))}}function S(e){var t=this;return function(n,a){return r.__awaiter(t,void 0,void 0,(function(){var t,o;return r.__generator(this,(function(r){return t=a().entities.users.currentUserId,o=[{user_id:t,category:i.Preferences.CATEGORY_GROUP_CHANNEL_SHOW,name:e,value:"true"},{user_id:t,category:i.Preferences.CATEGORY_CHANNEL_OPEN_TIME,name:e,value:(new Date).getTime().toString()}],[2,n(g.savePreferences(t,o))]}))}))}}function C(e,t){var n=this;return function(i,s){return r.__awaiter(n,void 0,void 0,(function(){var n,u;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.UPDATE_CHANNEL_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.patchChannel(e,t)];case 2:return n=r.sent(),[3,4];case 3:return u=r.sent(),y.forceLogoutIfNecessary(u,i,s),i(p.batchActions([{type:a.ChannelTypes.UPDATE_CHANNEL_FAILURE,error:u},b.logError(u)])),[2,{error:u}];case 4:return i(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:n},{type:a.ChannelTypes.UPDATE_CHANNEL_SUCCESS}])),[2,{data:n}]}}))}))}}function O(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s;return r.__generator(this,(function(r){switch(r.label){case 0:n({type:a.ChannelTypes.UPDATE_CHANNEL_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.updateChannel(e)];case 2:return t=r.sent(),[3,4];case 3:return s=r.sent(),y.forceLogoutIfNecessary(s,n,i),n(p.batchActions([{type:a.ChannelTypes.UPDATE_CHANNEL_FAILURE,error:s},b.logError(s)])),[2,{error:s}];case 4:return n(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:t},{type:a.ChannelTypes.UPDATE_CHANNEL_SUCCESS}])),[2,{data:t}]}}))}))}}function N(e,t,n){var i=this;return function(s,u){return r.__awaiter(i,void 0,void 0,(function(){var i,c,d,l;return r.__generator(this,(function(f){switch(f.label){case 0:i=r.__assign({user_id:e,channel_id:t},n),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,o.Client4.updateChannelNotifyProps(i)];case 2:return f.sent(),[3,4];case 3:return c=f.sent(),y.forceLogoutIfNecessary(c,s,u),s(b.logError(c)),[2,{error:c}];case 4:return d=u().entities.channels.myMembers[t]||{},l=d.notify_props||{},s({type:a.ChannelTypes.RECEIVED_CHANNEL_PROPS,data:{channel_id:t,notifyProps:r.__assign(r.__assign({},l),i)}}),[2,{data:!0}]}}))}))}}function w(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getChannel(e)];case 1:return t=r.sent(),[3,3];case 2:return s=r.sent(),y.forceLogoutIfNecessary(s,n,i),n(p.batchActions([{type:a.ChannelTypes.CHANNELS_FAILURE,error:s},b.logError(s)])),[2,{error:s}];case 3:return n({type:a.ChannelTypes.RECEIVED_CHANNEL,data:t}),[2,{data:t}]}}))}))}}function D(e){var t=this;return function(n,a){return r.__awaiter(t,void 0,void 0,(function(){var t,i;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getChannelTimezones(e)];case 1:return t=r.sent(),[3,3];case 2:return i=r.sent(),y.forceLogoutIfNecessary(i,n,a),n(b.logError(i)),[2,{error:i}];case 3:return[2,{data:t}]}}))}))}}function z(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s,u,c,l,f,_,M,g,A,L,T,v,S,C,O,N,w,D,z;return r.__generator(this,(function(I){switch(I.label){case 0:n({type:a.ChannelTypes.CHANNELS_REQUEST,data:null}),u=i(),c=h.isMinimumServerVersion(d.getServerVersion(u),5,21),I.label=1;case 1:return I.trys.push([1,4,,5]),l=o.Client4.getMyChannels(e,c),f=o.Client4.getMyChannelMembers(e),[4,l];case 2:return t=I.sent(),[4,f];case 3:return s=I.sent(),[3,5];case 4:return _=I.sent(),y.forceLogoutIfNecessary(_,n,i),n(p.batchActions([{type:a.ChannelTypes.CHANNELS_FAILURE,error:_},b.logError(_)])),[2,{error:_}];case 5:M=u.entities.users.currentUserId,g=u.entities.channels.currentChannelId,n(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNELS,teamId:e,data:t,currentChannelId:g},{type:a.ChannelTypes.CHANNELS_SUCCESS},{type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBERS,data:s,sync:!c,channels:t,remove:m.getChannelsIdForTeam(u,e),currentUserId:M,currentChannelId:g}])),A=new Set;try{for(L=r.__values(s),T=L.next();!T.done;T=L.next()){v=T.value;try{for(D=void 0,S=r.__values(v.roles.split(" ")),C=S.next();!C.done;C=S.next())O=C.value,A.add(O)}catch(e){D={error:e}}finally{try{C&&!C.done&&(z=S.return)&&z.call(S)}finally{if(D)throw D.error}}}}catch(e){N={error:e}}finally{try{T&&!T.done&&(w=L.return)&&w.call(L)}finally{if(N)throw N.error}}return A.size>0&&n(E.loadRolesIfNeeded(A)),[2,{data:{channels:t,members:s}}]}}))}))}}function I(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s,u,c,d,l,f,_,p,h,M,g,A,L,T,v;return r.__generator(this,(function(S){switch(S.label){case 0:return S.trys.push([0,2,,3]),[4,o.Client4.getMyChannelMembers(e)];case 1:return t=S.sent(),[3,3];case 2:return s=S.sent(),y.forceLogoutIfNecessary(s,n,i),n(b.logError(s)),[2,{error:s}];case 3:u=i(),c=u.entities.users.currentUserId,d=u.entities.channels.currentChannelId,n({type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBERS,data:t,remove:m.getChannelsIdForTeam(i(),e),currentUserId:c,currentChannelId:d}),l=new Set;try{for(f=r.__values(t),_=f.next();!_.done;_=f.next()){p=_.value;try{for(T=void 0,h=r.__values(p.roles.split(" ")),M=h.next();!M.done;M=h.next())g=M.value,l.add(g)}catch(e){T={error:e}}finally{try{M&&!M.done&&(v=h.return)&&v.call(h)}finally{if(T)throw T.error}}}}catch(e){A={error:e}}finally{try{_&&!_.done&&(L=f.return)&&L.call(f)}finally{if(A)throw A.error}}return l.size>0&&n(E.loadRolesIfNeeded(l)),[2,{data:t}]}}))}))}}function R(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s,u,c,d,l,f;return r.__generator(this,(function(r){return t=i(),s=t.entities.users.currentUserId,u=t.entities.channels,c=u.channels,d=u.myMembers,l=c[e],f=d[e],o.Client4.trackEvent("action","action_channels_leave",{channel_id:e}),n({type:a.ChannelTypes.LEAVE_CHANNEL,data:{id:e,user_id:s,team_id:l.team_id,type:l.type},meta:{offline:{effect:function(){return o.Client4.removeFromChannel(s,e)},commit:{type:"do_nothing"},rollback:function(){n(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:l},{type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:f}]))}}}}),[2,{data:!0}]}))}))}}function k(e,t,n,s){var u=this;return function(c,d){return r.__awaiter(u,void 0,void 0,(function(){var u,l,f;return r.__generator(this,(function(r){switch(r.label){case 0:if(!n&&!s)return[2,{data:null}];r.label=1;case 1:return r.trys.push([1,10,,11]),n?[4,o.Client4.addToChannel(e,n)]:[3,4];case 2:return u=r.sent(),[4,o.Client4.getChannel(n)];case 3:return l=r.sent(),[3,9];case 4:return[4,o.Client4.getChannelByName(t,s,!0)];case 5:return(l=r.sent()).type!==i.General.GM_CHANNEL&&l.type!==i.General.DM_CHANNEL?[3,7]:[4,o.Client4.getChannelMember(l.id,e)];case 6:return u=r.sent(),[3,9];case 7:return[4,o.Client4.addToChannel(e,l.id)];case 8:u=r.sent(),r.label=9;case 9:return[3,11];case 10:return f=r.sent(),y.forceLogoutIfNecessary(f,c,d),c(b.logError(f)),[2,{error:f}];case 11:return o.Client4.trackEvent("action","action_channels_join",{channel_id:n}),c(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:l},{type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:u}])),c(M.addChannelToInitialCategory(l)),u&&c(E.loadRolesIfNeeded(u.roles.split(" "))),[2,{data:{channel:l,member:u}}]}}))}))}}function P(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s,u,d,l,_,p;return r.__generator(this,(function(r){switch(r.label){case 0:t=i(),s="true"===t.entities.general.config.ExperimentalViewArchivedChannels,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.deleteChannel(e)];case 2:return r.sent(),[3,4];case 3:return u=r.sent(),y.forceLogoutIfNecessary(u,n,i),n(b.logError(u)),[2,{error:u}];case 4:return t=i(),d=t.entities.channels.currentChannelId,e!==d||s||(l=f.getCurrentTeamId(t),_=c.getChannelsNameMapInTeam(t,l),(p=m.getChannelByName(_,c.getRedirectChannelNameForTeam(t,l)))&&p.id&&n({type:a.ChannelTypes.SELECT_CHANNEL,data:p.id})),n({type:a.ChannelTypes.DELETE_CHANNEL_SUCCESS,data:{id:e,viewArchivedChannels:s}}),[2,{data:!0}]}}))}))}}function Y(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s,u,c;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.unarchiveChannel(e)];case 1:return r.sent(),[3,3];case 2:return t=r.sent(),y.forceLogoutIfNecessary(t,n,i),n(b.logError(t)),[2,{error:t}];case 3:return s=i(),u=d.getConfig(s),c="true"===u.ExperimentalViewArchivedChannels,n({type:a.ChannelTypes.UNARCHIVED_CHANNEL_SUCCESS,data:{id:e,viewArchivedChannels:c}}),[2,{data:!0}]}}))}))}}function U(e,t){var n=this;return void 0===t&&(t=""),function(s,u){return r.__awaiter(n,void 0,void 0,(function(){var n,d,l,f,_,m,h,M,A,L,T;return r.__generator(this,(function(v){switch(v.label){case 0:n=u().entities.users.currentUserId,d=u().entities.preferences.myPreferences,l=d[i.Preferences.CATEGORY_CHANNEL_APPROXIMATE_VIEW_TIME+"--"+e],f=l?parseInt(l.value,10):0,_=c.isManuallyUnread(u(),t),f<(new Date).getTime()-108e5&&(m=[{user_id:n,category:i.Preferences.CATEGORY_CHANNEL_APPROXIMATE_VIEW_TIME,name:e,value:(new Date).getTime().toString()}],g.savePreferences(n,m)(s)),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,o.Client4.viewMyChannel(e,_?"":t)];case 2:return v.sent(),[3,4];case 3:return h=v.sent(),y.forceLogoutIfNecessary(h,s,u),s(b.logError(h)),[2,{error:h}];case 4:return M=[],A=u().entities.channels.myMembers,(L=A[e])&&(c.isManuallyUnread(u(),e)&&M.push({type:a.ChannelTypes.REMOVE_MANUALLY_UNREAD,data:{channelId:e}}),M.push({type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:r.__assign(r.__assign({},L),{last_viewed_at:(new Date).getTime()})}),s(E.loadRolesIfNeeded(L.roles.split(" ")))),T=A[t],!_&&T&&(M.push({type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:r.__assign(r.__assign({},T),{last_viewed_at:(new Date).getTime()})}),s(E.loadRolesIfNeeded(T.roles.split(" ")))),s(p.batchActions(M)),[2,{data:!0}]}}))}))}}function W(e,t){return void 0===t&&(t=""),function(n,o){var i=[],s=o().entities.channels.myMembers,u=s[e],d=o();u&&(i.push({type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:r.__assign(r.__assign({},u),{last_viewed_at:Date.now()})}),c.isManuallyUnread(d,e)&&i.push({type:a.ChannelTypes.REMOVE_MANUALLY_UNREAD,data:{channelId:e}}),n(E.loadRolesIfNeeded(u.roles.split(" "))));var l=s[t];return l&&!c.isManuallyUnread(o(),t)&&(i.push({type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:r.__assign(r.__assign({},l),{last_viewed_at:Date.now()})}),n(E.loadRolesIfNeeded(l.roles.split(" ")))),i.length&&n(p.batchActions(i)),{data:!0}}}function q(e,t,n){var s=this;return void 0===t&&(t=0),void 0===n&&(n=i.General.CHANNELS_CHUNK_SIZE),function(i,u){return r.__awaiter(s,void 0,void 0,(function(){var s,c;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.GET_CHANNELS_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.getChannels(e,t,n)];case 2:return s=r.sent(),[3,4];case 3:return c=r.sent(),y.forceLogoutIfNecessary(c,i,u),i(p.batchActions([{type:a.ChannelTypes.GET_CHANNELS_FAILURE,error:c},b.logError(c)])),[2,{error:c}];case 4:return i(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNELS,teamId:e,data:s},{type:a.ChannelTypes.GET_CHANNELS_SUCCESS}])),[2,{data:s}]}}))}))}}function x(e,t){var n=this;return function(i,s){return r.__awaiter(n,void 0,void 0,(function(){var n,u;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.GET_CHANNELS_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.autocompleteChannels(e,t)];case 2:return n=r.sent(),[3,4];case 3:return u=r.sent(),y.forceLogoutIfNecessary(u,i,s),i(p.batchActions([{type:a.ChannelTypes.GET_CHANNELS_FAILURE,error:u},b.logError(u)])),[2,{error:u}];case 4:return i(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNELS,teamId:e,data:n},{type:a.ChannelTypes.GET_CHANNELS_SUCCESS}])),[2,{data:n}]}}))}))}}function H(e,t){var n=this;return function(i,s){return r.__awaiter(n,void 0,void 0,(function(){var n,u;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.GET_CHANNELS_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.autocompleteChannelsForSearch(e,t)];case 2:return n=r.sent(),[3,4];case 3:return u=r.sent(),y.forceLogoutIfNecessary(u,i,s),i(p.batchActions([{type:a.ChannelTypes.GET_CHANNELS_FAILURE,error:u},b.logError(u)])),[2,{error:u}];case 4:return i(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNELS,teamId:e,data:n},{type:a.ChannelTypes.GET_CHANNELS_SUCCESS}])),[2,{data:n}]}}))}))}}function B(e,t,n){var i=this;return function(s,u){return r.__awaiter(i,void 0,void 0,(function(){var i,c;return r.__generator(this,(function(r){switch(r.label){case 0:s({type:a.ChannelTypes.GET_CHANNELS_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,6,,7]),n?[4,o.Client4.searchArchivedChannels(e,t)]:[3,3];case 2:return i=r.sent(),[3,5];case 3:return[4,o.Client4.searchChannels(e,t)];case 4:i=r.sent(),r.label=5;case 5:return[3,7];case 6:return c=r.sent(),y.forceLogoutIfNecessary(c,s,u),s(p.batchActions([{type:a.ChannelTypes.GET_CHANNELS_FAILURE,error:c},b.logError(c)])),[2,{error:c}];case 7:return s(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNELS,teamId:e,data:i},{type:a.ChannelTypes.GET_CHANNELS_SUCCESS}])),[2,{data:i}]}}))}))}}function j(e){return y.bindClientFunc({clientFunc:o.Client4.searchGroupChannels,params:[e]})}function F(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getChannelStats(e)];case 1:return t=r.sent(),[3,3];case 2:return s=r.sent(),y.forceLogoutIfNecessary(s,n,i),n(b.logError(s)),[2,{error:s}];case 3:return n({type:a.ChannelTypes.RECEIVED_CHANNEL_STATS,data:t}),[2,{data:t}]}}))}))}}function X(e,t,n){var i=this;return void 0===n&&(n=""),function(s,u){return r.__awaiter(i,void 0,void 0,(function(){var i,c;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.addToChannel(t,e,n)];case 1:return i=r.sent(),[3,3];case 2:return c=r.sent(),y.forceLogoutIfNecessary(c,s,u),s(b.logError(c)),[2,{error:c}];case 3:return o.Client4.trackEvent("action","action_channels_add_member",{channel_id:e}),s(p.batchActions([{type:a.UserTypes.RECEIVED_PROFILE_IN_CHANNEL,data:{id:e,user_id:t}},{type:a.ChannelTypes.RECEIVED_CHANNEL_MEMBER,data:i},{type:a.ChannelTypes.ADD_CHANNEL_MEMBER_SUCCESS,id:e}],"ADD_CHANNEL_MEMBER.BATCH")),[2,{data:i}]}}))}))}}function G(e,t){var n=this;return function(i,s){return r.__awaiter(n,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.removeFromChannel(t,e)];case 1:return r.sent(),[3,3];case 2:return n=r.sent(),y.forceLogoutIfNecessary(n,i,s),i(b.logError(n)),[2,{error:n}];case 3:return o.Client4.trackEvent("action","action_channels_remove_member",{channel_id:e}),i(p.batchActions([{type:a.UserTypes.RECEIVED_PROFILE_NOT_IN_CHANNEL,data:{id:e,user_id:t}},{type:a.ChannelTypes.REMOVE_CHANNEL_MEMBER_SUCCESS,id:e}],"REMOVE_CHANNEL_MEMBER.BATCH")),[2,{data:!0}]}}))}))}}function V(e,t){var n=this;return function(i){return r.__awaiter(n,void 0,void 0,(function(){return r.__generator(this,(function(n){return o.Client4.trackEvent("action","action_channels_update_header",{channel_id:e}),i({type:a.ChannelTypes.UPDATE_CHANNEL_HEADER,data:{channelId:e,header:t}}),[2,{data:!0}]}))}))}}function J(e,t){var n=this;return function(i){return r.__awaiter(n,void 0,void 0,(function(){return r.__generator(this,(function(n){return o.Client4.trackEvent("action","action_channels_update_purpose",{channel_id:e}),i({type:a.ChannelTypes.UPDATE_CHANNEL_PURPOSE,data:{channelId:e,purpose:t}}),[2,{data:!0}]}))}))}}function K(e,t,n){var i=this;return void 0===n&&(n=!0),function(s,u){return r.__awaiter(i,void 0,void 0,(function(){var i,d,l,f,_,m,h,M,g,E;return r.__generator(this,(function(r){return i=c.isManuallyUnread(u(),t),n&&o.Client4.viewMyChannel(e,i?"":t).then().catch((function(e){return y.forceLogoutIfNecessary(e,s,u),s(b.logError(e)),{error:e}})),d=u(),l=d.entities.channels,f=l.channels,_=l.myMembers,m=f[e],h=!i&&t?f[t]:null,M=_[e],g=!i&&t?_[t]:null,E=[],m&&M&&(E.push({type:a.ChannelTypes.DECREMENT_UNREAD_MSG_COUNT,data:{teamId:m.team_id,channelId:e,amount:m.total_msg_count-M.msg_count}}),E.push({type:a.ChannelTypes.DECREMENT_UNREAD_MENTION_COUNT,data:{teamId:m.team_id,channelId:e,amount:M.mention_count}})),m&&c.isManuallyUnread(u(),e)&&E.push({type:a.ChannelTypes.REMOVE_MANUALLY_UNREAD,data:{channelId:e}}),h&&g&&(E.push({type:a.ChannelTypes.DECREMENT_UNREAD_MSG_COUNT,data:{teamId:h.team_id,channelId:t,amount:h.total_msg_count-g.msg_count}}),E.push({type:a.ChannelTypes.DECREMENT_UNREAD_MENTION_COUNT,data:{teamId:h.team_id,channelId:t,amount:g.mention_count}})),E.length>0&&s(p.batchActions(E)),[2,{data:!0}]}))}))}}function Q(e,t,n){var o=this;return function(s,u){return r.__awaiter(o,void 0,void 0,(function(){var o,c,d,l;return r.__generator(this,(function(r){return o=u(),c=o.entities.channels.myMembers,d=o.entities.users.currentUserId,l=[{type:a.ChannelTypes.INCREMENT_TOTAL_MSG_COUNT,data:{channelId:t,amount:1}},{type:a.ChannelTypes.INCREMENT_UNREAD_MSG_COUNT,data:{teamId:e,channelId:t,amount:1,onlyMentions:c[t]&&c[t].notify_props&&c[t].notify_props.mark_unread===i.General.MENTION}}],n&&-1!==n.indexOf(d)&&l.push({type:a.ChannelTypes.INCREMENT_UNREAD_MENTION_COUNT,data:{teamId:e,channelId:t,amount:1}}),s(p.batchActions(l)),[2,{data:!0}]}))}))}}function Z(e,t){return y.bindClientFunc({clientFunc:o.Client4.getChannelMembersByIds,onSuccess:a.ChannelTypes.RECEIVED_CHANNEL_MEMBERS,params:[e,t]})}function $(e,t){var n=this;return void 0===t&&(t=!0),function(d,p){return r.__awaiter(n,void 0,void 0,(function(){var n,m,h,b,y;return r.__generator(this,(function(r){switch(r.label){case 0:return n=p(),m=_.getCurrentUserId(n),h={user_id:m,category:i.Preferences.CATEGORY_FAVORITE_CHANNEL,name:e,value:"true"},o.Client4.trackEvent("action","action_channels_favorite"),l.getNewSidebarPreference(n)?t?(b=c.getChannel(n,e),(y=u.getCategoryInTeamByType(n,b.team_id||f.getCurrentTeamId(n),s.CategoryTypes.FAVORITES))?[4,d(M.addChannelToCategory(y.id,e))]:[3,2]):[3,2]:[3,3];case 1:r.sent(),r.label=2;case 2:return[2,d({type:a.PreferenceTypes.RECEIVED_PREFERENCES,data:[h]})];case 3:return[2,d(g.savePreferences(m,[h]))]}}))}))}}function ee(e,t){var n=this;return void 0===t&&(t=!0),function(d,p){return r.__awaiter(n,void 0,void 0,(function(){var n,m,h,b,y;return r.__generator(this,(function(r){switch(r.label){case 0:return n=p(),m=_.getCurrentUserId(n),h={user_id:m,category:i.Preferences.CATEGORY_FAVORITE_CHANNEL,name:e,value:""},o.Client4.trackEvent("action","action_channels_unfavorite"),l.getNewSidebarPreference(n)?t?(b=c.getChannel(n,e),(y=u.getCategoryInTeamByType(n,b.team_id||f.getCurrentTeamId(n),b.type===i.General.DM_CHANNEL||b.type===i.General.GM_CHANNEL?s.CategoryTypes.DIRECT_MESSAGES:s.CategoryTypes.CHANNELS))?[4,d(M.addChannelToCategory(y.id,b.id))]:[3,2]):[3,2]:[3,3];case 1:r.sent(),r.label=2;case 2:return[2,d({type:a.PreferenceTypes.DELETED_PREFERENCES,data:[h]})];case 3:return[2,d(g.deletePreferences(m,[h]))]}}))}))}}function te(e,t,n,r){return void 0===n&&(n=0),void 0===r&&(r=i.General.PROFILE_CHUNK_SIZE),y.bindClientFunc({clientFunc:o.Client4.channelMembersMinusGroupMembers,onSuccess:a.ChannelTypes.RECEIVED_CHANNEL_MEMBERS_MINUS_GROUP_MEMBERS,params:[e,t,n,r]})}function ne(e){var t=this;return y.bindClientFunc({clientFunc:function(){return r.__awaiter(t,void 0,void 0,(function(){var t;return r.__generator(this,(function(n){switch(n.label){case 0:return[4,o.Client4.getChannelModerations(e)];case 1:return t=n.sent(),[2,{channelId:e,moderations:t}]}}))}))},onSuccess:a.ChannelTypes.RECEIVED_CHANNEL_MODERATIONS,params:[e]})}function re(e,t){var n=this;return y.bindClientFunc({clientFunc:function(){return r.__awaiter(n,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,o.Client4.getChannelMemberCountsByGroup(e,t)];case 1:return n=r.sent(),[2,{channelId:e,memberCounts:n}]}}))}))},onSuccess:a.ChannelTypes.RECEIVED_CHANNEL_MEMBER_COUNTS_BY_GROUP,params:[e]})}t.selectChannel=L,t.createChannel=T,t.createDirectChannel=v,t.markGroupChannelOpen=S,t.createGroupChannel=function(e){var t=this;return function(n,s){return r.__awaiter(t,void 0,void 0,(function(){var t,u,d,l,f,_,m;return r.__generator(this,(function(r){switch(r.label){case 0:n({type:a.ChannelTypes.CREATE_CHANNEL_REQUEST,data:null}),t=s().entities.users.currentUserId,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.createGroupChannel(e)];case 2:return u=r.sent(),[3,4];case 3:return d=r.sent(),y.forceLogoutIfNecessary(d,n,s),n(p.batchActions([{type:a.ChannelTypes.CREATE_CHANNEL_FAILURE,error:d},b.logError(d)])),[2,{error:d}];case 4:if(l={channel_id:u.id,user_id:t,roles:""+i.General.CHANNEL_USER_ROLE,last_viewed_at:0,msg_count:0,mention_count:0,notify_props:{desktop:"default",mark_unread:"all"},last_update_at:u.create_at},!(u.total_msg_count>0))return[3,10];if(null!==(f=c.getMyChannelMember(s(),u.id)))return[3,9];r.label=5;case 5:return r.trys.push([5,7,,8]),[4,o.Client4.getMyChannelMember(u.id)];case 6:return l=r.sent(),[3,8];case 7:return _=r.sent(),n(b.logError(_)),[3,8];case 8:return[3,10];case 9:l=f,r.label=10;case 10:return n(S(u.id)),(m=e.map((function(e){return{id:e}}))).push({id:t}),n(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:u},{type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:l},{type:a.ChannelTypes.CREATE_CHANNEL_SUCCESS},{type:a.UserTypes.RECEIVED_PROFILES_LIST_IN_CHANNEL,id:u.id,data:m}])),n(M.addChannelToInitialCategory(u)),n(E.loadRolesIfNeeded(l&&l.roles&&l.roles.split(" ")||[])),[2,{data:u}]}}))}))}},t.patchChannel=C,t.updateChannel=O,t.updateChannelPrivacy=function(e,t){var n=this;return function(i,s){return r.__awaiter(n,void 0,void 0,(function(){var n,u;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.UPDATE_CHANNEL_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.updateChannelPrivacy(e,t)];case 2:return n=r.sent(),[3,4];case 3:return u=r.sent(),y.forceLogoutIfNecessary(u,i,s),i(p.batchActions([{type:a.ChannelTypes.UPDATE_CHANNEL_FAILURE,error:u},b.logError(u)])),[2,{error:u}];case 4:return i(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:n},{type:a.ChannelTypes.UPDATE_CHANNEL_SUCCESS}])),[2,{data:n}]}}))}))}},t.convertChannelToPrivate=function(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s;return r.__generator(this,(function(r){switch(r.label){case 0:n({type:a.ChannelTypes.UPDATE_CHANNEL_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.convertChannelToPrivate(e)];case 2:return t=r.sent(),[3,4];case 3:return s=r.sent(),y.forceLogoutIfNecessary(s,n,i),n(p.batchActions([{type:a.ChannelTypes.UPDATE_CHANNEL_FAILURE,error:s},b.logError(s)])),[2,{error:s}];case 4:return n(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:t},{type:a.ChannelTypes.UPDATE_CHANNEL_SUCCESS}])),[2,{data:t}]}}))}))}},t.updateChannelNotifyProps=N,t.getChannelByNameAndTeamName=function(e,t,n){var i=this;return void 0===n&&(n=!1),function(s,u){return r.__awaiter(i,void 0,void 0,(function(){var i,c;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getChannelByNameAndTeamName(e,t,n)];case 1:return i=r.sent(),[3,3];case 2:return c=r.sent(),y.forceLogoutIfNecessary(c,s,u),s(p.batchActions([{type:a.ChannelTypes.CHANNELS_FAILURE,error:c},b.logError(c)])),[2,{error:c}];case 3:return s({type:a.ChannelTypes.RECEIVED_CHANNEL,data:i}),[2,{data:i}]}}))}))}},t.getChannel=w,t.getChannelAndMyMember=function(e){var t=this;return function(n,i){return r.__awaiter(t,void 0,void 0,(function(){var t,s,u,c,d;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),u=o.Client4.getChannel(e),c=o.Client4.getMyChannelMember(e),[4,u];case 1:return t=r.sent(),[4,c];case 2:return s=r.sent(),[3,4];case 3:return d=r.sent(),y.forceLogoutIfNecessary(d,n,i),n(p.batchActions([{type:a.ChannelTypes.CHANNELS_FAILURE,error:d},b.logError(d)])),[2,{error:d}];case 4:return n(p.batchActions([{type:a.ChannelTypes.RECEIVED_CHANNEL,data:t},{type:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,data:s}])),n(E.loadRolesIfNeeded(s.roles.split(" "))),[2,{data:{channel:t,member:s}}]}}))}))}},t.getChannelTimezones=D,t.fetchMyChannelsAndMembers=z,t.getMyChannelMembers=I,t.getChannelMembers=function(e,t,n){var s=this;return void 0===t&&(t=0),void 0===n&&(n=i.General.CHANNELS_CHUNK_SIZE),function(i,u){return r.__awaiter(s,void 0,void 0,(function(){var s,c,d;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getChannelMembers(e,t,n)];case 1:return s=r.sent(),[3,3];case 2:return c=r.sent(),y.forceLogoutIfNecessary(c,i,u),i(b.logError(c)),[2,{error:c}];case 3:return d=s.map((function(e){return e.user_id})),A.getMissingProfilesByIds(d)(i,u),i({type:a.ChannelTypes.RECEIVED_CHANNEL_MEMBERS,data:s}),[2,{data:s}]}}))}))}},t.leaveChannel=R,t.joinChannel=k,t.deleteChannel=P,t.unarchiveChannel=Y,t.viewChannel=U,t.markChannelAsViewed=W,t.getChannels=q,t.getArchivedChannels=function(e,t,n){var s=this;return void 0===t&&(t=0),void 0===n&&(n=i.General.CHANNELS_CHUNK_SIZE),function(i,u){return r.__awaiter(s,void 0,void 0,(function(){var s,c;return r.__generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,o.Client4.getArchivedChannels(e,t,n)];case 1:return s=r.sent(),[3,3];case 2:return c=r.sent(),y.forceLogoutIfNecessary(c,i,u),[2,{error:c}];case 3:return i({type:a.ChannelTypes.RECEIVED_CHANNELS,teamId:e,data:s}),[2,{data:s}]}}))}))}},t.getAllChannelsWithCount=function(e,t,n,s,u){var c=this;return void 0===e&&(e=0),void 0===t&&(t=i.General.CHANNELS_CHUNK_SIZE),void 0===n&&(n=""),void 0===s&&(s=!1),void 0===u&&(u=!1),function(i,d){return r.__awaiter(c,void 0,void 0,(function(){var c,l;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.GET_ALL_CHANNELS_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.getAllChannels(e,t,n,s,!0,u)];case 2:return c=r.sent(),[3,4];case 3:return l=r.sent(),y.forceLogoutIfNecessary(l,i,d),i(p.batchActions([{type:a.ChannelTypes.GET_ALL_CHANNELS_FAILURE,error:l},b.logError(l)])),[2,{error:l}];case 4:return i(p.batchActions([{type:a.ChannelTypes.RECEIVED_ALL_CHANNELS,data:c.channels},{type:a.ChannelTypes.GET_ALL_CHANNELS_SUCCESS},{type:a.ChannelTypes.RECEIVED_TOTAL_CHANNEL_COUNT,data:c.total_count}])),[2,{data:c}]}}))}))}},t.getAllChannels=function(e,t,n,s){var u=this;return void 0===e&&(e=0),void 0===t&&(t=i.General.CHANNELS_CHUNK_SIZE),void 0===n&&(n=""),void 0===s&&(s=!1),function(i,c){return r.__awaiter(u,void 0,void 0,(function(){var u,d;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.GET_ALL_CHANNELS_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.getAllChannels(e,t,n,s)];case 2:return u=r.sent(),[3,4];case 3:return d=r.sent(),y.forceLogoutIfNecessary(d,i,c),i(p.batchActions([{type:a.ChannelTypes.GET_ALL_CHANNELS_FAILURE,error:d},b.logError(d)])),[2,{error:d}];case 4:return i(p.batchActions([{type:a.ChannelTypes.RECEIVED_ALL_CHANNELS,data:u},{type:a.ChannelTypes.GET_ALL_CHANNELS_SUCCESS}])),[2,{data:u}]}}))}))}},t.autocompleteChannels=x,t.autocompleteChannelsForSearch=H,t.searchChannels=B,t.searchAllChannels=function(e,t){var n=this;return void 0===t&&(t={}),function(i,s){return r.__awaiter(n,void 0,void 0,(function(){var n,u,c;return r.__generator(this,(function(r){switch(r.label){case 0:i({type:a.ChannelTypes.GET_ALL_CHANNELS_REQUEST,data:null}),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,o.Client4.searchAllChannels(e,t)];case 2:return n=r.sent(),[3,4];case 3:return u=r.sent(),y.forceLogoutIfNecessary(u,i,s),i(p.batchActions([{type:a.ChannelTypes.GET_ALL_CHANNELS_FAILURE,error:u},b.logError(u)])),[2,{error:u}];case 4:return c=n.channels||n,i(p.batchActions([{type:a.ChannelTypes.RECEIVED_ALL_CHANNELS,data:c},{type:a.ChannelTypes.GET_ALL_CHANNELS_SUCCESS}])),[2,{data:n}]}}))}))}},t.searchGroupChannels=j,t.getChannelStats=F,t.addChannelMember=X,t.removeChannelMember=G,t.updateChannelMemberRoles=function(e,t,n){var i=this;return function(s,u){return r.__awaiter(i,void 0,void 0,(function(){var i,c;return r.__generator(this,(function(d){switch(d.label){case 0:return d.trys.push([0,2,,3]),[4,o.Client4.updateChannelMemberRoles(e,t,n)];case 1:return d.sent(),[3,3];case 2:return i=d.sent(),y.forceLogoutIfNecessary(i,s,u),s(b.logError(i)),[2,{error:i}];case 3:return(c=u().entities.channels.membersInChannel[e])&&c[t]&&s({type:a.ChannelTypes.RECEIVED_CHANNEL_MEMBER,data:r.__assign(r.__assign({},c[t]),{roles:n})}),[2,{data:!0}]}}))}))}},t.updateChannelHeader=V,t.updateChannelPurpose=J,t.markChannelAsRead=K,t.markChannelAsUnread=Q,t.getChannelMembersByIds=Z,t.getChannelMember=function(e,t){return y.bindClientFunc({clientFunc:o.Client4.getChannelMember,onSuccess:a.ChannelTypes.RECEIVED_CHANNEL_MEMBER,params:[e,t]})},t.getMyChannelMember=function(e){return y.bindClientFunc({clientFunc:o.Client4.getMyChannelMember,onSuccess:a.ChannelTypes.RECEIVED_MY_CHANNEL_MEMBER,params:[e]})},t.favoriteChannel=$,t.unfavoriteChannel=ee,t.updateChannelScheme=function(e,t){var n=this;return y.bindClientFunc({clientFunc:function(){return r.__awaiter(n,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return[4,o.Client4.updateChannelScheme(e,t)];case 1:return n.sent(),[2,{channelId:e,schemeId:t}]}}))}))},onSuccess:a.ChannelTypes.UPDATED_CHANNEL_SCHEME})},t.updateChannelMemberSchemeRoles=function(e,t,n,i){var s=this;return y.bindClientFunc({clientFunc:function(){return r.__awaiter(s,void 0,void 0,(function(){return r.__generator(this,(function(r){switch(r.label){case 0:return[4,o.Client4.updateChannelMemberSchemeRoles(e,t,n,i)];case 1:return r.sent(),[2,{channelId:e,userId:t,isSchemeUser:n,isSchemeAdmin:i}]}}))}))},onSuccess:a.ChannelTypes.UPDATED_CHANNEL_MEMBER_SCHEME_ROLES})},t.membersMinusGroupMembers=te,t.getChannelModerations=ne,t.patchChannelModerations=function(e,t){var n=this;return y.bindClientFunc({clientFunc:function(){return r.__awaiter(n,void 0,void 0,(function(){var n;return r.__generator(this,(function(r){switch(r.label){case 0:return[4,o.Client4.patchChannelModerations(e,t)];case 1:return n=r.sent(),[2,{channelId:e,moderations:n}]}}))}))},onSuccess:a.ChannelTypes.RECEIVED_CHANNEL_MODERATIONS,params:[e]})},t.getChannelMemberCountsByGroup=re,t.default={selectChannel:L,createChannel:T,createDirectChannel:v,updateChannel:O,patchChannel:C,updateChannelNotifyProps:N,getChannel:w,fetchMyChannelsAndMembers:z,getMyChannelMembers:I,getChannelTimezones:D,getChannelMembersByIds:Z,leaveChannel:R,joinChannel:k,deleteChannel:P,unarchiveChannel:Y,viewChannel:U,markChannelAsViewed:W,getChannels:q,autocompleteChannels:x,autocompleteChannelsForSearch:H,searchChannels:B,searchGroupChannels:j,getChannelStats:F,addChannelMember:X,removeChannelMember:G,updateChannelHeader:V,updateChannelPurpose:J,markChannelAsRead:K,markChannelAsUnread:Q,favoriteChannel:$,unfavoriteChannel:ee,membersMinusGroupMembers:te,getChannelModerations:ne,getChannelMemberCountsByGroup:re}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(13),o=n(16),i=n(63),s=n(9),u=n(25);function c(e){return u.bindClientFunc({clientFunc:a.Client4.getRolesByNames,onRequest:o.RoleTypes.ROLES_BY_NAMES_REQUEST,onSuccess:[o.RoleTypes.RECEIVED_ROLES,o.RoleTypes.ROLES_BY_NAMES_SUCCESS],onFailure:o.RoleTypes.ROLES_BY_NAMES_FAILURE,params:[e]})}function d(e){var t=this;return function(n){return r.__awaiter(t,void 0,void 0,(function(){return r.__generator(this,(function(t){return n({type:o.RoleTypes.SET_PENDING_ROLES,data:e}),[2,{data:e}]}))}))}}t.getRolesByNames=c,t.getRoleByName=function(e){return u.bindClientFunc({clientFunc:a.Client4.getRoleByName,onRequest:o.RoleTypes.ROLE_BY_NAME_REQUEST,onSuccess:[o.RoleTypes.RECEIVED_ROLE,o.RoleTypes.ROLE_BY_NAME_SUCCESS],onFailure:o.RoleTypes.ROLE_BY_NAME_FAILURE,params:[e]})},t.getRole=function(e){return u.bindClientFunc({clientFunc:a.Client4.getRole,onRequest:o.RoleTypes.ROLE_BY_ID_REQUEST,onSuccess:[o.RoleTypes.RECEIVED_ROLE,o.RoleTypes.ROLE_BY_ID_SUCCESS],onFailure:o.RoleTypes.ROLE_BY_ID_FAILURE,params:[e]})},t.editRole=function(e){return u.bindClientFunc({clientFunc:a.Client4.patchRole,onRequest:o.RoleTypes.EDIT_ROLE_REQUEST,onSuccess:[o.RoleTypes.RECEIVED_ROLE,o.RoleTypes.EDIT_ROLE_SUCCESS],onFailure:o.RoleTypes.EDIT_ROLE_FAILURE,params:[e.id,e]})},t.setPendingRoles=d,t.loadRolesIfNeeded=function e(t){var n=this;return function(a,o){return r.__awaiter(n,void 0,void 0,(function(){var n,u,l,f,_,p,m,h,M,b,y,g,E;return r.__generator(this,(function(A){switch(A.label){case 0:n=o(),u=new Set;try{u=new Set(n.entities.roles.pending)}catch(e){}try{for(l=r.__values(t),f=l.next();!f.done;f=l.next())M=f.value,u.add(M)}catch(e){b={error:e}}finally{try{f&&!f.done&&(y=l.return)&&y.call(l)}finally{if(b)throw b.error}}return n.entities.general.serverVersion?s.hasNewPermissions(n)?[3,3]:n.entities.roles.pending?[4,a(d([]))]:[3,2]:(a(d(Array.from(u))),setTimeout((function(){return a(e([]))}),500),[2,{data:[]}]);case 1:A.sent(),A.label=2;case 2:return[2,{data:[]}];case 3:_=i.getRoles(n),p=new Set;try{for(m=r.__values(u),h=m.next();!h.done;h=m.next())M=h.value,_[M]||""===M.trim()||p.add(M)}catch(e){g={error:e}}finally{try{h&&!h.done&&(E=m.return)&&E.call(m)}finally{if(g)throw g.error}}return n.entities.roles.pending?[4,a(d([]))]:[3,5];case 4:A.sent(),A.label=5;case 5:return p.size>0?[2,c(Array.from(p))(a,o)]:[2,{data:n.entities.roles.roles}]}}))}))}}},function(e){e.exports=JSON.parse('{"id":"com.github.matterpoll.matterpoll","name":"Matterpoll","description":"Create polls and surveys directly within Mattermost.","homepage_url":"https://github.com/matterpoll/matterpoll","support_url":"https://github.com/matterpoll/matterpoll/issues","release_notes_url":"https://github.com/matterpoll/matterpoll/releases/tag/v1.4.0","icon_path":"assets/logo_dark.svg","version":"1.4.0","min_server_version":"5.20.0","server":{"executables":{"linux-amd64":"server/dist/plugin-linux-amd64","darwin-amd64":"server/dist/plugin-darwin-amd64","windows-amd64":"server/dist/plugin-windows-amd64.exe"}},"webapp":{"bundle_path":"webapp/dist/main.js"},"settings_schema":{"settings":[{"key":"Trigger","display_name":"Trigger Word","type":"text","help_text":"Trigger Word must be unique, and cannot begin with a slash or contain any spaces.","default":"poll"},{"key":"ExperimentalUI","display_name":"Experimental UI","type":"bool","help_text":"When true, Matterpoll will render poll posts with a rich UI. The rich UI is not available on mobile app.","default":false}],"footer":"* To report an issue, make a suggestion or a contribution, [check the repository](https://github.com/matterpoll/matterpoll)."}}')},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),a=n(10),o=n(34);function i(e){return e.entities.roles.roles}t.getRoles=i,t.getMySystemRoles=a.createSelector(o.getCurrentUser,(function(e){return e?new Set(e.roles.split(" ")):new Set})),t.getMySystemPermissions=a.createSelector(t.getMySystemRoles,i,(function(e,t){var n,a,o,i,s=new Set;try{for(var u=r.__values(e),c=u.next();!c.done;c=u.next()){var d=c.value;if(t[d])try{for(var l=(o=void 0,r.__values(t[d].permissions)),f=l.next();!f.done;f=l.next()){var _=f.value;s.add(_)}}catch(e){o={error:e}}finally{try{f&&!f.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}return s})),t.haveISystemPermission=a.createSelector(t.getMySystemPermissions,(function(e,t){return t.permission}),(function(e,t){return e.has(t)}))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(12),a=n(50),o="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==a(e)?o.call(e,""):Object(e)}:Object},function(e,t,n){var r=n(67);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,a){return e.call(t,n,r,a)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){"use strict";var r=n(51),a=n(30),o=n(43);e.exports=function(e,t,n){var i=r(t);i in e?a.f(e,i,o(0,n)):e[i]=n}},function(e,t,n){var r=n(53),a=n(97);(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){var r=n(12);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},function(e,t,n){var r=n(12),a=n(7),o=n(99),i=a("species");e.exports=function(e){return o>=51||!r((function(){var t=[];return(t.constructor={})[i]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},function(e,t,n){var r=n(19),a=n(11),o=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?o(r[e])||o(a[e]):r[e]&&r[e][t]||a[e]&&a[e][t]}},function(e,t,n){var r=n(29),a=n(37),o=n(100),i=function(e){return function(t,n,i){var s,u=r(t),c=a(u.length),d=o(i,c);if(e&&n!=n){for(;c>d;)if((s=u[d++])!=s)return!0}else for(;c>d;d++)if((e||d in u)&&u[d]===n)return e||d||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,n){var r,a=n(26),o=n(298),i=n(77),s=n(55),u=n(299),c=n(94),d=n(56),l=d("IE_PROTO"),f=function(){},_=function(e){return"