From 6344a8441dd609cb58a4fb28490499ed480c4534 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Fri, 5 Jun 2020 17:59:31 -0700 Subject: [PATCH 01/41] jael: always restart subscription to breached ship --- bin/solid.pill | 4 ++-- pkg/arvo/sys/vane/jael.hoon | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index 30d0e94e1d..2851e6e178 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dd9ee3401fd2a29fc49ef84aa51754be5929f2cddbb7e378ffac4641695e886c -size 13838435 +oid sha256:46d79f0b3dc1c4ff5f7ca56f1601a26a0fbc67540ab0ebcc672dc282fe8bbe74 +size 13825786 diff --git a/pkg/arvo/sys/vane/jael.hoon b/pkg/arvo/sys/vane/jael.hoon index fd024cdc23..4bd3a44630 100644 --- a/pkg/arvo/sys/vane/jael.hoon +++ b/pkg/arvo/sys/vane/jael.hoon @@ -883,9 +883,17 @@ ?=(%rift -.a-diff) (gth to.a-diff rift.point) == - %+ public-keys-give - (subscribers-on-ship who) - [%breach who] + =. ..feel + %+ public-keys-give + (subscribers-on-ship who) + [%breach who] + =/ sor (~(get by sources-reverse) %& who) + ?~ sor + ..feel + :: delay resubscribing because Ames is going to clear any + :: messages we send now. + :: + (emit hen %pass /breach/(scot %ud u.sor) %b %wait now) :: =. point ?- -.a-diff From 48ae088bbdf28d3ce450f3da595826ea0d31b587 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 19 Jun 2020 19:17:01 +1000 Subject: [PATCH 02/41] links-js: calculate header unread count correctly --- pkg/interface/src/apps/links/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/apps/links/app.js b/pkg/interface/src/apps/links/app.js index 6703f9d761..5ce2b5cce3 100644 --- a/pkg/interface/src/apps/links/app.js +++ b/pkg/interface/src/apps/links/app.js @@ -55,8 +55,8 @@ export class LinksApp extends Component { const seen = props.linksSeen ? props.linksSeen : {}; const totalUnseen = _.reduce( - seen, - (acc, links) => acc + _.reduce(links, (total, hasSeen) => total + (hasSeen ? 0 : 1), 0), + links, + (acc, collection) => acc + collection.unseenCount, 0 ); From 9aa4d96fb5c32a246434b7cfe2b97952db944b82 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 19 Jun 2020 19:22:44 +1000 Subject: [PATCH 03/41] chat: refine image scaling --- pkg/interface/src/apps/chat/components/lib/message.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/interface/src/apps/chat/components/lib/message.js b/pkg/interface/src/apps/chat/components/lib/message.js index ce1d4bd89d..ead51131f5 100644 --- a/pkg/interface/src/apps/chat/components/lib/message.js +++ b/pkg/interface/src/apps/chat/components/lib/message.js @@ -88,7 +88,8 @@ export class Message extends Component { src={letter.url} style={{ height: 'min(250px, 20vh)', - maxWidth: '80vw' + maxWidth: 'calc(100% - 36px - 1.5rem)', + objectFit: 'contain' }} > ); From f27037d2de16b13020157bf89d15a6f35fe41789 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Sat, 20 Jun 2020 02:54:37 +1000 Subject: [PATCH 04/41] links: filter unread count on selected groups --- pkg/interface/src/apps/links/app.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/apps/links/app.js b/pkg/interface/src/apps/links/app.js index 5ce2b5cce3..ed9e1dba1e 100644 --- a/pkg/interface/src/apps/links/app.js +++ b/pkg/interface/src/apps/links/app.js @@ -54,9 +54,18 @@ export class LinksApp extends Component { const seen = props.linksSeen ? props.linksSeen : {}; + const selectedGroups = props.selectedGroups ? props.selectedGroups : []; + + const selGroupPaths = selectedGroups.map(g => g[0]); const totalUnseen = _.reduce( links, - (acc, collection) => acc + collection.unseenCount, + (acc, collection, path) => { + if(selGroupPaths.length > 0 + && !selGroupPaths.includes(associations.link?.[path]?.['group-path'])) { + return acc; + } + return acc + collection.unseenCount; + }, 0 ); @@ -68,7 +77,6 @@ export class LinksApp extends Component { const invites = props.invites ? props.invites : {}; - const selectedGroups = props.selectedGroups ? props.selectedGroups : []; const listening = props.linkListening; From ad4e2c0c9d90003190d7b96216930d7f0eb8a00a Mon Sep 17 00:00:00 2001 From: Fang Date: Tue, 30 Jun 2020 01:19:44 +0200 Subject: [PATCH 05/41] chat fe: don't embed webms as images --- pkg/interface/src/apps/chat/components/lib/message.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/interface/src/apps/chat/components/lib/message.js b/pkg/interface/src/apps/chat/components/lib/message.js index ce1d4bd89d..c58cf5e89c 100644 --- a/pkg/interface/src/apps/chat/components/lib/message.js +++ b/pkg/interface/src/apps/chat/components/lib/message.js @@ -72,7 +72,7 @@ export class Message extends Component { ); } else if ('url' in letter) { let imgMatch = - /(jpg|img|png|gif|tiff|jpeg|JPG|IMG|PNG|TIFF|GIF|webp|WEBP|webm|WEBM|svg|SVG)$/ + /(jpg|img|png|gif|tiff|jpeg|JPG|IMG|PNG|TIFF|GIF|webp|WEBP|svg|SVG)$/ .exec(letter.url); const youTubeRegex = new RegExp(String(/(?:https?:\/\/(?:[a-z]+.)?)/.source) // protocol + /(?:youtu\.?be(?:\.com)?\/)(?:embed\/)?/.source // short and long-links From 9686f3483a06f12c7bf3cc5a5fc479524cca9d37 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 29 Jun 2020 22:48:17 -0400 Subject: [PATCH 06/41] interface: update production build for typescript --- pkg/interface/config/webpack.prod.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/interface/config/webpack.prod.js b/pkg/interface/config/webpack.prod.js index e19e15940e..3e00ad14d2 100644 --- a/pkg/interface/config/webpack.prod.js +++ b/pkg/interface/config/webpack.prod.js @@ -11,7 +11,7 @@ module.exports = { module: { rules: [ { - test: /\.js?$/, + test: /\.(j|t)sx?$/, use: { loader: 'babel-loader', options: { @@ -39,7 +39,7 @@ module.exports = { ] }, resolve: { - extensions: ['.js'] + extensions: ['.js', '.ts', '.tsx'] }, devtool: 'inline-source-map', // devServer: { @@ -58,7 +58,7 @@ module.exports = { output: { filename: 'index.js', chunkFilename: 'index.js', - path: path.resolve(urbitrc.URBIT_PIERS[0] + '/app/landscape/', 'js'), + path: path.resolve(__dirname, '../../arvo/app/landscape/js'), publicPath: '/' }, optimization: { From 1adca22298a93f0a4b2f1a35701f445c4fc271ca Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Tue, 30 Jun 2020 16:21:01 -0400 Subject: [PATCH 07/41] release: urbit-os-v1.0.25 --- bin/solid.pill | 4 ++-- pkg/arvo/app/landscape/js/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/solid.pill b/bin/solid.pill index bc6fa88e92..acf25b9916 100644 --- a/bin/solid.pill +++ b/bin/solid.pill @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:581c9b713aa12126f3a618d75bf4254bb431f633fbfc76941663391d3d13cdb0 -size 16742515 +oid sha256:07701886e00c91a5b05ab14d9243508bdfd0a26c14dd3994994d451f4f360770 +size 16637399 diff --git a/pkg/arvo/app/landscape/js/index.js b/pkg/arvo/app/landscape/js/index.js index 50745101d4..8f75d10812 100644 --- a/pkg/arvo/app/landscape/js/index.js +++ b/pkg/arvo/app/landscape/js/index.js @@ -347,5 +347,5 @@ var r=n(378),i=n(379),o=n(380);function a(){return l.TYPED_ARRAY_SUPPORT?2147483 * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,n){"use strict";var r=n(253);e.exports=o,o.wrap=r;var i=[].slice;function o(){var e=[],t={run:function(){var t=-1,n=i.call(arguments,0,-1),o=arguments[arguments.length-1];if("function"!=typeof o)throw new Error("Expected function as last argument, not "+o);function a(s){var l=e[++t],c=i.call(arguments,0),u=c.slice(1),d=n.length,f=-1;if(s)o(s);else{for(;++fa.length;s&&a.push(i);try{t=e.apply(null,a)}catch(e){if(s&&n)throw e;return i(e)}s||(t&&"function"==typeof t.then?t.then(o,i):t instanceof Error?i(t):o(t))};function i(){n||(n=!0,t.apply(null,arguments))}function o(e){i(null,e)}}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return"[object String]"===n.call(e)}},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}},function(e,t,n){"use strict";var r=n(257),i=n(8),o=n(259);function a(e){var t=r(o);t.prototype.options=i(t.prototype.options,this.data("settings"),e),this.Parser=t}e.exports=a,a.Parser=o},function(e,t,n){"use strict";var r=n(8),i=n(258);e.exports=function(e){var t,n,o;for(n in i(s,e),i(a,s),t=s.prototype)(o=t[n])&&"object"==typeof o&&(t[n]="concat"in o?o.concat():r(o));return s;function a(t){return e.apply(this,t)}function s(){return this instanceof s?e.apply(this,arguments):new a(arguments)}}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";var r=n(8),i=n(260),o=n(261),a=n(262),s=n(263),l=n(269);function c(e,t){this.file=t,this.offset={},this.options=r(this.options),this.setOptions({}),this.inList=!1,this.inBlock=!1,this.inLink=!1,this.atStart=!0,this.toOffset=o(t).toOffset,this.unescape=a(this,"escape"),this.decode=s(this)}e.exports=c;var u=c.prototype;function d(e){var t,n=[];for(t in e)n.push(t);return n}u.setOptions=n(270),u.parse=n(273),u.options=n(63),u.exitStart=i("atStart",!0),u.enterList=i("inList",!1),u.enterLink=i("inLink",!1),u.enterBlock=i("inBlock",!1),u.interruptParagraph=[["thematicBreak"],["atxHeading"],["fencedCode"],["blockquote"],["html"],["setextHeading",{commonmark:!1}],["definition",{commonmark:!1}],["footnote",{commonmark:!1}]],u.interruptList=[["atxHeading",{pedantic:!1}],["fencedCode",{pedantic:!1}],["thematicBreak",{pedantic:!1}],["definition",{commonmark:!1}],["footnote",{commonmark:!1}]],u.interruptBlockquote=[["indentedCode",{commonmark:!0}],["fencedCode",{commonmark:!0}],["atxHeading",{commonmark:!0}],["setextHeading",{commonmark:!0}],["thematicBreak",{commonmark:!0}],["html",{commonmark:!0}],["list",{commonmark:!0}],["definition",{commonmark:!1}],["footnote",{commonmark:!1}]],u.blockTokenizers={newline:n(277),indentedCode:n(278),fencedCode:n(279),blockquote:n(280),atxHeading:n(281),thematicBreak:n(282),list:n(283),setextHeading:n(285),html:n(286),footnote:n(287),definition:n(289),table:n(290),paragraph:n(291)},u.inlineTokenizers={escape:n(292),autoLink:n(294),url:n(295),html:n(297),link:n(298),reference:n(299),strong:n(300),emphasis:n(302),deletion:n(305),code:n(307),break:n(309),text:n(311)},u.blockMethods=d(u.blockTokenizers),u.inlineMethods=d(u.inlineTokenizers),u.tokenizeBlock=l("block"),u.tokenizeInline=l("inline"),u.tokenizeFactory=l},function(e,t,n){"use strict";e.exports=function(e,t,n){return function(){var r=n||this,i=r[e];return r[e]=!t,function(){r[e]=i}}}},function(e,t,n){"use strict";function r(e){return function(t){var n=-1,r=e.length;if(t<0)return{};for(;++nt)return{line:n+1,column:t-(e[n-1]||0)+1,offset:t};return{}}}function i(e){return function(t){var n=t&&t.line,r=t&&t.column;if(!isNaN(n)&&!isNaN(r)&&n-1 in e)return(e[n-2]||0)+r-1||0;return-1}}e.exports=function(e){var t=function(e){var t=[],n=e.indexOf("\n");for(;-1!==n;)t.push(n+1),n=e.indexOf("\n",n+1);return t.push(e.length+1),t}(String(e));return{toPosition:r(t),toOffset:i(t)}}},function(e,t,n){"use strict";e.exports=function(e,t){return function(n){var r,i=0,o=n.indexOf("\\"),a=e[t],s=[];for(;-1!==o;)s.push(n.slice(i,o)),i=o+1,(r=n.charAt(i))&&-1!==a.indexOf(r)||s.push("\\"),o=n.indexOf("\\",i);return s.push(n.slice(i)),s.join("")}}},function(e,t,n){"use strict";var r=n(8),i=n(39);e.exports=function(e){return o.raw=function(e,o,a){return i(e,r(a,{position:t(o),warning:n}))},o;function t(t){for(var n=e.offset,r=t.line,i=[];++r&&r in n;)i.push((n[r]||0)+1);return{start:t,indent:i}}function n(t,n,r){3!==r&&e.file.message(t,n)}function o(r,o,a){i(r,{position:t(o),warning:n,text:a,reference:a,textContext:e,referenceContext:e})}}},function(e){e.exports=JSON.parse('{"AElig":"Æ","AMP":"&","Aacute":"Á","Acirc":"Â","Agrave":"À","Aring":"Å","Atilde":"Ã","Auml":"Ä","COPY":"©","Ccedil":"Ç","ETH":"Ð","Eacute":"É","Ecirc":"Ê","Egrave":"È","Euml":"Ë","GT":">","Iacute":"Í","Icirc":"Î","Igrave":"Ì","Iuml":"Ï","LT":"<","Ntilde":"Ñ","Oacute":"Ó","Ocirc":"Ô","Ograve":"Ò","Oslash":"Ø","Otilde":"Õ","Ouml":"Ö","QUOT":"\\"","REG":"®","THORN":"Þ","Uacute":"Ú","Ucirc":"Û","Ugrave":"Ù","Uuml":"Ü","Yacute":"Ý","aacute":"á","acirc":"â","acute":"´","aelig":"æ","agrave":"à","amp":"&","aring":"å","atilde":"ã","auml":"ä","brvbar":"¦","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","curren":"¤","deg":"°","divide":"÷","eacute":"é","ecirc":"ê","egrave":"è","eth":"ð","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","iacute":"í","icirc":"î","iexcl":"¡","igrave":"ì","iquest":"¿","iuml":"ï","laquo":"«","lt":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","ntilde":"ñ","oacute":"ó","ocirc":"ô","ograve":"ò","ordf":"ª","ordm":"º","oslash":"ø","otilde":"õ","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\"","raquo":"»","reg":"®","sect":"§","shy":"­","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","thorn":"þ","times":"×","uacute":"ú","ucirc":"û","ugrave":"ù","uml":"¨","uuml":"ü","yacute":"ý","yen":"¥","yuml":"ÿ"}')},function(e){e.exports=JSON.parse('{"0":"�","128":"€","130":"‚","131":"ƒ","132":"„","133":"…","134":"†","135":"‡","136":"ˆ","137":"‰","138":"Š","139":"‹","140":"Œ","142":"Ž","145":"‘","146":"’","147":"“","148":"”","149":"•","150":"–","151":"—","152":"˜","153":"™","154":"š","155":"›","156":"œ","158":"ž","159":"Ÿ"}')},function(e,t,n){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}},function(e,t,n){"use strict";var r=n(62),i=n(29);e.exports=function(e){return r(e)||i(e)}},function(e,t,n){"use strict";var r;e.exports=function(e){var t,n="&"+e+";";if((r=r||document.createElement("i")).innerHTML=n,59===(t=r.textContent).charCodeAt(t.length-1)&&"semi"!==e)return!1;return t!==n&&t}},function(e,t,n){"use strict";e.exports=function(e){return function(t,n){var o,a,s,l,c,u,d=this,f=d.offset,h=[],p=d[e+"Methods"],m=d[e+"Tokenizers"],b=n.line,g=n.column;if(!t)return h;k.now=v,k.file=d.file,y("");for(;t;){for(o=-1,a=p.length,c=!1;++o"],i=r.concat(["~","|"]),o=i.concat(["\n",'"',"$","%","&","'",",","/",":",";","<","=","?","@","^"]);function a(e){var t=e||{};return t.commonmark?o:t.gfm?i:r}a.default=r,a.gfm=i,a.commonmark=o},function(e){e.exports=JSON.parse('["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","pre","section","source","title","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]')},function(e,t,n){"use strict";var r=n(8),i=n(274);e.exports=function(){var e,t=String(this.file),n={line:1,column:1,offset:0},a=r(n);65279===(t=t.replace(o,"\n")).charCodeAt(0)&&(t=t.slice(1),a.column++,a.offset++);e={type:"root",children:this.tokenizeBlock(t,a),position:{start:n,end:this.eof||r(n)}},this.options.position||i(e,!0);return e};var o=/\r\n|\r/g},function(e,t,n){"use strict";var r=n(25);function i(e){delete e.position}function o(e){e.position=void 0}e.exports=function(e,t){return r(e,t?i:o),e}},function(e,t,n){"use strict";e.exports=i;var r=n(276);function i(e,t,n,i){var a;function s(e,r,l){var c,u=[];return(t&&!a(e,r,l[l.length-1]||null)||!1!==(u=o(n(e,l)))[0])&&e.children&&"skip"!==u[0]&&!1===(c=o(function(e,t){var n,r=i?-1:1,o=(i?e.length:-1)+r;for(;o>-1&&o=4)){for(l="";g"!==t.charAt(x))return;if(n)return!0;x=0;for(;x"===t.charAt(x)?(x++,f=!0," "===t.charAt(x)&&x++):x=d,c=t.slice(x,l),!f&&!r(c)){x=d;break}if(!f&&(s=t.slice(x),i(b,m,this,[e,s,!0])))break;u=d===x?c:t.slice(d,l),w.push(x-d),_.push(u),k.push(c),x=l+1}x=-1,v=w.length,o=e(_.join("\n"));for(;++x6)return;if(!o||!a.pedantic&&"#"===t.charAt(l+1))return;s=t.length+1,i="";for(;++l=3&&(!r||"\n"===r)?(c+=a,!!n||e(c)({type:"thematicBreak"})):void 0;a+=r}}},function(e,t,n){"use strict";var r=n(23),i=n(40),o=n(29),a=n(64),s=n(284),l=n(42);e.exports=function(e,t,n){var i,a,s,c,u,d,f,h,y,v,_,k,w,x,M,S,L,C,E,T,O,D,j,Y,P=this.options.commonmark,A=this.options.pedantic,N=this.blockTokenizers,R=this.interruptList,H=0,I=t.length,F=null,z=0;for(;H=4)return;if(c=t.charAt(H),i=P?b:m,!0===p[c])u=c,s=!1;else{for(s=!0,a="";H=4&&(Y=!0),L&&z>=L.indent&&(Y=!0),c=t.charAt(H),y=null,!Y){if(!0===p[c])y=c,H++,z++;else{for(a="";H=L.indent||z>4):Y=!0,h=!1,H=f;if(_=t.slice(f,d),v=f===H?_:t.slice(H,d),("*"===y||"_"===y||"-"===y)&&N.thematicBreak.call(this,e,_,!0))break;if(k=w,w=!r(v).length,Y&&L)L.value=L.value.concat(S,_),M=M.concat(S,_),S=[];else if(h)0!==S.length&&(L.value.push(""),L.trail=S.concat()),L={value:[_],indent:z,trail:[]},x.push(L),M=M.concat(S,_),S=[];else if(w){if(k)break;S.push(_)}else{if(k)break;if(l(R,N,this,[e,_,!0]))break;L.value=L.value.concat(S,_),M=M.concat(S,_),S=[]}H=d+1}O=e(M.join("\n")).reset({type:"list",ordered:s,start:F,loose:null,children:[]}),C=this.enterList(),E=this.enterBlock(),T=!1,H=-1,I=x.length;for(;++H0&&a.indent=3){d--;break}f+=a}i="",o="";for(;++d|$))/i,/<\/(script|pre|style)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(r.source+"\\s*$"),/^$/,!1]];for(;h"!==e&&"["!==e&&"]"!==e}function s(e){return"["!==e&&"]"!==e&&!r(e)}a.delimiter=">"},function(e,t,n){"use strict";var r=n(7);e.exports=function(e,t,n){var i,o,a,s,l,c,u,d,f,h,p,m,b,g,y,v,_,k,w,x,M,S,L,C;if(!this.options.gfm)return;i=0,k=0,c=t.length+1,u=[];for(;iS){if(k<2)return;break}u.push(t.slice(i,S)),k++,i=S+1}s=u.join("\n"),o=u.splice(1,1)[0]||[],i=0,c=o.length,k--,a=!1,p=[];for(;i1&&(f?(s+=d.slice(0,d.length-1),d=d.charAt(d.length-1)):(s+=d,d="")),v=e.now(),e(s)({type:"tableCell",children:this.tokenizeInline(m,v)},l)),e(d+f),d="",m=""}else if(d&&(m+=d,d=""),m+=f,"\\"===f&&i!==c-2&&(m+=w.charAt(i+1),i++),"`"===f){for(g=1;w.charAt(i+1)===f;)m+=f,i++,g++;y?g>=y&&(y=0):y=g}b=!1,i++}else m?d+=f:e(f),i++;_||e("\n"+o)}return M}},function(e,t,n){"use strict";var r=n(23),i=n(29),o=n(41),a=n(42);e.exports=function(e,t,n){var s,l,c,u,d,f=this.options,h=f.commonmark,p=f.gfm,m=this.blockTokenizers,b=this.interruptParagraph,g=t.indexOf("\n"),y=t.length;for(;g=4){g=t.indexOf("\n",g+1);continue}}if(l=t.slice(g+1),a(b,m,this,[e,l,!0]))break;if(m.list.call(this,e,l,!0)&&(this.inList||h||p&&!i(r.left(l).charAt(0))))break;if(s=g,-1!==(g=t.indexOf("\n",g+1))&&""===r(t.slice(s,g))){g=s;break}}if(l=t.slice(0,g),""===r(l))return e(l),null;if(n)return!0;return d=e.now(),l=o(l),e(l)({type:"paragraph",children:this.tokenizeInline(l,d)})}},function(e,t,n){"use strict";var r=n(293);function i(e,t,n){var r,i;if("\\"===t.charAt(0)&&(r=t.charAt(1),-1!==this.escape.indexOf(r)))return!!n||(i="\n"===r?{type:"break"}:{type:"text",value:r},e("\\"+r)(i))}e.exports=i,i.locator=r},function(e,t,n){"use strict";e.exports=function(e,t){return e.indexOf("\\",t)}},function(e,t,n){"use strict";var r=n(7),i=n(39),o=n(66);e.exports=s,s.locator=o,s.notInLink=!0;var a="mailto:".length;function s(e,t,n){var o,s,l,c,u,d,f,h,p,m,b;if("<"===t.charAt(0)){for(this,o="",s=t.length,l=0,c="",d=!1,f="",l++,o="<";l"===u||"@"===u||":"===u&&"/"===t.charAt(l+1)));)c+=u,l++;if(c){if(f+=c,c="",f+=u=t.charAt(l),l++,"@"===u)d=!0;else{if(":"!==u||"/"!==t.charAt(l+1))return;f+="/",l++}for(;l"!==u);)c+=u,l++;if(u=t.charAt(l),c&&">"===u)return!!n||(p=f+=c,o+=f+u,(h=e.now()).column++,h.offset++,d&&("mailto:"===f.slice(0,a).toLowerCase()?(p=p.substr(a),h.column+=a,h.offset+=a):f="mailto:"+f),m=this.inlineTokenizers,this.inlineTokenizers={text:m.text},b=this.enterLink(),p=this.tokenizeInline(p,h),this.inlineTokenizers=m,b(),e(o)({type:"link",title:null,url:i(f,{nonTerminated:!1}),children:p}))}}}},function(e,t,n){"use strict";var r=n(39),i=n(7),o=n(296);e.exports=l,l.locator=o,l.notInLink=!0;var a=["http://","https://","mailto:"],s=a.length;function l(e,t,n){var o,l,c,u,d,f,h,p,m,b,g,y;if(this.options.gfm){for(o="",u=-1,p=s;++u/i;function l(e,t,n){var i,l,c=t.length;if(!("<"!==t.charAt(0)||c<3)&&(i=t.charAt(1),(r(i)||"?"===i||"!"===i||"/"===i)&&(l=t.match(o))))return!!n||(l=l[0],!this.inLink&&a.test(l)?this.inLink=!0:this.inLink&&s.test(l)&&(this.inLink=!1),e(l)({type:"html",value:l}))}},function(e,t,n){"use strict";var r=n(7),i=n(67);e.exports=l,l.locator=i;var o={}.hasOwnProperty,a={'"':'"',"'":"'"},s={};function l(e,t,n){var i,l,c,u,d,f,h,p,m,b,g,y,v,_,k,w,x,M,S,L="",C=0,E=t.charAt(0),T=this.options.pedantic,O=this.options.commonmark,D=this.options.gfm;if("!"===E&&(m=!0,L=E,E=t.charAt(++C)),"["===E&&(m||!this.inLink)){for(L+=E,k="",C++,y=t.length,_=0,(x=e.now()).column+=C,x.offset+=C;C=c&&(c=0):c=l}else if("\\"===E)C++,f+=t.charAt(C);else if(c&&!D||"["!==E){if((!c||D)&&"]"===E){if(!_){if(!T)for(;C"!==(E=t.charAt(C));){if(O&&"\n"===E)return;k+=E,C++}if(">"!==t.charAt(C))return;L+="<"+k+">",w=k,C++}else{for(E=null,f="";Ct&&" "===e.charAt(n-1);)n--;return n}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,i,o,a,s,l,c,u,d,f;if(n)return!0;r=this.inlineMethods,a=r.length,i=this.inlineTokenizers,o=-1,d=t.length;for(;++o$/i,o=/^<(\/?)([a-z]+)\s*>$/;e.exports=function(e){var t,n;return r(e,"html",(function(e,r,a){n!==a&&(t=[],n=a);var s=function(e){var t=e.value.match(i);return!!t&&t[1]}(e);if(s)return a.children.splice(r,1,{type:"virtualHtml",tag:s,position:e.position}),!0;var l=function(e,t){var n=e.value.match(o);return!!n&&{tag:n[2],opening:!n[1],node:e}}(e);if(!l)return!0;var c=function(e,t){var n=e.length;for(;n--;)if(e[n].tag===t)return e.splice(n,1)[0];return!1}(t,l.tag);return c?a.children.splice(r,0,function(e,t,n){var r=n.children.indexOf(e.node),i=n.children.indexOf(t.node),o=n.children.splice(r,i-r+1).slice(1,-1);return{type:"virtualHtml",children:o,tag:e.tag,position:{start:e.node.position.start,end:t.node.position.end,indent:[]}}}(l,c,a)):l.opening||t.push(l),!0}),!0),e}},function(e,t,n){"use strict";var r=n(25);function i(e,t,n,r){if("remove"===r)n.children.splice(t,1);else if("unwrap"===r){var i=[t,1];e.children&&(i=i.concat(e.children)),Array.prototype.splice.apply(n.children,i)}}t.ofType=function(e,t){return function(t){return e.forEach((function(e){return r(t,e,n,!0)})),t};function n(e,n,r){r&&i(e,n,r,t)}},t.ifNotMatch=function(e,t){return function(e){return r(e,n,!0),e};function n(n,r,o){o&&!e(n,r,o)&&i(n,r,o,t)}}},function(e,t,n){"use strict";var r=n(0),i=n(8),o=n(24),a={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function s(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,c=t.renderers[e.type];void 0===e.position&&(e.position=n.node&&n.node.position||a);var u=e.position.start,d=[e.type,u.line,u.column,i].join("-");if(!o.isValidElementType(c))throw new Error("Renderer for type `".concat(e.type,"` not defined or is not renderable"));var f=l(e,d,t,c,n,i);return r.createElement(c,f,f.children||h()||void 0);function h(){return e.children&&e.children.map((function(n,r){return s(n,t,{node:e,props:f},r)}))}}function l(e,t,n,o,a,l){var u,d={key:t},f="string"==typeof o;n.sourcePos&&e.position&&(d["data-sourcepos"]=[(u=e.position).start.line,":",u.start.column,"-",u.end.line,":",u.end.column].map(String).join("")),n.rawSourcePos&&!f&&(d.sourcePosition=e.position),n.includeNodeIndex&&a.node&&a.node.children&&!f&&(d.index=a.node.children.indexOf(e),d.parentChildCount=a.node.children.length);var h=null!==e.identifier&&void 0!==e.identifier?n.definitions[e.identifier]||{}:null;switch(e.type){case"root":c(d,{className:n.className});break;case"text":d.nodeKey=t,d.children=e.value;break;case"heading":d.level=e.depth;break;case"list":d.start=e.start,d.ordered=e.ordered,d.tight=!e.loose,d.depth=e.depth;break;case"listItem":d.checked=e.checked,d.tight=!e.loose,d.ordered=e.ordered,d.index=e.index,d.children=function(e,t){if(e.loose)return e.children;if(t.node&&e.index>0&&t.node.children[e.index-1].loose)return e.children;return function(e){return e.children.reduce((function(e,t){return e.concat("paragraph"===t.type?t.children||[]:[t])}),[])}(e)}(e,a).map((function(t,r){return s(t,n,{node:e,props:d},r)}));break;case"definition":c(d,{identifier:e.identifier,title:e.title,url:e.url});break;case"code":c(d,{language:e.lang&&e.lang.split(/\s/,1)[0]});break;case"inlineCode":d.children=e.value,d.inline=!0;break;case"link":c(d,{title:e.title||void 0,target:"function"==typeof n.linkTarget?n.linkTarget(e.url,e.children,e.title):n.linkTarget,href:n.transformLinkUri?n.transformLinkUri(e.url,e.children,e.title):e.url});break;case"image":c(d,{alt:e.alt||void 0,title:e.title||void 0,src:n.transformImageUri?n.transformImageUri(e.url,e.children,e.title,e.alt):e.url});break;case"linkReference":c(d,i(h,{href:n.transformLinkUri?n.transformLinkUri(h.href):h.href}));break;case"imageReference":c(d,{src:n.transformImageUri&&h.href?n.transformImageUri(h.href,e.children,h.title,e.alt):h.href,title:h.title||void 0,alt:e.alt||void 0});break;case"table":case"tableHead":case"tableBody":d.columnAlignment=e.align;break;case"tableRow":d.isHeader="tableHead"===a.node.type,d.columnAlignment=a.props.columnAlignment;break;case"tableCell":c(d,{isHeader:a.props.isHeader,align:a.props.columnAlignment[l]});break;case"virtualHtml":d.tag=e.tag;break;case"html":d.isBlock=e.position.start.line!==e.position.end.line,d.escapeHtml=n.escapeHtml,d.skipHtml=n.skipHtml;break;case"parsedHtml":var p;e.children&&(p=e.children.map((function(t,r){return s(t,n,{node:e,props:d},r)}))),d.escapeHtml=n.escapeHtml,d.skipHtml=n.skipHtml,d.element=function(e,t){var n=e.element;if(Array.isArray(n)){var i=r.Fragment||"div";return r.createElement(i,null,n)}if(n.props.children||t){var o=r.Children.toArray(n.props.children).concat(t);return r.cloneElement(n,null,o)}return r.cloneElement(n,null)}(e,p);break;default:c(d,i(e,{type:void 0,position:void 0,children:void 0}))}return!f&&e.value&&(d.value=e.value),d}function c(e,t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}e.exports=s},function(e,t,n){"use strict";var r=n(25);function i(e){var t=e.children;e.children=[{type:"tableHead",align:e.align,children:[t[0]],position:t[0].position}],t.length>1&&e.children.push({type:"tableBody",align:e.align,children:t.slice(1),position:{start:t[1].position.start,end:t[t.length-1].position.end}})}e.exports=function(e){return r(e,"table",i),e}},function(e,t,n){"use strict";e.exports=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(t.children||[]).reduce((function(t,n){return"definition"===n.type&&(t[n.identifier]={href:n.url,title:n.title}),e(n,t)}),n)}},function(e,t,n){"use strict";var r=["http","https","mailto","tel"];e.exports=function(e){var t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;var i=t.indexOf(":");if(-1===i)return t;for(var o=r.length,a=-1;++aa||-1!==(a=t.indexOf("#"))&&i>a?t:"javascript:void(0)"}},function(e,t,n){"use strict";var r=n(8),i=n(0),o=parseInt((i.version||"16").slice(0,2),10)>=16,a=i.createElement;function s(e,t){return a(e,l(t),t.children)}function l(e){return e["data-sourcepos"]?{"data-sourcepos":e["data-sourcepos"]}:{}}e.exports={break:"br",paragraph:"p",emphasis:"em",strong:"strong",thematicBreak:"hr",blockquote:"blockquote",delete:"del",link:"a",image:"img",linkReference:"a",imageReference:"img",table:s.bind(null,"table"),tableHead:s.bind(null,"thead"),tableBody:s.bind(null,"tbody"),tableRow:s.bind(null,"tr"),tableCell:function(e){var t=e.align?{textAlign:e.align}:void 0,n=l(e);return a(e.isHeader?"th":"td",t?r({style:t},n):n,e.children)},root:function(e){var t=!e.className,n=t&&i.Fragment||"div";return a(n,t?null:e,e.children)},text:function(e){return o?e.children:a("span",null,e.children)},list:function(e){var t=l(e);null!==e.start&&1!==e.start&&void 0!==e.start&&(t.start=e.start.toString());return a(e.ordered?"ol":"ul",t,e.children)},listItem:function(e){var t=null;if(null!==e.checked&&void 0!==e.checked){var n=e.checked;t=a("input",{type:"checkbox",checked:n,readOnly:!0})}return a("li",l(e),t,e.children)},definition:function(){return null},heading:function(e){return a("h".concat(e.level),l(e),e.children)},inlineCode:function(e){return a("code",l(e),e.children)},code:function(e){var t=e.language&&"language-".concat(e.language),n=a("code",t?{className:t}:null,e.value);return a("pre",l(e),n)},html:function(e){if(e.skipHtml)return null;var t=e.isBlock?"div":"span";if(e.escapeHtml){var n=i.Fragment||t;return a(n,null,e.value)}var r={dangerouslySetInnerHTML:{__html:e.value}};return a(t,r)},virtualHtml:function(e){return a(e.tag,l(e),e.children)},parsedHtml:function(e){return e["data-sourcepos"]?i.cloneElement(e.element,{"data-sourcepos":e["data-sourcepos"]}):e.element}}},function(e,t,n){"use strict";var r=n(0),i=n(8),o=n(25),a=n(322),s=n(68),l="parsedHtml",c=/^<(area|base|br|col|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)\s*\/?>$/i,u=/^<([a-z]+)\b/i,d=/^<\/([a-z]+)\s*>$/,f=new a.Parser,h={isValidNode:function(e){return"script"!==e.type},processingInstructions:[{shouldProcessNode:function(){return!0},processNode:new a.ProcessNodeDefinitions(r).processDefaultNode}]};function p(e,t,n){var i,a;return o(t,"html",(function(t,o,s){if(n.escapeHtml)return s.children.splice(o,1,{type:"text",position:t.position,value:t.value}),!0;if(n.skipHtml)return s.children.splice(o,1),!0;a!==s&&(i=[],a=s);var h=function(e){var t=e.value.match(c);return!!t&&t[1]}(t);if(h)return s.children.splice(o,1,{type:"virtualHtml",tag:h,position:t.position}),!0;var p=function(e,t){var n=e.value.trim().match(d);if(n)return{tag:n[1],opening:!1,node:e};var i=f.parseWithInstructions(e.value,t.isValidNode,t.processingInstructions);if(!i)return!1;var o=r.Children.count(i)>1,a=!o&&c.test("<".concat(i.type,">"));if(o||a)return{type:l,position:e.position,node:i};var s=e.value.trim().match(u);return{tag:s?s[1]:i.type,opening:!0,node:e,element:i}}(t,e);if(!p||p.type===l)return!0;var m=function(e,t){var n=e.length;for(;n--;)if(e[n].tag===t)return e.splice(n,1)[0];return!1}(i,p.tag);return m?s.children.splice(o,0,function(e,t,n){var r=n.children.indexOf(e.node),i=n.children.indexOf(t.node),o=n.children.splice(r,i-r+1).slice(1,-1);return{type:l,children:o,tag:e.tag,element:e.element,value:e.node.value,position:{start:e.node.position.start,end:t.node.position.end,indent:[]}}}(p,m,s)):p.opening||i.push(p),!0}),!0),o(t,"html",(function(t,n,r){var i=f.parseWithInstructions(t.value,e.isValidNode,e.processingInstructions);return i?(r.children.splice(n,1,{type:l,element:i,value:t.value,position:t.position}),!0):(r.children.splice(n,1),!0)})),t}e.exports=function(e,t){if(t&&(void 0!==e.source||void 0!==e.children))throw new Error("react-markdown: `html-parser` must be called before use - see https://github.com/rexxars/react-markdown#parsing-html");var n=i(h,e||{}),r=p.bind(null,n);return r.identity=s.HtmlParser,r}},function(e,t,n){"use strict";var r=n(323),i=n(80),o=n(83),a=n(81);e.exports={Parser:r,ProcessingInstructions:i,IsValidNodeDefinitions:o,ProcessNodeDefinitions:a}},function(e,t,n){"use strict";var r=n(324),i=n(326),o=n(330),a=n(341),s=n(344),l=n(347).Parser,c=n(52).DomHandler,u=n(80),d=n(83),f=n(82);e.exports=function(e){function t(t,n,u,d){var h=function(t){(e=e||{}).decodeEntities=!0;var n=new c;return new l(n,e).parseComplete(t),n.dom.filter((function(e){return"directive"!==e.type}))}(t).map((function(e,t){return function e(t,n,l,c,u){if(n(t)){r((function(e){e.shouldPreprocessNode(t)&&e.preprocessNode(t,u)}),c||[]);var d=i((function(e){return e.shouldProcessNode(t)}),l||[]);if(null!=d){var h=o((function(e){return null==e||!1===e}),a(s)((function(t,r){return e(t,n,l,c,r)}),t.children||[]));return d.replaceChildren?f.createElement(t,u,t.data,[d.processNode(t,h,u)]):d.processNode(t,h,u)}return!1}return!1}(e,n,u,d,t)}));return h.length<=1?h[0]:h}return{parse:function(e){var n=new u;return t(e,d.alwaysValid,n.defaultProcessingInstructions)},parseWithInstructions:t}}},function(e,t,n){var r=n(325),i=n(9)(r("forEach",(function(e,t){for(var n=t.length,r=0;r0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))}));e.exports=a},function(e,t){e.exports=function(e){return"[object String]"===Object.prototype.toString.call(e)}},function(e,t){var n=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();e.exports=function(e){return new n(e)}},function(e,t,n){var r=n(48),i=n(9)((function(e,t){return r(e.length,(function(){return e.apply(t,arguments)}))}));e.exports=i},function(e,t,n){var r=n(9),i=n(46),o=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=i.init,e.prototype["@@transducer/result"]=i.result,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}(),a=r((function(e,t){return new o(e,t)}));e.exports=a},function(e,t,n){var r=n(49),i=Object.prototype.toString,o=function(){return"[object Arguments]"===i.call(arguments)?function(e){return"[object Arguments]"===i.call(e)}:function(e){return r("callee",e)}}();e.exports=o},function(e,t,n){var r=n(342),i=n(20),o=n(70),a=i((function(e){return o(e.length,(function(){var t=0,n=arguments[0],i=arguments[arguments.length-1],o=Array.prototype.slice.call(arguments,0);return o[0]=function(){var e=n.apply(this,r(arguments,[t,i]));return t+=1,e},e.apply(this,o)}))}));e.exports=a},function(e,t){e.exports=function(e,t){var n;t=t||[];var r=(e=e||[]).length,i=t.length,o=[];for(n=0;n=arguments.length)?u=n[c]:(u=arguments[s],s+=1),a[c]=u,i(u)||(l-=1),c+=1}return l<=0?o.apply(this,a):r(l,e(t,a,o))}}},function(e,t,n){var r=n(9),i=n(45),o=n(345),a=n(47),s=n(346),l=n(70),c=n(69),u=r(i(["fantasy-land/map","map"],s,(function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return l(t.length,(function(){return e.call(this,t.apply(this,arguments))}));case"[object Object]":return a((function(n,r){return n[r]=e(t[r]),n}),{},c(t));default:return o(e,t)}})));e.exports=u},function(e,t){e.exports=function(e,t){for(var n=0,r=t.length,i=Array(r);n0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,u=b(l,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";var r,i=this&&this.__extends||(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(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var o=new Map([["tag",1],["script",1],["style",1],["directive",1],["text",3],["cdata",4],["comment",8]]),a=function(){function e(e){this.type=e,this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"nodeType",{get:function(){return o.get(this.type)||1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent||null},set:function(e){this.parent=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev||null},set:function(e){this.prev=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next||null},set:function(e){this.next=e},enumerable:!0,configurable:!0}),e}();t.Node=a;var s=function(e){function t(t,n){var r=e.call(this,t)||this;return r.data=n,r}return i(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),t}(a);t.DataNode=s;var l=function(e){function t(t,n){var r=e.call(this,"directive",n)||this;return r.name=t,r}return i(t,e),t}(s);t.ProcessingInstruction=l;var c=function(e){function t(t,n){var r=e.call(this,t)||this;return r.children=n,r}return i(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.children[0]||null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children[this.children.length-1]||null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!0,configurable:!0}),t}(a);t.NodeWithChildren=c;var u=function(e){function t(t,n){var r=e.call(this,"script"===t?"script":"style"===t?"style":"tag",[])||this;return r.name=t,r.attribs=n,r.attribs=n,r}return i(t,e),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!0,configurable:!0}),t}(c);t.Element=u},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(26),o=r(n(352));t.getOuterHTML=o.default,t.getInnerHTML=function(e,n){return i.hasChildren(e)?e.children.map((function(e){return t.getOuterHTML(e,n)})).join(""):""},t.getText=function e(t){return Array.isArray(t)?t.map(e).join(""):i.isTag(t)?"br"===t.name?"\n":e(t.children):i.isCDATA(t)?e(t.children):i.isText(t)?t.data:""}},function(e,t,n){var r=n(53),i=n(353),o=n(354);o.elementNames.__proto__=null,o.attributeNames.__proto__=null;var a={__proto__:null,style:!0,script:!0,xmp:!0,iframe:!0,noembed:!0,noframes:!0,plaintext:!0,noscript:!0};var s={__proto__:null,area:!0,base:!0,basefont:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,isindex:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},l=e.exports=function(e,t){Array.isArray(e)||e.cheerio||(e=[e]),t=t||{};for(var n="",i=0;i=0&&(t=Object.assign({},t,{xmlMode:!1}))),!t.xmlMode&&["svg","math"].indexOf(e.name)>=0&&(t=Object.assign({},t,{xmlMode:"foreign"}));var n="<"+e.name,r=function(e,t){if(e){var n,r="";for(var a in e)n=e[a],r&&(r+=" "),"foreign"===t.xmlMode&&(a=o.attributeNames[a]||a),r+=a,(null!==n&&""!==n||t.xmlMode)&&(r+='="'+(t.decodeEntities?i.encodeXML(n):n.replace(/\"/g,"""))+'"');return r}}(e.attribs,t);return r&&(n+=" "+r),!t.xmlMode||e.children&&0!==e.children.length?(n+=">",e.children&&(n+=l(e.children,t)),s[e.name]&&!t.xmlMode||(n+="")):n+="/>",n}function d(e){return"<"+e.data+">"}function f(e,t){var n=e.data||"";return!t.decodeEntities||e.parent&&e.parent.name in a||(n=i.encodeXML(n)),n}function h(e){return""}function p(e){return"\x3c!--"+e.data+"--\x3e"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(77),i=n(78);t.decode=function(e,t){return(!t||t<=0?r.decodeXML:r.decodeHTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?r.decodeXML:r.decodeHTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?i.encodeXML:i.encodeHTML)(e)};var o=n(78);t.encodeXML=o.encodeXML,t.encodeHTML=o.encodeHTML,t.escape=o.escape,t.encodeHTML4=o.encodeHTML,t.encodeHTML5=o.encodeHTML;var a=n(77);t.decodeXML=a.decodeXML,t.decodeHTML=a.decodeHTML,t.decodeHTMLStrict=a.decodeHTMLStrict,t.decodeHTML4=a.decodeHTML,t.decodeHTML5=a.decodeHTML,t.decodeHTML4Strict=a.decodeHTMLStrict,t.decodeHTML5Strict=a.decodeHTMLStrict,t.decodeXMLStrict=a.decodeXML},function(e){e.exports=JSON.parse('{"elementNames":{"altglyph":"altGlyph","altglyphdef":"altGlyphDef","altglyphitem":"altGlyphItem","animatecolor":"animateColor","animatemotion":"animateMotion","animatetransform":"animateTransform","clippath":"clipPath","feblend":"feBlend","fecolormatrix":"feColorMatrix","fecomponenttransfer":"feComponentTransfer","fecomposite":"feComposite","feconvolvematrix":"feConvolveMatrix","fediffuselighting":"feDiffuseLighting","fedisplacementmap":"feDisplacementMap","fedistantlight":"feDistantLight","fedropshadow":"feDropShadow","feflood":"feFlood","fefunca":"feFuncA","fefuncb":"feFuncB","fefuncg":"feFuncG","fefuncr":"feFuncR","fegaussianblur":"feGaussianBlur","feimage":"feImage","femerge":"feMerge","femergenode":"feMergeNode","femorphology":"feMorphology","feoffset":"feOffset","fepointlight":"fePointLight","fespecularlighting":"feSpecularLighting","fespotlight":"feSpotLight","fetile":"feTile","feturbulence":"feTurbulence","foreignobject":"foreignObject","glyphref":"glyphRef","lineargradient":"linearGradient","radialgradient":"radialGradient","textpath":"textPath"},"attributeNames":{"definitionurl":"definitionURL","attributename":"attributeName","attributetype":"attributeType","basefrequency":"baseFrequency","baseprofile":"baseProfile","calcmode":"calcMode","clippathunits":"clipPathUnits","diffuseconstant":"diffuseConstant","edgemode":"edgeMode","filterunits":"filterUnits","glyphref":"glyphRef","gradienttransform":"gradientTransform","gradientunits":"gradientUnits","kernelmatrix":"kernelMatrix","kernelunitlength":"kernelUnitLength","keypoints":"keyPoints","keysplines":"keySplines","keytimes":"keyTimes","lengthadjust":"lengthAdjust","limitingconeangle":"limitingConeAngle","markerheight":"markerHeight","markerunits":"markerUnits","markerwidth":"markerWidth","maskcontentunits":"maskContentUnits","maskunits":"maskUnits","numoctaves":"numOctaves","pathlength":"pathLength","patterncontentunits":"patternContentUnits","patterntransform":"patternTransform","patternunits":"patternUnits","pointsatx":"pointsAtX","pointsaty":"pointsAtY","pointsatz":"pointsAtZ","preservealpha":"preserveAlpha","preserveaspectratio":"preserveAspectRatio","primitiveunits":"primitiveUnits","refx":"refX","refy":"refY","repeatcount":"repeatCount","repeatdur":"repeatDur","requiredextensions":"requiredExtensions","requiredfeatures":"requiredFeatures","specularconstant":"specularConstant","specularexponent":"specularExponent","spreadmethod":"spreadMethod","startoffset":"startOffset","stddeviation":"stdDeviation","stitchtiles":"stitchTiles","surfacescale":"surfaceScale","systemlanguage":"systemLanguage","tablevalues":"tableValues","targetx":"targetX","targety":"targetY","textlength":"textLength","viewbox":"viewBox","viewtarget":"viewTarget","xchannelselector":"xChannelSelector","ychannelselector":"yChannelSelector","zoomandpan":"zoomAndPan"}}')},function(e,t,n){"use strict";function r(e){return e.children||null}function i(e){return e.parent||null}function o(e,t){return e.attribs&&e.attribs[t]}Object.defineProperty(t,"__esModule",{value:!0}),t.getChildren=r,t.getParent=i,t.getSiblings=function(e){var t=i(e);return t?r(t):[e]},t.getAttributeValue=o,t.hasAttrib=function(e,t){return!!o(e,t)},t.getName=function(e){return e.name}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeElement=function(e){if(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e.parent){var t=e.parent.children;t.splice(t.lastIndexOf(e),1)}},t.replaceElement=function(e,t){var n=t.prev=e.prev;n&&(n.next=t);var r=t.next=e.next;r&&(r.prev=t);var i=t.parent=e.parent;if(i){var o=i.children;o[o.lastIndexOf(e)]=t}},t.appendChild=function(e,t){if(t.parent=e,1!==e.children.push(t)){var n=e.children[e.children.length-2];n.next=t,t.prev=n,t.next=null}},t.append=function(e,t){var n=e.parent,r=e.next;if(t.next=r,t.prev=e,e.next=t,t.parent=n,r){if(r.prev=t,n){var i=n.children;i.splice(i.lastIndexOf(r),0,t)}}else n&&n.children.push(t)},t.prepend=function(e,t){var n=e.parent;if(n){var r=n.children;r.splice(r.lastIndexOf(e),0,t)}e.prev&&(e.prev.next=t),t.parent=n,t.prev=e.prev,t.next=e,e.prev=t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(79),i=n(26);function o(e){return"text"===e.type}var a={tag_name:function(e){return"function"==typeof e?function(t){return i.isTag(t)&&e(t.name)}:"*"===e?i.isTag:function(t){return i.isTag(t)&&t.name===e}},tag_type:function(e){return"function"==typeof e?function(t){return e(t.type)}:function(t){return t.type===e}},tag_contains:function(e){return"function"==typeof e?function(t){return o(t)&&e(t.data)}:function(t){return o(t)&&t.data===e}}};function s(e,t){return"function"==typeof t?function(n){return i.isTag(n)&&t(n.attribs[e])}:function(n){return i.isTag(n)&&n.attribs[e]===t}}function l(e,t){return function(n){return e(n)||t(n)}}function c(e){var t=Object.keys(e).map((function(t){var n=e[t];return t in a?a[t](n):s(t,n)}));return 0===t.length?null:t.reduce(l)}t.testElement=function(e,t){var n=c(e);return!n||n(t)},t.getElements=function(e,t,n,i){void 0===i&&(i=1/0);var o=c(e);return o?r.filter(o,t,n,i):[]},t.getElementById=function(e,t,n){return void 0===n&&(n=!0),Array.isArray(t)||(t=[t]),r.findOne(s("id",e),t,n)},t.getElementsByTagName=function(e,t,n,i){return void 0===i&&(i=1/0),r.filter(a.tag_name(e),t,n,i)},t.getElementsByTagType=function(e,t,n,i){return void 0===n&&(n=!0),void 0===i&&(i=1/0),r.filter(a.tag_type(e),t,n,i)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(26);function i(e,t){var n=[],i=[];if(e===t)return 0;for(var o=r.hasChildren(e)?e:e.parent;o;)n.unshift(o),o=o.parent;for(o=r.hasChildren(t)?t:t.parent;o;)i.unshift(o),o=o.parent;for(var a=0;n[a]===i[a];)a++;if(0===a)return 1;var s=n[a-1],l=s.children,c=n[a],u=i[a];return l.indexOf(c)>l.indexOf(u)?s===t?20:4:s===e?10:2}t.removeSubsets=function(e){for(var t=e.length;--t>=0;){var n=e[t];if(t>0&&e.lastIndexOf(n,t-1)>=0)e.splice(t,1);else for(var r=n.parent;r;r=r.parent)if(e.indexOf(r)>-1){e.splice(t,1);break}}return e},t.compareDocumentPosition=i,t.uniqueSort=function(e){return(e=e.filter((function(e,t,n){return!n.includes(e,t+1)}))).sort((function(e,t){var n=i(e,t);return 2&n?-1:4&n?1:0})),e}},function(e,t){},function(e,t,n){"use strict";var r,i=this&&this.__extends||(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(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,(function(e){for(var t,r=[],i=1;i=r?e:function(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r]*>\s*$/,!1)){for(;d.prev&&!d.startOfLine;)d=d.prev;d.startOfLine?u-=r.indentUnit:c.prev.state.lexical&&(u=c.prev.state.lexical.indented)}else 1==c.depth&&(u+=r.indentUnit);return i.context=new t(e.startState(a,u),a,0,i.context),null}if(1==c.depth){if("<"==n.peek())return o.skipAttribute(c.state),i.context=new t(e.startState(o,s(c.state)),o,0,i.context),null;if(n.match("//"))return n.skipToEnd(),"comment";if(n.match("/*"))return c.depth=2,l(n,i)}var f,h=o.token(n,c.state),p=n.current();return/\btag\b/.test(h)?/>$/.test(p)?c.state.context?c.depth=0:i.context=i.context.prev:/^-1&&n.backUp(p.length-f),h}(n,i,i.context):function(n,r,i){if("<"==n.peek()&&a.expressionAllowed(n,i.state))return a.skipExpression(i.state),r.context=new t(e.startState(o,a.indent(i.state,"","")),o,0,r.context),null;var s=a.token(n,i.state);if(!s&&null!=i.depth){var l=n.current();"{"==l?i.depth++:"}"==l&&0==--i.depth&&(r.context=r.context.prev)}return s}(n,i,i.context)}return{startState:function(){return{context:new t(e.startState(a),a)}},copyState:function(e){return{context:n(e.context)}},token:l,indent:function(e,t,n){return e.context.mode.indent(e.context.state,t,n)},innerMode:function(e){return e.context}}}),"xml","javascript"),e.defineMIME("text/jsx","jsx"),e.defineMIME("text/typescript-jsx",{name:"jsx",base:{name:"javascript",typescript:!0}})}(n(11),n(60),n(369))},function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,s=n.jsonld,l=n.json||s,c=n.typescript,u=n.wordCharacters||/[\w$\xa1-\uffff]/,d=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),f=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(e,t,n){return r=e,i=n,t}function m(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(s&&"@"==e.peek()&&e.match(h))return t.tokenize=m,p("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=m),p("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return p("number","number");if("."==r&&e.match(".."))return p("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return p(r);if("="==r&&e.eat(">"))return p("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return p("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),p("number","number");if("/"==r)return e.eat("*")?(t.tokenize=b,b(e,t)):e.eat("/")?(e.skipToEnd(),p("comment","comment")):Ze(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),p("regexp","string-2")):(e.eat("="),p("operator","operator",e.current()));if("`"==r)return t.tokenize=g,g(e,t);if("#"==r)return e.skipToEnd(),p("error","error");if("<"==r&&e.match("!--")||"-"==r&&e.match("->"))return e.skipToEnd(),p("comment","comment");if(f.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),p("operator","operator",e.current());if(u.test(r)){e.eatWhile(u);var i=e.current();if("."!=t.lastType){if(d.propertyIsEnumerable(i)){var o=d[i];return p(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return p("async","keyword",i)}return p("variable","variable",i)}}function b(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=m;break}r="*"==n}return p("comment","comment")}function g(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=m;break}r=!r&&"\\"==n}return p("quasi","string-2",e.current())}function y(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(c){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),l="([{}])".indexOf(s);if(l>=0&&l<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(l>=3&&l<6)++i;else if(u.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var v={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function _(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function k(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}var w={state:null,column:null,marked:null,cc:null};function x(){for(var e=arguments.length-1;e>=0;e--)w.cc.push(arguments[e])}function M(){return x.apply(null,arguments),!0}function S(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function L(e){var t=w.state;if(w.marked="def",t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=function e(t,n){if(n){if(n.block){var r=e(t,n.prev);return r?r==n.prev?n:new E(r,n.vars,!0):null}return S(t,n.vars)?n:new E(n.prev,new T(t,n.vars),!1)}return null}(e,t.context);if(null!=r)return void(t.context=r)}else if(!S(e,t.localVars))return void(t.localVars=new T(e,t.localVars));n.globalVars&&!S(e,t.globalVars)&&(t.globalVars=new T(e,t.globalVars))}function C(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function E(e,t,n){this.prev=e,this.vars=t,this.block=n}function T(e,t){this.name=e,this.next=t}var O=new T("this",new T("arguments",null));function D(){w.state.context=new E(w.state.context,w.state.localVars,!1),w.state.localVars=O}function j(){w.state.context=new E(w.state.context,w.state.localVars,!0),w.state.localVars=null}function Y(){w.state.localVars=w.state.context.vars,w.state.context=w.state.context.prev}function P(e,t){var n=function(){var n=w.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new _(r,w.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function A(){var e=w.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function N(e){return function t(n){return n==e?M():";"==e||"}"==n||")"==n||"]"==n?x():M(t)}}function R(e,t){return"var"==e?M(P("vardef",t),ye,N(";"),A):"keyword a"==e?M(P("form"),z,R,A):"keyword b"==e?M(P("form"),R,A):"keyword d"==e?w.stream.match(/^\s*$/,!1)?M():M(P("stat"),B,N(";"),A):"debugger"==e?M(N(";")):"{"==e?M(P("}"),j,oe,A,Y):";"==e?M():"if"==e?("else"==w.state.lexical.info&&w.state.cc[w.state.cc.length-1]==A&&w.state.cc.pop()(),M(P("form"),z,R,A,Me)):"function"==e?M(Ee):"for"==e?M(P("form"),Se,R,A):"class"==e||c&&"interface"==t?(w.marked="keyword",M(P("form","class"==e?e:t),Ye,A)):"variable"==e?c&&"declare"==t?(w.marked="keyword",M(R)):c&&("module"==t||"enum"==t||"type"==t)&&w.stream.match(/^\s*\w/,!1)?(w.marked="keyword","enum"==t?M(Ve):"type"==t?M(Oe,N("operator"),ue,N(";")):M(P("form"),ve,N("{"),P("}"),oe,A,A)):c&&"namespace"==t?(w.marked="keyword",M(P("form"),I,R,A)):c&&"abstract"==t?(w.marked="keyword",M(R)):M(P("stat"),X):"switch"==e?M(P("form"),z,N("{"),P("}","switch"),j,oe,A,A,Y):"case"==e?M(I,N(":")):"default"==e?M(N(":")):"catch"==e?M(P("form"),D,H,R,A,Y):"export"==e?M(P("stat"),Re,A):"import"==e?M(P("stat"),Ie,A):"async"==e?M(R):"@"==t?M(I,R):x(P("stat"),I,N(";"),A)}function H(e){if("("==e)return M(De,N(")"))}function I(e,t){return W(e,t,!1)}function F(e,t){return W(e,t,!0)}function z(e){return"("!=e?x():M(P(")"),B,N(")"),A)}function W(e,t,n){if(w.state.fatArrowAt==w.stream.start){var r=n?$:G;if("("==e)return M(D,P(")"),re(De,")"),A,N("=>"),r,Y);if("variable"==e)return x(D,ve,N("=>"),r,Y)}var i=n?V:U;return v.hasOwnProperty(e)?M(i):"function"==e?M(Ee,i):"class"==e||c&&"interface"==t?(w.marked="keyword",M(P("form"),je,A)):"keyword c"==e||"async"==e?M(n?F:I):"("==e?M(P(")"),B,N(")"),A,i):"operator"==e||"spread"==e?M(n?F:I):"["==e?M(P("]"),Ue,A,i):"{"==e?ie(ee,"}",null,i):"quasi"==e?x(q,i):"new"==e?M(function(e){return function(t){return"."==t?M(e?K:J):"variable"==t&&c?M(me,e?V:U):x(e?F:I)}}(n)):"import"==e?M(I):M()}function B(e){return e.match(/[;\}\)\],]/)?x():x(I)}function U(e,t){return","==e?M(B):V(e,t,!1)}function V(e,t,n){var r=0==n?U:V,i=0==n?I:F;return"=>"==e?M(D,n?$:G,Y):"operator"==e?/\+\+|--/.test(t)||c&&"!"==t?M(r):c&&"<"==t&&w.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?M(P(">"),re(ue,">"),A,r):"?"==t?M(I,N(":"),i):M(i):"quasi"==e?x(q,r):";"!=e?"("==e?ie(F,")","call",r):"."==e?M(Q,r):"["==e?M(P("]"),B,N("]"),A,r):c&&"as"==t?(w.marked="keyword",M(ue,r)):"regexp"==e?(w.state.lastType=w.marked="operator",w.stream.backUp(w.stream.pos-w.stream.start-1),M(i)):void 0:void 0}function q(e,t){return"quasi"!=e?x():"${"!=t.slice(t.length-2)?M(q):M(I,Z)}function Z(e){if("}"==e)return w.marked="string-2",w.state.tokenize=g,M(q)}function G(e){return y(w.stream,w.state),x("{"==e?R:I)}function $(e){return y(w.stream,w.state),x("{"==e?R:F)}function J(e,t){if("target"==t)return w.marked="keyword",M(U)}function K(e,t){if("target"==t)return w.marked="keyword",M(V)}function X(e){return":"==e?M(A,R):x(U,N(";"),A)}function Q(e){if("variable"==e)return w.marked="property",M()}function ee(e,t){return"async"==e?(w.marked="property",M(ee)):"variable"==e||"keyword"==w.style?(w.marked="property","get"==t||"set"==t?M(te):(c&&w.state.fatArrowAt==w.stream.start&&(n=w.stream.match(/^\s*:\s*/,!1))&&(w.state.fatArrowAt=w.stream.pos+n[0].length),M(ne))):"number"==e||"string"==e?(w.marked=s?"property":w.style+" property",M(ne)):"jsonld-keyword"==e?M(ne):c&&C(t)?(w.marked="keyword",M(ee)):"["==e?M(I,ae,N("]"),ne):"spread"==e?M(F,ne):"*"==t?(w.marked="keyword",M(ee)):":"==e?x(ne):void 0;var n}function te(e){return"variable"!=e?x(ne):(w.marked="property",M(Ee))}function ne(e){return":"==e?M(F):"("==e?x(Ee):void 0}function re(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=w.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),M((function(n,r){return n==t||r==t?x():x(e)}),r)}return i==t||o==t?M():n&&n.indexOf(";")>-1?x(e):M(N(t))}return function(n,i){return n==t||i==t?M():x(e,r)}}function ie(e,t,n){for(var r=3;r"),ue):void 0}function de(e){if("=>"==e)return M(ue)}function fe(e,t){return"variable"==e||"keyword"==w.style?(w.marked="property",M(fe)):"?"==t||"number"==e||"string"==e?M(fe):":"==e?M(ue):"["==e?M(N("variable"),se,N("]"),fe):"("==e?x(Te,fe):void 0}function he(e,t){return"variable"==e&&w.stream.match(/^\s*[?:]/,!1)||"?"==t?M(he):":"==e?M(ue):"spread"==e?M(he):x(ue)}function pe(e,t){return"<"==t?M(P(">"),re(ue,">"),A,pe):"|"==t||"."==e||"&"==t?M(ue):"["==e?M(ue,N("]"),pe):"extends"==t||"implements"==t?(w.marked="keyword",M(ue)):"?"==t?M(ue,N(":"),ue):void 0}function me(e,t){if("<"==t)return M(P(">"),re(ue,">"),A,pe)}function be(){return x(ue,ge)}function ge(e,t){if("="==t)return M(ue)}function ye(e,t){return"enum"==t?(w.marked="keyword",M(Ve)):x(ve,ae,we,xe)}function ve(e,t){return c&&C(t)?(w.marked="keyword",M(ve)):"variable"==e?(L(t),M()):"spread"==e?M(ve):"["==e?ie(ke,"]"):"{"==e?ie(_e,"}"):void 0}function _e(e,t){return"variable"!=e||w.stream.match(/^\s*:/,!1)?("variable"==e&&(w.marked="property"),"spread"==e?M(ve):"}"==e?x():"["==e?M(I,N("]"),N(":"),_e):M(N(":"),ve,we)):(L(t),M(we))}function ke(){return x(ve,we)}function we(e,t){if("="==t)return M(F)}function xe(e){if(","==e)return M(ye)}function Me(e,t){if("keyword b"==e&&"else"==t)return M(P("form","else"),R,A)}function Se(e,t){return"await"==t?M(Se):"("==e?M(P(")"),Le,A):void 0}function Le(e){return"var"==e?M(ye,Ce):"variable"==e?M(Ce):x(Ce)}function Ce(e,t){return")"==e?M():";"==e?M(Ce):"in"==t||"of"==t?(w.marked="keyword",M(I,Ce)):x(I,Ce)}function Ee(e,t){return"*"==t?(w.marked="keyword",M(Ee)):"variable"==e?(L(t),M(Ee)):"("==e?M(D,P(")"),re(De,")"),A,le,R,Y):c&&"<"==t?M(P(">"),re(be,">"),A,Ee):void 0}function Te(e,t){return"*"==t?(w.marked="keyword",M(Te)):"variable"==e?(L(t),M(Te)):"("==e?M(D,P(")"),re(De,")"),A,le,Y):c&&"<"==t?M(P(">"),re(be,">"),A,Te):void 0}function Oe(e,t){return"keyword"==e||"variable"==e?(w.marked="type",M(Oe)):"<"==t?M(P(">"),re(be,">"),A):void 0}function De(e,t){return"@"==t&&M(I,De),"spread"==e?M(De):c&&C(t)?(w.marked="keyword",M(De)):c&&"this"==e?M(ae,we):x(ve,ae,we)}function je(e,t){return"variable"==e?Ye(e,t):Pe(e,t)}function Ye(e,t){if("variable"==e)return L(t),M(Pe)}function Pe(e,t){return"<"==t?M(P(">"),re(be,">"),A,Pe):"extends"==t||"implements"==t||c&&","==e?("implements"==t&&(w.marked="keyword"),M(c?ue:I,Pe)):"{"==e?M(P("}"),Ae,A):void 0}function Ae(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||c&&C(t))&&w.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(w.marked="keyword",M(Ae)):"variable"==e||"keyword"==w.style?(w.marked="property",M(c?Ne:Ee,Ae)):"number"==e||"string"==e?M(c?Ne:Ee,Ae):"["==e?M(I,ae,N("]"),c?Ne:Ee,Ae):"*"==t?(w.marked="keyword",M(Ae)):c&&"("==e?x(Te,Ae):";"==e||","==e?M(Ae):"}"==e?M():"@"==t?M(I,Ae):void 0}function Ne(e,t){if("?"==t)return M(Ne);if(":"==e)return M(ue,we);if("="==t)return M(F);var n=w.state.lexical.prev;return x(n&&"interface"==n.info?Te:Ee)}function Re(e,t){return"*"==t?(w.marked="keyword",M(Be,N(";"))):"default"==t?(w.marked="keyword",M(I,N(";"))):"{"==e?M(re(He,"}"),Be,N(";")):x(R)}function He(e,t){return"as"==t?(w.marked="keyword",M(N("variable"))):"variable"==e?x(F,He):void 0}function Ie(e){return"string"==e?M():"("==e?x(I):x(Fe,ze,Be)}function Fe(e,t){return"{"==e?ie(Fe,"}"):("variable"==e&&L(t),"*"==t&&(w.marked="keyword"),M(We))}function ze(e){if(","==e)return M(Fe,ze)}function We(e,t){if("as"==t)return w.marked="keyword",M(Fe)}function Be(e,t){if("from"==t)return w.marked="keyword",M(I)}function Ue(e){return"]"==e?M():x(re(F,"]"))}function Ve(){return x(P("form"),ve,N("{"),P("}"),re(qe,"}"),A,A)}function qe(){return x(ve,we)}function Ze(e,t,n){return t.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return Y.lex=!0,A.lex=!0,{startState:function(e){var t={tokenize:m,lastType:"sof",cc:[],lexical:new _((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new E(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),y(e,t)),t.tokenize!=b&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",function(e,t,n,r,i){var o=e.cc;for(w.state=e,w.stream=i,w.marked=null,w.cc=o,w.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?I:R)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return w.marked?w.marked:"variable"==n&&k(e,r)?"variable-2":t}}(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==b)return e.Pass;if(t.tokenize!=m)return 0;var i,s=r&&r.charAt(0),l=t.lexical;if(!/^\s*else\b/.test(r))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==A)l=l.prev;else if(u!=Me)break}for(;("stat"==l.type||"form"==l.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==U||i==V)&&!/^[,\.=+\-*:?[\(]/.test(r));)l=l.prev;a&&")"==l.type&&"stat"==l.prev.type&&(l=l.prev);var d=l.type,h=s==d;return"vardef"==d?l.indented+("operator"==t.lastType||","==t.lastType?l.info.length+1:0):"form"==d&&"{"==s?l.indented:"form"==d?l.indented+o:"stat"==d?l.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||f.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||o:0):"switch"!=l.info||h||0==n.doubleIndentSwitch?l.align?l.column+(h?0:1):l.indented+(h?0:o):l.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",blockCommentContinue:l?null:" * ",lineComment:l?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l,expressionAllowed:Ze,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=I&&t!=F||e.cc.pop()}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(11))},function(e,t,n){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:function(t){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),a=t.listSelections(),c=0;c=0;c--){var d=a[c].head;t.replaceRange("",n(d.line,d.ch-1),n(d.line,d.ch+1),"+delete")}},Enter:function(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a1&&f.indexOf(i)>=0&&t.getRange(n(v.line,v.ch-2),v)==i+i){if(v.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(v.line,v.ch-2))))return e.Pass;g="addFour"}else if(h){var k=0==v.ch?" ":t.getRange(n(v.line,v.ch-1),v);if(e.isWordChar(_)||k==i||e.isWordChar(k))return e.Pass;g="both"}else{if(!m||!(0===_.length||/\s/.test(_)||d.indexOf(_)>-1))return e.Pass;g="both"}else g=h&&c(t,v)?"both":f.indexOf(i)>=0&&t.getRange(v,n(v.line,v.ch+3))==i+i+i?"skipThree":"skip";if(u){if(u!=g)return e.Pass}else u=g}var w=l%2?a.charAt(l-1):i,x=l%2?i:a.charAt(l+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==u){var i=t.getSelections();for(r=0;r0,{anchor:new n(o.anchor.line,o.anchor.ch+(a?-1:1)),head:new n(o.head.line,o.head.ch+(a?1:-1))});t.setSelections(i)}else"both"==u?(t.replaceSelection(w+x,null),t.triggerElectric(w+x),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(w+w+w+w,"before"),t.execCommand("goCharRight"));var o,a}))}(i,t)}}function s(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function c(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(11))},function(e,t,n){var r=n(13),i=n(372);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(14)(!1)).push([e.i,'body,html{width:100%;height:100%;font-family:"Inter",sans-serif;-webkit-font-smoothing:antialiased}p,h1,h2,h3,h4,h5,h6,a,input,textarea,button{margin-block-end:unset;margin-block-start:unset;-webkit-margin-before:unset;-webkit-margin-after:unset;font-family:Inter,sans-serif}textarea,select,input,button{outline:none}.c-default{cursor:default}.mono{font-family:"Source Code Pro",monospace}.mix-blend-diff{mix-blend-mode:difference}@media all and (prefers-color-scheme: dark){body{background-color:#333}.bg-gray0-d{background-color:#333}.bg-gray1-d{background-color:#4d4d4d}.bg-gray2-d{background-color:#7f7f7f}.b--gray1-d{border-color:#4d4d4d}.white-d{color:#fff}.invert-d{filter:invert(1)}.hover-bg-gray1-d:hover{background-color:#4d4d4d}}',""]),e.exports=t},function(e,t){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},function(e,t,n){var r={"./af":84,"./af.js":84,"./ar":85,"./ar-dz":86,"./ar-dz.js":86,"./ar-kw":87,"./ar-kw.js":87,"./ar-ly":88,"./ar-ly.js":88,"./ar-ma":89,"./ar-ma.js":89,"./ar-sa":90,"./ar-sa.js":90,"./ar-tn":91,"./ar-tn.js":91,"./ar.js":85,"./az":92,"./az.js":92,"./be":93,"./be.js":93,"./bg":94,"./bg.js":94,"./bm":95,"./bm.js":95,"./bn":96,"./bn.js":96,"./bo":97,"./bo.js":97,"./br":98,"./br.js":98,"./bs":99,"./bs.js":99,"./ca":100,"./ca.js":100,"./cs":101,"./cs.js":101,"./cv":102,"./cv.js":102,"./cy":103,"./cy.js":103,"./da":104,"./da.js":104,"./de":105,"./de-at":106,"./de-at.js":106,"./de-ch":107,"./de-ch.js":107,"./de.js":105,"./dv":108,"./dv.js":108,"./el":109,"./el.js":109,"./en-au":110,"./en-au.js":110,"./en-ca":111,"./en-ca.js":111,"./en-gb":112,"./en-gb.js":112,"./en-ie":113,"./en-ie.js":113,"./en-il":114,"./en-il.js":114,"./en-in":115,"./en-in.js":115,"./en-nz":116,"./en-nz.js":116,"./en-sg":117,"./en-sg.js":117,"./eo":118,"./eo.js":118,"./es":119,"./es-do":120,"./es-do.js":120,"./es-us":121,"./es-us.js":121,"./es.js":119,"./et":122,"./et.js":122,"./eu":123,"./eu.js":123,"./fa":124,"./fa.js":124,"./fi":125,"./fi.js":125,"./fil":126,"./fil.js":126,"./fo":127,"./fo.js":127,"./fr":128,"./fr-ca":129,"./fr-ca.js":129,"./fr-ch":130,"./fr-ch.js":130,"./fr.js":128,"./fy":131,"./fy.js":131,"./ga":132,"./ga.js":132,"./gd":133,"./gd.js":133,"./gl":134,"./gl.js":134,"./gom-deva":135,"./gom-deva.js":135,"./gom-latn":136,"./gom-latn.js":136,"./gu":137,"./gu.js":137,"./he":138,"./he.js":138,"./hi":139,"./hi.js":139,"./hr":140,"./hr.js":140,"./hu":141,"./hu.js":141,"./hy-am":142,"./hy-am.js":142,"./id":143,"./id.js":143,"./is":144,"./is.js":144,"./it":145,"./it-ch":146,"./it-ch.js":146,"./it.js":145,"./ja":147,"./ja.js":147,"./jv":148,"./jv.js":148,"./ka":149,"./ka.js":149,"./kk":150,"./kk.js":150,"./km":151,"./km.js":151,"./kn":152,"./kn.js":152,"./ko":153,"./ko.js":153,"./ku":154,"./ku.js":154,"./ky":155,"./ky.js":155,"./lb":156,"./lb.js":156,"./lo":157,"./lo.js":157,"./lt":158,"./lt.js":158,"./lv":159,"./lv.js":159,"./me":160,"./me.js":160,"./mi":161,"./mi.js":161,"./mk":162,"./mk.js":162,"./ml":163,"./ml.js":163,"./mn":164,"./mn.js":164,"./mr":165,"./mr.js":165,"./ms":166,"./ms-my":167,"./ms-my.js":167,"./ms.js":166,"./mt":168,"./mt.js":168,"./my":169,"./my.js":169,"./nb":170,"./nb.js":170,"./ne":171,"./ne.js":171,"./nl":172,"./nl-be":173,"./nl-be.js":173,"./nl.js":172,"./nn":174,"./nn.js":174,"./oc-lnc":175,"./oc-lnc.js":175,"./pa-in":176,"./pa-in.js":176,"./pl":177,"./pl.js":177,"./pt":178,"./pt-br":179,"./pt-br.js":179,"./pt.js":178,"./ro":180,"./ro.js":180,"./ru":181,"./ru.js":181,"./sd":182,"./sd.js":182,"./se":183,"./se.js":183,"./si":184,"./si.js":184,"./sk":185,"./sk.js":185,"./sl":186,"./sl.js":186,"./sq":187,"./sq.js":187,"./sr":188,"./sr-cyrl":189,"./sr-cyrl.js":189,"./sr.js":188,"./ss":190,"./ss.js":190,"./sv":191,"./sv.js":191,"./sw":192,"./sw.js":192,"./ta":193,"./ta.js":193,"./te":194,"./te.js":194,"./tet":195,"./tet.js":195,"./tg":196,"./tg.js":196,"./th":197,"./th.js":197,"./tl-ph":198,"./tl-ph.js":198,"./tlh":199,"./tlh.js":199,"./tr":200,"./tr.js":200,"./tzl":201,"./tzl.js":201,"./tzm":202,"./tzm-latn":203,"./tzm-latn.js":203,"./tzm.js":202,"./ug-cn":204,"./ug-cn.js":204,"./uk":205,"./uk.js":205,"./ur":206,"./ur.js":206,"./uz":207,"./uz-latn":208,"./uz-latn.js":208,"./uz.js":207,"./vi":209,"./vi.js":209,"./x-pseudo":210,"./x-pseudo.js":210,"./yo":211,"./yo.js":211,"./zh-cn":212,"./zh-cn.js":212,"./zh-hk":213,"./zh-hk.js":213,"./zh-mo":214,"./zh-mo.js":214,"./zh-tw":215,"./zh-tw.js":215};function i(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}i.keys=function(){return Object.keys(r)},i.resolve=o,e.exports=i,i.id=374},function(e,t,n){var r=n(13),i=n(376);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(14)(!1)).push([e.i,'*{-webkit-font-smoothing:antialiased;-webkit-touch-callout:none}html,body{height:100%;width:100%;margin:0;padding:0;position:fixed}#root{height:100%;width:100%;margin:0;padding:0}p,h1,h2,h3,h4,h5,h6,a,input,textarea,button{margin-block-end:unset;margin-block-start:unset;-webkit-margin-before:unset;-webkit-margin-after:unset;font-family:Inter,sans-serif;padding:0}textarea,input,button{outline:none;-webkit-appearance:none;border:none;background-color:#fff}a{color:#000;font-weight:400;text-decoration:none}h2{font-weight:400}.inter{font-family:Inter,sans-serif}.clamp-3{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-line-clamp:2;-webkit-box-orient:vertical}.clamp-message{max-width:calc(100% - 36px - 1.5rem)}.clamp-attachment{overflow:auto;max-height:10em;max-width:100%}.lh-16{line-height:16px}.chat-md-message>pre{overflow-x:auto}.mono{font-family:"Source Code Pro",monospace}.bg-welcome-green{background-color:#ecf6f2}.list-ship{line-height:2.2}.c-default{cursor:default}.word-break-all{word-break:break-all}.focus-b--black:focus{border-color:#000}.mix-blend-diff{mix-blend-mode:difference}.placeholder-inter::placeholder{font-family:"Inter",sans-serif}.spin-active{animation:spin 2s infinite}@keyframes spin{0%{transform:rotate(0deg)}25%{transform:rotate(90deg)}50%{transform:rotate(180deg)}75%{transform:rotate(270deg)}100%{transform:rotate(360deg)}}.embed-container{position:relative;height:0;overflow:hidden;padding-bottom:28.125%}.embed-container iframe,.embed-container object,.embed-container embed{position:absolute;top:0;left:0;width:100%;height:100%}.mh-16{max-height:16rem}.toggle::after{content:"";height:12px;width:12px;background:#fff;position:absolute;top:2px;left:2px;border-radius:100%}.toggle.checked::after{content:"";height:12px;width:12px;background:#fff;position:absolute;top:2px;left:14px;border-radius:100%}.shadow-6{box-shadow:2px 4px 20px rgba(0,0,0,.25)}.brt2{border-radius:.25rem .25rem 0 0}.green3{color:#7ea899}.unread-notice{top:48px}@media all and (max-width: 34.375em){.dn-s{display:none}.flex-basis-full-s{flex-basis:100%}.h-100-minus-96-s{height:calc(100% - 96px)}.embed-container{padding-bottom:56.25%}.unread-notice{top:96px}}@media all and (min-width: 34.375em)and (max-width: 46.875em){.flex-basis-250-m{flex-basis:250px}.embed-container{padding-bottom:56.25%}}@media all and (min-width: 46.875em)and (max-width: 60em){.flex-basis-250-l{flex-basis:250px}.embed-container{padding-bottom:37.5%}}@media all and (min-width: 60em){.flex-basis-250-xl{flex-basis:250px}}blockquote{padding-left:24px;padding-top:8px;padding-bottom:8px;margin-left:0;margin-right:0;margin-top:8px;margin-bottom:8px;border-left:1px solid #000}:root{--dark-gray: #555555;--gray: #7F7F7F;--medium-gray: #CCCCCC;--light-gray: rgba(0,0,0,0.08)}.chat .react-codemirror2{width:100%}.chat .CodeMirror{height:100% !important;width:100% !important;cursor:text}.chat .CodeMirror *{font-family:"Inter"}.chat .CodeMirror.cm-s-code.chat .cm-s-tlon *{font-family:"Source Code Pro"}.chat .CodeMirror-selected{background:#bae3fe !important;color:#000}pre.CodeMirror-placeholder.CodeMirror-line-like{color:var(--gray)}.chat .cm-s-tlon span{font-family:"Inter"}.chat .cm-s-tlon span.cm-meta{color:var(--gray)}.chat .cm-s-tlon span.cm-number{color:var(--gray)}.chat .cm-s-tlon span.cm-keyword{line-height:1em;font-weight:bold;color:var(--gray)}.chat .cm-s-tlon span.cm-atom{font-weight:bold;color:var(--gray)}.chat .cm-s-tlon span.cm-def{color:#000}.chat .cm-s-tlon span.cm-variable{color:#000}.chat .cm-s-tlon span.cm-variable-2{color:#000}.chat .cm-s-tlon span.cm-variable-3,.chat .cm-s-tlon span.cm-type{color:#000}.chat .cm-s-tlon span.cm-property{color:#000}.chat .cm-s-tlon span.cm-operator{color:#000}.chat .cm-s-tlon span.cm-comment{font-family:"Source Code Pro";color:#000;background-color:var(--light-gray);display:inline-block;border-radius:2px}.chat .cm-s-tlon span.cm-string{color:var(--dark-gray)}.chat .cm-s-tlon span.cm-string-2{color:var(--gray)}.chat .cm-s-tlon span.cm-qualifier{color:#555}.chat .cm-s-tlon span.cm-error{color:red}.chat .cm-s-tlon span.cm-attribute{color:var(--gray)}.chat .cm-s-tlon span.cm-tag{color:var(--gray)}.chat .cm-s-tlon span.cm-link{color:var(--dark-gray);text-decoration:none}.chat .cm-s-tlon .CodeMirror-activeline-background{background:var(--gray)}.chat .cm-s-tlon .CodeMirror-cursor{border-left:2px solid #3687ff}.chat .cm-s-tlon span.cm-builtin{color:var(--gray)}.chat .cm-s-tlon span.cm-bracket{color:var(--gray)}.chat .cm-s-tlon .CodeMirror-matchingbracket{outline:1px solid gray;color:#000 !important}.chat .CodeMirror-hints.tlon{color:#616569;background-color:#ebf3fd !important}.chat .CodeMirror-hints.tlon .CodeMirror-hint-active{background-color:#a2b8c9 !important;color:#5c6065 !important}.title-input[placeholder]:empty:before{content:attr(placeholder);color:#7f7f7f}@media(prefers-color-scheme: dark){body{background-color:#333}.bg-black-d{background-color:#000}.white-d{color:#fff}.gray1-d{color:#4d4d4d}.gray2-d{color:#7f7f7f}.gray3-d{color:#b1b2b3}.gray4-d{color:#e6e6e6}.bg-gray0-d{background-color:#333}.bg-gray1-d{background-color:#4d4d4d}.b--gray0-d{border-color:#333}.b--gray1-d{border-color:#4d4d4d}.b--gray2-d{border-color:#7f7f7f}.b--white-d{border-color:#fff}.b--green2-d{border-color:#2aa779}.bb-d{border-bottom-width:1px;border-bottom-style:solid}.invert-d{filter:invert(1)}.o-80-d{opacity:.8}.focus-b--white-d:focus{border-color:#fff}a{color:#fff}.hover-bg-gray1-d:hover{background-color:#4d4d4d}blockquote{border-left:1px solid #fff}.contrast-10-d{filter:contrast(0.1)}.bg-none-d{background:none}.chat .cm-s-tlon.CodeMirror{background:#333;color:#fff}.chat .cm-s-tlon span.cm-def{color:#fff}.chat .cm-s-tlon span.cm-variable{color:#fff}.chat .cm-s-tlon span.cm-variable-2{color:#fff}.chat .cm-s-tlon span.cm-variable-3,.chat .cm-s-tlon span.cm-type{color:#fff}.chat .cm-s-tlon span.cm-property{color:#fff}.chat .cm-s-tlon span.cm-operator{color:#fff}.chat .cm-s-tlon span.cm-string{color:var(--gray)}.chat .cm-s-tlon span.cm-string-2{color:var(--gray)}.chat .cm-s-tlon span.cm-attribute{color:var(--gray)}.chat .cm-s-tlon span.cm-tag{color:var(--gray)}.chat .cm-s-tlon span.cm-link{color:var(--gray)}.chat .CodeMirror-selected{background:var(--medium-gray) !important;color:#fff}.chat .cm-s-tlon span.cm-comment{color:#000;display:inline-block;padding:0;background-color:rgba(255,255,255,.3);border-radius:2px}}',""]),e.exports=t},function(e,t,n){(function(t){const r=n(54),i=n(382),o=n(383),a=n(217),s=new r(0),l=new r(1),c=new r(2),u=new r(3),d=new r(4),f=new r(5),h="\nzodnecbudwessevpersutletfulpensytdurwepserwylsunrypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnexlunmeplutseppesdelsulpedtemledtulmetwenbynhexfebpyldulhetmevruttylwydtepbesdexsefwycburderneppurrysrebdennutsubpetrulsynregtydsupsemwynrecmegnetsecmulnymtevwebsummutnyxrextebfushepbenmuswyxsymselrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpelsyptermebsetdutdegtexsurfeltudnuxruxrenwytnubmedlytdusnebrumtynseglyxpunresredfunrevrefmectedrusbexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermertenlusnussyltecmexpubrymtucfyllepdebbermughuttunbylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmylwedducfurfexnulluclennerlexrupnedlecrydlydfenwelnydhusrelrudneshesfetdesretdunlernyrsebhulrylludremlysfynwerrycsugnysnyllyndyndemluxfedsedbecmunlyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes",p=e=>e.replace(/[\^~-]/g,"").match(/.{1,3}/g)||[],m="\ndozmarbinwansamlitsighidfidlissogdirwacsabwissibrigsoldopmodfoglidhopdardorlorhodfolrintogsilmirholpaslacrovlivdalsatlibtabhanticpidtorbolfosdotlosdilforpilramtirwintadbicdifrocwidbisdasmidloprilnardapmolsanlocnovsitnidtipsicropwitnatpanminritpodmottamtolsavposnapnopsomfinfonbanmorworsipronnorbotwicsocwatdolmagpicdavbidbaltimtasmalligsivtagpadsaldivdactansidfabtarmonranniswolmispallasdismaprabtobrollatlonnodnavfignomnibpagsopralbilhaddocridmocpacravripfaltodtiltinhapmicfanpattaclabmogsimsonpinlomrictapfirhasbosbatpochactidhavsaplindibhosdabbitbarracparloddosbortochilmactomdigfilfasmithobharmighinradmashalraglagfadtopmophabnilnosmilfopfamdatnoldinhatnacrisfotribhocnimlarfitwalrapsarnalmoslandondanladdovrivbacpollaptalpitnambonrostonfodponsovnocsorlavmatmipfip".match(/.{1,3}/g),b=h.match(/.{1,3}/g),g=e=>c.pow(e),y=(e,t,n)=>n.div(g(g(e).mul(t))),v=(e,t,n=s)=>t.eq(s)?n:v(e,y(e,l,t),n.add(l)),_=(e,t,n)=>n.mod(g(g(e).mul(t))),k=e=>{if(!1===T(e))throw new Error("patp2hex: not a valid @p");const t=p(e),n=e=>e.toString(2).padStart(8,"0"),i=t.reduce((e,r,i)=>i%2!=0||1===t.length?e+n(b.indexOf(r)):e+n(m.indexOf(r)),""),o=new r(i,2),s=a.fynd(o).toString("hex");return s.length%2!=0?s.padStart(s.length+1,"0"):s},w=e=>new r(k(e),"hex"),x=e=>{let t;try{t=w(e)}catch(e){throw new Error("patp2dec: not a valid @p")}return t.toString()},M=e=>{const n=new r(e).toArrayLike(t);return S(n)},S=e=>{const t=e.length%2!=0&&e.length>1?[[e[0]]].concat(i(e.slice(1),2)):i(e,2),n=e=>{return e.length%2!=0&&t.length>1?void 0===(n=e)[1]?m[0]+b[n[0]]:m[n[0]]+b[n[1]]:(e=>void 0===e[1]?b[e[0]]:m[e[0]]+b[e[1]])(e);var n};return t.reduce((e,t)=>e+("~"===e?"":"-")+n(t),"~")},L=e=>{if(!1===T(e))throw new Error("patq2hex: not a valid @q");const t=e.slice(1).split("-"),n=e=>e.toString(16).padStart(2,"0"),r=t.map(e=>{let t=(r=3,[(i=e).slice(0,r),i.slice(r)]);var r,i;return""===t[1]?n(b.indexOf(t[0])):n(m.indexOf(t[0]))+n(b.indexOf(t[1]))});return 0===e.length?"00":r.join("")},C=e=>{let t;try{t=(e=>new r(L(e),"hex"))(e)}catch(e){throw new Error("patq2dec: not a valid @q")}return t.toString()},E=e=>{let t;try{t=w(e)}catch(e){throw new Error("clan: not a valid @p")}const n=v(u,t);return n.lte(l)?"galaxy":n.eq(c)?"star":n.lte(d)?"planet":n.lte(new r(8))?"moon":"comet"},T=e=>{if("string"!=typeof e)throw new Error("isValidPat: non-string input");if(!1===("~"===e.slice(0,1))||e.length<4)return!1;{const t=p(e),n=t.length%2!=0&&1!==t.length,r=t.reduce((e,n,r)=>e&&(r%2!=0||1===t.length?b.includes(n):m.includes(n)),!0);return!n&&r}},O=e=>"00"===e.slice(0,2)?O(e.slice(2)):e,D=(e,t)=>{let n,r;try{n=L(e)}catch(e){throw new Error("eqPatq: not a valid @q")}try{r=L(t)}catch(e){throw new Error("eqPatq: not a valid @q")}return i=r,o(O(n),O(i));var i},j=e=>{const t=new r(e),n=a.fein(t),i=v(d,n),o=(e,t,n)=>{const r=_(d,l,e),a=m[y(u,l,r)]+b[_(u,l,r)]+(t.mod(d).eq(s)?t.eq(s)?"":"--":"-")+n;return t.eq(i)?n:o(y(d,l,e),t.add(l),a)};return"~"+(v(u,n).lte(l)?b[n]:o(n,s,""))};e.exports={patp:j,patp2hex:k,hex2patp:e=>j(new r(e,"hex")),patp2dec:x,sein:e=>{let t,n;try{t=w(e)}catch(e){throw new Error("sein: not a valid @p")}try{n=E(e)}catch(e){throw new Error("sein: not a valid @p")}const r="galaxy"===n?t:"star"===n?_(u,l,t):"planet"===n?_(d,l,t):"moon"===n?_(f,l,t):s;return j(r)},clan:E,patq:M,patq2hex:L,hex2patq:e=>{const n=e.length%2!=0?e.padStart(e.length+1,"0"):e,r=t.from(n,"hex");return S(r)},patq2dec:C,eqPatq:D,isValidPat:T,isValidPatp:e=>T(e)&&e===j(x(e)),isValidPatq:e=>T(e)&&D(e,M(C(e)))}}).call(this,n(216).Buffer)},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],l=new o(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),u=0,d=s>0?a-4:a;for(n=0;n>16&255,l[u++]=t>>8&255,l[u++]=255&t;2===s&&(t=i[e.charCodeAt(n)]<<2|i[e.charCodeAt(n+1)]>>4,l[u++]=255&t);1===s&&(t=i[e.charCodeAt(n)]<<10|i[e.charCodeAt(n+1)]<<4|i[e.charCodeAt(n+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var i,o,a=[],s=t;s>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,l=(1<>1,u=-7,d=n?i-1:0,f=n?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=256*o+e[t+d],d+=f,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+d],d+=f,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,r),o-=c}return(h?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,c=8*o-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:o-1,p=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?f/l:f*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[n+h]=255&s,h+=p,s/=256,i-=8);for(a=a<0;e[n+h]=255&a,h+=p,a/=256,c-=8);e[n+h-p]|=128*m}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=/^(?:0|[1-9]\d*)$/,s=parseInt,l=Object.prototype.toString,c=Math.ceil,u=Math.max;function d(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r-1&&e%1==0&&e<=9007199254740991}(e.length)&&!function(e){var t=h(e)?l.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)}(n)&&function(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||a.test(e))&&e>-1&&e%1==0&&es))return!1;var c=o.get(e);if(c&&o.get(t))return c==t;var u=-1,d=!0,f=2&n?new oe:void 0;for(o.set(e,t),o.set(t,e);++u-1},re.prototype.set=function(e,t){var n=this.__data__,r=le(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},ie.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(U||re),string:new ne}},ie.prototype.delete=function(e){var t=be(this,e).delete(e);return this.size-=t?1:0,t},ie.prototype.get=function(e){return be(this,e).get(e)},ie.prototype.has=function(e){return be(this,e).has(e)},ie.prototype.set=function(e,t){var n=be(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},oe.prototype.add=oe.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},oe.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.clear=function(){this.__data__=new re,this.size=0},ae.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ae.prototype.get=function(e){return this.__data__.get(e)},ae.prototype.has=function(e){return this.__data__.has(e)},ae.prototype.set=function(e,t){var n=this.__data__;if(n instanceof re){var r=n.__data__;if(!U||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ie(r)}return n.set(e,t),this.size=n.size,this};var ye=F?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}function Ee(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Te(e){return null!=e&&"object"==typeof e}var Oe=y?function(e){return function(t){return e(t)}}(y):function(e){return Te(e)&&Ce(e.length)&&!!c[ce(e)]};function De(e){return null!=(t=e)&&Ce(t.length)&&!Le(t)?se(e):he(e);var t}n.exports=function(e,t){return de(e,t)}}).call(this,n(19),n(31)(e))},function(e,t,n){const r=n(54),i=new r(255),o=new r(65280),a=new r(256),s=(e,t)=>{let n,r,i,o,a,s,l,c;for(n=3&e.length,r=e.length-n,i=t,a=3432918353,s=461845907,c=0;c>>16)*a&65535)<<16)&4294967295,l=l<<15|l>>>17,l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295,i^=l,i=i<<13|i>>>19,o=5*(65535&i)+((5*(i>>>16)&65535)<<16)&4294967295,i=27492+(65535&o)+((58964+(o>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:l^=255&e.charCodeAt(c),l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295,l=l<<15|l>>>17,l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295,i^=l}return i^=e.length,i^=i>>>16,i=2246822507*(65535&i)+((2246822507*(i>>>16)&65535)<<16)&4294967295,i^=i>>>13,i=3266489909*(65535&i)+((3266489909*(i>>>16)&65535)<<16)&4294967295,i^=i>>>16,i>>>0};e.exports={muk:(e,t,n)=>{const l=n.and(i).toNumber(),c=n.and(o).div(a).toNumber(),u=String.fromCharCode(l)+String.fromCharCode(c);return new r(s(u,e))}}},function(e,t,n){(function(t){var n=function(){"use strict";function e(e,t){return null!=t&&e instanceof t}var n,r,i;try{n=Map}catch(e){n=function(){}}try{r=Set}catch(e){r=function(){}}try{i=Promise}catch(e){i=function(){}}function o(a,l,c,u,d){"object"==typeof l&&(c=l.depth,u=l.prototype,d=l.includeNonEnumerable,l=l.circular);var f=[],h=[],p=void 0!==t;return void 0===l&&(l=!0),void 0===c&&(c=1/0),function a(c,m){if(null===c)return null;if(0===m)return c;var b,g;if("object"!=typeof c)return c;if(e(c,n))b=new n;else if(e(c,r))b=new r;else if(e(c,i))b=new i((function(e,t){c.then((function(t){e(a(t,m-1))}),(function(e){t(a(e,m-1))}))}));else if(o.__isArray(c))b=[];else if(o.__isRegExp(c))b=new RegExp(c.source,s(c)),c.lastIndex&&(b.lastIndex=c.lastIndex);else if(o.__isDate(c))b=new Date(c.getTime());else{if(p&&t.isBuffer(c))return b=t.allocUnsafe?t.allocUnsafe(c.length):new t(c.length),c.copy(b),b;e(c,Error)?b=Object.create(c):void 0===u?(g=Object.getPrototypeOf(c),b=Object.create(g)):(b=Object.create(u),g=u)}if(l){var y=f.indexOf(c);if(-1!=y)return h[y];f.push(c),h.push(b)}for(var v in e(c,n)&&c.forEach((function(e,t){var n=a(t,m-1),r=a(e,m-1);b.set(n,r)})),e(c,r)&&c.forEach((function(e){var t=a(e,m-1);b.add(t)})),c){var _;g&&(_=Object.getOwnPropertyDescriptor(g,v)),_&&null==_.set||(b[v]=a(c[v],m-1))}if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(c);for(v=0;vspan::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:none}',""]),e.exports=t},function(e,t,n){var r=n(13),i=n(390);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(14)(!1)).push([e.i,"input#dojo{background-color:inherit;color:inherit}@media all and (max-width: 34.375em){.h-100-m40-s{height:calc(100% - 40px)}}",""]),e.exports=t},function(e,t,n){var r=n(13),i=n(392);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(14)(!1)).push([e.i,".c-default{cursor:default}.m0a{margin:0 auto}@media all and (max-width: 34.375em){.dn-s{display:none}.flex-basis-100-s{flex-basis:100%}}@media all and (min-width: 34.375em){.db-ns{display:block}.flex-basis-30-ns{flex-basis:30vw}}@media all and (prefers-color-scheme: dark){.o-60-d{opacity:.6}}",""]),e.exports=t},function(e,t,n){var r=n(13),i=n(394);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(14)(!1)).push([e.i,".links.embed-container{position:relative;height:0;overflow:hidden;padding-bottom:56.25%}.links.embed-container iframe,.links.embed-container object,.links.embed-container embed{position:absolute;top:0;left:0;width:100%;height:100%}@media all and (max-width: 34.375em){.dn-s{display:none}.flex-basis-100-s,.flex-basis-full-s{flex-basis:100%}}@media all and (min-width: 34.375em){.db-ns{display:block}.flex-basis-30-ns{flex-basis:30vw}}",""]),e.exports=t},function(e,t,n){var r=n(13),i=n(396);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[e.i,i,""]]);var o={insert:"head",singleton:!1};r(i,o);e.exports=i.locals||{}},function(e,t,n){(t=n(14)(!1)).push([e.i,':root{--dark-gray: #555555;--gray: #7F7F7F;--medium-gray: #CCCCCC;--light-gray: rgba(0,0,0,0.08)}.bg-welcome-green{background-color:#ecf6f2}@media all and (max-width: 34.375em){.dn-s{display:none}.flex-basis-100-s,.flex-basis-full-s{flex-basis:100%}.h-100-m-40-s{height:calc(100% - 40px)}.black-s{color:#000}}@media all and (min-width: 34.375em){.db-ns{display:block}.flex-basis-250-ns{flex-basis:250px}.h-100-m-40-ns{height:calc(100% - 40px)}}.bg-light-green{background:rgba(42,167,121,.1)}.NotebookButton{border-radius:2px;cursor:pointer}.NewPost{width:100%;height:calc(100vh - 184px);display:flex;padding-top:8px}.EditPost{width:100%;height:calc(100vh - 120px);display:flex;padding-top:8px}.placeholder-inter::placeholder{font-family:"Inter",sans-serif}.publish .react-codemirror2{width:100%}.publish .CodeMirror{padding:12px;height:100% !important;max-width:700px;width:100% !important;cursor:text;font-size:12px;line-height:20px}.publish .CodeMirror *{font-family:"Source Code Pro"}.publish .CodeMirror-selected{background:#bae3fe !important;color:#000}.publish .cm-s-tlon span{font-family:"Source Code Pro"}.publish .cm-s-tlon span.cm-meta{color:var(--gray)}.publish .cm-s-tlon span.cm-number{color:var(--gray)}.publish .cm-s-tlon span.cm-keyword{line-height:1em;font-weight:bold;color:var(--gray)}.publish .cm-s-tlon span.cm-atom{font-weight:bold;color:var(--gray)}.publish .cm-s-tlon span.cm-def{color:#000}.publish .cm-s-tlon span.cm-variable{color:#000}.publish .cm-s-tlon span.cm-variable-2{color:#000}.publish .cm-s-tlon span.cm-variable-3,.publish .cm-s-tlon span.cm-type{color:#000}.publish .cm-s-tlon span.cm-property{color:#000}.publish .cm-s-tlon span.cm-operator{color:#000}.publish .cm-s-tlon span.cm-comment{color:#000;background-color:var(--light-gray);display:inline-block;border-radius:2px}.publish .cm-s-tlon span.cm-string{color:var(--dark-gray)}.publish .cm-s-tlon span.cm-string-2{color:var(--gray)}.publish .cm-s-tlon span.cm-qualifier{color:#555}.publish .cm-s-tlon span.cm-error{color:red}.publish .cm-s-tlon span.cm-attribute{color:var(--gray)}.publish .cm-s-tlon span.cm-tag{color:var(--gray)}.publish .cm-s-tlon span.cm-link{color:var(--dark-gray);text-decoration:none}.publish .cm-s-tlon .CodeMirror-activeline-background{background:var(--gray)}.publish .cm-s-tlon .CodeMirror-cursor{border-left:2px solid #3687ff}.publish .cm-s-tlon span.cm-builtin{color:var(--gray)}.publish .cm-s-tlon span.cm-bracket{color:var(--gray)}.publish .cm-s-tlon .CodeMirror-matchingbracket{outline:1px solid gray;color:#000 !important}.publish .CodeMirror-hints.tlon{color:#616569;background-color:#ebf3fd !important}.publish .CodeMirror-hints.tlon .CodeMirror-hint-active{background-color:#a2b8c9 !important;color:#5c6065 !important}.title-input[placeholder]:empty:before{content:attr(placeholder);color:#7f7f7f}.options.open{background-color:#e6e6e6}.options.closed{background-color:#fff}.options::after{content:"⌃";transform:rotate(180deg);position:absolute;right:8px;top:4px;color:#7f7f7f}[contenteditable]:focus{outline:0px solid transparent}.dropdown::after{content:"⌃";transform:rotate(180deg);position:absolute;right:8px;top:16px;color:#7f7f7f}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar::-webkit-scrollbar{display:none}.md h1,.md h2,.md h3,.md h4,.md h5,.md p,.md a,.md ul,.md ol,.md blockquote,.md code,.md pre{font-size:14px;margin-bottom:16px}.md h2,.md h3,.md h4,.md h5,.md p,.md a,.md ul{font-weight:400}.md h1{font-weight:600}.md h2,.md h3,.md h4,.md h5{color:var(--gray)}.md p{line-height:1.5}.md code,.md pre{font-family:"Source Code Pro",mono}.md ul>li,.md ol>li{line-height:1.5}.md a{border-bottom-style:solid;border-bottom-width:1px}md img{margin-bottom:8px}@media all and (prefers-color-scheme: dark){body{background-color:#333}.bg-black-d{background-color:#000}.white-d{color:#fff}.gray1-d{color:#4d4d4d}.gray2-d{color:#7f7f7f}.gray3-d{color:#b1b2b3}.gray4-d{color:#e6e6e6}.bg-gray0-d{background-color:#333}.bg-gray1-d{background-color:#4d4d4d}.b--gray0-d{border-color:#333}.b--gray1-d{border-color:#4d4d4d}.b--gray2-d{border-color:#7f7f7f}.b--white-d{border-color:#fff}.invert-d{filter:invert(1)}.o-60-d{opacity:.6}a{color:#fff}.focus-b--white-d:focus{border-color:#fff}.hover-bg-gray1-d:hover{background-color:#4d4d4d}.options.open{background-color:#4d4d4d}.options.closed{background-color:#333}.publish .cm-s-tlon.CodeMirror{background:#333;color:#fff}.publish .cm-s-tlon span.cm-def{color:#fff}.publish .cm-s-tlon span.cm-variable{color:#fff}.publish .cm-s-tlon span.cm-variable-2{color:#fff}.publish .cm-s-tlon span.cm-variable-3,.publish .cm-s-tlon span.cm-type{color:#fff}.publish .cm-s-tlon span.cm-property{color:#fff}.publish .cm-s-tlon span.cm-operator{color:#fff}.publish .cm-s-tlon span.cm-string{color:var(--gray)}.publish .cm-s-tlon span.cm-string-2{color:var(--gray)}.publish .cm-s-tlon span.cm-attribute{color:var(--gray)}.publish .cm-s-tlon span.cm-tag{color:var(--gray)}.publish .cm-s-tlon span.cm-link{color:var(--gray)}.publish .CodeMirror-selected{background:var(--medium-gray) !important;color:#fff}.publish .cm-s-tlon span.cm-comment{color:#000;display:inline-block;padding:0;background-color:rgba(255,255,255,.3);border-radius:2px}}',""]),e.exports=t},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),o=n(32);function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var s=n(17),l=n.n(s);function c(){return(c=Object.assign||function(e){for(var t=1;t=0;f--){var h=i[f];"."===h?d(i,f):".."===h?(d(i,f),c++):c&&(d(i,f),c--)}if(!s)for(;c--;c)i.unshift("..");!s||""===i[0]||i[0]&&u(i[0])||i.unshift("");var p=i.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};var h=function(e,t){if(!e)throw new Error("Invariant failed")};function p(e){return"/"===e.charAt(0)?e:"/"+e}function m(e){return"/"===e.charAt(0)?e.substr(1):e}function b(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function g(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function y(e){var t=e.pathname,n=e.search,r=e.hash,i=t||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function v(e,t,n,r){var i;"string"==typeof e?(i=function(e){var t=e||"/",n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substr(i),t=t.substr(0,i));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(i=c({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),r?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=f(i.pathname,r.pathname)):i.pathname=r.pathname:i.pathname||(i.pathname="/"),i}function _(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,i){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),d({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=v(e,t,f(),g.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(g.entries[g.index]=r,d({action:"REPLACE",location:r}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=g.index+e;return t>=0&&t=0||(i[n]=e[n]);return i}var z=n(18),W=n.n(z),B=function(e){var t=R();return t.displayName=e,t}("Router"),U=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}a(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return i.a.createElement(B.Provider,{children:this.props.children||null,value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}})},t}(i.a.Component);i.a.Component;i.a.Component;var V={},q=0;function Z(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,i=n.exact,o=void 0!==i&&i,a=n.strict,s=void 0!==a&&a,l=n.sensitive,c=void 0!==l&&l;return[].concat(r).reduce((function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=V[n]||(V[n]={});if(r[e])return r[e];var i=[],o={regexp:I()(e,i,t),keys:i};return q<1e4&&(r[e]=o,q++),o}(n,{end:o,strict:s,sensitive:c}),i=r.regexp,a=r.keys,l=i.exec(e);if(!l)return null;var u=l[0],d=l.slice(1),f=e===u;return o&&!f?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:f,params:a.reduce((function(e,t,n){return e[t.name]=d[n],e}),{})}}),null)}var G=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(B.Consumer,null,(function(t){t||h(!1);var n=e.props.location||t.location,r=c({},t,{location:n,match:e.props.computedMatch?e.props.computedMatch:e.props.path?Z(n.pathname,e.props):t.match}),o=e.props,a=o.children,s=o.component,l=o.render;return Array.isArray(a)&&0===a.length&&(a=null),i.a.createElement(B.Provider,{value:r},r.match?a?"function"==typeof a?a(r):a:s?i.a.createElement(s,r):l?l(r):null:"function"==typeof a?a(r):null)}))},t}(i.a.Component);function $(e){return"/"===e.charAt(0)?e:"/"+e}function J(e,t){if(!e)return t;var n=$(e);return 0!==t.pathname.indexOf(n)?t:c({},t,{pathname:t.pathname.substr(n.length)})}function K(e){return"string"==typeof e?e:y(e)}function X(e){return function(){h(!1)}}function Q(){}i.a.Component;var ee=function(e){function t(){return e.apply(this,arguments)||this}return a(t,e),t.prototype.render=function(){var e=this;return i.a.createElement(B.Consumer,null,(function(t){t||h(!1);var n,r,o=e.props.location||t.location;return i.a.Children.forEach(e.props.children,(function(e){if(null==r&&i.a.isValidElement(e)){n=e;var a=e.props.path||e.props.from;r=a?Z(o.pathname,c({},e.props,{path:a})):t.match}})),r?i.a.cloneElement(n,{location:o,computedMatch:r}):null}))},t}(i.a.Component);var te=i.a.useContext;function ne(){return te(B).location}var re=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n=10?e:"0"+e};return"~".concat(e.getUTCFullYear(),".")+"".concat(e.getUTCMonth()+1,".")+"".concat(n(e.getUTCDate()),"..")+"".concat(n(e.getUTCHours()),".")+"".concat(n(e.getUTCMinutes()),".")+"".concat(n(e.getUTCSeconds()))+"".concat(t?"..0000":"")}function _e(e){return e.replace("~","")}function ke(e){return e.length>2&&"0x"===e.substr(0,2)?e.substr(2).replace(".","").padStart(6,"0"):e.replace(".","").padStart(6,"0")}function we(e){var t="0123456789ABCDEF".split("");return e.reverse().reduce((function(n,r,i){var o=t.findIndex((function(e){return e===r.toUpperCase()}));if(o<0)throw console.error(e),new Error("Incorrect hex formatting");return n+o*Math.pow(16,i)}),0)}function xe(e){return new Promise((function(t,n){var r=document.createRange();r.selectNodeContents(document.body),document.getSelection().addRange(r);var i=!1;function o(t){t.clipboardData.setData("text/plain",e),t.preventDefault(),i=!0}document.addEventListener("copy",o),document.execCommand("copy"),document.removeEventListener("copy",o),document.getSelection().removeAllRanges(),i?t():n()})).catch((function(e){console.error(e)}))}function Me(e){var t=e;return t.startsWith("~")&&(t=t.substr(1)),56===t.length?"~"+t.slice(0,6)+"_"+t.slice(50,56):27===t.length?"~"+t.slice(14,20)+"^"+t.slice(21,27):"~".concat(t)}function Se(e){var t={};return Object.keys(e).sort((function(t,n){var r=t.substr(1),i=n.substr(1);return e[t].metadata&&e[t].metadata.title&&(r=""!==e[t].metadata.title?e[t].metadata.title:t.substr(1)),e[n].metadata&&e[n].metadata.title&&(i=""!==e[n].metadata.title?e[n].metadata.title:n.substr(1)),r.toLowerCase().localeCompare(i.toLowerCase())})).map((function(n){t[n]=e[n]})),t}function Le(e){return window.btoa(e).split("+").join("-").split("/").join("_")}function Ce(e){for(var t="",n=0;n=97&&o<=122||o>=48&&o<=57||"-"===r?r:"~"+o.toString(16)+"."}t+=i}return"~."+t}function Ee(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,a="/~link"+(t?"/popout":"")+e;return r?(a="".concat(a,"/").concat(n,"/").concat(i,"/").concat(Le(r)),0!==o&&(a=a+"/"+o)):0!==n&&(a=a+"/"+n),a}function Te(e){if(!e)return!1;var t=/(\/~)?\/~([a-z-]{3,})\/.*/.exec(e)[2];return window.ship===t}function Oe(e){var t=!e;return{nickname:(e=e||{nickname:"",avatar:null,color:"0x0"}).nickname||"",color:ke(e.color||"0x0"),member:t,avatar:e.avatar||null}}function De(e){for(var t="",n=0;n=97&&r<=122||r>=48&&r<=57?e[n]:r>=65&&r<=90?String.fromCharCode(r+32):"-"}return""===(t=(t=t.replace(/^[\-\d]+|\-+/g,"-")).replace(/^\-+|\-+$/g,""))?ve(new Date):t}function je(e){return function(e){if(Array.isArray(e))return Ye(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ye(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ye(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ye(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:this.ship,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;this.bindPaths=me.a.uniq([].concat(je(this.bindPaths),[e])),window.subscriptionId=this.channel.subscribe(n,r,e,(function(e){o(e)}),(function(t){i({data:t,from:{ship:n,path:e}})}),(function(e){a(e)}))}},{key:"action",value:function(e,t,n){var r=this;return new Promise((function(i,o){r.channel.poke(window.ship,e,t,n,(function(e){i(e)}),(function(e){o(e)}))}))}}])&&Pe(t.prototype,n),r&&Pe(t,r),e}();function Ne(e){return(Ne="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)}function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function He(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{basic:{title:"",linkedUrl:"",iconUrl:""}};this.launchAction({add:{name:e,tile:t}})}},{key:"launchRemove",value:function(e){this.launchAction({remove:e})}},{key:"launchChangeOrder",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.launchAction({"change-order":e})}},{key:"launchChangeFirstTime",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.launchAction({"change-first-time":e})}},{key:"launchChangeIsShown",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.launchAction({"change-is-shown":{name:e,isShown:t}})}},{key:"weatherAction",value:function(e){this.action("weather","json",e)}}])&&He(t.prototype,n),r&&He(t,r),o}(Ae),Ue=function e(t,n,r){Re(this,e);var i=new Be(t,n,r);this.ship=t,this.subscribe=i.subscribe.bind(i),this.launch={add:i.launchAdd.bind(i),remove:i.launchRemove.bind(i),changeOrder:i.launchChangeOrder.bind(i),changeFirstTime:i.launchChangeFirstTime.bind(i),changeIsShown:i.launchChangeIsShown.bind(i)},this.weather=i.weatherAction.bind(i)};function Ve(e,t){for(var n=0;non(t.sunriseEnd,t.nightEnd)&&an(this.angle)1&&void 0!==arguments[1]?arguments[1]:{gradient1:"white",gradient2:"white",text:"black"};return i.a.createElement(kt,null,i.a.createElement("div",{className:"relative "+t.text,style:{width:126,height:126,background:"linear-gradient(135deg, ".concat(t.gradient1," 0%,")+"".concat(t.gradient2," 45%, ").concat(t.gradient2," 65%,")+"".concat(t.gradient1," 100%)")}},e))}},{key:"renderManualEntry",value:function(){var e,t,n=this;return!0===this.state.error&&(t=i.a.createElement("p",{className:"f9 red2 pt1"},"Please try again.")),"https:"===location.protocol&&(e=i.a.createElement("a",{className:"black white-d f9 absolute pointer",style:{right:8,top:8},onClick:function(){return n.locationSubmit()}},"Detect ->")),this.renderWrapper(i.a.createElement("div",{className:"pa2 w-100 h-100 bg-white bg-gray0-d black white-d b--black b--gray1-d ba"},i.a.createElement("a",{className:"f9 black white-d pointer absolute",style:{top:8},onClick:function(){return n.setState({manualEntry:!n.state.manualEntry})}},"<-"),e,i.a.createElement("p",{className:"f9 pt5"},"Please enter your"," ",i.a.createElement("a",{className:"black bb white-d",href:"https://latitudeandlongitude.org/",target:"_blank"},"latitude and longitude"),"."),t,i.a.createElement("div",{className:"absolute",style:{left:8,bottom:8}},i.a.createElement("form",{className:"flex",style:{marginBlockEnd:0}},i.a.createElement("input",{id:"gps",className:"w-100 black white-d bg-transparent bn f9",type:"text",placeholder:"29.558107, -95.089023",onKeyDown:function(e){"Enter"===e.key&&(e.preventDefault(),n.manualLocationSubmit(e.target.value))}}),i.a.createElement("input",{className:"bg-transparent black white-d bn pointer f9 flex-shrink-0 pr1",type:"submit",onClick:function(){return n.manualLocationSubmit()},value:"->"})))))}},{key:"renderNoData",value:function(){var e=this;return this.renderWrapper(i.a.createElement("div",{className:"pa2 w-100 h-100 b--black b--gray1-d ba bg-white bg-gray0-d black white-d",onClick:function(){return e.setState({manualEntry:!e.state.manualEntry})}},i.a.createElement("p",{className:"f9 absolute",style:{left:8,top:8}},"Weather"),i.a.createElement("p",{className:"absolute w-100 flex-col f9",style:{bottom:8,left:8,cursor:"pointer"}},"-> Set location")))}},{key:"renderWithData",value:function(e,t){var n=this,r=e.currently,o=e.daily.data[0],a=It.a.unix(o.sunsetTime).format("h:mm a")||"";return this.renderWrapper(i.a.createElement("div",{className:"w-100 h-100 b--black b--gray1-d ba",style:{backdropFilter:"blur(80px)"}},i.a.createElement("p",{className:"f9 absolute",style:{left:8,top:8}},"Weather"),i.a.createElement("a",{className:"f9 absolute pointer",style:{right:8,top:8},onClick:function(){return n.setState({manualEntry:!n.state.manualEntry})}},"->"),i.a.createElement("div",{className:"w-100 absolute",style:{left:8,bottom:8}},i.a.createElement("p",{className:"f9"},r.summary),i.a.createElement("p",{className:"f9 pt1"},Math.round(r.temperature),"°"),i.a.createElement("p",{className:"f9 pt1"},"Sunset at ",a))),t)}},{key:"render",value:function(){var e=this.props.weather?this.props.weather:{};if(!0===this.state.manualEntry)return this.renderManualEntry();if("currently"in e&&"daily"in e){var t=this.setColors(e);return this.renderWithData(e,t)}return this.props.location?this.renderWrapper(i.a.createElement("div",{className:"pa2 w-100 h-100 b--black b--gray1-d ba bg-white bg-gray0-d black white-d"},i.a.createElement("p",{className:"f9 absolute",style:{left:8,top:8}},"Weather"),i.a.createElement("p",{className:"absolute w-100 flex-col f9",style:{bottom:8,left:8}},"Loading, please check again later..."))):this.renderNoData()}}])&&bn(t.prototype,n),r&&bn(t,r),a}(i.a.Component);function wn(e){return(wn="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)}function xn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mn(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r={groupify:{"app-path":e,existing:null}};return t&&(r.groupify.existing={"group-path":t,inclusive:n}),this.chatViewAction(r)}},{key:"inviteAction",value:function(e){this.action("invite-store","json",e)}},{key:"inviteAccept",value:function(e){this.inviteAction({accept:{path:"/chat",uid:e}})}},{key:"inviteDecline",value:function(e){this.inviteAction({decline:{path:"/chat",uid:e}})}},{key:"metadataAction",value:function(e){return this.action("metadata-hook","metadata-action",e)}},{key:"metadataAdd",value:function(e,t,n,r,i,o){var a="~".concat(window.ship);return this.metadataAction({add:{"group-path":t,resource:{"app-path":e,"app-name":"chat"},metadata:{title:n,description:r,color:o,"date-created":i,creator:a}}})}},{key:"sidebarToggle",value:function(){var e=!0;!0===this.store.state.sidebarShown&&(e=!1),this.store.handleEvent({data:{local:{sidebarToggle:e}}})}}])&&qn(t.prototype,n),r&&qn(t,r),o}(Ae);function er(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function rr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n14?i.a.createElement("div",{className:"bg-black dib "+t,style:{width:e.size,height:e.size}}):i.a.createElement("div",{className:"dib "+t,style:{flexBasis:e.size,backgroundColor:e.color}},Object(xi.sigil)({patp:e.ship,renderer:xi.reactRenderer,size:e.size,colors:[e.color,n],class:e.svgClass}))}}])&&Li(t.prototype,n),r&&Li(t,r),a}(r.Component);function ji(e){return(ji="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)}function Yi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pi(e){for(var t=1;t0&&this.setState({suggestions:[]}),void this.unbindShortcuts();null===t.searchTerm&&t.searchTerm!==e.searchTerm&&t.searchTerm.startsWith(e.searchTerm)?this.updateSuggestions():e.searchTerm!==t.searchTerm&&this.updateSuggestions(!0)}},{key:"updateSuggestions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.props.searchTerm,n=function(e){return(e=e.toLowerCase()).startsWith(t)||me.a.some(me.a.words(e),(function(e){return e.startsWith(t)}))},r=this.state.suggestions;if(e||0===this.state.suggestions.length){var i=me.a.chain(this.props.contacts).defaultTo({}).map((function(e,t){return Pi(Pi({},e),{},{ship:t})})).filter((function(e){var t=e.nickname,r=e.ship;return n(t)||n(r)})).map("ship").value(),o=_i.a.isValidPatp("~".concat(t))?[t]:[];r=me.a.chain(this.props.candidates).defaultTo([]).union(i).union(o).value()}var a=me.a.chain(r).filter(n).filter((function(e){return e.length<28})).value();this.bindShortcuts(),this.setState({suggestions:a,selected:a[0]})}},{key:"bindCmShortcuts",value:function(){this.props.cm&&this.props.cm.addKeyMap(this.keymap)}},{key:"unbindCmShortcuts",value:function(){this.props.cm&&this.props.cm.removeKeyMap(this.keymap)}},{key:"bindShortcuts",value:function(){var e=this;if(!this.state.bound){if(!this.props.inputRef)return this.bindCmShortcuts();this.setState({bound:!0}),this.mousetrap||(this.mousetrap=new wi.a(this.props.inputRef)),this.mousetrap.bind("enter",(function(t){t.preventDefault(),t.stopPropagation(),e.state.selected&&(e.unbindShortcuts(),e.props.onSelect(e.state.selected))})),this.mousetrap.bind("tab",(function(t){t.preventDefault(),t.stopPropagation(),e.nextAutocompleteSuggestion(!1)})),this.mousetrap.bind(["up","shift+tab"],(function(t){t.preventDefault(),t.stopPropagation(),e.nextAutocompleteSuggestion(!0)})),this.mousetrap.bind("down",(function(t){t.preventDefault(),t.stopPropagation(),e.nextAutocompleteSuggestion(!1)})),this.mousetrap.bind("esc",(function(t){t.preventDefault(),t.stopPropagation(),e.props.onClear()}))}}},{key:"unbindShortcuts",value:function(){this.props.inputRef||this.unbindCmShortcuts(),this.state.bound&&(this.setState({bound:!1}),this.mousetrap.unbind("enter"),this.mousetrap.unbind("tab"),this.mousetrap.unbind(["up","shift+tab"]),this.mousetrap.unbind("down"),this.mousetrap.unbind("esc"))}},{key:"nextAutocompleteSuggestion",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.state.suggestions,r=n.findIndex((function(t){return t===e.state.selected}));r=t?r-1:r+1,(r%=Math.min(n.length,5))<0&&(r=n.length-1),this.setState({selected:n[r]})}},{key:"render",value:function(){var e=this.props,t=e.onSelect,n=e.contacts,r=e.popover,o=e.className,a=this.state,s=a.selected,l=a.suggestions;if(0===l.length)return null;var c=r?" absolute ":" ";return i.a.createElement("div",{style:r?{bottom:"90%",left:"48px"}:{},className:"black white-d bg-white bg-gray0-d w7 pv3 z-1 mt1 ba b--gray1-d b--gray4"+c+o||!1},l.slice(0,5).map((function(e){return i.a.createElement(Vi,{onSelect:t,key:e,selected:s,contacts:n,ship:e})})))}}]),n}(r.Component),Zi=function(e){Ii(n,e);var t=zi(n);function n(){var e;return Ni(this,n),(e=t.call(this)).state={searchTerm:""},e.inputRef=null,e.popoverRef=null,e.search=e.search.bind(Bi(e)),e.onClick=e.onClick.bind(Bi(e)),e.setInputRef=e.setInputRef.bind(Bi(e)),e}return Hi(n,[{key:"onClick",value:function(e){var t=this.popoverRef;t&&!t.contains(e.target)&&this.props.onClear()}},{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onClick),document.addEventListener("touchstart",this.onClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onClick),document.removeEventListener("touchstart",this.onClick)}},{key:"setInputRef",value:function(e){this.inputRef=e,e&&e.focus(),this.forceUpdate()}},{key:"search",value:function(e){var t=e.target.value;this.setState({searchTerm:t})}},{key:"render",value:function(){var e=this,t=this.state,n=this.props;return i.a.createElement("div",{ref:function(t){return e.popoverRef=t},style:{top:"150%",left:"-80px"},className:"b--gray2 b--solid ba absolute bg-white bg-gray0-d"},i.a.createElement("textarea",{style:{resize:"none",maxWidth:"200px"},className:"ma2 pa2 b--gray4 ba b--solid w7 db bg-gray0-d white-d",rows:1,autocapitalise:"none",autoFocus:!/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent),placeholder:"Search for a ship",value:t.searchTerm,onChange:this.search,ref:this.setInputRef}),i.a.createElement(qi,{contacts:n.contacts,candidates:n.candidates,searchTerm:_e(t.searchTerm),inputRef:this.inputRef,onSelect:n.onSelect,onClear:n.onClear}))}}]),n}(r.Component);function Gi(e){return(Gi="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)}function $i(){return($i=Object.assign||function(e){for(var t=1;t0?i.a.createElement("pre",{className:"f7 clamp-attachment pa1 mt0 mb0 b--gray4 b--gray1-d bl br bb"},t.code.output[0].join("\n")):null;return i.a.createElement("div",{className:"mv2"},i.a.createElement("pre",{className:"f7 clamp-attachment pa1 mt0 mb0 bg-light-gray b--gray4 b--gray1-d ba"},t.code.expression),n)}if("url"in t){var r,o=/(jpg|img|png|gif|tiff|jpeg|JPG|IMG|PNG|TIFF|GIF|webp|WEBP|webm|WEBM|svg|SVG)$/.exec(t.url),a=new RegExp(String(/(?:https?:\/\/(?:[a-z]+.)?)/.source)+/(?:youtu\.?be(?:\.com)?\/)(?:embed\/)?/.source+/(?:(?:(?:(?:watch\?)?(?:time_continue=(?:[0-9]+))?.+v=)?([a-zA-Z0-9_-]+))(?:\?t\=(?:[0-9a-zA-Z]+))?)/.source).exec(t.url),s=t.url;return o?(s=i.a.createElement("img",{className:"o-80-d",src:t.url,style:{height:"min(250px, 20vh)",maxWidth:"80vw"}}),i.a.createElement("a",{className:"f7 lh-copy v-top word-break-all",href:t.url,target:"_blank",rel:"noopener noreferrer"},s)):a?(s=i.a.createElement("div",{className:"embed-container mb2 w-100 w-75-l w-50-xl "+(!0===this.state.unfold?"db":"dn")},i.a.createElement("iframe",{ref:"iframe",width:"560",height:"315","data-src":"https://www.youtube.com/embed/".concat(a[1]),frameBorder:"0",allow:"picture-in-picture, fullscreen"})),i.a.createElement("div",null,i.a.createElement("a",(Fo(r={href:t.url,className:"f7 lh-copy v-top bb b--white-d word-break-all"},"href",t.url),Fo(r,"target","_blank"),Fo(r,"rel","noopener noreferrer"),r),t.url),i.a.createElement("a",{className:"ml2 f7 pointer lh-copy v-top",onClick:function(t){return e.unFoldEmbed()}},"[embed]"),s)):i.a.createElement("a",{className:"f7 lh-copy v-top bb b--white-d b--black word-break-all",href:t.url,target:"_blank",rel:"noopener noreferrer"},s)}return"me"in t?i.a.createElement("p",{className:"f7 i lh-copy v-top"},t.me):i.a.createElement("section",{className:"chat-md-message"},i.a.createElement(Jo,{source:t.text}))}},{key:"render",value:function(){var e=this,t=this.props,n=this.state,r=t.msg.pending?" o-40":"",o="~"+It.a.unix(t.msg.when/1e3).format("YYYY.M.D"),a=t.paddingTop?{paddingTop:"6px"}:"";if(t.renderSigil){var s=It.a.unix(t.msg.when/1e3).format("hh:mm a"),l=t.msg.author in t.contacts&&t.contacts[t.msg.author],c="~".concat(t.msg.author),u="#000000",d="mix-blend-diff";return l&&(c=l.nickname.length>0?l.nickname:"~".concat(t.msg.author),u="#".concat(ke(l.color)),d=""),"~".concat(t.msg.author)===c&&(c=Me(t.msg.author)),i.a.createElement("div",{ref:this.containerRef,className:"w-100 f7 pl3 pt4 pr3 cf flex lh-copy "+r,style:{minHeight:"min-content"}},i.a.createElement(Po,{ship:t.msg.author,contact:l,color:u,sigilClass:d,group:t.group,className:"fl pr3 v-top bg-white bg-gray0-d"}),i.a.createElement("div",{className:"fr clamp-message white-d",style:{flexGrow:1,marginTop:-8}},i.a.createElement("div",{className:"hide-child",style:a},i.a.createElement("p",{className:"v-mid f9 gray2 dib mr3 c-default"},i.a.createElement("span",{className:"pointer "+(l.nickname||n.copied?null:"mono"),onClick:function(){xe(t.msg.author),e.setState({copied:!0}),setTimeout((function(){e.setState({copied:!1})}),800)},title:"~".concat(t.msg.author)},n.copied?"Copied":c)),i.a.createElement("p",{className:"v-mid mono f9 gray2 dib"},s),i.a.createElement("p",{className:"v-mid mono f9 ml2 gray2 dib child dn-s"},o)),this.renderContent()))}var f=It.a.unix(t.msg.when/1e3).format("hh:mm");return i.a.createElement("div",{className:"w-100 pr3 cf hide-child flex"+r,style:{minHeight:"min-content"}},i.a.createElement("p",{className:"child pt2 pl2 pr1 mono f9 gray2 dib"},f),i.a.createElement("div",{className:"fr f7 clamp-message white-d pr3 lh-copy",style:{flexGrow:1}},this.renderContent()))}}])&&zo(t.prototype,n),r&&zo(t,r),a}(r.Component);function Xo(e){return(Xo="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)}function Qo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ea(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],n=this.state.patpSuggestions,r=n.findIndex((function(t){return t===e.state.selectedSuggestion}));r=t?r-1:r+1,(r%=n.length)<0&&(r=n.length-1),this.setState({selectedSuggestion:n[r]})}},{key:"patpAutocomplete",value:function(e){var t=/~([a-zA-Z\-]*)$/.exec(e);t?this.setState({patpSearch:t[1].toLowerCase()}):this.setState({patpSearch:null})}},{key:"clearSearch",value:function(){this.setState({patpSearch:null})}},{key:"completePatp",value:function(e){if(this.editor){var t=this.editor.getValue().replace(/[a-zA-Z\-]*$/,e);this.editor.setValue(t);var n=this.editor.lastLine(),r=this.editor.getLineHandle(n).text.length;this.editor.setCursor(n,r),this.setState({patpSearch:null})}}},{key:"messageChange",value:function(e,t,n){null!==this.state.patpSearch&&this.patpAutocomplete(n,!1)}},{key:"getLetterType",value:function(e){if(e.startsWith("/me ")){for(e=e.slice(4);"\n"===e[0];)e=e.slice(1);return{me:e}}return this.isUrl(e)?{url:e}:{text:e}}},{key:"isUrl",value:function(e){try{return new RegExp(String(/^((\w+:\/\/)[-a-zA-Z0-9:@;?&=\/%\+\.\*!'\(\),\$_\{\}\^~\[\]`#|]+)/.source)).test(e)}catch(e){return!1}}},{key:"messageSubmit",value:function(){var e=this;if(this.editor){var t=this.props,n=this.state,r=this.editor.getValue();if(""!==r){if(t.onEnter(),n.code)return t.api.chat.message(t.station,"~".concat(window.ship),Date.now(),{code:{expression:r,output:void 0}}),void this.editor.setValue("");var i=[];r.split(" ").map((function(n){if(!e.isUrl(n))return i.push(n);i.length>0&&(i=i.join(" "),i=e.getLetterType(i),t.api.chat.message(t.station,"~".concat(window.ship),Date.now(),i),i=[]);var r=e.getLetterType(n);t.api.chat.message(t.station,"~".concat(window.ship),Date.now(),r)})),i.length>0&&(i=i.join(" "),i=this.getLetterType(i),t.api.chat.message(t.station,"~".concat(window.ship),Date.now(),i),i=[]),this.editor.setValue("")}}}},{key:"toggleCode",value:function(){this.state.code?(this.setState({code:!1}),this.editor.setOption("mode",Pa),this.editor.setOption("placeholder",this.props.placeholder)):(this.setState({code:!0}),this.editor.setOption("mode",null),this.editor.setOption("placeholder","Code...")),0===this.editor.getValue().length&&(this.editor.setValue(" "),this.editor.setValue(""))}},{key:"uploadSuccess",value:function(e){var t=this.props;t.api.chat.message(t.station,"~".concat(window.ship),Date.now(),{url:e})}},{key:"uploadError",value:function(e){}},{key:"render",value:function(){var e=this,t=this.props,n=this.state,r=t.ownerContact?ke(t.ownerContact.color):"000000",o=t.ownerContact?"":"mix-blend-diff",a=t.ownerContact&&null!==t.ownerContact.avatar?i.a.createElement("img",{src:t.ownerContact.avatar,height:24,width:24,className:"dib"}):i.a.createElement(Di,{ship:window.ship,size:24,color:"#".concat(r),classes:o}),s=me.a.chain(this.props.envelopes).defaultTo([]).map("author").uniq().reverse().value(),l=n.code?" code":"",c={mode:Pa,theme:"tlon"+l,lineNumbers:!1,lineWrapping:!0,scrollbarStyle:"native",cursorHeight:.85,placeholder:n.code?"Code...":t.placeholder,extraKeys:{Tab:function(t){return e.patpAutocomplete(t.getValue(),!0)},Enter:function(){e.messageSubmit(),e.state.code&&e.toggleCode()},"Shift-3":function(t){return 0===t.getValue().length?e.toggleCode():ga.a.Pass}}};return i.a.createElement("div",{className:"chat pa3 cf flex black white-d bt b--gray4 b--gray1-d bg-white bg-gray0-d relative",style:{flexGrow:1}},i.a.createElement(qi,{popover:!0,onSelect:this.completePatp,onClear:this.clearSearch,contacts:t.contacts,candidates:s,searchTerm:this.state.patpSearch,cm:this.editor}),i.a.createElement("div",{className:"fl",style:{marginTop:6,flexBasis:24,height:24}},a),i.a.createElement("div",{className:"fr h-100 flex bg-gray0-d lh-copy pl2 w-100 items-center",style:{flexGrow:1,maxHeight:"224px",width:"calc(100% - 72px)"}},i.a.createElement(ma.UnControlled,{options:c,editorDidMount:function(t){e.editor=t,/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)||t.focus()},onChange:function(t,n,r){return e.messageChange(t,n,r)}})),i.a.createElement("div",{className:"ml2 mr2",style:{height:"16px",width:"16px",flexBasis:16,marginTop:10}},i.a.createElement(La,{configuration:t.s3.configuration,credentials:t.s3.credentials,uploadSuccess:this.uploadSuccess.bind(this),uploadError:this.uploadError.bind(this)})),i.a.createElement("div",{style:{height:"16px",width:"16px",flexBasis:16,marginTop:10}},i.a.createElement("img",{style:{filter:n.code&&"invert(100%)",height:"14px",width:"14px"},onClick:this.toggleCode,src:"/~chat/img/CodeEval.png",className:"contrast-10-d bg-white bg-none-d ba b--gray1-d br1"})))}}])&&Ea(t.prototype,n),r&&Ea(t,r),a}(r.Component);function Na(e){return(Na="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)}function Ra(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ha(e,t){for(var n=0;n1e3;!i&&r+20>300?this.askForMessages(r+20):this.askForMessages(300),i||t.read===t.length?(this.scrolledToMarker=!0,this.setState({scrollLocked:!1},(function(){e.scrollToBottom()}))):this.setState({scrollLocked:!0,numPages:Math.ceil(n/100)})}},{key:"componentDidUpdate",value:function(e,t){var n=this.props,r=this.state;e.match.params.station!==n.match.params.station||e.match.params.ship!==n.match.params.ship?this.receivedNewChat():n.chatInitialized&&!(n.station in n.inbox)&&Boolean(n.chatSynced)&&!(n.station in n.chatSynced)?n.history.push("/~chat"):n.envelopes.length>=e.envelopes.length+10?this.hasAskedForMessages=!1:n.length!==e.length&&e.length===t.read&&r.active&&(this.setState({read:n.length}),this.props.api.chat.read(this.props.station)),!e.chatInitialized&&n.chatInitialized&&this.receivedNewChat(),n.length===e.length&&n.envelopes.length===e.envelopes.length&&Xa(n)===this.lastNumPending&&r.numPages===t.numPages||(this.scrollToBottom(),navigator.userAgent.includes("Firefox")&&this.recalculateScrollTop(),this.lastNumPending=Xa(n))}},{key:"askForMessages",value:function(e){var t=this.props;if(this.state,!(t.envelopes.length>=t.length||this.hasAskedForMessages||t.length<=0)){var n=t.length-t.envelopes[t.envelopes.length-1].number;if(n>0){var r=n+e0&&o.length,o.length>100*r.numPages&&(o=o.slice(0,100*r.numPages));var a=n.pendingMessages.has(n.station)?n.pendingMessages.get(n.station):[];a.map((function(e){return e.pending=!0}));var s=(o=a.concat(o)).map((function(r,a){var s=["author"],l=me.a.get(o[a+1],s)!==me.a.get(r,s,r.author),c=l,u=me.a.get(o[a-1],s)!==me.a.get(r,s,r.author),d=["when"],f=It()(me.a.get(o[a+1],d)).format("YYYY.MM.DD")!==It()(me.a.get(o[a],d)).format("YYYY.MM.DD"),h=i.a.createElement(Ko,{key:r.uid,msg:r,contacts:n.contacts,renderSigil:l,paddingTop:c,paddingBot:u,pending:Boolean(r.pending),group:n.association});return e>0&&a===e-1?i.a.createElement(i.a.Fragment,null,h,i.a.createElement("div",{key:"unreads"+r.uid,ref:t.setUnreadMarker,className:"mv2 green2 flex items-center f9"},i.a.createElement("hr",{className:"dn-s ma0 w2 b--green2 bt-0"}),i.a.createElement("p",{className:"mh4"},"New messages below"),i.a.createElement("hr",{className:"ma0 flex-grow-1 b--green2 bt-0"}),f&&i.a.createElement("p",{className:"gray2 mh4"},It()(me.a.get(o[a],d)).calendar()),i.a.createElement("hr",{style:{width:"calc(50% - 48px)"},className:"b--green2 ma0 bt-0"}))):f?i.a.createElement(i.a.Fragment,null,h,i.a.createElement("div",{key:"daybreak"+r.uid,className:"pv3 gray2 b--gray2 flex items-center justify-center f9 "},i.a.createElement("p",null,It()(me.a.get(o[a],d)).calendar()))):h}));return navigator.userAgent.includes("Firefox")?i.a.createElement("div",{className:"relative overflow-y-scroll h-100",onScroll:this.onScroll,ref:function(e){t.scrollContainer=e}},i.a.createElement("div",{className:"bg-white bg-gray0-d pt3 pb2 flex flex-column-reverse",style:{resize:"vertical"}},i.a.createElement("div",{ref:function(e){t.scrollElement=e}}),n.chatInitialized&&!(n.station in n.inbox)&&i.a.createElement(yo,null),n.chatSynced&&!(n.station in n.chatSynced)&&o.length>0?i.a.createElement(co,{api:n.api,host:n.match.params.ship,station:n.station}):i.a.createElement("div",null),s)):i.a.createElement("div",{className:"overflow-y-scroll bg-white bg-gray0-d pt3 pb2 flex flex-column-reverse relative",style:{height:"100%",resize:"vertical"},onScroll:this.onScroll},i.a.createElement("div",{ref:function(e){t.scrollElement=e}}),n.chatInitialized&&!(n.station in n.inbox)&&i.a.createElement(yo,null),n.chatSynced&&!(n.station in n.chatSynced)&&o.length>0?i.a.createElement(co,{api:n.api,host:n.match.params.ship,station:n.station}):i.a.createElement("div",null),s)}},{key:"render",value:function(){var e=this,t=this.props,n=this.state,r=t.envelopes.slice(0),o=r.length>0?r.length:0,a=Array.from(t.permission.who.values()),s=t.popout?"popout/":"",l=window.ship in t.contacts&&t.contacts[window.ship],c=t.station.substr(1);t.association&&"metadata"in t.association&&(c=""!==t.association.metadata.title?t.association.metadata.title:t.station.substr(1));var u=t.length-n.read,d=u>0&&r[u-1],f=t.length!==t.read&&t.read===n.read;return i.a.createElement("div",{key:t.station,className:"h-100 w-100 overflow-hidden flex flex-column relative"},i.a.createElement("div",{className:"w-100 dn-m dn-l dn-xl inter pt4 pb6 pl3 f8",style:{height:"1rem"}},i.a.createElement(ce,{to:"/~chat/"},"⟵ All Chats")),i.a.createElement("div",{className:"pl4 pt2 bb b--gray4 b--gray1-d bg-gray0-d flex relative overflow-x-auto overflow-y-hidden flex-shrink-0 ",style:{height:48}},i.a.createElement(oa,{sidebarShown:t.sidebarShown,popout:t.popout,api:t.api}),i.a.createElement(ce,{to:"/~chat/"+s+"room"+t.station,className:"pt2 white-d"},i.a.createElement("h2",{className:"dib f9 fw4 lh-solid v-top "+(c===t.station.substr(1)?"mono":""),style:{width:"max-content"}},c)),i.a.createElement(pa,Va({},t,{station:t.station,numPeers:a.length,isOwner:_e(t.match.params.ship)===window.ship,popout:t.popout,api:t.api}))),!!d&&f&&i.a.createElement(Ba,{unread:u,unreadMsg:d,onRead:function(){return e.dismissUnread()}}),this.chatWindow(u),i.a.createElement(Aa,{api:t.api,numMsgs:o,station:t.station,owner:_e(t.match.params.ship),ownerContact:l,envelopes:t.envelopes,contacts:t.contacts,onEnter:function(){return e.setState({scrollLocked:!1})},s3:t.s3,placeholder:"Message..."}))}}])&&qa(t.prototype,n),r&&qa(t,r),a}(r.Component);function ts(e){return(ts="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)}function ns(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rs(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function fs(e,t){if(e){if("string"==typeof e)return hs(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hs(e,t):void 0}}function hs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var n,o=ds(e.props.groups[t].values());try{for(o.s();!(n=o.n()).done;){var a=n.value;r.add(a)}}catch(e){o.e(e)}finally{o.f()}}if(e.props.contacts[t]){var s,l=ds(e.props.groups[t].values());try{for(l.s();!(s=l.n()).done;){var c=s.value;e.props.contacts[t][c]&&(i.has(c)?i.get(c).push(e.props.contacts[t][c].nickname):i.set(c,[e.props.contacts[t][c].nickname]))}}catch(e){l.e(e)}finally{l.f()}}})),n=Array.from(r),this.setState({groups:t,peers:n,contacts:i})}},{key:"search",value:function(e){var t=this,n=e.target.value.toLowerCase().replace("~","");if(this.setState({searchValue:e.target.value}),n.length<1&&this.setState({searchResults:{groups:[],ships:[]}}),n.length>0){!0===this.state.inviteError&&this.setState({inviteError:!1});var r=[];this.props.groupResults&&(r=this.state.groups.filter((function(e){return e[0].includes(n)||e[1].toLowerCase().includes(n)})));var i=[];if(this.props.shipResults){i=this.state.peers.filter((function(e){return e.includes(n)&&!t.props.invites.ships.includes(e)}));var o,a=ds(this.state.contacts.keys());try{for(a.s();!(o=a.n()).done;){var s=o.value;this.state.contacts.get(s).filter((function(e){return e.toLowerCase().includes(n)})).length>0&&(s in i||i.push(s))}}catch(e){a.e(e)}finally{a.f()}var l=!0;_i.a.isValidPatp("~"+n)||(l=!1),l&&i.findIndex((function(e){return e===n}))<0&&i.unshift(n)}var c=this.state.selected,u=r.findIndex((function(e){return us(e,1)[0]===c})),d=i.findIndex((function(e){return e===c}));if(!c||u<0&&d<0){var f=me.a.get(r,"[0][0]")||i[0];this.setState({selected:f})}n.length<3&&(r=r.filter((function(e){return us(e,2)[1].toLowerCase().split(" ").some((function(e){return e.startsWith(n)}))})).sort((function(e,t){return e[1].length-t[1].length})),i=i.slice(0,3)),this.setState({searchResults:{groups:r,ships:i}})}}},{key:"bindShortcuts",value:function(){var e=this,t=wi()(this.textarea.current);t.bind(["down","tab"],(function(t){t.preventDefault(),t.stopPropagation(),e.nextSelection()})),t.bind(["up","shift+tab"],(function(t){t.preventDefault(),t.stopPropagation(),e.nextSelection("backward")})),t.bind("enter",(function(t){t.preventDefault(),t.stopPropagation();var n=e.state.selected;n.startsWith("/")?e.addGroup(n):e.addShip(n),e.setState({selected:null})}))}},{key:"nextSelection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.state,n=t.selected,r=t.searchResults,i=r.ships,o=r.groups;if(n){var a=o.findIndex((function(e){return us(e,1)[0]===n})),s=i.findIndex((function(e){return e===n}));if(a>=0){e?a--:a++;var l=me.a.get(o,[a],"[0]");return a===o.length&&(l=0===i.length?o[0][0]:i[0]),a<0&&(l=0===i.length?o[o.length-1][0]:i[i.length-1]),void this.setState({selected:l})}if(s>=0){e?s--:s++;var c=i[s];s===i.length&&(c=0===o.length?i[0]:o[0][0]),s<0&&(c=0===o.length?i[i.length-1]:o[o.length-1][0]),this.setState({selected:c})}}}},{key:"deleteGroup",value:function(){var e=this.props.invites.ships;this.setState({searchValue:"",searchResults:{groups:[],ships:[]}}),this.props.setInvite({groups:[],ships:e})}},{key:"deleteShip",value:function(e){var t=this.props.invites,n=t.groups,r=t.ships;this.setState({searchValue:"",searchResults:{groups:[],ships:[]}}),r=r.filter((function(t){return t!==e})),this.props.setInvite({groups:n,ships:r})}},{key:"addGroup",value:function(e){this.setState({searchValue:"",searchResults:{groups:[],ships:[]}}),this.props.setInvite({groups:[e],ships:[]})}},{key:"addShip",value:function(e){var t=this.props.invites,n=t.groups,r=t.ships;if(this.setState({searchValue:"",searchResults:{groups:[],ships:[]}}),r.includes(e)||r.push(e),n.length>0)return!1;this.props.setInvite({groups:n,ships:r})}},{key:"submitShipToAdd",value:function(e){var t=e.toLowerCase().replace("~","").trim(),n=!0;_i.a.isValidPatp("~"+t)||(n=!1),n?n&&(this.addShip(t),this.setState({searchValue:""})):this.setState({inviteError:!0,searchValue:""})}},{key:"render",value:function(){var e=this,t=this.props,n=this.state,r=t.disabled;t.invites.groups&&t.invites.groups.length>0&&(r=!0);var o=i.a.createElement("div",null),a=i.a.createElement("div",null),s="";t.shipResults&&(s="ships"),t.groupResults&&(s.length>0&&(s+=" or "),s+="existing groups"),s="Search for "+s;var l=i.a.createElement("span",null);if(n.inviteError&&(l=i.a.createElement("span",{className:"f9 inter red2 db pt2"},"Invited ships must be validly formatted ship names.")),n.searchResults.groups.length>0||n.searchResults.ships.length>0){var c=n.searchResults.groups.length>0?i.a.createElement("p",{className:"f9 gray2 ph3 pb2"},"Groups"):"",u=n.searchResults.ships.length>0?i.a.createElement("p",{className:"f9 gray2 pv2 ph3"},"Ships"):"",d=n.searchResults.groups.map((function(t){return i.a.createElement("li",{key:t[0],className:"list white-d f8 pv2 ph3 pointer hover-bg-gray4 hover-bg-gray1-d "+(t[1]?"inter":"mono")+(t[0]===n.selected?" bg-gray1-d bg-gray4":""),onClick:function(){return e.addGroup(t[0])}},i.a.createElement("span",{className:"mix-blend-diff white"},t[1]?t[1]:t[0]))})),f=n.searchResults.ships.map((function(t){var r=e.state.contacts.has(t)?e.state.contacts.get(t).filter((function(e){return!(""===e)})).join(", "):"";return i.a.createElement("li",{key:t,className:"list mono white-d f8 pv1 ph3 pointer hover-bg-gray4 hover-bg-gray1-d relative"+(t===n.selected?" bg-gray1-d bg-gray4":""),onClick:function(n){return e.addShip(t)}},i.a.createElement(Di,{ship:"~"+t,size:24,color:"#000000",classes:"mix-blend-diff v-mid"}),i.a.createElement("span",{className:"v-mid ml2 mw5 truncate dib mix-blend-diff white"},"~"+t),i.a.createElement("span",{className:"absolute right-1 di truncate mw4 inter f9 pt1 mix-blend-diff white"},r))}));a=i.a.createElement("div",{className:"absolute bg-white bg-gray0-d white-d pv3 z-1 w-100 mt1 ba b--white-d overflow-y-scroll mh-16"},c,d,u,f)}var h=t.invites.groups||[],p=t.invites.ships||[];if(h.length>0||p.length>0){var m=h.map((function(t){return i.a.createElement("span",{key:t,className:"f9 mono black pa2 bg-gray5 bg-gray1-d ba b--gray4 b--gray2-d white-d dib mr2 mt2 c-default"},t,i.a.createElement("span",{className:"white-d ml3 mono pointer",onClick:function(n){return e.deleteGroup(t)}},"x"))})),b=p.map((function(t){return i.a.createElement("span",{key:t,className:"f9 mono black pa2 bg-gray5 bg-gray1-d ba b--gray4 b--gray2-d white-d dib mr2 mt2 c-default"},"~"+t,i.a.createElement("span",{className:"white-d ml3 mono pointer",onClick:function(n){return e.deleteShip(t)}},"x"))}));o=i.a.createElement("div",{className:"f9 gray2 bb bl br b--gray3 b--gray2-d bg-gray0-d white-d pa3 db w-100 inter"},i.a.createElement("span",{className:"db gray2"},"Participants"),m," ",b)}return i.a.createElement("div",{className:"relative"},i.a.createElement("img",{src:"/~chat/img/search.png",className:"absolute invert-d",style:{height:16,width:16,top:14,left:12}}),i.a.createElement("textarea",{ref:this.textarea,className:"f7 ba b--gray3 b--gray2-d bg-gray0-d white-d pa3 w-100 db focus-b--black focus-b--white-d",placeholder:s,disabled:r,rows:1,spellCheck:!1,style:{resize:"none",paddingLeft:36},onChange:this.search,value:n.searchValue}),a,o,l)}}])&&ps(t.prototype,n),r&&ps(t,r),a}(r.Component);function ks(e){return(ks="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)}function ws(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xs(e,t){for(var n=0;n0;if(n.title){var i="/".concat(n.idName)+(r?"-".concat(Math.floor(1e4*Math.random())):"");if(i in t.inbox)this.setState({inviteError:!1,idError:!0,success:!1});else{var o=!0,a=n.ships.map((function(e){return"~".concat(_e(e.trim()))}));a.forEach((function(e){_i.a.isValidPatp(e)||(o=!1)})),1!==n.ships.length||"village"!==n.security||n.createGroup||t.history.push("/~chat/new/dm/".concat(a[0])),o?(this.textarea&&(this.textarea.value=""),this.setState({error:!1,success:!0,group:[],ships:[],awaiting:!0},(function(){var r="/~".concat(window.ship).concat(i);n.createGroup||0!==n.groups.length||(r="/~".concat(r));var o=r;n.groups.length>0&&(o=n.groups[0]),t.api.chatView.create(n.title,n.description,r,o,n.security,a,n.allowHistory).then((function(){e.setState({awaiting:!1}),t.history.push("/~chat/room".concat(r))}))}))):this.setState({inviteError:!0,idError:!1,success:!1})}}else this.setState({idError:!0,inviteError:!1})}},{key:"render",value:function(){var e=this.props,t=this.state;t.security,t.createGroup;var n=t.createGroup?"relative checked bg-green2 br3 h1 toggle v-mid z-0":"relative bg-gray4 bg-gray1-d br3 h1 toggle v-mid z-0",r=t.idName?"pointer db f9 green2 bg-gray0-d ba pv3 ph4 b--green2":"pointer db f9 gray2 ba bg-gray0-d pa2 pv3 ph4 b--gray3",o="f7 ba b--gray3 b--gray2-d bg-gray0-d white-d pa3 db w-100 focus-b--black focus-b--white-d ",a=i.a.createElement("span",null);t.idError&&(a=i.a.createElement("span",{className:"f9 inter red2 db pt2"},"Chat must have a valid name."));var s=i.a.createElement("div",null);0===t.groups.length&&(s=i.a.createElement("div",{className:"mv7"},i.a.createElement("input",{type:"checkbox",style:{WebkitAppearance:"none",width:28},className:n,onChange:this.createGroupChange}),i.a.createElement("span",{className:"dib f9 white-d inter ml3"},"Create Group"),i.a.createElement("p",{className:"f9 gray2 pt1",style:{paddingLeft:40}},"Participants will share this group across applications")));var l={};return Object.keys(e.permissions).forEach((function(t){l[t]=e.permissions[t].who})),i.a.createElement("div",{className:"h-100 w-100 mw6 pa3 pt4 overflow-x-hidden bg-gray0-d white-d flex flex-column"},i.a.createElement("div",{className:"w-100 dn-m dn-l dn-xl inter pt1 pb6 f8"},i.a.createElement(ce,{to:"/~chat/"},"⟵ All Chats")),i.a.createElement("h2",{className:"mb3 f8"},"New Chat"),i.a.createElement("div",{className:"w-100"},i.a.createElement("p",{className:"f8 mt3 lh-copy db"},"Name"),i.a.createElement("textarea",{className:o,placeholder:"Secret Chat",rows:1,style:{resize:"none"},onChange:this.titleChange}),a,i.a.createElement("p",{className:"f8 mt3 lh-copy db"},"Description",i.a.createElement("span",{className:"gray3"}," (Optional)")),i.a.createElement("textarea",{className:o,placeholder:"The coolest chat",rows:1,style:{resize:"none"},onChange:this.descriptionChange}),i.a.createElement("p",{className:"f8 mt4 lh-copy db"},"Invite",i.a.createElement("span",{className:"gray3"}," (Optional)")),i.a.createElement("p",{className:"f9 gray2 db mb2 pt1"},"Selected groups or ships will be able to post to chat"),i.a.createElement(_s,{groups:l,contacts:e.contacts,associations:e.associations,groupResults:!0,shipResults:!0,invites:{groups:t.groups,ships:t.ships},setInvite:this.setInvite}),s,i.a.createElement("button",{onClick:this.onClickCreate.bind(this),className:r},"Start Chat"),i.a.createElement(Es,{awaiting:this.state.awaiting,classes:"mt4",text:"Creating chat..."})))}}])&&nl(t.prototype,n),r&&nl(t,r),a}(r.Component);function cl(e){return(cl="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)}function ul(e,t){for(var n=0;n ~").concat(t.ship),"",n,r,"village",t.ship!==window.ship?["~".concat(t.ship)]:[],!0)}))}},{key:"render",value:function(){return i.a.createElement("div",{className:"h-100 w-100 mw6 pa3 pt4 overflow-x-hidden bg-gray0-d white-d flex flex-column"},i.a.createElement("div",{className:"w-100 dn-m dn-l dn-xl inter pt1 pb6 f8"},i.a.createElement(ce,{to:"/~chat/"},"⟵ All Chats")),i.a.createElement("h2",{className:"mb3 f8"},"New DM"),i.a.createElement("div",{className:"w-100"},i.a.createElement(Es,{awaiting:this.state.awaiting,classes:"mt4",text:"Creating chat..."})))}}])&&yl(t.prototype,n),r&&yl(t,r),a}(r.Component);function Sl(e){return(Sl="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)}function Ll(){return(Ll=Object.assign||function(e){for(var t=1;t0?"OS1 - Chat (".concat(a,")"):"OS1 - Chat",this.totalUnreads=a);var c=t.invites?t.invites:{"/chat":{},"/contacts":{}},u=t.contacts?t.contacts:{},d=t.s3?t.s3:{},f=function(n,a){return i.a.createElement(to,Ll({inbox:t.inbox,messagePreviews:r,associations:l,selectedGroups:s,contacts:u,invites:c["/chat"]||{},unreads:o,api:e.api,station:a},n))};return i.a.createElement(ee,null,i.a.createElement(G,{exact:!0,path:"/~chat",render:function(e){return i.a.createElement(Fr,{associations:l,invites:c,chatHideonMobile:!0,sidebarShown:t.sidebarShown,sidebar:f(e)},i.a.createElement("div",{className:"h-100 w-100 overflow-x-hidden flex flex-column bg-white bg-gray0-d"},i.a.createElement("div",{className:"pl3 pr3 pt2 dt pb3 w-100 h-100"},i.a.createElement("p",{className:"f8 pt3 gray2 w-100 h-100 dtc v-mid tc"},"Select, create, or join a chat to begin."))))}}),i.a.createElement(G,{exact:!0,path:"/~chat/new/dm/:ship",render:function(n){var r=n.match.params.ship;return i.a.createElement(Fr,{associations:l,invites:c,sidebarHideOnMobile:!0,sidebar:f(n),sidebarShown:t.sidebarShown},i.a.createElement(Ml,Ll({api:e.api,inbox:t.inbox||{},permissions:t.permissions||{},contacts:t.contacts||{},associations:l.contacts,chatSynced:t.chatSynced||{},autoCreate:r},n)))}}),i.a.createElement(G,{exact:!0,path:"/~chat/new",render:function(n){return i.a.createElement(Fr,{associations:l,invites:c,sidebarHideOnMobile:!0,sidebar:f(n),sidebarShown:t.sidebarShown},i.a.createElement(ll,Ll({api:e.api,inbox:t.inbox||{},permissions:t.permissions||{},contacts:t.contacts||{},associations:l.contacts,chatSynced:t.chatSynced||{}},n)))}}),i.a.createElement(G,{exact:!0,path:"/~chat/join/(~)?/:ship?/:station?",render:function(n){var r="/".concat(n.match.params.ship,"/").concat(n.match.params.station);return n.match.url.includes("/~/")&&(r="/~"+r),i.a.createElement(Fr,{associations:l,invites:c,sidebarHideOnMobile:!0,sidebar:f(n),sidebarShown:t.sidebarShown},i.a.createElement(bl,Ll({api:e.api,inbox:t.inbox,autoJoin:r,chatSynced:t.chatSynced||{}},n)))}}),i.a.createElement(G,{exact:!0,path:"/~chat/(popout)?/room/(~)?/:ship/:station+",render:function(n){var r="/".concat(n.match.params.ship,"/").concat(n.match.params.station);n.match.url.includes("/~/")&&(r="/~"+r);var o=t.inbox[r]||{config:{read:0,length:0},envelopes:[]},a={},s=r in l.chat&&"group-path"in l.chat[r]?l.chat[r]["group-path"]:"";l.chat[r]&&s in u&&(a=u[s]);var h=r in l.chat?l.chat[r]:{},p=r in t.permissions?t.permissions[r]:{who:new Set([]),kind:"white"},m=n.match.url.includes("/popout/");return i.a.createElement(Fr,{associations:l,invites:c,sidebarHideOnMobile:!0,popout:m,sidebarShown:t.sidebarShown,sidebar:f(n,r)},i.a.createElement(es,Ll({chatSynced:t.chatSynced,station:r,association:h,api:e.api,subscription:e.subscription,read:o.config.read,length:o.config.length,envelopes:o.envelopes,inbox:t.inbox,contacts:a,permission:p,pendingMessages:t.pendingMessages,s3:d,popout:m,sidebarShown:t.sidebarShown,chatInitialized:t.chatInitialized},n)))}}),i.a.createElement(G,{exact:!0,path:"/~chat/(popout)?/members/(~)?/:ship/:station+",render:function(n){var r="/".concat(n.match.params.ship,"/").concat(n.match.params.station);n.match.url.includes("/~/")&&(r="/~"+r);var o=t.permissions[r]||{kind:"",who:new Set([])},a=n.match.url.includes("/popout/"),s=r in l.chat?l.chat[r]:{};return i.a.createElement(Fr,{associations:l,invites:c,sidebarHideOnMobile:!0,sidebarShown:t.sidebarShown,popout:a,sidebar:f(n,r)},i.a.createElement(Vs,Ll({},n,{api:e.api,station:r,association:s,permission:o,contacts:u,permissions:t.permissions,popout:a,sidebarShown:t.sidebarShown})))}}),i.a.createElement(G,{exact:!0,path:"/~chat/(popout)?/settings/(~)?/:ship/:station+",render:function(n){var r="/".concat(n.match.params.ship,"/").concat(n.match.params.station);n.match.url.includes("/~/")&&(r="/~"+r);var o=n.match.url.includes("/popout/"),a=t.permissions[r]||{kind:"",who:new Set([])},s=r in l.chat?l.chat[r]:{};return i.a.createElement(Fr,{associations:l,invites:c,sidebarHideOnMobile:!0,popout:o,sidebarShown:t.sidebarShown,sidebar:f(n,r)},i.a.createElement(el,Ll({},n,{station:r,association:s,permission:a,permissions:t.permissions||{},contacts:t.contacts||{},associations:l.contacts,api:e.api,inbox:t.inbox,popout:o,sidebarShown:t.sidebarShown})))}}))}}])&&Cl(t.prototype,n),r&&Cl(t,r),a}(i.a.Component);function Yl(e){return(Yl="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)}function Pl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Al(e,t){for(var n=0;n1)||["Enter","Backspace","ArrowLeft","ArrowRight","Tab"].includes(e.key)))if("Enter"===e.key)t.setState({awaiting:!0,type:"Sending to Dojo"}),t.props.api.soto("ret").then((function(){t.setState({awaiting:!1})}));else{if("Backspace"===e.key&&t.props.cursor>0)return t.props.store.doEdit({del:t.props.cursor-1}),t.props.store.setState({cursor:t.props.cursor-1});if("Backspace"===e.key)return;e.key.startsWith("Arrow")?"ArrowLeft"===e.key?t.props.cursor>0&&t.props.store.setState({cursor:t.props.cursor-1}):"ArrowRight"===e.key&&t.props.cursore.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&void 0!==arguments[2]?arguments[2]:this.ship,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"dojo",i=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;this.bindPaths=me.a.uniq([].concat(rc(this.bindPaths),[e])),window.subscriptionId=this.channel.subscribe(n,r,e,(function(e){o(e)}),(function(t){i({data:t,from:{ship:n,path:e}})}),(function(e){o(e)}))}},{key:"soto",value:function(e){return this.action("dojo","sole-action",{id:this.dojoId,dat:e})}},{key:"action",value:function(e,t,n){var r=this;return new Promise((function(i,o){r.channel.poke(window.ship,e,t,n,(function(e){i(e)}),(function(e){o(e)}))}))}}])&&oc(t.prototype,n),r&&oc(t,r),e}();function sc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lc(e){for(var t=1;t=t.ins.at&&(t.ins.at=i,t.ins.at++)}return t;default:throw"%sole-edit -lost.".concat(dc(e))}}}},{key:"commit",value:function(e){return this.ven[0]++,this.leg.push(e),this.apply(e)}},{key:"inverse",value:function(e){var t=this;switch(!1){case"nop"!==e:return e;case!e.map:return e.map((function(e){var n=t.inverse(e);return t.apply(e),n})).reverse();default:switch(Object.keys(e)[0]){case"set":return{set:this.buf};case"ins":return{del:e.ins};case"del":return{ins:{at:e.del,cha:this.buf[e.del]}};default:throw"%sole-edit -lost.".concat(dc(e))}}}},{key:"receive",value:function(e){var t=e.ler,n=e.ted;if(t[1]!==this.ven[1])throw"-out-of-sync.[".concat(dc(t)," ").concat(dc(this.ven),"]");this.leg=this.leg.slice(this.leg.length+t[0]-this.ven[0]);var r=this.transmute(this.leg,n);return this.ven[1]++,this.apply(r),r}},{key:"remit",value:function(){throw"stub"}},{key:"transmit",value:function(e){var t={ted:e,ler:[this.ven[1],this.ven[0]]};return this.commit(e),t}},{key:"transceive",value:function(t){var n=t.ler,r=t.ted,i=new e(this.buf),o=this.receive({ler:n,ted:r});return i.inverse(o)}},{key:"transpose",value:function(e,t){return void 0===t?this.transpose(this.leg,e):(null!=(n=this.transmute(e,{ins:{at:t}}).ins)?n:{at:0}).at;var n}}])&&uc(t.prototype,n),r&&uc(t,r),e}();function hc(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;return this.contactViewAction({create:{path:e,ships:t,title:n,description:r}})}},{key:"groupAdd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.action("group-store","group-action",{add:{members:t,path:e}})}},{key:"groupRemove",value:function(e,t){return this.action("group-store","group-action",{remove:{members:t,path:e}})}},{key:"contactShare",value:function(e,t,n,r){return this.contactViewAction({share:{recipient:e,path:t,ship:n,contact:r}})}},{key:"contactDelete",value:function(e){return this.contactViewAction({delete:{path:e}})}},{key:"contactRemove",value:function(e,t){return this.contactViewAction({remove:{path:e,ship:t}})}},{key:"contactHookAction",value:function(e){return this.action("contact-hook","contact-action",e)}},{key:"contactEdit",value:function(e,t,n){return this.contactHookAction({edit:{path:e,ship:t,"edit-field":n}})}},{key:"inviteAction",value:function(e){return this.action("invite-store","json",e)}},{key:"inviteAccept",value:function(e){return this.inviteAction({accept:{path:"/contacts",uid:e}})}},{key:"inviteDecline",value:function(e){return this.inviteAction({decline:{path:"/contacts",uid:e}})}},{key:"metadataAction",value:function(e){return this.action("metadata-hook","metadata-action",e)}},{key:"metadataAdd",value:function(e,t,n,r,i,o){var a="~".concat(window.ship);return this.metadataAction({add:{"group-path":t,resource:{"app-path":e,"app-name":"contacts"},metadata:{title:n,description:r,color:o,"date-created":i,creator:a}}})}},{key:"setSelected",value:function(e){this.store.handleEvent({data:{local:{selected:e}}})}}])&&Lc(t.prototype,n),r&&Lc(t,r),o}(Ae);function Pc(e){return(Pc="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)}function Ac(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nc(e,t){for(var n=0;n=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function Bc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n