forked from APACGAMONDE/ShareHoldings
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvendor-25f03d73.js.download
122 lines (122 loc) · 106 KB
/
vendor-25f03d73.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
System.register([],(function(t){"use strict";return{execute:function(){t({S:K,a:function(){var t;return(t=Gt()).observe.apply(t,arguments)},d:$,f:function(t,e,n){return t.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}))}
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/,g:function(t=0,e={}){return(n,i,s)=>{if(!s||"function"!=typeof s.value)throw new Error("debounce can only decorate functions");const r=s.value;s.value=$(r,t,e),Object.defineProperty(n,i,s)}},i:q,j:V,n:W,o:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=!!i.capture,r=s?st:it,o=r[t];o||(o=new K,r[t]=o,document.addEventListener(t,ft,s));o.add(e,n)},t:U,u:B});
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
const e=new WeakMap,n=t=>"function"==typeof t&&e.has(t),i=void 0!==window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,s=(t,e,n=null)=>{for(;e!==n;){const n=e.nextSibling;t.removeChild(e),e=n}},r={},o={},a=`{{lit-${String(Math.random()).slice(2)}}}`,c=`\x3c!--${a}--\x3e`,l=new RegExp(`${a}|${c}`);class u{constructor(t,e){this.parts=[],this.element=e;const n=[],i=[],s=document.createTreeWalker(e.content,133,null,!1);let r=0,o=-1,c=0;const{strings:u,values:{length:h}}=t;for(;c<h;){const t=s.nextNode();if(null!==t){if(o++,1===t.nodeType){if(t.hasAttributes()){const e=t.attributes,{length:n}=e;let i=0;for(let t=0;t<n;t++)d(e[t].name,"$lit$")&&i++;for(;i-- >0;){const e=u[c],n=f.exec(e)[2],i=n.toLowerCase()+"$lit$",s=t.getAttribute(i);t.removeAttribute(i);const r=s.split(l);this.parts.push({type:"attribute",index:o,name:n,strings:r}),c+=r.length-1}}"TEMPLATE"===t.tagName&&(i.push(t),s.currentNode=t.content)}else if(3===t.nodeType){const e=t.data;if(e.indexOf(a)>=0){const i=t.parentNode,s=e.split(l),r=s.length-1;for(let e=0;e<r;e++){let n,r=s[e];if(""===r)n=m();else{const t=f.exec(r);null!==t&&d(t[2],"$lit$")&&(r=r.slice(0,t.index)+t[1]+t[2].slice(0,-"$lit$".length)+t[3]),n=document.createTextNode(r)}i.insertBefore(n,t),this.parts.push({type:"node",index:++o})}""===s[r]?(i.insertBefore(m(),t),n.push(t)):t.data=s[r],c+=r}}else if(8===t.nodeType)if(t.data===a){const e=t.parentNode;null!==t.previousSibling&&o!==r||(o++,e.insertBefore(m(),t)),r=o,this.parts.push({type:"node",index:o}),null===t.nextSibling?t.data="":(n.push(t),o--),c++}else{let e=-1;for(;-1!==(e=t.data.indexOf(a,e+1));)this.parts.push({type:"node",index:-1}),c++}}else s.currentNode=i.pop()}for(const a of n)a.parentNode.removeChild(a)}}const d=(t,e)=>{const n=t.length-e.length;return n>=0&&t.slice(n)===e},h=t=>-1!==t.index,m=()=>document.createComment(""),f=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
class p{constructor(t,e,n){this.__parts=[],this.template=t,this.processor=e,this.options=n}update(t){let e=0;for(const n of this.__parts)void 0!==n&&n.setValue(t[e]),e++;for(const n of this.__parts)void 0!==n&&n.commit()}_clone(){const t=i?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),e=[],n=this.template.parts,s=document.createTreeWalker(t,133,null,!1);let r,o=0,a=0,c=s.nextNode();for(;o<n.length;)if(r=n[o],h(r)){for(;a<r.index;)a++,"TEMPLATE"===c.nodeName&&(e.push(c),s.currentNode=c.content),null===(c=s.nextNode())&&(s.currentNode=e.pop(),c=s.nextNode());if("node"===r.type){const t=this.processor.handleTextExpression(this.options);t.insertAfterNode(c.previousSibling),this.__parts.push(t)}else this.__parts.push(...this.processor.handleAttributeExpressions(c,r.name,r.strings,this.options));o++}else this.__parts.push(void 0),o++;return i&&(document.adoptNode(t),customElements.upgrade(t)),t}}
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const g=` ${a} `;class v{constructor(t,e,n,i){this.strings=t,this.values=e,this.type=n,this.processor=i}getHTML(){const t=this.strings.length-1;let e="",n=!1;for(let i=0;i<t;i++){const t=this.strings[i],s=t.lastIndexOf("\x3c!--");n=(s>-1||n)&&-1===t.indexOf("--\x3e",s+1);const r=f.exec(t);e+=null===r?t+(n?g:c):t.substr(0,r.index)+r[1]+r[2]+"$lit$"+r[3]+a}return e+=this.strings[t],e}getTemplateElement(){const t=document.createElement("template");return t.innerHTML=this.getHTML(),t}}
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/const b=t=>null===t||!("object"==typeof t||"function"==typeof t),E=t=>Array.isArray(t)||!(!t||!t[Symbol.iterator]);class w{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let i=0;i<n.length-1;i++)this.parts[i]=this._createPart()}_createPart(){return new y(this)}_getValue(){const t=this.strings,e=t.length-1;let n="";for(let i=0;i<e;i++){n+=t[i];const e=this.parts[i];if(void 0!==e){const t=e.value;if(b(t)||!E(t))n+="string"==typeof t?t:String(t);else for(const e of t)n+="string"==typeof e?e:String(e)}}return n+=t[e],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class y{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===r||b(t)&&t===this.value||(this.value=t,n(t)||(this.committer.dirty=!0))}commit(){for(;n(this.value);){const t=this.value;this.value=r,t(this)}this.value!==r&&this.committer.commit()}}class A{constructor(t){this.value=void 0,this.__pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(m()),this.endNode=t.appendChild(m())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t.__insert(this.startNode=m()),t.__insert(this.endNode=m())}insertAfterPart(t){t.__insert(this.startNode=m()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this.__pendingValue=t}commit(){for(;n(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=r,t(this)}const t=this.__pendingValue;t!==r&&(b(t)?t!==this.value&&this.__commitText(t):t instanceof v?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):E(t)?this.__commitIterable(t):t===o?(this.value=o,this.clear()):this.__commitText(t))}__insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}__commitNode(t){this.value!==t&&(this.clear(),this.__insert(t),this.value=t)}__commitText(t){const e=this.startNode.nextSibling,n="string"==typeof(t=null==t?"":t)?t:String(t);e===this.endNode.previousSibling&&3===e.nodeType?e.data=n:this.__commitNode(document.createTextNode(n)),this.value=t}__commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof p&&this.value.template===e)this.value.update(t.values);else{const n=new p(e,t.processor,this.options),i=n._clone();n.update(t.values),this.__commitNode(i),this.value=n}}__commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,i=0;for(const s of t)n=e[i],void 0===n&&(n=new A(this.options),e.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(e[i-1])),n.setValue(s),n.commit(),i++;i<e.length&&(e.length=i,this.clear(n&&n.endNode))}clear(t=this.startNode){s(this.startNode.parentNode,t.nextSibling,this.endNode)}}class x{constructor(t,e,n){if(this.value=void 0,this.__pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this.__pendingValue=t}commit(){for(;n(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=r,t(this)}if(this.__pendingValue===r)return;const t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=r}}class k extends w{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new T(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class T extends y{}let M=!1;try{const t={get capture(){return M=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(Gi){}class L{constructor(t,e,n){this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this.__boundHandleEvent=t=>this.handleEvent(t)}setValue(t){this.__pendingValue=t}commit(){for(;n(this.__pendingValue);){const t=this.__pendingValue;this.__pendingValue=r,t(this)}if(this.__pendingValue===r)return;const t=this.__pendingValue,e=this.value,i=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),s=null!=t&&(null==e||i);i&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),s&&(this.__options=C(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=r}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const C=t=>t&&(M?{capture:t.capture,passive:t.passive,once:t.once}:t.capture)
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/;const S=new class{handleAttributeExpressions(t,e,n,i){const s=e[0];if("."===s){return new k(t,e.slice(1),n).parts}return"@"===s?[new L(t,e.slice(1),i.eventContext)]:"?"===s?[new x(t,e.slice(1),n)]:new w(t,e,n).parts}handleTextExpression(t){return new A(t)}};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/function I(t){let e=_.get(t.type);void 0===e&&(e={stringsArray:new WeakMap,keyString:new Map},_.set(t.type,e));let n=e.stringsArray.get(t.strings);if(void 0!==n)return n;const i=t.strings.join(a);return n=e.keyString.get(i),void 0===n&&(n=new u(t,t.getTemplateElement()),e.keyString.set(i,n)),e.stringsArray.set(t.strings,n),n}const _=new Map,D=new WeakMap;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/t("r",(t,e,n)=>{let i=D.get(e);void 0===i&&(s(e,e.firstChild),D.set(e,i=new A(Object.assign({templateFactory:I},n))),i.appendInto(e)),i.setValue(t),i.commit()});
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at
* http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at
* http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.1.2");t("h",(t,...e)=>new v(t,e,"html",S));function H(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,s=e.offsetTop,r=s+e.clientHeight;return s>=n&&r<=i})(t,e)||(t.scrollTop=e.offsetTop)}function q(t,e){t.addEventListener("compositionstart",j),t.addEventListener("compositionend",j),t.addEventListener("keydown",O),e.addEventListener("click",P)}function B(t,e){t.removeAttribute("aria-activedescendant"),t.removeEventListener("compositionstart",j),t.removeEventListener("compositionend",j),t.removeEventListener("keydown",O),e.removeEventListener("click",P)}let N=!1;const F=!!navigator.userAgent.match(/Macintosh/);function O(t){if(t.shiftKey||t.metaKey||t.altKey)return;const e=t.currentTarget;if(!(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement))return;if(N)return;const n=document.getElementById(e.getAttribute("aria-owns")||"");if(n)switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||(n.click(),!0))})(0,n)&&t.preventDefault();break;case"Escape":V(e,n);break;case"ArrowDown":W(e,n,1),t.preventDefault();break;case"ArrowUp":W(e,n,-1),t.preventDefault();break;case"n":F&&t.ctrlKey&&(W(e,n,1),t.preventDefault());break;case"p":F&&t.ctrlKey&&(W(e,n,-1),t.preventDefault())}}function P(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function R(t){return!t.hidden&&(!t.type||"hidden"!==t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}function W(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const i=Array.from(e.querySelectorAll('[aria-selected="true"]')).filter(R)[0],s=Array.from(e.querySelectorAll('[role="option"]')).filter(R),r=s.indexOf(i);let o=1===n?0:s.length-1;if(i&&r>=0){const t=r+n;t>=0&&t<s.length&&(o=t)}const a=s[o];if(a)for(const c of s)a===c?(t.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),H(e,a)):c.setAttribute("aria-selected","false")}function V(t,e){t.removeAttribute("aria-activedescendant");for(const n of e.querySelectorAll('[aria-selected="true"]'))n.setAttribute("aria-selected","false")}function j(t){const e=t.currentTarget;if(!(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement))return;N="compositionstart"===t.type;const n=document.getElementById(e.getAttribute("aria-owns")||"");n&&V(e,n)}function U(t,e=0,{start:n=!0,middle:i=!0,once:s=!1}={}){let r,o=0,a=!1;function c(...l){if(a)return;const u=Date.now()-o;o=Date.now(),n?(n=!1,t.apply(this,l),s&&c.cancel()):(i&&u<e||!i)&&(clearTimeout(r),r=setTimeout(()=>{o=Date.now(),t.apply(this,l),s&&c.cancel()},i?e-u:e))}return c.cancel=()=>{clearTimeout(r),a=!0},c}function $(t,e=0,{start:n=!1,middle:i=!1,once:s=!1}={}){return U(t,e,{start:n,middle:i,once:s})}function K(){if(!(this instanceof K))return new K;this.size=0,this.uid=0,this.selectors=[],this.indexes=Object.create(this.indexes),this.activeIndexes=[]}var Y=window.document.documentElement,z=Y.matches||Y.webkitMatchesSelector||Y.mozMatchesSelector||Y.oMatchesSelector||Y.msMatchesSelector;K.prototype.matchesSelector=function(t,e){return z.call(t,e)},K.prototype.querySelectorAll=function(t,e){return e.querySelectorAll(t)},K.prototype.indexes=[];var X=/^#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;K.prototype.indexes.push({name:"ID",selector:function(t){var e;if(e=t.match(X))return e[0].slice(1)},element:function(t){if(t.id)return[t.id]}});var G=/^\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;K.prototype.indexes.push({name:"CLASS",selector:function(t){var e;if(e=t.match(G))return e[0].slice(1)},element:function(t){var e=t.className;if(e){if("string"==typeof e)return e.split(/\s/);if("object"==typeof e&&"baseVal"in e)return e.baseVal.split(/\s/)}}});var Q,Z=/^((?:[\w\u00c0-\uFFFF\-]|\\.)+)/g;K.prototype.indexes.push({name:"TAG",selector:function(t){var e;if(e=t.match(Z))return e[0].toUpperCase()},element:function(t){return[t.nodeName.toUpperCase()]}}),K.prototype.indexes.default={name:"UNIVERSAL",selector:function(){return!0},element:function(){return[!0]}},Q="function"==typeof window.Map?window.Map:function(){function t(){this.map={}}return t.prototype.get=function(t){return this.map[t+" "]},t.prototype.set=function(t,e){this.map[t+" "]=e},t}();var J=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g;function tt(t,e){var n,i,s,r,o,a,c=(t=t.slice(0).concat(t.default)).length,l=e,u=[];do{if(J.exec(""),(s=J.exec(l))&&(l=s[3],s[2]||!l))for(n=0;n<c;n++)if(o=(a=t[n]).selector(s[1])){for(i=u.length,r=!1;i--;)if(u[i].index===a&&u[i].key===o){r=!0;break}r||u.push({index:a,key:o});break}}while(s);return u}function et(t,e){var n,i,s;for(n=0,i=t.length;n<i;n++)if(s=t[n],e.isPrototypeOf(s))return s}function nt(t,e){return t.id-e.id}K.prototype.logDefaultIndexUsed=function(){},K.prototype.add=function(t,e){var n,i,s,r,o,a,c,l,u=this.activeIndexes,d=this.selectors;if("string"==typeof t){for(n={id:this.uid++,selector:t,data:e},c=tt(this.indexes,t),i=0;i<c.length;i++)r=(l=c[i]).key,(o=et(u,s=l.index))||((o=Object.create(s)).map=new Q,u.push(o)),s===this.indexes.default&&this.logDefaultIndexUsed(n),(a=o.map.get(r))||(a=[],o.map.set(r,a)),a.push(n);this.size++,d.push(t)}},K.prototype.remove=function(t,e){if("string"==typeof t){var n,i,s,r,o,a,c,l,u=this.activeIndexes,d={},h=1===arguments.length;for(n=tt(this.indexes,t),s=0;s<n.length;s++)for(i=n[s],r=u.length;r--;)if(a=u[r],i.index.isPrototypeOf(a)){if(c=a.map.get(i.key))for(o=c.length;o--;)(l=c[o]).selector!==t||!h&&l.data!==e||(c.splice(o,1),d[l.id]=!0);break}this.size-=Object.keys(d).length}},K.prototype.queryAll=function(t){if(!this.selectors.length)return[];var e,n,i,s,r,o,a,c,l={},u=[],d=this.querySelectorAll(this.selectors.join(", "),t);for(e=0,i=d.length;e<i;e++)for(r=d[e],n=0,s=(o=this.matches(r)).length;n<s;n++)l[(c=o[n]).id]?a=l[c.id]:(a={id:c.id,selector:c.selector,data:c.data,elements:[]},l[c.id]=a,u.push(a)),a.elements.push(r);return u.sort(nt)},K.prototype.matches=function(t){if(!t)return[];var e,n,i,s,r,o,a,c,l,u,d,h=this.activeIndexes,m={},f=[];for(e=0,s=h.length;e<s;e++)if(c=(a=h[e]).element(t))for(n=0,r=c.length;n<r;n++)if(l=a.map.get(c[n]))for(i=0,o=l.length;i<o;i++)!m[d=(u=l[i]).id]&&this.matchesSelector(t,u.selector)&&(m[d]=!0,f.push(u));return f.sort(nt)};var it={},st={},rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ct=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function lt(t,e,n){var i=t[e];return t[e]=function(){return n.apply(t,arguments),i.apply(t,arguments)},t}function ut(){rt.set(this,!0)}function dt(){rt.set(this,!0),ot.set(this,!0)}function ht(){return at.get(this)||null}function mt(t,e){ct&&Object.defineProperty(t,"currentTarget",{configurable:!0,enumerable:!0,get:e||ct.get})}function ft(t){if(function(t){try{return t.eventPhase,!0}catch(e){return!1}}(t)){var e=(1===t.eventPhase?st:it)[t.type];if(e){var n=function(t,e,n){var i=[],s=e;do{if(1!==s.nodeType)break;var r=t.matches(s);if(r.length){var o={node:s,observers:r};n?i.unshift(o):i.push(o)}}while(s=s.parentElement);return i}(e,t.target,1===t.eventPhase);if(n.length){lt(t,"stopPropagation",ut),lt(t,"stopImmediatePropagation",dt),mt(t,ht);for(var i=0,s=n.length;i<s&&!rt.get(t);i++){var r=n[i];at.set(t,r.node);for(var o=0,a=r.observers.length;o<a&&!ot.get(t);o++)r.observers[o].data.call(r.node,t)}at.delete(t),mt(t)}}}}const pt=new WeakMap;t("b",(gt=(...t)=>e=>{let n=pt.get(e);void 0===n&&(n={lastRenderedIndex:2147483647,values:[]},pt.set(e,n));const i=n.values;let s=i.length;n.values=t;for(let r=0;r<t.length&&!(r>n.lastRenderedIndex);r++){const o=t[r];if(b(o)||"function"!=typeof o.then){e.setValue(o),n.lastRenderedIndex=r;break}r<s&&o===i[r]||(n.lastRenderedIndex=2147483647,s=0,Promise.resolve(o).then(t=>{const i=n.values.indexOf(o);i>-1&&i<n.lastRenderedIndex&&(n.lastRenderedIndex=i,e.setValue(t),e.commit())}))}},(...t)=>{const n=gt(...t);return e.set(n,!0),n}));var gt,vt=null,bt=null,Et=[];function wt(t,e){var n=[];function i(){var t=n;n=[],e(t)}return function(){for(var e=arguments.length,s=Array(e),r=0;r<e;r++)s[r]=arguments[r];n.push(s),1===n.length&&yt(t,i)}}function yt(t,e){bt||(bt=new MutationObserver(At)),vt||(vt=t.createElement("div"),bt.observe(vt,{attributes:!0})),Et.push(e),vt.setAttribute("data-twiddle",""+Date.now())}function At(){var t=Et;Et=[];for(var e=0;e<t.length;e++)try{t[e]()}catch(n){setTimeout((function(){throw n}),0)}}var xt=new WeakMap,kt=new WeakMap,Tt=new WeakMap,Mt=new WeakMap;function Lt(t,e){for(var n=0;n<e.length;n++){var i=e[n],s=i[0],r=i[1],o=i[2];s===qt?(Ct(o,r),St(o,r)):s===Bt?It(o,r):s===Nt&&_t(t.observers,r)}}function Ct(t,e){if(e instanceof t.elementConstructor){var n=xt.get(e);if(n||(n=[],xt.set(e,n)),-1===n.indexOf(t.id)){var i=void 0;if(t.initialize&&(i=t.initialize.call(void 0,e)),i){var s=kt.get(e);s||(s={},kt.set(e,s)),s[""+t.id]=i}n.push(t.id)}}}function St(t,e){if(e instanceof t.elementConstructor){var n=Mt.get(e);if(n||(n=[],Mt.set(e,n)),-1===n.indexOf(t.id)){t.elements.push(e);var i=kt.get(e),s=i?i[""+t.id]:null;if(s&&s.add&&s.add.call(void 0,e),t.subscribe){var r=t.subscribe.call(void 0,e);if(r){var o=Tt.get(e);o||(o={},Tt.set(e,o)),o[""+t.id]=r}}t.add&&t.add.call(void 0,e),n.push(t.id)}}}function It(t,e){if(e instanceof t.elementConstructor){var n=Mt.get(e);if(n){var i=t.elements.indexOf(e);if(-1!==i&&t.elements.splice(i,1),-1!==(i=n.indexOf(t.id))){var s=kt.get(e),r=s?s[""+t.id]:null;if(r&&r.remove&&r.remove.call(void 0,e),t.subscribe){var o=Tt.get(e),a=o?o[""+t.id]:null;a&&a.unsubscribe&&a.unsubscribe()}t.remove&&t.remove.call(void 0,e),n.splice(i,1)}0===n.length&&Mt.delete(e)}}}function _t(t,e){var n=Mt.get(e);if(n){for(var i=n.slice(0),s=0;s<i.length;s++){var r=t[i[s]];if(r){var o=r.elements.indexOf(e);-1!==o&&r.elements.splice(o,1);var a=kt.get(e),c=a?a[""+r.id]:null;c&&c.remove&&c.remove.call(void 0,e);var l=Tt.get(e),u=l?l[""+r.id]:null;u&&u.unsubscribe&&u.unsubscribe(),r.remove&&r.remove.call(void 0,e)}}Mt.delete(e)}}var Dt=null;function Ht(t){return"matches"in t||"webkitMatchesSelector"in t||"mozMatchesSelector"in t||"oMatchesSelector"in t||"msMatchesSelector"in t}var qt=1,Bt=2,Nt=3;function Ft(t,e,n){for(var i=0;i<n.length;i++){var s=n[i];"childList"===s.type?(Ot(t,e,s.addedNodes),Pt(t,e,s.removedNodes)):"attributes"===s.type&&Rt(t,e,s.target)}(function(t){if(null===Dt){var e=t.createElement("div"),n=t.createElement("div"),i=t.createElement("div");e.appendChild(n),n.appendChild(i),e.innerHTML="",Dt=i.parentNode!==n}return Dt})(t.ownerDocument)&&function(t,e){for(var n=0;n<t.observers.length;n++){var i=t.observers[n];if(i)for(var s=i.elements,r=0;r<s.length;r++){var o=s[r];o.parentNode||e.push([Nt,o])}}}(t,e)}function Ot(t,e,n){for(var i=0;i<n.length;i++){var s=n[i];if(Ht(s))for(var r=t.selectorSet.matches(s),o=0;o<r.length;o++){var a=r[o].data;e.push([qt,s,a])}if("querySelectorAll"in s)for(var c=t.selectorSet.queryAll(s),l=0;l<c.length;l++)for(var u=c[l],d=u.data,h=u.elements,m=0;m<h.length;m++)e.push([qt,h[m],d])}}function Pt(t,e,n){for(var i=0;i<n.length;i++){var s=n[i];if("querySelectorAll"in s){e.push([Nt,s]);for(var r=s.querySelectorAll("*"),o=0;o<r.length;o++)e.push([Nt,r[o]])}}}function Rt(t,e,n){if(Ht(n))for(var i=t.selectorSet.matches(n),s=0;s<i.length;s++){var r=i[s].data;e.push([qt,n,r])}if("querySelectorAll"in n){var o=Mt.get(n);if(o)for(var a=0;a<o.length;a++){var c=t.observers[o[a]];c&&(t.selectorSet.matchesSelector(n,c.selector)||e.push([Bt,n,c]))}}}var Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vt=0;function jt(t){this.rootNode=9===t.nodeType?t.documentElement:t,this.ownerDocument=9===t.nodeType?t:t.ownerDocument,this.observers=[],this.selectorSet=new K,this.mutationObserver=new MutationObserver(Kt.bind(this,this)),this._scheduleAddRootNodes=wt(this.ownerDocument,$t.bind(this,this)),this._handleThrottledChangedTargets=wt(this.ownerDocument,zt.bind(this,this)),this.rootNode.addEventListener("change",Yt.bind(this,this),!1),function(t,e){var n=t.readyState;"interactive"===n||"complete"===n?yt(t,e):t.addEventListener("DOMContentLoaded",yt(t,e))}(this.ownerDocument,Ut.bind(this,this))}function Ut(t){t.mutationObserver.observe(t.rootNode,{childList:!0,attributes:!0,subtree:!0}),t._scheduleAddRootNodes()}function $t(t){var e=[];Ot(t,e,[t.rootNode]),Lt(t,e)}function Kt(t,e){var n=[];Ft(t,n,e),Lt(t,n)}function Yt(t,e){t._handleThrottledChangedTargets(e.target)}function zt(t,e){var n=[];!function(t,e,n){for(var i=0;i<n.length;i++)for(var s=n[i],r=s.form?s.form.elements:t.rootNode.querySelectorAll("input"),o=0;o<r.length;o++)Rt(t,e,r[o])}(t,n,e),Lt(t,n)}jt.prototype.disconnect=function(){this.mutationObserver.disconnect()},jt.prototype.observe=function(t,e){var n=void 0;"function"==typeof e?n={selector:t,initialize:e}:"object"===(void 0===e?"undefined":Wt(e))?(n=e).selector=t:n=t;var i=this,s={id:Vt++,selector:n.selector,initialize:n.initialize,add:n.add,remove:n.remove,subscribe:n.subscribe,elements:[],elementConstructor:n.hasOwnProperty("constructor")?n.constructor:this.ownerDocument.defaultView.Element,abort:function(){i._abortObserving(s)}};return this.selectorSet.add(s.selector,s),this.observers[s.id]=s,this._scheduleAddRootNodes(),s},jt.prototype._abortObserving=function(t){for(var e=t.elements,n=0;n<e.length;n++)It(t,e[n]);this.selectorSet.remove(t.selector,t),delete this.observers[t.id]},jt.prototype.triggerObservers=function(t){var e=[];!function(t,e,n){if("querySelectorAll"in n){Rt(t,e,n);for(var i=n.querySelectorAll("*"),s=0;s<i.length;s++)Rt(t,e,i[s])}}(this,e,t),Lt(this,e)};var Xt=void 0;function Gt(){return Xt||(Xt=new jt(window.document)),Xt}function Qt(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{start:n=!0,middle:i=!0,once:s=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var r,o=0,a=!1,c=function c(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];if(!a){var h=Date.now()-o;o=Date.now(),n?(n=!1,t(...u),s&&c.cancel()):(i&&h<e||!i)&&(clearTimeout(r),r=setTimeout((function(){o=Date.now(),t(...u),s&&c.cancel()}),i?e-h:e))}};return c.cancel=function(){clearTimeout(r),a=!0},c}const Zt=new WeakMap;class AutoCheckElement extends HTMLElement{connectedCallback(){const t=this.input;if(!t)return;const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,{start:n=!1,middle:i=!1,once:s=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Qt(t,e,{start:n,middle:i,once:s})}(te.bind(null,this),300),n={check:e,controller:null};Zt.set(this,n),t.addEventListener("input",Jt),t.addEventListener("input",e),t.autocomplete="off",t.spellcheck=!1}disconnectedCallback(){const t=this.input;if(!t)return;const e=Zt.get(this);e&&(Zt.delete(this),t.removeEventListener("input",Jt),t.removeEventListener("input",e.check),t.setCustomValidity(""))}attributeChangedCallback(t){if("required"===t){const t=this.input;if(!t)return;t.required=this.required}}static get observedAttributes(){return["required"]}get input(){const t=this.querySelector("input");return t instanceof HTMLInputElement?t:null}get src(){const t=this.getAttribute("src");if(!t)return"";const e=this.ownerDocument.createElement("a");return e.href=t,e.href}set src(t){this.setAttribute("src",t)}get csrf(){const t=this.querySelector("[data-csrf]");return this.getAttribute("csrf")||t instanceof HTMLInputElement&&t.value||""}set csrf(t){this.setAttribute("csrf",t)}get required(){return this.hasAttribute("required")}set required(t){t?this.setAttribute("required",""):this.removeAttribute("required")}}function Jt(t){const e=t.currentTarget;if(!(e instanceof HTMLInputElement))return;const n=e.closest("auto-check");if(!(n instanceof AutoCheckElement))return;const i=n.src,s=n.csrf,r=Zt.get(n);if(!i||!s||!r)return;let o="Verifying…";e.dispatchEvent(new CustomEvent("auto-check-start",{bubbles:!0,detail:{setValidity:t=>o=t}})),n.required&&e.setCustomValidity(o)}async function te(t){const e=t.input;if(!e)return;const n=t.src,i=t.csrf,s=Zt.get(t);if(!n||!i||!s)return void(t.required&&e.setCustomValidity(""));if(!e.value.trim())return void(t.required&&e.setCustomValidity(""));const r=new FormData;r.append("authenticity_token",i),r.append("value",e.value),e.dispatchEvent(new CustomEvent("auto-check-send",{bubbles:!0,detail:{body:r}})),s.controller?s.controller.abort():t.dispatchEvent(new CustomEvent("loadstart")),s.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};try{const i=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(i){throw"AbortError"!==i.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),i}}(t,n,{credentials:"same-origin",signal:s.controller.signal,method:"POST",body:r});i.ok?function(t,e,n){n&&e.setCustomValidity("");e.dispatchEvent(new CustomEvent("auto-check-success",{bubbles:!0,detail:{response:t.clone()}}))}(i,e,t.required):function(t,e,n){let i="Validation failed";e.dispatchEvent(new CustomEvent("auto-check-error",{bubbles:!0,detail:{response:t.clone(),setValidity:t=>i=t}})),n&&e.setCustomValidity(i)}(i,e,t.required),s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0}))}catch(o){"AbortError"!==o.name&&(s.controller=null,e.dispatchEvent(new CustomEvent("auto-check-complete",{bubbles:!0})))}}window.customElements.get("auto-check")||(window.AutoCheckElement=AutoCheckElement,window.customElements.define("auto-check",AutoCheckElement));class ee extends CustomEvent{constructor(t,e){super(t,e),this.relatedTarget=e.relatedTarget}}const ne=new WeakMap;function ie(t,e){const n=new XMLHttpRequest;return n.open("GET",e,!0),n.setRequestHeader("Accept","text/fragment+html"),function(t,e){const n=ne.get(t);n&&n.abort();ne.set(t,e);const i=()=>ne.delete(t),s=function(t){return new Promise((e,n)=>{t.onload=function(){t.status>=200&&t.status<300?e(t.responseText):n(new Error(t.responseText))},t.onerror=n,t.send()})}(e);return s.then(i,i),s}(t,n)}function se(t,e){(function(t,e){const n=t.scrollTop,i=n+t.clientHeight,s=e.offsetTop,r=s+e.clientHeight;return s>=n&&r<=i})(t,e)||(t.scrollTop=e.offsetTop)}let re=!1;const oe=!!navigator.userAgent.match(/Macintosh/);function ae(t){if(t.shiftKey||t.metaKey||t.altKey)return;const e=t.currentTarget;if(!(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement))return;if(re)return;const n=document.getElementById(e.getAttribute("aria-owns")||"");if(n)switch(t.key){case"Enter":case"Tab":(function(t,e){const n=e.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||(n.click(),!0))})(0,n)&&t.preventDefault();break;case"Escape":ue(e,n);break;case"ArrowDown":le(e,n,1),t.preventDefault();break;case"ArrowUp":le(e,n,-1),t.preventDefault();break;case"n":oe&&t.ctrlKey&&(le(e,n,1),t.preventDefault());break;case"p":oe&&t.ctrlKey&&(le(e,n,-1),t.preventDefault())}}function ce(t){if(!(t.target instanceof Element))return;const e=t.target.closest('[role="option"]');e&&"true"!==e.getAttribute("aria-disabled")&&function(t){t.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(e)}function le(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const i=e.querySelector('[aria-selected="true"]'),s=Array.from(e.querySelectorAll('[role="option"]')),r=s.indexOf(i);let o=1===n?0:s.length-1;if(i&&r>=0){const t=r+n;t>=0&&t<s.length&&(o=t)}const a=s[o];if(a)for(const c of s)a===c?(t.setAttribute("aria-activedescendant",a.id),a.setAttribute("aria-selected","true"),se(e,a)):c.setAttribute("aria-selected","false")}function ue(t,e){t.removeAttribute("aria-activedescendant");for(const n of e.querySelectorAll('[aria-selected="true"]'))n.setAttribute("aria-selected","false")}function de(t){const e=t.currentTarget;if(!(e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement))return;re="compositionstart"===t.type;const n=document.getElementById(e.getAttribute("aria-owns")||"");n&&ue(e,n)}class he{constructor(t,e,n){this.container=t,this.input=e,this.results=n,this.results.hidden=!0,this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=function(t,e){let n;return function(){for(var i=arguments.length,s=new Array(i),r=0;r<i;r++)s[r]=arguments[r];clearTimeout(n),n=setTimeout(()=>{clearTimeout(n),t(...s)},e)}}(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}onKeydown(t){"Escape"===t.key&&this.container.open&&(this.container.open=!1,t.stopPropagation(),t.preventDefault())}onInputFocus(){this.fetchResults()}onInputBlur(){this.interactingWithList?this.interactingWithList=!1:this.container.open=!1}onCommit(t){let{target:e}=t;const n=e;if(!(n instanceof HTMLElement))return;if(this.container.open=!1,n instanceof HTMLAnchorElement)return;const i=n.getAttribute("data-autocomplete-value")||n.textContent;this.container.value=i}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id="".concat(this.results.id,"-option-").concat(t++)}fetchResults(){const t=this.input.value.trim();if(!t)return void(this.container.open=!1);const e=this.container.src;if(!e)return;const n=new URL(e,window.location.href),i=new URLSearchParams(n.search.slice(1));i.append("q",t),n.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),ie(this.input,n.toString()).then(t=>{this.results.innerHTML=t,this.identifyOptions();const e=!!this.results.querySelector('[role="option"]');this.container.open=e,this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){var t,e;this.results.hidden&&(t=this.input,e=this.results,t.addEventListener("compositionstart",de),t.addEventListener("compositionend",de),t.addEventListener("keydown",ae),e.addEventListener("click",ce),this.results.hidden=!1,this.container.setAttribute("aria-expanded","true"))}close(){var t,e;this.results.hidden||(t=this.input,e=this.results,t.removeAttribute("aria-activedescendant"),t.removeEventListener("compositionstart",de),t.removeEventListener("compositionend",de),t.removeEventListener("keydown",ae),e.removeEventListener("click",ce),this.results.hidden=!0,this.input.removeAttribute("aria-activedescendant"),this.container.setAttribute("aria-expanded","false"))}}const me=new WeakMap;class AutocompleteElement extends HTMLElement{constructor(){super()}connectedCallback(){const t=this.getAttribute("aria-owns");if(!t)return;const e=this.querySelector("input"),n=document.getElementById(t);e instanceof HTMLInputElement&&n&&(e.setAttribute("aria-owns",t),me.set(this,new he(this,e,n)),this.setAttribute("role","combobox"),this.setAttribute("aria-haspopup","listbox"),this.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-controls",t),n.setAttribute("role","listbox"))}disconnectedCallback(){const t=me.get(this);t&&(t.destroy(),me.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}static get observedAttributes(){return["open","value"]}attributeChangedCallback(t,e,n){if(e===n)return;const i=me.get(this);if(i)switch(t){case"open":null===n?i.close():i.open();break;case"value":null!==n&&(i.input.value=n),this.dispatchEvent(new ee("auto-complete-change",{bubbles:!0,relatedTarget:i.input}))}}}function fe(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.textContent);const e=getSelection();if(null==e)return Promise.reject(new Error);e.removeAllRanges();const n=document.createRange();return n.selectNodeContents(t),e.addRange(n),document.execCommand("copy"),e.removeAllRanges(),Promise.resolve()}function pe(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t);const e=document.body;if(!e)return Promise.reject(new Error);const n=function(t){const e=document.createElement("pre");return e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="5px",e.textContent=t,e}(t);return e.appendChild(n),fe(n),e.removeChild(n),Promise.resolve()}function ge(t){const e=t.getAttribute("for"),n=t.getAttribute("value");function i(){t.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n)pe(n).then(i);else if(e){const n=t.ownerDocument.getElementById(e);n&&(s=n,s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement?"hidden"===s.type?pe(s.value):function(t){if("clipboard"in navigator)return navigator.clipboard.writeText(t.value);t.select(),document.execCommand("copy");const e=getSelection();return null!=e&&e.removeAllRanges(),Promise.resolve()}(s):s instanceof HTMLAnchorElement&&s.hasAttribute("href")?pe(s.href):fe(s)).then(i)}var s}function ve(t){const e=t.currentTarget;e instanceof HTMLElement&&ge(e)}function be(t){if(" "===t.key||"Enter"===t.key){const e=t.currentTarget;e instanceof HTMLElement&&(t.preventDefault(),ge(e))}}function Ee(t){t.currentTarget.addEventListener("keydown",be)}function we(t){t.currentTarget.removeEventListener("keydown",be)}window.customElements.get("auto-complete")||(window.AutocompleteElement=AutocompleteElement,window.customElements.define("auto-complete",AutocompleteElement)),t("A",AutocompleteElement);class ClipboardCopyElement extends HTMLElement{constructor(){super(),this.addEventListener("click",ve),this.addEventListener("focus",Ee),this.addEventListener("blur",we)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}window.customElements.get("clipboard-copy")||(window.ClipboardCopyElement=ClipboardCopyElement,window.customElements.define("clipboard-copy",ClipboardCopyElement)),t("C",ClipboardCopyElement);function ye(t){let e=Array.from(t.querySelectorAll("[autofocus]")).filter(xe)[0];e||(e=t,t.setAttribute("tabindex","-1")),e.focus()}function Ae(t){const e=t.currentTarget;e instanceof Element&&("Escape"===t.key||"Esc"===t.key?(Le(e,!1),t.stopPropagation()):"Tab"===t.key&&function(t){if(!(t.currentTarget instanceof Element))return;const e=t.currentTarget.querySelector("details-dialog");if(!e)return;t.preventDefault();const n=Array.from(e.querySelectorAll("*")).filter(xe);if(0===n.length)return;const i=t.shiftKey?-1:1,s=e.contains(document.activeElement)?document.activeElement:null;let r=-1===i?-1:0;if(s){const t=n.indexOf(s);-1!==t&&(r=t+i)}r<0?r=n.length-1:r%=n.length;n[r].focus()}(t))}function xe(t){return t.tabIndex>=0&&!t.disabled&&function(t){return!t.hidden&&(!t.type||"hidden"!==t.type)&&(t.offsetWidth>0||t.offsetHeight>0)}(t)}function ke(t){const e=t.querySelector("details-dialog");return!(e instanceof DetailsDialogElement)||e.dispatchEvent(new CustomEvent("details-dialog-close",{bubbles:!0,cancelable:!0}))}function Te(t){if(!(t.currentTarget instanceof Element))return;const e=t.currentTarget.closest("details");e&&e.hasAttribute("open")&&(ke(e)||(t.preventDefault(),t.stopPropagation()))}function Me(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.querySelector("details-dialog");if(n instanceof DetailsDialogElement)if(e.hasAttribute("open"))document.activeElement&&_e.set(n,{details:e,activeElement:document.activeElement}),ye(n),e.addEventListener("keydown",Ae);else{for(const e of n.querySelectorAll("form"))e instanceof HTMLFormElement&&e.reset();const t=function(t,e){const n=_e.get(e);return n&&n.activeElement instanceof HTMLElement?n.activeElement:t.querySelector("summary")}(e,n);t&&t.focus(),e.removeEventListener("keydown",Ae)}}function Le(t,e){e!==t.hasAttribute("open")&&(e?t.setAttribute("open",""):ke(t)&&t.removeAttribute("open"))}function Ce(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.querySelector("details-dialog");if(!(n instanceof DetailsDialogElement))return;const i=n.querySelector("include-fragment:not([src])");if(!i)return;const s=n.src;null!==s&&(i.addEventListener("loadend",()=>{e.hasAttribute("open")&&ye(n)}),i.setAttribute("src",s))}function Se(t,e,n){Ie(t),e&&t.addEventListener("toggle",Ce,{once:!0}),e&&n&&t.addEventListener("mouseover",Ce,{once:!0})}function Ie(t){t.removeEventListener("toggle",Ce),t.removeEventListener("mouseover",Ce)}const _e=new WeakMap;class DetailsDialogElement extends HTMLElement{static get CLOSE_ATTR(){return"data-close-dialog"}static get CLOSE_SELECTOR(){return"[data-close-dialog]"}constructor(){super(),_e.set(this,{details:null,activeElement:null}),this.addEventListener("click",(function(t){let e=t.target;if(!(e instanceof Element))return;const n=e.closest("details");n&&e.closest("[data-close-dialog]")&&Le(n,!1)}))}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t)}get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}connectedCallback(){this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true");const t=_e.get(this);if(!t)return;const e=this.parentElement;if(!e)return;const n=e.querySelector("summary");n&&(n.hasAttribute("role")||n.setAttribute("role","button"),n.addEventListener("click",Te,{capture:!0})),e.addEventListener("toggle",Me),t.details=e,Se(e,this.src,this.preload)}disconnectedCallback(){const t=_e.get(this);if(!t)return;const e=t.details;if(!e)return;e.removeEventListener("toggle",Me),Ie(e);const n=e.querySelector("summary");n&&n.removeEventListener("click",Te,{capture:!0}),t.details=null}toggle(t){const e=_e.get(this);if(!e)return;const n=e.details;n&&Le(n,t)}static get observedAttributes(){return["src","preload"]}attributeChangedCallback(){const t=_e.get(this);if(!t)return;const e=t.details;e&&Se(e,this.src,this.preload)}}t("D",DetailsDialogElement),window.customElements.get("details-dialog")||(window.DetailsDialogElement=DetailsDialogElement,window.customElements.define("details-dialog",DetailsDialogElement));class DetailsMenuElement extends HTMLElement{constructor(){super()}get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const n=[qe(t,"compositionstart",t=>Ue(this,t)),qe(t,"compositionend",t=>Ue(this,t)),qe(t,"click",e=>Re(t,this,e)),qe(t,"change",e=>Re(t,this,e)),qe(t,"keydown",e=>function(t,e,n){if(!(n instanceof KeyboardEvent))return;if(t.querySelector("details[open]"))return;const i=De.get(e);if(!i||i.isComposing)return;const s=n.target instanceof Element&&"SUMMARY"===n.target.tagName;switch(n.key){case"Escape":t.hasAttribute("open")&&(je(t),n.preventDefault(),n.stopPropagation());break;case"ArrowDown":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Oe(t,!0);e&&e.focus(),n.preventDefault()}break;case"ArrowUp":{s&&!t.hasAttribute("open")&&t.setAttribute("open","");const e=Oe(t,!1);e&&e.focus(),n.preventDefault()}break;case"n":if(Pe&&n.ctrlKey){const e=Oe(t,!0);e&&e.focus(),n.preventDefault()}break;case"p":if(Pe&&n.ctrlKey){const e=Oe(t,!1);e&&e.focus(),n.preventDefault()}break;case" ":case"Enter":{const e=document.activeElement;e&&Ve(e)&&e.closest("details")===t&&(n.preventDefault(),n.stopPropagation(),e.click())}}}(t,this,e)),qe(t,"toggle",()=>Be(t,this),{once:!0}),qe(t,"toggle",()=>function(t){if(!t.hasAttribute("open"))return;for(const e of document.querySelectorAll("details[open] > details-menu")){const n=e.closest("details");n&&n!==t&&!n.contains(t)&&n.removeAttribute("open")}}(t)),this.preload?qe(t,"mouseover",()=>Be(t,this),{once:!0}):He,...Ne(t)];De.set(this,{subscriptions:n,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=De.get(this);if(t){De.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const De=new WeakMap,He={unsubscribe(){}};function qe(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return t.addEventListener(e,n,i),{unsubscribe:()=>{t.removeEventListener(e,n,i)}}}function Be(t,e){const n=e.getAttribute("src");if(!n)return;const i=De.get(e);if(!i)return;if(i.loaded)return;i.loaded=!0;const s=e.querySelector("include-fragment");s&&!s.hasAttribute("src")&&(s.addEventListener("loadend",()=>Fe(t)),s.setAttribute("src",n))}function Ne(t){let e=!1;return[qe(t,"mousedown",()=>e=!0),qe(t,"keydown",()=>e=!1),qe(t,"toggle",()=>{t.hasAttribute("open")&&(Fe(t)||e||function(t){const e=document.activeElement;if(e&&Ve(e)&&t.contains(e))return;const n=Oe(t,!0);n&&n.focus()}(t))})]}function Fe(t){if(!t.hasAttribute("open"))return!1;const e=t.querySelector("[autofocus]");return!!e&&(e.focus(),!0)}function Oe(t,e){const n=Array.from(t.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled]):not([aria-disabled="true"])')),i=document.activeElement,s=n.indexOf(i),r=e?n[s+1]:n[s-1],o=e?n[0]:n[n.length-1];return r||o}const Pe=navigator.userAgent.match(/Macintosh/);function Re(t,e,n){const i=n.target;if(i instanceof Element&&i.closest("details")===t)if("click"===n.type){const e=i.closest('[role="menuitem"], [role="menuitemradio"]'),n=e&&"LABEL"===e.tagName&&e.querySelector("input");e&&!n&&We(e,t)}else if("change"===n.type){const e=i.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');e&&We(e,t)}}function We(t,e){if(t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled"))return;const n=t.closest("details-menu");n&&n.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:t}}))&&(!function(t,e){const n=e.querySelector("[data-menu-button]");if(!n)return;const i=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-text")?t:t.querySelector("[data-menu-button-text]");return e?e.getAttribute("data-menu-button-text")||e.textContent:null}(t);if(i)n.textContent=i;else{const e=function(t){if(!t)return null;const e=t.hasAttribute("data-menu-button-contents")?t:t.querySelector("[data-menu-button-contents]");return e?e.innerHTML:null}(t);e&&(n.innerHTML=e)}}(t,e),function(t,e){for(const n of e.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const e=n.querySelector('input[type="radio"], input[type="checkbox"]');let i=n===t;e instanceof HTMLInputElement&&(i=e.indeterminate?"mixed":e.checked),n.setAttribute("aria-checked",i.toString())}}(t,e),"menuitemcheckbox"!==t.getAttribute("role")&&je(e),n.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:t}})))}function Ve(t){const e=t.getAttribute("role");return"menuitem"===e||"menuitemcheckbox"===e||"menuitemradio"===e}function je(t){if(!t.hasAttribute("open"))return;t.removeAttribute("open");const e=t.querySelector("summary");e&&e.focus()}function Ue(t,e){const n=De.get(t);n&&(n.isComposing="compositionstart"===e.type)}window.customElements.get("details-menu")||(window.DetailsMenuElement=DetailsMenuElement,window.customElements.define("details-menu",DetailsMenuElement));class $e{constructor(t,e){this.file=t,this.directory=e,this.state="pending",this.id=null,this.href=null,this.name=null,this.percent=0}static traverse(t,e){return function(t,e){if(e&&function(t){return t.items&&Array.from(t.items).some(t=>{const e=t.webkitGetAsEntry&&t.webkitGetAsEntry();return e&&e.isDirectory})}(t))return async function t(e,n){const i=[];for(const s of Ke(n))if(s.isDirectory)i.push(...await t(s.fullPath,await ze(s)));else{const t=await Ye(s);i.push(new $e(t,e))}return i}("",function(t){return Array.from(t.items).map(t=>t.webkitGetAsEntry()).filter(t=>null!=t)}(t));return Promise.resolve(Ke(Array.from(t.files)).map(t=>new $e(t)))}(t,e)}static from(t){const e=[];for(const n of t)if(n instanceof File)e.push(new $e(n));else{if(!(n instanceof $e))throw new Error("Unexpected type");e.push(n)}return e}get fullPath(){return this.directory?`${this.directory}/${this.file.name}`:this.file.name}isImage(){return["image/gif","image/png","image/jpg","image/jpeg"].indexOf(this.file.type)>-1}saving(t){if("pending"!==this.state&&"saving"!==this.state)throw new Error(`Unexpected transition from ${this.state} to saving`);this.state="saving",this.percent=t}saved(t){var e,n,i;if("pending"!==this.state&&"saving"!==this.state)throw new Error(`Unexpected transition from ${this.state} to saved`);this.state="saved",this.id=null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null,this.href=null!==(n=null==t?void 0:t.href)&&void 0!==n?n:null,this.name=null!==(i=null==t?void 0:t.name)&&void 0!==i?i:null}isPending(){return"pending"===this.state}isSaving(){return"saving"===this.state}isSaved(){return"saved"===this.state}}function Ke(t){return Array.from(t).filter(t=>!function(t){return t.name.startsWith(".")}(t))}function Ye(t){return new Promise((function(e,n){t.file(e,n)}))}function ze(t){return new Promise((function(e,n){const i=[],s=t.createReader(),r=()=>{s.readEntries(t=>{t.length>0?(i.push(...t),r()):e(i)},n)};r()}))}t("k",$e);class FileAttachmentElement extends HTMLElement{constructor(){super(),this.addEventListener("dragenter",Qe),this.addEventListener("dragover",Qe),this.addEventListener("dragleave",Ze),this.addEventListener("drop",Je),this.addEventListener("paste",en),this.addEventListener("change",nn)}get directory(){return this.hasAttribute("directory")}set directory(t){t?this.setAttribute("directory",""):this.removeAttribute("directory")}async attach(t){const e=t instanceof DataTransfer?await $e.traverse(t,this.directory):$e.from(t);this.dispatchEvent(new CustomEvent("file-attachment-accept",{bubbles:!0,cancelable:!0,detail:{attachments:e}}))&&e.length&&this.dispatchEvent(new CustomEvent("file-attachment-accepted",{bubbles:!0,detail:{attachments:e}}))}}function Xe(t){return Array.from(t.types).indexOf("Files")>=0}let Ge=null;function Qe(t){const e=t.currentTarget;Ge&&clearTimeout(Ge),Ge=window.setTimeout(()=>e.removeAttribute("hover"),200);const n=t.dataTransfer;n&&Xe(n)&&(n.dropEffect="copy",e.setAttribute("hover",""),t.stopPropagation(),t.preventDefault())}function Ze(t){t.dataTransfer&&(t.dataTransfer.dropEffect="none"),t.currentTarget.removeAttribute("hover"),t.stopPropagation(),t.preventDefault()}function Je(t){const e=t.currentTarget;if(!(e instanceof FileAttachmentElement))return;e.removeAttribute("hover");const n=t.dataTransfer;n&&Xe(n)&&(e.attach(n),t.stopPropagation(),t.preventDefault())}const tn=/^image\/(gif|png|jpeg)$/;function en(t){if(!t.clipboardData)return;if(!t.clipboardData.items)return;const e=t.currentTarget;if(!(e instanceof FileAttachmentElement))return;const n=function(t){for(const e of t)if(tn.test(e.type))return e.getAsFile();return null}(t.clipboardData.items);if(!n)return;const i=[n];e.attach(i),t.preventDefault()}function nn(t){const e=t.currentTarget;if(!(e instanceof FileAttachmentElement))return;const n=t.target;if(!(n instanceof HTMLInputElement))return;const i=e.getAttribute("input");if(!i||n.id!==i)return;const s=n.files;s&&0!==s.length&&(e.attach(s),n.value="")}window.customElements.get("file-attachment")||(window.FileAttachmentElement=FileAttachmentElement,window.customElements.define("file-attachment",FileAttachmentElement)),t("l",FileAttachmentElement);class FilterInputElement extends HTMLElement{constructor(){super(),this.currentQuery=null,this.filter=null,this.debounceInputChange=function(t){let e;return function(){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),t()},300)}}(()=>sn(this,!0)),this.boundFilterResults=()=>{sn(this,!1)}}static get observedAttributes(){return["aria-owns"]}attributeChangedCallback(t,e){e&&"aria-owns"===t&&sn(this,!1)}connectedCallback(){const t=this.input;t&&(t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false"),t.addEventListener("focus",this.boundFilterResults),t.addEventListener("change",this.boundFilterResults),t.addEventListener("input",this.debounceInputChange))}disconnectedCallback(){const t=this.input;t&&(t.removeEventListener("focus",this.boundFilterResults),t.removeEventListener("change",this.boundFilterResults),t.removeEventListener("input",this.debounceInputChange))}get input(){const t=this.querySelector("input");return t instanceof HTMLInputElement?t:null}reset(){const t=this.input;t&&(t.value="",t.dispatchEvent(new Event("change",{bubbles:!0})))}}async function sn(t,e=!1){const n=t.input;if(!n)return;const i=n.value.trim(),s=t.getAttribute("aria-owns");if(!s)return;const r=document.getElementById(s);if(!r)return;const o=r.hasAttribute("data-filter-list")?r:r.querySelector("[data-filter-list]");if(!o)return;if(t.dispatchEvent(new CustomEvent("filter-input-start",{bubbles:!0})),e&&t.currentQuery===i)return;t.currentQuery=i;const a=t.filter||rn,c=o.childElementCount;let l=0,u=!1;for(const m of Array.from(o.children)){if(!(m instanceof HTMLElement))continue;const t=a(m,on(m),i);!0===t.hideNew&&(u=t.hideNew),m.hidden=!t.match,t.match&&l++}const d=r.querySelector("[data-filter-new-item]"),h=!!d&&i.length>0&&!u;d instanceof HTMLElement&&(d.hidden=!h,h&&function(t,e){const n=t.querySelector("[data-filter-new-item-text]");n&&(n.textContent=e);const i=t.querySelector("[data-filter-new-item-value]");(i instanceof HTMLInputElement||i instanceof HTMLButtonElement)&&(i.value=e)}(d,i)),function(t,e){const n=t.querySelector("[data-filter-empty-state]");n instanceof HTMLElement&&(n.hidden=e)}(r,l>0||h),t.dispatchEvent(new CustomEvent("filter-input-updated",{bubbles:!0,detail:{count:l,total:c}}))}function rn(t,e,n){return{match:-1!==e.toLowerCase().indexOf(n.toLowerCase()),hideNew:e===n}}function on(t){return((t.querySelector("[data-filter-item-text]")||t).textContent||"").trim()}t("F",FilterInputElement),window.customElements.get("filter-input")||(window.FilterInputElement=FilterInputElement,window.customElements.define("filter-input",FilterInputElement));const an=new Set(["👋","🤚","🖐️","✋","🖖","👌","🤏","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","🖕","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","👐","🤲","🙏","✍️","💅","🤳","💪","🦵","🦶","👂","🦻","👃","👶","🧒","👦","👧","🧑","👱","👨","🧔","👱♂️","👨🦰","👨🦱","👨🦳","👨🦲","👩","👱♀️","👩🦰","👩🦱","👩🦳","👩🦲","🧓","👴","👵","🙍","🙍♂️","🙍♀️","🙎","🙎♂️","🙎♀️","🙅","🙅♂️","🙅♀️","🙆","🙆♂️","🙆♀️","💁","💁♂️","💁♀️","🙋","🙋♂️","🙋♀️","🧏","🧏♂️","🧏♀️","🙇","🙇♂️","🙇♀️","🤦","🤦♂️","🤦♀️","🤷","🤷♂️","🤷♀️","👨⚕️","👩⚕️","👨🎓","👩🎓","👨🏫","👩🏫","👨⚖️","👩⚖️","👨🌾","👩🌾","👨🍳","👩🍳","👨🔧","👩🔧","👨🏭","👩🏭","👨💼","👩💼","👨🔬","👩🔬","👨💻","👩💻","👨🎤","👩🎤","👨🎨","👩🎨","👨✈️","👩✈️","👨🚀","👩🚀","👨🚒","👩🚒","👮","👮♂️","👮♀️","🕵️","🕵️♂️","🕵️♀️","💂","💂♂️","💂♀️","👷","👷♂️","👷♀️","🤴","👸","👳","👳♂️","👳♀️","👲","🧕","🤵","👰","🤰","🤱","👼","🎅","🤶","🦸","🦸♂️","🦸♀️","🦹","🦹♂️","🦹♀️","🧙","🧙♂️","🧙♀️","🧚","🧚♂️","🧚♀️","🧛","🧛♂️","🧛♀️","🧜","🧜♂️","🧜♀️","🧝","🧝♂️","🧝♀️","💆","💆♂️","💆♀️","💇","💇♂️","💇♀️","🚶","🚶♂️","🚶♀️","🧍","🧍♂️","🧍♀️","🧎","🧎♂️","🧎♀️","👨🦯","👩🦯","👨🦼","👩🦼","👨🦽","👩🦽","🏃","🏃♂️","🏃♀️","💃","🕺","🕴️","🧖","🧖♂️","🧖♀️","🧗","🧗♂️","🧗♀️","🏇","🏂","🏌️","🏌️♂️","🏌️♀️","🏄","🏄♂️","🏄♀️","🚣","🚣♂️","🚣♀️","🏊","🏊♂️","🏊♀️","⛹️","⛹️♂️","⛹️♀️","🏋️","🏋️♂️","🏋️♀️","🚴","🚴♂️","🚴♀️","🚵","🚵♂️","🚵♀️","🤸","🤸♂️","🤸♀️","🤽","🤽♂️","🤽♀️","🤾","🤾♂️","🤾♀️","🤹","🤹♂️","🤹♀️","🧘","🧘♂️","🧘♀️","🛀","🛌","🧑🤝🧑","👭","👫","👬"]);function cn(t){return an.has(t)}function ln(t){return[...t].filter(t=>!dn(t.codePointAt(0))).join("")}function un(t,e){const n=[...t].map(t=>t.codePointAt(0));return n[1]&&(dn(n[1])||65039===n[1])?n[1]=e:n.splice(1,0,e),String.fromCodePoint(...n)}function dn(t){return t>=127995&&t<=127999}function hn(t){switch(t){case 1:return 127995;case 2:return 127996;case 3:return 127997;case 4:return 127998;case 5:return 127999;default:return null}}class GEmojiElement extends HTMLElement{get image(){return this.firstElementChild instanceof HTMLImageElement?this.firstElementChild:null}get tone(){return(this.getAttribute("tone")||"").split(" ").map(t=>{const e=parseInt(t,10);return e>=0&&e<=5?e:0}).join(" ")}set tone(t){this.setAttribute("tone",t)}connectedCallback(){if(null===this.image&&!function(){const t=/\bWindows NT 6.1\b/.test(navigator.userAgent),e=/\bWindows NT 6.2\b/.test(navigator.userAgent),n=/\bWindows NT 6.3\b/.test(navigator.userAgent),i=/\bFreeBSD\b/.test(navigator.userAgent),s=/\bLinux\b/.test(navigator.userAgent);return!(t||e||n||s||i)}()){this.textContent="";const t=function(t){const e=document.createElement("img");return e.className="emoji",e.alt=t.getAttribute("alias")||"",e.height=20,e.width=20,e}(this);t.src=this.getAttribute("fallback-src")||"",this.appendChild(t)}this.hasAttribute("tone")&&mn(this)}static get observedAttributes(){return["tone"]}attributeChangedCallback(t){switch(t){case"tone":mn(this)}}}function mn(t){if(t.image)return;const e=t.tone.split(" ").map(t=>parseInt(t,10));if(0===e.length)t.textContent=ln(t.textContent);else if(1===e.length){const n=e[0];t.textContent=0===n?ln(t.textContent):function(t,e){const n=ln(t);if(!cn(n))return t;const i=hn(e);return i?n.split("").map(t=>cn(t)?un(t,i):t).join(""):t}(t.textContent,n)}else t.textContent=function(t,e){const n=ln(t);if(!cn(n))return t;const i=e.map(t=>hn(t));return n.split("").map(t=>{if(!cn(t))return t;const e=i.shift();return e?un(t,e):t}).join("")}(t.textContent,e)}window.customElements.get("g-emoji")||(window.GEmojiElement=GEmojiElement,window.customElements.define("g-emoji",GEmojiElement));const fn=document.createElement("template");fn.innerHTML='\n <div class="crop-wrapper">\n <img width="100%" class="crop-image" alt="">\n <div class="crop-container">\n <div data-crop-box class="crop-box">\n <div class="crop-outline"></div>\n <div data-direction="nw" class="handle nw"></div>\n <div data-direction="ne" class="handle ne"></div>\n <div data-direction="sw" class="handle sw"></div>\n <div data-direction="se" class="handle se"></div>\n </div>\n </div>\n </div>\n';const pn=new WeakMap,gn=new WeakMap,vn=new WeakMap;function bn(t){const e=t.currentTarget;if(!(e instanceof ImageCropElement))return;const{box:n,image:i}=vn.get(e)||{};let s=0,r=0;if("keydown"===t.type)"ArrowUp"===t.key?r=-1:"ArrowDown"===t.key?r=1:"ArrowLeft"===t.key?s=-1:"ArrowRight"===t.key&&(s=1);else if(gn.has(e)&&t instanceof MouseEvent){const n=gn.get(e);if(!n)return;s=t.pageX-n.dragStartX,r=t.pageY-n.dragStartY}if(0!==s||0!==r){const t=Math.min(Math.max(0,n.offsetLeft+s),i.width-n.offsetWidth),o=Math.min(Math.max(0,n.offsetTop+r),i.height-n.offsetHeight);n.style.left="".concat(t,"px"),n.style.top="".concat(o,"px"),Tn(e,{x:t,y:o,width:n.offsetWidth,height:n.offsetHeight})}t instanceof MouseEvent&&gn.set(e,{dragStartX:t.pageX,dragStartY:t.pageY})}function En(t){const e=t.target;if(!(e instanceof HTMLElement))return;const n=e.closest("image-crop");if(!(n instanceof ImageCropElement))return;const{box:i}=vn.get(n)||{},s=n.getBoundingClientRect();let r,o,a;if(t.key){if("Escape"===t.key)return xn(n);if("-"===t.key&&(a=-10),"="===t.key&&(a=10),!a)return;r=i.offsetWidth+a,o=i.offsetHeight+a,pn.set(n,{startX:i.offsetLeft,startY:i.offsetTop})}else if(t instanceof MouseEvent){const e=pn.get(n);if(!e)return;r=t.pageX-e.startX-s.left-window.pageXOffset,o=t.pageY-e.startY-s.top-window.pageYOffset}r&&o&&yn(n,r,o,!(t instanceof KeyboardEvent))}function wn(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=e.closest("image-crop");if(!(n instanceof ImageCropElement))return;const{box:i}=vn.get(n)||{},s=t.target;if(s instanceof HTMLElement)if(s.hasAttribute("data-direction")){const e=s.getAttribute("data-direction");n.addEventListener("mousemove",En),["nw","se"].indexOf(e)>=0&&n.classList.add("nwse"),["ne","sw"].indexOf(e)>=0&&n.classList.add("nesw"),pn.set(n,{startX:i.offsetLeft+(["se","ne"].indexOf(e)>=0?0:i.offsetWidth),startY:i.offsetTop+(["se","sw"].indexOf(e)>=0?0:i.offsetHeight)}),En(t)}else n.addEventListener("mousemove",bn)}function yn(t,e,n){let i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=Math.max(Math.abs(e),Math.abs(n),10);const r=pn.get(t);if(!r)return;const{box:o,image:a}=vn.get(t)||{};s=Math.min(s,n>0?a.height-r.startY:r.startY,e>0?a.width-r.startX:r.startX);const c=i?Math.round(Math.max(0,e>0?r.startX:r.startX-s)):o.offsetLeft,l=i?Math.round(Math.max(0,n>0?r.startY:r.startY-s)):o.offsetTop;o.style.left="".concat(c,"px"),o.style.top="".concat(l,"px"),o.style.width="".concat(s,"px"),o.style.height="".concat(s,"px"),Tn(t,{x:c,y:l,width:s,height:s})}function An(t){const e=t.currentTarget;if(!(e instanceof HTMLElement))return;const n=e.closest("image-crop");n instanceof ImageCropElement&&(n.loaded=!0,xn(n))}function xn(t){const{image:e}=vn.get(t)||{},n=Math.round(e.clientWidth>e.clientHeight?e.clientHeight:e.clientWidth);pn.set(t,{startX:(e.clientWidth-n)/2,startY:(e.clientHeight-n)/2}),yn(t,n,n)}function kn(t){const e=t.currentTarget;e instanceof ImageCropElement&&(gn.delete(e),e.classList.remove("nwse","nesw"),e.removeEventListener("mousemove",En),e.removeEventListener("mousemove",bn))}function Tn(t,e){const{image:n}=vn.get(t)||{},i=n.naturalWidth/n.width;for(const s in e){const n=Math.round(e[s]*i);e[s]=n;const r=t.querySelector("[data-image-crop-input='".concat(s,"']"));r instanceof HTMLInputElement&&(r.value=n.toString())}t.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:e}))}class ImageCropElement extends HTMLElement{connectedCallback(){if(vn.has(this))return;this.appendChild(document.importNode(fn.content,!0));const t=this.querySelector("[data-crop-box]");if(!(t instanceof HTMLElement))return;const e=this.querySelector("img");e instanceof HTMLImageElement&&(vn.set(this,{box:t,image:e}),e.addEventListener("load",An),this.addEventListener("mouseleave",kn),this.addEventListener("mouseup",kn),t.addEventListener("mousedown",wn),this.addEventListener("keydown",bn),this.addEventListener("keydown",En),this.src&&(e.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,n){const{image:i}=vn.get(this)||{};"src"===t&&(this.loaded=!1,i&&(i.src=n))}}window.customElements.get("image-crop")||(window.ImageCropElement=ImageCropElement,window.customElements.define("image-crop",ImageCropElement));const Mn=new WeakMap;function Ln(t,e){setTimeout((function(){e.dispatchEvent(new Event(t))}),0)}function Cn(t){return Sn(t).then((function(e){const n=t.parentNode;n&&(t.insertAdjacentHTML("afterend",e),n.removeChild(t))}),(function(){t.classList.add("is-error")}))}function Sn(t){const e=t.src;let n=Mn.get(t);return n&&n.src===e?n.data:(n=e?t.load():Promise.reject(new Error("missing src")),Mn.set(t,{src:e,data:n}),n)}class IncludeFragmentElement extends HTMLElement{constructor(){super()}static get observedAttributes(){return["src"]}get src(){const t=this.getAttribute("src");if(t){const e=this.ownerDocument.createElement("a");return e.href=t,e.href}return""}set src(t){this.setAttribute("src",t)}get accept(){return this.getAttribute("accept")}set accept(t){this.setAttribute("accept",t)}get data(){return Sn(this)}attributeChangedCallback(t){"src"===t&&this._attached&&Cn(this)}connectedCallback(){this._attached=!0,this.src&&Cn(this)}disconnectedCallback(){this._attached=!1}request(){const t=this.src;if(!t)throw new Error("missing src");return new Request(t,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"text/html"}})}load(){return Promise.resolve().then(()=>(Ln("loadstart",this),this.fetch(this.request()))).then(t=>{if(200!==t.status)throw new Error("Failed to load resource: the server responded with a status of ".concat(t.status));const e=t.headers.get("Content-Type");if(!(n=this.accept,n&&n.split(",").find(t=>t.match(/^\s*\*\/\*/))||e&&e.includes(this.accept?this.accept:"text/html")))throw new Error("Failed to load resource: expected ".concat(this.accept||"text/html"," but was ").concat(e));var n;return t}).then(t=>t.text()).then(t=>(Ln("load",this),Ln("loadend",this),t),t=>{throw Ln("error",this),Ln("loadend",this),t})}fetch(t){return fetch(t)}}function In(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}t("I",IncludeFragmentElement),window.customElements.get("include-fragment")||(window.IncludeFragmentElement=IncludeFragmentElement,window.customElements.define("include-fragment",IncludeFragmentElement));const _n=["[data-md-button]","md-header","md-bold","md-italic","md-quote","md-code","md-link","md-image","md-unordered-list","md-ordered-list","md-task-list","md-mention","md-ref"];function Dn(t){const e=[];for(const n of t.querySelectorAll(_n.join(", ")))n.hidden||n.offsetWidth<=0&&n.offsetHeight<=0||n.closest("markdown-toolbar")===t&&e.push(n);return e}const Hn=new WeakMap;class MarkdownButtonElement extends HTMLElement{constructor(){super();const t=()=>{const t=Hn.get(this);t&&Kn(this,t)};var e;this.addEventListener("keydown",(e=t,function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),e(t))})),this.addEventListener("click",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","button")}click(){const t=Hn.get(this);t&&Kn(this,t)}}class MarkdownHeaderButtonElement extends MarkdownButtonElement{constructor(){super();const t=parseInt(this.getAttribute("level")||3,10);if(t<1||t>6)return;const e="".concat("#".repeat(t)," ");Hn.set(this,{prefix:e})}}window.customElements.get("md-header")||(window.MarkdownHeaderButtonElement=MarkdownHeaderButtonElement,window.customElements.define("md-header",MarkdownHeaderButtonElement));class MarkdownBoldButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"**",suffix:"**",trimFirst:!0})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","b")}}window.customElements.get("md-bold")||(window.MarkdownBoldButtonElement=MarkdownBoldButtonElement,window.customElements.define("md-bold",MarkdownBoldButtonElement));class MarkdownItalicButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"_",suffix:"_",trimFirst:!0})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","i")}}window.customElements.get("md-italic")||(window.MarkdownItalicButtonElement=MarkdownItalicButtonElement,window.customElements.define("md-italic",MarkdownItalicButtonElement));class MarkdownQuoteButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"> ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-quote")||(window.MarkdownQuoteButtonElement=MarkdownQuoteButtonElement,window.customElements.define("md-quote",MarkdownQuoteButtonElement));class MarkdownCodeButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"})}}window.customElements.get("md-code")||(window.MarkdownCodeButtonElement=MarkdownCodeButtonElement,window.customElements.define("md-code",MarkdownCodeButtonElement));class MarkdownLinkButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","k")}}window.customElements.get("md-link")||(window.MarkdownLinkButtonElement=MarkdownLinkButtonElement,window.customElements.define("md-link",MarkdownLinkButtonElement));class MarkdownImageButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"![",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-image")||(window.MarkdownImageButtonElement=MarkdownImageButtonElement,window.customElements.define("md-image",MarkdownImageButtonElement));class MarkdownUnorderedListButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"- ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-unordered-list")||(window.MarkdownUnorderedListButtonElement=MarkdownUnorderedListButtonElement,window.customElements.define("md-unordered-list",MarkdownUnorderedListButtonElement));class MarkdownOrderedListButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"1. ",multiline:!0,orderedList:!0})}}window.customElements.get("md-ordered-list")||(window.MarkdownOrderedListButtonElement=MarkdownOrderedListButtonElement,window.customElements.define("md-ordered-list",MarkdownOrderedListButtonElement));class MarkdownTaskListButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0})}connectedCallback(){super.connectedCallback(),this.setAttribute("hotkey","L")}}window.customElements.get("md-task-list")||(window.MarkdownTaskListButtonElement=MarkdownTaskListButtonElement,window.customElements.define("md-task-list",MarkdownTaskListButtonElement));class MarkdownMentionButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"@",prefixSpace:!0})}}window.customElements.get("md-mention")||(window.MarkdownMentionButtonElement=MarkdownMentionButtonElement,window.customElements.define("md-mention",MarkdownMentionButtonElement));class MarkdownRefButtonElement extends MarkdownButtonElement{constructor(){super(),Hn.set(this,{prefix:"#",prefixSpace:!0})}}window.customElements.get("md-ref")||(window.MarkdownRefButtonElement=MarkdownRefButtonElement,window.customElements.define("md-ref",MarkdownRefButtonElement));const qn=navigator.userAgent.match(/Macintosh/)?"Meta":"Control";class MarkdownToolbarElement extends HTMLElement{constructor(){super()}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.addEventListener("keydown",Nn);const t=On.bind(null,this);this.field&&(this.field.addEventListener("keydown",t),Fn.set(this,t)),this.setAttribute("tabindex","0"),this.addEventListener("focus",Bn,{once:!0})}disconnectedCallback(){const t=Fn.get(this);t&&this.field&&(this.field.removeEventListener("keydown",t),Fn.delete(this)),this.removeEventListener("keydown",Nn)}get field(){const t=this.getAttribute("for");if(!t)return;const e=document.getElementById(t);return e instanceof HTMLTextAreaElement?e:null}}function Bn(t){let{target:e}=t;if(!(e instanceof Element))return;e.removeAttribute("tabindex");let n="0";for(const i of Dn(e))i.setAttribute("tabindex",n),"0"===n&&(i.focus(),n="-1")}function Nn(t){const e=t.key;if("ArrowRight"!==e&&"ArrowLeft"!==e&&"Home"!==e&&"End"!==e)return;const n=t.currentTarget;if(!(n instanceof HTMLElement))return;const i=Dn(n),s=i.indexOf(t.target),r=i.length;if(-1===s)return;let o=0;"ArrowLeft"===e&&(o=s-1),"ArrowRight"===e&&(o=s+1),"End"===e&&(o=r-1),o<0&&(o=r-1),o>r-1&&(o=0);for(let a=0;a<r;a+=1)i[a].setAttribute("tabindex",a===o?"0":"-1");t.preventDefault(),i[o].focus()}const Fn=new WeakMap;function On(t,e){if(e.metaKey&&"Meta"===qn||e.ctrlKey&&"Control"===qn){const n=t.querySelector('[hotkey="'.concat(e.key,'"]'));n&&(n.click(),e.preventDefault())}}function Pn(t){return t.trim().split("\n").length>1}function Rn(t,e){return Array(e+1).join(t)}function Wn(t,e){let n=e;for(;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}function Vn(t,e,n){let i=e;const s=n?/\n/:/\s/;for(;t[i]&&!t[i].match(s);)i++;return i}window.customElements.get("markdown-toolbar")||(window.MarkdownToolbarElement=MarkdownToolbarElement,window.customElements.define("markdown-toolbar",MarkdownToolbarElement));let jn=null;function Un(t,e){const n=t.value.slice(t.selectionStart,t.selectionEnd);let i;i=e.orderedList?function(t){const e=/^\d+\.\s+/,n=t.selectionStart===t.selectionEnd;let i,s,r,o,a=t.value.slice(t.selectionStart,t.selectionEnd),c=a,l=a.split("\n");if(n){const e=t.value.slice(0,t.selectionStart).split(/\n/);r=t.selectionStart-e[e.length-1].length,o=Vn(t.value,t.selectionStart,!0),c=t.value.slice(r,o)}const u=c.split("\n");if(u.every(t=>e.test(t))){if(l=u.map(t=>t.replace(e,"")),a=l.join("\n"),n&&r&&o){const e=u[0].length-l[0].length;s=i=t.selectionStart-e,t.selectionStart=r,t.selectionEnd=o}}else{l=function(){let t,e,n;const i=[];for(n=t=0,e=l.length;t<e;n=++t){const t=l[n];i.push("".concat(n+1,". ").concat(t))}return i}(),a=l.join("\n");const{newlinesToAppend:e,newlinesToPrepend:r}=$n(t);s=t.selectionStart+e.length,i=s+a.length,n&&(s=i),a=e+a+r}return{text:a,selectionStart:s,selectionEnd:i}}(t):e.multiline&&Pn(n)?function(t,e){const{prefix:n,suffix:i,surroundWithNewlines:s}=e;let r=t.value.slice(t.selectionStart,t.selectionEnd),o=t.selectionStart,a=t.selectionEnd;const c=r.split("\n");if(c.every(t=>t.startsWith(n)&&t.endsWith(i)))r=c.map(t=>t.slice(n.length,t.length-i.length)).join("\n"),a=o+r.length;else if(r=c.map(t=>n+t+i).join("\n"),s){const{newlinesToAppend:e,newlinesToPrepend:n}=$n(t);o+=e.length,a=o+r.length,r=e+r+n}return{text:r,selectionStart:o,selectionEnd:a}}(t,e):function(t,e){let n,i;const{prefix:s,suffix:r,blockPrefix:o,blockSuffix:a,replaceNext:c,prefixSpace:l,scanFor:u,surroundWithNewlines:d}=e,h=t.selectionStart,m=t.selectionEnd;let f=t.value.slice(t.selectionStart,t.selectionEnd),p=Pn(f)&&o.length>0?"".concat(o,"\n"):s,g=Pn(f)&&a.length>0?"\n".concat(a):r;if(l){const e=t.value[t.selectionStart-1];0===t.selectionStart||null==e||e.match(/\s/)||(p=" ".concat(p))}f=function(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.selectionStart===t.selectionEnd)t.selectionStart=Wn(t.value,t.selectionStart),t.selectionEnd=Vn(t.value,t.selectionEnd,i);else{const i=t.selectionStart-e.length,s=t.selectionEnd+n.length,r=t.value.slice(i,t.selectionStart)===e,o=t.value.slice(t.selectionEnd,s)===n;r&&o&&(t.selectionStart=i,t.selectionEnd=s)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,p,g,e.multiline);let v=t.selectionStart,b=t.selectionEnd;const E=c.length>0&&g.indexOf(c)>-1&&f.length>0;if(d){const e=$n(t);n=e.newlinesToAppend,i=e.newlinesToPrepend,p=n+s,g+=i}if(f.startsWith(p)&&f.endsWith(g)){const t=f.slice(p.length,f.length-g.length);if(h===m){let e=h-p.length;e=Math.max(e,v),e=Math.min(e,v+t.length),v=b=e}else b=v+t.length;return{text:t,selectionStart:v,selectionEnd:b}}if(E){if(u.length>0&&f.match(u)){g=g.replace(c,f);const t=p+g;return v=b=v+p.length,{text:t,selectionStart:v,selectionEnd:b}}{const t=p+f+g;return v=v+p.length+f.length+g.indexOf(c),b=v+c.length,{text:t,selectionStart:v,selectionEnd:b}}}{let t=p+f+g;v=h+p.length,b=m+p.length;const n=f.match(/^\s*|\s*$/g);if(e.trimFirst&&n){const e=n[0]||"",i=n[1]||"";t=e+p+f.trim()+g+i,v+=e.length,b-=i.length}return{text:t,selectionStart:v,selectionEnd:b}}}(t,e),function(t,e){let{text:n,selectionStart:i,selectionEnd:s}=e;const r=t.selectionStart,o=t.value.slice(0,r),a=t.value.slice(t.selectionEnd);if(null===jn||!0===jn){t.contentEditable="true";try{jn=document.execCommand("insertText",!1,n)}catch(c){jn=!1}t.contentEditable="false"}if(jn&&!t.value.slice(0,t.selectionStart).endsWith(n)&&(jn=!1),!jn){try{document.execCommand("ms-beginUndoUnit")}catch(l){}t.value=o+n+a;try{document.execCommand("ms-endUndoUnit")}catch(l){}t.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}null!=i&&null!=s?t.setSelectionRange(i,s):t.setSelectionRange(r,t.selectionEnd)}(t,i)}function $n(t){const e=t.value.slice(0,t.selectionStart),n=t.value.slice(t.selectionEnd),i=e.match(/\n*$/),s=n.match(/^\n*/),r=i?i[0].length:0,o=s?s[0].length:0;let a,c;return e.match(/\S/)&&r<2&&(a=Rn("\n",2-r)),n.match(/\S/)&&o<2&&(c=Rn("\n",2-o)),null==a&&(a=""),null==c&&(c=""),{newlinesToAppend:a,newlinesToPrepend:c}}function Kn(t,e){const n=t.closest("markdown-toolbar");if(!(n instanceof MarkdownToolbarElement))return;const i=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable})))),i.forEach((function(e){In(t,e,n[e])}))}return t}({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,trimFirst:!1},e),s=n.field;s&&(s.focus(),Un(s,i))}t("M",MarkdownToolbarElement);const Yn=new WeakMap;class RemoteInputElement extends HTMLElement{constructor(){super();const t=zn.bind(null,this,!0),e={currentQuery:null,oninput:Xn(t),fetch:t,controller:null};Yn.set(this,e)}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e){e&&"src"===t&&zn(this,!1)}connectedCallback(){const t=this.input;if(!t)return;t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false");const e=Yn.get(this);e&&(t.addEventListener("focus",e.fetch),t.addEventListener("change",e.fetch),t.addEventListener("input",e.oninput))}disconnectedCallback(){const t=this.input;if(!t)return;const e=Yn.get(this);e&&(t.removeEventListener("focus",e.fetch),t.removeEventListener("change",e.fetch),t.removeEventListener("input",e.oninput))}get input(){const t=this.querySelector("input, textarea");return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement?t:null}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}}async function zn(t,e){const n=t.input;if(!n)return;const i=Yn.get(t);if(!i)return;const s=n.value;if(e&&i.currentQuery===s)return;i.currentQuery=s;const r=t.src;if(!r)return;const o=document.getElementById(t.getAttribute("aria-owns")||"");if(!o)return;const a=new URL(r,window.location.href),c=new URLSearchParams(a.search);let l;c.append(t.getAttribute("param")||"q",s),a.search=c.toString(),i.controller?i.controller.abort():(t.dispatchEvent(new CustomEvent("loadstart")),t.setAttribute("loading","")),i.controller="AbortController"in window?new AbortController:{signal:null,abort(){}};let u="";try{l=await async function(t,e,n){try{const i=await fetch(e,n);return t.dispatchEvent(new CustomEvent("load")),t.dispatchEvent(new CustomEvent("loadend")),i}catch(i){throw"AbortError"!==i.name&&(t.dispatchEvent(new CustomEvent("error")),t.dispatchEvent(new CustomEvent("loadend"))),i}}(t,a.toString(),{signal:i.controller.signal,credentials:"same-origin",headers:{accept:"text/fragment+html"}}),u=await l.text(),t.removeAttribute("loading"),i.controller=null}catch(d){return void("AbortError"!==d.name&&(t.removeAttribute("loading"),i.controller=null))}l&&l.ok?(o.innerHTML=u,t.dispatchEvent(new CustomEvent("remote-input-success",{bubbles:!0}))):t.dispatchEvent(new CustomEvent("remote-input-error",{bubbles:!0}))}function Xn(t){let e;return function(){clearTimeout(e),e=setTimeout(()=>{clearTimeout(e),t()},300)}}t("R",RemoteInputElement),window.customElements.get("remote-input")||(window.RemoteInputElement=RemoteInputElement,window.customElements.define("remote-input",RemoteInputElement));class TabContainerElement extends HTMLElement{constructor(){super(),this.addEventListener("keydown",t=>{const e=t.target;if(!(e instanceof HTMLElement))return;if("tab"!==e.getAttribute("role")&&!e.closest('[role="tablist"]'))return;const n=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]')),i=n.indexOf(n.find(t=>t.matches('[aria-selected="true"]')));if("ArrowRight"===t.code){let t=i+1;t>=n.length&&(t=0),Gn(this,t)}else if("ArrowLeft"===t.code){let t=i-1;t<0&&(t=n.length-1),Gn(this,t)}else"Home"===t.code?(Gn(this,0),t.preventDefault()):"End"===t.code&&(Gn(this,n.length-1),t.preventDefault())}),this.addEventListener("click",t=>{const e=Array.from(this.querySelectorAll('[role="tablist"] [role="tab"]'));if(!(t.target instanceof Element))return;const n=t.target.closest('[role="tab"]');n&&n.closest('[role="tablist"]')&&Gn(this,e.indexOf(n))})}connectedCallback(){for(const t of this.querySelectorAll('[role="tablist"] [role="tab"]'))t.hasAttribute("aria-selected")||t.setAttribute("aria-selected","false"),t.hasAttribute("tabindex")||("true"===t.getAttribute("aria-selected")?t.setAttribute("tabindex","0"):t.setAttribute("tabindex","-1"))}}function Gn(t,e){const n=t.querySelectorAll('[role="tablist"] [role="tab"]'),i=t.querySelectorAll('[role="tabpanel"]'),s=n[e],r=i[e];if(!!t.dispatchEvent(new CustomEvent("tab-container-change",{bubbles:!0,cancelable:!0,detail:{relatedTarget:r}}))){for(const t of n)t.setAttribute("aria-selected","false"),t.setAttribute("tabindex","-1");for(const t of i)t.hidden=!0,t.hasAttribute("tabindex")||t.hasAttribute("data-tab-container-no-tabstop")||t.setAttribute("tabindex","0");s.setAttribute("aria-selected","true"),s.setAttribute("tabindex","0"),s.focus(),r.hidden=!1,t.dispatchEvent(new CustomEvent("tab-container-changed",{bubbles:!0,detail:{relatedTarget:r}}))}}t("c",TabContainerElement),window.customElements.get("tab-container")||(window.TabContainerElement=TabContainerElement,window.customElements.define("tab-container",TabContainerElement));const Qn=new WeakMap;let Zn=null;function Jn(t,e){return t.closest("task-lists")===e.closest("task-lists")}function ti(t){if(t.currentTarget!==t.target)return;const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest(".contains-task-list");if(!n)return;if(e.classList.add("is-ghost"),t.dataTransfer&&t.dataTransfer.setData("text/plain",e.textContent.trim()),!e.parentElement)return;const i=Array.from(e.parentElement.children),s=i.indexOf(e),r=Qn.get(e);r&&r.sortStarted(n),Zn={didDrop:!1,dragging:e,dropzone:e,sourceList:n,sourceSibling:i[s+1]||null,sourceIndex:s}}function ei(t){if(!Zn)return;const e=t.currentTarget;e instanceof Element&&(Jn(Zn.dragging,e)?(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move"),Zn.dropzone!==e&&(Zn.dragging.classList.add("is-dragging"),Zn.dropzone=e,!function(t,e){if(t.parentNode===e.parentNode){let n=t;for(;n;){if(n===e)return!0;n=n.previousElementSibling}}return!1}(Zn.dragging,e)?e.after(Zn.dragging):e.before(Zn.dragging))):t.stopPropagation())}function ni(t){if(!Zn)return;t.preventDefault(),t.stopPropagation();const e=t.currentTarget;if(!(e instanceof Element))return;if(Zn.didDrop=!0,!Zn.dragging.parentElement)return;let n=Array.from(Zn.dragging.parentElement.children).indexOf(Zn.dragging);const i=e.closest(".contains-task-list");if(!i)return;if(Zn.sourceIndex===n&&Zn.sourceList===i)return;Zn.sourceList===i&&Zn.sourceIndex<n&&n++;const s={list:Zn.sourceList,index:Zn.sourceIndex},r={list:i,index:n},o=Qn.get(Zn.dragging);o&&o.sortFinished({src:s,dst:r})}function ii(){Zn&&(Zn.dragging.classList.remove("is-dragging"),Zn.dragging.classList.remove("is-ghost"),Zn.didDrop||Zn.sourceList.insertBefore(Zn.dragging,Zn.sourceSibling),Zn=null)}function si(t){if(!Zn)return;const e=t.currentTarget;e instanceof Element&&(Jn(Zn.dragging,e)?(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="move")):t.stopPropagation())}const ri=new WeakMap;class TaskListsElement extends HTMLElement{constructor(){super(),this.addEventListener("change",t=>{const e=t.target;e instanceof HTMLInputElement&&e.classList.contains("task-list-item-checkbox")&&this.dispatchEvent(new CustomEvent("task-lists-check",{bubbles:!0,detail:{position:di(e),checked:e.checked}}))}),ri.set(this,new MutationObserver(fi.bind(null,this)))}connectedCallback(){const t=ri.get(this);t&&t.observe(this,{childList:!0,subtree:!0}),fi(this)}disconnectedCallback(){const t=ri.get(this);t&&t.disconnect()}get disabled(){return this.hasAttribute("disabled")}set disabled(t){t?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get sortable(){return this.hasAttribute("sortable")}set sortable(t){t?this.setAttribute("sortable",""):this.removeAttribute("sortable")}static get observedAttributes(){return["disabled"]}attributeChangedCallback(t,e,n){if(e!==n)switch(t){case"disabled":pi(this)}}}const oi=document.createElement("template");oi.innerHTML='\n <span class="handle">\n <svg class="drag-handle" aria-hidden="true" width="16" height="15" version="1.1" viewBox="0 0 16 15">\n <path d="M12,4V5H4V4h8ZM4,8h8V7H4V8Zm0,3h8V10H4v1Z"></path>\n </svg>\n </span>';const ai=new WeakMap;function ci(t){if(ai.get(t))return;ai.set(t,!0);const e=t.closest("task-lists");if(!(e instanceof TaskListsElement))return;if(e.querySelectorAll(".task-list-item").length<=1)return;const n=oi.content.cloneNode(!0),i=n.querySelector(".handle");if(t.prepend(n),!i)throw new Error("handle not found");i.addEventListener("mouseenter",wi),i.addEventListener("mouseleave",yi),function(t,e,n){Qn.set(t,{sortStarted:e,sortFinished:n}),t.addEventListener("dragstart",ti),t.addEventListener("dragenter",ei),t.addEventListener("dragend",ii),t.addEventListener("drop",ni),t.addEventListener("dragover",si)}(t,bi,Ei),t.addEventListener("mouseenter",li),t.addEventListener("mouseleave",ui)}function li(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest("task-lists");n instanceof TaskListsElement&&n.sortable&&!n.disabled&&e.classList.add("hovered")}function ui(t){const e=t.currentTarget;e instanceof Element&&e.classList.remove("hovered")}function di(t){const e=hi(t);if(!e)throw new Error(".contains-task-list not found");const n=Array.from(e.children).indexOf(t.closest(".task-list-item"));return[gi(e),n]}function hi(t){const e=t.parentElement;return e?e.closest(".contains-task-list"):null}function mi(t){return hi(t)===function t(e){const n=hi(e);return n?t(n)||n:null}(t)}function fi(t){const e=t.querySelectorAll(".contains-task-list > .task-list-item");for(const n of e)mi(n)&&ci(n);pi(t)}function pi(t){for(const e of t.querySelectorAll(".task-list-item"))e.classList.toggle("enabled",!t.disabled);for(const e of t.querySelectorAll(".task-list-item-checkbox"))e instanceof HTMLInputElement&&(e.disabled=t.disabled)}function gi(t){const e=t.closest("task-lists");if(!e)throw new Error("parent not found");return Array.from(e.querySelectorAll("ol, ul")).indexOf(t)}const vi=new WeakMap;function bi(t){const e=t.closest("task-lists");if(!e)throw new Error("parent not found");vi.set(e,Array.from(e.querySelectorAll("ol, ul")))}function Ei(t){let{src:e,dst:n}=t;const i=e.list.closest("task-lists");if(!i)return;const s=vi.get(i);s&&(vi.delete(i),i.dispatchEvent(new CustomEvent("task-lists-move",{bubbles:!0,detail:{src:[s.indexOf(e.list),e.index],dst:[s.indexOf(n.list),n.index]}})))}function wi(t){const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest(".task-list-item");if(!n)return;const i=n.closest("task-lists");i instanceof TaskListsElement&&i.sortable&&!i.disabled&&n.setAttribute("draggable","true")}function yi(t){if(Zn)return;const e=t.currentTarget;if(!(e instanceof Element))return;const n=e.closest(".task-list-item");n&&n.setAttribute("draggable","false")}window.customElements.get("task-lists")||(window.TaskListsElement=TaskListsElement,window.customElements.define("task-lists",TaskListsElement)),t("T",TaskListsElement);const Ai=/\s|\(|\[/;function xi(t,e,n){const i=t.lastIndexOf(e,n-1);if(-1===i)return;if(t.lastIndexOf(" ",n-1)>i)return;const s=t[i-1];return!s||Ai.test(s)?{word:t.substring(i+e.length,n),position:i+e.length}:void 0}const ki=["position:absolute;","overflow:auto;","word-wrap:break-word;","top:0px;","left:-9999px;"],Ti=["box-sizing","font-family","font-size","font-style","font-variant","font-weight","height","letter-spacing","line-height","max-height","min-height","padding-bottom","padding-left","padding-right","padding-top","border-bottom","border-left","border-right","border-top","text-decoration","text-indent","text-transform","width","word-spacing"],Mi=new WeakMap;function Li(t,e){const n=t.nodeName.toLowerCase();if("textarea"!==n&&"input"!==n)throw new Error("expected textField to a textarea or input");let i=Mi.get(t);if(i&&i.parentElement===t.parentElement)i.innerHTML="";else{i=document.createElement("div"),Mi.set(t,i);const e=window.getComputedStyle(t),s=ki.slice(0);"textarea"===n?s.push("white-space:pre-wrap;"):s.push("white-space:nowrap;");for(let t=0,n=Ti.length;t<n;t++){const n=Ti[t];s.push("".concat(n,":").concat(e.getPropertyValue(n),";"))}i.style.cssText=s.join(" ")}const s=document.createElement("span");let r,o;if(s.style.cssText="position: absolute;",s.innerHTML=" ","number"==typeof e){let n=t.value.substring(0,e);n&&(r=document.createTextNode(n)),n=t.value.substring(e),n&&(o=document.createTextNode(n))}else{const e=t.value;e&&(r=document.createTextNode(e))}if(r&&i.appendChild(r),i.appendChild(s),o&&i.appendChild(o),!i.parentElement){if(!t.parentElement)throw new Error("textField must have a parentElement to mirror");t.parentElement.insertBefore(i,t)}return i.scrollTop=t.scrollTop,i.scrollLeft=t.scrollLeft,{mirror:i,marker:s}}const Ci=new WeakMap;class Si{constructor(t,e){this.expander=t,this.input=e,this.menu=null,this.oninput=this.onInput.bind(this),this.onpaste=this.onPaste.bind(this),this.onkeydown=this.onKeydown.bind(this),this.oncommit=this.onCommit.bind(this),this.onmousedown=this.onMousedown.bind(this),this.onblur=this.onBlur.bind(this),this.interactingWithList=!1,e.addEventListener("paste",this.onpaste),e.addEventListener("input",this.oninput),e.addEventListener("keydown",this.onkeydown),e.addEventListener("blur",this.onblur)}destroy(){this.input.removeEventListener("paste",this.onpaste),this.input.removeEventListener("input",this.oninput),this.input.removeEventListener("keydown",this.onkeydown),this.input.removeEventListener("blur",this.onblur)}activate(t,e){if(this.input!==document.activeElement)return;this.deactivate(),this.menu=e,e.id||(e.id="text-expander-".concat(Math.floor(1e5*Math.random()).toString())),this.input.setAttribute("aria-owns",e.id),this.expander.append(e);const{top:n,left:i}=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.selectionEnd;const{mirror:n,marker:i}=Li(t,e),s=n.getBoundingClientRect(),r=i.getBoundingClientRect();return setTimeout(()=>{n.remove()},5e3),{top:r.top-s.top,left:r.left-s.left}}(this.input,t.position);e.style.top="".concat(n,"px"),e.style.left="".concat(i,"px"),q(this.input,e),e.addEventListener("combobox-commit",this.oncommit),e.addEventListener("mousedown",this.onmousedown),V(this.input,e),W(this.input,e)}deactivate(){const t=this.menu;t&&(this.menu=null,t.removeEventListener("combobox-commit",this.oncommit),t.removeEventListener("mousedown",this.onmousedown),B(this.input,t),this.input.removeAttribute("aria-owns"),t.remove())}onCommit(t){let{target:e}=t;const n=e;if(!(n instanceof HTMLElement))return;const i=this.match;if(!i)return;const s=this.input.value.substring(0,i.position-i.key.length),r=this.input.value.substring(i.position+i.text.length),o={item:n,key:i.key,value:null};if(!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:o})))return;if(!o.value)return;const a="".concat(o.value," ");this.input.value=s+a+r,this.deactivate(),this.input.focus();const c=s.length+a.length;this.input.selectionStart=c,this.input.selectionEnd=c}onBlur(){this.interactingWithList?this.interactingWithList=!1:this.deactivate()}onPaste(){this.justPasted=!0}async onInput(){if(this.justPasted)return void(this.justPasted=!1);const t=this.findMatch();if(t){this.match=t;const e=await this.notifyProviders(t);if(!this.match)return;e?this.activate(t,e):this.deactivate()}else this.match=null,this.deactivate()}findMatch(){const t=this.input.selectionEnd,e=this.input.value;for(const n of this.expander.keys){const i=xi(e,n,t);if(i)return{text:i.word,key:n,position:i.position}}}async notifyProviders(t){const e=[];if(this.expander.dispatchEvent(new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:t=>e.push(t),text:t.text,key:t.key}})))return(await Promise.all(e)).filter(t=>t.matched).map(t=>t.fragment)[0]}onMousedown(){this.interactingWithList=!0}onKeydown(t){"Escape"===t.key&&(this.deactivate(),t.stopImmediatePropagation(),t.preventDefault())}}class TextExpanderElement extends HTMLElement{get keys(){const t=this.getAttribute("keys");return t?t.split(" "):[]}connectedCallback(){const t=this.querySelector('input[type="text"], textarea');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const e=new Si(this,t);Ci.set(this,e)}disconnectedCallback(){const t=Ci.get(this);t&&(t.destroy(),Ci.delete(this))}}window.customElements.get("text-expander")||(window.TextExpanderElement=TextExpanderElement,window.customElements.define("text-expander",TextExpanderElement));const Ii=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_i=["January","February","March","April","May","June","July","August","September","October","November","December"];function Di(t){return"0".concat(t).slice(-2)}function Hi(t,e){const n=t.getDay(),i=t.getDate(),s=t.getMonth(),r=t.getFullYear(),o=t.getHours(),a=t.getMinutes(),c=t.getSeconds();return e.replace(/%([%aAbBcdeHIlmMpPSwyYZz])/g,(function(e){let l;switch(e[1]){case"%":return"%";case"a":return Ii[n].slice(0,3);case"A":return Ii[n];case"b":return _i[s].slice(0,3);case"B":return _i[s];case"c":return t.toString();case"d":return Di(i);case"e":return String(i);case"H":return Di(o);case"I":return Di(Hi(t,"%l"));case"l":return String(0===o||12===o?12:(o+12)%12);case"m":return Di(s+1);case"M":return Di(a);case"p":return o>11?"PM":"AM";case"P":return o>11?"pm":"am";case"S":return Di(c);case"w":return String(n);case"y":return Di(r%100);case"Y":return String(r);case"Z":return l=t.toString().match(/\((\w+)\)$/),l?l[1]:"";case"z":return l=t.toString().match(/\w([+-]\d\d\d\d) /),l?l[1]:""}return""}))}function qi(t){let e;return function(){if(e)return e;if("Intl"in window)try{return e=new Intl.DateTimeFormat(void 0,t),e}catch(n){if(!(n instanceof RangeError))throw n}}}let Bi=null;const Ni=qi({day:"numeric",month:"short"});function Fi(){if(null!==Bi)return Bi;const t=Ni();if(t){const e=t.format(new Date(0));return Bi=!!e.match(/^\d/),Bi}return!1}let Oi=null;const Pi=qi({day:"numeric",month:"short",year:"numeric"});function Ri(t){const e=t.closest("[lang]");return e instanceof HTMLElement&&e.lang?e.lang:"default"}const Wi=new WeakMap;class ExtendedTimeElement extends HTMLElement{static get observedAttributes(){return["datetime","day","format","lang","hour","minute","month","second","title","weekday","year"]}connectedCallback(){const t=this.getFormattedTitle();t&&!this.hasAttribute("title")&&this.setAttribute("title",t);const e=this.getFormattedDate();e&&(this.textContent=e)}attributeChangedCallback(t,e,n){const i=this.getFormattedTitle();if("datetime"===t){const t=Date.parse(n);isNaN(t)?Wi.delete(this):Wi.set(this,new Date(t))}const s=this.getFormattedTitle(),r=this.getAttribute("title");"title"===t||!s||r&&r!==i||this.setAttribute("title",s);const o=this.getFormattedDate();o&&(this.textContent=o)}get date(){return Wi.get(this)}getFormattedTitle(){const t=this.date;if(!t)return;const e=Vi();if(e)return e.format(t);try{return t.toLocaleString()}catch(n){if(n instanceof RangeError)return t.toString();throw n}}getFormattedDate(){}}const Vi=qi({day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}),ji=new WeakMap;class LocalTimeElement extends ExtendedTimeElement{attributeChangedCallback(t,e,n){"hour"!==t&&"minute"!==t&&"second"!==t&&"time-zone-name"!==t||ji.delete(this),super.attributeChangedCallback(t,e,n)}getFormattedDate(){const t=this.date;if(!t)return;const e=function(t,e){const n={weekday:{short:"%a",long:"%A"},day:{numeric:"%e","2-digit":"%d"},month:{short:"%b",long:"%B"},year:{numeric:"%Y","2-digit":"%y"}};let i=Fi()?"weekday day month year":"weekday month day, year";for(const s in n){const e=n[s][t.getAttribute(s)];i=i.replace(s,e||"")}return i=i.replace(/(\s,)|(,\s$)/,""),Hi(e,i).replace(/\s+/," ").trim()}(this,t)||"",n=function(t,e){const n={},i=t.getAttribute("hour");"numeric"!==i&&"2-digit"!==i||(n.hour=i);const s=t.getAttribute("minute");"numeric"!==s&&"2-digit"!==s||(n.minute=s);const r=t.getAttribute("second");"numeric"!==r&&"2-digit"!==r||(n.second=r);const o=t.getAttribute("time-zone-name");"short"!==o&&"long"!==o||(n.timeZoneName=o);if(0===Object.keys(n).length)return;let a=ji.get(t);a||(a=qi(n),ji.set(t,a));const c=a();if(c)return c.format(e);{const t=n.second?"%H:%M:%S":"%H:%M";return Hi(e,t)}}(this,t)||"";return"".concat(e," ").concat(n).trim()}}window.customElements.get("local-time")||(window.LocalTimeElement=LocalTimeElement,window.customElements.define("local-time",LocalTimeElement));class Ui{constructor(t,e){this.date=t,this.locale=e}toString(){const t=this.timeElapsed();if(t)return t;{const t=this.timeAhead();return t||"on ".concat(this.formatDate())}}timeElapsed(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),s=Math.round(i/24);return t>=0&&s<30?this.timeAgoFromMs(t):null}timeAhead(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),s=Math.round(i/24);return t>=0&&s<30?this.timeUntil():null}timeAgo(){const t=(new Date).getTime()-this.date.getTime();return this.timeAgoFromMs(t)}timeAgoFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),s=Math.round(i/24),r=Math.round(s/30),o=Math.round(r/12);return t<0?$i(this.locale,0,"second"):e<10?$i(this.locale,0,"second"):e<45?$i(this.locale,-e,"second"):e<90?$i(this.locale,-n,"minute"):n<45?$i(this.locale,-n,"minute"):n<90?$i(this.locale,-i,"hour"):i<24?$i(this.locale,-i,"hour"):i<36?$i(this.locale,-s,"day"):s<30?$i(this.locale,-s,"day"):r<18?$i(this.locale,-r,"month"):$i(this.locale,-o,"year")}microTimeAgo(){const t=(new Date).getTime()-this.date.getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),s=Math.round(i/24),r=Math.round(s/30),o=Math.round(r/12);return n<1?"1m":n<60?"".concat(n,"m"):i<24?"".concat(i,"h"):s<365?"".concat(s,"d"):"".concat(o,"y")}timeUntil(){const t=this.date.getTime()-(new Date).getTime();return this.timeUntilFromMs(t)}timeUntilFromMs(t){const e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),s=Math.round(i/24),r=Math.round(s/30),o=Math.round(r/12);return r>=18?$i(this.locale,o,"year"):r>=12?$i(this.locale,o,"year"):s>=45?$i(this.locale,r,"month"):s>=30?$i(this.locale,r,"month"):i>=36?$i(this.locale,s,"day"):i>=24?$i(this.locale,s,"day"):n>=90?$i(this.locale,i,"hour"):n>=45?$i(this.locale,i,"hour"):e>=90?$i(this.locale,n,"minute"):e>=45?$i(this.locale,n,"minute"):$i(this.locale,e>=10?e:0,"second")}microTimeUntil(){const t=this.date.getTime()-(new Date).getTime(),e=Math.round(t/1e3),n=Math.round(e/60),i=Math.round(n/60),s=Math.round(i/24),r=Math.round(s/30),o=Math.round(r/12);return s>=365?"".concat(o,"y"):i>=24?"".concat(s,"d"):n>=60?"".concat(i,"h"):n>1?"".concat(n,"m"):"1m"}formatDate(){let t=Fi()?"%e %b":"%b %e";var e;return e=this.date,(new Date).getUTCFullYear()!==e.getUTCFullYear()&&(t+=function(){if(null!==Oi)return Oi;const t=Pi();if(t){const e=t.format(new Date(0));return Oi=!!e.match(/\d,/),Oi}return!0}()?", %Y":" %Y"),Hi(this.date,t)}formatTime(){const t=Ki();return t?t.format(this.date):Hi(this.date,"%l:%M%P")}}function $i(t,e,n){const i=function(t,e){if("Intl"in window&&"RelativeTimeFormat"in window.Intl)try{return new Intl.RelativeTimeFormat(t,e)}catch(n){if(!(n instanceof RangeError))throw n}}(t,{numeric:"auto"});return i?i.format(e,n):function(t,e){if(0===t)switch(e){case"year":case"quarter":case"month":case"week":return"this ".concat(e);case"day":return"today";case"hour":case"minute":return"in 0 ".concat(e,"s");case"second":return"now"}else if(1===t)switch(e){case"year":case"quarter":case"month":case"week":return"next ".concat(e);case"day":return"tomorrow";case"hour":case"minute":case"second":return"in 1 ".concat(e)}else if(-1===t)switch(e){case"year":case"quarter":case"month":case"week":return"last ".concat(e);case"day":return"yesterday";case"hour":case"minute":case"second":return"1 ".concat(e," ago")}else if(t>1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return"in ".concat(t," ").concat(e,"s")}else if(t<-1)switch(e){case"year":case"quarter":case"month":case"week":case"day":case"hour":case"minute":case"second":return"".concat(-t," ").concat(e,"s ago")}throw new RangeError("Invalid unit argument for format() '".concat(e,"'"))}(e,n)}const Ki=qi({hour:"numeric",minute:"2-digit"});class RelativeTimeElement extends ExtendedTimeElement{getFormattedDate(){const t=this.date;if(t)return new Ui(t,Ri(this)).toString()}connectedCallback(){Yi.push(this),zi||(Xi(),zi=setInterval(Xi,6e4)),super.connectedCallback()}disconnectedCallback(){const t=Yi.indexOf(this);-1!==t&&Yi.splice(t,1),Yi.length||zi&&(clearInterval(zi),zi=null)}}t("e",RelativeTimeElement);const Yi=[];let zi;function Xi(){let t,e,n;for(e=0,n=Yi.length;e<n;e++)t=Yi[e],t.textContent=t.getFormattedDate()||""}window.customElements.get("relative-time")||(window.RelativeTimeElement=RelativeTimeElement,window.customElements.define("relative-time",RelativeTimeElement));class TimeAgoElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new Ui(e,Ri(this)).microTimeAgo():new Ui(e,Ri(this)).timeAgo()}}window.customElements.get("time-ago")||(window.TimeAgoElement=TimeAgoElement,window.customElements.define("time-ago",TimeAgoElement));class TimeUntilElement extends RelativeTimeElement{getFormattedDate(){const t=this.getAttribute("format"),e=this.date;if(e)return"micro"===t?new Ui(e,Ri(this)).microTimeUntil():new Ui(e,Ri(this)).timeUntil()}}window.customElements.get("time-until")||(window.TimeUntilElement=TimeUntilElement,window.customElements.define("time-until",TimeUntilElement))}}}));
//# sourceMappingURL=vendor-a8e7c019.js.map