marketplacepos 3.6.0 → 3.6.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 (77) hide show
  1. package/Marketplace/{chunk-DKPFXQNF.js → chunk-2GCJVDVN.js} +1 -1
  2. package/Marketplace/chunk-2KGUHH44.js +1 -0
  3. package/Marketplace/{chunk-JWESCPR3.js → chunk-45NXB6RE.js} +1 -1
  4. package/Marketplace/{chunk-FTYEJYHR.js → chunk-46GC4FG7.js} +1 -1
  5. package/Marketplace/{chunk-37HLVAAU.js → chunk-4YRDQUI3.js} +1 -1
  6. package/Marketplace/{chunk-KDJNHDU2.js → chunk-5LHF6NCK.js} +1 -1
  7. package/Marketplace/{chunk-4TY6WDXS.js → chunk-66UC4STB.js} +1 -1
  8. package/Marketplace/{chunk-PUSB4EIC.js → chunk-6M2Q3GGB.js} +1 -1
  9. package/Marketplace/{chunk-NAXDUEX4.js → chunk-7EYB3DHT.js} +1 -1
  10. package/Marketplace/{chunk-JUIDNG6B.js → chunk-7JWQMOH7.js} +1 -1
  11. package/Marketplace/{chunk-2GUSUJKR.js → chunk-7V6UQDFG.js} +1 -1
  12. package/Marketplace/{chunk-CIGF5YG5.js → chunk-A4X2AUOC.js} +1 -1
  13. package/Marketplace/{chunk-KTPCOMZ2.js → chunk-BATYANE3.js} +1 -1
  14. package/Marketplace/{chunk-6YFZBURX.js → chunk-BREDWZJ7.js} +1 -1
  15. package/Marketplace/chunk-BVGNNSM2.js +1 -0
  16. package/Marketplace/{chunk-YK6VKTWV.js → chunk-BVMOK3VE.js} +1 -1
  17. package/Marketplace/{chunk-FBU5QXHN.js → chunk-BW5REXI6.js} +1 -1
  18. package/Marketplace/{chunk-PP4T4PLJ.js → chunk-BYPWQ2HT.js} +1 -1
  19. package/Marketplace/{chunk-35GLPUIA.js → chunk-CBOPSK2G.js} +1 -1
  20. package/Marketplace/{chunk-WNUGQVRM.js → chunk-DKGYGZK7.js} +1 -1
  21. package/Marketplace/{chunk-JGYSNRH6.js → chunk-DQRS5DAE.js} +1 -1
  22. package/Marketplace/{chunk-MIAEM23L.js → chunk-DZKSVYPR.js} +1 -1
  23. package/Marketplace/{chunk-YS2YJHB3.js → chunk-EAYXHDLW.js} +1 -1
  24. package/Marketplace/{chunk-ISJRZPJX.js → chunk-EOM22W74.js} +1 -1
  25. package/Marketplace/{chunk-3G5KO3TI.js → chunk-ERRFLL6T.js} +1 -1
  26. package/Marketplace/{chunk-IPSBLHOU.js → chunk-F45ZZTMU.js} +1 -1
  27. package/Marketplace/{chunk-3ZNOGHL3.js → chunk-FH2STK2T.js} +1 -1
  28. package/Marketplace/{chunk-Q2ZCP6BL.js → chunk-FO3KSKQ6.js} +1 -1
  29. package/Marketplace/{chunk-AO2MXRCQ.js → chunk-GF526R3A.js} +1 -1
  30. package/Marketplace/{chunk-SFDY7NUA.js → chunk-GMNZLOVM.js} +1 -1
  31. package/Marketplace/{chunk-VX5ROJLM.js → chunk-HUDF4XGA.js} +1 -1
  32. package/Marketplace/{chunk-BUG6II55.js → chunk-HXRWGEJ5.js} +1 -1
  33. package/Marketplace/{chunk-I7PLLVEH.js → chunk-I3M6GHUE.js} +1 -1
  34. package/Marketplace/{chunk-QC4HQRFC.js → chunk-J2UWP2SN.js} +1 -1
  35. package/Marketplace/{chunk-SY5WIR62.js → chunk-JSCR55UZ.js} +3 -3
  36. package/Marketplace/{chunk-HVNMMTYL.js → chunk-KM23UFSR.js} +1 -1
  37. package/Marketplace/{chunk-YBAPXY6T.js → chunk-L3TBTXVF.js} +1 -1
  38. package/Marketplace/{chunk-3KJSV75O.js → chunk-LXDCPBTR.js} +1 -1
  39. package/Marketplace/chunk-MO3YBEXE.js +1 -0
  40. package/Marketplace/{chunk-233MWU5I.js → chunk-NZQHBWBK.js} +2 -2
  41. package/Marketplace/{chunk-K5FAZTRK.js → chunk-PFXGXQHO.js} +1 -1
  42. package/Marketplace/{chunk-SUY2H7ZI.js → chunk-PXAUQQ7Y.js} +1 -1
  43. package/Marketplace/{chunk-ZXU3FVPS.js → chunk-QYZDV3KB.js} +1 -1
  44. package/Marketplace/{chunk-W7OIIPRU.js → chunk-QZ6GD3DK.js} +1 -1
  45. package/Marketplace/{chunk-2Y66HZFD.js → chunk-RISSBTN2.js} +1 -1
  46. package/Marketplace/{chunk-MLMGMDJA.js → chunk-RNPQSH4X.js} +1 -1
  47. package/Marketplace/{chunk-53K2CWAN.js → chunk-RQYJJ3EK.js} +1 -1
  48. package/Marketplace/{chunk-V752HOUZ.js → chunk-RWYXA653.js} +1 -1
  49. package/Marketplace/{chunk-HEYRRICW.js → chunk-SB5XTLLY.js} +1 -1
  50. package/Marketplace/{chunk-2FZAKLVH.js → chunk-TAD43MYD.js} +1 -1
  51. package/Marketplace/{chunk-ZVELVZIL.js → chunk-TG2NAWXW.js} +1 -1
  52. package/Marketplace/{chunk-G4PZ5CPL.js → chunk-TPFTT632.js} +1 -1
  53. package/Marketplace/{chunk-IOUI2FZD.js → chunk-UV6KK4W6.js} +1 -1
  54. package/Marketplace/{chunk-IM6ZDC7I.js → chunk-V7X66MWE.js} +1 -1
  55. package/Marketplace/{chunk-UTRK7TTD.js → chunk-XAU4KWDG.js} +1 -1
  56. package/Marketplace/{chunk-R2U2NYVL.js → chunk-XDJYCAPB.js} +1 -1
  57. package/Marketplace/{chunk-Q6Y22NLN.js → chunk-XJMXZWZW.js} +1 -1
  58. package/Marketplace/{chunk-UTSC6PL6.js → chunk-YBEJ6DSM.js} +1 -1
  59. package/Marketplace/{chunk-M3XCT7JY.js → chunk-YO44EPAG.js} +1 -1
  60. package/Marketplace/{chunk-NEAQH3FX.js → chunk-Z4L57D42.js} +1 -1
  61. package/Marketplace/{chunk-MGVAWFYU.js → chunk-ZHLG7GCJ.js} +1 -1
  62. package/Marketplace/{chunk-7ARC4G4F.js → chunk-ZJYHLYQC.js} +1 -1
  63. package/Marketplace/{chunk-5LICD27P.js → chunk-ZLHGVQE6.js} +2 -2
  64. package/Marketplace/{chunk-MBHOZDLB.js → chunk-ZRTKOAYD.js} +1 -1
  65. package/Marketplace/index.html +2 -2
  66. package/Marketplace/{main-ICOUGZTS.js → main-JR4ZU2LJ.js} +1 -1
  67. package/Marketplace/{styles-XDRE2JJC.css → styles-DXZCV23O.css} +1 -1
  68. package/package.json +1 -1
  69. package/Marketplace/chunk-E64JNFG7.js +0 -1
  70. package/Marketplace/chunk-UWU5GEHX.js +0 -1
  71. package/Marketplace/chunk-V3NJFGV3.js +0 -1
  72. /package/Marketplace/{chunk-6RUGKYFT.js → chunk-72VLH7XK.js} +0 -0
  73. /package/Marketplace/{chunk-6HLIRI7N.js → chunk-GCXKRLIU.js} +0 -0
  74. /package/Marketplace/{chunk-V6VYUZWG.js → chunk-NXHCLVII.js} +0 -0
  75. /package/Marketplace/{chunk-ZLME6FEU.js → chunk-OUASU5FP.js} +0 -0
  76. /package/Marketplace/{chunk-KPTAVWMG.js → chunk-YD4CXLB4.js} +0 -0
  77. /package/Marketplace/{polyfills-L2ZK4WXQ.js → polyfills-ON52FDZY.js} +0 -0
@@ -1 +1 @@
1
- import{a as ue}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-35GLPUIA.js";import{b as he,e as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-VX5ROJLM.js";import{$ as le,ca as U,d as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";import{a as d,b as R,c as H,h as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6RUGKYFT.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.6.2/Marketplace/chunk-CBOPSK2G.js";import{b as he,e as ge}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-HUDF4XGA.js";import{$ as le,ca as U,d as ae}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";import{a as d,b as R,c as H,h as u}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-72VLH7XK.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,3 +1,3 @@
1
- import{a as st,b as dt,c as qt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-3KJSV75O.js";import{a as Ut}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-BUG6II55.js";import{d as Qt,e as rt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-DKPFXQNF.js";import{f as Yt,g as it,h as Nt,j as nt,k as Lt,l as Bt,o as jt,p as ge,s as Ht}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-IM6ZDC7I.js";import{D as at,E as Pt,F as X,J as zt,L as $t,O as Kt,R as _,S as T,U as He,a as N,f as Ft,g as W,h as Rt,j as je,m as Tt,y as Ot}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-JWESCPR3.js";import{a as Ye,d as Ne,e as _e,f as Et,g as xt,j as Le,n as Be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-6YFZBURX.js";import{$ as J,$a as $,A as oe,B as bt,Ba as O,Fa as h,Ga as o,Gb as It,Ha as wt,Hb as w,I as Ae,Ia as P,Ib as R,Ja as p,Jb as Pe,Ka as We,Kb as k,La as H,Na as b,Oa as v,Pa as xe,Qa as F,S as we,Ta as Xe,Ua as z,Va as ce,Vb as Vt,Wa as Fe,Xa as Re,Xb as Ze,Ya as Te,Z as ke,Za as c,_a as u,a as E,aa as Dt,ba as Me,c as B,ca as Ie,da as le,db as he,ea as y,eb as Oe,fa as yt,fb as kt,fc as St,ga as x,hb as g,ia as j,ib as Mt,ja as C,jb as m,ka as A,kb as ue,la as Ue,lb as ee,ma as Ct,n as Ce,na as Ge,oa as At,pa as Ve,pb as D,qa as Se,qb as Y,rb as te,sa as Ee,sc as Je,tb as K,tc as pe,wc as Q,xc as et,yc as tt,zc as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.0/Marketplace/chunk-MGVAWFYU.js";var pa=["mat-calendar-body",""];function ma(r,i){if(r&1&&(c(0,"tr",0)(1,"td",2),D(2),u()()),r&2){let d=m();h(1),xe("padding-top",d._cellPadding)("padding-bottom",d._cellPadding),b("colspan",d.numCols),h(1),te(" ",d.label," ")}}function _a(r,i){if(r&1&&(c(0,"td",2),D(1),u()),r&2){let d=m(2);xe("padding-top",d._cellPadding)("padding-bottom",d._cellPadding),b("colspan",d._firstRowOffset),h(1),te(" ",d._firstRowOffset>=d.labelMinRequiredCells?d.label:""," ")}}function ga(r,i){if(r&1){let d=he();c(0,"td",5)(1,"button",6),g("click",function(a){let n=C(d).$implicit,s=m(2);return A(s._cellClicked(n,a))})("focus",function(a){let n=C(d).$implicit,s=m(2);return A(s._emitActiveDateChange(n,a))}),c(2,"span",7),D(3),u(),$(4,"span",8),u()()}if(r&2){let d=i.$implicit,e=i.$index,a=m().$index,t=m();xe("width",t._cellWidth)("padding-top",t._cellPadding)("padding-bottom",t._cellPadding),b("data-mat-row",a)("data-mat-col",e),h(1),F("mat-calendar-body-disabled",!d.enabled)("mat-calendar-body-active",t._isActiveCell(a,e))("mat-calendar-body-range-start",t._isRangeStart(d.compareValue))("mat-calendar-body-range-end",t._isRangeEnd(d.compareValue))("mat-calendar-body-in-range",t._isInRange(d.compareValue))("mat-calendar-body-comparison-bridge-start",t._isComparisonBridgeStart(d.compareValue,a,e))("mat-calendar-body-comparison-bridge-end",t._isComparisonBridgeEnd(d.compareValue,a,e))("mat-calendar-body-comparison-start",t._isComparisonStart(d.compareValue))("mat-calendar-body-comparison-end",t._isComparisonEnd(d.compareValue))("mat-calendar-body-in-comparison-range",t._isInComparisonRange(d.compareValue))("mat-calendar-body-preview-start",t._isPreviewStart(d.compareValue))("mat-calendar-body-preview-end",t._isPreviewEnd(d.compareValue))("mat-calendar-body-in-preview",t._isInPreview(d.compareValue)),v("ngClass",d.cssClasses)("tabindex",t._isActiveCell(a,e)?0:-1),b("aria-label",d.ariaLabel)("aria-disabled",!d.enabled||null)("aria-pressed",t._isSelected(d.compareValue))("aria-current",t.todayValue===d.compareValue?"date":null)("aria-describedby",t._getDescribedby(d.compareValue)),h(1),F("mat-calendar-body-selected",t._isSelected(d.compareValue))("mat-calendar-body-comparison-identical",t._isComparisonIdentical(d.compareValue))("mat-calendar-body-today",t.todayValue===d.compareValue),h(1),te(" ",d.displayValue," ")}}function fa(r,i){if(r&1&&(c(0,"tr",3),z(1,_a,2,6,"td",4),Re(2,ga,5,48,"td",9,Fe),u()),r&2){let d=i.$implicit,e=i.$index,a=m();h(1),ce(1,e===0&&a._firstRowOffset?1:-1),h(1),Te(d)}}function va(r,i){if(r&1&&(c(0,"th",4)(1,"span",5),D(2),u(),c(3,"span",6),D(4),u()()),r&2){let d=i.$implicit;h(2),Y(d.long),h(2),Y(d.narrow)}}var ia=["*"];function ba(r,i){}function Da(r,i){if(r&1){let d=he();c(0,"mat-month-view",2),g("activeDateChange",function(a){C(d);let t=m();return A(t.activeDate=a)})("_userSelection",function(a){C(d);let t=m();return A(t._dateSelected(a))})("dragStarted",function(a){C(d);let t=m();return A(t._dragStarted(a))})("dragEnded",function(a){C(d);let t=m();return A(t._dragEnded(a))}),u()}if(r&2){let d=m();v("activeDate",d.activeDate)("selected",d.selected)("dateFilter",d.dateFilter)("maxDate",d.maxDate)("minDate",d.minDate)("dateClass",d.dateClass)("comparisonStart",d.comparisonStart)("comparisonEnd",d.comparisonEnd)("startDateAccessibleName",d.startDateAccessibleName)("endDateAccessibleName",d.endDateAccessibleName)("activeDrag",d._activeDrag)}}function ya(r,i){if(r&1){let d=he();c(0,"mat-year-view",3),g("activeDateChange",function(a){C(d);let t=m();return A(t.activeDate=a)})("monthSelected",function(a){C(d);let t=m();return A(t._monthSelectedInYearView(a))})("selectedChange",function(a){C(d);let t=m();return A(t._goToDateInView(a,"month"))}),u()}if(r&2){let d=m();v("activeDate",d.activeDate)("selected",d.selected)("dateFilter",d.dateFilter)("maxDate",d.maxDate)("minDate",d.minDate)("dateClass",d.dateClass)}}function Ca(r,i){if(r&1){let d=he();c(0,"mat-multi-year-view",4),g("activeDateChange",function(a){C(d);let t=m();return A(t.activeDate=a)})("yearSelected",function(a){C(d);let t=m();return A(t._yearSelectedInMultiYearView(a))})("selectedChange",function(a){C(d);let t=m();return A(t._goToDateInView(a,"year"))}),u()}if(r&2){let d=m();v("activeDate",d.activeDate)("selected",d.selected)("dateFilter",d.dateFilter)("maxDate",d.maxDate)("minDate",d.minDate)("dateClass",d.dateClass)}}function Aa(r,i){}var wa=["button"];function ka(r,i){r&1&&(Ue(),c(0,"svg",3),$(1,"path",4),u())}var Ma=[[["","matDatepickerToggleIcon",""]]],Ia=["[matDatepickerToggleIcon]"],Va=[[["input","matStartDate",""]],[["input","matEndDate",""]]],Sa=["input[matStartDate]","input[matEndDate]"];function Ea(r,i){r&1&&(c(0,"div",0),ee(1),u())}var ye=(()=>{let i=class i{constructor(){this.changes=new B,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 24 years",this.nextMultiYearLabel="Next 24 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year",this.startDateLabel="Start date",this.endDateLabel="End date"}formatYearRange(e,a){return`${e} \u2013 ${a}`}formatYearRangeLabel(e,a){return`${e} to ${a}`}};i.\u0275fac=function(a){return new(a||i)},i.\u0275prov=J({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})(),be=class{constructor(i,d,e,a,t={},n=i,s){this.value=i,this.displayValue=d,this.ariaLabel=e,this.enabled=a,this.cssClasses=t,this.compareValue=n,this.rawValue=s}},xa=1,Gt=je({passive:!1,capture:!0}),q=je({passive:!0,capture:!0}),ze=je({passive:!0}),re=(()=>{let i=class i{ngAfterViewChecked(){this._focusActiveCellAfterViewChecked&&(this._focusActiveCell(),this._focusActiveCellAfterViewChecked=!1)}constructor(e,a){this._elementRef=e,this._ngZone=a,this._platform=le(Rt),this._focusActiveCellAfterViewChecked=!1,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new p,this.previewChange=new p,this.activeDateChange=new p,this.dragStarted=new p,this.dragEnded=new p,this._didDragSinceMouseDown=!1,this._enterHandler=t=>{if(this._skipNextFocus&&t.type==="focus"){this._skipNextFocus=!1;return}if(t.target&&this.isRange){let n=this._getCellFromElement(t.target);n&&this._ngZone.run(()=>this.previewChange.emit({value:n.enabled?n:null,event:t}))}},this._touchmoveHandler=t=>{if(!this.isRange)return;let n=Wt(t),s=n?this._getCellFromElement(n):null;n!==t.target&&(this._didDragSinceMouseDown=!0),lt(t.target)&&t.preventDefault(),this._ngZone.run(()=>this.previewChange.emit({value:s?.enabled?s:null,event:t}))},this._leaveHandler=t=>{this.previewEnd!==null&&this.isRange&&(t.type!=="blur"&&(this._didDragSinceMouseDown=!0),t.target&&this._getCellFromElement(t.target)&&!(t.relatedTarget&&this._getCellFromElement(t.relatedTarget))&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:t})))},this._mousedownHandler=t=>{if(!this.isRange)return;this._didDragSinceMouseDown=!1;let n=t.target&&this._getCellFromElement(t.target);!n||!this._isInRange(n.compareValue)||this._ngZone.run(()=>{this.dragStarted.emit({value:n.rawValue,event:t})})},this._mouseupHandler=t=>{if(!this.isRange)return;let n=lt(t.target);if(!n){this._ngZone.run(()=>{this.dragEnded.emit({value:null,event:t})});return}n.closest(".mat-calendar-body")===this._elementRef.nativeElement&&this._ngZone.run(()=>{let s=this._getCellFromElement(n);this.dragEnded.emit({value:s?.rawValue??null,event:t})})},this._touchendHandler=t=>{let n=Wt(t);n&&this._mouseupHandler({target:n})},this._id=`mat-calendar-body-${xa++}`,this._startDateLabelId=`${this._id}-start-date`,this._endDateLabelId=`${this._id}-end-date`,a.runOutsideAngular(()=>{let t=e.nativeElement;t.addEventListener("touchmove",this._touchmoveHandler,Gt),t.addEventListener("mouseenter",this._enterHandler,q),t.addEventListener("focus",this._enterHandler,q),t.addEventListener("mouseleave",this._leaveHandler,q),t.addEventListener("blur",this._leaveHandler,q),t.addEventListener("mousedown",this._mousedownHandler,ze),t.addEventListener("touchstart",this._mousedownHandler,ze),this._platform.isBrowser&&(window.addEventListener("mouseup",this._mouseupHandler),window.addEventListener("touchend",this._touchendHandler))})}_cellClicked(e,a){this._didDragSinceMouseDown||e.enabled&&this.selectedValueChange.emit({value:e.value,event:a})}_emitActiveDateChange(e,a){e.enabled&&this.activeDateChange.emit({value:e.value,event:a})}_isSelected(e){return this.startValue===e||this.endValue===e}ngOnChanges(e){let a=e.numCols,{rows:t,numCols:n}=this;(e.rows||a)&&(this._firstRowOffset=t&&t.length&&t[0].length?n-t[0].length:0),(e.cellAspectRatio||a||!this._cellPadding)&&(this._cellPadding=`${50*this.cellAspectRatio/n}%`),(a||!this._cellWidth)&&(this._cellWidth=`${100/n}%`)}ngOnDestroy(){let e=this._elementRef.nativeElement;e.removeEventListener("touchmove",this._touchmoveHandler,Gt),e.removeEventListener("mouseenter",this._enterHandler,q),e.removeEventListener("focus",this._enterHandler,q),e.removeEventListener("mouseleave",this._leaveHandler,q),e.removeEventListener("blur",this._leaveHandler,q),e.removeEventListener("mousedown",this._mousedownHandler,ze),e.removeEventListener("touchstart",this._mousedownHandler,ze),this._platform.isBrowser&&(window.removeEventListener("mouseup",this._mouseupHandler),window.removeEventListener("touchend",this._touchendHandler))}_isActiveCell(e,a){let t=e*this.numCols+a;return e&&(t-=this._firstRowOffset),t==this.activeCell}_focusActiveCell(e=!0){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Ae(1)).subscribe(()=>{setTimeout(()=>{let a=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");a&&(e||(this._skipNextFocus=!0),a.focus())})})})}_scheduleFocusActiveCellAfterViewChecked(){this._focusActiveCellAfterViewChecked=!0}_isRangeStart(e){return ct(e,this.startValue,this.endValue)}_isRangeEnd(e){return ht(e,this.startValue,this.endValue)}_isInRange(e){return ut(e,this.startValue,this.endValue,this.isRange)}_isComparisonStart(e){return ct(e,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(e,a,t){if(!this._isComparisonStart(e)||this._isRangeStart(e)||!this._isInRange(e))return!1;let n=this.rows[a][t-1];if(!n){let s=this.rows[a-1];n=s&&s[s.length-1]}return n&&!this._isRangeEnd(n.compareValue)}_isComparisonBridgeEnd(e,a,t){if(!this._isComparisonEnd(e)||this._isRangeEnd(e)||!this._isInRange(e))return!1;let n=this.rows[a][t+1];if(!n){let s=this.rows[a+1];n=s&&s[0]}return n&&!this._isRangeStart(n.compareValue)}_isComparisonEnd(e){return ht(e,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(e){return ut(e,this.comparisonStart,this.comparisonEnd,this.isRange)}_isComparisonIdentical(e){return this.comparisonStart===this.comparisonEnd&&e===this.comparisonStart}_isPreviewStart(e){return ct(e,this.previewStart,this.previewEnd)}_isPreviewEnd(e){return ht(e,this.previewStart,this.previewEnd)}_isInPreview(e){return ut(e,this.previewStart,this.previewEnd,this.isRange)}_getDescribedby(e){return this.isRange?this.startValue===e&&this.endValue===e?`${this._startDateLabelId} ${this._endDateLabelId}`:this.startValue===e?this._startDateLabelId:this.endValue===e?this._endDateLabelId:null:null}_getCellFromElement(e){let a=lt(e);if(a){let t=a.getAttribute("data-mat-row"),n=a.getAttribute("data-mat-col");if(t&&n)return this.rows[parseInt(t)][parseInt(n)]}return null}};i.\u0275fac=function(a){return new(a||i)(o(O),o(We))},i.\u0275cmp=y({type:i,selectors:[["","mat-calendar-body",""]],hostAttrs:[1,"mat-calendar-body"],inputs:{label:"label",rows:"rows",todayValue:"todayValue",startValue:"startValue",endValue:"endValue",labelMinRequiredCells:"labelMinRequiredCells",numCols:"numCols",activeCell:"activeCell",isRange:"isRange",cellAspectRatio:"cellAspectRatio",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",previewStart:"previewStart",previewEnd:"previewEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedValueChange:"selectedValueChange",previewChange:"previewChange",activeDateChange:"activeDateChange",dragStarted:"dragStarted",dragEnded:"dragEnded"},exportAs:["matCalendarBody"],features:[j],attrs:pa,decls:7,vars:5,consts:[["aria-hidden","true"],[1,"mat-calendar-body-hidden-label",3,"id"],[1,"mat-calendar-body-label"],["role","row"],["class","mat-calendar-body-label",3,"paddingTop","paddingBottom"],["role","gridcell",1,"mat-calendar-body-cell-container"],["type","button",1,"mat-calendar-body-cell",3,"ngClass","tabindex","click","focus"],[1,"mat-calendar-body-cell-content","mat-focus-indicator"],["aria-hidden","true",1,"mat-calendar-body-cell-preview"],["role","gridcell","class","mat-calendar-body-cell-container",3,"width","paddingTop","paddingBottom"]],template:function(a,t){a&1&&(z(0,ma,3,6,"tr",0),Re(1,fa,4,1,"tr",3,Fe),c(3,"label",1),D(4),u(),c(5,"label",1),D(6),u()),a&2&&(ce(0,t._firstRowOffset<t.labelMinRequiredCells?0:-1),h(1),Te(t.rows),h(2),v("id",t._startDateLabelId),h(1),te(" ",t.startDateAccessibleName,`
1
+ import{a as st,b as dt,c as qt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-LXDCPBTR.js";import{a as Ut}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-HXRWGEJ5.js";import{d as Qt,e as rt}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-2GCJVDVN.js";import{f as Yt,g as it,h as Nt,j as nt,k as Lt,l as Bt,o as jt,p as ge,s as Ht}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-V7X66MWE.js";import{D as at,E as Pt,F as X,J as zt,L as $t,O as Kt,R as _,S as T,U as He,a as N,f as Ft,g as W,h as Rt,j as je,m as Tt,y as Ot}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-45NXB6RE.js";import{a as Ye,d as Ne,e as _e,f as Et,g as xt,j as Le,n as Be}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-BREDWZJ7.js";import{$ as J,$a as $,A as oe,B as bt,Ba as O,Fa as h,Ga as o,Gb as It,Ha as wt,Hb as w,I as Ae,Ia as P,Ib as R,Ja as p,Jb as Pe,Ka as We,Kb as k,La as H,Na as b,Oa as v,Pa as xe,Qa as F,S as we,Ta as Xe,Ua as z,Va as ce,Vb as Vt,Wa as Fe,Xa as Re,Xb as Ze,Ya as Te,Z as ke,Za as c,_a as u,a as E,aa as Dt,ba as Me,c as B,ca as Ie,da as le,db as he,ea as y,eb as Oe,fa as yt,fb as kt,fc as St,ga as x,hb as g,ia as j,ib as Mt,ja as C,jb as m,ka as A,kb as ue,la as Ue,lb as ee,ma as Ct,n as Ce,na as Ge,oa as At,pa as Ve,pb as D,qa as Se,qb as Y,rb as te,sa as Ee,sc as Je,tb as K,tc as pe,wc as Q,xc as et,yc as tt,zc as me}from"https://cdn.jsdelivr.net/npm/marketplacepos@3.6.2/Marketplace/chunk-ZHLG7GCJ.js";var pa=["mat-calendar-body",""];function ma(r,i){if(r&1&&(c(0,"tr",0)(1,"td",2),D(2),u()()),r&2){let d=m();h(1),xe("padding-top",d._cellPadding)("padding-bottom",d._cellPadding),b("colspan",d.numCols),h(1),te(" ",d.label," ")}}function _a(r,i){if(r&1&&(c(0,"td",2),D(1),u()),r&2){let d=m(2);xe("padding-top",d._cellPadding)("padding-bottom",d._cellPadding),b("colspan",d._firstRowOffset),h(1),te(" ",d._firstRowOffset>=d.labelMinRequiredCells?d.label:""," ")}}function ga(r,i){if(r&1){let d=he();c(0,"td",5)(1,"button",6),g("click",function(a){let n=C(d).$implicit,s=m(2);return A(s._cellClicked(n,a))})("focus",function(a){let n=C(d).$implicit,s=m(2);return A(s._emitActiveDateChange(n,a))}),c(2,"span",7),D(3),u(),$(4,"span",8),u()()}if(r&2){let d=i.$implicit,e=i.$index,a=m().$index,t=m();xe("width",t._cellWidth)("padding-top",t._cellPadding)("padding-bottom",t._cellPadding),b("data-mat-row",a)("data-mat-col",e),h(1),F("mat-calendar-body-disabled",!d.enabled)("mat-calendar-body-active",t._isActiveCell(a,e))("mat-calendar-body-range-start",t._isRangeStart(d.compareValue))("mat-calendar-body-range-end",t._isRangeEnd(d.compareValue))("mat-calendar-body-in-range",t._isInRange(d.compareValue))("mat-calendar-body-comparison-bridge-start",t._isComparisonBridgeStart(d.compareValue,a,e))("mat-calendar-body-comparison-bridge-end",t._isComparisonBridgeEnd(d.compareValue,a,e))("mat-calendar-body-comparison-start",t._isComparisonStart(d.compareValue))("mat-calendar-body-comparison-end",t._isComparisonEnd(d.compareValue))("mat-calendar-body-in-comparison-range",t._isInComparisonRange(d.compareValue))("mat-calendar-body-preview-start",t._isPreviewStart(d.compareValue))("mat-calendar-body-preview-end",t._isPreviewEnd(d.compareValue))("mat-calendar-body-in-preview",t._isInPreview(d.compareValue)),v("ngClass",d.cssClasses)("tabindex",t._isActiveCell(a,e)?0:-1),b("aria-label",d.ariaLabel)("aria-disabled",!d.enabled||null)("aria-pressed",t._isSelected(d.compareValue))("aria-current",t.todayValue===d.compareValue?"date":null)("aria-describedby",t._getDescribedby(d.compareValue)),h(1),F("mat-calendar-body-selected",t._isSelected(d.compareValue))("mat-calendar-body-comparison-identical",t._isComparisonIdentical(d.compareValue))("mat-calendar-body-today",t.todayValue===d.compareValue),h(1),te(" ",d.displayValue," ")}}function fa(r,i){if(r&1&&(c(0,"tr",3),z(1,_a,2,6,"td",4),Re(2,ga,5,48,"td",9,Fe),u()),r&2){let d=i.$implicit,e=i.$index,a=m();h(1),ce(1,e===0&&a._firstRowOffset?1:-1),h(1),Te(d)}}function va(r,i){if(r&1&&(c(0,"th",4)(1,"span",5),D(2),u(),c(3,"span",6),D(4),u()()),r&2){let d=i.$implicit;h(2),Y(d.long),h(2),Y(d.narrow)}}var ia=["*"];function ba(r,i){}function Da(r,i){if(r&1){let d=he();c(0,"mat-month-view",2),g("activeDateChange",function(a){C(d);let t=m();return A(t.activeDate=a)})("_userSelection",function(a){C(d);let t=m();return A(t._dateSelected(a))})("dragStarted",function(a){C(d);let t=m();return A(t._dragStarted(a))})("dragEnded",function(a){C(d);let t=m();return A(t._dragEnded(a))}),u()}if(r&2){let d=m();v("activeDate",d.activeDate)("selected",d.selected)("dateFilter",d.dateFilter)("maxDate",d.maxDate)("minDate",d.minDate)("dateClass",d.dateClass)("comparisonStart",d.comparisonStart)("comparisonEnd",d.comparisonEnd)("startDateAccessibleName",d.startDateAccessibleName)("endDateAccessibleName",d.endDateAccessibleName)("activeDrag",d._activeDrag)}}function ya(r,i){if(r&1){let d=he();c(0,"mat-year-view",3),g("activeDateChange",function(a){C(d);let t=m();return A(t.activeDate=a)})("monthSelected",function(a){C(d);let t=m();return A(t._monthSelectedInYearView(a))})("selectedChange",function(a){C(d);let t=m();return A(t._goToDateInView(a,"month"))}),u()}if(r&2){let d=m();v("activeDate",d.activeDate)("selected",d.selected)("dateFilter",d.dateFilter)("maxDate",d.maxDate)("minDate",d.minDate)("dateClass",d.dateClass)}}function Ca(r,i){if(r&1){let d=he();c(0,"mat-multi-year-view",4),g("activeDateChange",function(a){C(d);let t=m();return A(t.activeDate=a)})("yearSelected",function(a){C(d);let t=m();return A(t._yearSelectedInMultiYearView(a))})("selectedChange",function(a){C(d);let t=m();return A(t._goToDateInView(a,"year"))}),u()}if(r&2){let d=m();v("activeDate",d.activeDate)("selected",d.selected)("dateFilter",d.dateFilter)("maxDate",d.maxDate)("minDate",d.minDate)("dateClass",d.dateClass)}}function Aa(r,i){}var wa=["button"];function ka(r,i){r&1&&(Ue(),c(0,"svg",3),$(1,"path",4),u())}var Ma=[[["","matDatepickerToggleIcon",""]]],Ia=["[matDatepickerToggleIcon]"],Va=[[["input","matStartDate",""]],[["input","matEndDate",""]]],Sa=["input[matStartDate]","input[matEndDate]"];function Ea(r,i){r&1&&(c(0,"div",0),ee(1),u())}var ye=(()=>{let i=class i{constructor(){this.changes=new B,this.calendarLabel="Calendar",this.openCalendarLabel="Open calendar",this.closeCalendarLabel="Close calendar",this.prevMonthLabel="Previous month",this.nextMonthLabel="Next month",this.prevYearLabel="Previous year",this.nextYearLabel="Next year",this.prevMultiYearLabel="Previous 24 years",this.nextMultiYearLabel="Next 24 years",this.switchToMonthViewLabel="Choose date",this.switchToMultiYearViewLabel="Choose month and year",this.startDateLabel="Start date",this.endDateLabel="End date"}formatYearRange(e,a){return`${e} \u2013 ${a}`}formatYearRangeLabel(e,a){return`${e} to ${a}`}};i.\u0275fac=function(a){return new(a||i)},i.\u0275prov=J({token:i,factory:i.\u0275fac,providedIn:"root"});let r=i;return r})(),be=class{constructor(i,d,e,a,t={},n=i,s){this.value=i,this.displayValue=d,this.ariaLabel=e,this.enabled=a,this.cssClasses=t,this.compareValue=n,this.rawValue=s}},xa=1,Gt=je({passive:!1,capture:!0}),q=je({passive:!0,capture:!0}),ze=je({passive:!0}),re=(()=>{let i=class i{ngAfterViewChecked(){this._focusActiveCellAfterViewChecked&&(this._focusActiveCell(),this._focusActiveCellAfterViewChecked=!1)}constructor(e,a){this._elementRef=e,this._ngZone=a,this._platform=le(Rt),this._focusActiveCellAfterViewChecked=!1,this.numCols=7,this.activeCell=0,this.isRange=!1,this.cellAspectRatio=1,this.previewStart=null,this.previewEnd=null,this.selectedValueChange=new p,this.previewChange=new p,this.activeDateChange=new p,this.dragStarted=new p,this.dragEnded=new p,this._didDragSinceMouseDown=!1,this._enterHandler=t=>{if(this._skipNextFocus&&t.type==="focus"){this._skipNextFocus=!1;return}if(t.target&&this.isRange){let n=this._getCellFromElement(t.target);n&&this._ngZone.run(()=>this.previewChange.emit({value:n.enabled?n:null,event:t}))}},this._touchmoveHandler=t=>{if(!this.isRange)return;let n=Wt(t),s=n?this._getCellFromElement(n):null;n!==t.target&&(this._didDragSinceMouseDown=!0),lt(t.target)&&t.preventDefault(),this._ngZone.run(()=>this.previewChange.emit({value:s?.enabled?s:null,event:t}))},this._leaveHandler=t=>{this.previewEnd!==null&&this.isRange&&(t.type!=="blur"&&(this._didDragSinceMouseDown=!0),t.target&&this._getCellFromElement(t.target)&&!(t.relatedTarget&&this._getCellFromElement(t.relatedTarget))&&this._ngZone.run(()=>this.previewChange.emit({value:null,event:t})))},this._mousedownHandler=t=>{if(!this.isRange)return;this._didDragSinceMouseDown=!1;let n=t.target&&this._getCellFromElement(t.target);!n||!this._isInRange(n.compareValue)||this._ngZone.run(()=>{this.dragStarted.emit({value:n.rawValue,event:t})})},this._mouseupHandler=t=>{if(!this.isRange)return;let n=lt(t.target);if(!n){this._ngZone.run(()=>{this.dragEnded.emit({value:null,event:t})});return}n.closest(".mat-calendar-body")===this._elementRef.nativeElement&&this._ngZone.run(()=>{let s=this._getCellFromElement(n);this.dragEnded.emit({value:s?.rawValue??null,event:t})})},this._touchendHandler=t=>{let n=Wt(t);n&&this._mouseupHandler({target:n})},this._id=`mat-calendar-body-${xa++}`,this._startDateLabelId=`${this._id}-start-date`,this._endDateLabelId=`${this._id}-end-date`,a.runOutsideAngular(()=>{let t=e.nativeElement;t.addEventListener("touchmove",this._touchmoveHandler,Gt),t.addEventListener("mouseenter",this._enterHandler,q),t.addEventListener("focus",this._enterHandler,q),t.addEventListener("mouseleave",this._leaveHandler,q),t.addEventListener("blur",this._leaveHandler,q),t.addEventListener("mousedown",this._mousedownHandler,ze),t.addEventListener("touchstart",this._mousedownHandler,ze),this._platform.isBrowser&&(window.addEventListener("mouseup",this._mouseupHandler),window.addEventListener("touchend",this._touchendHandler))})}_cellClicked(e,a){this._didDragSinceMouseDown||e.enabled&&this.selectedValueChange.emit({value:e.value,event:a})}_emitActiveDateChange(e,a){e.enabled&&this.activeDateChange.emit({value:e.value,event:a})}_isSelected(e){return this.startValue===e||this.endValue===e}ngOnChanges(e){let a=e.numCols,{rows:t,numCols:n}=this;(e.rows||a)&&(this._firstRowOffset=t&&t.length&&t[0].length?n-t[0].length:0),(e.cellAspectRatio||a||!this._cellPadding)&&(this._cellPadding=`${50*this.cellAspectRatio/n}%`),(a||!this._cellWidth)&&(this._cellWidth=`${100/n}%`)}ngOnDestroy(){let e=this._elementRef.nativeElement;e.removeEventListener("touchmove",this._touchmoveHandler,Gt),e.removeEventListener("mouseenter",this._enterHandler,q),e.removeEventListener("focus",this._enterHandler,q),e.removeEventListener("mouseleave",this._leaveHandler,q),e.removeEventListener("blur",this._leaveHandler,q),e.removeEventListener("mousedown",this._mousedownHandler,ze),e.removeEventListener("touchstart",this._mousedownHandler,ze),this._platform.isBrowser&&(window.removeEventListener("mouseup",this._mouseupHandler),window.removeEventListener("touchend",this._touchendHandler))}_isActiveCell(e,a){let t=e*this.numCols+a;return e&&(t-=this._firstRowOffset),t==this.activeCell}_focusActiveCell(e=!0){this._ngZone.runOutsideAngular(()=>{this._ngZone.onStable.pipe(Ae(1)).subscribe(()=>{setTimeout(()=>{let a=this._elementRef.nativeElement.querySelector(".mat-calendar-body-active");a&&(e||(this._skipNextFocus=!0),a.focus())})})})}_scheduleFocusActiveCellAfterViewChecked(){this._focusActiveCellAfterViewChecked=!0}_isRangeStart(e){return ct(e,this.startValue,this.endValue)}_isRangeEnd(e){return ht(e,this.startValue,this.endValue)}_isInRange(e){return ut(e,this.startValue,this.endValue,this.isRange)}_isComparisonStart(e){return ct(e,this.comparisonStart,this.comparisonEnd)}_isComparisonBridgeStart(e,a,t){if(!this._isComparisonStart(e)||this._isRangeStart(e)||!this._isInRange(e))return!1;let n=this.rows[a][t-1];if(!n){let s=this.rows[a-1];n=s&&s[s.length-1]}return n&&!this._isRangeEnd(n.compareValue)}_isComparisonBridgeEnd(e,a,t){if(!this._isComparisonEnd(e)||this._isRangeEnd(e)||!this._isInRange(e))return!1;let n=this.rows[a][t+1];if(!n){let s=this.rows[a+1];n=s&&s[0]}return n&&!this._isRangeStart(n.compareValue)}_isComparisonEnd(e){return ht(e,this.comparisonStart,this.comparisonEnd)}_isInComparisonRange(e){return ut(e,this.comparisonStart,this.comparisonEnd,this.isRange)}_isComparisonIdentical(e){return this.comparisonStart===this.comparisonEnd&&e===this.comparisonStart}_isPreviewStart(e){return ct(e,this.previewStart,this.previewEnd)}_isPreviewEnd(e){return ht(e,this.previewStart,this.previewEnd)}_isInPreview(e){return ut(e,this.previewStart,this.previewEnd,this.isRange)}_getDescribedby(e){return this.isRange?this.startValue===e&&this.endValue===e?`${this._startDateLabelId} ${this._endDateLabelId}`:this.startValue===e?this._startDateLabelId:this.endValue===e?this._endDateLabelId:null:null}_getCellFromElement(e){let a=lt(e);if(a){let t=a.getAttribute("data-mat-row"),n=a.getAttribute("data-mat-col");if(t&&n)return this.rows[parseInt(t)][parseInt(n)]}return null}};i.\u0275fac=function(a){return new(a||i)(o(O),o(We))},i.\u0275cmp=y({type:i,selectors:[["","mat-calendar-body",""]],hostAttrs:[1,"mat-calendar-body"],inputs:{label:"label",rows:"rows",todayValue:"todayValue",startValue:"startValue",endValue:"endValue",labelMinRequiredCells:"labelMinRequiredCells",numCols:"numCols",activeCell:"activeCell",isRange:"isRange",cellAspectRatio:"cellAspectRatio",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",previewStart:"previewStart",previewEnd:"previewEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedValueChange:"selectedValueChange",previewChange:"previewChange",activeDateChange:"activeDateChange",dragStarted:"dragStarted",dragEnded:"dragEnded"},exportAs:["matCalendarBody"],features:[j],attrs:pa,decls:7,vars:5,consts:[["aria-hidden","true"],[1,"mat-calendar-body-hidden-label",3,"id"],[1,"mat-calendar-body-label"],["role","row"],["class","mat-calendar-body-label",3,"paddingTop","paddingBottom"],["role","gridcell",1,"mat-calendar-body-cell-container"],["type","button",1,"mat-calendar-body-cell",3,"ngClass","tabindex","click","focus"],[1,"mat-calendar-body-cell-content","mat-focus-indicator"],["aria-hidden","true",1,"mat-calendar-body-cell-preview"],["role","gridcell","class","mat-calendar-body-cell-container",3,"width","paddingTop","paddingBottom"]],template:function(a,t){a&1&&(z(0,ma,3,6,"tr",0),Re(1,fa,4,1,"tr",3,Fe),c(3,"label",1),D(4),u(),c(5,"label",1),D(6),u()),a&2&&(ce(0,t._firstRowOffset<t.labelMinRequiredCells?0:-1),h(1),Te(t.rows),h(2),v("id",t._startDateLabelId),h(1),te(" ",t.startDateAccessibleName,`
2
2
  `),h(1),v("id",t._endDateLabelId),h(1),te(" ",t.endDateAccessibleName,`
3
3
  `))},dependencies:[Ze],styles:['.mat-calendar-body{min-width:224px}.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){border-color:var(--mat-datepicker-calendar-date-today-outline-color)}.mat-calendar-body-label{height:0;line-height:0;text-align:left;padding-left:4.7142857143%;padding-right:4.7142857143%;font-size:var(--mat-datepicker-calendar-body-label-text-size);font-weight:var(--mat-datepicker-calendar-body-label-text-weight);color:var(--mat-datepicker-calendar-body-label-text-color)}.mat-calendar-body-hidden-label{display:none}.mat-calendar-body-cell-container{position:relative;height:0;line-height:0}.mat-calendar-body-cell{-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;top:0;left:0;width:100%;height:100%;background:none;text-align:center;outline:none;font-family:inherit;margin:0}.mat-calendar-body-cell::-moz-focus-inner{border:0}.mat-calendar-body-cell::before,.mat-calendar-body-cell::after,.mat-calendar-body-cell-preview{content:"";position:absolute;top:5%;left:0;z-index:0;box-sizing:border-box;display:block;height:90%;width:100%}.mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-start::after,.mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,.mat-calendar-body-comparison-start::after,.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:5%;width:95%;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-range-start:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-start:not(.mat-calendar-body-comparison-bridge-start)::before,[dir=rtl] .mat-calendar-body-comparison-start::after,[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{left:0;border-radius:0;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,.mat-calendar-body-comparison-end::after,.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}[dir=rtl] .mat-calendar-body-range-end:not(.mat-calendar-body-in-comparison-range)::before,[dir=rtl] .mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-end:not(.mat-calendar-body-comparison-bridge-end)::before,[dir=rtl] .mat-calendar-body-comparison-end::after,[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{left:5%;border-radius:0;border-top-left-radius:999px;border-bottom-left-radius:999px}[dir=rtl] .mat-calendar-body-comparison-bridge-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-bridge-end.mat-calendar-body-range-start::after{width:95%;border-top-right-radius:999px;border-bottom-right-radius:999px}.mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,[dir=rtl] .mat-calendar-body-comparison-start.mat-calendar-body-range-end::after,.mat-calendar-body-comparison-end.mat-calendar-body-range-start::after,[dir=rtl] .mat-calendar-body-comparison-end.mat-calendar-body-range-start::after{width:90%}.mat-calendar-body-in-preview{color:var(--mat-datepicker-calendar-date-preview-state-outline-color)}.mat-calendar-body-in-preview .mat-calendar-body-cell-preview{border-top:dashed 1px;border-bottom:dashed 1px}.mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:dashed 1px}[dir=rtl] .mat-calendar-body-preview-start .mat-calendar-body-cell-preview{border-left:0;border-right:dashed 1px}.mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:dashed 1px}[dir=rtl] .mat-calendar-body-preview-end .mat-calendar-body-cell-preview{border-right:0;border-left:dashed 1px}.mat-calendar-body-disabled{cursor:default}.mat-calendar-body-disabled>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){color:var(--mat-datepicker-calendar-date-disabled-state-text-color)}.mat-calendar-body-disabled>.mat-calendar-body-today:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){border-color:var(--mat-datepicker-calendar-date-today-disabled-state-outline-color)}.cdk-high-contrast-active .mat-calendar-body-disabled{opacity:.5}.mat-calendar-body-cell-content{top:5%;left:5%;z-index:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;line-height:1;border-width:1px;border-style:solid;border-radius:999px;color:var(--mat-datepicker-calendar-date-text-color);border-color:var(--mat-datepicker-calendar-date-outline-color)}.mat-calendar-body-cell-content.mat-focus-indicator{position:absolute}.cdk-high-contrast-active .mat-calendar-body-cell-content{border:none}.cdk-keyboard-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical),.cdk-program-focused .mat-calendar-body-active>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-focus-state-background-color)}@media(hover: hover){.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background-color:var(--mat-datepicker-calendar-date-hover-state-background-color)}}.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-state-background-color);color:var(--mat-datepicker-calendar-date-selected-state-text-color)}.mat-calendar-body-disabled>.mat-calendar-body-selected{background-color:var(--mat-datepicker-calendar-date-selected-disabled-state-background-color)}.mat-calendar-body-selected.mat-calendar-body-today{box-shadow:inset 0 0 0 1px var(--mat-datepicker-calendar-date-today-selected-state-outline-color)}.mat-calendar-body-in-range::before{background:var(--mat-datepicker-calendar-date-in-range-state-background-color)}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color)}.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range::before{background:var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color)}.mat-calendar-body-comparison-bridge-start::before,[dir=rtl] .mat-calendar-body-comparison-bridge-end::before{background:linear-gradient(to right, var(--mat-datepicker-calendar-date-in-range-state-background-color) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color) 50%)}.mat-calendar-body-comparison-bridge-end::before,[dir=rtl] .mat-calendar-body-comparison-bridge-start::before{background:linear-gradient(to left, var(--mat-datepicker-calendar-date-in-range-state-background-color) 50%, var(--mat-datepicker-calendar-date-in-comparison-range-state-background-color) 50%)}.mat-calendar-body-in-range>.mat-calendar-body-comparison-identical,.mat-calendar-body-in-comparison-range.mat-calendar-body-in-range::after{background:var(--mat-datepicker-calendar-date-in-overlap-range-state-background-color)}.mat-calendar-body-comparison-identical.mat-calendar-body-selected,.mat-calendar-body-in-comparison-range>.mat-calendar-body-selected{background:var(--mat-datepicker-calendar-date-in-overlap-range-selected-state-background-color)}.cdk-high-contrast-active .mat-datepicker-popup:not(:empty),.cdk-high-contrast-active .mat-calendar-body-cell:not(.mat-calendar-body-in-range) .mat-calendar-body-selected{outline:solid 1px}.cdk-high-contrast-active .mat-calendar-body-today{outline:dotted 1px}.cdk-high-contrast-active .mat-calendar-body-cell::before,.cdk-high-contrast-active .mat-calendar-body-cell::after,.cdk-high-contrast-active .mat-calendar-body-selected{background:none}.cdk-high-contrast-active .mat-calendar-body-in-range::before,.cdk-high-contrast-active .mat-calendar-body-comparison-bridge-start::before,.cdk-high-contrast-active .mat-calendar-body-comparison-bridge-end::before{border-top:solid 1px;border-bottom:solid 1px}.cdk-high-contrast-active .mat-calendar-body-range-start::before{border-left:solid 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-range-start::before{border-left:0;border-right:solid 1px}.cdk-high-contrast-active .mat-calendar-body-range-end::before{border-right:solid 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-range-end::before{border-right:0;border-left:solid 1px}.cdk-high-contrast-active .mat-calendar-body-in-comparison-range::before{border-top:dashed 1px;border-bottom:dashed 1px}.cdk-high-contrast-active .mat-calendar-body-comparison-start::before{border-left:dashed 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-comparison-start::before{border-left:0;border-right:dashed 1px}.cdk-high-contrast-active .mat-calendar-body-comparison-end::before{border-right:dashed 1px}[dir=rtl] .cdk-high-contrast-active .mat-calendar-body-comparison-end::before{border-right:0;border-left:dashed 1px}[dir=rtl] .mat-calendar-body-label{text-align:right}'],encapsulation:2,changeDetection:0});let r=i;return r})();function ot(r){return r?.nodeName==="TD"}function lt(r){let i;return ot(r)?i=r:ot(r.parentNode)?i=r.parentNode:ot(r.parentNode?.parentNode)&&(i=r.parentNode.parentNode),i?.getAttribute("data-mat-row")!=null?i:null}function ct(r,i,d){return d!==null&&i!==d&&r<d&&r===i}function ht(r,i,d){return i!==null&&i!==d&&r>=i&&r===d}function ut(r,i,d,e){return e&&i!==null&&d!==null&&i!==d&&r>=i&&r<=d}function Wt(r){let i=r.changedTouches[0];return document.elementFromPoint(i.clientX,i.clientY)}var f=class{constructor(i,d){this.start=i,this.end=d}},U=(()=>{let i=class i{constructor(e,a){this.selection=e,this._adapter=a,this._selectionChanged=new B,this.selectionChanged=this._selectionChanged,this.selection=e}updateSelection(e,a){let t=this.selection;this.selection=e,this._selectionChanged.next({selection:e,source:a,oldValue:t})}ngOnDestroy(){this._selectionChanged.complete()}_isValidDateInstance(e){return this._adapter.isDateInstance(e)&&this._adapter.isValid(e)}};i.\u0275fac=function(a){wt()},i.\u0275prov=J({token:i,factory:i.\u0275fac});let r=i;return r})(),Fa=(()=>{let i=class i extends U{constructor(e){super(null,e)}add(e){super.updateSelection(e,this)}isValid(){return this.selection!=null&&this._isValidDateInstance(this.selection)}isComplete(){return this.selection!=null}clone(){let e=new i(this._adapter);return e.updateSelection(this.selection,this),e}};i.\u0275fac=function(a){return new(a||i)(Ie(_))},i.\u0275prov=J({token:i,factory:i.\u0275fac});let r=i;return r})(),Ra=(()=>{let i=class i extends U{constructor(e){super(new f(null,null),e)}add(e){let{start:a,end:t}=this.selection;a==null?a=e:t==null?t=e:(a=e,t=null),super.updateSelection(new f(a,t),this)}isValid(){let{start:e,end:a}=this.selection;return e==null&&a==null?!0:e!=null&&a!=null?this._isValidDateInstance(e)&&this._isValidDateInstance(a)&&this._adapter.compareDate(e,a)<=0:(e==null||this._isValidDateInstance(e))&&(a==null||this._isValidDateInstance(a))}isComplete(){return this.selection.start!=null&&this.selection.end!=null}clone(){let e=new i(this._adapter);return e.updateSelection(this.selection,this),e}};i.\u0275fac=function(a){return new(a||i)(Ie(_))},i.\u0275prov=J({token:i,factory:i.\u0275fac});let r=i;return r})();function Ta(r,i){return r||new Fa(i)}var na={provide:U,deps:[[new Ve,new Se,U],_],useFactory:Ta};function Oa(r,i){return r||new Ra(i)}var Pa={provide:U,deps:[[new Ve,new Se,U],_],useFactory:Oa},$e=new Me("MAT_DATE_RANGE_SELECTION_STRATEGY"),Ya=(()=>{let i=class i{constructor(e){this._dateAdapter=e}selectionFinished(e,a){let{start:t,end:n}=a;return t==null?t=e:n==null&&e&&this._dateAdapter.compareDate(e,t)>=0?n=e:(t=e,n=null),new f(t,n)}createPreview(e,a){let t=null,n=null;return a.start&&!a.end&&e&&(t=a.start,n=e),new f(t,n)}createDrag(e,a,t){let n=a.start,s=a.end;if(!n||!s)return null;let l=this._dateAdapter,I=l.compareDate(n,s)!==0,V=l.getYear(t)-l.getYear(e),L=l.getMonth(t)-l.getMonth(e),S=l.getDate(t)-l.getDate(e);return I&&l.sameDate(e,a.start)?(n=t,l.compareDate(t,s)>0&&(s=l.addCalendarYears(s,V),s=l.addCalendarMonths(s,L),s=l.addCalendarDays(s,S))):I&&l.sameDate(e,a.end)?(s=t,l.compareDate(t,n)<0&&(n=l.addCalendarYears(n,V),n=l.addCalendarMonths(n,L),n=l.addCalendarDays(n,S))):(n=l.addCalendarYears(n,V),n=l.addCalendarMonths(n,L),n=l.addCalendarDays(n,S),s=l.addCalendarYears(s,V),s=l.addCalendarMonths(s,L),s=l.addCalendarDays(s,S)),new f(n,s)}};i.\u0275fac=function(a){return new(a||i)(Ie(_))},i.\u0275prov=J({token:i,factory:i.\u0275fac});let r=i;return r})();function Na(r,i){return r||new Ya(i)}var La={provide:$e,deps:[[new Ve,new Se,$e],_],useFactory:Na},pt=7,Xt=(()=>{let i=class i{get activeDate(){return this._activeDate}set activeDate(e){let a=this._activeDate,t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(t,this.minDate,this.maxDate),this._hasSameMonthAndYear(a,this._activeDate)||this._init()}get selected(){return this._selected}set selected(e){e instanceof f?this._selected=e:this._selected=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setRanges(this._selected)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}constructor(e,a,t,n,s){this._changeDetectorRef=e,this._dateFormats=a,this._dateAdapter=t,this._dir=n,this._rangeStrategy=s,this._rerenderSubscription=E.EMPTY,this.activeDrag=null,this.selectedChange=new p,this._userSelection=new p,this.dragStarted=new p,this.dragEnded=new p,this.activeDateChange=new p,this._activeDate=this._dateAdapter.today()}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(we(null)).subscribe(()=>this._init())}ngOnChanges(e){let a=e.comparisonStart||e.comparisonEnd;a&&!a.firstChange&&this._setRanges(this.selected),e.activeDrag&&!this.activeDrag&&this._clearPreview()}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_dateSelected(e){let a=e.value,t=this._getDateFromDayOfMonth(a),n,s;this._selected instanceof f?(n=this._getDateInCurrentMonth(this._selected.start),s=this._getDateInCurrentMonth(this._selected.end)):n=s=this._getDateInCurrentMonth(this._selected),(n!==a||s!==a)&&this.selectedChange.emit(t),this._userSelection.emit({value:t,event:e.event}),this._clearPreview(),this._changeDetectorRef.markForCheck()}_updateActiveDate(e){let a=e.value,t=this._activeDate;this.activeDate=this._getDateFromDayOfMonth(a),this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this._activeDate)}_handleCalendarBodyKeydown(e){let a=this._activeDate,t=this._isRtl();switch(e.keyCode){case 37:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,t?1:-1);break;case 39:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,t?-1:1);break;case 38:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,-7);break;case 40:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,7);break;case 36:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,1-this._dateAdapter.getDate(this._activeDate));break;case 35:this.activeDate=this._dateAdapter.addCalendarDays(this._activeDate,this._dateAdapter.getNumDaysInMonth(this._activeDate)-this._dateAdapter.getDate(this._activeDate));break;case 33:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,-1):this._dateAdapter.addCalendarMonths(this._activeDate,-1);break;case 34:this.activeDate=e.altKey?this._dateAdapter.addCalendarYears(this._activeDate,1):this._dateAdapter.addCalendarMonths(this._activeDate,1);break;case 13:case 32:this._selectionKeyPressed=!0,this._canSelect(this._activeDate)&&e.preventDefault();return;case 27:this._previewEnd!=null&&!W(e)&&(this._clearPreview(),this.activeDrag?this.dragEnded.emit({value:null,event:e}):(this.selectedChange.emit(null),this._userSelection.emit({value:null,event:e})),e.preventDefault(),e.stopPropagation());return;default:return}this._dateAdapter.compareDate(a,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===32||e.keyCode===13)&&(this._selectionKeyPressed&&this._canSelect(this._activeDate)&&this._dateSelected({value:this._dateAdapter.getDate(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setRanges(this.selected),this._todayDate=this._getCellCompareValue(this._dateAdapter.today()),this._monthLabel=this._dateFormats.display.monthLabel?this._dateAdapter.format(this.activeDate,this._dateFormats.display.monthLabel):this._dateAdapter.getMonthNames("short")[this._dateAdapter.getMonth(this.activeDate)].toLocaleUpperCase();let e=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),1);this._firstWeekOffset=(pt+this._dateAdapter.getDayOfWeek(e)-this._dateAdapter.getFirstDayOfWeek())%pt,this._initWeekdays(),this._createWeekCells(),this._changeDetectorRef.markForCheck()}_focusActiveCell(e){this._matCalendarBody._focusActiveCell(e)}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_previewChanged({event:e,value:a}){if(this._rangeStrategy){let t=a?a.rawValue:null,n=this._rangeStrategy.createPreview(t,this.selected,e);if(this._previewStart=this._getCellCompareValue(n.start),this._previewEnd=this._getCellCompareValue(n.end),this.activeDrag&&t){let s=this._rangeStrategy.createDrag?.(this.activeDrag.value,this.selected,t,e);s&&(this._previewStart=this._getCellCompareValue(s.start),this._previewEnd=this._getCellCompareValue(s.end))}this._changeDetectorRef.detectChanges()}}_dragEnded(e){if(this.activeDrag)if(e.value){let a=this._rangeStrategy?.createDrag?.(this.activeDrag.value,this.selected,e.value,e.event);this.dragEnded.emit({value:a??null,event:e.event})}else this.dragEnded.emit({value:null,event:e.event})}_getDateFromDayOfMonth(e){return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),e)}_initWeekdays(){let e=this._dateAdapter.getFirstDayOfWeek(),a=this._dateAdapter.getDayOfWeekNames("narrow"),n=this._dateAdapter.getDayOfWeekNames("long").map((s,l)=>({long:s,narrow:a[l]}));this._weekdays=n.slice(e).concat(n.slice(0,e))}_createWeekCells(){let e=this._dateAdapter.getNumDaysInMonth(this.activeDate),a=this._dateAdapter.getDateNames();this._weeks=[[]];for(let t=0,n=this._firstWeekOffset;t<e;t++,n++){n==pt&&(this._weeks.push([]),n=0);let s=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),this._dateAdapter.getMonth(this.activeDate),t+1),l=this._shouldEnableDate(s),I=this._dateAdapter.format(s,this._dateFormats.display.dateA11yLabel),V=this.dateClass?this.dateClass(s,"month"):void 0;this._weeks[this._weeks.length-1].push(new be(t+1,a[t],I,l,V,this._getCellCompareValue(s),s))}}_shouldEnableDate(e){return!!e&&(!this.minDate||this._dateAdapter.compareDate(e,this.minDate)>=0)&&(!this.maxDate||this._dateAdapter.compareDate(e,this.maxDate)<=0)&&(!this.dateFilter||this.dateFilter(e))}_getDateInCurrentMonth(e){return e&&this._hasSameMonthAndYear(e,this.activeDate)?this._dateAdapter.getDate(e):null}_hasSameMonthAndYear(e,a){return!!(e&&a&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(a)&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(a))}_getCellCompareValue(e){if(e){let a=this._dateAdapter.getYear(e),t=this._dateAdapter.getMonth(e),n=this._dateAdapter.getDate(e);return new Date(a,t,n).getTime()}return null}_isRtl(){return this._dir&&this._dir.value==="rtl"}_setRanges(e){e instanceof f?(this._rangeStart=this._getCellCompareValue(e.start),this._rangeEnd=this._getCellCompareValue(e.end),this._isRange=!0):(this._rangeStart=this._rangeEnd=this._getCellCompareValue(e),this._isRange=!1),this._comparisonRangeStart=this._getCellCompareValue(this.comparisonStart),this._comparisonRangeEnd=this._getCellCompareValue(this.comparisonEnd)}_canSelect(e){return!this.dateFilter||this.dateFilter(e)}_clearPreview(){this._previewStart=this._previewEnd=null}};i.\u0275fac=function(a){return new(a||i)(o(P),o(T,8),o(_,8),o(X,8),o($e,8))},i.\u0275cmp=y({type:i,selectors:[["mat-month-view"]],viewQuery:function(a,t){if(a&1&&R(re,5),a&2){let n;w(n=k())&&(t._matCalendarBody=n.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName",activeDrag:"activeDrag"},outputs:{selectedChange:"selectedChange",_userSelection:"_userSelection",dragStarted:"dragStarted",dragEnded:"dragEnded",activeDateChange:"activeDateChange"},exportAs:["matMonthView"],features:[j],decls:8,vars:14,consts:[["role","grid",1,"mat-calendar-table"],[1,"mat-calendar-table-header"],["aria-hidden","true","colspan","7",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","comparisonStart","comparisonEnd","previewStart","previewEnd","isRange","labelMinRequiredCells","activeCell","startDateAccessibleName","endDateAccessibleName","selectedValueChange","activeDateChange","previewChange","dragStarted","dragEnded","keyup","keydown"],["scope","col"],[1,"cdk-visually-hidden"],["aria-hidden","true"]],template:function(a,t){a&1&&(c(0,"table",0)(1,"thead",1)(2,"tr"),Re(3,va,5,2,"th",4,Fe),u(),c(5,"tr"),$(6,"th",2),u()(),c(7,"tbody",3),g("selectedValueChange",function(s){return t._dateSelected(s)})("activeDateChange",function(s){return t._updateActiveDate(s)})("previewChange",function(s){return t._previewChanged(s)})("dragStarted",function(s){return t.dragStarted.emit(s)})("dragEnded",function(s){return t._dragEnded(s)})("keyup",function(s){return t._handleCalendarBodyKeyup(s)})("keydown",function(s){return t._handleCalendarBodyKeydown(s)}),u()()),a&2&&(h(3),Te(t._weekdays),h(4),v("label",t._monthLabel)("rows",t._weeks)("todayValue",t._todayDate)("startValue",t._rangeStart)("endValue",t._rangeEnd)("comparisonStart",t._comparisonRangeStart)("comparisonEnd",t._comparisonRangeEnd)("previewStart",t._previewStart)("previewEnd",t._previewEnd)("isRange",t._isRange)("labelMinRequiredCells",3)("activeCell",t._dateAdapter.getDate(t.activeDate)-1)("startDateAccessibleName",t.startDateAccessibleName)("endDateAccessibleName",t.endDateAccessibleName))},dependencies:[re],encapsulation:2,changeDetection:0});let r=i;return r})(),M=24,mt=4,Zt=(()=>{let i=class i{get activeDate(){return this._activeDate}set activeDate(e){let a=this._activeDate,t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(t,this.minDate,this.maxDate),ra(this._dateAdapter,a,this._activeDate,this.minDate,this.maxDate)||this._init()}get selected(){return this._selected}set selected(e){e instanceof f?this._selected=e:this._selected=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedYear(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}constructor(e,a,t){this._changeDetectorRef=e,this._dateAdapter=a,this._dir=t,this._rerenderSubscription=E.EMPTY,this.selectedChange=new p,this.yearSelected=new p,this.activeDateChange=new p,this._dateAdapter,this._activeDate=this._dateAdapter.today()}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(we(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_init(){this._todayYear=this._dateAdapter.getYear(this._dateAdapter.today());let a=this._dateAdapter.getYear(this._activeDate)-fe(this._dateAdapter,this.activeDate,this.minDate,this.maxDate);this._years=[];for(let t=0,n=[];t<M;t++)n.push(a+t),n.length==mt&&(this._years.push(n.map(s=>this._createCellForYear(s))),n=[]);this._changeDetectorRef.markForCheck()}_yearSelected(e){let a=e.value,t=this._dateAdapter.createDate(a,0,1),n=this._getDateFromYear(a);this.yearSelected.emit(t),this.selectedChange.emit(n)}_updateActiveDate(e){let a=e.value,t=this._activeDate;this.activeDate=this._getDateFromYear(a),this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){let a=this._activeDate,t=this._isRtl();switch(e.keyCode){case 37:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t?1:-1);break;case 39:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,t?-1:1);break;case 38:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-mt);break;case 40:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,mt);break;case 36:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,-fe(this._dateAdapter,this.activeDate,this.minDate,this.maxDate));break;case 35:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,M-fe(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)-1);break;case 33:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-M*10:-M);break;case 34:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?M*10:M);break;case 13:case 32:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(a,this.activeDate)&&this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked(),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===32||e.keyCode===13)&&(this._selectionKeyPressed&&this._yearSelected({value:this._dateAdapter.getYear(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_getActiveCell(){return fe(this._dateAdapter,this.activeDate,this.minDate,this.maxDate)}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getDateFromYear(e){let a=this._dateAdapter.getMonth(this.activeDate),t=this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(e,a,1));return this._dateAdapter.createDate(e,a,Math.min(this._dateAdapter.getDate(this.activeDate),t))}_createCellForYear(e){let a=this._dateAdapter.createDate(e,0,1),t=this._dateAdapter.getYearName(a),n=this.dateClass?this.dateClass(a,"multi-year"):void 0;return new be(e,t,t,this._shouldEnableYear(e),n)}_shouldEnableYear(e){if(e==null||this.maxDate&&e>this._dateAdapter.getYear(this.maxDate)||this.minDate&&e<this._dateAdapter.getYear(this.minDate))return!1;if(!this.dateFilter)return!0;let a=this._dateAdapter.createDate(e,0,1);for(let t=a;this._dateAdapter.getYear(t)==e;t=this._dateAdapter.addCalendarDays(t,1))if(this.dateFilter(t))return!0;return!1}_isRtl(){return this._dir&&this._dir.value==="rtl"}_setSelectedYear(e){if(this._selectedYear=null,e instanceof f){let a=e.start||e.end;a&&(this._selectedYear=this._dateAdapter.getYear(a))}else e&&(this._selectedYear=this._dateAdapter.getYear(e))}};i.\u0275fac=function(a){return new(a||i)(o(P),o(_,8),o(X,8))},i.\u0275cmp=y({type:i,selectors:[["mat-multi-year-view"]],viewQuery:function(a,t){if(a&1&&R(re,5),a&2){let n;w(n=k())&&(t._matCalendarBody=n.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",activeDateChange:"activeDateChange"},exportAs:["matMultiYearView"],decls:5,vars:7,consts:[["role","grid",1,"mat-calendar-table"],["aria-hidden","true",1,"mat-calendar-table-header"],["colspan","4",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"rows","todayValue","startValue","endValue","numCols","cellAspectRatio","activeCell","selectedValueChange","activeDateChange","keyup","keydown"]],template:function(a,t){a&1&&(c(0,"table",0)(1,"thead",1)(2,"tr"),$(3,"th",2),u()(),c(4,"tbody",3),g("selectedValueChange",function(s){return t._yearSelected(s)})("activeDateChange",function(s){return t._updateActiveDate(s)})("keyup",function(s){return t._handleCalendarBodyKeyup(s)})("keydown",function(s){return t._handleCalendarBodyKeydown(s)}),u()()),a&2&&(h(4),v("rows",t._years)("todayValue",t._todayYear)("startValue",t._selectedYear)("endValue",t._selectedYear)("numCols",4)("cellAspectRatio",4/7)("activeCell",t._getActiveCell()))},dependencies:[re],encapsulation:2,changeDetection:0});let r=i;return r})();function ra(r,i,d,e,a){let t=r.getYear(i),n=r.getYear(d),s=sa(r,e,a);return Math.floor((t-s)/M)===Math.floor((n-s)/M)}function fe(r,i,d,e){let a=r.getYear(i);return Ba(a-sa(r,d,e),M)}function sa(r,i,d){let e=0;return d?e=r.getYear(d)-M+1:i&&(e=r.getYear(i)),e}function Ba(r,i){return(r%i+i)%i}var Jt=(()=>{let i=class i{get activeDate(){return this._activeDate}set activeDate(e){let a=this._activeDate,t=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))||this._dateAdapter.today();this._activeDate=this._dateAdapter.clampDate(t,this.minDate,this.maxDate),this._dateAdapter.getYear(a)!==this._dateAdapter.getYear(this._activeDate)&&this._init()}get selected(){return this._selected}set selected(e){e instanceof f?this._selected=e:this._selected=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e)),this._setSelectedMonth(e)}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}constructor(e,a,t,n){this._changeDetectorRef=e,this._dateFormats=a,this._dateAdapter=t,this._dir=n,this._rerenderSubscription=E.EMPTY,this.selectedChange=new p,this.monthSelected=new p,this.activeDateChange=new p,this._activeDate=this._dateAdapter.today()}ngAfterContentInit(){this._rerenderSubscription=this._dateAdapter.localeChanges.pipe(we(null)).subscribe(()=>this._init())}ngOnDestroy(){this._rerenderSubscription.unsubscribe()}_monthSelected(e){let a=e.value,t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),a,1);this.monthSelected.emit(t);let n=this._getDateFromMonth(a);this.selectedChange.emit(n)}_updateActiveDate(e){let a=e.value,t=this._activeDate;this.activeDate=this._getDateFromMonth(a),this._dateAdapter.compareDate(t,this.activeDate)&&this.activeDateChange.emit(this.activeDate)}_handleCalendarBodyKeydown(e){let a=this._activeDate,t=this._isRtl();switch(e.keyCode){case 37:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,t?1:-1);break;case 39:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,t?-1:1);break;case 38:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-4);break;case 40:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,4);break;case 36:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,-this._dateAdapter.getMonth(this._activeDate));break;case 35:this.activeDate=this._dateAdapter.addCalendarMonths(this._activeDate,11-this._dateAdapter.getMonth(this._activeDate));break;case 33:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?-10:-1);break;case 34:this.activeDate=this._dateAdapter.addCalendarYears(this._activeDate,e.altKey?10:1);break;case 13:case 32:this._selectionKeyPressed=!0;break;default:return}this._dateAdapter.compareDate(a,this.activeDate)&&(this.activeDateChange.emit(this.activeDate),this._focusActiveCellAfterViewChecked()),e.preventDefault()}_handleCalendarBodyKeyup(e){(e.keyCode===32||e.keyCode===13)&&(this._selectionKeyPressed&&this._monthSelected({value:this._dateAdapter.getMonth(this._activeDate),event:e}),this._selectionKeyPressed=!1)}_init(){this._setSelectedMonth(this.selected),this._todayMonth=this._getMonthInCurrentYear(this._dateAdapter.today()),this._yearLabel=this._dateAdapter.getYearName(this.activeDate);let e=this._dateAdapter.getMonthNames("short");this._months=[[0,1,2,3],[4,5,6,7],[8,9,10,11]].map(a=>a.map(t=>this._createCellForMonth(t,e[t]))),this._changeDetectorRef.markForCheck()}_focusActiveCell(){this._matCalendarBody._focusActiveCell()}_focusActiveCellAfterViewChecked(){this._matCalendarBody._scheduleFocusActiveCellAfterViewChecked()}_getMonthInCurrentYear(e){return e&&this._dateAdapter.getYear(e)==this._dateAdapter.getYear(this.activeDate)?this._dateAdapter.getMonth(e):null}_getDateFromMonth(e){let a=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),t=this._dateAdapter.getNumDaysInMonth(a);return this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,Math.min(this._dateAdapter.getDate(this.activeDate),t))}_createCellForMonth(e,a){let t=this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate),e,1),n=this._dateAdapter.format(t,this._dateFormats.display.monthYearA11yLabel),s=this.dateClass?this.dateClass(t,"year"):void 0;return new be(e,a.toLocaleUpperCase(),n,this._shouldEnableMonth(e),s)}_shouldEnableMonth(e){let a=this._dateAdapter.getYear(this.activeDate);if(e==null||this._isYearAndMonthAfterMaxDate(a,e)||this._isYearAndMonthBeforeMinDate(a,e))return!1;if(!this.dateFilter)return!0;let t=this._dateAdapter.createDate(a,e,1);for(let n=t;this._dateAdapter.getMonth(n)==e;n=this._dateAdapter.addCalendarDays(n,1))if(this.dateFilter(n))return!0;return!1}_isYearAndMonthAfterMaxDate(e,a){if(this.maxDate){let t=this._dateAdapter.getYear(this.maxDate),n=this._dateAdapter.getMonth(this.maxDate);return e>t||e===t&&a>n}return!1}_isYearAndMonthBeforeMinDate(e,a){if(this.minDate){let t=this._dateAdapter.getYear(this.minDate),n=this._dateAdapter.getMonth(this.minDate);return e<t||e===t&&a<n}return!1}_isRtl(){return this._dir&&this._dir.value==="rtl"}_setSelectedMonth(e){e instanceof f?this._selectedMonth=this._getMonthInCurrentYear(e.start)||this._getMonthInCurrentYear(e.end):this._selectedMonth=this._getMonthInCurrentYear(e)}};i.\u0275fac=function(a){return new(a||i)(o(P),o(T,8),o(_,8),o(X,8))},i.\u0275cmp=y({type:i,selectors:[["mat-year-view"]],viewQuery:function(a,t){if(a&1&&R(re,5),a&2){let n;w(n=k())&&(t._matCalendarBody=n.first)}},inputs:{activeDate:"activeDate",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass"},outputs:{selectedChange:"selectedChange",monthSelected:"monthSelected",activeDateChange:"activeDateChange"},exportAs:["matYearView"],decls:5,vars:9,consts:[["role","grid",1,"mat-calendar-table"],["aria-hidden","true",1,"mat-calendar-table-header"],["colspan","4",1,"mat-calendar-table-header-divider"],["mat-calendar-body","",3,"label","rows","todayValue","startValue","endValue","labelMinRequiredCells","numCols","cellAspectRatio","activeCell","selectedValueChange","activeDateChange","keyup","keydown"]],template:function(a,t){a&1&&(c(0,"table",0)(1,"thead",1)(2,"tr"),$(3,"th",2),u()(),c(4,"tbody",3),g("selectedValueChange",function(s){return t._monthSelected(s)})("activeDateChange",function(s){return t._updateActiveDate(s)})("keyup",function(s){return t._handleCalendarBodyKeyup(s)})("keydown",function(s){return t._handleCalendarBodyKeydown(s)}),u()()),a&2&&(h(4),v("label",t._yearLabel)("rows",t._months)("todayValue",t._todayMonth)("startValue",t._selectedMonth)("endValue",t._selectedMonth)("labelMinRequiredCells",2)("numCols",4)("cellAspectRatio",4/7)("activeCell",t._dateAdapter.getMonth(t.activeDate)))},dependencies:[re],encapsulation:2,changeDetection:0});let r=i;return r})(),ja=1,Ha=(()=>{let i=class i{constructor(e,a,t,n,s){this._intl=e,this.calendar=a,this._dateAdapter=t,this._dateFormats=n,this._id=`mat-calendar-header-${ja++}`,this._periodButtonLabelId=`${this._id}-period-label`,this.calendar.stateChanges.subscribe(()=>s.markForCheck())}get periodButtonText(){return this.calendar.currentView=="month"?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():this.calendar.currentView=="year"?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRange(...this._formatMinAndMaxYearLabels())}get periodButtonDescription(){return this.calendar.currentView=="month"?this._dateAdapter.format(this.calendar.activeDate,this._dateFormats.display.monthYearLabel).toLocaleUpperCase():this.calendar.currentView=="year"?this._dateAdapter.getYearName(this.calendar.activeDate):this._intl.formatYearRangeLabel(...this._formatMinAndMaxYearLabels())}get periodButtonLabel(){return this.calendar.currentView=="month"?this._intl.switchToMultiYearViewLabel:this._intl.switchToMonthViewLabel}get prevButtonLabel(){return{month:this._intl.prevMonthLabel,year:this._intl.prevYearLabel,"multi-year":this._intl.prevMultiYearLabel}[this.calendar.currentView]}get nextButtonLabel(){return{month:this._intl.nextMonthLabel,year:this._intl.nextYearLabel,"multi-year":this._intl.nextMultiYearLabel}[this.calendar.currentView]}currentPeriodClicked(){this.calendar.currentView=this.calendar.currentView=="month"?"multi-year":"month"}previousClicked(){this.calendar.activeDate=this.calendar.currentView=="month"?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,-1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,this.calendar.currentView=="year"?-1:-M)}nextClicked(){this.calendar.activeDate=this.calendar.currentView=="month"?this._dateAdapter.addCalendarMonths(this.calendar.activeDate,1):this._dateAdapter.addCalendarYears(this.calendar.activeDate,this.calendar.currentView=="year"?1:M)}previousEnabled(){return this.calendar.minDate?!this.calendar.minDate||!this._isSameView(this.calendar.activeDate,this.calendar.minDate):!0}nextEnabled(){return!this.calendar.maxDate||!this._isSameView(this.calendar.activeDate,this.calendar.maxDate)}_isSameView(e,a){return this.calendar.currentView=="month"?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(a)&&this._dateAdapter.getMonth(e)==this._dateAdapter.getMonth(a):this.calendar.currentView=="year"?this._dateAdapter.getYear(e)==this._dateAdapter.getYear(a):ra(this._dateAdapter,e,a,this.calendar.minDate,this.calendar.maxDate)}_formatMinAndMaxYearLabels(){let a=this._dateAdapter.getYear(this.calendar.activeDate)-fe(this._dateAdapter,this.calendar.activeDate,this.calendar.minDate,this.calendar.maxDate),t=a+M-1,n=this._dateAdapter.getYearName(this._dateAdapter.createDate(a,0,1)),s=this._dateAdapter.getYearName(this._dateAdapter.createDate(t,0,1));return[n,s]}};i.\u0275fac=function(a){return new(a||i)(o(ye),o(ke(()=>_t)),o(_,8),o(T,8),o(P))},i.\u0275cmp=y({type:i,selectors:[["mat-calendar-header"]],exportAs:["matCalendarHeader"],ngContentSelectors:ia,decls:13,vars:11,consts:[[1,"mat-calendar-header"],[1,"mat-calendar-controls"],["mat-button","","type","button","aria-live","polite",1,"mat-calendar-period-button",3,"click"],["aria-hidden","true"],["viewBox","0 0 10 5","focusable","false","aria-hidden","true",1,"mat-calendar-arrow"],["points","0,0 5,5 10,0"],[1,"mat-calendar-spacer"],["mat-icon-button","","type","button",1,"mat-calendar-previous-button",3,"disabled","click"],["mat-icon-button","","type","button",1,"mat-calendar-next-button",3,"disabled","click"],[1,"mat-calendar-hidden-label",3,"id"]],template:function(a,t){a&1&&(ue(),c(0,"div",0)(1,"div",1)(2,"button",2),g("click",function(){return t.currentPeriodClicked()}),c(3,"span",3),D(4),u(),Ue(),c(5,"svg",4),$(6,"polygon",5),u()(),Ct(),$(7,"div",6),ee(8),c(9,"button",7),g("click",function(){return t.previousClicked()}),u(),c(10,"button",8),g("click",function(){return t.nextClicked()}),u()()(),c(11,"label",9),D(12),u()),a&2&&(h(2),b("aria-label",t.periodButtonLabel)("aria-describedby",t._periodButtonLabelId),h(2),Y(t.periodButtonText),h(1),F("mat-calendar-invert",t.calendar.currentView!=="month"),h(4),v("disabled",!t.previousEnabled()),b("aria-label",t.prevButtonLabel),h(1),v("disabled",!t.nextEnabled()),b("aria-label",t.nextButtonLabel),h(1),v("id",t._periodButtonLabelId),h(1),Y(t.periodButtonDescription))},dependencies:[st,dt],encapsulation:2,changeDetection:0});let r=i;return r})(),_t=(()=>{let i=class i{get startAt(){return this._startAt}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get selected(){return this._selected}set selected(e){e instanceof f?this._selected=e:this._selected=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get minDate(){return this._minDate}set minDate(e){this._minDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get maxDate(){return this._maxDate}set maxDate(e){this._maxDate=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get activeDate(){return this._clampedActiveDate}set activeDate(e){this._clampedActiveDate=this._dateAdapter.clampDate(e,this.minDate,this.maxDate),this.stateChanges.next(),this._changeDetectorRef.markForCheck()}get currentView(){return this._currentView}set currentView(e){let a=this._currentView!==e?e:null;this._currentView=e,this._moveFocusOnNextTick=!0,this._changeDetectorRef.markForCheck(),a&&this.viewChanged.emit(a)}constructor(e,a,t,n){this._dateAdapter=a,this._dateFormats=t,this._changeDetectorRef=n,this._moveFocusOnNextTick=!1,this.startView="month",this.selectedChange=new p,this.yearSelected=new p,this.monthSelected=new p,this.viewChanged=new p(!0),this._userSelection=new p,this._userDragDrop=new p,this._activeDrag=null,this.stateChanges=new B,this._intlChanges=e.changes.subscribe(()=>{n.markForCheck(),this.stateChanges.next()})}ngAfterContentInit(){this._calendarHeaderPortal=new it(this.headerComponent||Ha),this.activeDate=this.startAt||this._dateAdapter.today(),this._currentView=this.startView}ngAfterViewChecked(){this._moveFocusOnNextTick&&(this._moveFocusOnNextTick=!1,this.focusActiveCell())}ngOnDestroy(){this._intlChanges.unsubscribe(),this.stateChanges.complete()}ngOnChanges(e){let a=e.minDate&&!this._dateAdapter.sameDate(e.minDate.previousValue,e.minDate.currentValue)?e.minDate:void 0,t=e.maxDate&&!this._dateAdapter.sameDate(e.maxDate.previousValue,e.maxDate.currentValue)?e.maxDate:void 0,n=a||t||e.dateFilter;if(n&&!n.firstChange){let s=this._getCurrentViewComponent();s&&(this._changeDetectorRef.detectChanges(),s._init())}this.stateChanges.next()}focusActiveCell(){this._getCurrentViewComponent()._focusActiveCell(!1)}updateTodaysDate(){this._getCurrentViewComponent()._init()}_dateSelected(e){let a=e.value;(this.selected instanceof f||a&&!this._dateAdapter.sameDate(a,this.selected))&&this.selectedChange.emit(a),this._userSelection.emit(e)}_yearSelectedInMultiYearView(e){this.yearSelected.emit(e)}_monthSelectedInYearView(e){this.monthSelected.emit(e)}_goToDateInView(e,a){this.activeDate=e,this.currentView=a}_dragStarted(e){this._activeDrag=e}_dragEnded(e){this._activeDrag&&(e.value&&this._userDragDrop.emit(e),this._activeDrag=null)}_getCurrentViewComponent(){return this.monthView||this.yearView||this.multiYearView}};i.\u0275fac=function(a){return new(a||i)(o(ye),o(_,8),o(T,8),o(P))},i.\u0275cmp=y({type:i,selectors:[["mat-calendar"]],viewQuery:function(a,t){if(a&1&&(R(Xt,5),R(Jt,5),R(Zt,5)),a&2){let n;w(n=k())&&(t.monthView=n.first),w(n=k())&&(t.yearView=n.first),w(n=k())&&(t.multiYearView=n.first)}},hostAttrs:[1,"mat-calendar"],inputs:{headerComponent:"headerComponent",startAt:"startAt",startView:"startView",selected:"selected",minDate:"minDate",maxDate:"maxDate",dateFilter:"dateFilter",dateClass:"dateClass",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd",startDateAccessibleName:"startDateAccessibleName",endDateAccessibleName:"endDateAccessibleName"},outputs:{selectedChange:"selectedChange",yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",_userSelection:"_userSelection",_userDragDrop:"_userDragDrop"},exportAs:["matCalendar"],features:[K([na]),j],decls:5,vars:2,consts:[[3,"cdkPortalOutlet"],["cdkMonitorSubtreeFocus","","tabindex","-1",1,"mat-calendar-content"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","activeDrag","activeDateChange","_userSelection","dragStarted","dragEnded"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","monthSelected","selectedChange"],[3,"activeDate","selected","dateFilter","maxDate","minDate","dateClass","activeDateChange","yearSelected","selectedChange"]],template:function(a,t){if(a&1&&(z(0,ba,0,0,"ng-template",0),c(1,"div",1),z(2,Da,1,11)(3,ya,1,6)(4,Ca,1,6),u()),a&2){let n;v("cdkPortalOutlet",t._calendarHeaderPortal),h(2),ce(2,(n=t.currentView)==="month"?2:n==="year"?3:n==="multi-year"?4:-1)}},dependencies:[at,nt,Xt,Jt,Zt],styles:['.mat-calendar{display:block;font-family:var(--mat-datepicker-calendar-text-font);font-size:var(--mat-datepicker-calendar-text-size)}.mat-calendar-header{padding:8px 8px 0 8px}.mat-calendar-content{padding:0 8px 8px 8px;outline:none}.mat-calendar-controls{display:flex;align-items:center;margin:5% calc(4.7142857143% - 16px)}.mat-calendar-spacer{flex:1 1 auto}.mat-calendar-period-button{min-width:0;margin:0 8px;font-size:var(--mat-datepicker-calendar-period-button-text-size);font-weight:var(--mat-datepicker-calendar-period-button-text-weight)}.mat-calendar-arrow{display:inline-block;width:10px;height:5px;margin:0 0 0 5px;vertical-align:middle;fill:var(--mat-datepicker-calendar-period-button-icon-color)}.mat-calendar-arrow.mat-calendar-invert{transform:rotate(180deg)}[dir=rtl] .mat-calendar-arrow{margin:0 5px 0 0}.cdk-high-contrast-active .mat-calendar-arrow{fill:CanvasText}.mat-calendar-previous-button,.mat-calendar-next-button{position:relative}.mat-datepicker-content .mat-calendar-previous-button,.mat-datepicker-content .mat-calendar-next-button{color:var(--mat-datepicker-calendar-navigation-button-icon-color)}.mat-calendar-previous-button::after,.mat-calendar-next-button::after{top:0;left:0;right:0;bottom:0;position:absolute;content:"";margin:15.5px;border:0 solid currentColor;border-top-width:2px}[dir=rtl] .mat-calendar-previous-button,[dir=rtl] .mat-calendar-next-button{transform:rotate(180deg)}.mat-calendar-previous-button::after{border-left-width:2px;transform:translateX(2px) rotate(-45deg)}.mat-calendar-next-button::after{border-right-width:2px;transform:translateX(-2px) rotate(45deg)}.mat-calendar-table{border-spacing:0;border-collapse:collapse;width:100%}.mat-calendar-table-header th{text-align:center;padding:0 0 8px 0;color:var(--mat-datepicker-calendar-header-text-color);font-size:var(--mat-datepicker-calendar-header-text-size);font-weight:var(--mat-datepicker-calendar-header-text-weight)}.mat-calendar-table-header-divider{position:relative;height:1px}.mat-calendar-table-header-divider::after{content:"";position:absolute;top:0;left:-8px;right:-8px;height:1px;background:var(--mat-datepicker-calendar-header-divider-color)}.mat-calendar-body-cell-content::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}.mat-calendar-body-cell:focus .mat-focus-indicator::before{content:""}.mat-calendar-hidden-label{display:none}'],encapsulation:2,changeDetection:0});let r=i;return r})(),ea={transformPanel:Je("transformPanel",[me("void => enter-dropdown",pe("120ms cubic-bezier(0, 0, 0.2, 1)",tt([Q({opacity:0,transform:"scale(1, 0.8)"}),Q({opacity:1,transform:"scale(1, 1)"})]))),me("void => enter-dialog",pe("150ms cubic-bezier(0, 0, 0.2, 1)",tt([Q({opacity:0,transform:"scale(0.7)"}),Q({transform:"none",opacity:1})]))),me("* => void",pe("100ms linear",Q({opacity:0})))]),fadeInCalendar:Je("fadeInCalendar",[et("void",Q({opacity:0})),et("enter",Q({opacity:1})),me("void => *",pe("120ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)"))])},za=0,da=new Me("mat-datepicker-scroll-strategy",{providedIn:"root",factory:()=>{let r=le(ge);return()=>r.scrollStrategies.reposition()}});function $a(r){return()=>r.scrollStrategies.reposition()}var Ka={provide:da,deps:[ge],useFactory:$a},Qa=$t(class{constructor(r){this._elementRef=r}}),qa=(()=>{let i=class i extends Qa{constructor(e,a,t,n,s,l){super(e),this._changeDetectorRef=a,this._globalModel=t,this._dateAdapter=n,this._rangeSelectionStrategy=s,this._subscriptions=new E,this._animationDone=new B,this._isAnimating=!1,this._actionsPortal=null,this._closeButtonText=l.closeCalendarLabel}ngOnInit(){this._animationState=this.datepicker.touchUi?"enter-dialog":"enter-dropdown"}ngAfterViewInit(){this._subscriptions.add(this.datepicker.stateChanges.subscribe(()=>{this._changeDetectorRef.markForCheck()})),this._calendar.focusActiveCell()}ngOnDestroy(){this._subscriptions.unsubscribe(),this._animationDone.complete()}_handleUserSelection(e){let a=this._model.selection,t=e.value,n=a instanceof f;if(n&&this._rangeSelectionStrategy){let s=this._rangeSelectionStrategy.selectionFinished(t,a,e.event);this._model.updateSelection(s,this)}else t&&(n||!this._dateAdapter.sameDate(t,a))&&this._model.add(t);(!this._model||this._model.isComplete())&&!this._actionsPortal&&this.datepicker.close()}_handleUserDragDrop(e){this._model.updateSelection(e.value,this)}_startExitAnimation(){this._animationState="void",this._changeDetectorRef.markForCheck()}_handleAnimationEvent(e){this._isAnimating=e.phaseName==="start",this._isAnimating||this._animationDone.next()}_getSelected(){return this._model.selection}_applyPendingSelection(){this._model!==this._globalModel&&this._globalModel.updateSelection(this._model.selection,this)}_assignActions(e,a){this._model=e?this._globalModel.clone():this._globalModel,this._actionsPortal=e,a&&this._changeDetectorRef.detectChanges()}};i.\u0275fac=function(a){return new(a||i)(o(O),o(P),o(U),o(_),o($e,8),o(ye))},i.\u0275cmp=y({type:i,selectors:[["mat-datepicker-content"]],viewQuery:function(a,t){if(a&1&&R(_t,5),a&2){let n;w(n=k())&&(t._calendar=n.first)}},hostAttrs:[1,"mat-datepicker-content"],hostVars:3,hostBindings:function(a,t){a&1&&Mt("@transformPanel.start",function(s){return t._handleAnimationEvent(s)})("@transformPanel.done",function(s){return t._handleAnimationEvent(s)}),a&2&&(kt("@transformPanel",t._animationState),F("mat-datepicker-content-touch",t.datepicker.touchUi))},inputs:{color:"color"},exportAs:["matDatepickerContent"],features:[H],decls:5,vars:26,consts:[["cdkTrapFocus","","role","dialog",1,"mat-datepicker-content-container"],[3,"id","ngClass","startAt","startView","minDate","maxDate","dateFilter","headerComponent","selected","dateClass","comparisonStart","comparisonEnd","startDateAccessibleName","endDateAccessibleName","yearSelected","monthSelected","viewChanged","_userSelection","_userDragDrop"],[3,"cdkPortalOutlet"],["type","button","mat-raised-button","",1,"mat-datepicker-close-button",3,"color","focus","blur","click"]],template:function(a,t){if(a&1&&(c(0,"div",0)(1,"mat-calendar",1),g("yearSelected",function(s){return t.datepicker._selectYear(s)})("monthSelected",function(s){return t.datepicker._selectMonth(s)})("viewChanged",function(s){return t.datepicker._viewChanged(s)})("_userSelection",function(s){return t._handleUserSelection(s)})("_userDragDrop",function(s){return t._handleUserDragDrop(s)}),u(),z(2,Aa,0,0,"ng-template",2),c(3,"button",3),g("focus",function(){return t._closeButtonFocused=!0})("blur",function(){return t._closeButtonFocused=!1})("click",function(){return t.datepicker.close()}),D(4),u()()),a&2){let n;F("mat-datepicker-content-container-with-custom-header",t.datepicker.calendarHeaderComponent)("mat-datepicker-content-container-with-actions",t._actionsPortal),b("aria-modal",!0)("aria-labelledby",(n=t._dialogLabelId)!==null&&n!==void 0?n:void 0),h(1),v("id",t.datepicker.id)("ngClass",t.datepicker.panelClass)("startAt",t.datepicker.startAt)("startView",t.datepicker.startView)("minDate",t.datepicker._getMinDate())("maxDate",t.datepicker._getMaxDate())("dateFilter",t.datepicker._getDateFilter())("headerComponent",t.datepicker.calendarHeaderComponent)("selected",t._getSelected())("dateClass",t.datepicker.dateClass)("comparisonStart",t.comparisonStart)("comparisonEnd",t.comparisonEnd)("@fadeInCalendar","enter")("startDateAccessibleName",t.startDateAccessibleName)("endDateAccessibleName",t.endDateAccessibleName),h(1),v("cdkPortalOutlet",t._actionsPortal),h(1),F("cdk-visually-hidden",!t._closeButtonFocused),v("color",t.color||"primary"),h(1),Y(t._closeButtonText)}},dependencies:[Ze,st,Ot,nt,_t],styles:[".mat-datepicker-content{box-shadow:0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);display:block;border-radius:4px;background-color:var(--mat-datepicker-calendar-container-background-color);color:var(--mat-datepicker-calendar-container-text-color)}.mat-datepicker-content .mat-calendar{width:296px;height:354px}.mat-datepicker-content .mat-datepicker-content-container-with-custom-header .mat-calendar{height:auto}.mat-datepicker-content .mat-datepicker-close-button{position:absolute;top:100%;left:0;margin-top:8px}.ng-animating .mat-datepicker-content .mat-datepicker-close-button{display:none}.mat-datepicker-content-container{display:flex;flex-direction:column;justify-content:space-between}.mat-datepicker-content-touch{box-shadow:0px 11px 15px -7px rgba(0, 0, 0, 0.2), 0px 24px 38px 3px rgba(0, 0, 0, 0.14), 0px 9px 46px 8px rgba(0, 0, 0, 0.12);display:block;max-height:80vh;position:relative;overflow:visible}.mat-datepicker-content-touch .mat-datepicker-content-container{min-height:312px;max-height:788px;min-width:250px;max-width:750px}.mat-datepicker-content-touch .mat-calendar{width:100%;height:auto}@media all and (orientation: landscape){.mat-datepicker-content-touch .mat-datepicker-content-container{width:64vh;height:80vh}}@media all and (orientation: portrait){.mat-datepicker-content-touch .mat-datepicker-content-container{width:80vw;height:100vw}.mat-datepicker-content-touch .mat-datepicker-content-container-with-actions{height:115vw}}"],encapsulation:2,data:{animation:[ea.transformPanel,ea.fadeInCalendar]},changeDetection:0});let r=i;return r})(),Z=(()=>{let i=class i{get startAt(){return this._startAt||(this.datepickerInput?this.datepickerInput.getStartValue():null)}set startAt(e){this._startAt=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e))}get color(){return this._color||(this.datepickerInput?this.datepickerInput.getThemePalette():void 0)}set color(e){this._color=e}get touchUi(){return this._touchUi}set touchUi(e){this._touchUi=N(e)}get disabled(){return this._disabled===void 0&&this.datepickerInput?this.datepickerInput.disabled:!!this._disabled}set disabled(e){let a=N(e);a!==this._disabled&&(this._disabled=a,this.stateChanges.next(void 0))}get restoreFocus(){return this._restoreFocus}set restoreFocus(e){this._restoreFocus=N(e)}get panelClass(){return this._panelClass}set panelClass(e){this._panelClass=Ft(e)}get opened(){return this._opened}set opened(e){N(e)?this.open():this.close()}_getMinDate(){return this.datepickerInput&&this.datepickerInput.min}_getMaxDate(){return this.datepickerInput&&this.datepickerInput.max}_getDateFilter(){return this.datepickerInput&&this.datepickerInput.dateFilter}constructor(e,a,t,n,s,l,I){this._overlay=e,this._ngZone=a,this._viewContainerRef=t,this._dateAdapter=s,this._dir=l,this._model=I,this._inputStateChanges=E.EMPTY,this._document=le(Vt),this.startView="month",this._touchUi=!1,this.xPosition="start",this.yPosition="below",this._restoreFocus=!0,this.yearSelected=new p,this.monthSelected=new p,this.viewChanged=new p(!0),this.openedStream=new p,this.closedStream=new p,this._opened=!1,this.id=`mat-datepicker-${za++}`,this._focusedElementBeforeOpen=null,this._backdropHarnessClass=`${this.id}-backdrop`,this.stateChanges=new B,this._dateAdapter,this._scrollStrategy=n}ngOnChanges(e){let a=e.xPosition||e.yPosition;if(a&&!a.firstChange&&this._overlayRef){let t=this._overlayRef.getConfig().positionStrategy;t instanceof jt&&(this._setConnectedPositions(t),this.opened&&this._overlayRef.updatePosition())}this.stateChanges.next(void 0)}ngOnDestroy(){this._destroyOverlay(),this.close(),this._inputStateChanges.unsubscribe(),this.stateChanges.complete()}select(e){this._model.add(e)}_selectYear(e){this.yearSelected.emit(e)}_selectMonth(e){this.monthSelected.emit(e)}_viewChanged(e){this.viewChanged.emit(e)}registerInput(e){return this.datepickerInput,this._inputStateChanges.unsubscribe(),this.datepickerInput=e,this._inputStateChanges=e.stateChanges.subscribe(()=>this.stateChanges.next(void 0)),this._model}registerActions(e){this._actionsPortal,this._actionsPortal=e,this._componentRef?.instance._assignActions(e,!0)}removeActions(e){e===this._actionsPortal&&(this._actionsPortal=null,this._componentRef?.instance._assignActions(null,!0))}open(){this._opened||this.disabled||this._componentRef?.instance._isAnimating||(this.datepickerInput,this._focusedElementBeforeOpen=Tt(),this._openOverlay(),this._opened=!0,this.openedStream.emit())}close(){if(!this._opened||this._componentRef?.instance._isAnimating)return;let e=this._restoreFocus&&this._focusedElementBeforeOpen&&typeof this._focusedElementBeforeOpen.focus=="function",a=()=>{this._opened&&(this._opened=!1,this.closedStream.emit())};if(this._componentRef){let{instance:t,location:n}=this._componentRef;t._startExitAnimation(),t._animationDone.pipe(Ae(1)).subscribe(()=>{let s=this._document.activeElement;e&&(!s||s===this._document.activeElement||n.nativeElement.contains(s))&&this._focusedElementBeforeOpen.focus(),this._focusedElementBeforeOpen=null,this._destroyOverlay()})}e?setTimeout(a):a()}_applyPendingSelection(){this._componentRef?.instance?._applyPendingSelection()}_forwardContentValues(e){e.datepicker=this,e.color=this.color,e._dialogLabelId=this.datepickerInput.getOverlayLabelId(),e._assignActions(this._actionsPortal,!1)}_openOverlay(){this._destroyOverlay();let e=this.touchUi,a=new it(qa,this._viewContainerRef),t=this._overlayRef=this._overlay.create(new Bt({positionStrategy:e?this._getDialogStrategy():this._getDropdownStrategy(),hasBackdrop:!0,backdropClass:[e?"cdk-overlay-dark-backdrop":"mat-overlay-transparent-backdrop",this._backdropHarnessClass],direction:this._dir,scrollStrategy:e?this._overlay.scrollStrategies.block():this._scrollStrategy(),panelClass:`mat-datepicker-${e?"dialog":"popup"}`}));this._getCloseStream(t).subscribe(n=>{n&&n.preventDefault(),this.close()}),t.keydownEvents().subscribe(n=>{let s=n.keyCode;(s===38||s===40||s===37||s===39||s===33||s===34)&&n.preventDefault()}),this._componentRef=t.attach(a),this._forwardContentValues(this._componentRef.instance),e||this._ngZone.onStable.pipe(Ae(1)).subscribe(()=>t.updatePosition())}_destroyOverlay(){this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=this._componentRef=null)}_getDialogStrategy(){return this._overlay.position().global().centerHorizontally().centerVertically()}_getDropdownStrategy(){let e=this._overlay.position().flexibleConnectedTo(this.datepickerInput.getConnectedOverlayOrigin()).withTransformOriginOn(".mat-datepicker-content").withFlexibleDimensions(!1).withViewportMargin(8).withLockedPosition();return this._setConnectedPositions(e)}_setConnectedPositions(e){let a=this.xPosition==="end"?"end":"start",t=a==="start"?"end":"start",n=this.yPosition==="above"?"bottom":"top",s=n==="top"?"bottom":"top";return e.withPositions([{originX:a,originY:s,overlayX:a,overlayY:n},{originX:a,originY:n,overlayX:a,overlayY:s},{originX:t,originY:s,overlayX:t,overlayY:n},{originX:t,originY:n,overlayX:t,overlayY:s}])}_getCloseStream(e){let a=["ctrlKey","shiftKey","metaKey"];return oe(e.backdropClick(),e.detachments(),e.keydownEvents().pipe(bt(t=>t.keyCode===27&&!W(t)||this.datepickerInput&&W(t,"altKey")&&t.keyCode===38&&a.every(n=>!W(t,n)))))}};i.\u0275fac=function(a){return new(a||i)(o(ge),o(We),o(Xe),o(da),o(_,8),o(X,8),o(U))},i.\u0275dir=x({type:i,inputs:{calendarHeaderComponent:"calendarHeaderComponent",startAt:"startAt",startView:"startView",color:"color",touchUi:"touchUi",disabled:"disabled",xPosition:"xPosition",yPosition:"yPosition",restoreFocus:"restoreFocus",dateClass:"dateClass",panelClass:"panelClass",opened:"opened"},outputs:{yearSelected:"yearSelected",monthSelected:"monthSelected",viewChanged:"viewChanged",openedStream:"opened",closedStream:"closed"},features:[j]});let r=i;return r})(),$i=(()=>{let i=class i extends Z{};i.\u0275fac=(()=>{let e;return function(t){return(e||(e=Ge(i)))(t||i)}})(),i.\u0275cmp=y({type:i,selectors:[["mat-datepicker"]],exportAs:["matDatepicker"],features:[K([na,{provide:Z,useExisting:i}]),H],decls:0,vars:0,template:function(a,t){},encapsulation:2,changeDetection:0});let r=i;return r})(),ae=class{constructor(i,d){this.target=i,this.targetElement=d,this.value=this.target.value}},oa=(()=>{let i=class i{get value(){return this._model?this._getValueFromModel(this._model.selection):this._pendingValue}set value(e){this._assignValueProgrammatically(e)}get disabled(){return!!this._disabled||this._parentDisabled()}set disabled(e){let a=N(e),t=this._elementRef.nativeElement;this._disabled!==a&&(this._disabled=a,this.stateChanges.next(void 0)),a&&this._isInitialized&&t.blur&&t.blur()}_getValidators(){return[this._parseValidator,this._minValidator,this._maxValidator,this._filterValidator]}_registerModel(e){this._model=e,this._valueChangesSubscription.unsubscribe(),this._pendingValue&&this._assignValue(this._pendingValue),this._valueChangesSubscription=this._model.selectionChanged.subscribe(a=>{if(this._shouldHandleChangeEvent(a)){let t=this._getValueFromModel(a.selection);this._lastValueValid=this._isValidValue(t),this._cvaOnChange(t),this._onTouched(),this._formatValue(t),this.dateInput.emit(new ae(this,this._elementRef.nativeElement)),this.dateChange.emit(new ae(this,this._elementRef.nativeElement))}})}constructor(e,a,t){this._elementRef=e,this._dateAdapter=a,this._dateFormats=t,this.dateChange=new p,this.dateInput=new p,this.stateChanges=new B,this._onTouched=()=>{},this._validatorOnChange=()=>{},this._cvaOnChange=()=>{},this._valueChangesSubscription=E.EMPTY,this._localeSubscription=E.EMPTY,this._parseValidator=()=>this._lastValueValid?null:{matDatepickerParse:{text:this._elementRef.nativeElement.value}},this._filterValidator=n=>{let s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(n.value));return!s||this._matchesFilter(s)?null:{matDatepickerFilter:!0}},this._minValidator=n=>{let s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(n.value)),l=this._getMinDate();return!l||!s||this._dateAdapter.compareDate(l,s)<=0?null:{matDatepickerMin:{min:l,actual:s}}},this._maxValidator=n=>{let s=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(n.value)),l=this._getMaxDate();return!l||!s||this._dateAdapter.compareDate(l,s)>=0?null:{matDatepickerMax:{max:l,actual:s}}},this._lastValueValid=!1,this._localeSubscription=a.localeChanges.subscribe(()=>{this._assignValueProgrammatically(this.value)})}ngAfterViewInit(){this._isInitialized=!0}ngOnChanges(e){la(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._valueChangesSubscription.unsubscribe(),this._localeSubscription.unsubscribe(),this.stateChanges.complete()}registerOnValidatorChange(e){this._validatorOnChange=e}validate(e){return this._validator?this._validator(e):null}writeValue(e){this._assignValueProgrammatically(e)}registerOnChange(e){this._cvaOnChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e}_onKeydown(e){let a=["ctrlKey","shiftKey","metaKey"];W(e,"altKey")&&e.keyCode===40&&a.every(n=>!W(e,n))&&!this._elementRef.nativeElement.readOnly&&(this._openPopup(),e.preventDefault())}_onInput(e){let a=this._lastValueValid,t=this._dateAdapter.parse(e,this._dateFormats.parse.dateInput);this._lastValueValid=this._isValidValue(t),t=this._dateAdapter.getValidDateOrNull(t);let n=!this._dateAdapter.sameDate(t,this.value);!t||n?this._cvaOnChange(t):(e&&!this.value&&this._cvaOnChange(t),a!==this._lastValueValid&&this._validatorOnChange()),n&&(this._assignValue(t),this.dateInput.emit(new ae(this,this._elementRef.nativeElement)))}_onChange(){this.dateChange.emit(new ae(this,this._elementRef.nativeElement))}_onBlur(){this.value&&this._formatValue(this.value),this._onTouched()}_formatValue(e){this._elementRef.nativeElement.value=e!=null?this._dateAdapter.format(e,this._dateFormats.display.dateInput):""}_assignValue(e){this._model?(this._assignValueToModel(e),this._pendingValue=null):this._pendingValue=e}_isValidValue(e){return!e||this._dateAdapter.isValid(e)}_parentDisabled(){return!1}_assignValueProgrammatically(e){e=this._dateAdapter.deserialize(e),this._lastValueValid=this._isValidValue(e),e=this._dateAdapter.getValidDateOrNull(e),this._assignValue(e),this._formatValue(e)}_matchesFilter(e){let a=this._getDateFilter();return!a||a(e)}};i.\u0275fac=function(a){return new(a||i)(o(O),o(_,8),o(T,8))},i.\u0275dir=x({type:i,inputs:{value:"value",disabled:"disabled"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[j]});let r=i;return r})();function la(r,i){let d=Object.keys(r);for(let e of d){let{previousValue:a,currentValue:t}=r[e];if(i.isDateInstance(a)&&i.isDateInstance(t)){if(!i.sameDate(a,t))return!0}else return!0}return!1}var Ua={provide:Ye,useExisting:ke(()=>ca),multi:!0},Ga={provide:Ne,useExisting:ke(()=>ca),multi:!0},ca=(()=>{let i=class i extends oa{set matDatepicker(e){e&&(this._datepicker=e,this._closedSubscription=e.closedStream.subscribe(()=>this._onTouched()),this._registerModel(e.registerInput(this)))}get min(){return this._min}set min(e){let a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._min)||(this._min=a,this._validatorOnChange())}get max(){return this._max}set max(e){let a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._max)||(this._max=a,this._validatorOnChange())}get dateFilter(){return this._dateFilter}set dateFilter(e){let a=this._matchesFilter(this.value);this._dateFilter=e,this._matchesFilter(this.value)!==a&&this._validatorOnChange()}constructor(e,a,t,n){super(e,a,t),this._formField=n,this._closedSubscription=E.EMPTY,this._validator=_e.compose(super._getValidators())}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getOverlayLabelId(){return this._formField?this._formField.getLabelId():this._elementRef.nativeElement.getAttribute("aria-labelledby")}getThemePalette(){return this._formField?this._formField.color:void 0}getStartValue(){return this.value}ngOnDestroy(){super.ngOnDestroy(),this._closedSubscription.unsubscribe()}_openPopup(){this._datepicker&&this._datepicker.open()}_getValueFromModel(e){return e}_assignValueToModel(e){this._model&&this._model.updateSelection(e,this)}_getMinDate(){return this._min}_getMaxDate(){return this._max}_getDateFilter(){return this._dateFilter}_shouldHandleChangeEvent(e){return e.source!==this}};i.\u0275fac=function(a){return new(a||i)(o(O),o(_,8),o(T,8),o(rt,8))},i.\u0275dir=x({type:i,selectors:[["input","matDatepicker",""]],hostAttrs:[1,"mat-datepicker-input"],hostVars:6,hostBindings:function(a,t){a&1&&g("input",function(s){return t._onInput(s.target.value)})("change",function(){return t._onChange()})("blur",function(){return t._onBlur()})("keydown",function(s){return t._onKeydown(s)}),a&2&&(Oe("disabled",t.disabled),b("aria-haspopup",t._datepicker?"dialog":null)("aria-owns",(t._datepicker==null?null:t._datepicker.opened)&&t._datepicker.id||null)("min",t.min?t._dateAdapter.toIso8601(t.min):null)("max",t.max?t._dateAdapter.toIso8601(t.max):null)("data-mat-calendar",t._datepicker?t._datepicker.id:null))},inputs:{matDatepicker:"matDatepicker",min:"min",max:"max",dateFilter:["matDatepickerFilter","dateFilter"]},exportAs:["matDatepickerInput"],features:[K([Ua,Ga,{provide:Ut,useExisting:i}]),H]});let r=i;return r})(),Wa=(()=>{let i=class i{};i.\u0275fac=function(a){return new(a||i)},i.\u0275dir=x({type:i,selectors:[["","matDatepickerToggleIcon",""]]});let r=i;return r})(),Ki=(()=>{let i=class i{get disabled(){return this._disabled===void 0&&this.datepicker?this.datepicker.disabled:!!this._disabled}set disabled(e){this._disabled=N(e)}constructor(e,a,t){this._intl=e,this._changeDetectorRef=a,this._stateChanges=E.EMPTY;let n=Number(t);this.tabIndex=n||n===0?n:null}ngOnChanges(e){e.datepicker&&this._watchStateChanges()}ngOnDestroy(){this._stateChanges.unsubscribe()}ngAfterContentInit(){this._watchStateChanges()}_open(e){this.datepicker&&!this.disabled&&(this.datepicker.open(),e.stopPropagation())}_watchStateChanges(){let e=this.datepicker?this.datepicker.stateChanges:Ce(),a=this.datepicker&&this.datepicker.datepickerInput?this.datepicker.datepickerInput.stateChanges:Ce(),t=this.datepicker?oe(this.datepicker.openedStream,this.datepicker.closedStream):Ce();this._stateChanges.unsubscribe(),this._stateChanges=oe(this._intl.changes,e,a,t).subscribe(()=>this._changeDetectorRef.markForCheck())}};i.\u0275fac=function(a){return new(a||i)(o(ye),o(P),At("tabindex"))},i.\u0275cmp=y({type:i,selectors:[["mat-datepicker-toggle"]],contentQueries:function(a,t,n){if(a&1&&Pe(n,Wa,5),a&2){let s;w(s=k())&&(t._customIcon=s.first)}},viewQuery:function(a,t){if(a&1&&R(wa,5),a&2){let n;w(n=k())&&(t._button=n.first)}},hostAttrs:[1,"mat-datepicker-toggle"],hostVars:8,hostBindings:function(a,t){a&1&&g("click",function(s){return t._open(s)}),a&2&&(b("tabindex",null)("data-mat-calendar",t.datepicker?t.datepicker.id:null),F("mat-datepicker-toggle-active",t.datepicker&&t.datepicker.opened)("mat-accent",t.datepicker&&t.datepicker.color==="accent")("mat-warn",t.datepicker&&t.datepicker.color==="warn"))},inputs:{datepicker:["for","datepicker"],tabIndex:"tabIndex",ariaLabel:["aria-label","ariaLabel"],disabled:"disabled",disableRipple:"disableRipple"},exportAs:["matDatepickerToggle"],features:[j],ngContentSelectors:Ia,decls:4,vars:6,consts:[["mat-icon-button","","type","button",3,"disabled","disableRipple"],["button",""],["class","mat-datepicker-toggle-default-icon","viewBox","0 0 24 24","width","24px","height","24px","fill","currentColor","focusable","false","aria-hidden","true"],["viewBox","0 0 24 24","width","24px","height","24px","fill","currentColor","focusable","false","aria-hidden","true",1,"mat-datepicker-toggle-default-icon"],["d","M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"]],template:function(a,t){a&1&&(ue(Ma),c(0,"button",0,1),z(2,ka,2,0,":svg:svg",2),ee(3),u()),a&2&&(v("disabled",t.disabled)("disableRipple",t.disableRipple),b("aria-haspopup",t.datepicker?"dialog":null)("aria-label",t.ariaLabel||t._intl.openCalendarLabel)("tabindex",t.disabled?-1:t.tabIndex),h(2),ce(2,t._customIcon?-1:2))},dependencies:[dt],styles:[".mat-datepicker-toggle{pointer-events:auto;color:var(--mat-datepicker-toggle-icon-color)}.mat-datepicker-toggle-active{color:var(--mat-datepicker-toggle-active-state-icon-color)}.cdk-high-contrast-active .mat-datepicker-toggle-default-icon{color:CanvasText}"],encapsulation:2,changeDetection:0});let r=i;return r})();function Xa(r){return gt(r,!0)}function ta(r){return r.nodeType===Node.ELEMENT_NODE}function Za(r){return r.nodeName==="INPUT"}function Ja(r){return r.nodeName==="TEXTAREA"}function gt(r,i){if(ta(r)&&i){let e=(r.getAttribute?.("aria-labelledby")?.split(/\s+/g)||[]).reduce((a,t)=>{let n=document.getElementById(t);return n&&a.push(n),a},[]);if(e.length)return e.map(a=>gt(a,!1)).join(" ")}if(ta(r)){let d=r.getAttribute("aria-label")?.trim();if(d)return d}if(Za(r)||Ja(r)){if(r.labels?.length)return Array.from(r.labels).map(a=>gt(a,!1)).join(" ");let d=r.getAttribute("placeholder")?.trim();if(d)return d;let e=r.getAttribute("title")?.trim();if(e)return e}return(r.textContent||"").replace(/\s+/g," ").trim()}var qe=new Me("MAT_DATE_RANGE_INPUT_PARENT"),ei=(()=>{let i=class i extends oa{constructor(e,a,t,n,s,l,I,V){super(a,I,V),this._rangeInput=e,this._elementRef=a,this._defaultErrorStateMatcher=t,this._injector=n,this._parentForm=s,this._parentFormGroup=l,this._dir=le(X,{optional:!0})}ngOnInit(){let e=this._injector.get(xt,null,{optional:!0,self:!0});e&&(this.ngControl=e)}ngDoCheck(){this.ngControl&&this.updateErrorState()}isEmpty(){return this._elementRef.nativeElement.value.length===0}_getPlaceholder(){return this._elementRef.nativeElement.placeholder}focus(){this._elementRef.nativeElement.focus()}getMirrorValue(){let e=this._elementRef.nativeElement,a=e.value;return a.length>0?a:e.placeholder}_onInput(e){super._onInput(e),this._rangeInput._handleChildValueChange()}_openPopup(){this._rangeInput._openDatepicker()}_getMinDate(){return this._rangeInput.min}_getMaxDate(){return this._rangeInput.max}_getDateFilter(){return this._rangeInput.dateFilter}_parentDisabled(){return this._rangeInput._groupDisabled}_shouldHandleChangeEvent({source:e}){return e!==this._rangeInput._startInput&&e!==this._rangeInput._endInput}_assignValueProgrammatically(e){super._assignValueProgrammatically(e),(this===this._rangeInput._startInput?this._rangeInput._endInput:this._rangeInput._startInput)?._validatorOnChange()}_getAccessibleName(){return Xa(this._elementRef.nativeElement)}};i.\u0275fac=function(a){return new(a||i)(o(qe),o(O),o(He),o(Ee),o(Le,8),o(Be,8),o(_,8),o(T,8))},i.\u0275dir=x({type:i,features:[H]});let r=i;return r})(),ha=Kt(ei),ti=(()=>{let i=class i extends ha{constructor(e,a,t,n,s,l,I,V){super(e,a,t,n,s,l,I,V),this._startValidator=L=>{let S=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(L.value)),G=this._model?this._model.selection.end:null;return!S||!G||this._dateAdapter.compareDate(S,G)<=0?null:{matStartDateInvalid:{end:G,actual:S}}},this._validator=_e.compose([...super._getValidators(),this._startValidator])}_getValueFromModel(e){return e.start}_shouldHandleChangeEvent(e){return super._shouldHandleChangeEvent(e)?e.oldValue?.start?!e.selection.start||!!this._dateAdapter.compareDate(e.oldValue.start,e.selection.start):!!e.selection.start:!1}_assignValueToModel(e){if(this._model){let a=new f(e,this._model.selection.end);this._model.updateSelection(a,this)}}_formatValue(e){super._formatValue(e),this._rangeInput._handleChildValueChange()}_onKeydown(e){let a=this._rangeInput._endInput,t=this._elementRef.nativeElement,n=this._dir?.value!=="rtl";(e.keyCode===39&&n||e.keyCode===37&&!n)&&t.selectionStart===t.value.length&&t.selectionEnd===t.value.length?(e.preventDefault(),a._elementRef.nativeElement.setSelectionRange(0,0),a.focus()):super._onKeydown(e)}};i.\u0275fac=function(a){return new(a||i)(o(qe),o(O),o(He),o(Ee),o(Le,8),o(Be,8),o(_,8),o(T,8))},i.\u0275dir=x({type:i,selectors:[["input","matStartDate",""]],hostAttrs:["type","text",1,"mat-start-date","mat-date-range-input-inner"],hostVars:5,hostBindings:function(a,t){a&1&&g("input",function(s){return t._onInput(s.target.value)})("change",function(){return t._onChange()})("keydown",function(s){return t._onKeydown(s)})("blur",function(){return t._onBlur()}),a&2&&(Oe("disabled",t.disabled),b("aria-haspopup",t._rangeInput.rangePicker?"dialog":null)("aria-owns",(t._rangeInput.rangePicker==null?null:t._rangeInput.rangePicker.opened)&&t._rangeInput.rangePicker.id||null)("min",t._getMinDate()?t._dateAdapter.toIso8601(t._getMinDate()):null)("max",t._getMaxDate()?t._dateAdapter.toIso8601(t._getMaxDate()):null))},inputs:{errorStateMatcher:"errorStateMatcher"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[K([{provide:Ye,useExisting:i,multi:!0},{provide:Ne,useExisting:i,multi:!0}]),H]});let r=i;return r})(),ai=(()=>{let i=class i extends ha{constructor(e,a,t,n,s,l,I,V){super(e,a,t,n,s,l,I,V),this._endValidator=L=>{let S=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(L.value)),G=this._model?this._model.selection.start:null;return!S||!G||this._dateAdapter.compareDate(S,G)>=0?null:{matEndDateInvalid:{start:G,actual:S}}},this._validator=_e.compose([...super._getValidators(),this._endValidator])}_getValueFromModel(e){return e.end}_shouldHandleChangeEvent(e){return super._shouldHandleChangeEvent(e)?e.oldValue?.end?!e.selection.end||!!this._dateAdapter.compareDate(e.oldValue.end,e.selection.end):!!e.selection.end:!1}_assignValueToModel(e){if(this._model){let a=new f(this._model.selection.start,e);this._model.updateSelection(a,this)}}_onKeydown(e){let a=this._rangeInput._startInput,t=this._elementRef.nativeElement,n=this._dir?.value!=="rtl";if(e.keyCode===8&&!t.value)a.focus();else if((e.keyCode===37&&n||e.keyCode===39&&!n)&&t.selectionStart===0&&t.selectionEnd===0){e.preventDefault();let s=a._elementRef.nativeElement.value.length;a._elementRef.nativeElement.setSelectionRange(s,s),a.focus()}else super._onKeydown(e)}};i.\u0275fac=function(a){return new(a||i)(o(qe),o(O),o(He),o(Ee),o(Le,8),o(Be,8),o(_,8),o(T,8))},i.\u0275dir=x({type:i,selectors:[["input","matEndDate",""]],hostAttrs:["type","text",1,"mat-end-date","mat-date-range-input-inner"],hostVars:5,hostBindings:function(a,t){a&1&&g("input",function(s){return t._onInput(s.target.value)})("change",function(){return t._onChange()})("keydown",function(s){return t._onKeydown(s)})("blur",function(){return t._onBlur()}),a&2&&(Oe("disabled",t.disabled),b("aria-haspopup",t._rangeInput.rangePicker?"dialog":null)("aria-owns",(t._rangeInput.rangePicker==null?null:t._rangeInput.rangePicker.opened)&&t._rangeInput.rangePicker.id||null)("min",t._getMinDate()?t._dateAdapter.toIso8601(t._getMinDate()):null)("max",t._getMaxDate()?t._dateAdapter.toIso8601(t._getMaxDate()):null))},inputs:{errorStateMatcher:"errorStateMatcher"},outputs:{dateChange:"dateChange",dateInput:"dateInput"},features:[K([{provide:Ye,useExisting:i,multi:!0},{provide:Ne,useExisting:i,multi:!0}]),H]});let r=i;return r})(),ii=0,Qi=(()=>{let i=class i{get value(){return this._model?this._model.selection:null}get shouldLabelFloat(){return this.focused||!this.empty}get placeholder(){let e=this._startInput?._getPlaceholder()||"",a=this._endInput?._getPlaceholder()||"";return e||a?`${e} ${this.separator} ${a}`:""}get rangePicker(){return this._rangePicker}set rangePicker(e){e&&(this._model=e.registerInput(this),this._rangePicker=e,this._closedSubscription.unsubscribe(),this._closedSubscription=e.closedStream.subscribe(()=>{this._startInput?._onTouched(),this._endInput?._onTouched()}),this._registerModel(this._model))}get required(){return this._required??(this._isTargetRequired(this)||this._isTargetRequired(this._startInput)||this._isTargetRequired(this._endInput))??!1}set required(e){this._required=N(e)}get dateFilter(){return this._dateFilter}set dateFilter(e){let a=this._startInput,t=this._endInput,n=a&&a._matchesFilter(a.value),s=t&&t._matchesFilter(a.value);this._dateFilter=e,a&&a._matchesFilter(a.value)!==n&&a._validatorOnChange(),t&&t._matchesFilter(t.value)!==s&&t._validatorOnChange()}get min(){return this._min}set min(e){let a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._min)||(this._min=a,this._revalidate())}get max(){return this._max}set max(e){let a=this._dateAdapter.getValidDateOrNull(this._dateAdapter.deserialize(e));this._dateAdapter.sameDate(a,this._max)||(this._max=a,this._revalidate())}get disabled(){return this._startInput&&this._endInput?this._startInput.disabled&&this._endInput.disabled:this._groupDisabled}set disabled(e){let a=N(e);a!==this._groupDisabled&&(this._groupDisabled=a,this.stateChanges.next(void 0))}get errorState(){return this._startInput&&this._endInput?this._startInput.errorState||this._endInput.errorState:!1}get empty(){let e=this._startInput?this._startInput.isEmpty():!1,a=this._endInput?this._endInput.isEmpty():!1;return e&&a}constructor(e,a,t,n,s){this._changeDetectorRef=e,this._elementRef=a,this._dateAdapter=n,this._formField=s,this._closedSubscription=E.EMPTY,this.id=`mat-date-range-input-${ii++}`,this.focused=!1,this.controlType="mat-date-range-input",this._groupDisabled=!1,this._ariaDescribedBy=null,this.separator="\u2013",this.comparisonStart=null,this.comparisonEnd=null,this.stateChanges=new B,s?._elementRef.nativeElement.classList.contains("mat-mdc-form-field")&&a.nativeElement.classList.add("mat-mdc-input-element","mat-mdc-form-field-input-control","mdc-text-field__input"),this.ngControl=t}setDescribedByIds(e){this._ariaDescribedBy=e.length?e.join(" "):null}onContainerClick(){!this.focused&&!this.disabled&&(!this._model||!this._model.selection.start?this._startInput.focus():this._endInput.focus())}ngAfterContentInit(){this._model&&this._registerModel(this._model),oe(this._startInput.stateChanges,this._endInput.stateChanges).subscribe(()=>{this.stateChanges.next(void 0)})}ngOnChanges(e){la(e,this._dateAdapter)&&this.stateChanges.next(void 0)}ngOnDestroy(){this._closedSubscription.unsubscribe(),this.stateChanges.complete()}getStartValue(){return this.value?this.value.start:null}getThemePalette(){return this._formField?this._formField.color:void 0}getConnectedOverlayOrigin(){return this._formField?this._formField.getConnectedOverlayOrigin():this._elementRef}getOverlayLabelId(){return this._formField?this._formField.getLabelId():null}_getInputMirrorValue(e){let a=e==="start"?this._startInput:this._endInput;return a?a.getMirrorValue():""}_shouldHidePlaceholders(){return this._startInput?!this._startInput.isEmpty():!1}_handleChildValueChange(){this.stateChanges.next(void 0),this._changeDetectorRef.markForCheck()}_openDatepicker(){this._rangePicker&&this._rangePicker.open()}_shouldHideSeparator(){return(!this._formField||this._formField.getLabelId()&&!this._formField._shouldLabelFloat())&&this.empty}_getAriaLabelledby(){let e=this._formField;return e&&e._hasFloatingLabel()?e._labelId:null}_getStartDateAccessibleName(){return this._startInput._getAccessibleName()}_getEndDateAccessibleName(){return this._endInput._getAccessibleName()}_updateFocus(e){this.focused=e!==null,this.stateChanges.next()}_revalidate(){this._startInput&&this._startInput._validatorOnChange(),this._endInput&&this._endInput._validatorOnChange()}_registerModel(e){this._startInput&&this._startInput._registerModel(e),this._endInput&&this._endInput._registerModel(e)}_isTargetRequired(e){return e?.ngControl?.control?.hasValidator(_e.required)}};i.\u0275fac=function(a){return new(a||i)(o(P),o(O),o(Et,10),o(_,8),o(rt,8))},i.\u0275cmp=y({type:i,selectors:[["mat-date-range-input"]],contentQueries:function(a,t,n){if(a&1&&(Pe(n,ti,5),Pe(n,ai,5)),a&2){let s;w(s=k())&&(t._startInput=s.first),w(s=k())&&(t._endInput=s.first)}},hostAttrs:["role","group",1,"mat-date-range-input"],hostVars:8,hostBindings:function(a,t){a&2&&(b("id",t.id)("aria-labelledby",t._getAriaLabelledby())("aria-describedby",t._ariaDescribedBy)("data-mat-calendar",t.rangePicker?t.rangePicker.id:null),F("mat-date-range-input-hide-placeholders",t._shouldHidePlaceholders())("mat-date-range-input-required",t.required))},inputs:{rangePicker:"rangePicker",required:"required",dateFilter:"dateFilter",min:"min",max:"max",disabled:"disabled",separator:"separator",comparisonStart:"comparisonStart",comparisonEnd:"comparisonEnd"},exportAs:["matDateRangeInput"],features:[K([{provide:Qt,useExisting:i},{provide:qe,useExisting:i}]),j],ngContentSelectors:Sa,decls:11,vars:5,consts:[["cdkMonitorSubtreeFocus","",1,"mat-date-range-input-container",3,"cdkFocusChange"],[1,"mat-date-range-input-wrapper"],["aria-hidden","true",1,"mat-date-range-input-mirror"],[1,"mat-date-range-input-separator"],[1,"mat-date-range-input-wrapper","mat-date-range-input-end-wrapper"]],template:function(a,t){a&1&&(ue(Va),c(0,"div",0),g("cdkFocusChange",function(s){return t._updateFocus(s)}),c(1,"div",1),ee(2),c(3,"span",2),D(4),u()(),c(5,"span",3),D(6),u(),c(7,"div",4),ee(8,1),c(9,"span",2),D(10),u()()()),a&2&&(h(4),Y(t._getInputMirrorValue("start")),h(1),F("mat-date-range-input-separator-hidden",t._shouldHideSeparator()),h(1),Y(t.separator),h(4),Y(t._getInputMirrorValue("end")))},dependencies:[at],styles:[".mat-date-range-input{display:block;width:100%}.mat-date-range-input-container{display:flex;align-items:center}.mat-date-range-input-separator{transition:opacity 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);margin:0 4px;color:var(--mat-datepicker-range-input-separator-color)}.mat-form-field-disabled .mat-date-range-input-separator{color:var(--mat-datepicker-range-input-disabled-state-separator-color)}._mat-animation-noopable .mat-date-range-input-separator{transition:none}.mat-date-range-input-separator-hidden{-webkit-user-select:none;user-select:none;opacity:0;transition:none}.mat-date-range-input-wrapper{position:relative;overflow:hidden;max-width:calc(50% - 4px)}.mat-date-range-input-end-wrapper{flex-grow:1}.mat-date-range-input-inner{position:absolute;top:0;left:0;font:inherit;background:rgba(0,0,0,0);color:currentColor;border:none;outline:none;padding:0;margin:0;vertical-align:bottom;text-align:inherit;-webkit-appearance:none;width:100%;height:100%}.mat-date-range-input-inner:-moz-ui-invalid{box-shadow:none}.mat-date-range-input-inner::placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-moz-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner::-webkit-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner:-ms-input-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1)}.mat-date-range-input-inner[disabled]{color:var(--mat-datepicker-range-input-disabled-state-text-color)}.mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::-moz-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-moz-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner::-webkit-input-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner::-webkit-input-placeholder{opacity:0}.mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{-webkit-user-select:none;user-select:none;color:rgba(0,0,0,0) !important;-webkit-text-fill-color:rgba(0,0,0,0);transition:none}.cdk-high-contrast-active .mat-form-field-hide-placeholder .mat-date-range-input-inner:-ms-input-placeholder,.cdk-high-contrast-active .mat-date-range-input-hide-placeholders .mat-date-range-input-inner:-ms-input-placeholder{opacity:0}._mat-animation-noopable .mat-date-range-input-inner::placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-moz-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner::-webkit-input-placeholder{transition:none}._mat-animation-noopable .mat-date-range-input-inner:-ms-input-placeholder{transition:none}.mat-date-range-input-mirror{-webkit-user-select:none;user-select:none;visibility:hidden;white-space:nowrap;display:inline-block;min-width:2px}.mat-mdc-form-field-type-mat-date-range-input .mat-mdc-form-field-infix{width:200px}"],encapsulation:2,changeDetection:0});let r=i;return r})(),qi=(()=>{let i=class i extends Z{_forwardContentValues(e){super._forwardContentValues(e);let a=this.datepickerInput;a&&(e.comparisonStart=a.comparisonStart,e.comparisonEnd=a.comparisonEnd,e.startDateAccessibleName=a._getStartDateAccessibleName(),e.endDateAccessibleName=a._getEndDateAccessibleName())}};i.\u0275fac=(()=>{let e;return function(t){return(e||(e=Ge(i)))(t||i)}})(),i.\u0275cmp=y({type:i,selectors:[["mat-date-range-picker"]],exportAs:["matDateRangePicker"],features:[K([Pa,La,{provide:Z,useExisting:i}]),H],decls:0,vars:0,template:function(a,t){},encapsulation:2,changeDetection:0});let r=i;return r})(),Ui=(()=>{let i=class i{constructor(e){this._datepicker=e}_applySelection(){this._datepicker._applyPendingSelection(),this._datepicker.close()}};i.\u0275fac=function(a){return new(a||i)(o(Z))},i.\u0275dir=x({type:i,selectors:[["","matDatepickerApply",""],["","matDateRangePickerApply",""]],hostBindings:function(a,t){a&1&&g("click",function(){return t._applySelection()})}});let r=i;return r})(),Gi=(()=>{let i=class i{constructor(e){this._datepicker=e}};i.\u0275fac=function(a){return new(a||i)(o(Z))},i.\u0275dir=x({type:i,selectors:[["","matDatepickerCancel",""],["","matDateRangePickerCancel",""]],hostBindings:function(a,t){a&1&&g("click",function(){return t._datepicker.close()})}});let r=i;return r})(),Wi=(()=>{let i=class i{constructor(e,a){this._datepicker=e,this._viewContainerRef=a}ngAfterViewInit(){this._portal=new Nt(this._template,this._viewContainerRef),this._datepicker.registerActions(this._portal)}ngOnDestroy(){this._datepicker.removeActions(this._portal),this._portal&&this._portal.isAttached&&this._portal?.detach()}};i.\u0275fac=function(a){return new(a||i)(o(Z),o(Xe))},i.\u0275cmp=y({type:i,selectors:[["mat-datepicker-actions"],["mat-date-range-picker-actions"]],viewQuery:function(a,t){if(a&1&&R(It,5),a&2){let n;w(n=k())&&(t._template=n.first)}},ngContentSelectors:ia,decls:1,vars:0,consts:[[1,"mat-datepicker-actions"]],template:function(a,t){a&1&&(ue(),z(0,Ea,2,0,"ng-template"))},styles:[".mat-datepicker-actions{display:flex;justify-content:flex-end;align-items:center;padding:0 8px 8px 8px}.mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-datepicker-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}"],encapsulation:2,changeDetection:0});let r=i;return r})(),Xi=(()=>{let i=class i{};i.\u0275fac=function(a){return new(a||i)},i.\u0275mod=yt({type:i}),i.\u0275inj=Dt({providers:[ye,Ka],imports:[St,qt,Ht,Pt,Lt,zt,Yt]});let r=i;return r})();export{$i as a,ca as b,Ki as c,ti as d,ai as e,Qi as f,qi as g,Ui as h,Gi as i,Wi as j,Xi as k};