marketplacepos 3.9.0 → 3.9.2

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.
Files changed (71) hide show
  1. package/Marketplace/{chunk-TSQMENIR.js → chunk-253CGPDL.js} +1 -1
  2. package/Marketplace/{chunk-XUXJWQIO.js → chunk-2GEKKULX.js} +1 -1
  3. package/Marketplace/{chunk-RW2RZLLY.js → chunk-3ADBD6TU.js} +1 -1
  4. package/Marketplace/{chunk-6HKBE32M.js → chunk-3MUKJETU.js} +1 -1
  5. package/Marketplace/{chunk-CHON6N2M.js → chunk-42URWJWL.js} +1 -1
  6. package/Marketplace/chunk-5G6F6KM6.js +1 -0
  7. package/Marketplace/{chunk-L3WFFTI6.js → chunk-5KWI6CNM.js} +1 -1
  8. package/Marketplace/{chunk-CXP7YAGC.js → chunk-5MVSVVTZ.js} +1 -1
  9. package/Marketplace/{chunk-MSDWOEET.js → chunk-62YVBX6C.js} +1 -1
  10. package/Marketplace/{chunk-PT6I33PO.js → chunk-6GHDH7BV.js} +1 -1
  11. package/Marketplace/{chunk-ITJHNS2G.js → chunk-6TL753XX.js} +1 -1
  12. package/Marketplace/{chunk-G2KDKW3S.js → chunk-7DWQVDUN.js} +1 -1
  13. package/Marketplace/{chunk-HCGJWBQS.js → chunk-7NUYZDNH.js} +1 -1
  14. package/Marketplace/{chunk-D7O45PEU.js → chunk-A4NDARMD.js} +1 -1
  15. package/Marketplace/{chunk-ON25NAJQ.js → chunk-AYOR2E3R.js} +1 -1
  16. package/Marketplace/{chunk-PZ6VAPM5.js → chunk-CQDJKHRJ.js} +1 -1
  17. package/Marketplace/{chunk-BYU3FQ7F.js → chunk-DAOVB2Q7.js} +1 -1
  18. package/Marketplace/{chunk-W56FKJF2.js → chunk-DR77LMQ5.js} +1 -1
  19. package/Marketplace/{chunk-OM4JMXVF.js → chunk-GIXQOMAF.js} +1 -1
  20. package/Marketplace/{chunk-U2TX2OBS.js → chunk-HTEDNGSI.js} +1 -1
  21. package/Marketplace/{chunk-G3JH324J.js → chunk-HWGOH7QS.js} +1 -1
  22. package/Marketplace/chunk-JRVVHEWT.js +1 -0
  23. package/Marketplace/{chunk-2R3KOIEF.js → chunk-JZNKYXRR.js} +1 -1
  24. package/Marketplace/{chunk-C6SX7URU.js → chunk-K2D3HYO3.js} +1 -1
  25. package/Marketplace/{chunk-CGVJUMLO.js → chunk-KES3BFYS.js} +1 -1
  26. package/Marketplace/{chunk-LJLL24D5.js → chunk-KPVSCTPE.js} +1 -1
  27. package/Marketplace/{chunk-2NXM7D4R.js → chunk-LLITFBOE.js} +1 -1
  28. package/Marketplace/{chunk-TV6JTTZ6.js → chunk-LSG32F4X.js} +1 -1
  29. package/Marketplace/{chunk-2IV4PAZF.js → chunk-MNQTYXTP.js} +1 -1
  30. package/Marketplace/{chunk-WOWVP6FH.js → chunk-MSDWP3Z5.js} +1 -1
  31. package/Marketplace/{chunk-TPI2XS3B.js → chunk-MU6WSNWI.js} +1 -1
  32. package/Marketplace/{chunk-DT4LKSYR.js → chunk-NDL2OQM7.js} +1 -1
  33. package/Marketplace/{chunk-ZWFR4K4H.js → chunk-NO7WERYV.js} +1 -1
  34. package/Marketplace/{chunk-NDVW5CQG.js → chunk-NUQYRQUS.js} +1 -1
  35. package/Marketplace/{chunk-EYF3TVW2.js → chunk-OGZ4S2OZ.js} +1 -1
  36. package/Marketplace/{chunk-LDC42S7G.js → chunk-OHUTMYI3.js} +1 -1
  37. package/Marketplace/{chunk-3FEJKWZ3.js → chunk-P5FK7XH7.js} +1 -1
  38. package/Marketplace/{chunk-VAVNT6M4.js → chunk-PEROEQOW.js} +1 -1
  39. package/Marketplace/{chunk-4CQ2V5UQ.js → chunk-PTD6INQZ.js} +1 -1
  40. package/Marketplace/{chunk-JTZGR2TX.js → chunk-QC2RB3LW.js} +1 -1
  41. package/Marketplace/{chunk-BGUJV6DT.js → chunk-RB4PODHN.js} +1 -1
  42. package/Marketplace/{chunk-ZNRMYXI6.js → chunk-T726PSLZ.js} +1 -1
  43. package/Marketplace/{chunk-JNGM4O4U.js → chunk-TEMOBJ6P.js} +1 -1
  44. package/Marketplace/{chunk-ISFIEDU2.js → chunk-TH3YEBZM.js} +1 -1
  45. package/Marketplace/{chunk-4Y26NEN3.js → chunk-TTTBABPM.js} +1 -1
  46. package/Marketplace/{chunk-NVTP35HE.js → chunk-USTIBZQZ.js} +1 -1
  47. package/Marketplace/{chunk-55YNBCIT.js → chunk-UU4FCLSH.js} +1 -1
  48. package/Marketplace/{chunk-F34W6HKK.js → chunk-VK5MBCEQ.js} +1 -1
  49. package/Marketplace/{chunk-Q443OERQ.js → chunk-WDVFAXEE.js} +1 -1
  50. package/Marketplace/{chunk-XRU6ZED5.js → chunk-WGRN55OQ.js} +1 -1
  51. package/Marketplace/{chunk-D4SY4NN2.js → chunk-WOVAE35N.js} +1 -1
  52. package/Marketplace/{chunk-R3ZCIBHW.js → chunk-X7OCPOXW.js} +1 -1
  53. package/Marketplace/{chunk-IPMUP2EJ.js → chunk-XBFPNQRE.js} +1 -1
  54. package/Marketplace/{chunk-J6ASZAVV.js → chunk-XH2RYIXU.js} +1 -1
  55. package/Marketplace/chunk-YJA6GNVB.js +1 -0
  56. package/Marketplace/{chunk-KFEX5WDJ.js → chunk-YMW3PRQO.js} +1 -1
  57. package/Marketplace/{chunk-LEMN4XNC.js → chunk-YWSTU35G.js} +2 -2
  58. package/Marketplace/{chunk-JS5XLOTQ.js → chunk-ZKFCU6QY.js} +1 -1
  59. package/Marketplace/{chunk-U7ZNJ3CU.js → chunk-ZOAWBPA4.js} +1 -1
  60. package/Marketplace/index.html +2 -2
  61. package/Marketplace/{main-B7ZBS2B4.js → main-A64TEOJA.js} +1 -1
  62. package/Marketplace/{styles-VI47P5BQ.css → styles-XF7HDZPE.css} +1 -1
  63. package/package.json +1 -1
  64. package/Marketplace/chunk-BQVKRP7F.js +0 -1
  65. package/Marketplace/chunk-GL34FHFI.js +0 -1
  66. package/Marketplace/chunk-KNFZSRBH.js +0 -1
  67. /package/Marketplace/{chunk-EQ2WXZM5.js → chunk-3OPATVPE.js} +0 -0
  68. /package/Marketplace/{chunk-TOSWRZLL.js → chunk-CRNJ2Q5T.js} +0 -0
  69. /package/Marketplace/{chunk-KJRJA6WL.js → chunk-FXU7TISG.js} +0 -0
  70. /package/Marketplace/{chunk-TIT4WYYC.js → chunk-PXXT4AMP.js} +0 -0
  71. /package/Marketplace/{polyfills-5HAIPMSD.js → polyfills-JB4R6HHU.js} +0 -0
@@ -1 +1 @@
1
- import{$a as f,$b as T,Db as c,Eb as u,Fa as a,Ja as r,Oa as s,Ua as C,Za as o,_a as l,db as P,ea as b,fc as w,gc as y,hb as d,ja as v,jb as h,ka as _,pb as m,qb as k,sb as N,ub as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-D4SY4NN2.js";function I(t,i){if(t&1){let g=P();o(0,"span",10),d("click",function(){v(g);let n=h();return n.getTotal(),_(n.hasClicked=!0)}),o(1,"i",11),m(2,"?"),l()()}}function M(t,i){if(t&1&&(o(0,"span"),m(1),c(2,"number"),l()),t&2){let g=h();a(1),k(u(2,1,g.paginationTotal))}}var O=(()=>{let i=class i{constructor(){this.get=new r,this.change=new r,this.next=new r,this.previous=new r,this.total=new r,this.hasClicked=!1}changePage(p){this.filter.PageNumber=p.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=b({type:i,selectors:[["app-mat-paginator-no-count"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},standalone:!0,features:[S],decls:13,vars:10,consts:[[1,"d-flex","justify-content-end","mt-5"],[1,"d-sm-block","collapse","mt-3","me-5"],[1,"text-dark","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary","btn-sm","me-3","border-0",3,"disabled","click"],[1,"fas","fa-chevron-left"],["role","button",1,"btn","btn-outline-secondary","btn-sm","border-0",3,"disabled","click"],[1,"fas","fa-chevron-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(n,e){n&1&&(o(0,"div",0)(1,"div",1)(2,"div",2),m(3),c(4,"number"),c(5,"number"),C(6,I,3,0,"span",3)(7,M,3,3,"span",4),l()(),o(8,"div",5)(9,"button",6),d("click",function(){return e.PreviousPage()}),f(10,"i",7),l(),o(11,"button",8),d("click",function(){return e.NextPage()}),f(12,"i",9),l()()()),n&2&&(a(3),N(" Showing ",u(4,6,e.filter.PageSize*(e.filter.PageNumber-1)+1)," - ",u(5,8,e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata)," of "),a(3),s("ngIf",!e.hasClicked),a(1),s("ngIf",e.hasClicked),a(2),s("disabled",e.filter.PageNumber==1),a(2),s("disabled",e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata==e.paginationTotal||e.totaldata<e.filter.PageSize))},dependencies:[y,T,w]});let t=i;return t})();export{O as a};
1
+ import{$a as f,$b as T,Db as c,Eb as u,Fa as a,Ja as r,Oa as s,Ua as C,Za as o,_a as l,db as P,ea as b,fc as w,gc as y,hb as d,ja as v,jb as h,ka as _,pb as m,qb as k,sb as N,ub as S}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-WOVAE35N.js";function I(t,i){if(t&1){let g=P();o(0,"span",10),d("click",function(){v(g);let n=h();return n.getTotal(),_(n.hasClicked=!0)}),o(1,"i",11),m(2,"?"),l()()}}function M(t,i){if(t&1&&(o(0,"span"),m(1),c(2,"number"),l()),t&2){let g=h();a(1),k(u(2,1,g.paginationTotal))}}var O=(()=>{let i=class i{constructor(){this.get=new r,this.change=new r,this.next=new r,this.previous=new r,this.total=new r,this.hasClicked=!1}changePage(p){this.filter.PageNumber=p.pageIndex+1,this.change.emit(this.filter)}getTotal(){this.total.emit()}PreviousPage(){this.previous.emit()}NextPage(){this.next.emit()}};i.\u0275fac=function(n){return new(n||i)},i.\u0275cmp=b({type:i,selectors:[["app-mat-paginator-no-count"]],inputs:{filter:"filter",paginationTotal:"paginationTotal",totaldata:"totaldata",hasClicked:"hasClicked"},outputs:{get:"get",change:"change",next:"next",previous:"previous",total:"total"},standalone:!0,features:[S],decls:13,vars:10,consts:[[1,"d-flex","justify-content-end","mt-5"],[1,"d-sm-block","collapse","mt-3","me-5"],[1,"text-dark","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary","btn-sm","me-3","border-0",3,"disabled","click"],[1,"fas","fa-chevron-left"],["role","button",1,"btn","btn-outline-secondary","btn-sm","border-0",3,"disabled","click"],[1,"fas","fa-chevron-right"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"]],template:function(n,e){n&1&&(o(0,"div",0)(1,"div",1)(2,"div",2),m(3),c(4,"number"),c(5,"number"),C(6,I,3,0,"span",3)(7,M,3,3,"span",4),l()(),o(8,"div",5)(9,"button",6),d("click",function(){return e.PreviousPage()}),f(10,"i",7),l(),o(11,"button",8),d("click",function(){return e.NextPage()}),f(12,"i",9),l()()()),n&2&&(a(3),N(" Showing ",u(4,6,e.filter.PageSize*(e.filter.PageNumber-1)+1)," - ",u(5,8,e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata)," of "),a(3),s("ngIf",!e.hasClicked),a(1),s("ngIf",e.hasClicked),a(2),s("disabled",e.filter.PageNumber==1),a(2),s("disabled",e.filter.PageSize*(e.filter.PageNumber-1)+e.totaldata==e.paginationTotal||e.totaldata<e.filter.PageSize))},dependencies:[y,T,w]});let t=i;return t})();export{O as a};
@@ -1 +1 @@
1
- import{a as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-ITJHNS2G.js";import{b as he,e as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-TPI2XS3B.js";import{$ as le,ca as U,d as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-D4SY4NN2.js";import{a as d,b as R,c as H,h as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-TOSWRZLL.js";var y=class extends Error{constructor(e,t){let o=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=o}},T=class extends Error{constructor(e="A timeout occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},b=class extends Error{constructor(e="An abort occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},j=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=o}},O=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=o}},B=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=o}},F=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}},z=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=o}};var A=class{constructor(e,t,o){this.statusCode=e,this.statusText=t,this.content=o}},v=class{get(e,t){return this.send(R(d({},t),{method:"GET",url:e}))}post(e,t){return this.send(R(d({},t),{method:"POST",url:e}))}delete(e,t){return this.send(R(d({},t),{method:"DELETE",url:e}))}getCookieString(e){return""}};var i=function(r){return r[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Information=2]="Information",r[r.Warning=3]="Warning",r[r.Error=4]="Error",r[r.Critical=5]="Critical",r[r.None=6]="None",r}(i||{});var k=class{constructor(){}log(e,t){}};k.instance=new k;var me="7.0.11",f=class{static isRequired(e,t){if(e==null)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,o){if(!(e in t))throw new Error(`Unknown ${o} value: ${e}.`)}},_=class{static get isBrowser(){return typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return typeof self=="object"&&"importScripts"in self}static get isReactNative(){return typeof window=="object"&&typeof window.document>"u"}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}};function x(r,e){let t="";return P(r)?(t=`Binary data of length ${r.byteLength}`,e&&(t+=`. Content: '${we(r)}'`)):typeof r=="string"&&(t=`String data of length ${r.length}`,e&&(t+=`. Content: '${r}'`)),t}function we(r){let e=new Uint8Array(r),t="";return e.forEach(o=>{let n=o<16?"0":"";t+=`0x${n}${o.toString(16)} `}),t.substr(0,t.length-1)}function P(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}function V(r,e,t,o,n,s){return u(this,null,function*(){let c={},[l,a]=E();c[l]=a,r.log(i.Trace,`(${e} transport) sending data. ${x(n,s.logMessageContent)}.`);let h=P(n)?"arraybuffer":"text",g=yield t.post(o,{content:n,headers:d(d({},c),s.headers),responseType:h,timeout:s.timeout,withCredentials:s.withCredentials});r.log(i.Trace,`(${e} transport) request complete. Response status: ${g.statusCode}.`)})}function pe(r){return r===void 0?new D(i.Information):r===null?k.instance:r.log!==void 0?r:new D(r)}var J=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(t=>{})}},D=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let o=`[${new Date().toISOString()}] ${i[e]}: ${t}`;switch(e){case i.Critical:case i.Error:this.out.error(o);break;case i.Warning:this.out.warn(o);break;case i.Information:this.out.info(o);break;default:this.out.log(o);break}}}};function E(){let r="X-SignalR-User-Agent";return _.isNode&&(r="User-Agent"),[r,be(me,Ce(),ye(),Se())]}function be(r,e,t,o){let n="Microsoft SignalR/",s=r.split(".");return n+=`${s[0]}.${s[1]}`,n+=` (${r}; `,e&&e!==""?n+=`${e}; `:n+="Unknown OS; ",n+=`${t}`,o?n+=`; ${o}`:n+="; Unknown Runtime Version",n+=")",n}function Ce(){if(_.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Se(){if(_.isNode)return process.versions.node}function ye(){return _.isNode?"NodeJS":"Browser"}function ie(r){return r.stack?r.stack:r.message?r.message:`${r}`}function de(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}var X=class extends v{constructor(e){if(super(),this._logger=e,typeof fetch>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._jar=new(t("tough-cookie")).CookieJar,this._fetchType=t("node-fetch"),this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(de());if(typeof AbortController>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}send(e){return u(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new b;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");let t=new this._abortControllerType,o;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),o=new b});let n=null;if(e.timeout){let a=e.timeout;n=setTimeout(()=>{t.abort(),this._logger.log(i.Warning,"Timeout from HTTP request."),o=new T},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},P(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let s;try{s=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:d({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(a){throw o||(this._logger.log(i.Warning,`Error from HTTP request. ${a}.`),a)}finally{n&&clearTimeout(n),e.abortSignal&&(e.abortSignal.onabort=null)}if(!s.ok){let a=yield fe(s,"text");throw new y(a||s.statusText,s.status)}let l=yield fe(s,e.responseType);return new A(s.status,s.statusText,l)})}getCookieString(e){let t="";return _.isNode&&this._jar&&this._jar.getCookies(e,(o,n)=>t=n.join("; ")),t}};function fe(r,e){let t;switch(e){case"arraybuffer":t=r.arrayBuffer();break;case"text":t=r.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:t=r.text();break}return t}var K=class extends v{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?new Promise((t,o)=>{let n=new XMLHttpRequest;n.open(e.method,e.url,!0),n.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,n.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(P(e.content)?n.setRequestHeader("Content-Type","application/octet-stream"):n.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));let s=e.headers;s&&Object.keys(s).forEach(c=>{n.setRequestHeader(c,s[c])}),e.responseType&&(n.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o(new b)}),e.timeout&&(n.timeout=e.timeout),n.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),n.status>=200&&n.status<300?t(new A(n.status,n.statusText,n.response||n.responseText)):o(new y(n.response||n.responseText||n.statusText,n.status))},n.onerror=()=>{this._logger.log(i.Warning,`Error from HTTP request. ${n.status}: ${n.statusText}.`),o(new y(n.statusText,n.status))},n.ontimeout=()=>{this._logger.log(i.Warning,"Timeout from HTTP request."),o(new T)},n.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}};var G=class extends v{constructor(e){if(super(),typeof fetch<"u"||_.isNode)this._httpClient=new X(e);else if(typeof XMLHttpRequest<"u")this._httpClient=new K(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}};var S=class r{static write(e){return`${e}${r.RecordSeparator}`}static parse(e){if(e[e.length-1]!==r.RecordSeparator)throw new Error("Message is incomplete.");let t=e.split(r.RecordSeparator);return t.pop(),t}};S.RecordSeparatorCode=30;S.RecordSeparator=String.fromCharCode(S.RecordSeparatorCode);var Y=class{writeHandshakeRequest(e){return S.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,o;if(P(e)){let l=new Uint8Array(e),a=l.indexOf(S.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(l.slice(0,h))),o=l.byteLength>h?l.slice(h).buffer:null}else{let l=e,a=l.indexOf(S.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=l.substring(0,h),o=l.length>h?l.substring(h):null}let n=S.parse(t),s=JSON.parse(n[0]);if(s.type)throw new Error("Expected a handshake response from the server.");return[o,s]}};var p=function(r){return r[r.Invocation=1]="Invocation",r[r.StreamItem=2]="StreamItem",r[r.Completion=3]="Completion",r[r.StreamInvocation=4]="StreamInvocation",r[r.CancelInvocation=5]="CancelInvocation",r[r.Ping=6]="Ping",r[r.Close=7]="Close",r}(p||{});var Q=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new J(this,e)}};var ve=30*1e3,ke=15*1e3,m=function(r){return r.Disconnected="Disconnected",r.Connecting="Connecting",r.Connected="Connected",r.Disconnecting="Disconnecting",r.Reconnecting="Reconnecting",r}(m||{}),Z=class r{constructor(e,t,o,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(i.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},f.isRequired(e,"connection"),f.isRequired(t,"logger"),f.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=ve,this.keepAliveIntervalInMilliseconds=ke,this._logger=t,this._protocol=o,this.connection=e,this._reconnectPolicy=n,this._handshakeProtocol=new Y,this.connection.onreceive=s=>this._processIncomingData(s),this.connection.onclose=s=>this._connectionClosed(s),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=m.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:p.Ping})}static create(e,t,o,n){return new r(e,t,o,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==m.Disconnected&&this._connectionState!==m.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return u(this,null,function*(){if(this._connectionState!==m.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=m.Connecting,this._logger.log(i.Debug,"Starting HubConnection.");try{yield this._startInternal(),_.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=m.Connected,this._connectionStarted=!0,this._logger.log(i.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=m.Disconnected,this._logger.log(i.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return u(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((t,o)=>{this._handshakeResolver=t,this._handshakeRejecter=o});yield this.connection.start(this._protocol.transferFormat);try{let t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(i.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(i.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(t){throw this._logger.log(i.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(t),t}})}stop(){return u(this,null,function*(){let e=this._startPromise;this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch{}})}_stopInternal(e){return this._connectionState===m.Disconnected?(this._logger.log(i.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===m.Disconnecting?(this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=m.Disconnecting,this._logger.log(i.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(i.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new b("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createStreamInvocation(e,t,n),c,l=new Q;return l.cancelCallback=()=>{let a=this._createCancelInvocation(s.invocationId);return delete this._callbacks[s.invocationId],c.then(()=>this._sendWithProtocol(a))},this._callbacks[s.invocationId]=(a,h)=>{if(h){l.error(h);return}else a&&(a.type===p.Completion?a.error?l.error(new Error(a.error)):l.complete():l.next(a.item))},c=this._sendWithProtocol(s).catch(a=>{l.error(a),delete this._callbacks[s.invocationId]}),this._launchStreams(o,c),l}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._sendWithProtocol(this._createInvocation(e,t,!0,n));return this._launchStreams(o,s),s}invoke(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createInvocation(e,t,!1,n);return new Promise((l,a)=>{this._callbacks[s.invocationId]=(g,I)=>{if(I){a(I);return}else g&&(g.type===p.Completion?g.error?a(new Error(g.error)):l(g.result):a(new Error(`Unexpected message type: ${g.type}`)))};let h=this._sendWithProtocol(s).catch(g=>{a(g),delete this._callbacks[s.invocationId]});this._launchStreams(o,h)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let o=this._methods[e];if(o)if(t){let n=o.indexOf(t);n!==-1&&(o.splice(n,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let o of t)switch(o.type){case p.Invocation:this._invokeClientMethod(o);break;case p.StreamItem:case p.Completion:{let n=this._callbacks[o.invocationId];if(n){o.type===p.Completion&&delete this._callbacks[o.invocationId];try{n(o)}catch(s){this._logger.log(i.Error,`Stream callback threw error: ${ie(s)}`)}}break}case p.Ping:break;case p.Close:{this._logger.log(i.Information,"Close message received from server.");let n=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(n):this._stopPromise=this._stopInternal(n);break}default:this._logger.log(i.Warning,`Invalid message type: ${o.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,o;try{[o,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(n){let s="Error parsing handshake response: "+n;this._logger.log(i.Error,s);let c=new Error(s);throw this._handshakeRejecter(c),c}if(t.error){let n="Server returned handshake error: "+t.error;this._logger.log(i.Error,n);let s=new Error(n);throw this._handshakeRejecter(s),s}else this._logger.log(i.Debug,"Server handshake complete.");return this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>u(this,null,function*(){if(this._connectionState===m.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return u(this,null,function*(){let t=e.target.toLowerCase(),o=this._methods[t];if(!o){this._logger.log(i.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}let n=o.slice(),s=!!e.invocationId,c,l,a;for(let h of n)try{let g=c;c=yield h.apply(this,e.arguments),s&&c&&g&&(this._logger.log(i.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),l=void 0}catch(g){l=g,this._logger.log(i.Error,`A callback for the method '${t}' threw error '${g}'.`)}a?yield this._sendWithProtocol(a):s?(l?a=this._createCompletionMessage(e.invocationId,`${l}`,null):c!==void 0?a=this._createCompletionMessage(e.invocationId,null,c):(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):c&&this._logger.log(i.Error,`Result given for '${t}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(i.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new b("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===m.Disconnecting?this._completeClose(e):this._connectionState===m.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===m.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=m.Disconnected,this._connectionStarted=!1,_.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(i.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}_reconnect(e){return u(this,null,function*(){let t=Date.now(),o=0,n=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),s=this._getNextRetryDelay(o++,0,n);if(s===null){this._logger.log(i.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=m.Reconnecting,e?this._logger.log(i.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(i.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(c=>c.apply(this,[e]))}catch(c){this._logger.log(i.Error,`An onreconnecting callback called with error '${e}' threw error '${c}'.`)}if(this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;s!==null;){if(this._logger.log(i.Information,`Reconnect attempt number ${o} will start in ${s} ms.`),yield new Promise(c=>{this._reconnectDelayHandle=setTimeout(c,s)}),this._reconnectDelayHandle=void 0,this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=m.Connected,this._logger.log(i.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(c=>c.apply(this,[this.connection.connectionId]))}catch(c){this._logger.log(i.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${c}'.`)}return}catch(c){if(this._logger.log(i.Information,`Reconnect attempt failed because of error '${c}'.`),this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===m.Disconnecting&&this._completeClose();return}n=c instanceof Error?c:new Error(c.toString()),s=this._getNextRetryDelay(o++,Date.now()-t,n)}}this._logger.log(i.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,t,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:o})}catch(n){return this._logger.log(i.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(o=>{let n=t[o];try{n(null,e)}catch(s){this._logger.log(i.Error,`Stream 'error' callback called with '${e}' threw error: ${ie(s)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,o,n){if(o)return n.length!==0?{arguments:t,streamIds:n,target:e,type:p.Invocation}:{arguments:t,target:e,type:p.Invocation};{let s=this._invocationId;return this._invocationId++,n.length!==0?{arguments:t,invocationId:s.toString(),streamIds:n,target:e,type:p.Invocation}:{arguments:t,invocationId:s.toString(),target:e,type:p.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||(t=Promise.resolve());for(let o in e)e[o].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:n=>{let s;n instanceof Error?s=n.message:n&&n.toString?s=n.toString():s="Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,s)))},next:n=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,n)))}})}}_replaceStreamingParams(e){let t=[],o=[];for(let n=0;n<e.length;n++){let s=e[n];if(this._isObservable(s)){let c=this._invocationId;this._invocationId++,t[c]=s,o.push(c.toString()),e.splice(n,1)}}return[t,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,t,o){let n=this._invocationId;return this._invocationId++,o.length!==0?{arguments:t,invocationId:n.toString(),streamIds:o,target:e,type:p.StreamInvocation}:{arguments:t,invocationId:n.toString(),target:e,type:p.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:p.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:p.StreamItem}}_createCompletionMessage(e,t,o){return t?{error:t,invocationId:e,type:p.Completion}:{invocationId:e,result:o,type:p.Completion}}};var Ee=[0,2e3,1e4,3e4,null],L=class{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Ee}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}};var $=(()=>{class r{}return r.Authorization="Authorization",r.Cookie="Cookie",r})();var q=class extends v{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}send(e){return u(this,null,function*(){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);let o=yield this._innerClient.send(e);return t&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):o})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[$.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[$.Authorization]&&delete e.headers[$.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}};var C=function(r){return r[r.None=0]="None",r[r.WebSockets=1]="WebSockets",r[r.ServerSentEvents=2]="ServerSentEvents",r[r.LongPolling=4]="LongPolling",r}(C||{}),w=function(r){return r[r.Text=1]="Text",r[r.Binary=2]="Binary",r}(w||{});var ee=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};var W=class{constructor(e,t,o){this._httpClient=e,this._logger=t,this._pollAbort=new ee,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}connect(e,t){return u(this,null,function*(){if(f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._url=e,this._logger.log(i.Trace,"(LongPolling transport) Connecting."),t===w.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");let[o,n]=E(),s=d({[o]:n},this._options.headers),c={abortSignal:this._pollAbort.signal,headers:s,timeout:1e5,withCredentials:this._options.withCredentials};t===w.Binary&&(c.responseType="arraybuffer");let l=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${l}.`);let a=yield this._httpClient.get(l,c);a.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new y(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,c)})}_poll(e,t){return u(this,null,function*(){try{for(;this._running;)try{let o=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${o}.`);let n=yield this._httpClient.get(o,t);n.statusCode===204?(this._logger.log(i.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):n.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${n.statusCode}.`),this._closeError=new y(n.statusText||"",n.statusCode),this._running=!1):n.content?(this._logger.log(i.Trace,`(LongPolling transport) data received. ${x(n.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(n.content)):this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof T?this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(i.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(i.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return u(this,null,function*(){return this._running?V(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return u(this,null,function*(){this._logger.log(i.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(i.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,o]=E();e[t]=o;let n={headers:d(d({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};yield this._httpClient.delete(this._url,n),this._logger.log(i.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(i.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(i.Trace,e),this.onclose(this._closeError)}}};var te=class{constructor(e,t,o,n){this._httpClient=e,this._accessToken=t,this._logger=o,this._options=n,this.onreceive=null,this.onclose=null}connect(e,t){return u(this,null,function*(){return f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,n)=>{let s=!1;if(t!==w.Text){n(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let c;if(_.isBrowser||_.isWebWorker)c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let l=this._httpClient.getCookieString(e),a={};a.Cookie=l;let[h,g]=E();a[h]=g,c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:d(d({},a),this._options.headers)})}try{c.onmessage=l=>{if(this.onreceive)try{this._logger.log(i.Trace,`(SSE transport) data received. ${x(l.data,this._options.logMessageContent)}.`),this.onreceive(l.data)}catch(a){this._close(a);return}},c.onerror=l=>{s?this._close():n(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},c.onopen=()=>{this._logger.log(i.Information,`SSE connected to ${this._url}`),this._eventSource=c,s=!0,o()}}catch(l){n(l);return}})})}send(e){return u(this,null,function*(){return this._eventSource?V(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}};var oe=class{constructor(e,t,o,n,s,c){this._logger=o,this._accessTokenFactory=t,this._logMessageContent=n,this._webSocketConstructor=s,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=c}connect(e,t){return u(this,null,function*(){f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(WebSockets transport) Connecting.");let o;return this._accessTokenFactory&&(o=yield this._accessTokenFactory()),new Promise((n,s)=>{e=e.replace(/^http/,"ws");let c,l=this._httpClient.getCookieString(e),a=!1;if(_.isNode||_.isReactNative){let h={},[g,I]=E();h[g]=I,o&&(h[$.Authorization]=`Bearer ${o}`),l&&(h[$.Cookie]=l),c=new this._webSocketConstructor(e,void 0,{headers:d(d({},h),this._headers)})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);c||(c=new this._webSocketConstructor(e)),t===w.Binary&&(c.binaryType="arraybuffer"),c.onopen=h=>{this._logger.log(i.Information,`WebSocket connected to ${e}.`),this._webSocket=c,a=!0,n()},c.onerror=h=>{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="There was an error with the transport",this._logger.log(i.Information,`(WebSockets transport) ${g}.`)},c.onmessage=h=>{if(this._logger.log(i.Trace,`(WebSockets transport) data received. ${x(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(g){this._close(g);return}},c.onclose=h=>{if(a)this._close(h);else{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",s(new Error(g))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(i.Trace,`(WebSockets transport) sending data. ${x(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(i.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}};var _e=100,ne=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,f.isRequired(e,"url"),this._logger=pe(t.logger),this.baseUrl=this._resolveUrl(e),t=t||{},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials=="boolean"||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.timeout=t.timeout===void 0?100*1e3:t.timeout;let o=null,n=null;if(_.isNode&&typeof H<"u"){let s=typeof __webpack_require__=="function"?__non_webpack_require__:H;o=s("ws"),n=s("eventsource")}!_.isNode&&typeof WebSocket<"u"&&!t.WebSocket?t.WebSocket=WebSocket:_.isNode&&!t.WebSocket&&o&&(t.WebSocket=o),!_.isNode&&typeof EventSource<"u"&&!t.EventSource?t.EventSource=EventSource:_.isNode&&!t.EventSource&&typeof n<"u"&&(t.EventSource=n),this._httpClient=new q(t.httpClient||new G(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}start(e){return u(this,null,function*(){if(e=e||w.Binary,f.isIn(e,w,"transferFormat"),this._logger.log(i.Debug,`Starting connection with transfer format '${w[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){let t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(i.Error,t),yield this._stopPromise,Promise.reject(new b(t))}else if(this._connectionState!=="Connected"){let t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(i.Error,t),Promise.reject(new b(t))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new se(this.transport)),this._sendQueue.send(e))}stop(e){return u(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(t=>{this._stopPromiseResolver=t}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return u(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch{}if(this.transport){try{yield this.transport.stop()}catch(t){this._logger.log(i.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(i.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return u(this,null,function*(){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===C.WebSockets)this.transport=this._constructTransport(C.WebSockets),yield this._startTransport(t,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let o=null,n=0;do{if(o=yield this._getNegotiationResponse(t),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new b("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(t=o.url),o.accessToken){let s=o.accessToken;this._accessTokenFactory=()=>s,this._httpClient._accessToken=s,this._httpClient._accessTokenFactory=void 0}n++}while(o.url&&n<_e);if(n===_e&&o.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(t,this._options.transport,o,e)}this.transport instanceof W&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(i.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(i.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}})}_getNegotiationResponse(e){return u(this,null,function*(){let t={},[o,n]=E();t[o]=n;let s=this._resolveNegotiateUrl(e);this._logger.log(i.Debug,`Sending negotiation request: ${s}.`);try{let c=yield this._httpClient.post(s,{content:"",headers:d(d({},t),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(c.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${c.statusCode}'`));let l=JSON.parse(c.content);return(!l.negotiateVersion||l.negotiateVersion<1)&&(l.connectionToken=l.connectionId),l}catch(c){let l="Failed to complete negotiation with the server: "+c;return c instanceof y&&c.statusCode===404&&(l=l+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(i.Error,l),Promise.reject(new F(l))}})}_createConnectUrl(e,t){return t?e+(e.indexOf("?")===-1?"?":"&")+`id=${t}`:e}_createTransport(e,t,o,n){return u(this,null,function*(){let s=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(t)){this._logger.log(i.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,yield this._startTransport(s,n),this.connectionId=o.connectionId;return}let c=[],l=o.availableTransports||[],a=o;for(let h of l){let g=this._resolveTransportOrError(h,t,n);if(g instanceof Error)c.push(`${h.transport} failed:`),c.push(g);else if(this._isITransport(g)){if(this.transport=g,!a){try{a=yield this._getNegotiationResponse(e)}catch(I){return Promise.reject(I)}s=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(s,n),this.connectionId=a.connectionId;return}catch(I){if(this._logger.log(i.Error,`Failed to start the transport '${h.transport}': ${I}`),a=void 0,c.push(new B(`${h.transport} failed: ${I}`,C[h.transport])),this._connectionState!=="Connecting"){let ce="Failed to select transport before stop() was called.";return this._logger.log(i.Debug,ce),Promise.reject(new b(ce))}}}}return c.length>0?Promise.reject(new z(`Unable to connect to the server with any of the available transports. ${c.join(" ")}`,c)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case C.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new oe(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case C.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new te(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case C.LongPolling:return new W(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(e,t)}_resolveTransportOrError(e,t,o){let n=C[e.transport];if(n==null)return this._logger.log(i.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(Ie(t,n))if(e.transferFormats.map(c=>w[c]).indexOf(o)>=0){if(n===C.WebSockets&&!this._options.WebSocket||n===C.ServerSentEvents&&!this._options.EventSource)return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it is not supported in your environment.'`),new j(`'${C[n]}' is not supported in your environment.`,n);this._logger.log(i.Debug,`Selecting transport '${C[n]}'.`);try{return this._constructTransport(n)}catch(c){return c}}else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it does not support the requested transfer format '${w[o]}'.`),new Error(`'${C[n]}' does not support ${w[o]}.`);else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it was disabled by the client.`),new O(`'${C[n]}' is disabled by the client.`,n)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(i.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(i.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(i.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(i.Error,`Connection disconnected with error '${e}'.`):this._logger.log(i.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(t=>{this._logger.log(i.Error,`TransportSendQueue.stop() threw error '${t}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(i.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!_.isBrowser)throw new Error(`Cannot resolve '${e}'.`);let t=window.document.createElement("a");return t.href=e,this._logger.log(i.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=e.indexOf("?"),o=e.substring(0,t===-1?e.length:t);return o[o.length-1]!=="/"&&(o+="/"),o+="negotiate",o+=t===-1?"":e.substring(t),o.indexOf("negotiateVersion")===-1&&(o+=t===-1?"?":"&",o+="negotiateVersion="+this._negotiateVersion),o}};function Ie(r,e){return!r||(e&r)!==0}var se=class r{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new N,this._transportResult=new N,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new N),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return u(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new N;let e=this._transportResult;this._transportResult=void 0;let t=typeof this._buffer[0]=="string"?this._buffer.join(""):r._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(t),e.resolve()}catch(o){e.reject(o)}}})}static _concatBuffers(e){let t=e.map(s=>s.byteLength).reduce((s,c)=>s+c),o=new Uint8Array(t),n=0;for(let s of e)o.set(new Uint8Array(s),n),n+=s.byteLength;return o.buffer}},N=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}};var Te="json",re=class{constructor(){this.name=Te,this.version=1,this.transferFormat=w.Text}parseMessages(e,t){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];t===null&&(t=k.instance);let o=S.parse(e),n=[];for(let s of o){let c=JSON.parse(s);if(typeof c.type!="number")throw new Error("Invalid payload.");switch(c.type){case p.Invocation:this._isInvocationMessage(c);break;case p.StreamItem:this._isStreamItemMessage(c);break;case p.Completion:this._isCompletionMessage(c);break;case p.Ping:break;case p.Close:break;default:t.log(i.Information,"Unknown message type '"+c.type+"' ignored.");continue}n.push(c)}return n}writeMessage(e){return S.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if(typeof e!="string"||e==="")throw new Error(t)}};var xe={trace:i.Trace,debug:i.Debug,info:i.Information,information:i.Information,warn:i.Warning,warning:i.Warning,error:i.Error,critical:i.Critical,none:i.None};function Pe(r){let e=xe[r.toLowerCase()];if(typeof e<"u")return e;throw new Error(`Unknown log level: ${r}`)}var M=class{configureLogging(e){if(f.isRequired(e,"logging"),De(e))this.logger=e;else if(typeof e=="string"){let t=Pe(e);this.logger=new D(t)}else this.logger=new D(e);return this}withUrl(e,t){return f.isRequired(e,"url"),f.isNotEmpty(e,"url"),this.url=e,typeof t=="object"?this.httpConnectionOptions=d(d({},this.httpConnectionOptions),t):this.httpConnectionOptions=R(d({},this.httpConnectionOptions),{transport:t}),this}withHubProtocol(e){return f.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new L(e):this.reconnectPolicy=e:this.reconnectPolicy=new L,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");let t=new ne(this.url,e);return Z.create(t,this.logger||k.instance,this.protocol||new re,this.reconnectPolicy)}};function De(r){return r.log!==void 0}var Eo=(()=>{let e=class e{constructor(o,n,s){this.decodeTokenService=o,this.toastr=n,this.httpService=s,this.initNotifications(),this.parseToken=this.decodeTokenService.getParseToken(),this.buildConnection()}initNotifications(){let o=JSON.parse(localStorage.getItem("Notifications"));this._notifications=new ae(o||[])}setNotification(o){let s=[...this._notifications.value,o];this.saveNotificationTotal(s),this._notifications.next(s)}saveNotificationTotal(o=[]){localStorage.setItem("Notifications",JSON.stringify(o))}getNotification(){return this._notifications.asObservable()}getNotificationDetail(o){return this.httpService.post("/api/notification/GetByID",{ID:o})}buildConnection(){this.hubConnection=new M().withUrl("/MarketplaceHub").withAutomaticReconnect().configureLogging(i.Information).build(),this.startConnection(),this.onConnectionClose(),this.subscribeNotification()}connectToRegister(){this.hubConnection.invoke("SubscribeGroup",this.parseToken.PID)}startConnection(){this.hubConnection.start().then(()=>{this.connectToRegister()}).catch(o=>console.log("Error while starting connection: "+o))}onConnectionClose(){this.hubConnection.onclose(()=>{this.buildConnection()})}subscribeNotification(){this.hubConnection.on("Notification",o=>{let n=JSON.parse(o);this.setNotification(n),n.ID==this.parseToken.PID&&(n.StatusCode!=200?this.toastr.error(n.Message,n.Title,{enableHtml:!0}):this.toastr.success(n.Message,n.Title,{enableHtml:!0}))})}clearNotification(){localStorage.removeItem("Notifications"),this._notifications.next([])}};e.\u0275fac=function(n){return new(n||e)(U(ue),U(he),U(ge))},e.\u0275prov=le({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{Eo as a};
1
+ import{a as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-6TL753XX.js";import{b as he,e as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-MU6WSNWI.js";import{$ as le,ca as U,d as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-WOVAE35N.js";import{a as d,b as R,c as H,h as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-CRNJ2Q5T.js";var y=class extends Error{constructor(e,t){let o=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=o}},T=class extends Error{constructor(e="A timeout occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},b=class extends Error{constructor(e="An abort occurred."){let t=new.target.prototype;super(e),this.__proto__=t}},j=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=o}},O=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=o}},B=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=o}},F=class extends Error{constructor(e){let t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}},z=class extends Error{constructor(e,t){let o=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=o}};var A=class{constructor(e,t,o){this.statusCode=e,this.statusText=t,this.content=o}},v=class{get(e,t){return this.send(R(d({},t),{method:"GET",url:e}))}post(e,t){return this.send(R(d({},t),{method:"POST",url:e}))}delete(e,t){return this.send(R(d({},t),{method:"DELETE",url:e}))}getCookieString(e){return""}};var i=function(r){return r[r.Trace=0]="Trace",r[r.Debug=1]="Debug",r[r.Information=2]="Information",r[r.Warning=3]="Warning",r[r.Error=4]="Error",r[r.Critical=5]="Critical",r[r.None=6]="None",r}(i||{});var k=class{constructor(){}log(e,t){}};k.instance=new k;var me="7.0.11",f=class{static isRequired(e,t){if(e==null)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,o){if(!(e in t))throw new Error(`Unknown ${o} value: ${e}.`)}},_=class{static get isBrowser(){return typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return typeof self=="object"&&"importScripts"in self}static get isReactNative(){return typeof window=="object"&&typeof window.document>"u"}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}};function x(r,e){let t="";return P(r)?(t=`Binary data of length ${r.byteLength}`,e&&(t+=`. Content: '${we(r)}'`)):typeof r=="string"&&(t=`String data of length ${r.length}`,e&&(t+=`. Content: '${r}'`)),t}function we(r){let e=new Uint8Array(r),t="";return e.forEach(o=>{let n=o<16?"0":"";t+=`0x${n}${o.toString(16)} `}),t.substr(0,t.length-1)}function P(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}function V(r,e,t,o,n,s){return u(this,null,function*(){let c={},[l,a]=E();c[l]=a,r.log(i.Trace,`(${e} transport) sending data. ${x(n,s.logMessageContent)}.`);let h=P(n)?"arraybuffer":"text",g=yield t.post(o,{content:n,headers:d(d({},c),s.headers),responseType:h,timeout:s.timeout,withCredentials:s.withCredentials});r.log(i.Trace,`(${e} transport) request complete. Response status: ${g.statusCode}.`)})}function pe(r){return r===void 0?new D(i.Information):r===null?k.instance:r.log!==void 0?r:new D(r)}var J=class{constructor(e,t){this._subject=e,this._observer=t}dispose(){let e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(t=>{})}},D=class{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){let o=`[${new Date().toISOString()}] ${i[e]}: ${t}`;switch(e){case i.Critical:case i.Error:this.out.error(o);break;case i.Warning:this.out.warn(o);break;case i.Information:this.out.info(o);break;default:this.out.log(o);break}}}};function E(){let r="X-SignalR-User-Agent";return _.isNode&&(r="User-Agent"),[r,be(me,Ce(),ye(),Se())]}function be(r,e,t,o){let n="Microsoft SignalR/",s=r.split(".");return n+=`${s[0]}.${s[1]}`,n+=` (${r}; `,e&&e!==""?n+=`${e}; `:n+="Unknown OS; ",n+=`${t}`,o?n+=`; ${o}`:n+="; Unknown Runtime Version",n+=")",n}function Ce(){if(_.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Se(){if(_.isNode)return process.versions.node}function ye(){return _.isNode?"NodeJS":"Browser"}function ie(r){return r.stack?r.stack:r.message?r.message:`${r}`}function de(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}var X=class extends v{constructor(e){if(super(),this._logger=e,typeof fetch>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._jar=new(t("tough-cookie")).CookieJar,this._fetchType=t("node-fetch"),this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(de());if(typeof AbortController>"u"){let t=typeof __webpack_require__=="function"?__non_webpack_require__:H;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}send(e){return u(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new b;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");let t=new this._abortControllerType,o;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),o=new b});let n=null;if(e.timeout){let a=e.timeout;n=setTimeout(()=>{t.abort(),this._logger.log(i.Warning,"Timeout from HTTP request."),o=new T},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},P(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let s;try{s=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:d({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(a){throw o||(this._logger.log(i.Warning,`Error from HTTP request. ${a}.`),a)}finally{n&&clearTimeout(n),e.abortSignal&&(e.abortSignal.onabort=null)}if(!s.ok){let a=yield fe(s,"text");throw new y(a||s.statusText,s.status)}let l=yield fe(s,e.responseType);return new A(s.status,s.statusText,l)})}getCookieString(e){let t="";return _.isNode&&this._jar&&this._jar.getCookies(e,(o,n)=>t=n.join("; ")),t}};function fe(r,e){let t;switch(e){case"arraybuffer":t=r.arrayBuffer();break;case"text":t=r.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:t=r.text();break}return t}var K=class extends v{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?new Promise((t,o)=>{let n=new XMLHttpRequest;n.open(e.method,e.url,!0),n.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,n.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(P(e.content)?n.setRequestHeader("Content-Type","application/octet-stream"):n.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));let s=e.headers;s&&Object.keys(s).forEach(c=>{n.setRequestHeader(c,s[c])}),e.responseType&&(n.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o(new b)}),e.timeout&&(n.timeout=e.timeout),n.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),n.status>=200&&n.status<300?t(new A(n.status,n.statusText,n.response||n.responseText)):o(new y(n.response||n.responseText||n.statusText,n.status))},n.onerror=()=>{this._logger.log(i.Warning,`Error from HTTP request. ${n.status}: ${n.statusText}.`),o(new y(n.statusText,n.status))},n.ontimeout=()=>{this._logger.log(i.Warning,"Timeout from HTTP request."),o(new T)},n.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}};var G=class extends v{constructor(e){if(super(),typeof fetch<"u"||_.isNode)this._httpClient=new X(e);else if(typeof XMLHttpRequest<"u")this._httpClient=new K(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new b):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}};var S=class r{static write(e){return`${e}${r.RecordSeparator}`}static parse(e){if(e[e.length-1]!==r.RecordSeparator)throw new Error("Message is incomplete.");let t=e.split(r.RecordSeparator);return t.pop(),t}};S.RecordSeparatorCode=30;S.RecordSeparator=String.fromCharCode(S.RecordSeparatorCode);var Y=class{writeHandshakeRequest(e){return S.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,o;if(P(e)){let l=new Uint8Array(e),a=l.indexOf(S.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(l.slice(0,h))),o=l.byteLength>h?l.slice(h).buffer:null}else{let l=e,a=l.indexOf(S.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");let h=a+1;t=l.substring(0,h),o=l.length>h?l.substring(h):null}let n=S.parse(t),s=JSON.parse(n[0]);if(s.type)throw new Error("Expected a handshake response from the server.");return[o,s]}};var p=function(r){return r[r.Invocation=1]="Invocation",r[r.StreamItem=2]="StreamItem",r[r.Completion=3]="Completion",r[r.StreamInvocation=4]="StreamInvocation",r[r.CancelInvocation=5]="CancelInvocation",r[r.Ping=6]="Ping",r[r.Close=7]="Close",r}(p||{});var Q=class{constructor(){this.observers=[]}next(e){for(let t of this.observers)t.next(e)}error(e){for(let t of this.observers)t.error&&t.error(e)}complete(){for(let e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new J(this,e)}};var ve=30*1e3,ke=15*1e3,m=function(r){return r.Disconnected="Disconnected",r.Connecting="Connecting",r.Connected="Connected",r.Disconnecting="Disconnecting",r.Reconnecting="Reconnecting",r}(m||{}),Z=class r{constructor(e,t,o,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(i.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},f.isRequired(e,"connection"),f.isRequired(t,"logger"),f.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=ve,this.keepAliveIntervalInMilliseconds=ke,this._logger=t,this._protocol=o,this.connection=e,this._reconnectPolicy=n,this._handshakeProtocol=new Y,this.connection.onreceive=s=>this._processIncomingData(s),this.connection.onclose=s=>this._connectionClosed(s),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=m.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:p.Ping})}static create(e,t,o,n){return new r(e,t,o,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==m.Disconnected&&this._connectionState!==m.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return u(this,null,function*(){if(this._connectionState!==m.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=m.Connecting,this._logger.log(i.Debug,"Starting HubConnection.");try{yield this._startInternal(),_.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=m.Connected,this._connectionStarted=!0,this._logger.log(i.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=m.Disconnected,this._logger.log(i.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return u(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;let e=new Promise((t,o)=>{this._handshakeResolver=t,this._handshakeRejecter=o});yield this.connection.start(this._protocol.transferFormat);try{let t={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(i.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(t)),this._logger.log(i.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(t){throw this._logger.log(i.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(t),t}})}stop(){return u(this,null,function*(){let e=this._startPromise;this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch{}})}_stopInternal(e){return this._connectionState===m.Disconnected?(this._logger.log(i.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===m.Disconnecting?(this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=m.Disconnecting,this._logger.log(i.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(i.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new b("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))}stream(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createStreamInvocation(e,t,n),c,l=new Q;return l.cancelCallback=()=>{let a=this._createCancelInvocation(s.invocationId);return delete this._callbacks[s.invocationId],c.then(()=>this._sendWithProtocol(a))},this._callbacks[s.invocationId]=(a,h)=>{if(h){l.error(h);return}else a&&(a.type===p.Completion?a.error?l.error(new Error(a.error)):l.complete():l.next(a.item))},c=this._sendWithProtocol(s).catch(a=>{l.error(a),delete this._callbacks[s.invocationId]}),this._launchStreams(o,c),l}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._sendWithProtocol(this._createInvocation(e,t,!0,n));return this._launchStreams(o,s),s}invoke(e,...t){let[o,n]=this._replaceStreamingParams(t),s=this._createInvocation(e,t,!1,n);return new Promise((l,a)=>{this._callbacks[s.invocationId]=(g,I)=>{if(I){a(I);return}else g&&(g.type===p.Completion?g.error?a(new Error(g.error)):l(g.result):a(new Error(`Unexpected message type: ${g.type}`)))};let h=this._sendWithProtocol(s).catch(g=>{a(g),delete this._callbacks[s.invocationId]});this._launchStreams(o,h)})}on(e,t){!e||!t||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();let o=this._methods[e];if(o)if(t){let n=o.indexOf(t);n!==-1&&(o.splice(n,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){let t=this._protocol.parseMessages(e,this._logger);for(let o of t)switch(o.type){case p.Invocation:this._invokeClientMethod(o);break;case p.StreamItem:case p.Completion:{let n=this._callbacks[o.invocationId];if(n){o.type===p.Completion&&delete this._callbacks[o.invocationId];try{n(o)}catch(s){this._logger.log(i.Error,`Stream callback threw error: ${ie(s)}`)}}break}case p.Ping:break;case p.Close:{this._logger.log(i.Information,"Close message received from server.");let n=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(n):this._stopPromise=this._stopInternal(n);break}default:this._logger.log(i.Warning,`Invalid message type: ${o.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,o;try{[o,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(n){let s="Error parsing handshake response: "+n;this._logger.log(i.Error,s);let c=new Error(s);throw this._handshakeRejecter(c),c}if(t.error){let n="Server returned handshake error: "+t.error;this._logger.log(i.Error,n);let s=new Error(n);throw this._handshakeRejecter(s),s}else this._logger.log(i.Debug,"Server handshake complete.");return this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>u(this,null,function*(){if(this._connectionState===m.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return u(this,null,function*(){let t=e.target.toLowerCase(),o=this._methods[t];if(!o){this._logger.log(i.Warning,`No client method with the name '${t}' found.`),e.invocationId&&(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}let n=o.slice(),s=!!e.invocationId,c,l,a;for(let h of n)try{let g=c;c=yield h.apply(this,e.arguments),s&&c&&g&&(this._logger.log(i.Error,`Multiple results provided for '${t}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),l=void 0}catch(g){l=g,this._logger.log(i.Error,`A callback for the method '${t}' threw error '${g}'.`)}a?yield this._sendWithProtocol(a):s?(l?a=this._createCompletionMessage(e.invocationId,`${l}`,null):c!==void 0?a=this._createCompletionMessage(e.invocationId,null,c):(this._logger.log(i.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):c&&this._logger.log(i.Error,`Result given for '${t}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(i.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new b("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===m.Disconnecting?this._completeClose(e):this._connectionState===m.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===m.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=m.Disconnected,this._connectionStarted=!1,_.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(i.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}_reconnect(e){return u(this,null,function*(){let t=Date.now(),o=0,n=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),s=this._getNextRetryDelay(o++,0,n);if(s===null){this._logger.log(i.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=m.Reconnecting,e?this._logger.log(i.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(i.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(c=>c.apply(this,[e]))}catch(c){this._logger.log(i.Error,`An onreconnecting callback called with error '${e}' threw error '${c}'.`)}if(this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;s!==null;){if(this._logger.log(i.Information,`Reconnect attempt number ${o} will start in ${s} ms.`),yield new Promise(c=>{this._reconnectDelayHandle=setTimeout(c,s)}),this._reconnectDelayHandle=void 0,this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=m.Connected,this._logger.log(i.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(c=>c.apply(this,[this.connection.connectionId]))}catch(c){this._logger.log(i.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${c}'.`)}return}catch(c){if(this._logger.log(i.Information,`Reconnect attempt failed because of error '${c}'.`),this._connectionState!==m.Reconnecting){this._logger.log(i.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===m.Disconnecting&&this._completeClose();return}n=c instanceof Error?c:new Error(c.toString()),s=this._getNextRetryDelay(o++,Date.now()-t,n)}}this._logger.log(i.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,t,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:o})}catch(n){return this._logger.log(i.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${n}'.`),null}}_cancelCallbacksWithError(e){let t=this._callbacks;this._callbacks={},Object.keys(t).forEach(o=>{let n=t[o];try{n(null,e)}catch(s){this._logger.log(i.Error,`Stream 'error' callback called with '${e}' threw error: ${ie(s)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,o,n){if(o)return n.length!==0?{arguments:t,streamIds:n,target:e,type:p.Invocation}:{arguments:t,target:e,type:p.Invocation};{let s=this._invocationId;return this._invocationId++,n.length!==0?{arguments:t,invocationId:s.toString(),streamIds:n,target:e,type:p.Invocation}:{arguments:t,invocationId:s.toString(),target:e,type:p.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||(t=Promise.resolve());for(let o in e)e[o].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:n=>{let s;n instanceof Error?s=n.message:n&&n.toString?s=n.toString():s="Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,s)))},next:n=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,n)))}})}}_replaceStreamingParams(e){let t=[],o=[];for(let n=0;n<e.length;n++){let s=e[n];if(this._isObservable(s)){let c=this._invocationId;this._invocationId++,t[c]=s,o.push(c.toString()),e.splice(n,1)}}return[t,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,t,o){let n=this._invocationId;return this._invocationId++,o.length!==0?{arguments:t,invocationId:n.toString(),streamIds:o,target:e,type:p.StreamInvocation}:{arguments:t,invocationId:n.toString(),target:e,type:p.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:p.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:p.StreamItem}}_createCompletionMessage(e,t,o){return t?{error:t,invocationId:e,type:p.Completion}:{invocationId:e,result:o,type:p.Completion}}};var Ee=[0,2e3,1e4,3e4,null],L=class{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Ee}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}};var $=(()=>{class r{}return r.Authorization="Authorization",r.Cookie="Cookie",r})();var q=class extends v{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}send(e){return u(this,null,function*(){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);let o=yield this._innerClient.send(e);return t&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):o})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[$.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[$.Authorization]&&delete e.headers[$.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}};var C=function(r){return r[r.None=0]="None",r[r.WebSockets=1]="WebSockets",r[r.ServerSentEvents=2]="ServerSentEvents",r[r.LongPolling=4]="LongPolling",r}(C||{}),w=function(r){return r[r.Text=1]="Text",r[r.Binary=2]="Binary",r}(w||{});var ee=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};var W=class{constructor(e,t,o){this._httpClient=e,this._logger=t,this._pollAbort=new ee,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}connect(e,t){return u(this,null,function*(){if(f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._url=e,this._logger.log(i.Trace,"(LongPolling transport) Connecting."),t===w.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");let[o,n]=E(),s=d({[o]:n},this._options.headers),c={abortSignal:this._pollAbort.signal,headers:s,timeout:1e5,withCredentials:this._options.withCredentials};t===w.Binary&&(c.responseType="arraybuffer");let l=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${l}.`);let a=yield this._httpClient.get(l,c);a.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new y(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,c)})}_poll(e,t){return u(this,null,function*(){try{for(;this._running;)try{let o=`${e}&_=${Date.now()}`;this._logger.log(i.Trace,`(LongPolling transport) polling: ${o}.`);let n=yield this._httpClient.get(o,t);n.statusCode===204?(this._logger.log(i.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):n.statusCode!==200?(this._logger.log(i.Error,`(LongPolling transport) Unexpected response code: ${n.statusCode}.`),this._closeError=new y(n.statusText||"",n.statusCode),this._running=!1):n.content?(this._logger.log(i.Trace,`(LongPolling transport) data received. ${x(n.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(n.content)):this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof T?this._logger.log(i.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(i.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(i.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return u(this,null,function*(){return this._running?V(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return u(this,null,function*(){this._logger.log(i.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(i.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);let e={},[t,o]=E();e[t]=o;let n={headers:d(d({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};yield this._httpClient.delete(this._url,n),this._logger.log(i.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(i.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(i.Trace,e),this.onclose(this._closeError)}}};var te=class{constructor(e,t,o,n){this._httpClient=e,this._accessToken=t,this._logger=o,this._options=n,this.onreceive=null,this.onclose=null}connect(e,t){return u(this,null,function*(){return f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,n)=>{let s=!1;if(t!==w.Text){n(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let c;if(_.isBrowser||_.isWebWorker)c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{let l=this._httpClient.getCookieString(e),a={};a.Cookie=l;let[h,g]=E();a[h]=g,c=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:d(d({},a),this._options.headers)})}try{c.onmessage=l=>{if(this.onreceive)try{this._logger.log(i.Trace,`(SSE transport) data received. ${x(l.data,this._options.logMessageContent)}.`),this.onreceive(l.data)}catch(a){this._close(a);return}},c.onerror=l=>{s?this._close():n(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},c.onopen=()=>{this._logger.log(i.Information,`SSE connected to ${this._url}`),this._eventSource=c,s=!0,o()}}catch(l){n(l);return}})})}send(e){return u(this,null,function*(){return this._eventSource?V(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}};var oe=class{constructor(e,t,o,n,s,c){this._logger=o,this._accessTokenFactory=t,this._logMessageContent=n,this._webSocketConstructor=s,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=c}connect(e,t){return u(this,null,function*(){f.isRequired(e,"url"),f.isRequired(t,"transferFormat"),f.isIn(t,w,"transferFormat"),this._logger.log(i.Trace,"(WebSockets transport) Connecting.");let o;return this._accessTokenFactory&&(o=yield this._accessTokenFactory()),new Promise((n,s)=>{e=e.replace(/^http/,"ws");let c,l=this._httpClient.getCookieString(e),a=!1;if(_.isNode||_.isReactNative){let h={},[g,I]=E();h[g]=I,o&&(h[$.Authorization]=`Bearer ${o}`),l&&(h[$.Cookie]=l),c=new this._webSocketConstructor(e,void 0,{headers:d(d({},h),this._headers)})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);c||(c=new this._webSocketConstructor(e)),t===w.Binary&&(c.binaryType="arraybuffer"),c.onopen=h=>{this._logger.log(i.Information,`WebSocket connected to ${e}.`),this._webSocket=c,a=!0,n()},c.onerror=h=>{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="There was an error with the transport",this._logger.log(i.Information,`(WebSockets transport) ${g}.`)},c.onmessage=h=>{if(this._logger.log(i.Trace,`(WebSockets transport) data received. ${x(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(g){this._close(g);return}},c.onclose=h=>{if(a)this._close(h);else{let g=null;typeof ErrorEvent<"u"&&h instanceof ErrorEvent?g=h.error:g="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",s(new Error(g))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(i.Trace,`(WebSockets transport) sending data. ${x(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(i.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}};var _e=100,ne=class{constructor(e,t={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,f.isRequired(e,"url"),this._logger=pe(t.logger),this.baseUrl=this._resolveUrl(e),t=t||{},t.logMessageContent=t.logMessageContent===void 0?!1:t.logMessageContent,typeof t.withCredentials=="boolean"||t.withCredentials===void 0)t.withCredentials=t.withCredentials===void 0?!0:t.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.timeout=t.timeout===void 0?100*1e3:t.timeout;let o=null,n=null;if(_.isNode&&typeof H<"u"){let s=typeof __webpack_require__=="function"?__non_webpack_require__:H;o=s("ws"),n=s("eventsource")}!_.isNode&&typeof WebSocket<"u"&&!t.WebSocket?t.WebSocket=WebSocket:_.isNode&&!t.WebSocket&&o&&(t.WebSocket=o),!_.isNode&&typeof EventSource<"u"&&!t.EventSource?t.EventSource=EventSource:_.isNode&&!t.EventSource&&typeof n<"u"&&(t.EventSource=n),this._httpClient=new q(t.httpClient||new G(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}start(e){return u(this,null,function*(){if(e=e||w.Binary,f.isIn(e,w,"transferFormat"),this._logger.log(i.Debug,`Starting connection with transfer format '${w[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){let t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(i.Error,t),yield this._stopPromise,Promise.reject(new b(t))}else if(this._connectionState!=="Connected"){let t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(i.Error,t),Promise.reject(new b(t))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new se(this.transport)),this._sendQueue.send(e))}stop(e){return u(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(i.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(t=>{this._stopPromiseResolver=t}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return u(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch{}if(this.transport){try{yield this.transport.stop()}catch(t){this._logger.log(i.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(i.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return u(this,null,function*(){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===C.WebSockets)this.transport=this._constructTransport(C.WebSockets),yield this._startTransport(t,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let o=null,n=0;do{if(o=yield this._getNegotiationResponse(t),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new b("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(t=o.url),o.accessToken){let s=o.accessToken;this._accessTokenFactory=()=>s,this._httpClient._accessToken=s,this._httpClient._accessTokenFactory=void 0}n++}while(o.url&&n<_e);if(n===_e&&o.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(t,this._options.transport,o,e)}this.transport instanceof W&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(i.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(i.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}})}_getNegotiationResponse(e){return u(this,null,function*(){let t={},[o,n]=E();t[o]=n;let s=this._resolveNegotiateUrl(e);this._logger.log(i.Debug,`Sending negotiation request: ${s}.`);try{let c=yield this._httpClient.post(s,{content:"",headers:d(d({},t),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(c.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${c.statusCode}'`));let l=JSON.parse(c.content);return(!l.negotiateVersion||l.negotiateVersion<1)&&(l.connectionToken=l.connectionId),l}catch(c){let l="Failed to complete negotiation with the server: "+c;return c instanceof y&&c.statusCode===404&&(l=l+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(i.Error,l),Promise.reject(new F(l))}})}_createConnectUrl(e,t){return t?e+(e.indexOf("?")===-1?"?":"&")+`id=${t}`:e}_createTransport(e,t,o,n){return u(this,null,function*(){let s=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(t)){this._logger.log(i.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,yield this._startTransport(s,n),this.connectionId=o.connectionId;return}let c=[],l=o.availableTransports||[],a=o;for(let h of l){let g=this._resolveTransportOrError(h,t,n);if(g instanceof Error)c.push(`${h.transport} failed:`),c.push(g);else if(this._isITransport(g)){if(this.transport=g,!a){try{a=yield this._getNegotiationResponse(e)}catch(I){return Promise.reject(I)}s=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(s,n),this.connectionId=a.connectionId;return}catch(I){if(this._logger.log(i.Error,`Failed to start the transport '${h.transport}': ${I}`),a=void 0,c.push(new B(`${h.transport} failed: ${I}`,C[h.transport])),this._connectionState!=="Connecting"){let ce="Failed to select transport before stop() was called.";return this._logger.log(i.Debug,ce),Promise.reject(new b(ce))}}}}return c.length>0?Promise.reject(new z(`Unable to connect to the server with any of the available transports. ${c.join(" ")}`,c)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case C.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new oe(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case C.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new te(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case C.LongPolling:return new W(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(e,t)}_resolveTransportOrError(e,t,o){let n=C[e.transport];if(n==null)return this._logger.log(i.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(Ie(t,n))if(e.transferFormats.map(c=>w[c]).indexOf(o)>=0){if(n===C.WebSockets&&!this._options.WebSocket||n===C.ServerSentEvents&&!this._options.EventSource)return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it is not supported in your environment.'`),new j(`'${C[n]}' is not supported in your environment.`,n);this._logger.log(i.Debug,`Selecting transport '${C[n]}'.`);try{return this._constructTransport(n)}catch(c){return c}}else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it does not support the requested transfer format '${w[o]}'.`),new Error(`'${C[n]}' does not support ${w[o]}.`);else return this._logger.log(i.Debug,`Skipping transport '${C[n]}' because it was disabled by the client.`),new O(`'${C[n]}' is disabled by the client.`,n)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(i.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(i.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(i.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(i.Error,`Connection disconnected with error '${e}'.`):this._logger.log(i.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(t=>{this._logger.log(i.Error,`TransportSendQueue.stop() threw error '${t}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(i.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!_.isBrowser)throw new Error(`Cannot resolve '${e}'.`);let t=window.document.createElement("a");return t.href=e,this._logger.log(i.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){let t=e.indexOf("?"),o=e.substring(0,t===-1?e.length:t);return o[o.length-1]!=="/"&&(o+="/"),o+="negotiate",o+=t===-1?"":e.substring(t),o.indexOf("negotiateVersion")===-1&&(o+=t===-1?"?":"&",o+="negotiateVersion="+this._negotiateVersion),o}};function Ie(r,e){return!r||(e&r)!==0}var se=class r{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new N,this._transportResult=new N,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new N),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return u(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new N;let e=this._transportResult;this._transportResult=void 0;let t=typeof this._buffer[0]=="string"?this._buffer.join(""):r._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(t),e.resolve()}catch(o){e.reject(o)}}})}static _concatBuffers(e){let t=e.map(s=>s.byteLength).reduce((s,c)=>s+c),o=new Uint8Array(t),n=0;for(let s of e)o.set(new Uint8Array(s),n),n+=s.byteLength;return o.buffer}},N=class{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}};var Te="json",re=class{constructor(){this.name=Te,this.version=1,this.transferFormat=w.Text}parseMessages(e,t){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];t===null&&(t=k.instance);let o=S.parse(e),n=[];for(let s of o){let c=JSON.parse(s);if(typeof c.type!="number")throw new Error("Invalid payload.");switch(c.type){case p.Invocation:this._isInvocationMessage(c);break;case p.StreamItem:this._isStreamItemMessage(c);break;case p.Completion:this._isCompletionMessage(c);break;case p.Ping:break;case p.Close:break;default:t.log(i.Information,"Unknown message type '"+c.type+"' ignored.");continue}n.push(c)}return n}writeMessage(e){return S.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(e,t){if(typeof e!="string"||e==="")throw new Error(t)}};var xe={trace:i.Trace,debug:i.Debug,info:i.Information,information:i.Information,warn:i.Warning,warning:i.Warning,error:i.Error,critical:i.Critical,none:i.None};function Pe(r){let e=xe[r.toLowerCase()];if(typeof e<"u")return e;throw new Error(`Unknown log level: ${r}`)}var M=class{configureLogging(e){if(f.isRequired(e,"logging"),De(e))this.logger=e;else if(typeof e=="string"){let t=Pe(e);this.logger=new D(t)}else this.logger=new D(e);return this}withUrl(e,t){return f.isRequired(e,"url"),f.isNotEmpty(e,"url"),this.url=e,typeof t=="object"?this.httpConnectionOptions=d(d({},this.httpConnectionOptions),t):this.httpConnectionOptions=R(d({},this.httpConnectionOptions),{transport:t}),this}withHubProtocol(e){return f.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new L(e):this.reconnectPolicy=e:this.reconnectPolicy=new L,this}build(){let e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");let t=new ne(this.url,e);return Z.create(t,this.logger||k.instance,this.protocol||new re,this.reconnectPolicy)}};function De(r){return r.log!==void 0}var Eo=(()=>{let e=class e{constructor(o,n,s){this.decodeTokenService=o,this.toastr=n,this.httpService=s,this.initNotifications(),this.parseToken=this.decodeTokenService.getParseToken(),this.buildConnection()}initNotifications(){let o=JSON.parse(localStorage.getItem("Notifications"));this._notifications=new ae(o||[])}setNotification(o){let s=[...this._notifications.value,o];this.saveNotificationTotal(s),this._notifications.next(s)}saveNotificationTotal(o=[]){localStorage.setItem("Notifications",JSON.stringify(o))}getNotification(){return this._notifications.asObservable()}getNotificationDetail(o){return this.httpService.post("/api/notification/GetByID",{ID:o})}buildConnection(){this.hubConnection=new M().withUrl("/MarketplaceHub").withAutomaticReconnect().configureLogging(i.Information).build(),this.startConnection(),this.onConnectionClose(),this.subscribeNotification()}connectToRegister(){this.hubConnection.invoke("SubscribeGroup",this.parseToken.PID)}startConnection(){this.hubConnection.start().then(()=>{this.connectToRegister()}).catch(o=>console.log("Error while starting connection: "+o))}onConnectionClose(){this.hubConnection.onclose(()=>{this.buildConnection()})}subscribeNotification(){this.hubConnection.on("Notification",o=>{let n=JSON.parse(o);this.setNotification(n),n.ID==this.parseToken.PID&&(n.StatusCode!=200?this.toastr.error(n.Message,n.Title,{enableHtml:!0}):this.toastr.success(n.Message,n.Title,{enableHtml:!0}))})}clearNotification(){localStorage.removeItem("Notifications"),this._notifications.next([])}};e.\u0275fac=function(n){return new(n||e)(U(ue),U(he),U(ge))},e.\u0275prov=le({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{Eo as a};
@@ -1 +1 @@
1
- import{b as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-BGUJV6DT.js";import{f as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-LEMN4XNC.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-ITJHNS2G.js";import{b as k,e as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-TPI2XS3B.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-6HKBE32M.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-LDC42S7G.js";import{c as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-W56FKJF2.js";import{a as G,c as W,d as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-Q443OERQ.js";import{B as X,C as Y,q as J,r as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-WOWVP6FH.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-C6SX7URU.js";import{h as $,k as H,u as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-JS5XLOTQ.js";import{b,c as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-TIT4WYYC.js";import{$a as E,$b as K,Db as U,Eb as F,Fa as c,Ga as g,Mc as v,Oa as m,Q as L,Ua as f,X as y,Za as o,_a as a,_b as j,aa as d,ab as O,bb as w,cc as V,db as D,ea as N,fa as h,gc as C,hb as p,ja as x,jb as u,ka as T,pb as s,q as M,qb as S,rb as P,za as I}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-D4SY4NN2.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-TOSWRZLL.js";function re(n,t){if(n&1&&(o(0,"span",13),E(1,"img",14),a(),o(2,"span"),s(3),a()),n&2){let l=t.item;c(1),m("src",l.logo,I),c(2),P(" ",l.Name," ")}}function ae(n,t){if(n&1){let l=D();O(0),o(1,"ng-select",16),p("ngModelChange",function(i){x(l);let r=u().$implicit;return T(r.ProductSKU=i)}),a(),w()}if(n&2){let l=t.ngIf,e=u().$implicit;c(1),m("ngModel",e.ProductSKU)("items",l)}}function se(n,t){if(n&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),f(8,ae,2,2,"ng-container",15),U(9,"async"),a()()),n&2){let l=t.$implicit,e=u();c(2),S(l.Name),c(2),S(l.Service),c(2),S(l.TypeString),c(2),m("ngIf",F(9,4,e.logisticOptions$))}}var ie=(()=>{let t=class t{constructor(e,i,r){this.http=e,this.toastr=i,this.authService=r,this.filter={ChannelID:""},this.logisticServiceOptions=[],this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let e=[b.WooCommerce,b.Lazada,b.Shopify];this.channelOptions=this.channelOptions.map(i=>(e.forEach(r=>{i.TypeID===r&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(e=>{this.filter=e.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(L(1),y(e=>{this.logisticServiceOptions=e}))}Validate(){for(let e of this.logisticServices)this.datasource.find(r=>r.ProductSKU==e.ProductSKU&&r.Name==e.Name)===void 0&&(e.IsChange=!0);return Promise.resolve(this.logisticServices)}submitLogistics(){this.Validate().then(e=>{this.http.post("/api/Logistic/Submit",this.logisticServices).subscribe(i=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.getLogisticService()})})}getLogisticService(){this.datasource=[],this.http.post("/api/Logistic/Get",this.filter).pipe(M(e=>e.map(i=>(i.ProductSKU=B.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i)))).subscribe(e=>{this.iniTitle(),this.logisticServices=e,this.datasource=structuredClone(e)})}iniTitle(){let e=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=e?e.Name:null}};t.\u0275fac=function(i){return new(i||t)(g(R),g(k),g(z))},t.\u0275cmp=N({type:t,selectors:[["app-logistic"]],decls:28,vars:6,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"headerTitle","hideSearchDropdown","onSubmit"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModel","items","ngModelChange"]],template:function(i,r){i&1&&(o(0,"mainpanel",0),p("onSubmit",function(){return r.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",1),s(4,"Select a Channel"),a(),o(5,"ng-select",2),p("ngModelChange",function(oe){return r.filter.ChannelID=oe}),f(6,re,4,2,"ng-template",3),a()()(),o(7,"actions")(8,"a",4),p("click",function(){return r.submitLogistics()}),s(9,"Submit"),a()(),o(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),s(19,"Logistic"),a(),o(20,"th"),s(21,"Service"),a(),o(22,"th"),s(23,"Type"),a(),o(24,"th"),s(25,"Logistic Service"),a()()(),o(26,"tbody"),f(27,se,10,6,"tr",12),a()()()()()()()()),i&2&&(m("headerTitle","Logistic Courier - "+r.channelName)("hideSearchDropdown",!1),c(5),m("clearable",!1)("items",r.channelOptions)("ngModel",r.filter.ChannelID),c(22),m("ngForOf",r.logisticServices))},dependencies:[j,K,$,H,X,W,G,J,V]});let n=t;return n})();var le=[{path:"",component:ie}],ne=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=h({type:t}),t.\u0275inj=d({imports:[C,v.forChild(le)]});let n=t;return n})();var je=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=h({type:t}),t.\u0275inj=d({imports:[C,v,ne,A,Y,q,ee,Z,Q]});let n=t;return n})();export{je as LogisticModule};
1
+ import{b as ee}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-RB4PODHN.js";import{f as z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-YWSTU35G.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-6TL753XX.js";import{b as k,e as R}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-MU6WSNWI.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-3MUKJETU.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-OHUTMYI3.js";import{c as Z}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-DR77LMQ5.js";import{a as G,c as W,d as q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-WDVFAXEE.js";import{B as X,C as Y,q as J,r as Q}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-MSDWP3Z5.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-K2D3HYO3.js";import{h as $,k as H,u as A}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-ZKFCU6QY.js";import{b,c as B}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-PXXT4AMP.js";import{$a as E,$b as K,Db as U,Eb as F,Fa as c,Ga as g,Mc as v,Oa as m,Q as L,Ua as f,X as y,Za as o,_a as a,_b as j,aa as d,ab as O,bb as w,cc as V,db as D,ea as N,fa as h,gc as C,hb as p,ja as x,jb as u,ka as T,pb as s,q as M,qb as S,rb as P,za as I}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-WOVAE35N.js";import"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-CRNJ2Q5T.js";function re(n,t){if(n&1&&(o(0,"span",13),E(1,"img",14),a(),o(2,"span"),s(3),a()),n&2){let l=t.item;c(1),m("src",l.logo,I),c(2),P(" ",l.Name," ")}}function ae(n,t){if(n&1){let l=D();O(0),o(1,"ng-select",16),p("ngModelChange",function(i){x(l);let r=u().$implicit;return T(r.ProductSKU=i)}),a(),w()}if(n&2){let l=t.ngIf,e=u().$implicit;c(1),m("ngModel",e.ProductSKU)("items",l)}}function se(n,t){if(n&1&&(o(0,"tr")(1,"td"),s(2),a(),o(3,"td"),s(4),a(),o(5,"td"),s(6),a(),o(7,"td"),f(8,ae,2,2,"ng-container",15),U(9,"async"),a()()),n&2){let l=t.$implicit,e=u();c(2),S(l.Name),c(2),S(l.Service),c(2),S(l.TypeString),c(2),m("ngIf",F(9,4,e.logisticOptions$))}}var ie=(()=>{let t=class t{constructor(e,i,r){this.http=e,this.toastr=i,this.authService=r,this.filter={ChannelID:""},this.logisticServiceOptions=[],this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let e=[b.WooCommerce,b.Lazada,b.Shopify];this.channelOptions=this.channelOptions.map(i=>(e.forEach(r=>{i.TypeID===r&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(e=>{this.filter=e.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(L(1),y(e=>{this.logisticServiceOptions=e}))}Validate(){for(let e of this.logisticServices)this.datasource.find(r=>r.ProductSKU==e.ProductSKU&&r.Name==e.Name)===void 0&&(e.IsChange=!0);return Promise.resolve(this.logisticServices)}submitLogistics(){this.Validate().then(e=>{this.http.post("/api/Logistic/Submit",this.logisticServices).subscribe(i=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.getLogisticService()})})}getLogisticService(){this.datasource=[],this.http.post("/api/Logistic/Get",this.filter).pipe(M(e=>e.map(i=>(i.ProductSKU=B.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i)))).subscribe(e=>{this.iniTitle(),this.logisticServices=e,this.datasource=structuredClone(e)})}iniTitle(){let e=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=e?e.Name:null}};t.\u0275fac=function(i){return new(i||t)(g(R),g(k),g(z))},t.\u0275cmp=N({type:t,selectors:[["app-logistic"]],decls:28,vars:6,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"headerTitle","hideSearchDropdown","onSubmit"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModel","items","ngModelChange"]],template:function(i,r){i&1&&(o(0,"mainpanel",0),p("onSubmit",function(){return r.getLogisticService()}),o(1,"filters")(2,"div")(3,"label",1),s(4,"Select a Channel"),a(),o(5,"ng-select",2),p("ngModelChange",function(oe){return r.filter.ChannelID=oe}),f(6,re,4,2,"ng-template",3),a()()(),o(7,"actions")(8,"a",4),p("click",function(){return r.submitLogistics()}),s(9,"Submit"),a()(),o(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),s(19,"Logistic"),a(),o(20,"th"),s(21,"Service"),a(),o(22,"th"),s(23,"Type"),a(),o(24,"th"),s(25,"Logistic Service"),a()()(),o(26,"tbody"),f(27,se,10,6,"tr",12),a()()()()()()()()),i&2&&(m("headerTitle","Logistic Courier - "+r.channelName)("hideSearchDropdown",!1),c(5),m("clearable",!1)("items",r.channelOptions)("ngModel",r.filter.ChannelID),c(22),m("ngForOf",r.logisticServices))},dependencies:[j,K,$,H,X,W,G,J,V]});let n=t;return n})();var le=[{path:"",component:ie}],ne=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=h({type:t}),t.\u0275inj=d({imports:[C,v.forChild(le)]});let n=t;return n})();var je=(()=>{let t=class t{};t.\u0275fac=function(i){return new(i||t)},t.\u0275mod=h({type:t}),t.\u0275inj=d({imports:[C,v,ne,A,Y,q,ee,Z,Q]});let n=t;return n})();export{je as LogisticModule};
@@ -1,4 +1,4 @@
1
- import{a as cr,b as dr,e as js,g as re,h as a,i as it}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.0/Marketplace/chunk-TOSWRZLL.js";var ur=function(n){let e=[],t=0;for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);r<128?e[t++]=r:r<2048?(e[t++]=r>>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(r=65536+((r&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},Gs=function(n){let e=[],t=0,i=0;for(;t<n.length;){let r=n[t++];if(r<128)e[i++]=String.fromCharCode(r);else if(r>191&&r<224){let s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){let s=n[t++],o=n[t++],c=n[t++],d=((r&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[i++]=String.fromCharCode(55296+(d>>10)),e[i++]=String.fromCharCode(56320+(d&1023))}else{let s=n[t++],o=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|o&63)}}return e.join("")},hr={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r<n.length;r+=3){let s=n[r],o=r+1<n.length,c=o?n[r+1]:0,d=r+2<n.length,l=d?n[r+2]:0,h=s>>2,f=(s&3)<<4|c>>4,m=(c&15)<<2|l>>6,S=l&63;d||(S=64,o||(m=64)),i.push(t[h],t[f],t[m],t[S])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(ur(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Gs(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r<n.length;){let s=t[n.charAt(r++)],c=r<n.length?t[n.charAt(r)]:0;++r;let l=r<n.length?t[n.charAt(r)]:64;++r;let f=r<n.length?t[n.charAt(r)]:64;if(++r,s==null||c==null||l==null||f==null)throw new qt;let m=s<<2|c>>4;if(i.push(m),l!==64){let S=c<<4&240|l>>2;if(i.push(S),f!==64){let ie=l<<6&192|f;i.push(ie)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},qt=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},qs=function(n){let e=ur(n);return hr.encodeByteArray(e,!0)},Yt=function(n){return qs(n).replace(/\./g,"")},Jt=function(n){try{return hr.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Ne(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(let t in e)!e.hasOwnProperty(t)||!Ks(t)||(n[t]=Ne(n[t],e[t]));return n}function Ks(n){return n!=="__proto__"}function Ys(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}var Js=()=>Ys().__FIREBASE_DEFAULTS__,Xs=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Qs=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&Jt(n[1]);return e&&JSON.parse(e)},Xt=()=>{try{return Js()||Xs()||Qs()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}};var Qt=()=>{var n;return(n=Xt())===null||n===void 0?void 0:n.config},fr=n=>{var e;return(e=Xt())===null||e===void 0?void 0:e[`_${n}`]};var rt=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}};function v(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function pr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function Zt(){var n;let e=(n=Xt())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function mr(){return typeof self=="object"&&self.self===self}function st(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Oe(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function ot(){let n=v();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Ee(){try{return typeof indexedDB=="object"}catch{return!1}}function gr(){return new Promise((n,e)=>{try{let t=!0,i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var s;e(((s=r.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}var Zs="FirebaseError",T=class n extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=Zs,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,C.prototype.create)}},C=class{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){let i=t[0]||{},r=`${this.service}/${e}`,s=this.errors[e],o=s?eo(s,i):"Error",c=`${this.serviceName}: ${o} (${r}).`;return new T(r,c,i)}};function eo(n,e){return n.replace(to,(t,i)=>{let r=e[i];return r!=null?String(r):`<${i}?>`})}var to=/\{\$([^}]+)}/g;function en(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function _r(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function De(n,e){if(n===e)return!0;let t=Object.keys(n),i=Object.keys(e);for(let r of t){if(!i.includes(r))return!1;let s=n[r],o=e[r];if(lr(s)&&lr(o)){if(!De(s,o))return!1}else if(s!==o)return!1}for(let r of i)if(!t.includes(r))return!1;return!0}function lr(n){return n!==null&&typeof n=="object"}function se(n){let e=[];for(let[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function Y(n){let e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){let[r,s]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(s)}}),e}function ye(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function at(n,e){let t=new Kt(n,e);return t.subscribe.bind(t)}var Kt=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");no(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=Gt),r.error===void 0&&(r.error=Gt),r.complete===void 0&&(r.complete=Gt);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function no(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Gt(){}var al=4*60*60*1e3;function p(n){return n&&n._delegate?n._delegate:n}var R=class{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var oe="[DEFAULT]";var tn=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let i=new rt;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let i=this.normalizeInstanceIdentifier(e?.identifier),r=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(ro(e))try{this.getOrInitializeService({instanceIdentifier:oe})}catch{}for(let[t,i]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(t);try{let s=this.getOrInitializeService({instanceIdentifier:r});i.resolve(s)}catch{}}}}clearInstance(e=oe){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return a(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=oe){return this.instances.has(e)}getOptions(e=oe){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(let[s,o]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);i===c&&o.resolve(r)}return r}onInit(e,t){var i;let r=this.normalizeInstanceIdentifier(t),s=(i=this.onInitCallbacks.get(r))!==null&&i!==void 0?i:new Set;s.add(e),this.onInitCallbacks.set(r,s);let o=this.instances.get(r);return o&&e(o,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){let i=this.onInitCallbacks.get(t);if(i)for(let r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:io(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=oe){return this.component?this.component.multipleInstances?e:oe:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function io(n){return n===oe?void 0:n}function ro(n){return n.instantiationMode==="EAGER"}var ct=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new tn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var En={};js(En,{FirebaseError:()=>T,SDK_VERSION:()=>j,_DEFAULT_ENTRY_NAME:()=>U,_addComponent:()=>xe,_addOrOverwriteComponent:()=>mn,_apps:()=>X,_clearComponents:()=>Go,_components:()=>Le,_getProvider:()=>gn,_registerComponent:()=>$,_removeServiceInstance:()=>jo,deleteApp:()=>_n,getApp:()=>Or,getApps:()=>Ko,initializeApp:()=>lt,onLog:()=>vn,registerVersion:()=>O,setLogLevel:()=>In});var nn=[],g=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(g||{}),vr={debug:g.DEBUG,verbose:g.VERBOSE,info:g.INFO,warn:g.WARN,error:g.ERROR,silent:g.SILENT},so=g.INFO,oo={[g.DEBUG]:"log",[g.VERBOSE]:"log",[g.INFO]:"info",[g.WARN]:"warn",[g.ERROR]:"error"},ao=(n,e,...t)=>{if(e<n.logLevel)return;let i=new Date().toISOString(),r=oo[e];if(r)console[r](`[${i}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},J=class{constructor(e){this.name=e,this._logLevel=so,this._logHandler=ao,this._userLogHandler=null,nn.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in g))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?vr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,g.DEBUG,...e),this._logHandler(this,g.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,g.VERBOSE,...e),this._logHandler(this,g.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,g.INFO,...e),this._logHandler(this,g.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,g.WARN,...e),this._logHandler(this,g.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,g.ERROR,...e),this._logHandler(this,g.ERROR,...e)}};function Ir(n){nn.forEach(e=>{e.setLogLevel(n)})}function Er(n,e){for(let t of nn){let i=null;e&&e.level&&(i=vr[e.level]),n===null?t.userLogHandler=null:t.userLogHandler=(r,s,...o)=>{let c=o.map(d=>{if(d==null)return null;if(typeof d=="string")return d;if(typeof d=="number"||typeof d=="boolean")return d.toString();if(d instanceof Error)return d.message;try{return JSON.stringify(d)}catch{return null}}).filter(d=>d).join(" ");s>=(i??r.logLevel)&&n({level:g[s].toLowerCase(),message:c,args:o,type:r.name})}}}var co=(n,e)=>e.some(t=>n instanceof t),yr,wr;function lo(){return yr||(yr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function uo(){return wr||(wr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Tr=new WeakMap,sn=new WeakMap,br=new WeakMap,rn=new WeakMap,an=new WeakMap;function ho(n){let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(x(n.result)),r()},o=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Tr.set(t,n)}).catch(()=>{}),an.set(e,n),e}function fo(n){if(sn.has(n))return;let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});sn.set(n,e)}var on={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return sn.get(n);if(e==="objectStoreNames")return n.objectStoreNames||br.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return x(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Ar(n){on=n(on)}function po(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let i=n.call(dt(this),e,...t);return br.set(i,e.sort?e.sort():[e]),x(i)}:uo().includes(n)?function(...e){return n.apply(dt(this),e),x(Tr.get(this))}:function(...e){return x(n.apply(dt(this),e))}}function mo(n){return typeof n=="function"?po(n):(n instanceof IDBTransaction&&fo(n),co(n,lo())?new Proxy(n,on):n)}function x(n){if(n instanceof IDBRequest)return ho(n);if(rn.has(n))return rn.get(n);let e=mo(n);return e!==n&&(rn.set(n,e),an.set(e,n)),e}var dt=n=>an.get(n);function Rr(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){let o=indexedDB.open(n,e),c=x(o);return i&&o.addEventListener("upgradeneeded",d=>{i(x(o.result),d.oldVersion,d.newVersion,x(o.transaction),d)}),t&&o.addEventListener("blocked",d=>t(d.oldVersion,d.newVersion,d)),c.then(d=>{s&&d.addEventListener("close",()=>s()),r&&d.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}var go=["get","getKey","getAll","getAllKeys","count"],_o=["put","add","delete","clear"],cn=new Map;function Sr(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(cn.get(e))return cn.get(e);let t=e.replace(/FromIndex$/,""),i=e!==t,r=_o.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||go.includes(t)))return;let s=function(o,...c){return a(this,null,function*(){let d=this.transaction(o,r?"readwrite":"readonly"),l=d.store;return i&&(l=l.index(c.shift())),(yield Promise.all([l[t](...c),r&&d.done]))[0]})};return cn.set(e,s),s}Ar(n=>dr(cr({},n),{get:(e,t,i)=>Sr(e,t)||n.get(e,t,i),has:(e,t)=>!!Sr(e,t)||n.has(e,t)}));var ln=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(vo(t)){let i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}};function vo(n){let e=n.getComponent();return e?.type==="VERSION"}var un="@firebase/app",Pr="0.9.25";var ae=new J("@firebase/app"),Io="@firebase/app-compat",Eo="@firebase/analytics-compat",yo="@firebase/analytics",wo="@firebase/app-check-compat",To="@firebase/app-check",bo="@firebase/auth",Ao="@firebase/auth-compat",So="@firebase/database",Ro="@firebase/database-compat",Po="@firebase/functions",ko="@firebase/functions-compat",Co="@firebase/installations",No="@firebase/installations-compat",Oo="@firebase/messaging",Do="@firebase/messaging-compat",Lo="@firebase/performance",Mo="@firebase/performance-compat",xo="@firebase/remote-config",Uo="@firebase/remote-config-compat",Fo="@firebase/storage",Vo="@firebase/storage-compat",Wo="@firebase/firestore",Ho="@firebase/firestore-compat",Bo="firebase",zo="10.7.1";var U="[DEFAULT]",$o={[un]:"fire-core",[Io]:"fire-core-compat",[yo]:"fire-analytics",[Eo]:"fire-analytics-compat",[To]:"fire-app-check",[wo]:"fire-app-check-compat",[bo]:"fire-auth",[Ao]:"fire-auth-compat",[So]:"fire-rtdb",[Ro]:"fire-rtdb-compat",[Po]:"fire-fn",[ko]:"fire-fn-compat",[Co]:"fire-iid",[No]:"fire-iid-compat",[Oo]:"fire-fcm",[Do]:"fire-fcm-compat",[Lo]:"fire-perf",[Mo]:"fire-perf-compat",[xo]:"fire-rc",[Uo]:"fire-rc-compat",[Fo]:"fire-gcs",[Vo]:"fire-gcs-compat",[Wo]:"fire-fst",[Ho]:"fire-fst-compat","fire-js":"fire-js",[Bo]:"fire-js-all"};var X=new Map,Le=new Map;function xe(n,e){try{n.container.addComponent(e)}catch(t){ae.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function mn(n,e){n.container.addOrOverwriteComponent(e)}function $(n){let e=n.name;if(Le.has(e))return ae.debug(`There were multiple attempts to register component ${e}.`),!1;Le.set(e,n);for(let t of X.values())xe(t,n);return!0}function gn(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function jo(n,e,t=U){gn(n,e).clearInstance(t)}function Go(){Le.clear()}var qo={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},z=new C("app","Firebase",qo);var hn=class{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new R("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw z.create("app-deleted",{appName:this._name})}};var j=zo;function lt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let i=Object.assign({name:U,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw z.create("bad-app-name",{appName:String(r)});if(t||(t=Qt()),!t)throw z.create("no-options");let s=X.get(r);if(s){if(De(t,s.options)&&De(i,s.config))return s;throw z.create("duplicate-app",{appName:r})}let o=new ct(r);for(let d of Le.values())o.addComponent(d);let c=new hn(t,i,o);return X.set(r,c),c}function Or(n=U){let e=X.get(n);if(!e&&n===U&&Qt())return lt();if(!e)throw z.create("no-app",{appName:n});return e}function Ko(){return Array.from(X.values())}function _n(n){return a(this,null,function*(){let e=n.name;X.has(e)&&(X.delete(e),yield Promise.all(n.container.getProviders().map(t=>t.delete())),n.isDeleted=!0)})}function O(n,e,t){var i;let r=(i=$o[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);let s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){let c=[`Unable to register library "${r}" with version "${e}":`];s&&c.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ae.warn(c.join(" "));return}$(new R(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function vn(n,e){if(n!==null&&typeof n!="function")throw z.create("invalid-log-argument");Er(n,e)}function In(n){Ir(n)}var Yo="firebase-heartbeat-database",Jo=1,Me="firebase-heartbeat-store",dn=null;function Dr(){return dn||(dn=Rr(Yo,Jo,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(Me)}}}).catch(n=>{throw z.create("idb-open",{originalErrorMessage:n.message})})),dn}function Xo(n){return a(this,null,function*(){try{return yield(yield Dr()).transaction(Me).objectStore(Me).get(Lr(n))}catch(e){if(e instanceof T)ae.warn(e.message);else{let t=z.create("idb-get",{originalErrorMessage:e?.message});ae.warn(t.message)}}})}function kr(n,e){return a(this,null,function*(){try{let i=(yield Dr()).transaction(Me,"readwrite");yield i.objectStore(Me).put(e,Lr(n)),yield i.done}catch(t){if(t instanceof T)ae.warn(t.message);else{let i=z.create("idb-set",{originalErrorMessage:t?.message});ae.warn(i.message)}}})}function Lr(n){return`${n.name}!${n.options.appId}`}var Qo=1024,Zo=30*24*60*60*1e3,fn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new pn(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}triggerHeartbeat(){return a(this,null,function*(){var e,t;let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Cr();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{let c=new Date(o.date).valueOf();return Date.now()-c<=Zo}),this._storage.overwrite(this._heartbeatsCache)})}getHeartbeatsHeader(){return a(this,null,function*(){var e;if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=Cr(),{heartbeatsToSend:i,unsentEntries:r}=ea(this._heartbeatsCache.heartbeats),s=Yt(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s})}};function Cr(){return new Date().toISOString().substring(0,10)}function ea(n,e=Qo){let t=[],i=n.slice();for(let r of n){let s=t.find(o=>o.agent===r.agent);if(s){if(s.dates.push(r.date),Nr(t)>e){s.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),Nr(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}var pn=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return a(this,null,function*(){return Ee()?gr().then(()=>!0).catch(()=>!1):!1})}read(){return a(this,null,function*(){if(yield this._canUseIndexedDBPromise){let t=yield Xo(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return})}};function Nr(n){return Yt(JSON.stringify({version:2,heartbeats:n})).length}function ta(n){$(new R("platform-logger",e=>new ln(e),"PRIVATE")),$(new R("heartbeat",e=>new fn(e),"PRIVATE")),O(un,Pr,n),O(un,Pr,"esm2017"),O("fire-js","")}ta("");var yn=class{constructor(e,t){this._delegate=e,this.firebase=t,xe(e,new R("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),_n(this._delegate)))}_getService(e,t=U){var i;this._delegate.checkDestroyed();let r=this._delegate.container.getProvider(e);return!r.isInitialized()&&((i=r.getComponent())===null||i===void 0?void 0:i.instantiationMode)==="EXPLICIT"&&r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=U){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){xe(this._delegate,e)}_addOrOverwriteComponent(e){mn(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}};var na={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},Mr=new C("app-compat","Firebase",na);function ia(n){let e={},t={__esModule:!0,initializeApp:s,app:r,registerVersion:O,setLogLevel:In,onLog:vn,apps:null,SDK_VERSION:j,INTERNAL:{registerComponent:c,removeApp:i,useAsService:d,modularAPIs:En}};t.default=t,Object.defineProperty(t,"apps",{get:o});function i(l){delete e[l]}function r(l){if(l=l||U,!en(e,l))throw Mr.create("no-app",{appName:l});return e[l]}r.App=n;function s(l,h={}){let f=lt(l,h);if(en(e,f.name))return e[f.name];let m=new n(f,t);return e[f.name]=m,m}function o(){return Object.keys(e).map(l=>e[l])}function c(l){let h=l.name,f=h.replace("-compat","");if($(l)&&l.type==="PUBLIC"){let m=(S=r())=>{if(typeof S[f]!="function")throw Mr.create("invalid-app-argument",{appName:h});return S[f]()};l.serviceProps!==void 0&&Ne(m,l.serviceProps),t[f]=m,n.prototype[f]=function(...S){return this._getService.bind(this,h).apply(this,l.multipleInstances?S:[])}}return l.type==="PUBLIC"?t[f]:null}function d(l,h){return h==="serverAuth"?null:h}return t}function Ur(){let n=ia(yn);n.INTERNAL=Object.assign(Object.assign({},n.INTERNAL),{createFirebaseNamespace:Ur,extendNamespace:e,createSubscribe:at,ErrorFactory:C,deepExtend:Ne});function e(t){Ne(n,t)}return n}var ra=Ur();var xr=new J("@firebase/app-compat"),sa="@firebase/app-compat",oa="0.2.25";function aa(n){O(sa,oa,n)}if(mr()&&self.firebase!==void 0){xr.warn(`
1
+ import{a as cr,b as dr,e as js,g as re,h as a,i as it}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.9.2/Marketplace/chunk-CRNJ2Q5T.js";var ur=function(n){let e=[],t=0;for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);r<128?e[t++]=r:r<2048?(e[t++]=r>>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(r=65536+((r&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},Gs=function(n){let e=[],t=0,i=0;for(;t<n.length;){let r=n[t++];if(r<128)e[i++]=String.fromCharCode(r);else if(r>191&&r<224){let s=n[t++];e[i++]=String.fromCharCode((r&31)<<6|s&63)}else if(r>239&&r<365){let s=n[t++],o=n[t++],c=n[t++],d=((r&7)<<18|(s&63)<<12|(o&63)<<6|c&63)-65536;e[i++]=String.fromCharCode(55296+(d>>10)),e[i++]=String.fromCharCode(56320+(d&1023))}else{let s=n[t++],o=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(s&63)<<6|o&63)}}return e.join("")},hr={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();let t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r<n.length;r+=3){let s=n[r],o=r+1<n.length,c=o?n[r+1]:0,d=r+2<n.length,l=d?n[r+2]:0,h=s>>2,f=(s&3)<<4|c>>4,m=(c&15)<<2|l>>6,S=l&63;d||(S=64,o||(m=64)),i.push(t[h],t[f],t[m],t[S])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(ur(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):Gs(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();let t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r<n.length;){let s=t[n.charAt(r++)],c=r<n.length?t[n.charAt(r)]:0;++r;let l=r<n.length?t[n.charAt(r)]:64;++r;let f=r<n.length?t[n.charAt(r)]:64;if(++r,s==null||c==null||l==null||f==null)throw new qt;let m=s<<2|c>>4;if(i.push(m),l!==64){let S=c<<4&240|l>>2;if(i.push(S),f!==64){let ie=l<<6&192|f;i.push(ie)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}},qt=class extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}},qs=function(n){let e=ur(n);return hr.encodeByteArray(e,!0)},Yt=function(n){return qs(n).replace(/\./g,"")},Jt=function(n){try{return hr.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Ne(n,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:let t=e;return new Date(t.getTime());case Object:n===void 0&&(n={});break;case Array:n=[];break;default:return e}for(let t in e)!e.hasOwnProperty(t)||!Ks(t)||(n[t]=Ne(n[t],e[t]));return n}function Ks(n){return n!=="__proto__"}function Ys(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}var Js=()=>Ys().__FIREBASE_DEFAULTS__,Xs=()=>{if(typeof process>"u"||typeof process.env>"u")return;let n=process.env.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},Qs=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}let e=n&&Jt(n[1]);return e&&JSON.parse(e)},Xt=()=>{try{return Js()||Xs()||Qs()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}};var Qt=()=>{var n;return(n=Xt())===null||n===void 0?void 0:n.config},fr=n=>{var e;return(e=Xt())===null||e===void 0?void 0:e[`_${n}`]};var rt=class{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}};function v(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function pr(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(v())}function Zt(){var n;let e=(n=Xt())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function mr(){return typeof self=="object"&&self.self===self}function st(){let n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function Oe(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function ot(){let n=v();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function Ee(){try{return typeof indexedDB=="object"}catch{return!1}}function gr(){return new Promise((n,e)=>{try{let t=!0,i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var s;e(((s=r.error)===null||s===void 0?void 0:s.message)||"")}}catch(t){e(t)}})}var Zs="FirebaseError",T=class n extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=Zs,Object.setPrototypeOf(this,n.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,C.prototype.create)}},C=class{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){let i=t[0]||{},r=`${this.service}/${e}`,s=this.errors[e],o=s?eo(s,i):"Error",c=`${this.serviceName}: ${o} (${r}).`;return new T(r,c,i)}};function eo(n,e){return n.replace(to,(t,i)=>{let r=e[i];return r!=null?String(r):`<${i}?>`})}var to=/\{\$([^}]+)}/g;function en(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function _r(n){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function De(n,e){if(n===e)return!0;let t=Object.keys(n),i=Object.keys(e);for(let r of t){if(!i.includes(r))return!1;let s=n[r],o=e[r];if(lr(s)&&lr(o)){if(!De(s,o))return!1}else if(s!==o)return!1}for(let r of i)if(!t.includes(r))return!1;return!0}function lr(n){return n!==null&&typeof n=="object"}function se(n){let e=[];for(let[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function Y(n){let e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){let[r,s]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(s)}}),e}function ye(n){let e=n.indexOf("?");if(!e)return"";let t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function at(n,e){let t=new Kt(n,e);return t.subscribe.bind(t)}var Kt=class{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");no(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=Gt),r.error===void 0&&(r.error=Gt),r.complete===void 0&&(r.complete=Gt);let s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),s}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}};function no(n,e){if(typeof n!="object"||n===null)return!1;for(let t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Gt(){}var al=4*60*60*1e3;function p(n){return n&&n._delegate?n._delegate:n}var R=class{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}};var oe="[DEFAULT]";var tn=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let i=new rt;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let i=this.normalizeInstanceIdentifier(e?.identifier),r=(t=e?.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(ro(e))try{this.getOrInitializeService({instanceIdentifier:oe})}catch{}for(let[t,i]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(t);try{let s=this.getOrInitializeService({instanceIdentifier:r});i.resolve(s)}catch{}}}}clearInstance(e=oe){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}delete(){return a(this,null,function*(){let e=Array.from(this.instances.values());yield Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])})}isComponentSet(){return this.component!=null}isInitialized(e=oe){return this.instances.has(e)}getOptions(e=oe){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(let[s,o]of this.instancesDeferred.entries()){let c=this.normalizeInstanceIdentifier(s);i===c&&o.resolve(r)}return r}onInit(e,t){var i;let r=this.normalizeInstanceIdentifier(t),s=(i=this.onInitCallbacks.get(r))!==null&&i!==void 0?i:new Set;s.add(e),this.onInitCallbacks.set(r,s);let o=this.instances.get(r);return o&&e(o,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){let i=this.onInitCallbacks.get(t);if(i)for(let r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:io(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=oe){return this.component?this.component.multipleInstances?e:oe:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function io(n){return n===oe?void 0:n}function ro(n){return n.instantiationMode==="EAGER"}var ct=class{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);let t=new tn(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}};var En={};js(En,{FirebaseError:()=>T,SDK_VERSION:()=>j,_DEFAULT_ENTRY_NAME:()=>U,_addComponent:()=>xe,_addOrOverwriteComponent:()=>mn,_apps:()=>X,_clearComponents:()=>Go,_components:()=>Le,_getProvider:()=>gn,_registerComponent:()=>$,_removeServiceInstance:()=>jo,deleteApp:()=>_n,getApp:()=>Or,getApps:()=>Ko,initializeApp:()=>lt,onLog:()=>vn,registerVersion:()=>O,setLogLevel:()=>In});var nn=[],g=function(n){return n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT",n}(g||{}),vr={debug:g.DEBUG,verbose:g.VERBOSE,info:g.INFO,warn:g.WARN,error:g.ERROR,silent:g.SILENT},so=g.INFO,oo={[g.DEBUG]:"log",[g.VERBOSE]:"log",[g.INFO]:"info",[g.WARN]:"warn",[g.ERROR]:"error"},ao=(n,e,...t)=>{if(e<n.logLevel)return;let i=new Date().toISOString(),r=oo[e];if(r)console[r](`[${i}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)},J=class{constructor(e){this.name=e,this._logLevel=so,this._logHandler=ao,this._userLogHandler=null,nn.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in g))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?vr[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,g.DEBUG,...e),this._logHandler(this,g.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,g.VERBOSE,...e),this._logHandler(this,g.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,g.INFO,...e),this._logHandler(this,g.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,g.WARN,...e),this._logHandler(this,g.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,g.ERROR,...e),this._logHandler(this,g.ERROR,...e)}};function Ir(n){nn.forEach(e=>{e.setLogLevel(n)})}function Er(n,e){for(let t of nn){let i=null;e&&e.level&&(i=vr[e.level]),n===null?t.userLogHandler=null:t.userLogHandler=(r,s,...o)=>{let c=o.map(d=>{if(d==null)return null;if(typeof d=="string")return d;if(typeof d=="number"||typeof d=="boolean")return d.toString();if(d instanceof Error)return d.message;try{return JSON.stringify(d)}catch{return null}}).filter(d=>d).join(" ");s>=(i??r.logLevel)&&n({level:g[s].toLowerCase(),message:c,args:o,type:r.name})}}}var co=(n,e)=>e.some(t=>n instanceof t),yr,wr;function lo(){return yr||(yr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function uo(){return wr||(wr=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}var Tr=new WeakMap,sn=new WeakMap,br=new WeakMap,rn=new WeakMap,an=new WeakMap;function ho(n){let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("success",s),n.removeEventListener("error",o)},s=()=>{t(x(n.result)),r()},o=()=>{i(n.error),r()};n.addEventListener("success",s),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&Tr.set(t,n)}).catch(()=>{}),an.set(e,n),e}function fo(n){if(sn.has(n))return;let e=new Promise((t,i)=>{let r=()=>{n.removeEventListener("complete",s),n.removeEventListener("error",o),n.removeEventListener("abort",o)},s=()=>{t(),r()},o=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",s),n.addEventListener("error",o),n.addEventListener("abort",o)});sn.set(n,e)}var on={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return sn.get(n);if(e==="objectStoreNames")return n.objectStoreNames||br.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return x(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Ar(n){on=n(on)}function po(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){let i=n.call(dt(this),e,...t);return br.set(i,e.sort?e.sort():[e]),x(i)}:uo().includes(n)?function(...e){return n.apply(dt(this),e),x(Tr.get(this))}:function(...e){return x(n.apply(dt(this),e))}}function mo(n){return typeof n=="function"?po(n):(n instanceof IDBTransaction&&fo(n),co(n,lo())?new Proxy(n,on):n)}function x(n){if(n instanceof IDBRequest)return ho(n);if(rn.has(n))return rn.get(n);let e=mo(n);return e!==n&&(rn.set(n,e),an.set(e,n)),e}var dt=n=>an.get(n);function Rr(n,e,{blocked:t,upgrade:i,blocking:r,terminated:s}={}){let o=indexedDB.open(n,e),c=x(o);return i&&o.addEventListener("upgradeneeded",d=>{i(x(o.result),d.oldVersion,d.newVersion,x(o.transaction),d)}),t&&o.addEventListener("blocked",d=>t(d.oldVersion,d.newVersion,d)),c.then(d=>{s&&d.addEventListener("close",()=>s()),r&&d.addEventListener("versionchange",l=>r(l.oldVersion,l.newVersion,l))}).catch(()=>{}),c}var go=["get","getKey","getAll","getAllKeys","count"],_o=["put","add","delete","clear"],cn=new Map;function Sr(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(cn.get(e))return cn.get(e);let t=e.replace(/FromIndex$/,""),i=e!==t,r=_o.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||go.includes(t)))return;let s=function(o,...c){return a(this,null,function*(){let d=this.transaction(o,r?"readwrite":"readonly"),l=d.store;return i&&(l=l.index(c.shift())),(yield Promise.all([l[t](...c),r&&d.done]))[0]})};return cn.set(e,s),s}Ar(n=>dr(cr({},n),{get:(e,t,i)=>Sr(e,t)||n.get(e,t,i),has:(e,t)=>!!Sr(e,t)||n.has(e,t)}));var ln=class{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(vo(t)){let i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}};function vo(n){let e=n.getComponent();return e?.type==="VERSION"}var un="@firebase/app",Pr="0.9.25";var ae=new J("@firebase/app"),Io="@firebase/app-compat",Eo="@firebase/analytics-compat",yo="@firebase/analytics",wo="@firebase/app-check-compat",To="@firebase/app-check",bo="@firebase/auth",Ao="@firebase/auth-compat",So="@firebase/database",Ro="@firebase/database-compat",Po="@firebase/functions",ko="@firebase/functions-compat",Co="@firebase/installations",No="@firebase/installations-compat",Oo="@firebase/messaging",Do="@firebase/messaging-compat",Lo="@firebase/performance",Mo="@firebase/performance-compat",xo="@firebase/remote-config",Uo="@firebase/remote-config-compat",Fo="@firebase/storage",Vo="@firebase/storage-compat",Wo="@firebase/firestore",Ho="@firebase/firestore-compat",Bo="firebase",zo="10.7.1";var U="[DEFAULT]",$o={[un]:"fire-core",[Io]:"fire-core-compat",[yo]:"fire-analytics",[Eo]:"fire-analytics-compat",[To]:"fire-app-check",[wo]:"fire-app-check-compat",[bo]:"fire-auth",[Ao]:"fire-auth-compat",[So]:"fire-rtdb",[Ro]:"fire-rtdb-compat",[Po]:"fire-fn",[ko]:"fire-fn-compat",[Co]:"fire-iid",[No]:"fire-iid-compat",[Oo]:"fire-fcm",[Do]:"fire-fcm-compat",[Lo]:"fire-perf",[Mo]:"fire-perf-compat",[xo]:"fire-rc",[Uo]:"fire-rc-compat",[Fo]:"fire-gcs",[Vo]:"fire-gcs-compat",[Wo]:"fire-fst",[Ho]:"fire-fst-compat","fire-js":"fire-js",[Bo]:"fire-js-all"};var X=new Map,Le=new Map;function xe(n,e){try{n.container.addComponent(e)}catch(t){ae.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function mn(n,e){n.container.addOrOverwriteComponent(e)}function $(n){let e=n.name;if(Le.has(e))return ae.debug(`There were multiple attempts to register component ${e}.`),!1;Le.set(e,n);for(let t of X.values())xe(t,n);return!0}function gn(n,e){let t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function jo(n,e,t=U){gn(n,e).clearInstance(t)}function Go(){Le.clear()}var qo={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."},z=new C("app","Firebase",qo);var hn=class{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new R("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw z.create("app-deleted",{appName:this._name})}};var j=zo;function lt(n,e={}){let t=n;typeof e!="object"&&(e={name:e});let i=Object.assign({name:U,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw z.create("bad-app-name",{appName:String(r)});if(t||(t=Qt()),!t)throw z.create("no-options");let s=X.get(r);if(s){if(De(t,s.options)&&De(i,s.config))return s;throw z.create("duplicate-app",{appName:r})}let o=new ct(r);for(let d of Le.values())o.addComponent(d);let c=new hn(t,i,o);return X.set(r,c),c}function Or(n=U){let e=X.get(n);if(!e&&n===U&&Qt())return lt();if(!e)throw z.create("no-app",{appName:n});return e}function Ko(){return Array.from(X.values())}function _n(n){return a(this,null,function*(){let e=n.name;X.has(e)&&(X.delete(e),yield Promise.all(n.container.getProviders().map(t=>t.delete())),n.isDeleted=!0)})}function O(n,e,t){var i;let r=(i=$o[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);let s=r.match(/\s|\//),o=e.match(/\s|\//);if(s||o){let c=[`Unable to register library "${r}" with version "${e}":`];s&&c.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&c.push("and"),o&&c.push(`version name "${e}" contains illegal characters (whitespace or "/")`),ae.warn(c.join(" "));return}$(new R(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}function vn(n,e){if(n!==null&&typeof n!="function")throw z.create("invalid-log-argument");Er(n,e)}function In(n){Ir(n)}var Yo="firebase-heartbeat-database",Jo=1,Me="firebase-heartbeat-store",dn=null;function Dr(){return dn||(dn=Rr(Yo,Jo,{upgrade:(n,e)=>{switch(e){case 0:n.createObjectStore(Me)}}}).catch(n=>{throw z.create("idb-open",{originalErrorMessage:n.message})})),dn}function Xo(n){return a(this,null,function*(){try{return yield(yield Dr()).transaction(Me).objectStore(Me).get(Lr(n))}catch(e){if(e instanceof T)ae.warn(e.message);else{let t=z.create("idb-get",{originalErrorMessage:e?.message});ae.warn(t.message)}}})}function kr(n,e){return a(this,null,function*(){try{let i=(yield Dr()).transaction(Me,"readwrite");yield i.objectStore(Me).put(e,Lr(n)),yield i.done}catch(t){if(t instanceof T)ae.warn(t.message);else{let i=z.create("idb-set",{originalErrorMessage:t?.message});ae.warn(i.message)}}})}function Lr(n){return`${n.name}!${n.options.appId}`}var Qo=1024,Zo=30*24*60*60*1e3,fn=class{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new pn(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}triggerHeartbeat(){return a(this,null,function*(){var e,t;let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),s=Cr();if(!(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null))&&!(this._heartbeatsCache.lastSentHeartbeatDate===s||this._heartbeatsCache.heartbeats.some(o=>o.date===s)))return this._heartbeatsCache.heartbeats.push({date:s,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{let c=new Date(o.date).valueOf();return Date.now()-c<=Zo}),this._storage.overwrite(this._heartbeatsCache)})}getHeartbeatsHeader(){return a(this,null,function*(){var e;if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";let t=Cr(),{heartbeatsToSend:i,unsentEntries:r}=ea(this._heartbeatsCache.heartbeats),s=Yt(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s})}};function Cr(){return new Date().toISOString().substring(0,10)}function ea(n,e=Qo){let t=[],i=n.slice();for(let r of n){let s=t.find(o=>o.agent===r.agent);if(s){if(s.dates.push(r.date),Nr(t)>e){s.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),Nr(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}var pn=class{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return a(this,null,function*(){return Ee()?gr().then(()=>!0).catch(()=>!1):!1})}read(){return a(this,null,function*(){if(yield this._canUseIndexedDBPromise){let t=yield Xo(this.app);return t?.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return})}add(e){return a(this,null,function*(){var t;if(yield this._canUseIndexedDBPromise){let r=yield this.read();return kr(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return})}};function Nr(n){return Yt(JSON.stringify({version:2,heartbeats:n})).length}function ta(n){$(new R("platform-logger",e=>new ln(e),"PRIVATE")),$(new R("heartbeat",e=>new fn(e),"PRIVATE")),O(un,Pr,n),O(un,Pr,"esm2017"),O("fire-js","")}ta("");var yn=class{constructor(e,t){this._delegate=e,this.firebase=t,xe(e,new R("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),_n(this._delegate)))}_getService(e,t=U){var i;this._delegate.checkDestroyed();let r=this._delegate.container.getProvider(e);return!r.isInitialized()&&((i=r.getComponent())===null||i===void 0?void 0:i.instantiationMode)==="EXPLICIT"&&r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=U){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){xe(this._delegate,e)}_addOrOverwriteComponent(e){mn(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}};var na={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},Mr=new C("app-compat","Firebase",na);function ia(n){let e={},t={__esModule:!0,initializeApp:s,app:r,registerVersion:O,setLogLevel:In,onLog:vn,apps:null,SDK_VERSION:j,INTERNAL:{registerComponent:c,removeApp:i,useAsService:d,modularAPIs:En}};t.default=t,Object.defineProperty(t,"apps",{get:o});function i(l){delete e[l]}function r(l){if(l=l||U,!en(e,l))throw Mr.create("no-app",{appName:l});return e[l]}r.App=n;function s(l,h={}){let f=lt(l,h);if(en(e,f.name))return e[f.name];let m=new n(f,t);return e[f.name]=m,m}function o(){return Object.keys(e).map(l=>e[l])}function c(l){let h=l.name,f=h.replace("-compat","");if($(l)&&l.type==="PUBLIC"){let m=(S=r())=>{if(typeof S[f]!="function")throw Mr.create("invalid-app-argument",{appName:h});return S[f]()};l.serviceProps!==void 0&&Ne(m,l.serviceProps),t[f]=m,n.prototype[f]=function(...S){return this._getService.bind(this,h).apply(this,l.multipleInstances?S:[])}}return l.type==="PUBLIC"?t[f]:null}function d(l,h){return h==="serverAuth"?null:h}return t}function Ur(){let n=ia(yn);n.INTERNAL=Object.assign(Object.assign({},n.INTERNAL),{createFirebaseNamespace:Ur,extendNamespace:e,createSubscribe:at,ErrorFactory:C,deepExtend:Ne});function e(t){Ne(n,t)}return n}var ra=Ur();var xr=new J("@firebase/app-compat"),sa="@firebase/app-compat",oa="0.2.25";function aa(n){O(sa,oa,n)}if(mr()&&self.firebase!==void 0){xr.warn(`
2
2
  Warning: Firebase is already defined in the global scope. Please make sure
3
3
  Firebase library is only loaded once.
4
4
  `);let n=self.firebase.SDK_VERSION;n&&n.indexOf("LITE")>=0&&xr.warn(`