@lambforge/agent-chat 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-chat.js +12 -12
- package/dist/agent-chat.js.map +3 -3
- package/package.json +3 -3
package/dist/agent-chat.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(()=>{var Qs=Object.create;var wt=Object.defineProperty;var lo=Object.getOwnPropertyDescriptor;var ea=Object.getOwnPropertyNames;var ta=Object.getPrototypeOf,ra=Object.prototype.hasOwnProperty;var y=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var xe=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},
|
|
1
|
+
(()=>{var Qs=Object.create;var wt=Object.defineProperty;var lo=Object.getOwnPropertyDescriptor;var ea=Object.getOwnPropertyNames;var ta=Object.getPrototypeOf,ra=Object.prototype.hasOwnProperty;var y=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var xe=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},R=(r,e)=>{for(var t in e)wt(r,t,{get:e[t],enumerable:!0})},co=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ea(e))!ra.call(r,o)&&o!==t&&wt(r,o,{get:()=>e[o],enumerable:!(n=lo(e,o))||n.enumerable});return r};var an=(r,e,t)=>(t=r!=null?Qs(ta(r)):{},co(e||!r||!r.__esModule?wt(t,"default",{value:r,enumerable:!0}):t,r)),C=r=>co(wt({},"__esModule",{value:!0}),r),N=(r,e,t,n)=>{for(var o=n>1?void 0:n?lo(e,t):e,i=r.length-1,s;i>=0;i--)(s=r[i])&&(o=(n?s(e,t,o):s(o))||o);return n&&o&&wt(e,t,o),o};var jr={};R(jr,{_$LH:()=>lt,html:()=>li,noChange:()=>A,nothing:()=>E,render:()=>Ce,svg:()=>ci});function ze(r,e,t=r,n){var o,i,s,l;if(e===A)return e;let a=n!==void 0?(o=t._$Co)===null||o===void 0?void 0:o[n]:t._$Cl,c=Ut(e)?void 0:e._$litDirective$;return a?.constructor!==c&&((i=a?._$AO)===null||i===void 0||i.call(a,!1),c===void 0?a=void 0:(a=new c(r),a._$AT(r,t,n)),n!==void 0?((s=(l=t)._$Co)!==null&&s!==void 0?s:l._$Co=[])[n]=a:t._$Cl=a),a!==void 0&&(e=ze(r,a._$AS(r,e.values),a,n)),e}var En,Or,it,Zo,Se,Cn,Ra,st,Lt,Ut,oi,ii,jt,Xo,Qo,We,ei,ti,si,ai,li,ci,A,E,ri,ot,ui,Dt,kr,at,Ve,Pr,Ma,Ir,Rr,Mr,lt,ni,Ce,L=y(()=>{Or=window,it=Or.trustedTypes,Zo=it?it.createPolicy("lit-html",{createHTML:r=>r}):void 0,Se=`lit$${(Math.random()+"").slice(9)}$`,Cn="?"+Se,Ra=`<${Cn}>`,st=document,Lt=(r="")=>st.createComment(r),Ut=r=>r===null||typeof r!="object"&&typeof r!="function",oi=Array.isArray,ii=r=>oi(r)||typeof r?.[Symbol.iterator]=="function",jt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Xo=/-->/g,Qo=/>/g,We=RegExp(`>|[
|
|
2
2
|
\f\r](?:([^\\s"'>=/]+)([
|
|
3
3
|
\f\r]*=[
|
|
4
4
|
\f\r]*(?:[^
|
|
5
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ei=/'/g,ti=/"/g,si=/^(?:script|style|textarea|title)$/i,ai=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),li=ai(1),ci=ai(2),A=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),ri=new WeakMap,ot=st.createTreeWalker(st,129,null,!1),ui=(r,e)=>{let t=r.length-1,n=[],o,i=e===2?"<svg>":"",s=jt;for(let a=0;a<t;a++){let c=r[a],u,p,d=-1,f=0;for(;f<c.length&&(s.lastIndex=f,p=s.exec(c),p!==null);)f=s.lastIndex,s===jt?p[1]==="!--"?s=Xo:p[1]!==void 0?s=Qo:p[2]!==void 0?(si.test(p[2])&&(o=RegExp("</"+p[2],"g")),s=We):p[3]!==void 0&&(s=We):s===We?p[0]===">"?(s=o??jt,d=-1):p[1]===void 0?d=-2:(d=s.lastIndex-p[2].length,u=p[1],s=p[3]===void 0?We:p[3]==='"'?ti:ei):s===ti||s===ei?s=We:s===Xo||s===Qo?s=jt:(s=We,o=void 0);let v=s===We&&r[a+1].startsWith("/>")?" ":"";i+=s===jt?c+Ra:d>=0?(n.push(u),c.slice(0,d)+"$lit$"+c.slice(d)+Se+v):c+Se+(d===-2?(n.push(void 0),a):v)}let l=i+(r[t]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Zo!==void 0?Zo.createHTML(l):l,n]},Dt=class r{constructor({strings:e,_$litType$:t},n){let o;this.parts=[];let i=0,s=0,l=e.length-1,a=this.parts,[c,u]=ui(e,t);if(this.el=r.createElement(c,n),ot.currentNode=this.el.content,t===2){let p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(o=ot.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes()){let p=[];for(let d of o.getAttributeNames())if(d.endsWith("$lit$")||d.startsWith(Se)){let f=u[s++];if(p.push(d),f!==void 0){let v=o.getAttribute(f.toLowerCase()+"$lit$").split(Se),h=/([.?@])?(.*)/.exec(f);a.push({type:1,index:i,name:h[2],strings:v,ctor:h[1]==="."?
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ei=/'/g,ti=/"/g,si=/^(?:script|style|textarea|title)$/i,ai=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),li=ai(1),ci=ai(2),A=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),ri=new WeakMap,ot=st.createTreeWalker(st,129,null,!1),ui=(r,e)=>{let t=r.length-1,n=[],o,i=e===2?"<svg>":"",s=jt;for(let a=0;a<t;a++){let c=r[a],u,p,d=-1,f=0;for(;f<c.length&&(s.lastIndex=f,p=s.exec(c),p!==null);)f=s.lastIndex,s===jt?p[1]==="!--"?s=Xo:p[1]!==void 0?s=Qo:p[2]!==void 0?(si.test(p[2])&&(o=RegExp("</"+p[2],"g")),s=We):p[3]!==void 0&&(s=We):s===We?p[0]===">"?(s=o??jt,d=-1):p[1]===void 0?d=-2:(d=s.lastIndex-p[2].length,u=p[1],s=p[3]===void 0?We:p[3]==='"'?ti:ei):s===ti||s===ei?s=We:s===Xo||s===Qo?s=jt:(s=We,o=void 0);let v=s===We&&r[a+1].startsWith("/>")?" ":"";i+=s===jt?c+Ra:d>=0?(n.push(u),c.slice(0,d)+"$lit$"+c.slice(d)+Se+v):c+Se+(d===-2?(n.push(void 0),a):v)}let l=i+(r[t]||"<?>")+(e===2?"</svg>":"");if(!Array.isArray(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Zo!==void 0?Zo.createHTML(l):l,n]},Dt=class r{constructor({strings:e,_$litType$:t},n){let o;this.parts=[];let i=0,s=0,l=e.length-1,a=this.parts,[c,u]=ui(e,t);if(this.el=r.createElement(c,n),ot.currentNode=this.el.content,t===2){let p=this.el.content,d=p.firstChild;d.remove(),p.append(...d.childNodes)}for(;(o=ot.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes()){let p=[];for(let d of o.getAttributeNames())if(d.endsWith("$lit$")||d.startsWith(Se)){let f=u[s++];if(p.push(d),f!==void 0){let v=o.getAttribute(f.toLowerCase()+"$lit$").split(Se),h=/([.?@])?(.*)/.exec(f);a.push({type:1,index:i,name:h[2],strings:v,ctor:h[1]==="."?Pr:h[1]==="?"?Ir:h[1]==="@"?Rr:Ve})}else a.push({type:6,index:i})}for(let d of p)o.removeAttribute(d)}if(si.test(o.tagName)){let p=o.textContent.split(Se),d=p.length-1;if(d>0){o.textContent=it?it.emptyScript:"";for(let f=0;f<d;f++)o.append(p[f],Lt()),ot.nextNode(),a.push({type:2,index:++i});o.append(p[d],Lt())}}}else if(o.nodeType===8)if(o.data===Cn)a.push({type:2,index:i});else{let p=-1;for(;(p=o.data.indexOf(Se,p+1))!==-1;)a.push({type:7,index:i}),p+=Se.length-1}i++}}static createElement(e,t){let n=st.createElement("template");return n.innerHTML=e,n}};kr=class{constructor(e,t){this.u=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(e){var t;let{el:{content:n},parts:o}=this._$AD,i=((t=e?.creationScope)!==null&&t!==void 0?t:st).importNode(n,!0);ot.currentNode=i;let s=ot.nextNode(),l=0,a=0,c=o[0];for(;c!==void 0;){if(l===c.index){let u;c.type===2?u=new at(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new Mr(s,this,e)),this.u.push(u),c=o[++a]}l!==c?.index&&(s=ot.nextNode(),l++)}return i}p(e){let t=0;for(let n of this.u)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},at=class r{constructor(e,t,n,o){var i;this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=o,this._$Cm=(i=o?.isConnected)===null||i===void 0||i}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cm}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ze(this,e,t),Ut(e)?e===E||e==null||e===""?(this._$AH!==E&&this._$AR(),this._$AH=E):e!==this._$AH&&e!==A&&this.g(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ii(e)?this.k(e):this.g(e)}O(e,t=this._$AB){return this._$AA.parentNode.insertBefore(e,t)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}g(e){this._$AH!==E&&Ut(this._$AH)?this._$AA.nextSibling.data=e:this.T(st.createTextNode(e)),this._$AH=e}$(e){var t;let{values:n,_$litType$:o}=e,i=typeof o=="number"?this._$AC(e):(o.el===void 0&&(o.el=Dt.createElement(o.h,this.options)),o);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===i)this._$AH.p(n);else{let s=new kr(i,this),l=s.v(this.options);s.p(n),this.T(l),this._$AH=s}}_$AC(e){let t=ri.get(e.strings);return t===void 0&&ri.set(e.strings,t=new Dt(e)),t}k(e){oi(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,o=0;for(let i of e)o===t.length?t.push(n=new r(this.O(Lt()),this.O(Lt()),this,this.options)):n=t[o],n._$AI(i),o++;o<t.length&&(this._$AR(n&&n._$AB.nextSibling,o),t.length=o)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)===null||n===void 0||n.call(this,!1,!0,t);e&&e!==this._$AB;){let o=e.nextSibling;e.remove(),e=o}}setConnected(e){var t;this._$AM===void 0&&(this._$Cm=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},Ve=class{constructor(e,t,n,o,i){this.type=1,this._$AH=E,this._$AN=void 0,this.element=e,this.name=t,this._$AM=o,this.options=i,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=E}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,n,o){let i=this.strings,s=!1;if(i===void 0)e=ze(this,e,t,0),s=!Ut(e)||e!==this._$AH&&e!==A,s&&(this._$AH=e);else{let l=e,a,c;for(e=i[0],a=0;a<i.length-1;a++)c=ze(this,l[n+a],t,a),c===A&&(c=this._$AH[a]),s||(s=!Ut(c)||c!==this._$AH[a]),c===E?e=E:e!==E&&(e+=(c??"")+i[a+1]),this._$AH[a]=c}s&&!o&&this.j(e)}j(e){e===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Pr=class extends Ve{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===E?void 0:e}},Ma=it?it.emptyScript:"",Ir=class extends Ve{constructor(){super(...arguments),this.type=4}j(e){e&&e!==E?this.element.setAttribute(this.name,Ma):this.element.removeAttribute(this.name)}},Rr=class extends Ve{constructor(e,t,n,o,i){super(e,t,n,o,i),this.type=5}_$AI(e,t=this){var n;if((e=(n=ze(this,e,t,0))!==null&&n!==void 0?n:E)===A)return;let o=this._$AH,i=e===E&&o!==E||e.capture!==o.capture||e.once!==o.once||e.passive!==o.passive,s=e!==E&&(o===E||i);i&&this.element.removeEventListener(this.name,this,o),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,n;typeof this._$AH=="function"?this._$AH.call((n=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&n!==void 0?n:this.element,e):this._$AH.handleEvent(e)}},Mr=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){ze(this,e)}},lt={P:"$lit$",A:Se,M:Cn,C:1,L:ui,R:kr,D:ii,V:ze,I:at,H:Ve,N:Ir,U:Rr,B:Pr,F:Mr},ni=Or.litHtmlPolyfillSupport;ni?.(Dt,at),((En=Or.litHtmlVersions)!==null&&En!==void 0?En:Or.litHtmlVersions=[]).push("2.5.0");Ce=(r,e,t)=>{var n,o;let i=(n=t?.renderBefore)!==null&&n!==void 0?n:e,s=i._$litPart$;if(s===void 0){let l=(o=t?.renderBefore)!==null&&o!==void 0?o:null;i._$litPart$=s=new at(e.insertBefore(Lt(),l),l,void 0,t??{})}return s._$AI(r),s}});var fi=xe(ct=>{"use strict";var ja=ct&&ct.__setFunctionName||function(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})};Object.defineProperty(ct,"__esModule",{value:!0});ct.Component=void 0;var pi=(L(),C(jr)),La=(r,e,t)=>(window.customElements.define(r,e,t),e),Ua=(r,e,t)=>{let{kind:n,elements:o}=e;return{kind:n,elements:o,finisher(i){window.customElements.define(r,i,t)}}},Da=r=>typeof r=="function",qa=(r,e={})=>t=>{var n,o;if(!((n=window._excluded_components)===null||n===void 0)&&n.includes(e.selector))return t;if(!r||r&&r.indexOf("-")<=0)throw new Error(`You need at least 1 dash in the custom element name! ${t}`);e.styles=e.styles||[],e.components=e.components||[];let i=t.prototype.OnInit||function(){},s=t.prototype.OnDestroy||function(){},l=t.prototype.OnUpdate||function(){},a=t.prototype.OnUpdateFirst||function(){},c=t.prototype.connectedCallback||function(){},u=t.prototype.disconnectedCallback||function(){},p=t.prototype.update||function(){},d=t.prototype.firstUpdated||function(){};e.template||(e.template=t.prototype.render||(()=>(0,pi.html)``)),e.style&&e.styles.push(e.style);let f=(o=class extends t{static is(){return r}getTemplateResult(){return this}OnInit(){if(e.container&&((0,pi.render)(e.template.call(this),e.container),e.style)){let h=document.createElement("style");h.type="text/css",h.styleSheet?h.styleSheet.cssText=e.style.toString():h.appendChild(document.createTextNode(e.style.toString())),e.container.prepend(h)}return i.call(this)}disconnectedCallback(){var h;s.call(this),u.call(this),(h=this._registry)===null||h===void 0||h.unsubscribe(),this._registry=null}connectedCallback(){var h,m;if(c.call(this),i.call(this),Da(e.registry)&&(this._registry=e.registry.call(this)),!((h=e.modifiers)===null||h===void 0)&&h.length)for(let b of e.modifiers){if(!b)throw new Error(`Provided null value inside modifiers for component "${e.selector}"`);if(!b.options)throw new Error(`Missing options for attribute inside ${e.selector}`);if(!(!((m=b.options)===null||m===void 0)&&m.selector))throw new Error(`Missing attribute selector inside component "${e.selector}"`);if(!this._registry&&typeof b.options.registry=="function"&&(this._registry=b.options.registry.call(this)),!this._registry)throw new Error(`Missing attribute registry for attribute "${b.options.selector}" and no default registry specified inside component "${e.selector}"`);this._registry.define(b.options.selector,b)}}render(){return e.template.call(this)}update(){p.call(this),l.call(this)}firstUpdated(){d.call(this),a.call(this)}},ja(o,"ModifiedClass"),o.styles=e.styles,o),v=window.customElements.get(r);return v?(console.error(`** IMPORTANT!!! **
|
|
6
6
|
------------------------------------------
|
|
7
7
|
< ${r} > </${r}> Component re-defined multiple times and it is already registered inside customElements registry
|
|
8
8
|
Possible Solutions:
|
|
@@ -12,8 +12,8 @@ Possible Solutions:
|
|
|
12
12
|
|
|
13
13
|
** If this is Server Side Rendering you can ignore this message **
|
|
14
14
|
------------------------------------------
|
|
15
|
-
`),v):(typeof f=="function"?La(r,f,{extends:e.extends}):Ua(r,f,{extends:e.extends}),f)},Na=r=>qa(r.selector,r);ct.Component=Na});var hi=xe(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0})});var vi=xe(Te=>{"use strict";var Fa=Te&&Te.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),mi=Te&&Te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Fa(e,r,t)};Object.defineProperty(Te,"__esModule",{value:!0});mi(fi(),Te);mi(hi(),Te)});var Tn={};
|
|
16
|
-
`),tr.content.appendChild(rr)),e.add(er),t.delete(er),window.ShadyCSS.prepareTemplateStyles(tr,er),ao&&window.ShadyCSS.nativeShadow&&(rr=tr.content.querySelector("style"))!==null&&tr.content.appendChild(rr)})(K,Me),c.removeChild(u),(m=window.ShadyCSS)===null||m===void 0?void 0:m.nativeShadow){var je=Me.content.querySelector("style");je!==null&&c.appendChild(je.cloneNode(!0))}b.insertBefore(c,be),this._$AA=ie,this._$AB=be}else d.call(this,f,v)},p._$AC=function(f){var v,h=(v=this.options)===null||v===void 0?void 0:v.scope,m=l.get(h);m===void 0&&l.set(h,m=new Map);var b=m.get(f.strings);return b===void 0&&m.set(f.strings,b=new n(f,this.options)),b}}})}))});var Ur,zt,Rn,Ei,ft,Mn,Ci,Dr,Vt,jn=y(()=>{Ur=window,zt=Ur.ShadowRoot&&(Ur.ShadyCSS===void 0||Ur.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rn=Symbol(),Ei=new WeakMap,ft=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Rn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(zt&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Ei.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ei.set(t,e))}return e}toString(){return this.cssText}},Mn=r=>new ft(typeof r=="string"?r:r+"",void 0,Rn),Ci=(r,...e)=>{let t=r.length===1?r[0]:e.reduce(((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[i+1]),r[0]);return new ft(t,r,Rn)},Dr=(r,e)=>{zt?r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((t=>{let n=document.createElement("style"),o=Ur.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}))},Vt=zt?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Mn(t)})(r):r});var Ln,qr,Ti,sl,Oi,Nr,Dn,Un,pe,Fr=y(()=>{jn();jn();qr=window,Ti=qr.trustedTypes,sl=Ti?Ti.emptyScript:"",Oi=qr.reactiveElementPolyfillSupport,Nr={toAttribute(r,e){switch(e){case Boolean:r=r?sl:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Dn=(r,e)=>e!==r&&(e==e||r==r),Un={attribute:!0,type:String,converter:Nr,reflect:!1,hasChanged:Dn},pe=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach(((t,n)=>{let o=this._$Ep(n,t);o!==void 0&&(this._$Ev.set(o,n),e.push(o))})),e}static createProperty(e,t=Un){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,n,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(o){let i=this[e];this[t]=o,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Un}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let o of n)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let o of n)t.unshift(Vt(o))}else e!==void 0&&t.push(Vt(e));return t}static _$Ep(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach((t=>t(this)))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Dr(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)}))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=Un){var o;let i=this.constructor._$Ep(e,n);if(i!==void 0&&n.reflect===!0){let s=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:Nr).toAttribute(t,n.type);this._$El=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$El=null}}_$AK(e,t){var n;let o=this.constructor,i=o._$Ev.get(e);if(i!==void 0&&this._$El!==i){let s=o.getPropertyOptions(i),l=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?s.converter:Nr;this._$El=i,this[i]=l.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,n){let o=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Dn)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((o,i)=>this[i]=o)),this._$Ei=void 0);let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach((o=>{var i;return(i=o.hostUpdate)===null||i===void 0?void 0:i.call(o)})),this.update(n)):this._$Ek()}catch(o){throw t=!1,this._$Ek(),o}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach((n=>{var o;return(o=n.hostUpdated)===null||o===void 0?void 0:o.call(n)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach(((t,n)=>this._$EO(n,this[n],t))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};pe.finalized=!0,pe.elementProperties=new Map,pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},Oi?.({ReactiveElement:pe}),((Ln=qr.reactiveElementVersions)!==null&&Ln!==void 0?Ln:qr.reactiveElementVersions=[]).push("1.5.0")});var qn,Nn,Pi,ke,ki,Ii,Ri=y(()=>{Fr();Fr();L();L();Pi=pe,ke=class extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ce(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return A}};ke.finalized=!0,ke._$litElement$=!0,(qn=globalThis.litElementHydrateSupport)===null||qn===void 0||qn.call(globalThis,{LitElement:ke});ki=globalThis.litElementPolyfillSupport;ki?.({LitElement:ke});Ii={_$AK:(r,e,t)=>{r._$AK(e,t)},_$AL:r=>r._$AL};((Nn=globalThis.litElementVersions)!==null&&Nn!==void 0?Nn:globalThis.litElementVersions=[]).push("3.2.2")});var al,ll,Q,Pe=y(()=>{al=(r,e,t)=>{Object.defineProperty(e,t,r)},ll=(r,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:r}),Q=({finisher:r,descriptor:e})=>(t,n)=>{var o;if(n===void 0){let i=(o=t.originalKey)!==null&&o!==void 0?o:t.key,s=e!=null?{kind:"method",placement:"prototype",key:i,descriptor:e(t.key)}:{...t,key:i};return r!=null&&(s.finisher=function(l){r(l,i)}),s}{let i=t.constructor;e!==void 0&&Object.defineProperty(t,n,e(n)),r?.(i,n)}}});var cl,Mi=y(()=>{cl=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:o,elements:i}=n;return{kind:o,elements:i,finisher(s){customElements.define(t,s)}}})(r,e)});function Fn(r){return(e,t)=>t!==void 0?((n,o,i)=>{o.constructor.createProperty(i,n)})(r,e,t):ul(r,e)}var ul,Hn=y(()=>{ul=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}}});function pl(r){return Fn({...r,state:!0})}var ji=y(()=>{Hn();});function fl(r){return Q({finisher:(e,t)=>{Object.assign(e.prototype[t],r)}})}var Li=y(()=>{Pe();});function dl(r,e){return Q({descriptor:t=>{let n={get(){var o,i;return(i=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(r))!==null&&i!==void 0?i:null},enumerable:!0,configurable:!0};if(e){let o=typeof t=="symbol"?Symbol():"__"+t;n.get=function(){var i,s;return this[o]===void 0&&(this[o]=(s=(i=this.renderRoot)===null||i===void 0?void 0:i.querySelector(r))!==null&&s!==void 0?s:null),this[o]}}return n}})}var Ui=y(()=>{Pe();});function hl(r){return Q({descriptor:e=>({get(){var t,n;return(n=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelectorAll(r))!==null&&n!==void 0?n:[]},enumerable:!0,configurable:!0})})}var Di=y(()=>{Pe();});function ml(r){return Q({descriptor:e=>({async get(){var t;return await this.updateComplete,(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector(r)},enumerable:!0,configurable:!0})})}var qi=y(()=>{Pe();});function zn(r){let{slot:e,selector:t}=r??{};return Q({descriptor:n=>({get(){var o;let i="slot"+(e?`[name=${e}]`:":not([name])"),s=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(i),l=s!=null?vl(s,r):[];return t?l.filter((a=>a.matches(t))):l},enumerable:!0,configurable:!0})})}var Wn,vl,Vn=y(()=>{Pe();vl=((Wn=window.HTMLSlotElement)===null||Wn===void 0?void 0:Wn.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE))});function gl(r,e,t){let n,o=r;return typeof r=="object"?(o=r.slot,n=r):n={flatten:e},t?zn({slot:o,flatten:e,selector:t}):Q({descriptor:i=>({get(){var s,l;let a="slot"+(o?`[name=${o}]`:":not([name])"),c=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(a);return(l=c?.assignedNodes(n))!==null&&l!==void 0?l:[]},enumerable:!0,configurable:!0})})}var Ni=y(()=>{Pe();Vn();});var Fi={};I(Fi,{CSSResult:()=>ft,LitElement:()=>ke,ReactiveElement:()=>pe,UpdatingElement:()=>Pi,_$LE:()=>Ii,_$LH:()=>lt,adoptStyles:()=>Dr,css:()=>Ci,customElement:()=>cl,decorateProperty:()=>Q,defaultConverter:()=>Nr,eventOptions:()=>fl,getCompatibleStyle:()=>Vt,html:()=>li,legacyPrototypeMethod:()=>al,noChange:()=>A,notEqual:()=>Dn,nothing:()=>E,property:()=>Fn,query:()=>dl,queryAll:()=>hl,queryAssignedElements:()=>zn,queryAssignedNodes:()=>gl,queryAsync:()=>ml,render:()=>Ce,standardPrototypeMethod:()=>ll,state:()=>pl,supportsAdoptingStyleSheets:()=>zt,svg:()=>ci,unsafeCSS:()=>Mn});var Hi=y(()=>{Fr();L();Ri();Pe();Mi();Hn();ji();Li();Ui();Di();qi();Vn();Ni();console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.")});var Wi={};I(Wi,{classMap:()=>yl});var yl,zi=y(()=>{L();q();yl=T(class extends M{constructor(r){var e;if(super(r),r.type!==O.ATTRIBUTE||r.name!=="class"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter((e=>r[e])).join(" ")+" "}update(r,[e]){var t,n;if(this.nt===void 0){this.nt=new Set,r.strings!==void 0&&(this.st=new Set(r.strings.join(" ").split(/\s/).filter((i=>i!==""))));for(let i in e)e[i]&&!(!((t=this.st)===null||t===void 0)&&t.has(i))&&this.nt.add(i);return this.render(e)}let o=r.element.classList;this.nt.forEach((i=>{i in e||(o.remove(i),this.nt.delete(i))}));for(let i in e){let s=!!e[i];s===this.nt.has(i)||!((n=this.st)===null||n===void 0)&&n.has(i)||(s?(o.add(i),this.nt.add(i)):(o.remove(i),this.nt.delete(i)))}return A}})});var Vi,dt,ht,Bn=y(()=>{Vi=async(r,e)=>{for await(let t of r)if(await e(t)===!1)return},dt=class{constructor(e){this.Y=e}disconnect(){this.Y=void 0}reconnect(e){this.Y=e}deref(){return this.Y}},ht=class{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){var e;(e=this.Z)!==null&&e!==void 0||(this.Z=new Promise((t=>this.q=t)))}resume(){var e;(e=this.q)===null||e===void 0||e.call(this),this.Z=this.q=void 0}}});var Bi={};I(Bi,{AsyncReplaceDirective:()=>mt,asyncReplace:()=>bl});var mt,bl,Kn=y(()=>{L();pt();Bn();q();mt=class extends $e{constructor(){super(...arguments),this._$CK=new dt(this),this._$CX=new ht}render(e,t){return A}update(e,[t,n]){if(this.isConnected||this.disconnected(),t===this._$CJ)return;this._$CJ=t;let o=0,{_$CK:i,_$CX:s}=this;return Vi(t,(async l=>{for(;s.get();)await s.get();let a=i.deref();if(a!==void 0){if(a._$CJ!==t)return!1;n!==void 0&&(l=n(l,o)),a.commitValue(l,o),o++}return!0})),A}commitValue(e,t){this.setValue(e)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},bl=T(mt)});var Ki={};I(Ki,{asyncAppend:()=>xl});var xl,Yi=y(()=>{q();Kn();ye();xl=T(class extends mt{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(r,e){return this._$Ctt=r,super.update(r,e)}commitValue(r,e){e===0&&Ft(this._$Ctt);let t=ne(this._$Ctt);ue(t,r)}})});var Gi={};I(Gi,{cache:()=>wl});var wl,Ji=y(()=>{L();q();ye();wl=T(class extends M{constructor(r){super(r),this.et=new WeakMap}render(r){return[r]}update(r,[e]){if(Oe(this.it)&&(!Oe(e)||this.it.strings!==e.strings)){let t=ut(r).pop(),n=this.et.get(this.it.strings);if(n===void 0){let o=document.createDocumentFragment();n=Ce(E,o),n.setConnected(!1),this.et.set(this.it.strings,n)}ge(n,[t]),ne(n,void 0,t)}if(Oe(e)){if(!Oe(this.it)||this.it.strings!==e.strings){let t=this.et.get(e.strings);if(t!==void 0){let n=ut(t).pop();Ft(r),ne(r,void 0,n),ge(r,[n])}}this.it=e}else this.it=void 0;return this.render(e)}})});var Zi={};I(Zi,{guard:()=>Sl});var _l,Sl,Xi=y(()=>{L();q();_l={},Sl=T(class extends M{constructor(){super(...arguments),this.ot=_l}render(r,e){return e()}update(r,[e,t]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((n,o)=>n===this.ot[o])))return A}else if(this.ot===e)return A;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,t)}})});var Qi={};I(Qi,{ifDefined:()=>$l});var $l,es=y(()=>{L();$l=r=>r??E});var ts={};I(ts,{live:()=>Al});var Al,rs=y(()=>{L();q();ye();Al=T(class extends M{constructor(r){if(super(r),r.type!==O.PROPERTY&&r.type!==O.ATTRIBUTE&&r.type!==O.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Be(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===A||e===E)return e;let t=r.element,n=r.name;if(r.type===O.PROPERTY){if(e===t[n])return A}else if(r.type===O.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(n))return A}else if(r.type===O.ATTRIBUTE&&t.getAttribute(n)===e+"")return A;return ge(r),e}})});var ns={};I(ns,{createRef:()=>El,ref:()=>Cl});var El,Gn,Yn,Cl,os=y(()=>{L();pt();q();El=()=>new Gn,Gn=class{},Yn=new WeakMap,Cl=T(class extends $e{render(r){return E}update(r,[e]){var t;let n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.dt=(t=r.options)===null||t===void 0?void 0:t.host,this.rt(this.ct=r.element)),E}rt(r){var e;if(typeof this.Y=="function"){let t=(e=this.dt)!==null&&e!==void 0?e:globalThis,n=Yn.get(t);n===void 0&&(n=new WeakMap,Yn.set(t,n)),n.get(this.Y)!==void 0&&this.Y.call(this.dt,void 0),n.set(this.Y,r),r!==void 0&&this.Y.call(this.dt,r)}else this.Y.value=r}get lt(){var r,e,t;return typeof this.Y=="function"?(e=Yn.get((r=this.dt)!==null&&r!==void 0?r:globalThis))===null||e===void 0?void 0:e.get(this.Y):(t=this.Y)===null||t===void 0?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})});var ss={};I(ss,{repeat:()=>Tl});var is,Tl,as=y(()=>{L();q();ye();is=(r,e,t)=>{let n=new Map;for(let o=e;o<=t;o++)n.set(r[o],o);return n},Tl=T(class extends M{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("repeat() can only be used in text expressions")}ht(r,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);let o=[],i=[],s=0;for(let l of r)o[s]=n?n(l,s):s,i[s]=t(l,s),s++;return{values:i,keys:o}}render(r,e,t){return this.ht(r,e,t).values}update(r,[e,t,n]){var o;let i=ut(r),{values:s,keys:l}=this.ht(e,t,n);if(!Array.isArray(i))return this.ut=l,s;let a=(o=this.ut)!==null&&o!==void 0?o:this.ut=[],c=[],u,p,d=0,f=i.length-1,v=0,h=s.length-1;for(;d<=f&&v<=h;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(a[d]===l[v])c[v]=ue(i[d],s[v]),d++,v++;else if(a[f]===l[h])c[h]=ue(i[f],s[h]),f--,h--;else if(a[d]===l[h])c[h]=ue(i[d],s[h]),ne(r,c[h+1],i[d]),d++,h--;else if(a[f]===l[v])c[v]=ue(i[f],s[v]),ne(r,i[d],i[f]),f--,v++;else if(u===void 0&&(u=is(l,v,h),p=is(a,d,f)),u.has(a[d]))if(u.has(a[f])){let m=p.get(l[v]),b=m!==void 0?i[m]:null;if(b===null){let K=ne(r,i[d]);ue(K,s[v]),c[v]=K}else c[v]=ue(b,s[v]),ne(r,i[d],b),i[m]=null;v++}else Nt(i[f]),f--;else Nt(i[d]),d++;for(;v<=h;){let m=ne(r,c[h+1]);ue(m,s[v]),c[v++]=m}for(;d<=f;){let m=i[d++];m!==null&&Nt(m)}return this.ut=l,ge(r,c),A}})});var ls={};I(ls,{styleMap:()=>Ol});var Ol,cs=y(()=>{L();q();Ol=T(class extends M{constructor(r){var e;if(super(r),r.type!==O.ATTRIBUTE||r.name!=="style"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce(((e,t)=>{let n=r[t];return n==null?e:e+`${t=t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(r,[e]){let{style:t}=r.element;if(this.vt===void 0){this.vt=new Set;for(let n in e)this.vt.add(n);return this.render(e)}this.vt.forEach((n=>{e[n]==null&&(this.vt.delete(n),n.includes("-")?t.removeProperty(n):t[n]="")}));for(let n in e){let o=e[n];o!=null&&(this.vt.add(n),n.includes("-")?t.setProperty(n,o):t[n]=o)}return A}})});var us={};I(us,{templateContent:()=>kl});var kl,ps=y(()=>{L();q();kl=T(class extends M{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.ft===r?A:(this.ft=r,document.importNode(r.content,!0))}})});var fs={};I(fs,{UnsafeHTMLDirective:()=>Ie,unsafeHTML:()=>Pl});var Ie,Pl,Jn=y(()=>{L();q();Ie=class extends M{constructor(e){if(super(e),this.it=E,e.type!==O.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===E||e==null)return this._t=void 0,this.it=e;if(e===A)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ie.directiveName="unsafeHTML",Ie.resultType=1;Pl=T(Ie)});var ds={};I(ds,{unsafeSVG:()=>Il});var Bt,Il,hs=y(()=>{q();Jn();Bt=class extends Ie{};Bt.directiveName="unsafeSVG",Bt.resultType=2;Il=T(Bt)});var vs={};I(vs,{UntilDirective:()=>Hr,until:()=>Rl});var ms,Hr,Rl,gs=y(()=>{L();ye();pt();Bn();q();ms=r=>!qt(r)&&typeof r.then=="function",Hr=class extends $e{constructor(){super(...arguments),this._$Cwt=1073741823,this._$Cyt=[],this._$CK=new dt(this),this._$CX=new ht}render(...e){var t;return(t=e.find((n=>!ms(n))))!==null&&t!==void 0?t:A}update(e,t){let n=this._$Cyt,o=n.length;this._$Cyt=t;let i=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let l=0;l<t.length&&!(l>this._$Cwt);l++){let a=t[l];if(!ms(a))return this._$Cwt=l,a;l<o&&a===n[l]||(this._$Cwt=1073741823,o=0,Promise.resolve(a).then((async c=>{for(;s.get();)await s.get();let u=i.deref();if(u!==void 0){let p=u._$Cyt.indexOf(a);p>-1&&p<u._$Cwt&&(u._$Cwt=p,u.setValue(c))}})))}return A}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},Rl=T(Hr)});var ys={};I(ys,{choose:()=>Ml});var Ml,bs=y(()=>{Ml=(r,e,t)=>{for(let n of e)if(n[0]===r)return(0,n[1])();return t?.()}});var xs={};I(xs,{join:()=>jl});function*jl(r,e){let t=typeof e=="function";if(r!==void 0){let n=-1;for(let o of r)n>-1&&(yield t?e(n):e),n++,yield o}}var ws=y(()=>{});var _s={};I(_s,{keyed:()=>Ll});var Ll,Ss=y(()=>{L();q();ye();Ll=T(class extends M{constructor(){super(...arguments),this.key=E}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(ge(r),this.key=e),t}})});var $s={};I($s,{map:()=>Ul});function*Ul(r,e){if(r!==void 0){let t=0;for(let n of r)yield e(n,t++)}}var As=y(()=>{});var Es={};I(Es,{range:()=>Dl});function*Dl(r,e,t=1){let n=e===void 0?0:r;e!=null||(e=r);for(let o=n;t>0?o<e:e<o;o+=t)yield o}var Cs=y(()=>{});var Ts={};I(Ts,{when:()=>ql});function ql(r,e,t){return r?e():t?.()}var Os=y(()=>{});var Kt=xe($=>{"use strict";var Nl=$&&$.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),k=$&&$.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Nl(e,r,t)};Object.defineProperty($,"__esModule",{value:!0});k(vi(),$);k(xi(),$);k((L(),C(Mr)),$);k((q(),C(Tn)),$);k((In(),C(Si)),$);k(($i(),C(il)),$);k(Ai(),$);k((ye(),C(yi)),$);k((pt(),C(On)),$);k((Hi(),C(Fi)),$);k((zi(),C(Wi)),$);k((Yi(),C(Ki)),$);k((Kn(),C(Bi)),$);k((Ji(),C(Gi)),$);k((Xi(),C(Zi)),$);k((es(),C(Qi)),$);k((rs(),C(ts)),$);k((os(),C(ns)),$);k((as(),C(ss)),$);k((cs(),C(ls)),$);k((ps(),C(us)),$);k((Jn(),C(fs)),$);k((hs(),C(ds)),$);k((gs(),C(vs)),$);k((bs(),C(ys)),$);k((ws(),C(xs)),$);k((Ss(),C(_s)),$);k((As(),C($s)),$);k((Cs(),C(Es)),$);k((Os(),C(Ts)),$)});var ks=xe(fe=>{"use strict";var Yt=fe&&fe.__decorate||function(r,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},Wr=fe&&fe.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Fl=fe&&fe.__awaiter||function(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(u){try{c(n.next(u))}catch(p){s(p)}}function a(u){try{c(n.throw(u))}catch(p){s(p)}}function c(u){u.done?i(u.value):o(u.value).then(l,a)}c((n=n.apply(r,e||[])).next())})};Object.defineProperty(fe,"__esModule",{value:!0});fe.Renderer=void 0;var W=Kt();function Hl(r){return function(e){if(!window.customElements.get(r.selector))return(0,W.Component)(r)(e)}}var Ke=class extends W.LitElement{constructor(){super(...arguments),this.options={state:{},render:(e,t,n)=>(0,W.html)` ${e} `,style:(0,W.css)``,styles:[],deepCloneState:!1,loading:()=>(0,W.html)``,error:e=>(0,W.html)`${e?.message}`},this.loading=!0,this.state={}}OnUpdateFirst(){var e,t,n;return Fl(this,void 0,void 0,function*(){!((e=this.options)===null||e===void 0)&&e.style&&(0,W.adoptStyles)(this.shadowRoot,[this.options.style]),!((n=(t=this.options)===null||t===void 0?void 0:t.styles)===null||n===void 0)&&n.length&&(0,W.adoptStyles)(this.shadowRoot,this.options.styles),this.options.state=yield this.options.state,this.options.state&&(this.isObservable(this.options.state)?this.subscription=this.options.state.subscribe(o=>{this.state=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onData",{detail:o}))},o=>{this.state=null,this.error=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onError",{detail:o}))}):(this.loading=!1,this.state=this.options.state),yield this.updateComplete,yield new Promise(requestAnimationFrame),this.dispatchEvent(new CustomEvent("loaded")))})}isObservable(e){return this.isFunction(e.lift)&&this.isFunction(e.subscribe)}isFunction(e){return typeof e=="function"}OnDestroy(){this.subscription&&this.subscription.unsubscribe()}renderContent(){if(!this.error&&this.options.render){let e=this.options.render(this.options.deepCloneState?JSON.parse(JSON.stringify(this.state)):this.state,t=>this.state=Object.assign({},t),this.shadowRoot);return e?.strings?e:(0,W.html)``}return this.state}};fe.Renderer=Ke;Yt([(0,W.property)({type:Object}),Wr("design:type",Object)],Ke.prototype,"options",void 0);Yt([(0,W.property)({type:Boolean}),Wr("design:type",Object)],Ke.prototype,"loading",void 0);Yt([(0,W.property)({type:Object}),Wr("design:type",Error)],Ke.prototype,"error",void 0);Yt([(0,W.property)(),Wr("design:type",Object)],Ke.prototype,"state",void 0);fe.Renderer=Ke=Yt([Hl({selector:"r-renderer",template(){return(0,W.html)`
|
|
15
|
+
`),v):(typeof f=="function"?La(r,f,{extends:e.extends}):Ua(r,f,{extends:e.extends}),f)},Na=r=>qa(r.selector,r);ct.Component=Na});var hi=xe(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0})});var vi=xe(Te=>{"use strict";var Fa=Te&&Te.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),mi=Te&&Te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Fa(e,r,t)};Object.defineProperty(Te,"__esModule",{value:!0});mi(fi(),Te);mi(hi(),Te)});var Tn={};R(Tn,{Directive:()=>j,PartType:()=>O,directive:()=>T});var O,T,j,q=y(()=>{O={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},T=r=>(...e)=>({_$litDirective$:r,values:e}),j=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}});var yi={};R(yi,{TemplateResultType:()=>Wa,clearPart:()=>Ft,getCommittedValue:()=>ut,getDirectiveClass:()=>Va,insertPart:()=>ne,isDirectiveResult:()=>za,isPrimitive:()=>qt,isSingleExpression:()=>Be,isTemplateResult:()=>Oe,removePart:()=>Nt,setChildPartValue:()=>ue,setCommittedValue:()=>ge});var Ha,qt,Wa,Oe,za,Va,Be,gi,ne,ue,Ba,ge,ut,Nt,Ft,ye=y(()=>{L();({I:Ha}=lt),qt=r=>r===null||typeof r!="object"&&typeof r!="function",Wa={HTML:1,SVG:2},Oe=(r,e)=>e===void 0?r?._$litType$!==void 0:r?._$litType$===e,za=r=>r?._$litDirective$!==void 0,Va=r=>r?._$litDirective$,Be=r=>r.strings===void 0,gi=()=>document.createComment(""),ne=(r,e,t)=>{var n;let o=r._$AA.parentNode,i=e===void 0?r._$AB:e._$AA;if(t===void 0){let s=o.insertBefore(gi(),i),l=o.insertBefore(gi(),i);t=new Ha(s,l,r,r.options)}else{let s=t._$AB.nextSibling,l=t._$AM,a=l!==r;if(a){let c;(n=t._$AQ)===null||n===void 0||n.call(t,r),t._$AM=r,t._$AP!==void 0&&(c=r._$AU)!==l._$AU&&t._$AP(c)}if(s!==i||a){let c=t._$AA;for(;c!==s;){let u=c.nextSibling;o.insertBefore(c,i),c=u}}}return t},ue=(r,e,t=r)=>(r._$AI(e,t),r),Ba={},ge=(r,e=Ba)=>r._$AH=e,ut=r=>r._$AH,Nt=r=>{var e;(e=r._$AP)===null||e===void 0||e.call(r,!1,!0);let t=r._$AA,n=r._$AB.nextSibling;for(;t!==n;){let o=t.nextSibling;t.remove(),t=o}},Ft=r=>{r._$AR()}});var On={};R(On,{AsyncDirective:()=>$e,Directive:()=>j,PartType:()=>O,directive:()=>T});function Ka(r){this._$AN!==void 0?(Lr(this),this._$AM=r,bi(this)):this._$AM=r}function Ya(r,e=!1,t=0){let n=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(n))for(let i=t;i<n.length;i++)Ht(n[i],!1),Lr(n[i]);else n!=null&&(Ht(n,!1),Lr(n));else Ht(this,r)}var Ht,Lr,bi,Ga,$e,pt=y(()=>{ye();q();q();Ht=(r,e)=>{var t,n;let o=r._$AN;if(o===void 0)return!1;for(let i of o)(n=(t=i)._$AO)===null||n===void 0||n.call(t,e,!1),Ht(i,e);return!0},Lr=r=>{let e,t;do{if((e=r._$AM)===void 0)break;t=e._$AN,t.delete(r),r=e}while(t?.size===0)},bi=r=>{for(let e;e=r._$AM;r=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(r))break;t.add(r),Ga(e)}};Ga=r=>{var e,t,n,o;r.type==O.CHILD&&((e=(n=r)._$AP)!==null&&e!==void 0||(n._$AP=Ya),(t=(o=r)._$AQ)!==null&&t!==void 0||(o._$AQ=Ka))},$e=class extends j{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,n){super._$AT(e,t,n),bi(this),this.isConnected=e._$AU}_$AO(e,t=!0){var n,o;e!==this.isConnected&&(this.isConnected=e,e?(n=this.reconnected)===null||n===void 0||n.call(this):(o=this.disconnected)===null||o===void 0||o.call(this)),t&&(Ht(this,e),Lr(this))}setValue(e){if(Be(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}});var xi=xe(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.async=void 0;var Ja=(q(),C(Tn)),Za=(pt(),C(On)),Xa=(L(),C(jr)),kn=class extends Za.AsyncDirective{render(e){return"then"in e?(Promise.resolve(e).then(t=>this.setValue(t)),""):(this.observable!==e&&(this.unsubscribe(),this.observable=e,this.isConnected&&this.subscribe(e)),Xa.noChange)}subscribe(e){this.subscription=e.subscribe(t=>{this.setValue(t)})}disconnected(){this.unsubscribe()}unsubscribe(){this.subscription&&this.subscription.unsubscribe()}reconnected(){this.subscribe(this.observable)}};Ur.async=(0,Ja.directive)(kn)});var Si={};R(Si,{digestForTemplateResult:()=>_i,hydrate:()=>Pn});var Qa,el,wi,Wt,tl,Pn,rl,nl,ol,_i,In=y(()=>{L();q();ye();({R:Qa,D:el,V:wi,I:Wt,F:tl}=lt),Pn=(r,e,t={})=>{if(e._$litPart$!==void 0)throw Error("container already contains a live render");let n,o,i=[],s=document.createTreeWalker(e,NodeFilter.SHOW_COMMENT,null,!1),l;for(;(l=s.nextNode())!==null;){let a=l.data;if(a.startsWith("lit-part")){if(i.length===0&&n!==void 0)throw Error("there must be only one root part per container");o=rl(r,l,i,t),n!=null||(n=o)}else if(a.startsWith("lit-node"))ol(l,i,t);else if(a.startsWith("/lit-part")){if(i.length===1&&o!==n)throw Error("internal error");o=nl(l,o,i)}}console.assert(n!==void 0,"there should be exactly one root part in a render container"),e._$litPart$=n},rl=(r,e,t,n)=>{let o,i;if(t.length===0)i=new Wt(e,null,void 0,n),o=r;else{let s=t[t.length-1];if(s.type==="template-instance")i=new Wt(e,null,s.instance,n),s.instance.u.push(i),o=s.result.values[s.instancePartIndex++],s.templatePartIndex++;else if(s.type==="iterable"){i=new Wt(e,null,s.part,n);let l=s.iterator.next();if(l.done)throw o=void 0,s.done=!0,Error("Unhandled shorter than expected iterable");o=l.value,s.part._$AH.push(i)}else i=new Wt(e,null,s.part,n)}if(o=wi(i,o),o===A)t.push({part:i,type:"leaf"});else if(qt(o))t.push({part:i,type:"leaf"}),i._$AH=o;else if(Oe(o)){let s="lit-part "+_i(o);if(e.data!==s)throw Error("Hydration value mismatch: Unexpected TemplateResult rendered to part");{let l=Wt.prototype._$AC(o),a=new Qa(l,i);t.push({type:"template-instance",instance:a,part:i,templatePartIndex:0,instancePartIndex:0,result:o}),i._$AH=a}}else el(o)?(t.push({part:i,type:"iterable",value:o,iterator:o[Symbol.iterator](),done:!1}),i._$AH=[]):(t.push({part:i,type:"leaf"}),i._$AH=o??"");return i},nl=(r,e,t)=>{if(e===void 0)throw Error("unbalanced part marker");e._$AB=r;let n=t.pop();if(n.type==="iterable"&&!n.iterator.next().done)throw Error("unexpected longer than expected iterable");if(t.length>0)return t[t.length-1].part},ol=(r,e,t)=>{var n;let o=/lit-node (\d+)/.exec(r.data),i=parseInt(o[1]),s=(n=r.previousElementSibling)!==null&&n!==void 0?n:r.parentElement;if(s===null)throw Error("could not find node for attribute parts");s.removeAttribute("defer-hydration");let l=e[e.length-1];if(l.type!=="template-instance")throw Error("internal error");{let a=l.instance;for(;;){let c=a._$AD.parts[l.templatePartIndex];if(c===void 0||c.type!==O.ATTRIBUTE&&c.type!==O.ELEMENT||c.index!==i)break;if(c.type===O.ATTRIBUTE){let u=new c.ctor(s,c.name,c.strings,l.instance,t),p=Be(u)?l.result.values[l.instancePartIndex]:l.result.values,d=!(u.type===O.EVENT||u.type===O.PROPERTY);u._$AI(p,u,l.instancePartIndex,d),l.instancePartIndex+=c.strings.length-1,a.u.push(u)}else{let u=new tl(s,l.instance,t);wi(u,l.result.values[l.instancePartIndex++]),a.u.push(u)}l.templatePartIndex++}}},_i=r=>{let e=new Uint32Array(2).fill(5381);for(let t of r.strings)for(let n=0;n<t.length;n++)e[n%2]=33*e[n%2]^t.charCodeAt(n);return btoa(String.fromCharCode(...new Uint8Array(e.buffer)))}});var il={};var $i=y(()=>{L();In();globalThis.litElementHydrateSupport=({LitElement:r})=>{let e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(r),"observedAttributes").get;Object.defineProperty(r,"observedAttributes",{get(){return[...e.call(this),"defer-hydration"]}});let t=r.prototype.attributeChangedCallback;r.prototype.attributeChangedCallback=function(s,l,a){s==="defer-hydration"&&a===null&&n.call(this),t.call(this,s,l,a)};let n=r.prototype.connectedCallback;r.prototype.connectedCallback=function(){this.hasAttribute("defer-hydration")||n.call(this)};let o=r.prototype.createRenderRoot;r.prototype.createRenderRoot=function(){return this.shadowRoot?(this._$AG=!0,this.shadowRoot):o.call(this)};let i=Object.getPrototypeOf(r.prototype).update;r.prototype.update=function(s){let l=this.render();i.call(this,s),this._$AG?(this._$AG=!1,Pn(l,this.renderRoot,this.renderOptions)):Ce(l,this.renderRoot,this.renderOptions)}}});var Ai=xe(()=>{(function(r){typeof define=="function"&&define.amd?define(r):r()})((function(){"use strict";var r,e=new Set,t=new Map;(r=globalThis.litHtmlPolyfillSupport)!==null&&r!==void 0||(globalThis.litHtmlPolyfillSupport=function(n,o){if(window.ShadyCSS!==void 0&&(!window.ShadyCSS.nativeShadow||window.ShadyCSS.ApplyShim)){var i=function(f){return f!==void 0&&!e.has(f)},s=function(f){var v=t.get(f);return v===void 0&&t.set(f,v=[]),v},l=new Map,a=n.createElement;n.createElement=function(f,v){var h=a.call(n,f,v),m=v?.scope;if(m!==void 0&&(window.ShadyCSS.nativeShadow||window.ShadyCSS.prepareTemplateDom(h,m),i(m))){var b=s(m),K=h.content.querySelectorAll("style");b.push.apply(b,Array.from(K).map((function(ie){var be;return(be=ie.parentNode)===null||be===void 0||be.removeChild(ie),ie.textContent})))}return h};var c=document.createDocumentFragment(),u=document.createComment(""),p=o.prototype,d=p._$AI;p._$AI=function(f,v){var h,m;v===void 0&&(v=this);var b=this._$AA.parentNode,K=(h=this.options)===null||h===void 0?void 0:h.scope;if(b instanceof ShadowRoot&&i(K)){var ie=this._$AA,be=this._$AB;c.appendChild(u),this._$AA=u,this._$AB=null,d.call(this,f,v);var Me=f?._$litType$?this._$AH._$AD.el:document.createElement("template");if((function(er,tr){var rr,so=s(er),ao=so.length!==0;ao&&((rr=document.createElement("style")).textContent=so.join(`
|
|
16
|
+
`),tr.content.appendChild(rr)),e.add(er),t.delete(er),window.ShadyCSS.prepareTemplateStyles(tr,er),ao&&window.ShadyCSS.nativeShadow&&(rr=tr.content.querySelector("style"))!==null&&tr.content.appendChild(rr)})(K,Me),c.removeChild(u),(m=window.ShadyCSS)===null||m===void 0?void 0:m.nativeShadow){var je=Me.content.querySelector("style");je!==null&&c.appendChild(je.cloneNode(!0))}b.insertBefore(c,be),this._$AA=ie,this._$AB=be}else d.call(this,f,v)},p._$AC=function(f){var v,h=(v=this.options)===null||v===void 0?void 0:v.scope,m=l.get(h);m===void 0&&l.set(h,m=new Map);var b=m.get(f.strings);return b===void 0&&m.set(f.strings,b=new n(f,this.options)),b}}})}))});var Dr,zt,Rn,Ei,ft,Mn,Ci,qr,Vt,jn=y(()=>{Dr=window,zt=Dr.ShadowRoot&&(Dr.ShadyCSS===void 0||Dr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rn=Symbol(),Ei=new WeakMap,ft=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Rn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(zt&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Ei.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Ei.set(t,e))}return e}toString(){return this.cssText}},Mn=r=>new ft(typeof r=="string"?r:r+"",void 0,Rn),Ci=(r,...e)=>{let t=r.length===1?r[0]:e.reduce(((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+r[i+1]),r[0]);return new ft(t,r,Rn)},qr=(r,e)=>{zt?r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((t=>{let n=document.createElement("style"),o=Dr.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=t.cssText,r.appendChild(n)}))},Vt=zt?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Mn(t)})(r):r});var Ln,Nr,Ti,sl,Oi,Fr,Dn,Un,pe,Hr=y(()=>{jn();jn();Nr=window,Ti=Nr.trustedTypes,sl=Ti?Ti.emptyScript:"",Oi=Nr.reactiveElementPolyfillSupport,Fr={toAttribute(r,e){switch(e){case Boolean:r=r?sl:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Dn=(r,e)=>e!==r&&(e==e||r==r),Un={attribute:!0,type:String,converter:Fr,reflect:!1,hasChanged:Dn},pe=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach(((t,n)=>{let o=this._$Ep(n,t);o!==void 0&&(this._$Ev.set(o,n),e.push(o))})),e}static createProperty(e,t=Un){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let n=typeof e=="symbol"?Symbol():"__"+e,o=this.getPropertyDescriptor(e,n,t);o!==void 0&&Object.defineProperty(this.prototype,e,o)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(o){let i=this[e];this[t]=o,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Un}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let o of n)this.createProperty(o,t[o])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let o of n)t.unshift(Vt(o))}else e!==void 0&&t.push(Vt(e));return t}static _$Ep(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach((t=>t(this)))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return qr(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach((t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)}))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=Un){var o;let i=this.constructor._$Ep(e,n);if(i!==void 0&&n.reflect===!0){let s=(((o=n.converter)===null||o===void 0?void 0:o.toAttribute)!==void 0?n.converter:Fr).toAttribute(t,n.type);this._$El=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$El=null}}_$AK(e,t){var n;let o=this.constructor,i=o._$Ev.get(e);if(i!==void 0&&this._$El!==i){let s=o.getPropertyOptions(i),l=typeof s.converter=="function"?{fromAttribute:s.converter}:((n=s.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?s.converter:Fr;this._$El=i,this[i]=l.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,n){let o=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Dn)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((o,i)=>this[i]=o)),this._$Ei=void 0);let t=!1,n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach((o=>{var i;return(i=o.hostUpdate)===null||i===void 0?void 0:i.call(o)})),this.update(n)):this._$Ek()}catch(o){throw t=!1,this._$Ek(),o}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach((n=>{var o;return(o=n.hostUpdated)===null||o===void 0?void 0:o.call(n)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach(((t,n)=>this._$EO(n,this[n],t))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};pe.finalized=!0,pe.elementProperties=new Map,pe.elementStyles=[],pe.shadowRootOptions={mode:"open"},Oi?.({ReactiveElement:pe}),((Ln=Nr.reactiveElementVersions)!==null&&Ln!==void 0?Ln:Nr.reactiveElementVersions=[]).push("1.5.0")});var qn,Nn,Pi,ke,ki,Ii,Ri=y(()=>{Hr();Hr();L();L();Pi=pe,ke=class extends pe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let n=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=n.firstChild),n}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ce(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return A}};ke.finalized=!0,ke._$litElement$=!0,(qn=globalThis.litElementHydrateSupport)===null||qn===void 0||qn.call(globalThis,{LitElement:ke});ki=globalThis.litElementPolyfillSupport;ki?.({LitElement:ke});Ii={_$AK:(r,e,t)=>{r._$AK(e,t)},_$AL:r=>r._$AL};((Nn=globalThis.litElementVersions)!==null&&Nn!==void 0?Nn:globalThis.litElementVersions=[]).push("3.2.2")});var al,ll,Q,Pe=y(()=>{al=(r,e,t)=>{Object.defineProperty(e,t,r)},ll=(r,e)=>({kind:"method",placement:"prototype",key:e.key,descriptor:r}),Q=({finisher:r,descriptor:e})=>(t,n)=>{var o;if(n===void 0){let i=(o=t.originalKey)!==null&&o!==void 0?o:t.key,s=e!=null?{kind:"method",placement:"prototype",key:i,descriptor:e(t.key)}:{...t,key:i};return r!=null&&(s.finisher=function(l){r(l,i)}),s}{let i=t.constructor;e!==void 0&&Object.defineProperty(t,n,e(n)),r?.(i,n)}}});var cl,Mi=y(()=>{cl=r=>e=>typeof e=="function"?((t,n)=>(customElements.define(t,n),n))(r,e):((t,n)=>{let{kind:o,elements:i}=n;return{kind:o,elements:i,finisher(s){customElements.define(t,s)}}})(r,e)});function Fn(r){return(e,t)=>t!==void 0?((n,o,i)=>{o.constructor.createProperty(i,n)})(r,e,t):ul(r,e)}var ul,Hn=y(()=>{ul=(r,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,r)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,r)}}});function pl(r){return Fn({...r,state:!0})}var ji=y(()=>{Hn();});function fl(r){return Q({finisher:(e,t)=>{Object.assign(e.prototype[t],r)}})}var Li=y(()=>{Pe();});function dl(r,e){return Q({descriptor:t=>{let n={get(){var o,i;return(i=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(r))!==null&&i!==void 0?i:null},enumerable:!0,configurable:!0};if(e){let o=typeof t=="symbol"?Symbol():"__"+t;n.get=function(){var i,s;return this[o]===void 0&&(this[o]=(s=(i=this.renderRoot)===null||i===void 0?void 0:i.querySelector(r))!==null&&s!==void 0?s:null),this[o]}}return n}})}var Ui=y(()=>{Pe();});function hl(r){return Q({descriptor:e=>({get(){var t,n;return(n=(t=this.renderRoot)===null||t===void 0?void 0:t.querySelectorAll(r))!==null&&n!==void 0?n:[]},enumerable:!0,configurable:!0})})}var Di=y(()=>{Pe();});function ml(r){return Q({descriptor:e=>({async get(){var t;return await this.updateComplete,(t=this.renderRoot)===null||t===void 0?void 0:t.querySelector(r)},enumerable:!0,configurable:!0})})}var qi=y(()=>{Pe();});function zn(r){let{slot:e,selector:t}=r??{};return Q({descriptor:n=>({get(){var o;let i="slot"+(e?`[name=${e}]`:":not([name])"),s=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(i),l=s!=null?vl(s,r):[];return t?l.filter((a=>a.matches(t))):l},enumerable:!0,configurable:!0})})}var Wn,vl,Vn=y(()=>{Pe();vl=((Wn=window.HTMLSlotElement)===null||Wn===void 0?void 0:Wn.prototype.assignedElements)!=null?(r,e)=>r.assignedElements(e):(r,e)=>r.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE))});function gl(r,e,t){let n,o=r;return typeof r=="object"?(o=r.slot,n=r):n={flatten:e},t?zn({slot:o,flatten:e,selector:t}):Q({descriptor:i=>({get(){var s,l;let a="slot"+(o?`[name=${o}]`:":not([name])"),c=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(a);return(l=c?.assignedNodes(n))!==null&&l!==void 0?l:[]},enumerable:!0,configurable:!0})})}var Ni=y(()=>{Pe();Vn();});var Fi={};R(Fi,{CSSResult:()=>ft,LitElement:()=>ke,ReactiveElement:()=>pe,UpdatingElement:()=>Pi,_$LE:()=>Ii,_$LH:()=>lt,adoptStyles:()=>qr,css:()=>Ci,customElement:()=>cl,decorateProperty:()=>Q,defaultConverter:()=>Fr,eventOptions:()=>fl,getCompatibleStyle:()=>Vt,html:()=>li,legacyPrototypeMethod:()=>al,noChange:()=>A,notEqual:()=>Dn,nothing:()=>E,property:()=>Fn,query:()=>dl,queryAll:()=>hl,queryAssignedElements:()=>zn,queryAssignedNodes:()=>gl,queryAsync:()=>ml,render:()=>Ce,standardPrototypeMethod:()=>ll,state:()=>pl,supportsAdoptingStyleSheets:()=>zt,svg:()=>ci,unsafeCSS:()=>Mn});var Hi=y(()=>{Hr();L();Ri();Pe();Mi();Hn();ji();Li();Ui();Di();qi();Vn();Ni();console.warn("The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'. See https://lit.dev/msg/deprecated-import-path for more information.")});var Wi={};R(Wi,{classMap:()=>yl});var yl,zi=y(()=>{L();q();yl=T(class extends j{constructor(r){var e;if(super(r),r.type!==O.ATTRIBUTE||r.name!=="class"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(r){return" "+Object.keys(r).filter((e=>r[e])).join(" ")+" "}update(r,[e]){var t,n;if(this.nt===void 0){this.nt=new Set,r.strings!==void 0&&(this.st=new Set(r.strings.join(" ").split(/\s/).filter((i=>i!==""))));for(let i in e)e[i]&&!(!((t=this.st)===null||t===void 0)&&t.has(i))&&this.nt.add(i);return this.render(e)}let o=r.element.classList;this.nt.forEach((i=>{i in e||(o.remove(i),this.nt.delete(i))}));for(let i in e){let s=!!e[i];s===this.nt.has(i)||!((n=this.st)===null||n===void 0)&&n.has(i)||(s?(o.add(i),this.nt.add(i)):(o.remove(i),this.nt.delete(i)))}return A}})});var Vi,dt,ht,Bn=y(()=>{Vi=async(r,e)=>{for await(let t of r)if(await e(t)===!1)return},dt=class{constructor(e){this.Y=e}disconnect(){this.Y=void 0}reconnect(e){this.Y=e}deref(){return this.Y}},ht=class{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){var e;(e=this.Z)!==null&&e!==void 0||(this.Z=new Promise((t=>this.q=t)))}resume(){var e;(e=this.q)===null||e===void 0||e.call(this),this.Z=this.q=void 0}}});var Bi={};R(Bi,{AsyncReplaceDirective:()=>mt,asyncReplace:()=>bl});var mt,bl,Kn=y(()=>{L();pt();Bn();q();mt=class extends $e{constructor(){super(...arguments),this._$CK=new dt(this),this._$CX=new ht}render(e,t){return A}update(e,[t,n]){if(this.isConnected||this.disconnected(),t===this._$CJ)return;this._$CJ=t;let o=0,{_$CK:i,_$CX:s}=this;return Vi(t,(async l=>{for(;s.get();)await s.get();let a=i.deref();if(a!==void 0){if(a._$CJ!==t)return!1;n!==void 0&&(l=n(l,o)),a.commitValue(l,o),o++}return!0})),A}commitValue(e,t){this.setValue(e)}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},bl=T(mt)});var Ki={};R(Ki,{asyncAppend:()=>xl});var xl,Yi=y(()=>{q();Kn();ye();xl=T(class extends mt{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("asyncAppend can only be used in child expressions")}update(r,e){return this._$Ctt=r,super.update(r,e)}commitValue(r,e){e===0&&Ft(this._$Ctt);let t=ne(this._$Ctt);ue(t,r)}})});var Gi={};R(Gi,{cache:()=>wl});var wl,Ji=y(()=>{L();q();ye();wl=T(class extends j{constructor(r){super(r),this.et=new WeakMap}render(r){return[r]}update(r,[e]){if(Oe(this.it)&&(!Oe(e)||this.it.strings!==e.strings)){let t=ut(r).pop(),n=this.et.get(this.it.strings);if(n===void 0){let o=document.createDocumentFragment();n=Ce(E,o),n.setConnected(!1),this.et.set(this.it.strings,n)}ge(n,[t]),ne(n,void 0,t)}if(Oe(e)){if(!Oe(this.it)||this.it.strings!==e.strings){let t=this.et.get(e.strings);if(t!==void 0){let n=ut(t).pop();Ft(r),ne(r,void 0,n),ge(r,[n])}}this.it=e}else this.it=void 0;return this.render(e)}})});var Zi={};R(Zi,{guard:()=>Sl});var _l,Sl,Xi=y(()=>{L();q();_l={},Sl=T(class extends j{constructor(){super(...arguments),this.ot=_l}render(r,e){return e()}update(r,[e,t]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((n,o)=>n===this.ot[o])))return A}else if(this.ot===e)return A;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,t)}})});var Qi={};R(Qi,{ifDefined:()=>$l});var $l,es=y(()=>{L();$l=r=>r??E});var ts={};R(ts,{live:()=>Al});var Al,rs=y(()=>{L();q();ye();Al=T(class extends j{constructor(r){if(super(r),r.type!==O.PROPERTY&&r.type!==O.ATTRIBUTE&&r.type!==O.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Be(r))throw Error("`live` bindings can only contain a single expression")}render(r){return r}update(r,[e]){if(e===A||e===E)return e;let t=r.element,n=r.name;if(r.type===O.PROPERTY){if(e===t[n])return A}else if(r.type===O.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(n))return A}else if(r.type===O.ATTRIBUTE&&t.getAttribute(n)===e+"")return A;return ge(r),e}})});var ns={};R(ns,{createRef:()=>El,ref:()=>Cl});var El,Gn,Yn,Cl,os=y(()=>{L();pt();q();El=()=>new Gn,Gn=class{},Yn=new WeakMap,Cl=T(class extends $e{render(r){return E}update(r,[e]){var t;let n=e!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.dt=(t=r.options)===null||t===void 0?void 0:t.host,this.rt(this.ct=r.element)),E}rt(r){var e;if(typeof this.Y=="function"){let t=(e=this.dt)!==null&&e!==void 0?e:globalThis,n=Yn.get(t);n===void 0&&(n=new WeakMap,Yn.set(t,n)),n.get(this.Y)!==void 0&&this.Y.call(this.dt,void 0),n.set(this.Y,r),r!==void 0&&this.Y.call(this.dt,r)}else this.Y.value=r}get lt(){var r,e,t;return typeof this.Y=="function"?(e=Yn.get((r=this.dt)!==null&&r!==void 0?r:globalThis))===null||e===void 0?void 0:e.get(this.Y):(t=this.Y)===null||t===void 0?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})});var ss={};R(ss,{repeat:()=>Tl});var is,Tl,as=y(()=>{L();q();ye();is=(r,e,t)=>{let n=new Map;for(let o=e;o<=t;o++)n.set(r[o],o);return n},Tl=T(class extends j{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("repeat() can only be used in text expressions")}ht(r,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);let o=[],i=[],s=0;for(let l of r)o[s]=n?n(l,s):s,i[s]=t(l,s),s++;return{values:i,keys:o}}render(r,e,t){return this.ht(r,e,t).values}update(r,[e,t,n]){var o;let i=ut(r),{values:s,keys:l}=this.ht(e,t,n);if(!Array.isArray(i))return this.ut=l,s;let a=(o=this.ut)!==null&&o!==void 0?o:this.ut=[],c=[],u,p,d=0,f=i.length-1,v=0,h=s.length-1;for(;d<=f&&v<=h;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(a[d]===l[v])c[v]=ue(i[d],s[v]),d++,v++;else if(a[f]===l[h])c[h]=ue(i[f],s[h]),f--,h--;else if(a[d]===l[h])c[h]=ue(i[d],s[h]),ne(r,c[h+1],i[d]),d++,h--;else if(a[f]===l[v])c[v]=ue(i[f],s[v]),ne(r,i[d],i[f]),f--,v++;else if(u===void 0&&(u=is(l,v,h),p=is(a,d,f)),u.has(a[d]))if(u.has(a[f])){let m=p.get(l[v]),b=m!==void 0?i[m]:null;if(b===null){let K=ne(r,i[d]);ue(K,s[v]),c[v]=K}else c[v]=ue(b,s[v]),ne(r,i[d],b),i[m]=null;v++}else Nt(i[f]),f--;else Nt(i[d]),d++;for(;v<=h;){let m=ne(r,c[h+1]);ue(m,s[v]),c[v++]=m}for(;d<=f;){let m=i[d++];m!==null&&Nt(m)}return this.ut=l,ge(r,c),A}})});var ls={};R(ls,{styleMap:()=>Ol});var Ol,cs=y(()=>{L();q();Ol=T(class extends j{constructor(r){var e;if(super(r),r.type!==O.ATTRIBUTE||r.name!=="style"||((e=r.strings)===null||e===void 0?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(r){return Object.keys(r).reduce(((e,t)=>{let n=r[t];return n==null?e:e+`${t=t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`}),"")}update(r,[e]){let{style:t}=r.element;if(this.vt===void 0){this.vt=new Set;for(let n in e)this.vt.add(n);return this.render(e)}this.vt.forEach((n=>{e[n]==null&&(this.vt.delete(n),n.includes("-")?t.removeProperty(n):t[n]="")}));for(let n in e){let o=e[n];o!=null&&(this.vt.add(n),n.includes("-")?t.setProperty(n,o):t[n]=o)}return A}})});var us={};R(us,{templateContent:()=>kl});var kl,ps=y(()=>{L();q();kl=T(class extends j{constructor(r){if(super(r),r.type!==O.CHILD)throw Error("templateContent can only be used in child bindings")}render(r){return this.ft===r?A:(this.ft=r,document.importNode(r.content,!0))}})});var fs={};R(fs,{UnsafeHTMLDirective:()=>Ie,unsafeHTML:()=>Pl});var Ie,Pl,Jn=y(()=>{L();q();Ie=class extends j{constructor(e){if(super(e),this.it=E,e.type!==O.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===E||e==null)return this._t=void 0,this.it=e;if(e===A)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Ie.directiveName="unsafeHTML",Ie.resultType=1;Pl=T(Ie)});var ds={};R(ds,{unsafeSVG:()=>Il});var Bt,Il,hs=y(()=>{q();Jn();Bt=class extends Ie{};Bt.directiveName="unsafeSVG",Bt.resultType=2;Il=T(Bt)});var vs={};R(vs,{UntilDirective:()=>Wr,until:()=>Rl});var ms,Wr,Rl,gs=y(()=>{L();ye();pt();Bn();q();ms=r=>!qt(r)&&typeof r.then=="function",Wr=class extends $e{constructor(){super(...arguments),this._$Cwt=1073741823,this._$Cyt=[],this._$CK=new dt(this),this._$CX=new ht}render(...e){var t;return(t=e.find((n=>!ms(n))))!==null&&t!==void 0?t:A}update(e,t){let n=this._$Cyt,o=n.length;this._$Cyt=t;let i=this._$CK,s=this._$CX;this.isConnected||this.disconnected();for(let l=0;l<t.length&&!(l>this._$Cwt);l++){let a=t[l];if(!ms(a))return this._$Cwt=l,a;l<o&&a===n[l]||(this._$Cwt=1073741823,o=0,Promise.resolve(a).then((async c=>{for(;s.get();)await s.get();let u=i.deref();if(u!==void 0){let p=u._$Cyt.indexOf(a);p>-1&&p<u._$Cwt&&(u._$Cwt=p,u.setValue(c))}})))}return A}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}},Rl=T(Wr)});var ys={};R(ys,{choose:()=>Ml});var Ml,bs=y(()=>{Ml=(r,e,t)=>{for(let n of e)if(n[0]===r)return(0,n[1])();return t?.()}});var xs={};R(xs,{join:()=>jl});function*jl(r,e){let t=typeof e=="function";if(r!==void 0){let n=-1;for(let o of r)n>-1&&(yield t?e(n):e),n++,yield o}}var ws=y(()=>{});var _s={};R(_s,{keyed:()=>Ll});var Ll,Ss=y(()=>{L();q();ye();Ll=T(class extends j{constructor(){super(...arguments),this.key=E}render(r,e){return this.key=r,e}update(r,[e,t]){return e!==this.key&&(ge(r),this.key=e),t}})});var $s={};R($s,{map:()=>Ul});function*Ul(r,e){if(r!==void 0){let t=0;for(let n of r)yield e(n,t++)}}var As=y(()=>{});var Es={};R(Es,{range:()=>Dl});function*Dl(r,e,t=1){let n=e===void 0?0:r;e!=null||(e=r);for(let o=n;t>0?o<e:e<o;o+=t)yield o}var Cs=y(()=>{});var Ts={};R(Ts,{when:()=>ql});function ql(r,e,t){return r?e():t?.()}var Os=y(()=>{});var Kt=xe($=>{"use strict";var Nl=$&&$.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var o=Object.getOwnPropertyDescriptor(e,t);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,o)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),k=$&&$.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Nl(e,r,t)};Object.defineProperty($,"__esModule",{value:!0});k(vi(),$);k(xi(),$);k((L(),C(jr)),$);k((q(),C(Tn)),$);k((In(),C(Si)),$);k(($i(),C(il)),$);k(Ai(),$);k((ye(),C(yi)),$);k((pt(),C(On)),$);k((Hi(),C(Fi)),$);k((zi(),C(Wi)),$);k((Yi(),C(Ki)),$);k((Kn(),C(Bi)),$);k((Ji(),C(Gi)),$);k((Xi(),C(Zi)),$);k((es(),C(Qi)),$);k((rs(),C(ts)),$);k((os(),C(ns)),$);k((as(),C(ss)),$);k((cs(),C(ls)),$);k((ps(),C(us)),$);k((Jn(),C(fs)),$);k((hs(),C(ds)),$);k((gs(),C(vs)),$);k((bs(),C(ys)),$);k((ws(),C(xs)),$);k((Ss(),C(_s)),$);k((As(),C($s)),$);k((Cs(),C(Es)),$);k((Os(),C(Ts)),$)});var ks=xe(fe=>{"use strict";var Yt=fe&&fe.__decorate||function(r,e,t,n){var o=arguments.length,i=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(o<3?s(i):o>3?s(e,t,i):s(e,t))||i);return o>3&&i&&Object.defineProperty(e,t,i),i},zr=fe&&fe.__metadata||function(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)},Fl=fe&&fe.__awaiter||function(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(u){try{c(n.next(u))}catch(p){s(p)}}function a(u){try{c(n.throw(u))}catch(p){s(p)}}function c(u){u.done?i(u.value):o(u.value).then(l,a)}c((n=n.apply(r,e||[])).next())})};Object.defineProperty(fe,"__esModule",{value:!0});fe.Renderer=void 0;var W=Kt();function Hl(r){return function(e){if(!window.customElements.get(r.selector))return(0,W.Component)(r)(e)}}var Ke=class extends W.LitElement{constructor(){super(...arguments),this.options={state:{},render:(e,t,n)=>(0,W.html)` ${e} `,style:(0,W.css)``,styles:[],deepCloneState:!1,loading:()=>(0,W.html)``,error:e=>(0,W.html)`${e?.message}`},this.loading=!0,this.state={}}OnUpdateFirst(){var e,t,n;return Fl(this,void 0,void 0,function*(){!((e=this.options)===null||e===void 0)&&e.style&&(0,W.adoptStyles)(this.shadowRoot,[this.options.style]),!((n=(t=this.options)===null||t===void 0?void 0:t.styles)===null||n===void 0)&&n.length&&(0,W.adoptStyles)(this.shadowRoot,this.options.styles),this.options.state=yield this.options.state,this.options.state&&(this.isObservable(this.options.state)?this.subscription=this.options.state.subscribe(o=>{this.state=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onData",{detail:o}))},o=>{this.state=null,this.error=o,this.loading=!1,this.dispatchEvent(new CustomEvent("onError",{detail:o}))}):(this.loading=!1,this.state=this.options.state),yield this.updateComplete,yield new Promise(requestAnimationFrame),this.dispatchEvent(new CustomEvent("loaded")))})}isObservable(e){return this.isFunction(e.lift)&&this.isFunction(e.subscribe)}isFunction(e){return typeof e=="function"}OnDestroy(){this.subscription&&this.subscription.unsubscribe()}renderContent(){if(!this.error&&this.options.render){let e=this.options.render(this.options.deepCloneState?JSON.parse(JSON.stringify(this.state)):this.state,t=>this.state=Object.assign({},t),this.shadowRoot);return e?.strings?e:(0,W.html)``}return this.state}};fe.Renderer=Ke;Yt([(0,W.property)({type:Object}),zr("design:type",Object)],Ke.prototype,"options",void 0);Yt([(0,W.property)({type:Boolean}),zr("design:type",Object)],Ke.prototype,"loading",void 0);Yt([(0,W.property)({type:Object}),zr("design:type",Error)],Ke.prototype,"error",void 0);Yt([(0,W.property)(),zr("design:type",Object)],Ke.prototype,"state",void 0);fe.Renderer=Ke=Yt([Hl({selector:"r-renderer",template(){return(0,W.html)`
|
|
17
17
|
${this.loading?"":this.renderContent()}
|
|
18
18
|
${this.loading?(0,W.html)`
|
|
19
19
|
${this.isFunction(this.options.loading)?this.options.loading():(0,W.html)``}
|
|
@@ -27,13 +27,13 @@ Possible Solutions:
|
|
|
27
27
|
@loaded=${Kl.bind(this)}
|
|
28
28
|
.options=${{state:t.bind(this).call(this,e),loading:n.bind(this),style:r.style,styles:r.styles,error:o.bind(this),deepCloneState:r.deepCloneState,render:(s,l,a)=>(this.shadowRoot.append(a),i(e).bind(this).call(this,s,l,a))}}
|
|
29
29
|
></r-renderer>
|
|
30
|
-
`}}));de.Partial=Yl;function Gl({Settings:r,Providers:e,State:t,Render:n,Loading:o,Error:i}){return(0,de.Partial)(r)(e)(t)(o)(i)(n)}de.Component=Gl});var
|
|
30
|
+
`}}));de.Partial=Yl;function Gl({Settings:r,Providers:e,State:t,Render:n,Loading:o,Error:i}){return(0,de.Partial)(r)(e)(t)(o)(i)(n)}de.Component=Gl});var ln=function(r,e){return ln=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])},ln(r,e)};function z(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ln(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function uo(r,e,t,n){function o(i){return i instanceof t?i:new t(function(s){s(i)})}return new(t||(t=Promise))(function(i,s){function l(u){try{c(n.next(u))}catch(p){s(p)}}function a(u){try{c(n.throw(u))}catch(p){s(p)}}function c(u){u.done?i(u.value):o(u.value).then(l,a)}c((n=n.apply(r,e||[])).next())})}function nr(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(c){return function(u){return a([c,u])}}function a(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(t=0)),t;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,o=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1],i=c;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(c);break}i[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function we(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function F(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(l){s={error:l}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return i}function H(r,e,t){if(t||arguments.length===2)for(var n=0,o=e.length,i;n<o;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function Le(r){return this instanceof Le?(this.v=r,this):new Le(r)}function po(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(f){return function(v){return Promise.resolve(v).then(f,p)}}function l(f,v){n[f]&&(o[f]=function(h){return new Promise(function(m,b){i.push([f,h,m,b])>1||a(f,h)})},v&&(o[f]=v(o[f])))}function a(f,v){try{c(n[f](v))}catch(h){d(i[0][3],h)}}function c(f){f.value instanceof Le?Promise.resolve(f.value.v).then(u,p):d(i[0][2],f)}function u(f){a("next",f)}function p(f){a("throw",f)}function d(f,v){f(v),i.shift(),i.length&&a(i[0][0],i[0][1])}}function fo(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof we=="function"?we(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(s){return new Promise(function(l,a){s=r[i](s),o(l,a,s.done,s.value)})}}function o(i,s,l,a){Promise.resolve(a).then(function(c){i({value:c,done:l})},s)}}function g(r){return typeof r=="function"}function or(r){var e=function(n){Error.call(n),n.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ir=or(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
31
31
|
`+t.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
32
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function Ue(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var Z=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var l=we(s),a=l.next();!a.done;a=l.next()){var c=a.value;c.remove(this)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else s.remove(this);var u=this.initialTeardown;if(g(u))try{u()}catch(h){i=h instanceof ir?h.errors:[h]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=we(p),f=d.next();!f.done;f=d.next()){var v=f.value;try{ho(v)}catch(h){i=i??[],h instanceof ir?i=H(H([],F(i)),F(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}}if(i)throw new ir(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)ho(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ue(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Ue(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})();var ln=Z.EMPTY;function sr(r){return r instanceof Z||r&&"closed"in r&&g(r.remove)&&g(r.add)&&g(r.unsubscribe)}function ho(r){g(r)?r():r.unsubscribe()}var se={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Qe={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=Qe.delegate;return o?.setTimeout?o.setTimeout.apply(o,H([r,e],F(t))):setTimeout.apply(void 0,H([r,e],F(t)))},clearTimeout:function(r){var e=Qe.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function ar(r){Qe.setTimeout(function(){var e=se.onUnhandledError;if(e)e(r);else throw r})}function ae(){}var mo=(function(){return cn("C",void 0,void 0)})();function vo(r){return cn("E",void 0,r)}function go(r){return cn("N",r,void 0)}function cn(r,e,t){return{kind:r,value:e,error:t}}var De=null;function et(r){if(se.useDeprecatedSynchronousErrorHandling){var e=!De;if(e&&(De={errorThrown:!1,error:null}),r(),e){var t=De,n=t.errorThrown,o=t.error;if(De=null,n)throw o}}else r()}function yo(r){se.useDeprecatedSynchronousErrorHandling&&De&&(De.errorThrown=!0,De.error=r)}var _t=(function(r){z(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,sr(t)&&t.add(n)):n.destination=sa,n}return e.create=function(t,n,o){return new qe(t,n,o)},e.prototype.next=function(t){this.isStopped?pn(go(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?pn(vo(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?pn(mo,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(Z);var na=Function.prototype.bind;function un(r,e){return na.call(r,e)}var oa=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){lr(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){lr(n)}else lr(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){lr(t)}},r})(),qe=(function(r){z(e,r);function e(t,n,o){var i=r.call(this)||this,s;if(g(t)||!t)s={next:t??void 0,error:n??void 0,complete:o??void 0};else{var l;i&&se.useDeprecatedNextContext?(l=Object.create(t),l.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&un(t.next,l),error:t.error&&un(t.error,l),complete:t.complete&&un(t.complete,l)}):s=t}return i.destination=new oa(s),i}return e})(_t);function lr(r){se.useDeprecatedSynchronousErrorHandling?yo(r):ar(r)}function ia(r){throw r}function pn(r,e){var t=se.onStoppedNotification;t&&Qe.setTimeout(function(){return t(r,e)})}var sa={closed:!0,next:ae,error:ia,complete:ae};var tt=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function X(r){return r}function fn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return dn(r)}function dn(r){return r.length===0?X:r.length===1?r[0]:function(t){return r.reduce(function(n,o){return o(n)},t)}}var _=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var o=this,i=la(e)?e:new qe(e,t,n);return et(function(){var s=o,l=s.operator,a=s.source;i.add(l?l.call(i,a):a?o._subscribe(i):o._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=bo(t),new t(function(o,i){var s=new qe({next:function(l){try{e(l)}catch(a){i(a),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[tt]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return dn(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=bo(e),new e(function(n,o){var i;t.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(e){return new r(e)},r})();function bo(r){var e;return(e=r??se.Promise)!==null&&e!==void 0?e:Promise}function aa(r){return r&&g(r.next)&&g(r.error)&&g(r.complete)}function la(r){return r&&r instanceof _t||aa(r)&&sr(r)}function ca(r){return g(r?.lift)}function x(r){return function(e){if(ca(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function S(r,e,t,n,o){return new ua(r,e,t,n,o)}var ua=(function(r){z(e,r);function e(t,n,o,i,s,l){var a=r.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=l,a._next=n?function(c){try{n(c)}catch(u){t.error(u)}}:r.prototype._next,a._error=i?function(c){try{i(c)}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._error,a._complete=o?function(){try{o()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,a}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(_t);var xo=or(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var te=(function(r){z(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new wo(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new xo},e.prototype.next=function(t){var n=this;et(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=we(n.currentObservers),l=s.next();!l.done;l=s.next()){var a=l.value;a.next(t)}}catch(c){o={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},e.prototype.error=function(t){var n=this;et(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var o=n.observers;o.length;)o.shift().error(t)}})},e.prototype.complete=function(){var t=this;et(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,o=this,i=o.hasError,s=o.isStopped,l=o.observers;return i||s?ln:(this.currentObservers=null,l.push(t),new Z(function(){n.currentObservers=null,Ue(l,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?t.error(i):s&&t.complete()},e.prototype.asObservable=function(){var t=new _;return t.source=this,t},e.create=function(t,n){return new wo(t,n)},e})(_);var wo=(function(r){z(e,r);function e(t,n){var o=r.call(this)||this;return o.destination=t,o.source=n,o}return e.prototype.next=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,t)},e.prototype.error=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&o!==void 0?o:ln},e})(te);var St={now:function(){return(St.delegate||Date).now()},delegate:void 0};var _o=(function(r){z(e,r);function e(t,n,o){t===void 0&&(t=1/0),n===void 0&&(n=1/0),o===void 0&&(o=St);var i=r.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return e.prototype.next=function(t){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,l=n._timestampProvider,a=n._windowTime;o||(i.push(t),!s&&i.push(l.now()+a)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),o=this,i=o._infiniteTimeWindow,s=o._buffer,l=s.slice(),a=0;a<l.length&&!t.closed;a+=i?1:2)t.next(l[a]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,o=t._timestampProvider,i=t._buffer,s=t._infiniteTimeWindow,l=(s?1:2)*n;if(n<1/0&&l<i.length&&i.splice(0,i.length-l),!s){for(var a=o.now(),c=0,u=1;u<i.length&&i[u]<=a;u+=2)c=u;c&&i.splice(0,c+1)}},e})(te);var So=(function(r){z(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e})(Z);var $t={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=$t.delegate;return o?.setInterval?o.setInterval.apply(o,H([r,e],F(t))):setInterval.apply(void 0,H([r,e],F(t)))},clearInterval:function(r){var e=$t.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var $o=(function(r){z(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o.pending=!1,o}return e.prototype.schedule=function(t,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),$t.setInterval(t.flush.bind(t,this),o)},e.prototype.recycleAsyncId=function(t,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&$t.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var o=!1,i;try{this.work(t)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ue(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})(So);var hn=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=St.now,r})();var Ao=(function(r){z(e,r);function e(t,n){n===void 0&&(n=hn.now);var o=r.call(this,t,n)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,o){for(;t=n.shift();)t.unsubscribe();throw o}},e})(hn);var pa=new Ao($o),Eo=pa;var le=new _(function(r){return r.complete()});function cr(r){return r&&g(r.schedule)}function mn(r){return r[r.length-1]}function ur(r){return g(mn(r))?r.pop():void 0}function me(r){return cr(mn(r))?r.pop():void 0}function Co(r,e){return typeof mn(r)=="number"?r.pop():e}var pr=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function fr(r){return g(r?.then)}function dr(r){return g(r[tt])}function hr(r){return Symbol.asyncIterator&&g(r?.[Symbol.asyncIterator])}function mr(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function fa(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var vr=fa();function gr(r){return g(r?.[vr])}function yr(r){return po(this,arguments,function(){var t,n,o,i;return nr(this,function(s){switch(s.label){case 0:t=r.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Le(t.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,Le(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Le(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function br(r){return g(r?.getReader)}function P(r){if(r instanceof _)return r;if(r!=null){if(dr(r))return da(r);if(pr(r))return ha(r);if(fr(r))return ma(r);if(hr(r))return To(r);if(gr(r))return va(r);if(br(r))return ga(r)}throw mr(r)}function da(r){return new _(function(e){var t=r[tt]();if(g(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ha(r){return new _(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function ma(r){return new _(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ar)})}function va(r){return new _(function(e){var t,n;try{for(var o=we(r),i=o.next();!i.done;i=o.next()){var s=i.value;if(e.next(s),e.closed)return}}catch(l){t={error:l}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}e.complete()})}function To(r){return new _(function(e){ya(r,e).catch(function(t){return e.error(t)})})}function ga(r){return To(yr(r))}function ya(r,e){var t,n,o,i;return uo(this,void 0,void 0,function(){var s,l;return nr(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=fo(r),a.label=1;case 1:return[4,t.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(s=n.value,e.next(s),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=a.sent(),o={error:l},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Y(r,e,t,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=e.schedule(function(){t(),o?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(i),!o)return i}function xr(r,e){return e===void 0&&(e=0),x(function(t,n){t.subscribe(S(n,function(o){return Y(n,r,function(){return n.next(o)},e)},function(){return Y(n,r,function(){return n.complete()},e)},function(o){return Y(n,r,function(){return n.error(o)},e)}))})}function wr(r,e){return e===void 0&&(e=0),x(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}function Oo(r,e){return P(r).pipe(wr(e),xr(e))}function ko(r,e){return P(r).pipe(wr(e),xr(e))}function Po(r,e){return new _(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}function Io(r,e){return new _(function(t){var n;return Y(t,e,function(){n=r[vr](),Y(t,e,function(){var o,i,s;try{o=n.next(),i=o.value,s=o.done}catch(l){t.error(l);return}s?t.complete():t.next(i)},0,!0)}),function(){return g(n?.return)&&n.return()}})}function _r(r,e){if(!r)throw new Error("Iterable cannot be null");return new _(function(t){Y(t,e,function(){var n=r[Symbol.asyncIterator]();Y(t,e,function(){n.next().then(function(o){o.done?t.complete():t.next(o.value)})},0,!0)})})}function Ro(r,e){return _r(yr(r),e)}function Mo(r,e){if(r!=null){if(dr(r))return Oo(r,e);if(pr(r))return Po(r,e);if(fr(r))return ko(r,e);if(hr(r))return _r(r,e);if(gr(r))return Io(r,e);if(br(r))return Ro(r,e)}throw mr(r)}function V(r,e){return e?Mo(r,e):P(r)}function R(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r);return V(r,t)}function At(r,e){var t=g(r)?r:function(){return r},n=function(o){return o.error(t())};return new _(e?function(o){return e.schedule(n,0,o)}:n)}function Et(r){return!!r&&(r instanceof _||g(r.lift)&&g(r.subscribe))}function jo(r){return r instanceof Date&&!isNaN(r)}function j(r,e){return x(function(t,n){var o=0;t.subscribe(S(n,function(i){n.next(r.call(e,i,o++))}))})}var ba=Array.isArray;function xa(r,e){return ba(e)?r.apply(void 0,H([],F(e))):r(e)}function Lo(r){return j(function(e){return xa(r,e)})}var wa=Array.isArray,_a=Object.getPrototypeOf,Sa=Object.prototype,$a=Object.keys;function Uo(r){if(r.length===1){var e=r[0];if(wa(e))return{args:e,keys:null};if(Aa(e)){var t=$a(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:r,keys:null}}function Aa(r){return r&&typeof r=="object"&&_a(r)===Sa}function Do(r,e){return r.reduce(function(t,n,o){return t[n]=e[o],t},{})}function vn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r),n=ur(r),o=Uo(r),i=o.args,s=o.keys;if(i.length===0)return V([],t);var l=new _(Ea(i,t,s?function(a){return Do(s,a)}:X));return n?l.pipe(Lo(n)):l}function Ea(r,e,t){return t===void 0&&(t=X),function(n){qo(e,function(){for(var o=r.length,i=new Array(o),s=o,l=o,a=function(u){qo(e,function(){var p=V(r[u],e),d=!1;p.subscribe(S(n,function(f){i[u]=f,d||(d=!0,l--),l||n.next(t(i.slice()))},function(){--s||n.complete()}))},n)},c=0;c<o;c++)a(c)},n)}}function qo(r,e,t){r?Y(t,r,e):e()}function No(r,e,t,n,o,i,s,l){var a=[],c=0,u=0,p=!1,d=function(){p&&!a.length&&!c&&e.complete()},f=function(h){return c<n?v(h):a.push(h)},v=function(h){i&&e.next(h),c++;var m=!1;P(t(h,u++)).subscribe(S(e,function(b){o?.(b),i?f(b):e.next(b)},function(){m=!0},void 0,function(){if(m)try{c--;for(var b=function(){var K=a.shift();s?Y(e,s,function(){return v(K)}):v(K)};a.length&&c<n;)b();d()}catch(K){e.error(K)}}))};return r.subscribe(S(e,f,function(){p=!0,d()})),function(){l?.()}}function re(r,e,t){return t===void 0&&(t=1/0),g(e)?re(function(n,o){return j(function(i,s){return e(n,i,o,s)})(P(r(n,o)))},t):(typeof e=="number"&&(t=e),x(function(n,o){return No(n,o,r,t)}))}function Sr(r){return r===void 0&&(r=1/0),re(X,r)}function Fo(){return Sr(1)}function Ae(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Fo()(V(r,me(r)))}function Ct(r){return new _(function(e){P(r()).subscribe(e)})}function $r(r,e,t){r===void 0&&(r=0),t===void 0&&(t=Eo);var n=-1;return e!=null&&(cr(e)?t=e:n=e),new _(function(o){var i=jo(r)?+r-t.now():r;i<0&&(i=0);var s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Ee(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r),n=Co(r,1/0),o=r;return o.length?o.length===1?P(o[0]):Sr(n)(V(o,t)):le}var gn=new _(ae);function ve(r,e){return x(function(t,n){var o=0;t.subscribe(S(n,function(i){return r.call(e,i,o++)&&n.next(i)}))})}function G(r){return x(function(e,t){var n=null,o=!1,i;n=e.subscribe(S(t,void 0,void 0,function(s){i=P(r(s,G(r)(e))),n?(n.unsubscribe(),n=null,i.subscribe(t)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(t))})}function Ho(r,e,t,n,o){return function(i,s){var l=t,a=e,c=0;i.subscribe(S(s,function(u){var p=c++;a=l?r(a,u,p):(l=!0,u),n&&s.next(a)},o&&(function(){l&&s.next(a),s.complete()})))}}function Tt(r,e){return g(e)?re(r,e,1):re(r,1)}function Ne(r){return r<=0?function(){return le}:x(function(e,t){var n=0;e.subscribe(S(t,function(o){++n<=r&&(t.next(o),r<=n&&t.complete())}))})}function rt(){return x(function(r,e){r.subscribe(S(e,ae))})}function yn(r,e){return e===void 0&&(e=X),r=r??Ca,x(function(t,n){var o,i=!0;t.subscribe(S(n,function(s){var l=e(s);(i||!r(o,l))&&(i=!1,o=l,n.next(s))}))})}function Ca(r,e){return r===e}function bn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(t){return Ae(t,R.apply(void 0,H([],F(r))))}}function Ar(r,e){return e?function(t){return t.pipe(Ar(function(n,o){return P(r(n,o)).pipe(j(function(i,s){return e(n,i,o,s)}))}))}:x(function(t,n){var o=0,i=null,s=!1;t.subscribe(S(n,function(l){i||(i=S(n,void 0,function(){i=null,s&&n.complete()}),P(r(l,o++)).subscribe(i))},function(){s=!0,!i&&n.complete()}))})}function Ot(r){return x(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}function xn(r,e){return x(Ho(r,e,arguments.length>=2,!0))}function kt(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new te}:e,n=r.resetOnError,o=n===void 0?!0:n,i=r.resetOnComplete,s=i===void 0?!0:i,l=r.resetOnRefCountZero,a=l===void 0?!0:l;return function(c){var u,p,d,f=0,v=!1,h=!1,m=function(){p?.unsubscribe(),p=void 0},b=function(){m(),u=d=void 0,v=h=!1},K=function(){var ie=u;b(),ie?.unsubscribe()};return x(function(ie,be){f++,!h&&!v&&m();var Me=d=d??t();be.add(function(){f--,f===0&&!h&&!v&&(p=wn(K,a))}),Me.subscribe(be),!u&&f>0&&(u=new qe({next:function(je){return Me.next(je)},error:function(je){h=!0,m(),p=wn(b,o,je),Me.error(je)},complete:function(){v=!0,m(),p=wn(b,s),Me.complete()}}),P(ie).subscribe(u))})(c)}}function wn(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var o=new qe({next:function(){o.unsubscribe(),r()}});return P(e.apply(void 0,H([],F(t)))).subscribe(o)}}function nt(r,e,t){var n,o,i,s,l=!1;return r&&typeof r=="object"?(n=r.bufferSize,s=n===void 0?1/0:n,o=r.windowTime,e=o===void 0?1/0:o,i=r.refCount,l=i===void 0?!1:i,t=r.scheduler):s=r??1/0,kt({connector:function(){return new _o(s,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}function _n(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r);return x(function(n,o){(t?Ae(r,n,t):Ae(r,n)).subscribe(o)})}function B(r,e){return x(function(t,n){var o=null,i=0,s=!1,l=function(){return s&&!o&&n.complete()};t.subscribe(S(n,function(a){o?.unsubscribe();var c=0,u=i++;P(r(a,u)).subscribe(o=S(n,function(p){return n.next(e?e(a,p,u,c++):p)},function(){o=null,l()}))},function(){s=!0,l()}))})}function Fe(r){return x(function(e,t){P(r).subscribe(S(t,function(){return t.complete()},ae)),!t.closed&&e.subscribe(t)})}function Pt(r,e){return e===void 0&&(e=!1),x(function(t,n){var o=0;t.subscribe(S(n,function(i){var s=r(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}function _e(r,e,t){var n=g(r)||e||t?{next:r,error:e,complete:t}:r;return n?x(function(o,i){var s;(s=n.subscribe)===null||s===void 0||s.call(n);var l=!0;o.subscribe(S(i,function(a){var c;(c=n.next)===null||c===void 0||c.call(n,a),i.next(a)},function(){var a;l=!1,(a=n.complete)===null||a===void 0||a.call(n),i.complete()},function(a){var c;l=!1,(c=n.error)===null||c===void 0||c.call(n,a),i.error(a)},function(){var a,c;l&&((a=n.unsubscribe)===null||a===void 0||a.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):X}function Sn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=ur(r);return x(function(n,o){for(var i=r.length,s=new Array(i),l=r.map(function(){return!1}),a=!1,c=function(p){P(r[p]).subscribe(S(o,function(d){s[p]=d,!a&&!l[p]&&(l[p]=!0,(a=l.every(X))&&(l=null))},ae))},u=0;u<i;u++)c(u);n.subscribe(S(o,function(p){if(a){var d=H([p],F(s));o.next(t?t.apply(void 0,H([],F(d))):d)}}))})}var It=`id name type description instructions tools isActive modelName mcpLambdaId mcpLambdaName createdAt updatedAt
|
|
33
|
-
embed { published identity allowedOrigins welcome suggestions showToolDetails maxMessagesPerConversation retentionDays publishedAt }`,Vo="id name description welcome suggestions"
|
|
32
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Ue(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var Z=(function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,n,o,i;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var l=we(s),a=l.next();!a.done;a=l.next()){var c=a.value;c.remove(this)}}catch(h){e={error:h}}finally{try{a&&!a.done&&(t=l.return)&&t.call(l)}finally{if(e)throw e.error}}else s.remove(this);var u=this.initialTeardown;if(g(u))try{u()}catch(h){i=h instanceof ir?h.errors:[h]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var d=we(p),f=d.next();!f.done;f=d.next()){var v=f.value;try{ho(v)}catch(h){i=i??[],h instanceof ir?i=H(H([],F(i)),F(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(n)throw n.error}}}if(i)throw new ir(i)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)ho(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ue(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Ue(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=(function(){var e=new r;return e.closed=!0,e})(),r})();var cn=Z.EMPTY;function sr(r){return r instanceof Z||r&&"closed"in r&&g(r.remove)&&g(r.add)&&g(r.unsubscribe)}function ho(r){g(r)?r():r.unsubscribe()}var se={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Qe={setTimeout:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=Qe.delegate;return o?.setTimeout?o.setTimeout.apply(o,H([r,e],F(t))):setTimeout.apply(void 0,H([r,e],F(t)))},clearTimeout:function(r){var e=Qe.delegate;return(e?.clearTimeout||clearTimeout)(r)},delegate:void 0};function ar(r){Qe.setTimeout(function(){var e=se.onUnhandledError;if(e)e(r);else throw r})}function ae(){}var mo=(function(){return un("C",void 0,void 0)})();function vo(r){return un("E",void 0,r)}function go(r){return un("N",r,void 0)}function un(r,e,t){return{kind:r,value:e,error:t}}var De=null;function et(r){if(se.useDeprecatedSynchronousErrorHandling){var e=!De;if(e&&(De={errorThrown:!1,error:null}),r(),e){var t=De,n=t.errorThrown,o=t.error;if(De=null,n)throw o}}else r()}function yo(r){se.useDeprecatedSynchronousErrorHandling&&De&&(De.errorThrown=!0,De.error=r)}var _t=(function(r){z(e,r);function e(t){var n=r.call(this)||this;return n.isStopped=!1,t?(n.destination=t,sr(t)&&t.add(n)):n.destination=sa,n}return e.create=function(t,n,o){return new qe(t,n,o)},e.prototype.next=function(t){this.isStopped?fn(go(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?fn(vo(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?fn(mo,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(Z);var na=Function.prototype.bind;function pn(r,e){return na.call(r,e)}var oa=(function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(n){lr(n)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(n){lr(n)}else lr(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){lr(t)}},r})(),qe=(function(r){z(e,r);function e(t,n,o){var i=r.call(this)||this,s;if(g(t)||!t)s={next:t??void 0,error:n??void 0,complete:o??void 0};else{var l;i&&se.useDeprecatedNextContext?(l=Object.create(t),l.unsubscribe=function(){return i.unsubscribe()},s={next:t.next&&pn(t.next,l),error:t.error&&pn(t.error,l),complete:t.complete&&pn(t.complete,l)}):s=t}return i.destination=new oa(s),i}return e})(_t);function lr(r){se.useDeprecatedSynchronousErrorHandling?yo(r):ar(r)}function ia(r){throw r}function fn(r,e){var t=se.onStoppedNotification;t&&Qe.setTimeout(function(){return t(r,e)})}var sa={closed:!0,next:ae,error:ia,complete:ae};var tt=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function X(r){return r}function dn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return hn(r)}function hn(r){return r.length===0?X:r.length===1?r[0]:function(t){return r.reduce(function(n,o){return o(n)},t)}}var _=(function(){function r(e){e&&(this._subscribe=e)}return r.prototype.lift=function(e){var t=new r;return t.source=this,t.operator=e,t},r.prototype.subscribe=function(e,t,n){var o=this,i=la(e)?e:new qe(e,t,n);return et(function(){var s=o,l=s.operator,a=s.source;i.add(l?l.call(i,a):a?o._subscribe(i):o._trySubscribe(i))}),i},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},r.prototype.forEach=function(e,t){var n=this;return t=bo(t),new t(function(o,i){var s=new qe({next:function(l){try{e(l)}catch(a){i(a),s.unsubscribe()}},error:i,complete:o});n.subscribe(s)})},r.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},r.prototype[tt]=function(){return this},r.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hn(e)(this)},r.prototype.toPromise=function(e){var t=this;return e=bo(e),new e(function(n,o){var i;t.subscribe(function(s){return i=s},function(s){return o(s)},function(){return n(i)})})},r.create=function(e){return new r(e)},r})();function bo(r){var e;return(e=r??se.Promise)!==null&&e!==void 0?e:Promise}function aa(r){return r&&g(r.next)&&g(r.error)&&g(r.complete)}function la(r){return r&&r instanceof _t||aa(r)&&sr(r)}function ca(r){return g(r?.lift)}function x(r){return function(e){if(ca(e))return e.lift(function(t){try{return r(t,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function S(r,e,t,n,o){return new ua(r,e,t,n,o)}var ua=(function(r){z(e,r);function e(t,n,o,i,s,l){var a=r.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=l,a._next=n?function(c){try{n(c)}catch(u){t.error(u)}}:r.prototype._next,a._error=i?function(c){try{i(c)}catch(u){t.error(u)}finally{this.unsubscribe()}}:r.prototype._error,a._complete=o?function(){try{o()}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._complete,a}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;r.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(_t);var xo=or(function(r){return function(){r(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var te=(function(r){z(e,r);function e(){var t=r.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var n=new wo(this,this);return n.operator=t,n},e.prototype._throwIfClosed=function(){if(this.closed)throw new xo},e.prototype.next=function(t){var n=this;et(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var s=we(n.currentObservers),l=s.next();!l.done;l=s.next()){var a=l.value;a.next(t)}}catch(c){o={error:c}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}}})},e.prototype.error=function(t){var n=this;et(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=t;for(var o=n.observers;o.length;)o.shift().error(t)}})},e.prototype.complete=function(){var t=this;et(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var n=t.observers;n.length;)n.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),r.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var n=this,o=this,i=o.hasError,s=o.isStopped,l=o.observers;return i||s?cn:(this.currentObservers=null,l.push(t),new Z(function(){n.currentObservers=null,Ue(l,t)}))},e.prototype._checkFinalizedStatuses=function(t){var n=this,o=n.hasError,i=n.thrownError,s=n.isStopped;o?t.error(i):s&&t.complete()},e.prototype.asObservable=function(){var t=new _;return t.source=this,t},e.create=function(t,n){return new wo(t,n)},e})(_);var wo=(function(r){z(e,r);function e(t,n){var o=r.call(this)||this;return o.destination=t,o.source=n,o}return e.prototype.next=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,t)},e.prototype.error=function(t){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,t)},e.prototype.complete=function(){var t,n;(n=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||n===void 0||n.call(t)},e.prototype._subscribe=function(t){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(t))!==null&&o!==void 0?o:cn},e})(te);var St={now:function(){return(St.delegate||Date).now()},delegate:void 0};var _o=(function(r){z(e,r);function e(t,n,o){t===void 0&&(t=1/0),n===void 0&&(n=1/0),o===void 0&&(o=St);var i=r.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return e.prototype.next=function(t){var n=this,o=n.isStopped,i=n._buffer,s=n._infiniteTimeWindow,l=n._timestampProvider,a=n._windowTime;o||(i.push(t),!s&&i.push(l.now()+a)),this._trimBuffer(),r.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(t),o=this,i=o._infiniteTimeWindow,s=o._buffer,l=s.slice(),a=0;a<l.length&&!t.closed;a+=i?1:2)t.next(l[a]);return this._checkFinalizedStatuses(t),n},e.prototype._trimBuffer=function(){var t=this,n=t._bufferSize,o=t._timestampProvider,i=t._buffer,s=t._infiniteTimeWindow,l=(s?1:2)*n;if(n<1/0&&l<i.length&&i.splice(0,i.length-l),!s){for(var a=o.now(),c=0,u=1;u<i.length&&i[u]<=a;u+=2)c=u;c&&i.splice(0,c+1)}},e})(te);var So=(function(r){z(e,r);function e(t,n){return r.call(this)||this}return e.prototype.schedule=function(t,n){return n===void 0&&(n=0),this},e})(Z);var $t={setInterval:function(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var o=$t.delegate;return o?.setInterval?o.setInterval.apply(o,H([r,e],F(t))):setInterval.apply(void 0,H([r,e],F(t)))},clearInterval:function(r){var e=$t.delegate;return(e?.clearInterval||clearInterval)(r)},delegate:void 0};var $o=(function(r){z(e,r);function e(t,n){var o=r.call(this,t,n)||this;return o.scheduler=t,o.work=n,o.pending=!1,o}return e.prototype.schedule=function(t,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(t,n,o){return o===void 0&&(o=0),$t.setInterval(t.flush.bind(t,this),o)},e.prototype.recycleAsyncId=function(t,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&$t.clearInterval(n)},e.prototype.execute=function(t,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(t,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,n){var o=!1,i;try{this.work(t)}catch(s){o=!0,i=s||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,n=t.id,o=t.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Ue(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,r.prototype.unsubscribe.call(this)}},e})(So);var mn=(function(){function r(e,t){t===void 0&&(t=r.now),this.schedulerActionCtor=e,this.now=t}return r.prototype.schedule=function(e,t,n){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},r.now=St.now,r})();var Ao=(function(r){z(e,r);function e(t,n){n===void 0&&(n=mn.now);var o=r.call(this,t,n)||this;return o.actions=[],o._active=!1,o}return e.prototype.flush=function(t){var n=this.actions;if(this._active){n.push(t);return}var o;this._active=!0;do if(o=t.execute(t.state,t.delay))break;while(t=n.shift());if(this._active=!1,o){for(;t=n.shift();)t.unsubscribe();throw o}},e})(mn);var pa=new Ao($o),Eo=pa;var le=new _(function(r){return r.complete()});function cr(r){return r&&g(r.schedule)}function vn(r){return r[r.length-1]}function ur(r){return g(vn(r))?r.pop():void 0}function me(r){return cr(vn(r))?r.pop():void 0}function Co(r,e){return typeof vn(r)=="number"?r.pop():e}var pr=(function(r){return r&&typeof r.length=="number"&&typeof r!="function"});function fr(r){return g(r?.then)}function dr(r){return g(r[tt])}function hr(r){return Symbol.asyncIterator&&g(r?.[Symbol.asyncIterator])}function mr(r){return new TypeError("You provided "+(r!==null&&typeof r=="object"?"an invalid object":"'"+r+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function fa(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var vr=fa();function gr(r){return g(r?.[vr])}function yr(r){return po(this,arguments,function(){var t,n,o,i;return nr(this,function(s){switch(s.label){case 0:t=r.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Le(t.read())];case 3:return n=s.sent(),o=n.value,i=n.done,i?[4,Le(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Le(o)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function br(r){return g(r?.getReader)}function P(r){if(r instanceof _)return r;if(r!=null){if(dr(r))return da(r);if(pr(r))return ha(r);if(fr(r))return ma(r);if(hr(r))return To(r);if(gr(r))return va(r);if(br(r))return ga(r)}throw mr(r)}function da(r){return new _(function(e){var t=r[tt]();if(g(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ha(r){return new _(function(e){for(var t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete()})}function ma(r){return new _(function(e){r.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,ar)})}function va(r){return new _(function(e){var t,n;try{for(var o=we(r),i=o.next();!i.done;i=o.next()){var s=i.value;if(e.next(s),e.closed)return}}catch(l){t={error:l}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}e.complete()})}function To(r){return new _(function(e){ya(r,e).catch(function(t){return e.error(t)})})}function ga(r){return To(yr(r))}function ya(r,e){var t,n,o,i;return uo(this,void 0,void 0,function(){var s,l;return nr(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),t=fo(r),a.label=1;case 1:return[4,t.next()];case 2:if(n=a.sent(),!!n.done)return[3,4];if(s=n.value,e.next(s),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=a.sent(),o={error:l},[3,11];case 6:return a.trys.push([6,,9,10]),n&&!n.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Y(r,e,t,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=e.schedule(function(){t(),o?r.add(this.schedule(null,n)):this.unsubscribe()},n);if(r.add(i),!o)return i}function xr(r,e){return e===void 0&&(e=0),x(function(t,n){t.subscribe(S(n,function(o){return Y(n,r,function(){return n.next(o)},e)},function(){return Y(n,r,function(){return n.complete()},e)},function(o){return Y(n,r,function(){return n.error(o)},e)}))})}function wr(r,e){return e===void 0&&(e=0),x(function(t,n){n.add(r.schedule(function(){return t.subscribe(n)},e))})}function Oo(r,e){return P(r).pipe(wr(e),xr(e))}function ko(r,e){return P(r).pipe(wr(e),xr(e))}function Po(r,e){return new _(function(t){var n=0;return e.schedule(function(){n===r.length?t.complete():(t.next(r[n++]),t.closed||this.schedule())})})}function Io(r,e){return new _(function(t){var n;return Y(t,e,function(){n=r[vr](),Y(t,e,function(){var o,i,s;try{o=n.next(),i=o.value,s=o.done}catch(l){t.error(l);return}s?t.complete():t.next(i)},0,!0)}),function(){return g(n?.return)&&n.return()}})}function _r(r,e){if(!r)throw new Error("Iterable cannot be null");return new _(function(t){Y(t,e,function(){var n=r[Symbol.asyncIterator]();Y(t,e,function(){n.next().then(function(o){o.done?t.complete():t.next(o.value)})},0,!0)})})}function Ro(r,e){return _r(yr(r),e)}function Mo(r,e){if(r!=null){if(dr(r))return Oo(r,e);if(pr(r))return Po(r,e);if(fr(r))return ko(r,e);if(hr(r))return _r(r,e);if(gr(r))return Io(r,e);if(br(r))return Ro(r,e)}throw mr(r)}function V(r,e){return e?Mo(r,e):P(r)}function I(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r);return V(r,t)}function At(r,e){var t=g(r)?r:function(){return r},n=function(o){return o.error(t())};return new _(e?function(o){return e.schedule(n,0,o)}:n)}function Et(r){return!!r&&(r instanceof _||g(r.lift)&&g(r.subscribe))}function jo(r){return r instanceof Date&&!isNaN(r)}function M(r,e){return x(function(t,n){var o=0;t.subscribe(S(n,function(i){n.next(r.call(e,i,o++))}))})}var ba=Array.isArray;function xa(r,e){return ba(e)?r.apply(void 0,H([],F(e))):r(e)}function Lo(r){return M(function(e){return xa(r,e)})}var wa=Array.isArray,_a=Object.getPrototypeOf,Sa=Object.prototype,$a=Object.keys;function Uo(r){if(r.length===1){var e=r[0];if(wa(e))return{args:e,keys:null};if(Aa(e)){var t=$a(e);return{args:t.map(function(n){return e[n]}),keys:t}}}return{args:r,keys:null}}function Aa(r){return r&&typeof r=="object"&&_a(r)===Sa}function Do(r,e){return r.reduce(function(t,n,o){return t[n]=e[o],t},{})}function gn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r),n=ur(r),o=Uo(r),i=o.args,s=o.keys;if(i.length===0)return V([],t);var l=new _(Ea(i,t,s?function(a){return Do(s,a)}:X));return n?l.pipe(Lo(n)):l}function Ea(r,e,t){return t===void 0&&(t=X),function(n){qo(e,function(){for(var o=r.length,i=new Array(o),s=o,l=o,a=function(u){qo(e,function(){var p=V(r[u],e),d=!1;p.subscribe(S(n,function(f){i[u]=f,d||(d=!0,l--),l||n.next(t(i.slice()))},function(){--s||n.complete()}))},n)},c=0;c<o;c++)a(c)},n)}}function qo(r,e,t){r?Y(t,r,e):e()}function No(r,e,t,n,o,i,s,l){var a=[],c=0,u=0,p=!1,d=function(){p&&!a.length&&!c&&e.complete()},f=function(h){return c<n?v(h):a.push(h)},v=function(h){i&&e.next(h),c++;var m=!1;P(t(h,u++)).subscribe(S(e,function(b){o?.(b),i?f(b):e.next(b)},function(){m=!0},void 0,function(){if(m)try{c--;for(var b=function(){var K=a.shift();s?Y(e,s,function(){return v(K)}):v(K)};a.length&&c<n;)b();d()}catch(K){e.error(K)}}))};return r.subscribe(S(e,f,function(){p=!0,d()})),function(){l?.()}}function re(r,e,t){return t===void 0&&(t=1/0),g(e)?re(function(n,o){return M(function(i,s){return e(n,i,o,s)})(P(r(n,o)))},t):(typeof e=="number"&&(t=e),x(function(n,o){return No(n,o,r,t)}))}function Sr(r){return r===void 0&&(r=1/0),re(X,r)}function Fo(){return Sr(1)}function Ae(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return Fo()(V(r,me(r)))}function Ct(r){return new _(function(e){P(r()).subscribe(e)})}function $r(r,e,t){r===void 0&&(r=0),t===void 0&&(t=Eo);var n=-1;return e!=null&&(cr(e)?t=e:n=e),new _(function(o){var i=jo(r)?+r-t.now():r;i<0&&(i=0);var s=0;return t.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Ee(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r),n=Co(r,1/0),o=r;return o.length?o.length===1?P(o[0]):Sr(n)(V(o,t)):le}var yn=new _(ae);function ve(r,e){return x(function(t,n){var o=0;t.subscribe(S(n,function(i){return r.call(e,i,o++)&&n.next(i)}))})}function G(r){return x(function(e,t){var n=null,o=!1,i;n=e.subscribe(S(t,void 0,void 0,function(s){i=P(r(s,G(r)(e))),n?(n.unsubscribe(),n=null,i.subscribe(t)):o=!0})),o&&(n.unsubscribe(),n=null,i.subscribe(t))})}function Ho(r,e,t,n,o){return function(i,s){var l=t,a=e,c=0;i.subscribe(S(s,function(u){var p=c++;a=l?r(a,u,p):(l=!0,u),n&&s.next(a)},o&&(function(){l&&s.next(a),s.complete()})))}}function Tt(r,e){return g(e)?re(r,e,1):re(r,1)}function Ne(r){return r<=0?function(){return le}:x(function(e,t){var n=0;e.subscribe(S(t,function(o){++n<=r&&(t.next(o),r<=n&&t.complete())}))})}function rt(){return x(function(r,e){r.subscribe(S(e,ae))})}function bn(r,e){return e===void 0&&(e=X),r=r??Ca,x(function(t,n){var o,i=!0;t.subscribe(S(n,function(s){var l=e(s);(i||!r(o,l))&&(i=!1,o=l,n.next(s))}))})}function Ca(r,e){return r===e}function xn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];return function(t){return Ae(t,I.apply(void 0,H([],F(r))))}}function Ar(r,e){return e?function(t){return t.pipe(Ar(function(n,o){return P(r(n,o)).pipe(M(function(i,s){return e(n,i,o,s)}))}))}:x(function(t,n){var o=0,i=null,s=!1;t.subscribe(S(n,function(l){i||(i=S(n,void 0,function(){i=null,s&&n.complete()}),P(r(l,o++)).subscribe(i))},function(){s=!0,!i&&n.complete()}))})}function Ot(r){return x(function(e,t){try{e.subscribe(t)}finally{t.add(r)}})}function wn(r,e){return x(Ho(r,e,arguments.length>=2,!0))}function kt(r){r===void 0&&(r={});var e=r.connector,t=e===void 0?function(){return new te}:e,n=r.resetOnError,o=n===void 0?!0:n,i=r.resetOnComplete,s=i===void 0?!0:i,l=r.resetOnRefCountZero,a=l===void 0?!0:l;return function(c){var u,p,d,f=0,v=!1,h=!1,m=function(){p?.unsubscribe(),p=void 0},b=function(){m(),u=d=void 0,v=h=!1},K=function(){var ie=u;b(),ie?.unsubscribe()};return x(function(ie,be){f++,!h&&!v&&m();var Me=d=d??t();be.add(function(){f--,f===0&&!h&&!v&&(p=_n(K,a))}),Me.subscribe(be),!u&&f>0&&(u=new qe({next:function(je){return Me.next(je)},error:function(je){h=!0,m(),p=_n(b,o,je),Me.error(je)},complete:function(){v=!0,m(),p=_n(b,s),Me.complete()}}),P(ie).subscribe(u))})(c)}}function _n(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];if(e===!0){r();return}if(e!==!1){var o=new qe({next:function(){o.unsubscribe(),r()}});return P(e.apply(void 0,H([],F(t)))).subscribe(o)}}function nt(r,e,t){var n,o,i,s,l=!1;return r&&typeof r=="object"?(n=r.bufferSize,s=n===void 0?1/0:n,o=r.windowTime,e=o===void 0?1/0:o,i=r.refCount,l=i===void 0?!1:i,t=r.scheduler):s=r??1/0,kt({connector:function(){return new _o(s,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:l})}function Sn(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=me(r);return x(function(n,o){(t?Ae(r,n,t):Ae(r,n)).subscribe(o)})}function B(r,e){return x(function(t,n){var o=null,i=0,s=!1,l=function(){return s&&!o&&n.complete()};t.subscribe(S(n,function(a){o?.unsubscribe();var c=0,u=i++;P(r(a,u)).subscribe(o=S(n,function(p){return n.next(e?e(a,p,u,c++):p)},function(){o=null,l()}))},function(){s=!0,l()}))})}function Fe(r){return x(function(e,t){P(r).subscribe(S(t,function(){return t.complete()},ae)),!t.closed&&e.subscribe(t)})}function Pt(r,e){return e===void 0&&(e=!1),x(function(t,n){var o=0;t.subscribe(S(n,function(i){var s=r(i,o++);(s||e)&&n.next(i),!s&&n.complete()}))})}function _e(r,e,t){var n=g(r)||e||t?{next:r,error:e,complete:t}:r;return n?x(function(o,i){var s;(s=n.subscribe)===null||s===void 0||s.call(n);var l=!0;o.subscribe(S(i,function(a){var c;(c=n.next)===null||c===void 0||c.call(n,a),i.next(a)},function(){var a;l=!1,(a=n.complete)===null||a===void 0||a.call(n),i.complete()},function(a){var c;l=!1,(c=n.error)===null||c===void 0||c.call(n,a),i.error(a)},function(){var a,c;l&&((a=n.unsubscribe)===null||a===void 0||a.call(n)),(c=n.finalize)===null||c===void 0||c.call(n)}))}):X}function $n(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=ur(r);return x(function(n,o){for(var i=r.length,s=new Array(i),l=r.map(function(){return!1}),a=!1,c=function(p){P(r[p]).subscribe(S(o,function(d){s[p]=d,!a&&!l[p]&&(l[p]=!0,(a=l.every(X))&&(l=null))},ae))},u=0;u<i;u++)c(u);n.subscribe(S(o,function(p){if(a){var d=H([p],F(s));o.next(t?t.apply(void 0,H([],F(d))):d)}}))})}var It=`id name type description instructions tools isActive modelName mcpLambdaId mcpLambdaName createdAt updatedAt
|
|
33
|
+
embed { published identity allowedOrigins welcome suggestions showToolDetails maxMessagesPerConversation retentionDays publishedAt }`,Vo="id name description welcome suggestions",An=`token expiresAt agents { ${Vo} }`,Wo="id agentId title messageCount lastSeq answering lastMessageAt createdAt",Ta="id role text toolCalls { name status } createdAt",zo="conversationId seq type runId data createdAt",ce={listAgents:`query ($projectId: String!) { listProjectAgents(projectId: $projectId) { ${It} } }`,getAgent:`query ($id: String!) { getProjectAgent(id: $id) { ${It} } }`,createAgent:`mutation ($projectId: String!, $payload: CreateProjectAgentInput!) { createProjectAgent(projectId: $projectId, payload: $payload) { ${It} } }`,updateAgent:`mutation ($id: String!, $payload: UpdateProjectAgentInput!) { updateProjectAgent(id: $id, payload: $payload) { ${It} } }`,deleteAgent:"mutation ($id: String!) { deleteProjectAgent(id: $id) }",updateEmbed:`mutation ($agentId: String!, $embed: AgentEmbedInput!) { updateAgentEmbed(agentId: $agentId, embed: $embed) { ${It} } }`,createSession:`mutation ($subject: String!, $agents: [String], $claims: JSON, $ttlSeconds: Int, $origin: String) { createAgentSession(subject: $subject, agents: $agents, claims: $claims, ttlSeconds: $ttlSeconds, origin: $origin) { ${An} } }`,exchangeSession:`mutation ($projectId: String!, $token: String!, $agents: [String]) { exchangeAgentSession(projectId: $projectId, token: $token, agents: $agents) { ${An} } }`,anonymousSession:`mutation ($deviceId: String!, $turnstileToken: String!, $agents: [String]) { createAnonymousAgentSession(deviceId: $deviceId, turnstileToken: $turnstileToken, agents: $agents) { ${An} } }`,sessionAgents:`query { sessionAgents { ${Vo} } }`,conversations:`query ($agent: String) { agentConversations(agent: $agent) { ${Wo} } }`,conversation:`query ($id: String!) { agentConversation(id: $id) { ${Wo} messages { ${Ta} } } }`,events:`query ($conversationId: String!, $afterSeq: Int) { agentConversationEvents(conversationId: $conversationId, afterSeq: $afterSeq) { ${zo} } }`,send:"mutation ($agent: String!, $conversationId: String, $text: String!, $credential: String) { sendAgentMessage(agent: $agent, conversationId: $conversationId, text: $text, credential: $credential) { conversationId runId seq } }",abort:"mutation ($conversationId: String!) { abortAgentRun(conversationId: $conversationId) }",liveEvents:`subscription ($conversationId: String!) { agentEvents(conversationId: $conversationId) { ${zo} } }`};var Oa=["limit-reached","cap-reached","agent-unavailable","session-expired","credential-expired","aborted","internal"],U=class extends Error{constructor(t,n,o){super(t);this.code=n;this.status=o;this.name="LambforgeError"}};function Rt(r,e){let t=r?.[0]??{},n=String(t.message??"Request failed"),o=n.match(/^([a-z-]+):/)?.[1];return o&&Oa.includes(o)?new U(n,o,e):n==="session-expired"?new U(n,"session-expired",e):t.extensions?.code==="UNAUTHENTICATED"||/not authorized|unauthorized|invalid sign-in token/i.test(n)?new U(n,"unauthorized",e):new U(n,"bad-request",e)}var Er="https://api.lambforge.com",ka=r=>`${r.replace(/\/+$/,"")}/graphql`,Bo=r=>`${r.replace(/\/+$/,"").replace(/^http/,"ws")}/subscriptions`;function Mt(r,e,t,n,o){return new _(i=>{let s=new AbortController,l=r.fetch??globalThis.fetch;if(!l){i.error(new U("No fetch available","network"));return}return l(ka(r.url),{method:"POST",headers:{"content-type":"application/json",...e?{authorization:e}:{}},body:JSON.stringify({query:t,variables:n}),signal:s.signal}).then(async a=>{let c;try{c=await a.json()}catch{throw new U(`Lambforge answered ${a.status}`,a.status===401?"unauthorized":"network",a.status)}if(c.errors?.length)throw Rt(c.errors,a.status);if(!c.data||!(o in c.data))throw new U(`Lambforge answered ${a.status} without ${o}`,"network",a.status);i.next(c.data[o]),i.complete()}).catch(a=>{s.signal.aborted||i.error(a instanceof U?a:new U(String(a?.message??a),"network"))}),()=>s.abort()})}var Ko=["graphql-ws","graphql-transport-ws"];function Yo(r){return new _(e=>{let n=!1,o=new r.WebSocket(r.url,Ko),i=()=>o.protocol==="graphql-transport-ws",s=a=>{o.readyState===1&&o.send(JSON.stringify(a))},l=a=>{if(!n){n=!0,e.error(a);try{o.close(1e3)}catch{}}};return o.onopen=()=>s({type:"connection_init",payload:r.connectionParams}),o.onmessage=a=>{let c;try{c=JSON.parse(String(a.data))}catch{return}switch(c.type){case"connection_ack":s({id:"1",type:i()?"subscribe":"start",payload:{query:r.query,variables:r.variables}}),r.onStarted?.();return;case"ping":s({type:"pong"});return;case"next":case"data":{let u=c.payload;if(u?.errors?.length){l(Rt(u.errors));return}u?.data&&e.next(u.data[r.field]);return}case"error":l(Rt(Array.isArray(c.payload)?c.payload:[c.payload]));return;case"connection_error":l(new U(String(c.payload?.message??"connection refused"),"unauthorized"));return;case"complete":if(n)return;n=!0,e.complete(),o.close(1e3);return;default:return}},o.onclose=a=>{if(n)return;let c=a?.code===4401||a?.code===4403;l(new U(`connection closed${a?.code?` (${a.code}${a.reason?` ${a.reason}`:""})`:""}`,c?"unauthorized":"network"))},o.onerror=()=>{},()=>{n||(n=!0,s({id:"1",type:i()?"complete":"stop"})),o.onmessage=o.onclose=o.onerror=o.onopen=null;try{o.close(1e3)}catch{}}})}var Cr=r=>Ct(()=>{let e=r();return Et(e)?e.pipe(Ne(1)):V(Promise.resolve(e))}),Pa=6e4,Go="lambforge.agents.device",Ia=15e3,He=class{constructor(e){this.options=e;this.current=null;this.pending$=null;if([e.getToken,e.exchange,e.anonymous].filter(Boolean).length!==1)throw new U("AgentClient: give exactly one of getToken, exchange or anonymous","bad-request");if(e.anonymous&&!e.anonymous.publishableKey.startsWith("lfp_"))throw new U("AgentClient: anonymous visitors need a publishable key (lfp_...)","bad-request");this.endpoint={url:e.url??Er,fetch:e.fetch}}token$(){return this.current&&Date.now()<this.current.renewAt?I(this.current.token):(this.pending$||(this.pending$=this.session$().pipe(_e(e=>{let t=e.expiresAt?Date.parse(e.expiresAt):NaN;this.current={token:e.token,renewAt:Number.isFinite(t)?Math.max(Date.now()+3e4,t-Pa):Date.now()+50*6e4}}),M(e=>e.token),Ot(()=>this.pending$=null),nt(1))),this.pending$)}invalidate(){this.current=null}credential$(){let e=this.options,t=e.credential===!1?null:e.credential??(e.exchange?e.exchange.idToken:null);return t?Cr(t).pipe(M(n=>n||void 0)):I(void 0)}session$(){let e=this.options;if(e.getToken)return Cr(e.getToken).pipe(M(n=>typeof n=="string"?{token:n}:n));if(e.exchange){let{projectId:n,idToken:o,agents:i}=e.exchange;return Cr(o).pipe(B(s=>Mt(this.endpoint,null,ce.exchangeSession,{projectId:n,token:s,agents:i},"exchangeAgentSession")))}let t=e.anonymous;return Cr(t.turnstileToken).pipe(B(n=>Mt(this.endpoint,t.publishableKey,ce.anonymousSession,{deviceId:t.deviceId??Jo(),turnstileToken:n,agents:t.agents},"createAnonymousAgentSession")))}call$(e,t,n){let o=()=>this.token$().pipe(B(i=>Mt(this.endpoint,i,e,t,n)));return o().pipe(G(i=>i?.code!=="session-expired"&&i?.code!=="unauthorized"?At(()=>i):(this.invalidate(),o())))}agents(){return this.call$(ce.sessionAgents,{},"sessionAgents")}conversations(e){return this.call$(ce.conversations,{agent:e},"agentConversations")}agent(e){return{conversation:t=>new Tr(this,e,t??null),conversations:()=>this.conversations(e)}}events(e,t=0){return new _(n=>{let o=t,i=new Map,s=new Z,l=!1,a=!1,c=()=>{for(;i.has(o+1);){let m=i.get(o+1);i.delete(o+1),o=m.seq,n.next(m)}},u=m=>{!m||m.seq<=o||(i.set(m.seq,m),c(),i.size&&p())},p=()=>{if(l){a=!0;return}l=!0,s.add(this.call$(ce.events,{conversationId:e,afterSeq:o},"agentConversationEvents").subscribe({next:m=>{m.forEach(b=>i.set(b.seq,b)),c(),i.size&&!m.length&&(o=Math.min(...i.keys())-1,c())},error:m=>{l=!1,n.error(m)},complete:()=>{l=!1,a&&(a=!1,p())}}))},d=this.webSocket();if(!d)return p(),s.add($r(this.options.pollIntervalMs??1500,this.options.pollIntervalMs??1500).subscribe(()=>p())),s;let f=0,v=!1,h=()=>{s.add(this.token$().pipe(B(m=>Yo({url:Bo(this.endpoint.url),WebSocket:d,connectionParams:{agentSession:m},query:ce.liveEvents,variables:{conversationId:e},field:"agentEvents",onStarted:()=>{f=0,v=!1,p()}}))).subscribe({next:u,error:m=>{if(m?.code==="unauthorized"&&!v){v=!0,this.invalidate(),h();return}if(m?.code!=="network"){n.error(m);return}let b=Math.min(Ia,1e3*2**f++);s.add($r(b*(.75+Math.random()/2)).subscribe(h))},complete:()=>n.complete()}))};return h(),s})}webSocket(){return this.options.WebSocket===!1?null:this.options.WebSocket??(globalThis.WebSocket||null)}},Tr=class{constructor(e,t,n){this.client=e;this.agent=t;this.id=n}send(e,t={}){return(t.credential!==void 0?I(t.credential):this.client.credential$()).pipe(B(o=>this.client.call$(ce.send,{agent:this.agent,conversationId:this.id,text:e,credential:o},"sendAgentMessage"))).pipe(_e(o=>this.id=o.conversationId),B(o=>this.client.events(o.conversationId,Math.max(0,o.seq-2)).pipe(Pt(i=>!((i.type==="done"||i.type==="error")&&i.runId===o.runId),!0))))}events(e){return this.id?e===void 0?this.history().pipe(B(t=>this.client.events(this.id,t.lastSeq??0))):this.client.events(this.id,e):At(()=>new U("No conversation yet - send a message first","bad-request"))}history(){return this.id?this.client.call$(ce.conversation,{id:this.id},"agentConversation"):At(()=>new U("No conversation yet - send a message first","bad-request"))}abort(){return this.id?this.client.call$(ce.abort,{conversationId:this.id},"abortAgentRun"):I(!1)}};function Jo(){let r=globalThis.localStorage;try{let t=r?.getItem(Go);if(t&&/^[A-Za-z0-9_-]{16,128}$/.test(t))return t}catch{}let e=globalThis.crypto.randomUUID().replace(/-/g,"");try{r?.setItem(Go,e)}catch{}return e}var Xs=an(Rs()),w=an(Kt());var oe=an(Kt()),Jl=/^(https?:|mailto:)/i,Zn=/^\s*[-*+]\s+/,Vr=/^\s*\d+[.)]\s+/,Zl=/^```\s*([\w+-]*)\s*$/,Ms=/^(#{1,6})\s+(.*)$/;function Br(r){let e=[],t=String(r??"").replace(/\r\n?/g,`
|
|
34
34
|
`).split(`
|
|
35
35
|
`),n=0;for(;n<t.length;){let o=t[n],i=o.match(Zl);if(i){let a=[];for(n++;n<t.length&&!/^```\s*$/.test(t[n]);)a.push(t[n++]);n++,e.push(oe.html`<pre><code data-lang=${i[1]||""}>${a.join(`
|
|
36
|
-
`)}</code></pre>`);continue}let s=o.match(Ms);if(s){e.push(oe.html`<p><strong class="h">${Ge(s[2])}</strong></p>`),n++;continue}if(Zn.test(o)||zr.test(o)){let a=zr.test(o),c=a?zr:Zn,u=[];for(;n<t.length&&c.test(t[n]);)u.push(oe.html`<li>${Ge(t[n++].replace(c,""))}</li>`);e.push(a?oe.html`<ol>${u}</ol>`:oe.html`<ul>${u}</ul>`);continue}if(!o.trim()){n++;continue}let l=[];for(;n<t.length&&t[n].trim()&&!/^```/.test(t[n])&&!Ms.test(t[n])&&!Zn.test(t[n])&&!zr.test(t[n]);)l.push(t[n++]);e.push(oe.html`<p>${l.map((a,c)=>c?oe.html`<br />${Ge(a)}`:Ge(a))}</p>`)}return e}var Xl=/(`[^`]+`)|(\*\*[^*]+\*\*)|(__[^_]+__)|(\*[^*\s][^*]*\*)|(\[[^\]]+\]\([^)\s]+\))|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/;function Ge(r){let e=[],t=r;for(;t;){let n=t.match(Xl);if(!n||n.index===void 0){e.push(t);break}n.index&&e.push(t.slice(0,n.index));let o=n[0];if(n[1])e.push(oe.html`<code>${o.slice(1,-1)}</code>`);else if(n[2]||n[3])e.push(oe.html`<strong>${Ge(o.slice(2,-2))}</strong>`);else if(n[4])e.push(oe.html`<em>${Ge(o.slice(1,-1))}</em>`);else if(n[5]){let[,i,s]=o.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/)??[];e.push(js(i,s))}else e.push(js(o,o));t=t.slice(n.index+o.length)}return e}function js(r,e){return Jl.test(e)?oe.html`<a href=${e} target="_blank" rel="noopener noreferrer nofollow">${r}</a>`:r}var vt=function(){return vt=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},vt.apply(this,arguments)};function J(r,e){if(typeof e=="function")return Gt(r,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return vt(vt({},e.apply(void 0,n)),{type:r})});var t=e?e._as:"empty";switch(t){case"empty":return Gt(r,function(){return{type:r}});case"fsa":return Gt(r,function(n,o){return n instanceof Error?{error:!0,meta:o,payload:n,type:r}:{error:!1,meta:o,payload:n,type:r}});case"payload":return Gt(r,function(n){return{payload:n,type:r}});case"props":return Gt(r,function(n){return vt(vt({},n),{type:r})});default:throw new Error("Unexpected config.")}}function he(){return{_as:"payload",_p:void 0}}function Gt(r,e){return Object.defineProperty(e,"type",{value:r,writable:!1})}var Ql=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),o=0,e=0;e<t;e++)for(var i=arguments[e],s=0,l=i.length;s<l;s++,o++)n[o]=i[s];return n};function ee(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=r.pop(),n=r.reduce(function(o,i){return Ql(o,[i.type])},[]);return{reducer:t,types:n}}function Ls(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=new Map,o=0,i=e;o<i.length;o++)for(var s=i[o],l=0,a=s.types;l<a.length;l++){var c=a[l];n.has(c)?console.warn(c+" already specified in an 'on' call."):n.set(c,s.reducer)}return function(u,p){u===void 0&&(u=r);var d=n.get(p.type);return d?d(u,p):u}}var Br=J("[chat] shown",he()),Kr=J("[chat] connecting"),gt=J("[chat] failed",he()),Jt=J("[chat] verifying",he()),Zt=J("[chat] agents loaded",he()),Je=J("[chat] pick agent",he()),Yr=J("[chat] history loaded",he()),yt=J("[chat] new conversation"),bt=J("[chat] send",he()),Xn=J("[chat] resume",he()),Gr=J("[chat] event",he()),Jr=J("[chat] run ended"),Ze=J("[chat] stop",he());var Xt;(function(r){r.switchMap="switchMap",r.mergeMap="mergeMap",r.concatMap="concatMap",r.exhaustMap="exhaustMap"})(Xt||(Xt={}));var Us=r=>r!==null&&typeof r=="object";var Ds=r=>r.reduce((e,t)=>(...n)=>e(t(...n))),Xe=fn(G(r=>R(r))),Zr=r=>r.pipe(Xe),Xr=r=>Et(r)?r:r instanceof Promise?V(r):R(r);function qs([r,e,t]){function n(o,i){return t.length>0?Ds(t)(e)(o,i):e(o,i)}return xn(n,r)}var Ns={switchMap:B,mergeMap:re,concatMap:Tt,exhaustMap:Ar};function Fs(r={},e={},t){var n;let o=r&&r.reducer$&&r.reducer$.pipe(Xe)||R((m,b)=>m),i=new te,s=m=>Ee(r&&r.actionStream$&&r.actionStream$.pipe(Xe)||le,t).pipe(ve(Us),j(Xr),u(Zr),_e(i),m,j(Xr)),l=(r&&r.initialState$&&r.initialState$.pipe(Xe)||R({})).pipe(kt()),a=r&&r.middleware$&&r.middleware$.pipe(Xe)||R([]),c=((n=r?.destroy$)===null||n===void 0?void 0:n.pipe(Xe))||gn,u=Ns[e&&e.actionFlatOp||Xt.concatMap],p=Ns[e&&e.stateFlatOp||Xt.switchMap],d=m=>m.pipe(p(Zr),j(Xr),p(Zr)),f=e&&e.bufferSize||1,v=e&&e.windowTime;return{reducer$:o,actions$:i,actionStream$:s,initialState$:l,middleware$:a,destroy$:c,flattenState$:d,shareReplayConfig:{refCount:!1,bufferSize:f,windowTime:v}}}var Qn="@@redux-devtools/JUMP_TO_STATE";function Hs(r){if(!r)return;let e=r===!0?{}:r;return e.enabled===!1?void 0:e}function Ws(r){return(e,t)=>t?.type===Qn?t.state:r(e,t)}function zs(r,e={}){var t,n;let o=globalThis.__REDUX_DEVTOOLS_EXTENSION__;if(e.enabled===!1||!o)return()=>{};let i=o.connect(Object.assign({name:(t=e.name)!==null&&t!==void 0?t:"RxDI Store",maxAge:(n=e.maxAge)!==null&&n!==void 0?n:50},e.extensionOptions)),s=new Z,l;s.add(r.state$.subscribe(c=>{l=c})),i.init(l),s.add(r.state$.pipe(Sn(r.actions$),ve(([,c])=>c.type!==Qn)).subscribe(([c,u])=>i.send(u,c)));let a=i.subscribe(c=>{var u;if(c.type!=="DISPATCH")return;let p=(u=c.payload)===null||u===void 0?void 0:u.type;(p==="JUMP_TO_ACTION"||p==="JUMP_TO_STATE")&&c.state?r.dispatch({type:Qn,state:JSON.parse(c.state)}):p==="COMMIT"&&i.init(l)});return()=>{var c;s.unsubscribe(),typeof a=="function"&&a(),(c=i.unsubscribe)===null||c===void 0||c.call(i)}}var Qr=class{constructor(e,t){var n,o,i,s;this.config=e,this.options=t,this._dispatch$=new te,this.dispatch=m=>{this._dispatch$.next(m)};let l=Hs((n=this.config)===null||n===void 0?void 0:n.devTools);l&&(this.config=Object.assign(Object.assign({},this.config),{reducer$:((i=(o=this.config)===null||o===void 0?void 0:o.reducer$)!==null&&i!==void 0?i:R(m=>m)).pipe(j(m=>Ws(m)))}));let{reducer$:a,actions$:c,actionStream$:u,middleware$:p,initialState$:d,destroy$:f,flattenState$:v,shareReplayConfig:h}=Fs(this.config,this.options,this._dispatch$);if(this.state$=vn([d,a,p]).pipe(j(qs),Tt(u),_n(d),v,Fe(f),nt(h)),this.state$.subscribe(),this.actions$=c.pipe(nt(h)),!((s=this.config)===null||s===void 0)&&s.epic$&&this.config.epic$(this.actions$,this.state$).pipe(Fe(f)).subscribe({next:m=>this.dispatch(m),error:m=>console.error("[Epic] Error:",m)}),l){let m=zs(this,l);f.subscribe(()=>m())}}};function eo(r={},e={}){return new Qr(r,e)}function Re(...r){let e=new Set(r.map(t=>t.type));return t=>t.pipe(ve(n=>e.has(n.type)))}function xt(r={dispatch:!0}){return e=>(t,n)=>{let o=e(t,n);return r.dispatch===!1?o.pipe(rt(),G(i=>(console.error("[Effect] Error:",i),R()))):o.pipe(G(i=>(console.error("[Effect] Error:",i),R())))}}function Vs(...r){return(e,t)=>Ee(...r.map(n=>n(e,t)))}var ec=r=>r?.code||"internal",to=r=>R(gt(ec(r)));function tc(r,e){let t=e.agents.length?r.filter(o=>e.agents.includes(o.id)||e.agents.includes(o.name)):r,n=t.find(o=>o.id===e.agent||o.name===e.agent)??t[0];return{agents:t,agentId:n?.id??null}}var en=class{constructor(e){this.ctx=e;this.connect$=xt()((e,t)=>t.pipe(ve(n=>n.shown),Ne(1),B(()=>{let n=this.ctx.client;return n?Ae(R(Kr()),n.agents().pipe(Ne(1),j(o=>Zt(tc(o,this.ctx))),G(to))):R(gt("unauthorized"))})));this.select$=xt()(e=>Ee(e.pipe(Re(Zt),j(({payload:t})=>t.agentId)),e.pipe(Re(Je),j(({payload:t})=>t))).pipe(ve(t=>!!t),B(t=>{let n=this.ctx.client;return n.conversations(t).pipe(Ne(1),B(o=>{let i=o?.[0];return i?n.agent(t).conversation(i.id).history().pipe(re(s=>V([Yr({agentId:t,detail:s}),...s.answering?[Xn({agentId:t,conversationId:s.id,afterSeq:s.lastSeq??0})]:[]]))):le}),G(to))})));this.run$=xt()(e=>Ee(e.pipe(Re(bt),j(({payload:t})=>{let{agentId:n,conversationId:o,text:i}=t,s=this.conversation(n,o);return{c:s,events:s.send(i)}})),e.pipe(Re(Xn),j(({payload:t})=>{let{agentId:n,conversationId:o,afterSeq:i}=t,s=this.conversation(n,o);return{c:s,events:s.events(i)}}))).pipe(B(({c:t,events:n})=>this.follow$(t,n).pipe(Fe(e.pipe(Re(Ze,Je,yt))),bn(Jr())))));this.abort$=xt()(e=>e.pipe(Re(Ze),re(({payload:t})=>{let{agentId:n,conversationId:o}=t;return!o||!this.ctx.client?le:this.conversation(n,o).abort().pipe(rt(),G(()=>le))})));this.failures$=xt()(e=>e.pipe(Re(gt),_e(({payload:t})=>this.ctx.emit("error",{code:t})),rt()))}conversation(e,t){return this.ctx.client.agent(e).conversation(t??void 0)}follow$(e,t){let n=new Set;return t.pipe(Pt(o=>o.type!=="done"&&o.type!=="error",!0),_e(o=>{o.type==="message"&&o.data?.role==="assistant"&&!n.has(o.data.id)&&(n.add(o.data.id),this.ctx.emit("answer",{text:o.data.text,agent:e.agent,conversationId:o.conversationId})),o.type==="error"&&this.ctx.emit("error",{code:o.data?.code??"internal"})}),j(o=>Gr(o)),G(to))}};var tn={shown:!1,agents:[],agentId:null,conversationId:null,messages:[],answering:!1,notice:null};function ro(r){let e=(r.toolCalls??[]).map(t=>t?.name).filter(t=>!!t);return{id:r.id,role:r.role,text:r.text??"",tools:Array.from(new Set(e))}}var rc=/^local:/,Bs={conversationId:null,messages:[],answering:!1,notice:null},Ks=Ls(tn,ee(Br,(r,{payload:e})=>r.shown||!e?r:{...r,shown:!0}),ee(Kr,r=>({...r,notice:{kind:"busy",what:"connecting"}})),ee(gt,(r,{payload:e})=>({...r,answering:!1,notice:{kind:"error",code:e}})),ee(Jt,(r,{payload:e})=>({...r,notice:e?{kind:"busy",what:"verifying"}:r.notice?.kind==="busy"&&r.notice.what==="verifying"?null:r.notice})),ee(Zt,(r,{payload:e})=>({...r,agents:e.agents,agentId:e.agentId,notice:e.agentId?null:{kind:"error",code:"agent-unavailable"}})),ee(Je,(r,{payload:e})=>({...r,...Bs,agentId:e})),ee(Yr,(r,{payload:e})=>e.agentId!==r.agentId?r:{...r,conversationId:e.detail.id,messages:(e.detail.messages??[]).map(ro),answering:!!e.detail.answering,notice:e.detail.answering?{kind:"busy",what:"thinking"}:null}),ee(yt,r=>({...r,...Bs})),ee(bt,(r,{payload:e})=>({...r,messages:[...r.messages,{id:`local:${r.messages.length}`,role:"user",text:e.text,tools:[]}],answering:!0,notice:{kind:"busy",what:"thinking"}})),ee(Gr,(r,{payload:e})=>nc(r,e)),ee(Jr,r=>({...r,answering:!1,notice:r.notice?.kind==="busy"?null:r.notice})),ee(Ze,r=>({...r,answering:!1,notice:{kind:"info",what:"stopped"}})));function nc(r,e){let t=r.conversationId??e.conversationId;if(e.conversationId!==t)return r;if(e.type==="error")return{...r,conversationId:t,notice:{kind:"error",code:e.data?.code??"internal"}};if(e.type!=="message"||!e.data?.id)return{...r,conversationId:t};let n=ro(e.data);if(r.messages.some(s=>s.id===n.id))return{...r,conversationId:t};let o=[...r.messages],i=n.role==="user"?o.findIndex(s=>rc.test(s.id)&&s.text===n.text):-1;return i>=0?o[i]=n:o.push(n),{...r,conversationId:t,messages:o}}var rn=class{constructor(e,t={}){this.destroy$=new te;let n=new en(e);this.store=eo({reducer$:R(Ks),initialState$:R({...tn,...t}),epic$:Vs(n.select$,n.run$,n.abort$,n.failures$,n.connect$),destroy$:this.destroy$}),this.state$=this.store.state$.pipe(yn())}dispatch(e){this.store.dispatch(e)}destroy(){this.destroy$.next(),this.destroy$.complete()}};var Ys={title:"Chat",open:"Open chat",close:"Close chat",newChat:"New conversation",placeholder:"Type a message",send:"Send",stop:"Stop",thinking:"Thinking",connecting:"Connecting",pickAgent:"Assistant",usedTools:"Used",verifying:"Checking that you are human",errors:{"limit-reached":"This conversation is full - start a new one.","cap-reached":"The assistant is not available right now - try again later.","agent-unavailable":"This assistant is not available.","session-expired":"Your session ended - reload the page.","credential-expired":"Please sign in again.",aborted:"Stopped.",internal:"Something went wrong - try again.",unauthorized:"This chat is not allowed here.","bad-request":"That did not work - try again.",network:"No connection - try again.",default:"Something went wrong - try again."}},oc={title:"\u0427\u0430\u0442",open:"\u041E\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",close:"\u0417\u0430\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",newChat:"\u041D\u043E\u0432 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",placeholder:"\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0441\u044A\u043E\u0431\u0449\u0435\u043D\u0438\u0435",send:"\u0418\u0437\u043F\u0440\u0430\u0442\u0438",stop:"\u0421\u043F\u0440\u0438",thinking:"\u041C\u0438\u0441\u043B\u044F",connecting:"\u0421\u0432\u044A\u0440\u0437\u0432\u0430\u043D\u0435",pickAgent:"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442",usedTools:"\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u043D\u043E",verifying:"\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430, \u0447\u0435 \u0441\u0442\u0435 \u0447\u043E\u0432\u0435\u043A",errors:{"limit-reached":"\u0420\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u044A\u0442 \u0435 \u043F\u044A\u043B\u0435\u043D - \u0437\u0430\u043F\u043E\u0447\u043D\u0435\u0442\u0435 \u043D\u043E\u0432.","cap-reached":"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u044A\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D \u0432 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.","agent-unavailable":"\u0422\u043E\u0437\u0438 \u0430\u0441\u0438\u0441\u0442\u0435\u043D\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D.","session-expired":"\u0421\u0435\u0441\u0438\u044F\u0442\u0430 \u0438\u0437\u0442\u0435\u0447\u0435 - \u043F\u0440\u0435\u0437\u0430\u0440\u0435\u0434\u0435\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0442\u0430.","credential-expired":"\u041C\u043E\u043B\u044F, \u0432\u043B\u0435\u0437\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",aborted:"\u0421\u043F\u0440\u044F\u043D\u043E.",internal:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",unauthorized:"\u0422\u043E\u0437\u0438 \u0447\u0430\u0442 \u043D\u0435 \u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D \u0442\u0443\u043A.","bad-request":"\u041D\u0435 \u0441\u0435 \u043F\u043E\u043B\u0443\u0447\u0438 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",network:"\u041D\u044F\u043C\u0430 \u0432\u0440\u044A\u0437\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",default:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E."}},Gs={en:Ys,bg:oc};function no(r,e={}){let t=String(r||"en").toLowerCase().split("-")[0],n=Gs[t]??Ys;return{...n,...e,errors:{...n.errors,...e.errors??{}}}}var Js=`
|
|
36
|
+
`)}</code></pre>`);continue}let s=o.match(Ms);if(s){e.push(oe.html`<p><strong class="h">${Ge(s[2])}</strong></p>`),n++;continue}if(Zn.test(o)||Vr.test(o)){let a=Vr.test(o),c=a?Vr:Zn,u=[];for(;n<t.length&&c.test(t[n]);)u.push(oe.html`<li>${Ge(t[n++].replace(c,""))}</li>`);e.push(a?oe.html`<ol>${u}</ol>`:oe.html`<ul>${u}</ul>`);continue}if(!o.trim()){n++;continue}let l=[];for(;n<t.length&&t[n].trim()&&!/^```/.test(t[n])&&!Ms.test(t[n])&&!Zn.test(t[n])&&!Vr.test(t[n]);)l.push(t[n++]);e.push(oe.html`<p>${l.map((a,c)=>c?oe.html`<br />${Ge(a)}`:Ge(a))}</p>`)}return e}var Xl=/(`[^`]+`)|(\*\*[^*]+\*\*)|(__[^_]+__)|(\*[^*\s][^*]*\*)|(\[[^\]]+\]\([^)\s]+\))|(https?:\/\/[^\s<>()]+[^\s<>().,;:!?'"])/;function Ge(r){let e=[],t=r;for(;t;){let n=t.match(Xl);if(!n||n.index===void 0){e.push(t);break}n.index&&e.push(t.slice(0,n.index));let o=n[0];if(n[1])e.push(oe.html`<code>${o.slice(1,-1)}</code>`);else if(n[2]||n[3])e.push(oe.html`<strong>${Ge(o.slice(2,-2))}</strong>`);else if(n[4])e.push(oe.html`<em>${Ge(o.slice(1,-1))}</em>`);else if(n[5]){let[,i,s]=o.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/)??[];e.push(js(i,s))}else e.push(js(o,o));t=t.slice(n.index+o.length)}return e}function js(r,e){return Jl.test(e)?oe.html`<a href=${e} target="_blank" rel="noopener noreferrer nofollow">${r}</a>`:r}var vt=function(){return vt=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++){e=arguments[t];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},vt.apply(this,arguments)};function J(r,e){if(typeof e=="function")return Gt(r,function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return vt(vt({},e.apply(void 0,n)),{type:r})});var t=e?e._as:"empty";switch(t){case"empty":return Gt(r,function(){return{type:r}});case"fsa":return Gt(r,function(n,o){return n instanceof Error?{error:!0,meta:o,payload:n,type:r}:{error:!1,meta:o,payload:n,type:r}});case"payload":return Gt(r,function(n){return{payload:n,type:r}});case"props":return Gt(r,function(n){return vt(vt({},n),{type:r})});default:throw new Error("Unexpected config.")}}function he(){return{_as:"payload",_p:void 0}}function Gt(r,e){return Object.defineProperty(e,"type",{value:r,writable:!1})}var Ql=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),o=0,e=0;e<t;e++)for(var i=arguments[e],s=0,l=i.length;s<l;s++,o++)n[o]=i[s];return n};function ee(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var t=r.pop(),n=r.reduce(function(o,i){return Ql(o,[i.type])},[]);return{reducer:t,types:n}}function Ls(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var n=new Map,o=0,i=e;o<i.length;o++)for(var s=i[o],l=0,a=s.types;l<a.length;l++){var c=a[l];n.has(c)?console.warn(c+" already specified in an 'on' call."):n.set(c,s.reducer)}return function(u,p){u===void 0&&(u=r);var d=n.get(p.type);return d?d(u,p):u}}var Kr=J("[chat] shown",he()),Yr=J("[chat] connecting"),gt=J("[chat] failed",he()),Jt=J("[chat] verifying",he()),Zt=J("[chat] agents loaded",he()),Je=J("[chat] pick agent",he()),Gr=J("[chat] history loaded",he()),yt=J("[chat] new conversation"),bt=J("[chat] send",he()),Xn=J("[chat] resume",he()),Jr=J("[chat] event",he()),Zr=J("[chat] run ended"),Ze=J("[chat] stop",he());var Xt;(function(r){r.switchMap="switchMap",r.mergeMap="mergeMap",r.concatMap="concatMap",r.exhaustMap="exhaustMap"})(Xt||(Xt={}));var Us=r=>r!==null&&typeof r=="object";var Ds=r=>r.reduce((e,t)=>(...n)=>e(t(...n))),Xe=dn(G(r=>I(r))),Xr=r=>r.pipe(Xe),Qr=r=>Et(r)?r:r instanceof Promise?V(r):I(r);function qs([r,e,t]){function n(o,i){return t.length>0?Ds(t)(e)(o,i):e(o,i)}return wn(n,r)}var Ns={switchMap:B,mergeMap:re,concatMap:Tt,exhaustMap:Ar};function Fs(r={},e={},t){var n;let o=r&&r.reducer$&&r.reducer$.pipe(Xe)||I((m,b)=>m),i=new te,s=m=>Ee(r&&r.actionStream$&&r.actionStream$.pipe(Xe)||le,t).pipe(ve(Us),M(Qr),u(Xr),_e(i),m,M(Qr)),l=(r&&r.initialState$&&r.initialState$.pipe(Xe)||I({})).pipe(kt()),a=r&&r.middleware$&&r.middleware$.pipe(Xe)||I([]),c=((n=r?.destroy$)===null||n===void 0?void 0:n.pipe(Xe))||yn,u=Ns[e&&e.actionFlatOp||Xt.concatMap],p=Ns[e&&e.stateFlatOp||Xt.switchMap],d=m=>m.pipe(p(Xr),M(Qr),p(Xr)),f=e&&e.bufferSize||1,v=e&&e.windowTime;return{reducer$:o,actions$:i,actionStream$:s,initialState$:l,middleware$:a,destroy$:c,flattenState$:d,shareReplayConfig:{refCount:!1,bufferSize:f,windowTime:v}}}var Qn="@@redux-devtools/JUMP_TO_STATE";function Hs(r){if(!r)return;let e=r===!0?{}:r;return e.enabled===!1?void 0:e}function Ws(r){return(e,t)=>t?.type===Qn?t.state:r(e,t)}function zs(r,e={}){var t,n;let o=globalThis.__REDUX_DEVTOOLS_EXTENSION__;if(e.enabled===!1||!o)return()=>{};let i=o.connect(Object.assign({name:(t=e.name)!==null&&t!==void 0?t:"RxDI Store",maxAge:(n=e.maxAge)!==null&&n!==void 0?n:50},e.extensionOptions)),s=new Z,l;s.add(r.state$.subscribe(c=>{l=c})),i.init(l),s.add(r.state$.pipe($n(r.actions$),ve(([,c])=>c.type!==Qn)).subscribe(([c,u])=>i.send(u,c)));let a=i.subscribe(c=>{var u;if(c.type!=="DISPATCH")return;let p=(u=c.payload)===null||u===void 0?void 0:u.type;(p==="JUMP_TO_ACTION"||p==="JUMP_TO_STATE")&&c.state?r.dispatch({type:Qn,state:JSON.parse(c.state)}):p==="COMMIT"&&i.init(l)});return()=>{var c;s.unsubscribe(),typeof a=="function"&&a(),(c=i.unsubscribe)===null||c===void 0||c.call(i)}}var en=class{constructor(e,t){var n,o,i,s;this.config=e,this.options=t,this._dispatch$=new te,this.dispatch=m=>{this._dispatch$.next(m)};let l=Hs((n=this.config)===null||n===void 0?void 0:n.devTools);l&&(this.config=Object.assign(Object.assign({},this.config),{reducer$:((i=(o=this.config)===null||o===void 0?void 0:o.reducer$)!==null&&i!==void 0?i:I(m=>m)).pipe(M(m=>Ws(m)))}));let{reducer$:a,actions$:c,actionStream$:u,middleware$:p,initialState$:d,destroy$:f,flattenState$:v,shareReplayConfig:h}=Fs(this.config,this.options,this._dispatch$);if(this.state$=gn([d,a,p]).pipe(M(qs),Tt(u),Sn(d),v,Fe(f),nt(h)),this.state$.subscribe(),this.actions$=c.pipe(nt(h)),!((s=this.config)===null||s===void 0)&&s.epic$&&this.config.epic$(this.actions$,this.state$).pipe(Fe(f)).subscribe({next:m=>this.dispatch(m),error:m=>console.error("[Epic] Error:",m)}),l){let m=zs(this,l);f.subscribe(()=>m())}}};function eo(r={},e={}){return new en(r,e)}function Re(...r){let e=new Set(r.map(t=>t.type));return t=>t.pipe(ve(n=>e.has(n.type)))}function xt(r={dispatch:!0}){return e=>(t,n)=>{let o=e(t,n);return r.dispatch===!1?o.pipe(rt(),G(i=>(console.error("[Effect] Error:",i),I()))):o.pipe(G(i=>(console.error("[Effect] Error:",i),I())))}}function Vs(...r){return(e,t)=>Ee(...r.map(n=>n(e,t)))}var ec=r=>r?.code||"internal",to=r=>I(gt(ec(r)));function tc(r,e){let t=e.agents.length?r.filter(o=>e.agents.includes(o.id)||e.agents.includes(o.name)):r,n=t.find(o=>o.id===e.agent||o.name===e.agent)??t[0];return{agents:t,agentId:n?.id??null}}var tn=class{constructor(e){this.ctx=e;this.connect$=xt()((e,t)=>t.pipe(ve(n=>n.shown),Ne(1),B(()=>{let n=this.ctx.client;return n?Ae(I(Yr()),n.agents().pipe(Ne(1),M(o=>Zt(tc(o,this.ctx))),G(to))):I(gt("unauthorized"))})));this.select$=xt()(e=>Ee(e.pipe(Re(Zt),M(({payload:t})=>t.agentId)),e.pipe(Re(Je),M(({payload:t})=>t))).pipe(ve(t=>!!t),B(t=>{let n=this.ctx.client;return n.conversations(t).pipe(Ne(1),B(o=>{let i=o?.[0];return i?n.agent(t).conversation(i.id).history().pipe(re(s=>V([Gr({agentId:t,detail:s}),...s.answering?[Xn({agentId:t,conversationId:s.id,afterSeq:s.lastSeq??0})]:[]]))):le}),G(to))})));this.run$=xt()(e=>Ee(e.pipe(Re(bt),M(({payload:t})=>{let{agentId:n,conversationId:o,text:i}=t,s=this.conversation(n,o);return{c:s,events:s.send(i)}})),e.pipe(Re(Xn),M(({payload:t})=>{let{agentId:n,conversationId:o,afterSeq:i}=t,s=this.conversation(n,o);return{c:s,events:s.events(i)}}))).pipe(B(({c:t,events:n})=>this.follow$(t,n).pipe(Fe(e.pipe(Re(Ze,Je,yt))),xn(Zr())))));this.abort$=xt()(e=>e.pipe(Re(Ze),re(({payload:t})=>{let{agentId:n,conversationId:o}=t;return!o||!this.ctx.client?le:this.conversation(n,o).abort().pipe(rt(),G(()=>le))})));this.failures$=xt()(e=>e.pipe(Re(gt),_e(({payload:t})=>this.ctx.emit("error",{code:t})),rt()))}conversation(e,t){return this.ctx.client.agent(e).conversation(t??void 0)}follow$(e,t){let n=new Set;return t.pipe(Pt(o=>o.type!=="done"&&o.type!=="error",!0),_e(o=>{o.type==="message"&&o.data?.role==="assistant"&&!n.has(o.data.id)&&(n.add(o.data.id),this.ctx.emit("answer",{text:o.data.text,agent:e.agent,conversationId:o.conversationId})),o.type==="error"&&this.ctx.emit("error",{code:o.data?.code??"internal"})}),M(o=>Jr(o)),G(to))}};var rn={shown:!1,agents:[],agentId:null,conversationId:null,messages:[],answering:!1,notice:null};function ro(r){let e=(r.toolCalls??[]).map(t=>t?.name).filter(t=>!!t);return{id:r.id,role:r.role,text:r.text??"",tools:Array.from(new Set(e))}}var rc=/^local:/,Bs={conversationId:null,messages:[],answering:!1,notice:null},Ks=Ls(rn,ee(Kr,(r,{payload:e})=>r.shown||!e?r:{...r,shown:!0}),ee(Yr,r=>({...r,notice:{kind:"busy",what:"connecting"}})),ee(gt,(r,{payload:e})=>({...r,answering:!1,notice:{kind:"error",code:e}})),ee(Jt,(r,{payload:e})=>({...r,notice:e?{kind:"busy",what:"verifying"}:r.notice?.kind==="busy"&&r.notice.what==="verifying"?null:r.notice})),ee(Zt,(r,{payload:e})=>({...r,agents:e.agents,agentId:e.agentId,notice:e.agentId?null:{kind:"error",code:"agent-unavailable"}})),ee(Je,(r,{payload:e})=>({...r,...Bs,agentId:e})),ee(Gr,(r,{payload:e})=>e.agentId!==r.agentId?r:{...r,conversationId:e.detail.id,messages:(e.detail.messages??[]).map(ro),answering:!!e.detail.answering,notice:e.detail.answering?{kind:"busy",what:"thinking"}:null}),ee(yt,r=>({...r,...Bs})),ee(bt,(r,{payload:e})=>({...r,messages:[...r.messages,{id:`local:${r.messages.length}`,role:"user",text:e.text,tools:[]}],answering:!0,notice:{kind:"busy",what:"thinking"}})),ee(Jr,(r,{payload:e})=>nc(r,e)),ee(Zr,r=>({...r,answering:!1,notice:r.notice?.kind==="busy"?null:r.notice})),ee(Ze,r=>({...r,answering:!1,notice:{kind:"info",what:"stopped"}})));function nc(r,e){let t=r.conversationId??e.conversationId;if(e.conversationId!==t)return r;if(e.type==="error")return{...r,conversationId:t,notice:{kind:"error",code:e.data?.code??"internal"}};if(e.type!=="message"||!e.data?.id)return{...r,conversationId:t};let n=ro(e.data);if(r.messages.some(s=>s.id===n.id))return{...r,conversationId:t};let o=[...r.messages],i=n.role==="user"?o.findIndex(s=>rc.test(s.id)&&s.text===n.text):-1;return i>=0?o[i]=n:o.push(n),{...r,conversationId:t,messages:o}}var nn=class{constructor(e,t={}){this.destroy$=new te;let n=new tn(e);this.store=eo({reducer$:I(Ks),initialState$:I({...rn,...t}),epic$:Vs(n.select$,n.run$,n.abort$,n.failures$,n.connect$),destroy$:this.destroy$}),this.state$=this.store.state$.pipe(bn())}dispatch(e){this.store.dispatch(e)}destroy(){this.destroy$.next(),this.destroy$.complete()}};var Ys={title:"Chat",open:"Open chat",close:"Close chat",newChat:"New conversation",placeholder:"Type a message",send:"Send",stop:"Stop",thinking:"Thinking",connecting:"Connecting",pickAgent:"Assistant",usedTools:"Used",verifying:"Checking that you are human",errors:{"limit-reached":"This conversation is full - start a new one.","cap-reached":"The assistant is not available right now - try again later.","agent-unavailable":"This assistant is not available.","session-expired":"Your session ended - reload the page.","credential-expired":"Please sign in again.",aborted:"Stopped.",internal:"Something went wrong - try again.",unauthorized:"This chat is not allowed here.","bad-request":"That did not work - try again.",network:"No connection - try again.",default:"Something went wrong - try again."}},oc={title:"\u0427\u0430\u0442",open:"\u041E\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",close:"\u0417\u0430\u0442\u0432\u043E\u0440\u0438 \u0447\u0430\u0442\u0430",newChat:"\u041D\u043E\u0432 \u0440\u0430\u0437\u0433\u043E\u0432\u043E\u0440",placeholder:"\u041D\u0430\u043F\u0438\u0448\u0435\u0442\u0435 \u0441\u044A\u043E\u0431\u0449\u0435\u043D\u0438\u0435",send:"\u0418\u0437\u043F\u0440\u0430\u0442\u0438",stop:"\u0421\u043F\u0440\u0438",thinking:"\u041C\u0438\u0441\u043B\u044F",connecting:"\u0421\u0432\u044A\u0440\u0437\u0432\u0430\u043D\u0435",pickAgent:"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442",usedTools:"\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u043D\u043E",verifying:"\u041F\u0440\u043E\u0432\u0435\u0440\u043A\u0430, \u0447\u0435 \u0441\u0442\u0435 \u0447\u043E\u0432\u0435\u043A",errors:{"limit-reached":"\u0420\u0430\u0437\u0433\u043E\u0432\u043E\u0440\u044A\u0442 \u0435 \u043F\u044A\u043B\u0435\u043D - \u0437\u0430\u043F\u043E\u0447\u043D\u0435\u0442\u0435 \u043D\u043E\u0432.","cap-reached":"\u0410\u0441\u0438\u0441\u0442\u0435\u043D\u0442\u044A\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D \u0432 \u043C\u043E\u043C\u0435\u043D\u0442\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043F\u043E-\u043A\u044A\u0441\u043D\u043E.","agent-unavailable":"\u0422\u043E\u0437\u0438 \u0430\u0441\u0438\u0441\u0442\u0435\u043D\u0442 \u043D\u0435 \u0435 \u0434\u043E\u0441\u0442\u044A\u043F\u0435\u043D.","session-expired":"\u0421\u0435\u0441\u0438\u044F\u0442\u0430 \u0438\u0437\u0442\u0435\u0447\u0435 - \u043F\u0440\u0435\u0437\u0430\u0440\u0435\u0434\u0435\u0442\u0435 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430\u0442\u0430.","credential-expired":"\u041C\u043E\u043B\u044F, \u0432\u043B\u0435\u0437\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",aborted:"\u0421\u043F\u0440\u044F\u043D\u043E.",internal:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",unauthorized:"\u0422\u043E\u0437\u0438 \u0447\u0430\u0442 \u043D\u0435 \u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043D \u0442\u0443\u043A.","bad-request":"\u041D\u0435 \u0441\u0435 \u043F\u043E\u043B\u0443\u0447\u0438 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",network:"\u041D\u044F\u043C\u0430 \u0432\u0440\u044A\u0437\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E.",default:"\u041D\u0435\u0449\u043E \u0441\u0435 \u043E\u0431\u044A\u0440\u043A\u0430 - \u043E\u043F\u0438\u0442\u0430\u0439\u0442\u0435 \u043E\u0442\u043D\u043E\u0432\u043E."}},Gs={en:Ys,bg:oc};function no(r,e={}){let t=String(r||"en").toLowerCase().split("-")[0],n=Gs[t]??Ys;return{...n,...e,errors:{...n.errors,...e.errors??{}}}}var Js=`
|
|
37
37
|
:host {
|
|
38
38
|
--_accent: var(--lf-chat-accent, #4f46e5);
|
|
39
39
|
--_accent-fg: var(--lf-chat-accent-fg, #ffffff);
|
|
@@ -204,7 +204,7 @@ textarea:focus-visible { outline: 2px solid var(--_accent); outline-offset: 0; b
|
|
|
204
204
|
}
|
|
205
205
|
.send:disabled { opacity: 0.5; cursor: default; }
|
|
206
206
|
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
207
|
-
`;var Zs="https://lambforge.com/agent-turnstile.html",ic="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";var
|
|
207
|
+
`;var Zs="https://lambforge.com/agent-turnstile.html",ic="https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit";var on=null;function sc(r){let e=r.defaultView;return e?.turnstile?Promise.resolve(e.turnstile):(on||(on=new Promise((t,n)=>{let o=r.createElement("script");o.src=ic,o.async=!0,o.onload=()=>e.turnstile?t(e.turnstile):n(new Error("turnstile did not load")),o.onerror=()=>{on=null,n(new Error("turnstile did not load"))},r.head.append(o)})),on)}function oo(r){let e=r.host.ownerDocument;if(r.sitekey)return sc(e).then(o=>new Promise((i,s)=>{let l=e.createElement("div");r.host.append(l);let a,c=()=>{try{a&&o.remove(a)}catch{}l.remove()};a=o.render(l,{sitekey:r.sitekey,appearance:"interaction-only",callback:u=>{c(),i(u)},"error-callback":()=>{c(),s(new Error("turnstile failed"))}})}));let t=new URL(r.hostedUrl||Zs),n=e.defaultView;return t.searchParams.set("origin",n.location.origin),new Promise((o,i)=>{let s=e.createElement("iframe");s.title="Bot check",s.src=t.href;let l=setTimeout(()=>c(new Error("turnstile timed out")),12e4),a=u=>{if(u.origin!==t.origin||u.source!==s.contentWindow)return;let p=u.data;p?.type==="lambforge-turnstile"&&(p.token?c(null,p.token):c(new Error(p.error||"turnstile failed")))},c=(u,p)=>{clearTimeout(l),n.removeEventListener("message",a),s.remove(),u?i(u):o(p)};n.addEventListener("message",a),r.host.append(s)})}var Qt="lambforge-agent-chat",ac=w.svg`<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>`,lc=w.svg`<path d="M18 6 6 18M6 6l12 12"/>`,cc=w.svg`<path d="M12 5v14M5 12h14"/>`,io=r=>w.html`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${r}</svg>`,D=class extends w.LitElement{constructor(){super(...arguments);this.open=!1;this.mode="drawer";this.position="bottom-right";this.theme="light";this.agent="";this.agents="";this.locale="";this.heading="";this.url="";this.publishableKey="";this.tokenUrl="";this.turnstileSitekey="";this.turnstileUrl="";this.strings={};this.lastCount=0}get shown(){return this.mode!=="drawer"||this.open}get t(){return no(this.locale||this.ownerDocument.documentElement.lang||"en",this.strings)}connect(){return Ct(()=>{let t=new nn({client:this.resolveClient(),agent:this.agent,agents:this.agents.split(",").map(n=>n.trim()).filter(Boolean),emit:(n,o)=>this.emit(n,o)},{shown:this.shown});return this.store=t,t.state$.pipe(Ot(()=>{t.destroy(),this.store===t&&(this.store=void 0)}))})}dispatch(t){this.store?.dispatch(t)}OnUpdate(){this.shown&&this.dispatch(Kr(!0))}resolveClient(){if(this.client)return this.client;let t=this.url||void 0;if(this.getToken){let n=this.getToken;this.client=new He({url:t,getToken:()=>n()})}else if(this.tokenUrl){let n=this.tokenUrl;this.client=new He({url:t,getToken:()=>fetch(n,{credentials:"include",headers:{accept:"application/json"}}).then(o=>{if(!o.ok)throw new Error(`token-url answered ${o.status}`);return o.json()})})}else if(this.publishableKey)this.client=new He({url:t,anonymous:{publishableKey:this.publishableKey,turnstileToken:()=>this.verifyHuman()}});else return console.error(`[${Qt}] give it a session: token-url, publishable-key, .getToken or .client`),null;return this.client}verifyHuman(){return this.dispatch(Jt(!0)),this.turnstileBox().then(t=>oo({host:t,sitekey:this.turnstileSitekey||null,hostedUrl:this.turnstileUrl||null})).finally(()=>this.dispatch(Jt(!1)))}async turnstileBox(){for(let t=0;t<100;t++){let n=this.shadowRoot?.querySelector(".turnstile");if(n)return n;await new Promise(o=>setTimeout(o,20))}throw new Error("turnstile: the chat is not rendered")}send(t){return([n])=>{let o=String(t??"").trim();!o||n.answering||!n.agentId||this.dispatch(bt({agentId:n.agentId,conversationId:n.conversationId,text:o}))}}stopAnswer(){return([t])=>{t.agentId&&this.dispatch(Ze({agentId:t.agentId,conversationId:t.conversationId}))}}pick(t){this.dispatch(Je(t))}startOver(){this.dispatch(yt()),this.focusInput()}setOpen(t){t!==this.open&&(this.open=t,this.emit("open-change",{open:t}),t?this.focusInput():this.shadowRoot?.querySelector(".launcher")?.focus())}focusInput(){this.updateComplete.then(()=>requestAnimationFrame(()=>this.shadowRoot?.querySelector("textarea")?.focus()))}submit(t,n){if(t.preventDefault(),n.answering)return this.stopAnswer()([n]);let o=this.shadowRoot?.querySelector("textarea");o&&(this.send(o.value)([n]),o.value="",this.autosize(o))}onInputKey(t,n){t.key==="Enter"&&!t.shiftKey&&!t.isComposing&&(t.preventDefault(),n.answering||this.submit(t,n))}autosize(t){t.style.height="auto",t.style.height=`${Math.min(t.scrollHeight,140)}px`}onPanelKey(t){if(t.key==="Escape"&&this.mode==="drawer"){t.stopPropagation(),this.setOpen(!1);return}if(t.key!=="Tab"||this.mode==="inline")return;let n=this.shadowRoot?.querySelector(".panel"),o=Array.from(n?.querySelectorAll("button:not([disabled]), select, textarea, a[href]")??[]).filter(a=>!a.closest("[hidden]"));if(!o.length)return;let i=o[0],s=o[o.length-1],l=this.shadowRoot?.activeElement;t.shiftKey&&l===i?(t.preventDefault(),s.focus()):!t.shiftKey&&l===s&&(t.preventDefault(),i.focus())}emit(t,n){this.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}noticeText(t){if(!t)return"";let n=this.t;return t.kind==="busy"?n[t.what]:t.kind==="info"?n.errors.aborted:n.errors[t.code]??n.errors.default}view(t){let n=this.t,o=this.mode==="drawer",i=t.agents.find(a=>a.id===t.agentId)??null,s=this.heading||i?.name||n.title,l=t.notice;return t.messages.length!==this.lastCount&&(this.lastCount=t.messages.length,this.updateComplete.then(()=>requestAnimationFrame(()=>this.scrollDown()))),w.html`
|
|
208
208
|
<button
|
|
209
209
|
class="launcher"
|
|
210
210
|
part="launcher"
|
|
@@ -269,12 +269,12 @@ textarea:focus-visible { outline: 2px solid var(--_accent); outline-offset: 0; b
|
|
|
269
269
|
</form>
|
|
270
270
|
</section>
|
|
271
271
|
`}bubble(t){return t.role==="user"?w.html`<div class="msg user" part="message user">${t.text}</div>`:w.html`<div class="msg assistant" part="message assistant">
|
|
272
|
-
${
|
|
272
|
+
${Br(t.text)}
|
|
273
273
|
${t.tools.length?w.html`<div class="tools">${this.t.usedTools}: ${t.tools.join(", ")}</div>`:""}
|
|
274
274
|
</div>`}intro(t){let n=t.agents.find(o=>o.id===t.agentId);return!n?.welcome&&!n?.suggestions?.length?"":w.html`
|
|
275
|
-
${n.welcome?w.html`<div class="msg assistant welcome">${
|
|
275
|
+
${n.welcome?w.html`<div class="msg assistant welcome">${Br(n.welcome)}</div>`:""}
|
|
276
276
|
${n.suggestions?.length?w.html`<div class="suggestions">
|
|
277
277
|
${n.suggestions.map(o=>w.html`<button type="button" part="suggestion" @click=${()=>this.send(o)([t])}>${o}</button>`)}
|
|
278
278
|
</div>`:""}
|
|
279
|
-
`}scrollDown(){let t=this.shadowRoot?.querySelector(".messages");t&&(t.scrollTop=t.scrollHeight)}};N([(0,w.property)({type:Boolean,reflect:!0})],D.prototype,"open",2),N([(0,w.property)({reflect:!0})],D.prototype,"mode",2),N([(0,w.property)({reflect:!0})],D.prototype,"position",2),N([(0,w.property)({reflect:!0})],D.prototype,"theme",2),N([(0,w.property)()],D.prototype,"agent",2),N([(0,w.property)()],D.prototype,"agents",2),N([(0,w.property)()],D.prototype,"locale",2),N([(0,w.property)({attribute:"title"})],D.prototype,"heading",2),N([(0,w.property)()],D.prototype,"url",2),N([(0,w.property)({attribute:"publishable-key"})],D.prototype,"publishableKey",2),N([(0,w.property)({attribute:"token-url"})],D.prototype,"tokenUrl",2),N([(0,w.property)({attribute:"turnstile-sitekey"})],D.prototype,"turnstileSitekey",2),N([(0,w.property)({attribute:"turnstile-url"})],D.prototype,"turnstileUrl",2),N([(0,w.property)({attribute:!1})],D.prototype,"client",2),N([(0,w.property)({attribute:!1})],D.prototype,"getToken",2),N([(0,w.property)({attribute:!1})],D.prototype,"strings",2),D=N([(0,Xs.Component)({Settings:{selector:Qt,styles:[(0,w.unsafeCSS)(Js)]},Loading:()=>w.html``,Error:()=>w.html``,State(){return this.connect()},Render:()=>function(r){return this.view(r)}})],D);var
|
|
279
|
+
`}scrollDown(){let t=this.shadowRoot?.querySelector(".messages");t&&(t.scrollTop=t.scrollHeight)}};N([(0,w.property)({type:Boolean,reflect:!0})],D.prototype,"open",2),N([(0,w.property)({reflect:!0})],D.prototype,"mode",2),N([(0,w.property)({reflect:!0})],D.prototype,"position",2),N([(0,w.property)({reflect:!0})],D.prototype,"theme",2),N([(0,w.property)()],D.prototype,"agent",2),N([(0,w.property)()],D.prototype,"agents",2),N([(0,w.property)()],D.prototype,"locale",2),N([(0,w.property)({attribute:"title"})],D.prototype,"heading",2),N([(0,w.property)()],D.prototype,"url",2),N([(0,w.property)({attribute:"publishable-key"})],D.prototype,"publishableKey",2),N([(0,w.property)({attribute:"token-url"})],D.prototype,"tokenUrl",2),N([(0,w.property)({attribute:"turnstile-sitekey"})],D.prototype,"turnstileSitekey",2),N([(0,w.property)({attribute:"turnstile-url"})],D.prototype,"turnstileUrl",2),N([(0,w.property)({attribute:!1})],D.prototype,"client",2),N([(0,w.property)({attribute:!1})],D.prototype,"getToken",2),N([(0,w.property)({attribute:!1})],D.prototype,"strings",2),D=N([(0,Xs.Component)({Settings:{selector:Qt,styles:[(0,w.unsafeCSS)(Js)]},Loading:()=>w.html``,Error:()=>w.html``,State(){return this.connect()},Render:()=>function(r){return this.view(r)}})],D);var sn=document.currentScript,uc={key:"publishable-key",tokenUrl:"token-url",agent:"agent",agents:"agents",url:"url",mode:"mode",position:"position",locale:"locale",title:"title",theme:"theme",open:"open",turnstileSitekey:"turnstile-sitekey",turnstileUrl:"turnstile-url"};if(sn&&(sn.dataset.key||sn.dataset.tokenUrl)){let r=()=>{let e=document.createElement(Qt);for(let[t,n]of Object.entries(uc)){let o=sn.dataset[t];o!==void 0&&e.setAttribute(n,o)}document.body.append(e)};document.body?r():document.addEventListener("DOMContentLoaded",r,{once:!0})}})();
|
|
280
280
|
//# sourceMappingURL=agent-chat.js.map
|