@veltdev/sdk
Version:
Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.
37 lines (36 loc) • 7.65 MB
JavaScript
var SNIPPYLY_VERSION = '4.6.10';
(function(m,w){"use strict";function rt(){var e=K.splice(0,K.length);for(ie=0;e.length;)e.shift().call(null,e.shift())}function me(e,t){for(var n=0,r=e.length;n<r;n++)Te(e[n],t)}function ot(e){for(var t,n=0,r=e.length;n<r;n++)t=e[n],U(t,q[pe(t)])}function fe(e){return function(t){Lt(t)&&(Te(t,e),L.length&&me(t.querySelectorAll(L),e))}}function pe(e){var t=le.call(e,"is"),n=e.nodeName.toUpperCase(),r=v.call(D,t?Y+t.toUpperCase():x+n);return t&&-1<r&&!De(n,t)?-1:r}function De(e,t){return-1<L.indexOf(e+'[is="'+t+'"]')}function Ie(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,o=e.target,l=e[W]||2,a=e[He]||3;!ce||o&&o!==t||!t[y]||r==="style"||e.prevValue===e.newValue&&(e.newValue!==""||n!==l&&n!==a)||t[y](r,n===l?null:e.prevValue,n===a?null:e.newValue)}function Fe(e){var t=fe(e);return function(n){K.push(t,n.target),ie&&clearTimeout(ie),ie=setTimeout(rt,1)}}function de(e){nt&&(nt=!1,e.currentTarget.removeEventListener(Ze,de)),L.length&&me((e.target||u).querySelectorAll(L),e.detail===E?E:b),R&&at()}function lt(e,t){var n=this;Ye.call(n,e,t),Me.call(n,{target:n})}function Se(e,t,n){var r=t.apply(e,n),o=pe(r);return-1<o&&U(r,q[o]),n.pop()&&L.length&&ot(r.querySelectorAll(L)),r}function he(e,t){Tt(e,t),$?$.observe(e,gt):(ue&&(e.setAttribute=lt,e[H]=Ee(e),e[g](st,Me)),e[g](N,Ie)),e[k]&&ce&&(e.created=!0,e[k](),e.created=!1)}function at(){for(var e,t=0,n=G.length;t<n;t++)e=G[t],V.contains(e)||(n--,G.splice(t--,1),Te(e,E))}function Ve(e){throw new Error("A "+e+" type is already registered")}function Te(e,t){var n,r,o=pe(e);-1<o&&!Mt.call(e,"TEMPLATE")&&(Q(e,q[o]),o=0,t!==b||e[b]?t!==E||e[E]||(e[b]=!1,e[E]=!0,r="disconnected",o=1):(e[E]=!1,e[b]=!0,r="connected",o=1,R&&v.call(G,e)<0&&G.push(e)),o&&(n=e[t+O]||e[r+O])&&n.call(e))}function z(){}function Pe(e,t,n){var r=n&&n[_]||"",o=t.prototype,l=Ce(o),a=t.observedAttributes||ye,s={prototype:l};oe(l,k,{value:function(){if(te)te=!1;else if(!this[B]){this[B]=!0,new t(this),o[k]&&o[k].call(this);var i=j[ne.get(t)];(!Z||i.create.length>1)&&_e(this)}}}),oe(l,y,{value:function(i){-1<v.call(a,i)&&o[y]&&o[y].apply(this,arguments)}}),o[qe]&&oe(l,ut,{value:o[qe]}),o[Be]&&oe(l,ct,{value:o[Be]}),r&&(s[_]=r),e=e.toUpperCase(),j[e]={constructor:t,create:r?[r,re(e)]:[e]},ne.set(t,e),u[S](e.toLowerCase(),s),Le(e),P[e].r()}function Re(e){var t=j[e.toUpperCase()];return t&&t.constructor}function Ue(e){return typeof e=="string"?e:e&&e.is||""}function _e(e){for(var t,n=e[y],r=n?e.attributes:ye,o=r.length;o--;)t=r[o],n.call(e,t.name||t.nodeName,null,t.value||t.nodeValue)}function Le(e){return e=e.toUpperCase(),e in P||(P[e]={},P[e].p=new Xe(function(t){P[e].r=t})),P[e].p}function ke(){C&&delete m.customElements,I(m,"customElements",{configurable:!0,value:new z}),I(m,"CustomElementRegistry",{configurable:!0,value:z});for(var e=it.get(/^HTML[A-Z]*[a-z]/),t=e.length;t--;(function(n){var r=m[n];if(r){m[n]=function(o){var l,a;return o||(o=this),o[B]||(te=!0,l=j[ne.get(o.constructor)],a=Z&&l.create.length===1,o=a?Reflect.construct(r,ye,l.constructor):u.createElement.apply(u,l.create),o[B]=!0,te=!1,a||_e(o)),o},m[n].prototype=r.prototype;try{r.prototype.constructor=m[n]}catch{dt=!0,I(r,B,{value:m[n]})}}})(e[t]));u.createElement=function(n,r){var o=Ue(r);return o?Ae.call(this,n,re(o)):Ae.call(this,n)},et||(Oe=!0,u[S](""))}var u=m.document,T=m.Object,it=(function(e){var t,n,r,o,l=/^[A-Z]+[a-z]/,a=function(p){var f,h=[];for(f in i)p.test(f)&&h.push(f);return h},s=function(p,f){(f=f.toLowerCase())in i||(i[p]=(i[p]||[]).concat(f),i[f]=i[f.toUpperCase()]=p)},i=(T.create||T)(null),c={};for(n in e)for(o in e[n])for(r=e[n][o],i[o]=r,t=0;t<r.length;t++)i[r[t].toLowerCase()]=i[r[t].toUpperCase()]=o;return c.get=function(p){return typeof p=="string"?i[p]||(l.test(p)?[]:""):a(p)},c.set=function(p,f){return l.test(p)?s(p,f):s(f,p),c},c})({collections:{HTMLAllCollection:["all"],HTMLCollection:["forms"],HTMLFormControlsCollection:["elements"],HTMLOptionsCollection:["options"]},elements:{Element:["element"],HTMLAnchorElement:["a"],HTMLAppletElement:["applet"],HTMLAreaElement:["area"],HTMLAttachmentElement:["attachment"],HTMLAudioElement:["audio"],HTMLBRElement:["br"],HTMLBaseElement:["base"],HTMLBodyElement:["body"],HTMLButtonElement:["button"],HTMLCanvasElement:["canvas"],HTMLContentElement:["content"],HTMLDListElement:["dl"],HTMLDataElement:["data"],HTMLDataListElement:["datalist"],HTMLDetailsElement:["details"],HTMLDialogElement:["dialog"],HTMLDirectoryElement:["dir"],HTMLDivElement:["div"],HTMLDocument:["document"],HTMLElement:["element","abbr","address","article","aside","b","bdi","bdo","cite","code","command","dd","dfn","dt","em","figcaption","figure","footer","header","i","kbd","mark","nav","noscript","rp","rt","ruby","s","samp","section","small","strong","sub","summary","sup","u","var","wbr"],HTMLEmbedElement:["embed"],HTMLFieldSetElement:["fieldset"],HTMLFontElement:["font"],HTMLFormElement:["form"],HTMLFrameElement:["frame"],HTMLFrameSetElement:["frameset"],HTMLHRElement:["hr"],HTMLHeadElement:["head"],HTMLHeadingElement:["h1","h2","h3","h4","h5","h6"],HTMLHtmlElement:["html"],HTMLIFrameElement:["iframe"],HTMLImageElement:["img"],HTMLInputElement:["input"],HTMLKeygenElement:["keygen"],HTMLLIElement:["li"],HTMLLabelElement:["label"],HTMLLegendElement:["legend"],HTMLLinkElement:["link"],HTMLMapElement:["map"],HTMLMarqueeElement:["marquee"],HTMLMediaElement:["media"],HTMLMenuElement:["menu"],HTMLMenuItemElement:["menuitem"],HTMLMetaElement:["meta"],HTMLMeterElement:["meter"],HTMLModElement:["del","ins"],HTMLOListElement:["ol"],HTMLObjectElement:["object"],HTMLOptGroupElement:["optgroup"],HTMLOptionElement:["option"],HTMLOutputElement:["output"],HTMLParagraphElement:["p"],HTMLParamElement:["param"],HTMLPictureElement:["picture"],HTMLPreElement:["pre"],HTMLProgressElement:["progress"],HTMLQuoteElement:["blockquote","q","quote"],HTMLScriptElement:["script"],HTMLSelectElement:["select"],HTMLShadowElement:["shadow"],HTMLSlotElement:["slot"],HTMLSourceElement:["source"],HTMLSpanElement:["span"],HTMLStyleElement:["style"],HTMLTableCaptionElement:["caption"],HTMLTableCellElement:["td","th"],HTMLTableColElement:["col","colgroup"],HTMLTableElement:["table"],HTMLTableRowElement:["tr"],HTMLTableSectionElement:["thead","tbody","tfoot"],HTMLTemplateElement:["template"],HTMLTextAreaElement:["textarea"],HTMLTimeElement:["time"],HTMLTitleElement:["title"],HTMLTrackElement:["track"],HTMLUListElement:["ul"],HTMLUnknownElement:["unknown","vhgroupv","vkeygen"],HTMLVideoElement:["video"]},nodes:{Attr:["node"],Audio:["audio"],CDATASection:["node"],CharacterData:["node"],Comment:["#comment"],Document:["#document"],DocumentFragment:["#document-fragment"],DocumentType:["node"],HTMLDocument:["#document"],Image:["img"],Option:["option"],ProcessingInstruction:["node"],ShadowRoot:["#shadow-root"],Text:["#text"],XMLDocument:["xml"]}});typeof w!="object"&&(w={type:w||"auto"});var K,Me,X,Ee,$,ve,Q,U,A,S="registerElement",xe=1e5*m.Math.random()>>0,H="__"+S+xe,g="addEventListener",b="attached",O="Callback",E="detached",_="extends",y="attributeChanged"+O,ut=b+O,qe="connected"+O,Be="disconnected"+O,k="created"+O,ct=E+O,W="ADDITION",He="REMOVAL",N="DOMAttrModified",Ze="DOMContentLoaded",st="DOMSubtreeModified",x="<",Y="=",mt=/^[A-Z][._A-Z0-9]*-[-._A-Z0-9]*$/,ft=["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"],D=[],q=[],L="",V=u.documentElement,v=D.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},ge=T.prototype,be=ge.hasOwnProperty,J=ge.isPrototypeOf,I=T.defineProperty,ye=[],ee=T.getOwnPropertyDescriptor,je=T.getOwnPropertyNames,pt=T.getPrototypeOf,Ge=T.setPrototypeOf,ze=!!T.__proto__,dt=!1,B="__dreCEv1",C=m.customElements,Z=!/^force/.test(w.type)&&!!(C&&C.define&&C.get&&C.whenDefined),Ke=T.create||T,ht=m.Map||function(){var e,t=[],n=[];return{get:function(r){return n[v.call(t,r)]},set:function(r,o){e=v.call(t,r),e<0?n[t.push(r)-1]=o:n[e]=o}}},Xe=m.Promise||function(e){function t(l){for(r=!0;n.length;)n.shift()(l)}var n=[],r=!1,o={catch:function(){return o},then:function(l){return n.push(l),r&&setTimeout(t,1),o}};return e(t),o},te=!1,j=Ke(null),P=Ke(null),ne=new ht,re=function(e){return e.toLowerCase()},Ce=T.create||function e(t){return t?(e.prototype=t,new e):this},Tt=Ge||(ze?function(e,t){return e.__proto__=t,e}:je&&ee?(function(){function e(t,n){for(var r,o=je(n),l=0,a=o.length;l<a;l++)r=o[l],be.call(t,r)||I(t,r,ee(n,r))}return function(t,n){do e(t,n);while((n=pt(n))&&!J.call(n,t));return t}})():function(e,t){for(var n in t)e[n]=t[n];return e}),F=m.MutationObserver||m.WebKitMutationObserver,$e=m.HTMLAnchorElement,d=(m.HTMLElement||m.Element||m.Node).prototype,R=!J.call(d,V),oe=R?function(e,t,n){return e[t]=n.value,e}:I,Lt=R?function(e){return e.nodeType===1}:function(e){return J.call(d,e)},G=R&&[],Qe=d.attachShadow,We=d.cloneNode,Mt=d.closest||function(e){for(var t=this;t&&t.nodeName!==e;)t=t.parentNode;return t},we=d.dispatchEvent,le=d.getAttribute,Et=d.hasAttribute,vt=d.removeAttribute,Ye=d.setAttribute,ae=u.createElement,Ht=u.importNode,Ae=ae,gt=F&&{attributes:!0,characterData:!0,attributeOldValue:!0},Je=F||function(e){ue=!1,V.removeEventListener(N,Je)},ie=0,et=S in u&&!/^force-all/.test(w.type),tt=!0,Oe=!1,ue=!0,nt=!0,ce=!0;if(F&&(A=u.createElement("div"),A.innerHTML="<div><div></div></div>",new F(function(e,t){if(e[0]&&e[0].type=="childList"&&!e[0].removedNodes[0].childNodes.length){A=ee(d,"innerHTML");var n=A&&A.set;n&&I(d,"innerHTML",{set:function(r){for(;this.lastChild;)this.removeChild(this.lastChild);n.call(this,r)}})}t.disconnect(),A=null}).observe(A,{childList:!0,subtree:!0}),A.innerHTML=""),et||(Ge||ze?(Q=function(e,t){J.call(t,e)||he(e,t)},U=he):(Q=function(e,t){e[H]||(e[H]=T(!0),he(e,t))},U=Q),R?(ue=!1,(function(){var e=ee(d,g),t=e.value,n=function(l){var a=new CustomEvent(N,{bubbles:!0});a.attrName=l,a.prevValue=le.call(this,l),a.newValue=null,a[He]=a.attrChange=2,vt.call(this,l),we.call(this,a)},r=function(l,a){var s=Et.call(this,l),i=s&&le.call(this,l),c=new CustomEvent(N,{bubbles:!0});Ye.call(this,l,a),c.attrName=l,c.prevValue=s?i:null,c.newValue=a,s?c.MODIFICATION=c.attrChange=1:c[W]=c.attrChange=0,we.call(this,c)},o=function(l){var a,s=l.currentTarget,i=s[H],c=l.propertyName;i.hasOwnProperty(c)&&(i=i[c],a=new CustomEvent(N,{bubbles:!0}),a.attrName=i.name,a.prevValue=i.value||null,a.newValue=i.value=s[c]||null,a.prevValue==null?a[W]=a.attrChange=0:a.MODIFICATION=a.attrChange=1,we.call(s,a))};e.value=function(l,a,s){l===N&&this[y]&&this.setAttribute!==r&&(this[H]={className:{name:"class",value:this.className}},this.setAttribute=r,this.removeAttribute=n,t.call(this,"propertychange",o)),t.call(this,l,a,s)},I(d,g,e)})()):F||(V[g](N,Je),V.setAttribute(H,1),V.removeAttribute(H),ue&&(Me=function(e){var t,n,r,o=this;if(o===e.target){t=o[H],o[H]=n=Ee(o);for(r in n){if(!(r in t))return X(0,o,r,t[r],n[r],W);if(n[r]!==t[r])return X(1,o,r,t[r],n[r],"MODIFICATION")}for(r in t)if(!(r in n))return X(2,o,r,t[r],n[r],He)}},X=function(e,t,n,r,o,l){var a={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:o};a[l]=e,Ie(a)},Ee=function(e){for(var t,n,r={},o=e.attributes,l=0,a=o.length;l<a;l++)t=o[l],(n=t.name)!=="setAttribute"&&(r[n]=t.value);return r})),u[S]=function(e,t){if(n=e.toUpperCase(),tt&&(tt=!1,F?($=(function(i,c){function p(f,h){for(var M=0,se=f.length;M<se;h(f[M++]));}return new F(function(f){for(var h,M,se,Ne=0,bt=f.length;Ne<bt;Ne++)h=f[Ne],h.type==="childList"?(p(h.addedNodes,i),p(h.removedNodes,c)):(M=h.target,ce&&M[y]&&h.attributeName!=="style"&&(se=le.call(M,h.attributeName))!==h.oldValue&&M[y](h.attributeName,h.oldValue,se))})})(fe(b),fe(E)),ve=function(i){return $.observe(i,{childList:!0,subtree:!0}),i},ve(u),Qe&&(d.attachShadow=function(){return ve(Qe.apply(this,arguments))})):(K=[],u[g]("DOMNodeInserted",Fe(b)),u[g]("DOMNodeRemoved",Fe(E))),u[g](Ze,de),u[g]("readystatechange",de),u.importNode=function(i,c){switch(i.nodeType){case 1:return Se(u,Ht,[i,!!c]);case 11:for(var p=u.createDocumentFragment(),f=i.childNodes,h=f.length,M=0;M<h;M++)p.appendChild(u.importNode(f[M],!!c));return p;default:return We.call(i,!!c)}},d.cloneNode=function(i){return Se(this,We,[!!i])}),Oe)return Oe=!1;if(-2<v.call(D,Y+n)+v.call(D,x+n)&&Ve(e),!mt.test(n)||-1<v.call(ft,n))throw new Error("The type "+e+" is invalid");var n,r,o=function(){return a?u.createElement(s,n):u.createElement(s)},l=t||ge,a=be.call(l,_),s=a?t[_].toUpperCase():n;return a&&-1<v.call(D,x+s)&&Ve(s),r=D.push((a?Y:x)+n)-1,L=L.concat(L.length?",":"",a?s+'[is="'+e.toLowerCase()+'"]':s),o.prototype=q[r]=be.call(l,"prototype")?l.prototype:Ce(d),L.length&&me(u.querySelectorAll(L),b),o},u.createElement=Ae=function(e,t){var n=Ue(t),r=n?ae.call(u,e,re(n)):ae.call(u,e),o=""+e,l=v.call(D,(n?Y:x)+(n||o).toUpperCase()),a=-1<l;return n&&(r.setAttribute("is",n=n.toLowerCase()),a&&(a=De(o.toUpperCase(),n))),ce=!u.createElement.innerHTMLHelper,a&&U(r,q[l]),r}),addEventListener("beforeunload",function(){delete u.createElement,delete u.importNode,delete u[S]},!1),z.prototype={constructor:z,define:Z?function(e,t,n){if(n)Pe(e,t,n);else{var r=e.toUpperCase();j[r]={constructor:t,create:[r]},ne.set(t,r),C.define(e,t)}}:Pe,get:Z?function(e){return C.get(e)||Re(e)}:Re,whenDefined:Z?function(e){return Xe.race([C.whenDefined(e),Le(e)])}:Le},!C||/^force/.test(w.type))ke();else if(!w.noBuiltIn)try{(function(e,t,n){var r=new RegExp(`^<a\\s+is=('|")`+n+"\\1></a>$");if(t[_]="a",e.prototype=Ce($e.prototype),e.prototype.constructor=e,m.customElements.define(n,e,t),!r.test(u.createElement("a",{is:n}).outerHTML)||!r.test(new e().outerHTML))throw t})(function e(){return Reflect.construct($e,[],e)},{},"document-register-element-a"+xe)}catch{ke()}if(!w.noBuiltIn)try{if(ae.call(u,"a","a").outerHTML.indexOf("is")<0)throw{}}catch{re=function(t){return{is:t.toLowerCase()}}}})(window);
var HSe=Object.create;var r4=Object.defineProperty,zSe=Object.defineProperties,GSe=Object.getOwnPropertyDescriptor,WSe=Object.getOwnPropertyDescriptors,qSe=Object.getOwnPropertyNames,o4=Object.getOwnPropertySymbols,aK=Object.getPrototypeOf,w8=Object.prototype.hasOwnProperty,sK=Object.prototype.propertyIsEnumerable,YSe=Reflect.get;var rK=(i,o,n)=>o in i?r4(i,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[o]=n,E=(i,o)=>{for(var n in o||={})w8.call(o,n)&&rK(i,n,o[n]);if(o4)for(var n of o4(o))sK.call(o,n)&&rK(i,n,o[n]);return i},D=(i,o)=>zSe(i,WSe(o));var Cy=(i,o)=>{var n={};for(var e in i)w8.call(i,e)&&o.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&o4)for(var e of o4(i))o.indexOf(e)<0&&sK.call(i,e)&&(n[e]=i[e]);return n};var KSe=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),a4=(i,o)=>{for(var n in o)r4(i,n,{get:o[n],enumerable:!0})},ZSe=(i,o,n,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of qSe(o))!w8.call(i,t)&&t!==n&&r4(i,t,{get:()=>o[t],enumerable:!(e=GSe(o,t))||e.enumerable});return i};var lK=(i,o,n)=>(n=i!=null?HSe(aK(i)):{},ZSe(o||!i||!i.__esModule?r4(n,"default",{value:i,enumerable:!0}):n,i));var Up=(i,o,n)=>YSe(aK(i),n,o);var J=(i,o,n)=>new Promise((e,t)=>{var r=c=>{try{s(n.next(c))}catch(p){t(p)}},a=c=>{try{s(n.throw(c))}catch(p){t(p)}},s=c=>c.done?e(c.value):Promise.resolve(c.value).then(r,a);s((n=n.apply(i,o)).next())});var xY=KSe((NOo,EY)=>{"use strict";var Ot={};Ot.generateIdentifier=function(){return Math.random().toString(36).substring(2,12)};Ot.localCName=Ot.generateIdentifier();Ot.splitLines=function(i){return i.trim().split(`
`).map(o=>o.trim())};Ot.splitSections=function(i){return i.split(`
m=`).map((n,e)=>(e>0?"m="+n:n).trim()+`\r
`)};Ot.getDescription=function(i){let o=Ot.splitSections(i);return o&&o[0]};Ot.getMediaSections=function(i){let o=Ot.splitSections(i);return o.shift(),o};Ot.matchPrefix=function(i,o){return Ot.splitLines(i).filter(n=>n.indexOf(o)===0)};Ot.parseCandidate=function(i){let o;i.indexOf("a=candidate:")===0?o=i.substring(12).split(" "):o=i.substring(10).split(" ");let n={foundation:o[0],component:{1:"rtp",2:"rtcp"}[o[1]]||o[1],protocol:o[2].toLowerCase(),priority:parseInt(o[3],10),ip:o[4],address:o[4],port:parseInt(o[5],10),type:o[7]};for(let e=8;e<o.length;e+=2)switch(o[e]){case"raddr":n.relatedAddress=o[e+1];break;case"rport":n.relatedPort=parseInt(o[e+1],10);break;case"tcptype":n.tcpType=o[e+1];break;case"ufrag":n.ufrag=o[e+1],n.usernameFragment=o[e+1];break;default:n[o[e]]===void 0&&(n[o[e]]=o[e+1]);break}return n};Ot.writeCandidate=function(i){let o=[];o.push(i.foundation);let n=i.component;n==="rtp"?o.push(1):n==="rtcp"?o.push(2):o.push(n),o.push(i.protocol.toUpperCase()),o.push(i.priority),o.push(i.address||i.ip),o.push(i.port);let e=i.type;return o.push("typ"),o.push(e),e!=="host"&&i.relatedAddress&&i.relatedPort&&(o.push("raddr"),o.push(i.relatedAddress),o.push("rport"),o.push(i.relatedPort)),i.tcpType&&i.protocol.toLowerCase()==="tcp"&&(o.push("tcptype"),o.push(i.tcpType)),(i.usernameFragment||i.ufrag)&&(o.push("ufrag"),o.push(i.usernameFragment||i.ufrag)),"candidate:"+o.join(" ")};Ot.parseIceOptions=function(i){return i.substring(14).split(" ")};Ot.parseRtpMap=function(i){let o=i.substring(9).split(" "),n={payloadType:parseInt(o.shift(),10)};return o=o[0].split("/"),n.name=o[0],n.clockRate=parseInt(o[1],10),n.channels=o.length===3?parseInt(o[2],10):1,n.numChannels=n.channels,n};Ot.writeRtpMap=function(i){let o=i.payloadType;i.preferredPayloadType!==void 0&&(o=i.preferredPayloadType);let n=i.channels||i.numChannels||1;return"a=rtpmap:"+o+" "+i.name+"/"+i.clockRate+(n!==1?"/"+n:"")+`\r
`};Ot.parseExtmap=function(i){let o=i.substring(9).split(" ");return{id:parseInt(o[0],10),direction:o[0].indexOf("/")>0?o[0].split("/")[1]:"sendrecv",uri:o[1],attributes:o.slice(2).join(" ")}};Ot.writeExtmap=function(i){return"a=extmap:"+(i.id||i.preferredId)+(i.direction&&i.direction!=="sendrecv"?"/"+i.direction:"")+" "+i.uri+(i.attributes?" "+i.attributes:"")+`\r
`};Ot.parseFmtp=function(i){let o={},n,e=i.substring(i.indexOf(" ")+1).split(";");for(let t=0;t<e.length;t++)n=e[t].trim().split("="),o[n[0].trim()]=n[1];return o};Ot.writeFmtp=function(i){let o="",n=i.payloadType;if(i.preferredPayloadType!==void 0&&(n=i.preferredPayloadType),i.parameters&&Object.keys(i.parameters).length){let e=[];Object.keys(i.parameters).forEach(t=>{i.parameters[t]!==void 0?e.push(t+"="+i.parameters[t]):e.push(t)}),o+="a=fmtp:"+n+" "+e.join(";")+`\r
`}return o};Ot.parseRtcpFb=function(i){let o=i.substring(i.indexOf(" ")+1).split(" ");return{type:o.shift(),parameter:o.join(" ")}};Ot.writeRtcpFb=function(i){let o="",n=i.payloadType;return i.preferredPayloadType!==void 0&&(n=i.preferredPayloadType),i.rtcpFeedback&&i.rtcpFeedback.length&&i.rtcpFeedback.forEach(e=>{o+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+`\r
`}),o};Ot.parseSsrcMedia=function(i){let o=i.indexOf(" "),n={ssrc:parseInt(i.substring(7,o),10)},e=i.indexOf(":",o);return e>-1?(n.attribute=i.substring(o+1,e),n.value=i.substring(e+1)):n.attribute=i.substring(o+1),n};Ot.parseSsrcGroup=function(i){let o=i.substring(13).split(" ");return{semantics:o.shift(),ssrcs:o.map(n=>parseInt(n,10))}};Ot.getMid=function(i){let o=Ot.matchPrefix(i,"a=mid:")[0];if(o)return o.substring(6)};Ot.parseFingerprint=function(i){let o=i.substring(14).split(" ");return{algorithm:o[0].toLowerCase(),value:o[1].toUpperCase()}};Ot.getDtlsParameters=function(i,o){return{role:"auto",fingerprints:Ot.matchPrefix(i+o,"a=fingerprint:").map(Ot.parseFingerprint)}};Ot.writeDtlsParameters=function(i,o){let n="a=setup:"+o+`\r
`;return i.fingerprints.forEach(e=>{n+="a=fingerprint:"+e.algorithm+" "+e.value+`\r
`}),n};Ot.parseCryptoLine=function(i){let o=i.substring(9).split(" ");return{tag:parseInt(o[0],10),cryptoSuite:o[1],keyParams:o[2],sessionParams:o.slice(3)}};Ot.writeCryptoLine=function(i){return"a=crypto:"+i.tag+" "+i.cryptoSuite+" "+(typeof i.keyParams=="object"?Ot.writeCryptoKeyParams(i.keyParams):i.keyParams)+(i.sessionParams?" "+i.sessionParams.join(" "):"")+`\r
`};Ot.parseCryptoKeyParams=function(i){if(i.indexOf("inline:")!==0)return null;let o=i.substring(7).split("|");return{keyMethod:"inline",keySalt:o[0],lifeTime:o[1],mkiValue:o[2]?o[2].split(":")[0]:void 0,mkiLength:o[2]?o[2].split(":")[1]:void 0}};Ot.writeCryptoKeyParams=function(i){return i.keyMethod+":"+i.keySalt+(i.lifeTime?"|"+i.lifeTime:"")+(i.mkiValue&&i.mkiLength?"|"+i.mkiValue+":"+i.mkiLength:"")};Ot.getCryptoParameters=function(i,o){return Ot.matchPrefix(i+o,"a=crypto:").map(Ot.parseCryptoLine)};Ot.getIceParameters=function(i,o){let n=Ot.matchPrefix(i+o,"a=ice-ufrag:")[0],e=Ot.matchPrefix(i+o,"a=ice-pwd:")[0];return n&&e?{usernameFragment:n.substring(12),password:e.substring(10)}:null};Ot.writeIceParameters=function(i){let o="a=ice-ufrag:"+i.usernameFragment+`\r
a=ice-pwd:`+i.password+`\r
`;return i.iceLite&&(o+=`a=ice-lite\r
`),o};Ot.parseRtpParameters=function(i){let o={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},e=Ot.splitLines(i)[0].split(" ");o.profile=e[2];for(let r=3;r<e.length;r++){let a=e[r],s=Ot.matchPrefix(i,"a=rtpmap:"+a+" ")[0];if(s){let c=Ot.parseRtpMap(s),p=Ot.matchPrefix(i,"a=fmtp:"+a+" ");switch(c.parameters=p.length?Ot.parseFmtp(p[0]):{},c.rtcpFeedback=Ot.matchPrefix(i,"a=rtcp-fb:"+a+" ").map(Ot.parseRtcpFb),o.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":o.fecMechanisms.push(c.name.toUpperCase());break;default:break}}}Ot.matchPrefix(i,"a=extmap:").forEach(r=>{o.headerExtensions.push(Ot.parseExtmap(r))});let t=Ot.matchPrefix(i,"a=rtcp-fb:* ").map(Ot.parseRtcpFb);return o.codecs.forEach(r=>{t.forEach(a=>{r.rtcpFeedback.find(c=>c.type===a.type&&c.parameter===a.parameter)||r.rtcpFeedback.push(a)})}),o};Ot.writeRtpDescription=function(i,o){let n="";n+="m="+i+" ",n+=o.codecs.length>0?"9":"0",n+=" "+(o.profile||"UDP/TLS/RTP/SAVPF")+" ",n+=o.codecs.map(t=>t.preferredPayloadType!==void 0?t.preferredPayloadType:t.payloadType).join(" ")+`\r
`,n+=`c=IN IP4 0.0.0.0\r
`,n+=`a=rtcp:9 IN IP4 0.0.0.0\r
`,o.codecs.forEach(t=>{n+=Ot.writeRtpMap(t),n+=Ot.writeFmtp(t),n+=Ot.writeRtcpFb(t)});let e=0;return o.codecs.forEach(t=>{t.maxptime>e&&(e=t.maxptime)}),e>0&&(n+="a=maxptime:"+e+`\r
`),o.headerExtensions&&o.headerExtensions.forEach(t=>{n+=Ot.writeExtmap(t)}),n};Ot.parseRtpEncodingParameters=function(i){let o=[],n=Ot.parseRtpParameters(i),e=n.fecMechanisms.indexOf("RED")!==-1,t=n.fecMechanisms.indexOf("ULPFEC")!==-1,r=Ot.matchPrefix(i,"a=ssrc:").map(g=>Ot.parseSsrcMedia(g)).filter(g=>g.attribute==="cname"),a=r.length>0&&r[0].ssrc,s,c=Ot.matchPrefix(i,"a=ssrc-group:FID").map(g=>g.substring(17).split(" ").map(I=>parseInt(I,10)));c.length>0&&c[0].length>1&&c[0][0]===a&&(s=c[0][1]),n.codecs.forEach(g=>{if(g.name.toUpperCase()==="RTX"&&g.parameters.apt){let f={ssrc:a,codecPayloadType:parseInt(g.parameters.apt,10)};a&&s&&(f.rtx={ssrc:s}),o.push(f),e&&(f=JSON.parse(JSON.stringify(f)),f.fec={ssrc:a,mechanism:t?"red+ulpfec":"red"},o.push(f))}}),o.length===0&&a&&o.push({ssrc:a});let p=Ot.matchPrefix(i,"b=");return p.length&&(p[0].indexOf("b=TIAS:")===0?p=parseInt(p[0].substring(7),10):p[0].indexOf("b=AS:")===0?p=parseInt(p[0].substring(5),10)*1e3*.95-2e3*8:p=void 0,o.forEach(g=>{g.maxBitrate=p})),o};Ot.parseRtcpParameters=function(i){let o={},n=Ot.matchPrefix(i,"a=ssrc:").map(r=>Ot.parseSsrcMedia(r)).filter(r=>r.attribute==="cname")[0];n&&(o.cname=n.value,o.ssrc=n.ssrc);let e=Ot.matchPrefix(i,"a=rtcp-rsize");o.reducedSize=e.length>0,o.compound=e.length===0;let t=Ot.matchPrefix(i,"a=rtcp-mux");return o.mux=t.length>0,o};Ot.writeRtcpParameters=function(i){let o="";return i.reducedSize&&(o+=`a=rtcp-rsize\r
`),i.mux&&(o+=`a=rtcp-mux\r
`),i.ssrc!==void 0&&i.cname&&(o+="a=ssrc:"+i.ssrc+" cname:"+i.cname+`\r
`),o};Ot.parseMsid=function(i){let o,n=Ot.matchPrefix(i,"a=msid:");if(n.length===1)return o=n[0].substring(7).split(" "),{stream:o[0],track:o[1]};let e=Ot.matchPrefix(i,"a=ssrc:").map(t=>Ot.parseSsrcMedia(t)).filter(t=>t.attribute==="msid");if(e.length>0)return o=e[0].value.split(" "),{stream:o[0],track:o[1]}};Ot.parseSctpDescription=function(i){let o=Ot.parseMLine(i),n=Ot.matchPrefix(i,"a=max-message-size:"),e;n.length>0&&(e=parseInt(n[0].substring(19),10)),isNaN(e)&&(e=65536);let t=Ot.matchPrefix(i,"a=sctp-port:");if(t.length>0)return{port:parseInt(t[0].substring(12),10),protocol:o.fmt,maxMessageSize:e};let r=Ot.matchPrefix(i,"a=sctpmap:");if(r.length>0){let a=r[0].substring(10).split(" ");return{port:parseInt(a[0],10),protocol:a[1],maxMessageSize:e}}};Ot.writeSctpDescription=function(i,o){let n=[];return i.protocol!=="DTLS/SCTP"?n=["m="+i.kind+" 9 "+i.protocol+" "+o.protocol+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctp-port:"+o.port+`\r
`]:n=["m="+i.kind+" 9 "+i.protocol+" "+o.port+`\r
`,`c=IN IP4 0.0.0.0\r
`,"a=sctpmap:"+o.port+" "+o.protocol+` 65535\r
`],o.maxMessageSize!==void 0&&n.push("a=max-message-size:"+o.maxMessageSize+`\r
`),n.join("")};Ot.generateSessionId=function(){return Math.random().toString().substr(2,22)};Ot.writeSessionBoilerplate=function(i,o,n){let e,t=o!==void 0?o:2;return i?e=i:e=Ot.generateSessionId(),`v=0\r
o=`+(n||"thisisadapterortc")+" "+e+" "+t+` IN IP4 127.0.0.1\r
s=-\r
t=0 0\r
`};Ot.getDirection=function(i,o){let n=Ot.splitLines(i);for(let e=0;e<n.length;e++)switch(n[e]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[e].substring(2);default:}return o?Ot.getDirection(o):"sendrecv"};Ot.getKind=function(i){return Ot.splitLines(i)[0].split(" ")[0].substring(2)};Ot.isRejected=function(i){return i.split(" ",2)[1]==="0"};Ot.parseMLine=function(i){let n=Ot.splitLines(i)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}};Ot.parseOLine=function(i){let n=Ot.matchPrefix(i,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}};Ot.isValidSDP=function(i){if(typeof i!="string"||i.length===0)return!1;let o=Ot.splitLines(i);for(let n=0;n<o.length;n++)if(o[n].length<2||o[n].charAt(1)!=="=")return!1;return!0};typeof EY=="object"&&(EY.exports=Ot)});var O8;function s4(){return O8}function Pd(i){let o=O8;return O8=i,o}var cK=Symbol("NotFound");function Kf(i){return i===cK||i?.name==="\u0275NotFound"}var za=null,l4=!1,A8=1,XSe=null,Ls=Symbol("SIGNAL");function kn(i){let o=za;return za=i,o}function p4(){return za}var Uu={version:0,lastCleanEpoch:0,dirty:!1,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:!1,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function g4(i){if(l4)throw new Error("");if(za===null)return;za.consumerOnSignalRead(i);let o=za.producersTail;if(o!==void 0&&o.producer===i)return;let n,e=za.recomputing;if(e&&(n=o!==void 0?o.nextProducer:za.producers,n!==void 0&&n.producer===i)){za.producersTail=n,n.lastReadVersion=i.version;return}let t=i.consumersTail;if(t!==void 0&&t.consumer===za&&(!e||JSe(t,za)))return;let r=Qf(za),a={producer:i,consumer:za,nextProducer:n,prevConsumer:t,lastReadVersion:i.version,nextConsumer:void 0};za.producersTail=a,o!==void 0?o.nextProducer=a:za.producers=a,r&&gK(i,a)}function dK(){A8++}function u4(i){if(!(Qf(i)&&!i.dirty)&&!(!i.dirty&&i.lastCleanEpoch===A8)){if(!i.producerMustRecompute(i)&&!Sy(i)){m4(i);return}i.producerRecomputeValue(i),m4(i)}}function P8(i){if(i.consumers===void 0)return;let o=l4;l4=!0;try{for(let n=i.consumers;n!==void 0;n=n.nextConsumer){let e=n.consumer;e.dirty||QSe(e)}}finally{l4=o}}function M8(){return za?.consumerAllowSignalWrites!==!1}function QSe(i){i.dirty=!0,P8(i),i.consumerMarkedDirty?.(i)}function m4(i){i.dirty=!1,i.lastCleanEpoch=A8}function Zf(i){return i&&mK(i),kn(i)}function mK(i){i.producersTail=void 0,i.recomputing=!0}function yy(i,o){kn(o),i&&pK(i)}function pK(i){i.recomputing=!1;let o=i.producersTail,n=o!==void 0?o.nextProducer:i.producers;if(n!==void 0){if(Qf(i))do n=k8(n);while(n!==void 0);o!==void 0?o.nextProducer=void 0:i.producers=void 0}}function Sy(i){for(let o=i.producers;o!==void 0;o=o.nextProducer){let n=o.producer,e=o.lastReadVersion;if(e!==n.version||(u4(n),e!==n.version))return!0}return!1}function Xf(i){if(Qf(i)){let o=i.producers;for(;o!==void 0;)o=k8(o)}i.producers=void 0,i.producersTail=void 0,i.consumers=void 0,i.consumersTail=void 0}function gK(i,o){let n=i.consumersTail,e=Qf(i);if(n!==void 0?(o.nextConsumer=n.nextConsumer,n.nextConsumer=o):(o.nextConsumer=void 0,i.consumers=o),o.prevConsumer=n,i.consumersTail=o,!e)for(let t=i.producers;t!==void 0;t=t.nextProducer)gK(t.producer,t)}function k8(i){let o=i.producer,n=i.nextProducer,e=i.nextConsumer,t=i.prevConsumer;if(i.nextConsumer=void 0,i.prevConsumer=void 0,e!==void 0?e.prevConsumer=t:o.consumersTail=t,t!==void 0)t.nextConsumer=e;else if(o.consumers=e,!Qf(o)){let r=o.producers;for(;r!==void 0;)r=k8(r)}return n}function Qf(i){return i.consumerIsAlwaysLive||i.consumers!==void 0}function h4(i){XSe?.(i)}function JSe(i,o){let n=o.producersTail;if(n!==void 0){let e=o.producers;do{if(e===i)return!0;if(e===n)break;e=e.nextProducer}while(e!==void 0)}return!1}function f4(i,o){return Object.is(i,o)}function v4(i,o){let n=Object.create(ebe);n.computation=i,o!==void 0&&(n.equal=o);let e=()=>{if(u4(n),g4(n),n.value===_y)throw n.error;return n.value};return e[Ls]=n,h4(n),e}var c4=Symbol("UNSET"),d4=Symbol("COMPUTING"),_y=Symbol("ERRORED"),ebe=D(E({},Uu),{value:c4,dirty:!0,error:null,equal:f4,kind:"computed",producerMustRecompute(i){return i.value===c4||i.value===d4},producerRecomputeValue(i){if(i.value===d4)throw new Error("");let o=i.value;i.value=d4;let n=Zf(i),e,t=!1;try{e=i.computation(),kn(null),t=o!==c4&&o!==_y&&e!==_y&&i.equal(o,e)}catch(r){e=_y,i.error=r}finally{yy(i,n)}if(t){i.value=o;return}i.value=e,i.version++}});function tbe(){throw new Error}var uK=tbe;function hK(i){uK(i)}function R8(i){uK=i}var nbe=null;function N8(i,o){let n=Object.create(vK);n.value=i,o!==void 0&&(n.equal=o);let e=()=>fK(n);return e[Ls]=n,h4(n),[e,a=>C4(n,a),a=>F8(n,a)]}function fK(i){return g4(i),i.value}function C4(i,o){M8()||hK(i),i.equal(i.value,o)||(i.value=o,ibe(i))}function F8(i,o){M8()||hK(i),C4(i,o(i.value))}var vK=D(E({},Uu),{equal:f4,value:void 0,kind:"signal"});function ibe(i){i.version++,dK(),P8(i),nbe?.(i)}function Tn(i){return typeof i=="function"}function jp(i){let n=i(e=>{Error.call(e),e.stack=new Error().stack});return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var _4=jp(i=>function(n){i(this),this.message=n?`${n.length} errors occurred during unsubscription:
${n.map((e,t)=>`${t+1}) ${e.toString()}`).join(`
`)}`:"",this.name="UnsubscriptionError",this.errors=n});function ju(i,o){if(i){let n=i.indexOf(o);0<=n&&i.splice(n,1)}}var Dn=class i{constructor(o){this.initialTeardown=o,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let o;if(!this.closed){this.closed=!0;let{_parentage:n}=this;if(n)if(this._parentage=null,Array.isArray(n))for(let r of n)r.remove(this);else n.remove(this);let{initialTeardown:e}=this;if(Tn(e))try{e()}catch(r){o=r instanceof _4?r.errors:[r]}let{_finalizers:t}=this;if(t){this._finalizers=null;for(let r of t)try{CK(r)}catch(a){o=o??[],a instanceof _4?o=[...o,...a.errors]:o.push(a)}}if(o)throw new _4(o)}}add(o){var n;if(o&&o!==this)if(this.closed)CK(o);else{if(o instanceof i){if(o.closed||o._hasParent(this))return;o._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(o)}}_hasParent(o){let{_parentage:n}=this;return n===o||Array.isArray(n)&&n.includes(o)}_addParent(o){let{_parentage:n}=this;this._parentage=Array.isArray(n)?(n.push(o),n):n?[n,o]:o}_removeParent(o){let{_parentage:n}=this;n===o?this._parentage=null:Array.isArray(n)&&ju(n,o)}remove(o){let{_finalizers:n}=this;n&&ju(n,o),o instanceof i&&o._removeParent(this)}};Dn.EMPTY=(()=>{let i=new Dn;return i.closed=!0,i})();var L8=Dn.EMPTY;function y4(i){return i instanceof Dn||i&&"closed"in i&&Tn(i.remove)&&Tn(i.add)&&Tn(i.unsubscribe)}function CK(i){Tn(i)?i():i.unsubscribe()}var Oc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Jf={setTimeout(i,o,...n){let{delegate:e}=Jf;return e?.setTimeout?e.setTimeout(i,o,...n):setTimeout(i,o,...n)},clearTimeout(i){let{delegate:o}=Jf;return(o?.clearTimeout||clearTimeout)(i)},delegate:void 0};function S4(i){Jf.setTimeout(()=>{let{onUnhandledError:o}=Oc;if(o)o(i);else throw i})}function $u(){}var _K=B8("C",void 0,void 0);function yK(i){return B8("E",void 0,i)}function SK(i){return B8("N",i,void 0)}function B8(i,o,n){return{kind:i,value:o,error:n}}var Hu=null;function ev(i){if(Oc.useDeprecatedSynchronousErrorHandling){let o=!Hu;if(o&&(Hu={errorThrown:!1,error:null}),i(),o){let{errorThrown:n,error:e}=Hu;if(Hu=null,n)throw e}}else i()}function bK(i){Oc.useDeprecatedSynchronousErrorHandling&&Hu&&(Hu.errorThrown=!0,Hu.error=i)}var zu=class extends Dn{constructor(o){super(),this.isStopped=!1,o?(this.destination=o,y4(o)&&o.add(this)):this.destination=abe}static create(o,n,e){return new Ac(o,n,e)}next(o){this.isStopped?U8(SK(o),this):this._next(o)}error(o){this.isStopped?U8(yK(o),this):(this.isStopped=!0,this._error(o))}complete(){this.isStopped?U8(_K,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(o){this.destination.next(o)}_error(o){try{this.destination.error(o)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},obe=Function.prototype.bind;function V8(i,o){return obe.call(i,o)}var j8=class{constructor(o){this.partialObserver=o}next(o){let{partialObserver:n}=this;if(n.next)try{n.next(o)}catch(e){b4(e)}}error(o){let{partialObserver:n}=this;if(n.error)try{n.error(o)}catch(e){b4(e)}else b4(o)}complete(){let{partialObserver:o}=this;if(o.complete)try{o.complete()}catch(n){b4(n)}}},Ac=class extends zu{constructor(o,n,e){super();let t;if(Tn(o)||!o)t={next:o??void 0,error:n??void 0,complete:e??void 0};else{let r;this&&Oc.useDeprecatedNextContext?(r=Object.create(o),r.unsubscribe=()=>this.unsubscribe(),t={next:o.next&&V8(o.next,r),error:o.error&&V8(o.error,r),complete:o.complete&&V8(o.complete,r)}):t=o}this.destination=new j8(t)}};function b4(i){Oc.useDeprecatedSynchronousErrorHandling?bK(i):S4(i)}function rbe(i){throw i}function U8(i,o){let{onStoppedNotification:n}=Oc;n&&Jf.setTimeout(()=>n(i,o))}var abe={closed:!0,next:$u,error:rbe,complete:$u};var tv=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Pc(i){return i}function IK(i){return i.length===0?Pc:i.length===1?i[0]:function(n){return i.reduce((e,t)=>t(e),n)}}var $t=(()=>{class i{constructor(n){n&&(this._subscribe=n)}lift(n){let e=new i;return e.source=this,e.operator=n,e}subscribe(n,e,t){let r=lbe(n)?n:new Ac(n,e,t);return ev(()=>{let{operator:a,source:s}=this;r.add(a?a.call(r,s):s?this._subscribe(r):this._trySubscribe(r))}),r}_trySubscribe(n){try{return this._subscribe(n)}catch(e){n.error(e)}}forEach(n,e){return e=EK(e),new e((t,r)=>{let a=new Ac({next:s=>{try{n(s)}catch(c){r(c),a.unsubscribe()}},error:r,complete:t});this.subscribe(a)})}_subscribe(n){var e;return(e=this.source)===null||e===void 0?void 0:e.subscribe(n)}[tv](){return this}pipe(...n){return IK(n)(this)}toPromise(n){return n=EK(n),new n((e,t)=>{let r;this.subscribe(a=>r=a,a=>t(a),()=>e(r))})}}return i.create=o=>new i(o),i})();function EK(i){var o;return(o=i??Oc.Promise)!==null&&o!==void 0?o:Promise}function sbe(i){return i&&Tn(i.next)&&Tn(i.error)&&Tn(i.complete)}function lbe(i){return i&&i instanceof zu||sbe(i)&&y4(i)}function $8(i){return Tn(i?.lift)}function Vn(i){return o=>{if($8(o))return o.lift(function(n){try{return i(n,this)}catch(e){this.error(e)}});throw new TypeError("Unable to lift unknown Observable type")}}function On(i,o,n,e,t){return new H8(i,o,n,e,t)}var H8=class extends zu{constructor(o,n,e,t,r,a){super(o),this.onFinalize=r,this.shouldUnsubscribe=a,this._next=n?function(s){try{n(s)}catch(c){o.error(c)}}:super._next,this._error=t?function(s){try{t(s)}catch(c){o.error(c)}finally{this.unsubscribe()}}:super._error,this._complete=e?function(){try{e()}catch(s){o.error(s)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var o;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:n}=this;super.unsubscribe(),!n&&((o=this.onFinalize)===null||o===void 0||o.call(this))}}};function xK(){return Vn((i,o)=>{let n=null;i._refCount++;let e=On(o,void 0,void 0,void 0,()=>{if(!i||i._refCount<=0||0<--i._refCount){n=null;return}let t=i._connection,r=n;n=null,t&&(!r||t===r)&&t.unsubscribe(),o.unsubscribe()});i.subscribe(e),e.closed||(n=i.connect())})}var by=class extends $t{constructor(o,n){super(),this.source=o,this.subjectFactory=n,this._subject=null,this._refCount=0,this._connection=null,$8(o)&&(this.lift=o.lift)}_subscribe(o){return this.getSubject().subscribe(o)}getSubject(){let o=this._subject;return(!o||o.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:o}=this;this._subject=this._connection=null,o?.unsubscribe()}connect(){let o=this._connection;if(!o){o=this._connection=new Dn;let n=this.getSubject();o.add(this.source.subscribe(On(n,void 0,()=>{this._teardown(),n.complete()},e=>{this._teardown(),n.error(e)},()=>this._teardown()))),o.closed&&(this._connection=null,o=Dn.EMPTY)}return o}refCount(){return xK()(this)}};var nv={schedule(i){let o=requestAnimationFrame,n=cancelAnimationFrame,{delegate:e}=nv;e&&(o=e.requestAnimationFrame,n=e.cancelAnimationFrame);let t=o(r=>{n=void 0,i(r)});return new Dn(()=>n?.(t))},requestAnimationFrame(...i){let{delegate:o}=nv;return(o?.requestAnimationFrame||requestAnimationFrame)(...i)},cancelAnimationFrame(...i){let{delegate:o}=nv;return(o?.cancelAnimationFrame||cancelAnimationFrame)(...i)},delegate:void 0};var TK=jp(i=>function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Xe=(()=>{class i extends $t{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(n){let e=new I4(this,this);return e.operator=n,e}_throwIfClosed(){if(this.closed)throw new TK}next(n){ev(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let e of this.currentObservers)e.next(n)}})}error(n){ev(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=n;let{observers:e}=this;for(;e.length;)e.shift().error(n)}})}complete(){ev(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:n}=this;for(;n.length;)n.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0}_trySubscribe(n){return this._throwIfClosed(),super._trySubscribe(n)}_subscribe(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)}_innerSubscribe(n){let{hasError:e,isStopped:t,observers:r}=this;return e||t?L8:(this.currentObservers=null,r.push(n),new Dn(()=>{this.currentObservers=null,ju(r,n)}))}_checkFinalizedStatuses(n){let{hasError:e,thrownError:t,isStopped:r}=this;e?n.error(t):r&&n.complete()}asObservable(){let n=new $t;return n.source=this,n}}return i.create=(o,n)=>new I4(o,n),i})(),I4=class extends Xe{constructor(o,n){super(),this.destination=o,this.source=n}next(o){var n,e;(e=(n=this.destination)===null||n===void 0?void 0:n.next)===null||e===void 0||e.call(n,o)}error(o){var n,e;(e=(n=this.destination)===null||n===void 0?void 0:n.error)===null||e===void 0||e.call(n,o)}complete(){var o,n;(n=(o=this.destination)===null||o===void 0?void 0:o.complete)===null||n===void 0||n.call(o)}_subscribe(o){var n,e;return(e=(n=this.source)===null||n===void 0?void 0:n.subscribe(o))!==null&&e!==void 0?e:L8}};var Ce=class extends Xe{constructor(o){super(),this._value=o}get value(){return this.getValue()}_subscribe(o){let n=super._subscribe(o);return!n.closed&&o.next(this._value),n}getValue(){let{hasError:o,thrownError:n,_value:e}=this;if(o)throw n;return this._throwIfClosed(),e}next(o){super.next(this._value=o)}};var Gu={now(){return(Gu.delegate||Date).now()},delegate:void 0};var $p=class extends Xe{constructor(o=1/0,n=1/0,e=Gu){super(),this._bufferSize=o,this._windowTime=n,this._timestampProvider=e,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=n===1/0,this._bufferSize=Math.max(1,o),this._windowTime=Math.max(1,n)}next(o){let{isStopped:n,_buffer:e,_infiniteTimeWindow:t,_timestampProvider:r,_windowTime:a}=this;n||(e.push(o),!t&&e.push(r.now()+a)),this._trimBuffer(),super.next(o)}_subscribe(o){this._throwIfClosed(),this._trimBuffer();let n=this._innerSubscribe(o),{_infiniteTimeWindow:e,_buffer:t}=this,r=t.slice();for(let a=0;a<r.length&&!o.closed;a+=e?1:2)o.next(r[a]);return this._checkFinalizedStatuses(o),n}_trimBuffer(){let{_bufferSize:o,_timestampProvider:n,_buffer:e,_infiniteTimeWindow:t}=this,r=(t?1:2)*o;if(o<1/0&&r<e.length&&e.splice(0,e.length-r),!t){let a=n.now(),s=0;for(let c=1;c<e.length&&e[c]<=a;c+=2)s=c;s&&e.splice(0,s+1)}}};var E4=class extends Dn{constructor(o,n){super()}schedule(o,n=0){return this}};var Iy={setInterval(i,o,...n){let{delegate:e}=Iy;return e?.setInterval?e.setInterval(i,o,...n):setInterval(i,o,...n)},clearInterval(i){let{delegate:o}=Iy;return(o?.clearInterval||clearInterval)(i)},delegate:void 0};var Md=class extends E4{constructor(o,n){super(o,n),this.scheduler=o,this.work=n,this.pending=!1}schedule(o,n=0){var e;if(this.closed)return this;this.state=o;let t=this.id,r=this.scheduler;return t!=null&&(this.id=this.recycleAsyncId(r,t,n)),this.pending=!0,this.delay=n,this.id=(e=this.id)!==null&&e!==void 0?e:this.requestAsyncId(r,this.id,n),this}requestAsyncId(o,n,e=0){return Iy.setInterval(o.flush.bind(o,this),e)}recycleAsyncId(o,n,e=0){if(e!=null&&this.delay===e&&this.pending===!1)return n;n!=null&&Iy.clearInterval(n)}execute(o,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let e=this._execute(o,n);if(e)return e;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(o,n){let e=!1,t;try{this.work(o)}catch(r){e=!0,t=r||new Error("Scheduled action threw falsy error")}if(e)return this.unsubscribe(),t}unsubscribe(){if(!this.closed){let{id:o,scheduler:n}=this,{actions:e}=n;this.work=this.state=this.scheduler=null,this.pending=!1,ju(e,this),o!=null&&(this.id=this.recycleAsyncId(n,o,null)),this.delay=null,super.unsubscribe()}}};var cbe=1,z8,G8={};function DK(i){return i in G8?(delete G8[i],!0):!1}var wK={setImmediate(i){let o=cbe++;return G8[o]=!0,z8||(z8=Promise.resolve()),z8.then(()=>DK(o)&&i()),o},clearImmediate(i){DK(i)}};var{setImmediate:dbe,clearImmediate:mbe}=wK,Ey={setImmediate(...i){let{delegate:o}=Ey;return(o?.setImmediate||dbe)(...i)},clearImmediate(i){let{delegate:o}=Ey;return(o?.clearImmediate||mbe)(i)},delegate:void 0};var x4=class extends Md{constructor(o,n){super(o,n),this.scheduler=o,this.work=n}requestAsyncId(o,n,e=0){return e!==null&&e>0?super.requestAsyncId(o,n,e):(o.actions.push(this),o._scheduled||(o._scheduled=Ey.setImmediate(o.flush.bind(o,void 0))))}recycleAsyncId(o,n,e=0){var t;if(e!=null?e>0:this.delay>0)return super.recycleAsyncId(o,n,e);let{actions:r}=o;n!=null&&((t=r[r.length-1])===null||t===void 0?void 0:t.id)!==n&&(Ey.clearImmediate(n),o._scheduled===n&&(o._scheduled=void 0))}};var iv=class i{constructor(o,n=i.now){this.schedulerActionCtor=o,this.now=n}schedule(o,n=0,e){return new this.schedulerActionCtor(this,o).schedule(e,n)}};iv.now=Gu.now;var kd=class extends iv{constructor(o,n=iv.now){super(o,n),this.actions=[],this._active=!1}flush(o){let{actions:n}=this;if(this._active){n.push(o);return}let e;this._active=!0;do if(e=o.execute(o.state,o.delay))break;while(o=n.shift());if(this._active=!1,e){for(;o=n.shift();)o.unsubscribe();throw e}}};var T4=class extends kd{flush(o){this._active=!0;let n=this._scheduled;this._scheduled=void 0;let{actions:e}=this,t;o=o||e.shift();do if(t=o.execute(o.state,o.delay))break;while((o=e[0])&&o.id===n&&e.shift());if(this._active=!1,t){for(;(o=e[0])&&o.id===n&&e.shift();)o.unsubscribe();throw t}}};var W8=new T4(x4);var Ga=new kd(Md),q8=Ga;var D4=class extends Md{constructor(o,n){super(o,n),this.scheduler=o,this.work=n}schedule(o,n=0){return n>0?super.schedule(o,n):(this.delay=n,this.state=o,this.scheduler.flush(this),this)}execute(o,n){return n>0||this.closed?super.execute(o,n):this._execute(o,n)}requestAsyncId(o,n,e=0){return e!=null&&e>0||e==null&&this.delay>0?super.requestAsyncId(o,n,e):(o.flush(this),0)}};var w4=class extends kd{};var Y8=new w4(D4);var O4=class extends Md{constructor(o,n){super(o,n),this.scheduler=o,this.work=n}requestAsyncId(o,n,e=0){return e!==null&&e>0?super.requestAsyncId(o,n,e):(o.actions.push(this),o._scheduled||(o._scheduled=nv.requestAnimationFrame(()=>o.flush(void 0))))}recycleAsyncId(o,n,e=0){var t;if(e!=null?e>0:this.delay>0)return super.recycleAsyncId(o,n,e);let{actions:r}=o;n!=null&&n===o._scheduled&&((t=r[r.length-1])===null||t===void 0?void 0:t.id)!==n&&(nv.cancelAnimationFrame(n),o._scheduled=void 0)}};var A4=class extends kd{flush(o){this._active=!0;let n;o?n=o.id:(n=this._scheduled,this._scheduled=void 0);let{actions:e}=this,t;o=o||e.shift();do if(t=o.execute(o.state,o.delay))break;while((o=e[0])&&o.id===n&&e.shift());if(this._active=!1,t){for(;(o=e[0])&&o.id===n&&e.shift();)o.unsubscribe();throw t}}};var jm=new A4(O4);var Ul=new $t(i=>i.complete());function P4(i){return i&&Tn(i.schedule)}function K8(i){return i[i.length-1]}function M4(i){return Tn(K8(i))?i.pop():void 0}function Rd(i){return P4(K8(i))?i.pop():void 0}function OK(i,o){return typeof K8(i)=="number"?i.pop():o}function Z8(i,o){var n={};for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.indexOf(e)<0&&(n[e]=i[e]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,e=Object.getOwnPropertySymbols(i);t<e.length;t++)o.indexOf(e[t])<0&&Object.prototype.propertyIsEnumerable.call(i,e[t])&&(n[e[t]]=i[e[t]]);return n}function PK(i,o,n,e){function t(r){return r instanceof n?r:new n(function(a){a(r)})}return new(n||(n=Promise))(function(r,a){function s(g){try{p(e.next(g))}catch(f){a(f)}}function c(g){try{p(e.throw(g))}catch(f){a(f)}}function p(g){g.done?r(g.value):t(g.value).then(s,c)}p((e=e.apply(i,o||[])).next())})}function AK(i){var o=typeof Symbol=="function"&&Symbol.iterator,n=o&&i[o],e=0;if(n)return n.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&e>=i.length&&(i=void 0),{value:i&&i[e++],done:!i}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wu(i){return this instanceof Wu?(this.v=i,this):new Wu(i)}function MK(i,o,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n.apply(i,o||[]),t,r=[];return t=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),t[Symbol.asyncIterator]=function(){return this},t;function a(T){return function(B){return Promise.resolve(B).then(T,f)}}function s(T,B){e[T]&&(t[T]=function(G){return new Promise(function(z,Q){r.push([T,G,z,Q])>1||c(T,G)})},B&&(t[T]=B(t[T])))}function c(T,B){try{p(e[T](B))}catch(G){I(r[0][3],G)}}function p(T){T.value instanceof Wu?Promise.resolve(T.value.v).then(g,f):I(r[0][2],T)}function g(T){c("next",T)}function f(T){c("throw",T)}function I(T,B){T(B),r.shift(),r.length&&c(r[0][0],r[0][1])}}function kK(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=i[Symbol.asyncIterator],n;return o?o.call(i):(i=typeof AK=="function"?AK(i):i[Symbol.iterator](),n={},e("next"),e("throw"),e("return"),n[Symbol.asyncIterator]=function(){return this},n);function e(r){n[r]=i[r]&&function(a){return new Promise(function(s,c){a=i[r](a),t(s,c,a.done,a.value)})}}function t(r,a,s,c){Promise.resolve(c).then(function(p){r({value:p,done:s})},a)}}var ov=i=>i&&typeof i.length=="number"&&typeof i!="function";function k4(i){return Tn(i?.then)}function R4(i){return Tn(i[tv])}function N4(i){return Symbol.asyncIterator&&Tn(i?.[Symbol.asyncIterator])}function F4(i){return new TypeError(`You provided ${i!==null&&typeof i=="object"?"an invalid object":`'${i}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function pbe(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var L4=pbe();function B4(i){return Tn(i?.[L4])}function V4(i){return MK(this,arguments,function*(){let n=i.getReader();try{for(;;){let{value:e,done:t}=yield Wu(n.read());if(t)return yield Wu(void 0);yield yield Wu(e)}}finally{n.releaseLock()}})}function U4(i){return Tn(i?.getReader)}function xi(i){if(i instanceof $t)return i;if(i!=null){if(R4(i))return gbe(i);if(ov(i))return ube(i);if(k4(i))return hbe(i);if(N4(i))return RK(i);if(B4(i))return fbe(i);if(U4(i))return vbe(i)}throw F4(i)}function gbe(i){return new $t(o=>{let n=i[tv]();if(Tn(n.subscribe))return n.subscribe(o);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ube(i){return new $t(o=>{for(let n=0;n<i.length&&!o.closed;n++)o.next(i[n]);o.complete()})}function hbe(i){return new $t(o=>{i.then(n=>{o.closed||(o.next(n),o.complete())},n=>o.error(n)).then(null,S4)})}function fbe(i){return new $t(o=>{for(let n of i)if(o.next(n),o.closed)return;o.complete()})}function RK(i){return new $t(o=>{Cbe(i,o).catch(n=>o.error(n))})}function vbe(i){return RK(V4(i))}function Cbe(i,o){var n,e,t,r;return PK(this,void 0,void 0,function*(){try{for(n=kK(i);e=yield n.next(),!e.done;){let a=e.value;if(o.next(a),o.closed)return}}catch(a){t={error:a}}finally{try{e&&!e.done&&(r=n.return)&&(yield r.call(n))}finally{if(t)throw t.error}}o.complete()})}function Wa(i,o,n,e=0,t=!1){let r=o.sched